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 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:
    • isSRGB

      public boolean isSRGB()
    • getCompressionType

      public int getCompressionType()
      See Also:
    • 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()