Class TextureData


  • public class TextureData
    extends java.lang.Object
    This class contains the raw data and format definition of a texture.
    • Method Summary

      Modifier and Type Method Description
      static TextureData fromBitmap​(java.awt.image.BufferedImage bitmap)
      Convert a BufferedImage to TextureData
      static TextureData fromFile​(java.lang.String fileName)
      Load a texture from file
      static TextureData fromStream​(com.aspose.csporter.helpers.Stream stream)
      Load a texture from stream
      int getBytesPerPixel()
      Number of bytes of a pixel
      byte[] getData()
      Raw bytes of pixel data
      int getHeight()
      Number of vertical pixels
      PixelFormat getPixelFormat()
      The pixel's format
      int getStride()
      Number of bytes of a scanline.
      int getWidth()
      Number of horizontal pixels
      java.awt.image.BufferedImage toBitmap()
      Convert the TextureData to a BufferedImage instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.csporter.helpers.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