Package com.aspose.threed
Class TextureData
- java.lang.Object
-
- com.aspose.threed.TextureData
-
public class TextureData extends java.lang.Object
This class contains the raw data and format definition of a texture.
-
-
Constructor Summary
Constructors Constructor Description TextureData()
Constructor ofTextureData
TextureData(int width, int height, int stride, int bytesPerPixel, int pixelFormat, byte[] data)
Constructor ofTextureData
TextureData(int width, int height, int stride, int bytesPerPixel, PixelFormat pixelFormat, byte[] data)
Constructor ofTextureData
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TextureData
fromBitmap(java.awt.image.BufferedImage bitmap)
Convert aBufferedImage
toTextureData
static TextureData
fromFile(java.lang.String fileName)
Load a texture from filestatic TextureData
fromStream(com.aspose.threed.Stream stream)
Load a texture from streamint
getBytesPerPixel()
Number of bytes of a pixelbyte[]
getData()
Raw bytes of pixel dataint
getHeight()
Number of vertical pixelsPixelFormat
getPixelFormat()
The pixel's formatint
getStride()
Number of bytes of a scanline.int
getWidth()
Number of horizontal pixelsjava.awt.image.BufferedImage
toBitmap()
Convert the TextureData to aBufferedImage
instance.
-
-
-
Constructor Detail
-
TextureData
public TextureData(int width, int height, int stride, int bytesPerPixel, int pixelFormat, byte[] data)
Constructor ofTextureData
- Parameters:
width
-height
-stride
-bytesPerPixel
-pixelFormat
-data
-
-
TextureData
public TextureData(int width, int height, int stride, int bytesPerPixel, PixelFormat pixelFormat, byte[] data)
Constructor ofTextureData
- Parameters:
width
-height
-stride
-bytesPerPixel
-pixelFormat
-data
-
-
TextureData
public TextureData()
Constructor ofTextureData
-
-
Method Detail
-
getData
public byte[] getData()
Raw bytes of pixel data
-
getWidth
public int getWidth()
Number of horizontal pixels
-
getHeight
public int getHeight()
Number of vertical pixels
-
getStride
public int getStride()
Number of bytes of a scanline.
-
getBytesPerPixel
public int getBytesPerPixel()
Number of bytes of a pixel
-
getPixelFormat
public PixelFormat getPixelFormat()
The pixel's format
-
fromBitmap
public static TextureData fromBitmap(java.awt.image.BufferedImage bitmap)
Convert aBufferedImage
toTextureData
- Parameters:
bitmap
-
-
toBitmap
public java.awt.image.BufferedImage toBitmap()
Convert the TextureData to aBufferedImage
instance.
-
fromStream
public static TextureData fromStream(com.aspose.threed.Stream stream)
Load a texture from stream- Parameters:
stream
-
-
fromFile
public static TextureData fromFile(java.lang.String fileName) throws java.io.IOException
Load a texture from file- Parameters:
fileName
-- Throws:
java.io.IOException
-
-