Package icyllis.arc3d.engine

# Class ImageDesc

java.lang.Object
icyllis.arc3d.engine.ImageDesc

Direct Known Subclasses:
  `GLImageDesc`, `VulkanImageDesc`

@Immutable public abstract class ImageDesc extends Object
Contains backend-specific parameters used to create GPU images, which are: mip level count, sample count, image format, image view type, image create flags, image usage flags, width, height, depth, and array layer count.

All parameters are validated by `Caps`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final short`
  `mArraySize`
  `protected final short`
  `mDepth`
  `protected final int`
  `mFlags`
  `protected final int`
  `mHeight`
  `protected final byte`
  `mImageType`
  `protected final byte`
  `mMipLevelCount`
  `protected final byte`
  `mSampleCount`
  `protected final int`
  `mWidth`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ImageDesc(int imageType, int width, int height, int depth, int arraySize, int mipLevelCount, int sampleCount, int flags)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final int`
  `getArraySize()`
  `abstract int`
  `getBackend()`
  `int`
  `getBytesPerBlock()`
  `int`
  `getChannelFlags()`
  Gets the channels present in the format as a bitfield of ColorChannelFlag values.
  `int`
  `getCompressionType()`
  `final int`
  `getDepth()`
  `int`
  `getDepthBits()`
  `int`
  `getGLFormat()`
  If the backend API is OpenGL this gets the format as a GLenum.
  `final int`
  `getHeight()`
  `final int`
  `getImageType()`
  Returns the default image view type.
  `final int`
  `getMipLevelCount()`
  Returns the number of mip levels, greater than 1 if mipmapped
  `final int`
  `getSampleCount()`
  Returns the number of samples, greater than 1 if multisampled.
  `int`
  `getStencilBits()`
  `int`
  `getVkFormat()`
  If the backend API is Vulkan this gets the format as a VkFormat.
  `final int`
  `getWidth()`
  `final boolean`
  `isCompressed()`
  `final boolean`
  `isMipmapped()`
  `final boolean`
  `isMultisampled()`
  `final boolean`
  `isProtected()`
  `final boolean`
  `isRenderable()`
  `final boolean`
  `isSampledImage()`
  `boolean`
  `isSRGB()`
  `final boolean`
  `isStorageImage()`

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

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

- ## Field Details

  - ### mFlags

    protected final int mFlags

  - ### mWidth

    protected final int mWidth

  - ### mHeight

    protected final int mHeight

  - ### mDepth

    protected final short mDepth

  - ### mArraySize

    protected final short mArraySize

  - ### mMipLevelCount

    protected final byte mMipLevelCount

  - ### mSampleCount

    protected final byte mSampleCount

  - ### mImageType

    protected final byte mImageType

- ## Constructor Details

  - ### ImageDesc

    protected ImageDesc(int imageType, int width, int height, int depth, int arraySize, int mipLevelCount, int sampleCount, int flags)

- ## Method Details

  - ### getBackend

    public abstract int getBackend()
    Returns:
      see `Engine.BackendApi`

  - ### getImageType

    public final int getImageType()
    Returns the default image view type.
    Returns:
      see `Engine.ImageType`

  - ### getWidth

    public final int getWidth()
    Returns:
      the width in texels

  - ### getHeight

    public final int getHeight()
    Returns:
      the height in texels

  - ### getDepth

    public final int getDepth()
    Returns:
      the depth in texels

  - ### getArraySize

    public final int getArraySize()

  - ### isMipmapped

    public final boolean isMipmapped()

  - ### isMultisampled

    public final boolean isMultisampled()

  - ### getMipLevelCount

    public final int getMipLevelCount()
    Returns the number of mip levels, greater than 1 if mipmapped

  - ### getSampleCount

    public final int getSampleCount()
    Returns the number of samples, greater than 1 if multisampled.

  - ### isSampledImage

    public final boolean isSampledImage()
    Returns:
      true if this image can be used as textures

  - ### isStorageImage

    public final boolean isStorageImage()
    Returns:
      true if this image can be used as storage images.

  - ### isRenderable

    public final boolean isRenderable()
    Returns:
      true if this image can be used as color and depth/stencil attachments

  - ### isProtected

    public final boolean isProtected()

  - ### getGLFormat

    public int getGLFormat()
    If the backend API is OpenGL this gets the format as a GLenum.

  - ### getVkFormat

    public int getVkFormat()
    If the backend API is Vulkan this gets the format as a VkFormat.

  - ### getChannelFlags

    public int getChannelFlags()
    Gets the channels present in the format as a bitfield of ColorChannelFlag values.
    See Also:
      - `Color.COLOR_CHANNEL_FLAGS_RGBA`

  - ### isSRGB

    public boolean isSRGB()

  - ### getCompressionType

    public int getCompressionType()
    See Also:
      - `ColorInfo.COMPRESSION_NONE`

  - ### isCompressed

    public final boolean isCompressed()

  - ### getBytesPerBlock

    public int getBytesPerBlock()
    Returns:
      if compressed, bytes per block, otherwise bytes per pixel

  - ### getDepthBits

    public int getDepthBits()

  - ### getStencilBits

    public int getStencilBits()