Enum Class MemoryFormat

java.lang.Object
java.lang.Enum<MemoryFormat>
org.gnome.gdk.MemoryFormat
All Implemented Interfaces:
Serializable, Comparable<MemoryFormat>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum MemoryFormat extends Enum<MemoryFormat> implements Enumeration

Describes formats that image data can have in memory.

It describes formats by listing the contents of the memory passed to it. So GDK_MEMORY_A8R8G8B8 will be 1 byte (8 bits) of alpha, followed by a byte each of red, green and blue. It is not endian-dependent, so CAIRO_FORMAT_ARGB32 is represented by different GdkMemoryFormats on architectures with different endiannesses.

Its naming is modelled after VkFormat for details).

  • Enum Constant Details

    • B8G8R8A8_PREMULTIPLIED

      public static final MemoryFormat B8G8R8A8_PREMULTIPLIED
      4 bytes; for blue, green, red, alpha. The color values are premultiplied with the alpha value.
    • A8R8G8B8_PREMULTIPLIED

      public static final MemoryFormat A8R8G8B8_PREMULTIPLIED
      4 bytes; for alpha, red, green, blue. The color values are premultiplied with the alpha value.
    • R8G8B8A8_PREMULTIPLIED

      public static final MemoryFormat R8G8B8A8_PREMULTIPLIED
      4 bytes; for red, green, blue, alpha The color values are premultiplied with the alpha value.
    • B8G8R8A8

      public static final MemoryFormat B8G8R8A8
      4 bytes; for blue, green, red, alpha.
    • A8R8G8B8

      public static final MemoryFormat A8R8G8B8
      4 bytes; for alpha, red, green, blue.
    • R8G8B8A8

      public static final MemoryFormat R8G8B8A8
      4 bytes; for red, green, blue, alpha.
    • A8B8G8R8

      public static final MemoryFormat A8B8G8R8
      4 bytes; for alpha, blue, green, red.
    • R8G8B8

      public static final MemoryFormat R8G8B8
      3 bytes; for red, green, blue. The data is opaque.
    • B8G8R8

      public static final MemoryFormat B8G8R8
      3 bytes; for blue, green, red. The data is opaque.
    • R16G16B16

      public static final MemoryFormat R16G16B16
      3 guint16 values; for red, green, blue.
      Since:
      4.6
    • R16G16B16A16_PREMULTIPLIED

      public static final MemoryFormat R16G16B16A16_PREMULTIPLIED
      4 guint16 values; for red, green, blue, alpha. The color values are premultiplied with the alpha value.
      Since:
      4.6
    • R16G16B16A16

      public static final MemoryFormat R16G16B16A16
      4 guint16 values; for red, green, blue, alpha.
      Since:
      4.6
    • R16G16B16_FLOAT

      public static final MemoryFormat R16G16B16_FLOAT
      3 half-float values; for red, green, blue. The data is opaque.
      Since:
      4.6
    • R16G16B16A16_FLOAT_PREMULTIPLIED

      public static final MemoryFormat R16G16B16A16_FLOAT_PREMULTIPLIED
      4 half-float values; for red, green, blue and alpha. The color values are premultiplied with the alpha value.
      Since:
      4.6
    • R16G16B16A16_FLOAT

      public static final MemoryFormat R16G16B16A16_FLOAT
      4 half-float values; for red, green, blue and alpha.
      Since:
      4.6
    • R32G32B32_FLOAT

      public static final MemoryFormat R32G32B32_FLOAT
      3 float values; for red, green, blue.
    • R32G32B32A32_FLOAT_PREMULTIPLIED

      public static final MemoryFormat R32G32B32A32_FLOAT_PREMULTIPLIED
      4 float values; for red, green, blue and alpha. The color values are premultiplied with the alpha value.
      Since:
      4.6
    • R32G32B32A32_FLOAT

      public static final MemoryFormat R32G32B32A32_FLOAT
      4 float values; for red, green, blue and alpha.
      Since:
      4.6
    • G8A8_PREMULTIPLIED

      public static final MemoryFormat G8A8_PREMULTIPLIED
      2 bytes; for grayscale, alpha. The color values are premultiplied with the alpha value.
      Since:
      4.12
    • G8A8

      public static final MemoryFormat G8A8
      2 bytes; for grayscale, alpha.
      Since:
      4.12
    • G8

      public static final MemoryFormat G8
      One byte; for grayscale. The data is opaque.
      Since:
      4.12
    • G16A16_PREMULTIPLIED

      public static final MemoryFormat G16A16_PREMULTIPLIED
      2 guint16 values; for grayscale, alpha. The color values are premultiplied with the alpha value.
      Since:
      4.12
    • G16A16

      public static final MemoryFormat G16A16
      2 guint16 values; for grayscale, alpha.
      Since:
      4.12
    • G16

      public static final MemoryFormat G16
      One guint16 value; for grayscale. The data is opaque.
      Since:
      4.12
    • A8

      public static final MemoryFormat A8
      One byte; for alpha.
      Since:
      4.12
    • A16

      public static final MemoryFormat A16
      One guint16 value; for alpha.
      Since:
      4.12
    • A16_FLOAT

      public static final MemoryFormat A16_FLOAT
      One half-float value; for alpha.
      Since:
      4.12
    • A32_FLOAT

      public static final MemoryFormat A32_FLOAT
      One float value; for alpha.
      Since:
      4.12
    • A8B8G8R8_PREMULTIPLIED

      public static final MemoryFormat A8B8G8R8_PREMULTIPLIED
      4 bytes; for alpha, blue, green, red, The color values are premultiplied with the alpha value.
      Since:
      4.14
    • B8G8R8X8

      public static final MemoryFormat B8G8R8X8
      4 bytes; for blue, green, red, unused.
      Since:
      4.14
    • X8R8G8B8

      public static final MemoryFormat X8R8G8B8
      4 bytes; for unused, red, green, blue.
      Since:
      4.14
    • R8G8B8X8

      public static final MemoryFormat R8G8B8X8
      4 bytes; for red, green, blue, unused.
      Since:
      4.14
    • X8B8G8R8

      public static final MemoryFormat X8B8G8R8
      4 bytes; for unused, blue, green, red.
      Since:
      4.14
    • G8_B8R8_420

      public static final MemoryFormat G8_B8R8_420

      Multiplane format with 2 planes.

      The first plane contains the first channel, usually containing luma values. The second plane with interleaved chroma values, Cb followed by Cr. Subsampled in both the X and Y direction.

      Commonly known by the fourcc "NV12".

      Since:
      4.20
    • G8_R8B8_420

      public static final MemoryFormat G8_R8B8_420

      Multiplane format with 2 planes.

      The first plane contains the first channel, usually containing luma values. The second plane with interleaved chroma values, Cr followed by Cb. Subsampled in both the X and Y direction.

      Commonly known by the fourcc "NV21".

      Since:
      4.20
    • G8_B8R8_422

      public static final MemoryFormat G8_B8R8_422

      Multiplane format with 2 planes.

      The first plane contains the first channel, usually containing luma values. The second plane with interleaved chroma values, Cb followed by Cr. Subsampled in the X direction.

      Commonly known by the fourcc "NV16".

      Since:
      4.20
    • G8_R8B8_422

      public static final MemoryFormat G8_R8B8_422

      Multiplane format with 2 planes.

      The first plane contains the first channel, usually containing luma values. The second plane with interleaved chroma values, Cr followed by Cb. Subsampled in the X direction.

      Commonly known by the fourcc "NV61".

      Since:
      4.20
    • G8_B8R8_444

      public static final MemoryFormat G8_B8R8_444

      Multiplane format with 2 planes.

      The first plane contains the first channel, usually containing luma values. The second plane with interleaved chroma values, Cb followed by Cr. This format is not subsampled.

      Commonly known by the fourcc "NV24".

      Since:
      4.20
    • G8_R8B8_444

      public static final MemoryFormat G8_R8B8_444

      Multiplane format with 2 planes.

      The first plane contains the first channel, usually containing luma values. The second plane with interleaved chroma values, Cr followed by Cb. This format is not subsampled.

      Commonly known by the fourcc "NV42".

      Since:
      4.20
    • G10X6_B10X6R10X6_420

      public static final MemoryFormat G10X6_B10X6R10X6_420

      Multiplane format with 2 planes.

      Each channel is a 16 bit integer, but only the highest 10 bits are used.

      The first plane contains the first channel, usually containing luma values. The second plane with interleaved chroma values, Cr followed by Cb. This format is not subsampled.

      Commonly known by the fourcc "P010".

      Since:
      4.20
    • G12X4_B12X4R12X4_420

      public static final MemoryFormat G12X4_B12X4R12X4_420

      Multiplane format with 2 planes.

      Each channel is a 16 bit integer, but only the highest 10 bits are used.

      The first plane contains the first channel, usually containing luma values. The second plane with interleaved chroma values, Cr followed by Cb. This format is not subsampled.

      Commonly known by the fourcc "P012".

      Since:
      4.20
    • G16_B16R16_420

      public static final MemoryFormat G16_B16R16_420

      Multiplane format with 2 planes.

      Each channel is a 16 bit integer.

      The first plane contains the first channel, usually containing luma values. The second plane with interleaved chroma values, Cr followed by Cb. This format is not subsampled.

      Commonly known by the fourcc "P016".

      Since:
      4.20
    • G8_B8_R8_410

      public static final MemoryFormat G8_B8_R8_410

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in both the X and Y direction with 4:1 ratio. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in both the X and Y direction with 4:1 ratio. It is mapped into the 1st channel.

      Commonly known by the fourcc "YUV410".

      Since:
      4.20
    • G8_R8_B8_410

      public static final MemoryFormat G8_R8_B8_410

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the second chroma chanel. Subsampled in both the X and Y direction with 4:1 ratio. It is mapped into the 1st channel.

      The third plane usually contains the first chroma channel. Subsampled in both the X and Y direction with 4:1 ratio. It is mapped into the 3rd channel.

      Commonly known by the fourcc "YVU410".

      Since:
      4.20
    • G8_B8_R8_411

      public static final MemoryFormat G8_B8_R8_411

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in the X direction with 4:1 ratio. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in the X direction with 4:1 ratio. It is mapped into the 1st channel.

      Commonly known by the fourcc "YUV411".

      Since:
      4.20
    • G8_R8_B8_411

      public static final MemoryFormat G8_R8_B8_411

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the second chroma chanel. Subsampled in the X direction with 4:1 ratio. It is mapped into the 1st channel.

      The third plane usually contains the first chroma channel. Subsampled in the X direction with 4:1 ratio. It is mapped into the 3rd channel.

      Commonly known by the fourcc "YVU411".

      Since:
      4.20
    • G8_B8_R8_420

      public static final MemoryFormat G8_B8_R8_420

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in both the X and Y direction. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in both the X and Y direction. It is mapped into the 1st channel.

      Commonly known by the fourcc "YUV420".

      Since:
      4.20
    • G8_R8_B8_420

      public static final MemoryFormat G8_R8_B8_420

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the second chroma chanel. Subsampled in both the X and Y direction. It is mapped into the 1st channel.

      The third plane usually contains the first chroma channel. Subsampled in both the X and Y direction. It is mapped into the 3rd channel.

      Commonly known by the fourcc "YVU420".

      Since:
      4.20
    • G8_B8_R8_422

      public static final MemoryFormat G8_B8_R8_422

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in the X direction. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in the X direction. It is mapped into the 1st channel.

      Commonly known by the fourcc "YUV422".

      Since:
      4.20
    • G8_R8_B8_422

      public static final MemoryFormat G8_R8_B8_422

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the second chroma chanel. Subsampled in the X direction. It is mapped into the 1st channel.

      The third plane usually contains the first chroma channel. Subsampled in the X direction. It is mapped into the 3rd channel.

      Commonly known by the fourcc "YVU422".

      Since:
      4.20
    • G8_B8_R8_444

      public static final MemoryFormat G8_B8_R8_444

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. It is mapped into the 1st channel.

      Commonly known by the fourcc "YUV444".

      Since:
      4.20
    • G8_R8_B8_444

      public static final MemoryFormat G8_R8_B8_444

      Multiplane format with 3 planes.

      Each channel is a 8 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the second chroma chanel. Subsampled in the X direction. It is mapped into the 1st channel.

      The third plane usually contains the first chroma channel. Subsampled in the X direction. It is mapped into the 3rd channel.

      Commonly known by the fourcc "YVU444".

      Since:
      4.20
    • G8B8G8R8_422

      public static final MemoryFormat G8B8G8R8_422

      Packed format with subsampled channels.

      Each channel is a 8 bit integer. The red and blue/chroma channels are subsampled and interleaved with the green/luma channel.

      Each block contains 2 pixels, so the width must be a multiple of 2.

      Commonly known by the fourcc "YUYV".

      Since:
      4.20
    • G8R8G8B8_422

      public static final MemoryFormat G8R8G8B8_422

      Packed format with subsampled channels.

      Each channel is a 8 bit integer. The red and blue/chroma channels are subsampled and interleaved with the green/luma channel.

      Each block contains 2 pixels, so the width must be a multiple of 2.

      Commonly known by the fourcc "YVYU".

      Since:
      4.20
    • R8G8B8G8_422

      public static final MemoryFormat R8G8B8G8_422

      Packed format with subsampled channels.

      Each channel is a 8 bit integer. The red and blue/chroma channels are subsampled and interleaved with the green/luma channel.

      Each block contains 2 pixels, so the width must be a multiple of 2.

      Commonly known by the fourcc "VYUY".

      Since:
      4.20
    • B8G8R8G8_422

      public static final MemoryFormat B8G8R8G8_422

      Packed format with subsampled channels.

      Each channel is a 8 bit integer. The red and blue/chroma channels are subsampled and interleaved with the green/luma channel.

      Each block contains 2 pixels, so the width must be a multiple of 2.

      Commonly known by the fourcc "UYVY".

      Since:
      4.20
    • X6G10_X6B10_X6R10_420

      public static final MemoryFormat X6G10_X6B10_X6R10_420

      Multiplane format with 3 planes.

      Each channel is a 16 bit integer.

      Only the 10 lower bits are used. The remaining ones must be set to 0 by the producer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in both the X and Y direction. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in both the X and Y direction. It is mapped into the 1st channel.

      Commonly known by the fourcc "S010".

      Since:
      4.20
    • X6G10_X6B10_X6R10_422

      public static final MemoryFormat X6G10_X6B10_X6R10_422

      Multiplane format with 3 planes.

      Each channel is a 16 bit integer.

      Only the 10 lower bits are used. The remaining ones must be set to 0 by the producer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in the X direction. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in the X direction. It is mapped into the 1st channel.

      Commonly known by the fourcc "S210".

      Since:
      4.20
    • X6G10_X6B10_X6R10_444

      public static final MemoryFormat X6G10_X6B10_X6R10_444

      Multiplane format with 3 planes.

      Each channel is a 16 bit integer.

      Only the 10 lower bits are used. The remaining ones must be set to 0 by the producer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. It is mapped into the 1st channel.

      Commonly known by the fourcc "S410".

      Since:
      4.20
    • X4G12_X4B12_X4R12_420

      public static final MemoryFormat X4G12_X4B12_X4R12_420

      Multiplane format with 3 planes.

      Each channel is a 16 bit integer.

      Only the 12 lower bits are used. The remaining ones must be set to 0 by the producer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in both the X and Y direction. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in both the X and Y direction. It is mapped into the 1st channel.

      Commonly known by the fourcc "S012".

      Since:
      4.20
    • X4G12_X4B12_X4R12_422

      public static final MemoryFormat X4G12_X4B12_X4R12_422

      Multiplane format with 3 planes.

      Each channel is a 16 bit integer.

      Only the 12 lower bits are used. The remaining ones must be set to 0 by the producer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in the X direction. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in the X direction. It is mapped into the 1st channel.

      Commonly known by the fourcc "S212".

      Since:
      4.20
    • X4G12_X4B12_X4R12_444

      public static final MemoryFormat X4G12_X4B12_X4R12_444

      Multiplane format with 3 planes.

      Each channel is a 16 bit integer.

      Only the 12 lower bits are used. The remaining ones must be set to 0 by the producer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. It is mapped into the 1st channel.

      Commonly known by the fourcc "S412".

      Since:
      4.20
    • G16_B16_R16_420

      public static final MemoryFormat G16_B16_R16_420

      Multiplane format with 3 planes.

      Each channel is a 16 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in both the X and Y direction. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in both the X and Y direction. It is mapped into the 1st channel.

      Commonly known by the fourcc "S016".

      Since:
      4.20
    • G16_B16_R16_422

      public static final MemoryFormat G16_B16_R16_422

      Multiplane format with 3 planes.

      Each channel is a 16 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. Subsampled in the X direction. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. Subsampled in the X direction. It is mapped into the 1st channel.

      Commonly known by the fourcc "S216".

      Since:
      4.20
    • G16_B16_R16_444

      public static final MemoryFormat G16_B16_R16_444

      Multiplane format with 3 planes.

      Each channel is a 16 bit integer.

      The first plane usually contains the luma channel. It is mapped into the 2nd channel.

      The second plane usually contains the first chroma chanel. It is mapped into the 3rd channel.

      The third plane usually contains the second chroma channel. It is mapped into the 1st channel.

      Commonly known by the fourcc "S416".

      Since:
      4.20
    • N_FORMATS

      public static final MemoryFormat N_FORMATS
      The number of formats. This value will change as more formats get added, so do not rely on its concrete integer.
  • Method Details

    • values

      public static MemoryFormat[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MemoryFormat valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static MemoryFormat of(int value)
      Create a new MemoryFormat for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static MemoryFormat of(MemorySegment address)
      Create a new MemoryFormat for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

      public static @Nullable Type getType()
      Get the GType of the MemoryFormat class.
      Returns:
      the GType