Class Image

All Implemented Interfaces:
RefCounted
Direct Known Subclasses:
GraniteImage, RasterImage

public abstract class Image extends RefCnt
Image describes a two-dimensional array of pixels to draw. The pixels may be decoded in a raster bitmap, encoded in a Picture or compressed data stream, or located in GPU memory as a GPU texture.

Image cannot be modified after it is created. Image may allocate additional storage as needed; for instance, an encoded Image may decode when drawn.

Image width and height are greater than zero. Creating an Image with zero width or height returns Image equal to null.

Image may be created from Bitmap, Pixmap, Surface, Picture, encoded streams, GPU texture, YUV_ColorSpace data, or hardware buffer. Encoded streams supported include BMP, GIF, JPEG, PNG, WBMP, TGA, PSD, HDR, PNM, PIC, TIFF.

  • Field Details

    • mInfo

      protected final ImageInfo mInfo
    • mUniqueID

      protected final UniqueID mUniqueID
  • Constructor Details

    • Image

      protected Image(@Nonnull ImageInfo info)
  • Method Details

    • getInfo

      @Nonnull public final ImageInfo getInfo()
    • getWidth

      public final int getWidth()
      Returns the full width of this image.
      Returns:
      image width in pixels
    • getHeight

      public final int getHeight()
      Returns the full height of this image.
      Returns:
      image height in pixels
    • getBounds

      public final void getBounds(@Nonnull Rect2i bounds)
    • getBounds

      public final void getBounds(@Nonnull Rect2f bounds)
    • getUniqueID

      @Nonnull public final UniqueID getUniqueID()
      Returns object unique to image. Image contents cannot change after Image is created. Any operation to create a new Image will receive generate a new unique object.
      Returns:
      unique identifier
    • getColorType

      public final int getColorType()
    • getAlphaType

      public final int getAlphaType()
    • getColorSpace

      @Nullable public final ColorSpace getColorSpace()
    • isAlphaOnly

      public final boolean isAlphaOnly()
    • getContext

      @Internal @Nullable public Context getContext()
    • isRasterBacked

      @Internal public boolean isRasterBacked()
    • isTextureBacked

      @Internal public boolean isTextureBacked()
    • getTextureSize

      public long getTextureSize()