TextureData
Inheritance: java.lang.Object
public class TextureData
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) | |
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 |
getPixelFormat() | The pixel’s format |
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() | |
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 |
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
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 | com.aspose.csporter.helpers.Stream |
Returns: TextureData
getBytesPerPixel()
public int getBytesPerPixel()
Number of bytes of a pixel
Returns: int
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getData()
public byte[] getData()
Raw bytes of pixel data
Returns: byte[]
getHeight()
public int getHeight()
Number of vertical pixels
Returns: int
getPixelFormat()
public PixelFormat getPixelFormat()
The pixel’s format
Returns: PixelFormat
getStride()
public int getStride()
Number of bytes of a scanline.
Returns: int
getWidth()
public int getWidth()
Number of horizontal pixels
Returns: int
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()
save(Stream stream, String format)
public void save(Stream stream, String format)
Save texture data into specified image format
Parameters:
Parameter | Type | Description |
---|---|---|
stream | com.aspose.csporter.helpers.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. |
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 |