Class VkClearColorValue

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkClearColorValue>
org.lwjgl.vulkan.VkClearColorValue
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class VkClearColorValue extends org.lwjgl.system.Struct<VkClearColorValue> implements org.lwjgl.system.NativeResource
Structure specifying a clear color value.
Description

The four array elements of the clear color map to R, G, B, and A components of image formats, in order.

If the image has more than one sample, the same value is written to all samples for any pixels being cleared.

If the image or attachment format has a 64-bit component width, the first 2 array elements of each of the arrays above are reinterpreted as a single 64-bit element for the R component. The next 2 array elements are used in the same way for the G component. In other words, the union behaves as if it had the following additional members:


 double float64[2];
 int64_t int64[2];
 uint64_t uint64[2];
See Also

VkClearValue, VkSamplerCustomBorderColorCreateInfoEXT, CmdClearColorImage

Layout


 union VkClearColorValue {
     float float32()[4];
     int32_t int32()[4];
     uint32_t uint32()[4];
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • FLOAT32

      public static final int FLOAT32
      The struct member offsets.
    • INT32

      public static final int INT32
      The struct member offsets.
    • UINT32

      public static final int UINT32
      The struct member offsets.
  • Constructor Details

    • VkClearColorValue

      public VkClearColorValue(ByteBuffer container)
      Creates a VkClearColorValue instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<VkClearColorValue>
    • float32

      public FloatBuffer float32()
      are the color clear values when the format of the image or attachment is one of the numeric formats with a numeric type that is floating-point. Floating-point values are automatically converted to the format of the image, with the clear value being treated as linear if the image is sRGB.
    • float32

      public float float32(int index)
      are the color clear values when the format of the image or attachment is one of the numeric formats with a numeric type that is floating-point. Floating-point values are automatically converted to the format of the image, with the clear value being treated as linear if the image is sRGB.
    • int32

      public IntBuffer int32()
      are the color clear values when the format of the image or attachment has a numeric type that is signed integer (SINT). Signed integer values are converted to the format of the image by casting to the smaller type (with negative 32-bit values mapping to negative values in the smaller type). If the integer clear value is not representable in the target type (e.g. would overflow in conversion to that type), the clear value is undefined.
    • int32

      public int int32(int index)
      are the color clear values when the format of the image or attachment has a numeric type that is signed integer (SINT). Signed integer values are converted to the format of the image by casting to the smaller type (with negative 32-bit values mapping to negative values in the smaller type). If the integer clear value is not representable in the target type (e.g. would overflow in conversion to that type), the clear value is undefined.
    • uint32

      public IntBuffer uint32()
      are the color clear values when the format of the image or attachment has a numeric type that is unsigned integer (UINT). Unsigned integer values are converted to the format of the image by casting to the integer type with fewer bits.
    • uint32

      public int uint32(int index)
      are the color clear values when the format of the image or attachment has a numeric type that is unsigned integer (UINT). Unsigned integer values are converted to the format of the image by casting to the integer type with fewer bits.
    • float32

      public VkClearColorValue float32(FloatBuffer value)
      Copies the specified FloatBuffer to the float32() field.
    • float32

      public VkClearColorValue float32(int index, float value)
      Sets the specified value at the specified index of the float32() field.
    • int32

      public VkClearColorValue int32(IntBuffer value)
      Copies the specified IntBuffer to the int32() field.
    • int32

      public VkClearColorValue int32(int index, int value)
      Sets the specified value at the specified index of the int32() field.
    • uint32

      public VkClearColorValue uint32(IntBuffer value)
      Copies the specified IntBuffer to the uint32() field.
    • uint32

      public VkClearColorValue uint32(int index, int value)
      Sets the specified value at the specified index of the uint32() field.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static VkClearColorValue malloc()
      Returns a new VkClearColorValue instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static VkClearColorValue calloc()
      Returns a new VkClearColorValue instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static VkClearColorValue create()
      Returns a new VkClearColorValue instance allocated with BufferUtils.
    • create

      public static VkClearColorValue create(long address)
      Returns a new VkClearColorValue instance for the specified memory address.
    • createSafe

      public static @Nullable VkClearColorValue createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static VkClearColorValue.Buffer malloc(int capacity)
      Returns a new VkClearColorValue.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static VkClearColorValue.Buffer calloc(int capacity)
      Returns a new VkClearColorValue.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkClearColorValue.Buffer create(int capacity)
      Returns a new VkClearColorValue.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkClearColorValue.Buffer create(long address, int capacity)
      Create a VkClearColorValue.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable VkClearColorValue.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static VkClearColorValue mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkClearColorValue callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkClearColorValue mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkClearColorValue callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkClearColorValue.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkClearColorValue.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkClearColorValue.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkClearColorValue.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static VkClearColorValue malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkClearColorValue instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static VkClearColorValue calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkClearColorValue instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static VkClearColorValue.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkClearColorValue.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static VkClearColorValue.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkClearColorValue.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nfloat32

      public static FloatBuffer nfloat32(long struct)
      Unsafe version of float32().
    • nfloat32

      public static float nfloat32(long struct, int index)
      Unsafe version of float32.
    • nint32

      public static IntBuffer nint32(long struct)
      Unsafe version of int32().
    • nint32

      public static int nint32(long struct, int index)
      Unsafe version of int32.
    • nuint32

      public static IntBuffer nuint32(long struct)
      Unsafe version of uint32().
    • nuint32

      public static int nuint32(long struct, int index)
      Unsafe version of uint32.
    • nfloat32

      public static void nfloat32(long struct, FloatBuffer value)
      Unsafe version of float32.
    • nfloat32

      public static void nfloat32(long struct, int index, float value)
      Unsafe version of float32.
    • nint32

      public static void nint32(long struct, IntBuffer value)
      Unsafe version of int32.
    • nint32

      public static void nint32(long struct, int index, int value)
      Unsafe version of int32.
    • nuint32

      public static void nuint32(long struct, IntBuffer value)
      Unsafe version of uint32.
    • nuint32

      public static void nuint32(long struct, int index, int value)
      Unsafe version of uint32.