TextureData
Inheritance: java.lang.Object, com.aspose.threed.A3DObject
public class TextureData extends A3DObject
This class contains the raw data and format definition of a texture.
Constructors
Constructor | Description |
---|---|
TextureData(int width, int height, int stride, int bytesPerPixel, PixelFormat pixelFormat, byte[] data) | Constructor of TextureData |
TextureData(int width, int height, PixelFormat pixelFormat) | Constructs a new TextureData and allocate pixel data. |
TextureData() | Constructor of TextureData |
Methods
Method | Description |
---|---|
equals(Object arg0) | |
findProperty(String propertyName) | Finds the property. |
fromFile(String fileName) | Load a texture from file |
fromStream(Stream stream) | Load a texture from stream |
getBytesPerPixel() | Number of bytes of a pixel |
getClass() | |
getData() | Raw bytes of pixel data |
getHeight() | Number of vertical pixels |
getName() | Gets the name. |
getPixelFormat() | The pixel’s format |
getProperties() | Gets the collection of all properties. |
getProperty(String property) | Get the value of specified property |
getStride() | Number of bytes of a scanline. |
getWidth() | Number of horizontal pixels |
hashCode() | |
mapPixels(PixelMapMode mapMode) | Map all pixels for read/write |
mapPixels(PixelMapMode mapMode, PixelFormat format) | Map all pixels for read/write in given pixel format |
mapPixels(Rect rect, PixelMapMode mapMode, PixelFormat format) | Map pixels addressed by rect for reading/writing in given pixel format |
notify() | |
notifyAll() | |
removeProperty(Property property) | Removes a dynamic property. |
removeProperty(String property) | Remove the specified property identified by name |
save(Stream stream, String format) | Save texture data into specified image format |
save(String fileName) | Save texture data into image file |
save(String fileName, String format) | Save texture data into image file |
setName(String value) | Sets the name. |
setProperty(String property, Object value) | Sets the value of specified property |
toString() | |
transformPixelFormat(PixelFormat pixelFormat) | Transform pixel’s layout to new pixel format. |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
TextureData(int width, int height, int stride, int bytesPerPixel, PixelFormat pixelFormat, byte[] data)
public TextureData(int width, int height, int stride, int bytesPerPixel, PixelFormat pixelFormat, byte[] data)
Constructor of TextureData
Parameters:
Parameter | Type | Description |
---|---|---|
width | int | |
height | int | |
stride | int | |
bytesPerPixel | int | |
pixelFormat | PixelFormat | |
data | byte[] |
TextureData(int width, int height, PixelFormat pixelFormat)
public TextureData(int width, int height, PixelFormat pixelFormat)
Constructs a new TextureData and allocate pixel data.
Parameters:
Parameter | Type | Description |
---|---|---|
width | int | |
height | int | |
pixelFormat | PixelFormat |
TextureData()
public TextureData()
Constructor of TextureData
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
findProperty(String propertyName)
public Property findProperty(String propertyName)
Finds the property. It can be a dynamic property (Created by CreateDynamicProperty/SetProperty) or native property(Identified by its name)
Parameters:
Parameter | Type | Description |
---|---|---|
propertyName | java.lang.String | Property name. |
Returns: Property - The property.
fromFile(String fileName)
public static TextureData fromFile(String fileName)
Load a texture from file
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String |
Returns: TextureData
fromStream(Stream stream)
public static TextureData fromStream(Stream stream)
Load a texture from stream
Parameters:
Parameter | Type | Description |
---|---|---|
stream | Stream |
Returns: TextureData
getBytesPerPixel()
public int getBytesPerPixel()
Number of bytes of a pixel
Returns: int - Number of bytes of a pixel
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getData()
public byte[] getData()
Raw bytes of pixel data
Returns: byte[] - Raw bytes of pixel data
getHeight()
public int getHeight()
Number of vertical pixels
Returns: int - Number of vertical pixels
getName()
public String getName()
Gets the name.
Returns: java.lang.String - the name.
getPixelFormat()
public PixelFormat getPixelFormat()
The pixel’s format
Returns: PixelFormat - The pixel’s format
getProperties()
public PropertyCollection getProperties()
Gets the collection of all properties.
Returns: PropertyCollection - the collection of all properties.
getProperty(String property)
public Object getProperty(String property)
Get the value of specified property
Parameters:
Parameter | Type | Description |
---|---|---|
property | java.lang.String | Property name |
Returns: java.lang.Object - The value of the found property
getStride()
public int getStride()
Number of bytes of a scanline.
Returns: int - Number of bytes of a scanline.
getWidth()
public int getWidth()
Number of horizontal pixels
Returns: int - Number of horizontal pixels
hashCode()
public native int hashCode()
Returns: int
mapPixels(PixelMapMode mapMode)
public PixelMapping mapPixels(PixelMapMode mapMode)
Map all pixels for read/write
Parameters:
Parameter | Type | Description |
---|---|---|
mapMode | PixelMapMode | Map mode |
Returns: PixelMapping
mapPixels(PixelMapMode mapMode, PixelFormat format)
public PixelMapping mapPixels(PixelMapMode mapMode, PixelFormat format)
Map all pixels for read/write in given pixel format
Parameters:
Parameter | Type | Description |
---|---|---|
mapMode | PixelMapMode | Map mode |
format | PixelFormat | Pixel format |
Returns: PixelMapping
mapPixels(Rect rect, PixelMapMode mapMode, PixelFormat format)
public PixelMapping mapPixels(Rect rect, PixelMapMode mapMode, PixelFormat format)
Map pixels addressed by rect for reading/writing in given pixel format
Parameters:
Parameter | Type | Description |
---|---|---|
rect | Rect | The area of pixels to be accessed |
mapMode | PixelMapMode | Map mode |
format | PixelFormat | Pixel format |
Returns: PixelMapping - Returns a mapping object, it should be disposed when no longer needed.
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
removeProperty(Property property)
public boolean removeProperty(Property property)
Removes a dynamic property.
Parameters:
Parameter | Type | Description |
---|---|---|
property | Property | Which property to remove |
Returns: boolean - true if the property is successfully removed
removeProperty(String property)
public boolean removeProperty(String property)
Remove the specified property identified by name
Parameters:
Parameter | Type | Description |
---|---|---|
property | java.lang.String | Which property to remove |
Returns: boolean - true if the property is successfully removed
save(Stream stream, String format)
public void save(Stream stream, String format)
Save texture data into specified image format
Parameters:
Parameter | Type | Description |
---|---|---|
stream | Stream | The stream that holds the saved image |
format | java.lang.String | Image format, usually file extension |
save(String fileName)
public void save(String fileName)
Save texture data into image file
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | The file name of where the image will be saved. |
save(String fileName, String format)
public void save(String fileName, String format)
Save texture data into image file
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | The file name of where the image will be saved. |
format | java.lang.String | Image format of the output file. |
setName(String value)
public void setName(String value)
Sets the name.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | New value |
setProperty(String property, Object value)
public void setProperty(String property, Object value)
Sets the value of specified property
Parameters:
Parameter | Type | Description |
---|---|---|
property | java.lang.String | Property name |
value | java.lang.Object | The value of the property |
toString()
public String toString()
Returns: java.lang.String
transformPixelFormat(PixelFormat pixelFormat)
public void transformPixelFormat(PixelFormat pixelFormat)
Transform pixel’s layout to new pixel format.
Parameters:
Parameter | Type | Description |
---|---|---|
pixelFormat | PixelFormat | Destination pixel format |
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |