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 Detail

      • TextureData

        public TextureData​(int width,
                           int height,
                           int stride,
                           int bytesPerPixel,
                           int pixelFormat,
                           byte[] data)
        Constructor of TextureData
        Parameters:
        width -
        height -
        stride -
        bytesPerPixel -
        pixelFormat -
        data -
      • TextureData

        public TextureData​(int width,
                           int height,
                           int stride,
                           int bytesPerPixel,
                           PixelFormat pixelFormat,
                           byte[] data)
        Constructor of TextureData
        Parameters:
        width -
        height -
        stride -
        bytesPerPixel -
        pixelFormat -
        data -
      • TextureData

        public TextureData()
        Constructor of TextureData
    • 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 a BufferedImage to TextureData
        Parameters:
        bitmap -
      • toBitmap

        public java.awt.image.BufferedImage toBitmap()
        Convert the TextureData to a BufferedImage 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