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

ConstructorDescription
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

MethodDescription
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:

ParameterTypeDescription
widthint
heightint
strideint
bytesPerPixelint
pixelFormatPixelFormat
databyte[]

TextureData(int width, int height, PixelFormat pixelFormat)

public TextureData(int width, int height, PixelFormat pixelFormat)

Constructs a new TextureData and allocate pixel data.

Parameters:

ParameterTypeDescription
widthint
heightint
pixelFormatPixelFormat

TextureData()

public TextureData()

Constructor of TextureData

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.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:

ParameterTypeDescription
propertyNamejava.lang.StringProperty name.

Returns: Property - The property.

fromFile(String fileName)

public static TextureData fromFile(String fileName)

Load a texture from file

Parameters:

ParameterTypeDescription
fileNamejava.lang.String

Returns: TextureData

fromStream(Stream stream)

public static TextureData fromStream(Stream stream)

Load a texture from stream

Parameters:

ParameterTypeDescription
streamStream

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:

ParameterTypeDescription
propertyjava.lang.StringProperty 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:

ParameterTypeDescription
mapModePixelMapModeMap 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:

ParameterTypeDescription
mapModePixelMapModeMap mode
formatPixelFormatPixel 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:

ParameterTypeDescription
rectRectThe area of pixels to be accessed
mapModePixelMapModeMap mode
formatPixelFormatPixel 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:

ParameterTypeDescription
propertyPropertyWhich 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:

ParameterTypeDescription
propertyjava.lang.StringWhich 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:

ParameterTypeDescription
streamStreamThe stream that holds the saved image
formatjava.lang.StringImage format, usually file extension

save(String fileName)

public void save(String fileName)

Save texture data into image file

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringThe 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:

ParameterTypeDescription
fileNamejava.lang.StringThe file name of where the image will be saved.
formatjava.lang.StringImage format of the output file.

setName(String value)

public void setName(String value)

Sets the name.

Parameters:

ParameterTypeDescription
valuejava.lang.StringNew value

setProperty(String property, Object value)

public void setProperty(String property, Object value)

Sets the value of specified property

Parameters:

ParameterTypeDescription
propertyjava.lang.StringProperty name
valuejava.lang.ObjectThe 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:

ParameterTypeDescription
pixelFormatPixelFormatDestination pixel format

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int