Package icyllis.arc3d.core

# Class Image

java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.core.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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final ImageInfo`
  `mInfo`
  `protected final UniqueID`
  `mUniqueID`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Image(ImageInfo info)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final int`
  `getAlphaType()`
  `final void`
  `getBounds(Rect2f bounds)`
  `final void`
  `getBounds(Rect2i bounds)`
  `final ColorSpace`
  `getColorSpace()`
  `final int`
  `getColorType()`
  `Context`
  `getContext()`
  `final int`
  `getHeight()`
  Returns the full height of this image.
  `final ImageInfo`
  `getInfo()`
  `long`
  `getTextureSize()`
  `final UniqueID`
  `getUniqueID()`
  Returns object unique to image.
  `final int`
  `getWidth()`
  Returns the full width of this image.
  `final boolean`
  `isAlphaOnly()`
  `boolean`
  `isRasterBacked()`
  `boolean`
  `isTextureBacked()`

  ### Methods inherited from class icyllis.arc3d.core.RefCnt

  `create, create, deallocate, getRefCnt, getRefCntAcquire, getRefCntVolatile, move, move, ref, unique, unref`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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()