enum Gdk::MemoryFormat

Overview

Gdk::MemoryFormat 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 Gdk::MemoryFormats on architectures with different endiannesses.

Its naming is modelled after VkFormat for details).

Defined in:

lib/gi-crystal/src/auto/gdk-4.0/gdk.cr

Enum Members

B8g8r8a8Premultiplied = 0_u32

4 bytes; for blue, green, red, alpha. The color values are premultiplied with the alpha value.

A8r8g8b8Premultiplied = 1_u32

4 bytes; for alpha, red, green, blue. The color values are premultiplied with the alpha value.

R8g8b8a8Premultiplied = 2_u32

4 bytes; for red, green, blue, alpha The color values are premultiplied with the alpha value.

B8g8r8a8 = 3_u32

4 bytes; for blue, green, red, alpha.

A8r8g8b8 = 4_u32

4 bytes; for alpha, red, green, blue.

R8g8b8a8 = 5_u32

4 bytes; for red, green, blue, alpha.

A8b8g8r8 = 6_u32

4 bytes; for alpha, blue, green, red.

R8g8b8 = 7_u32

3 bytes; for red, green, blue. The data is opaque.

B8g8r8 = 8_u32

3 bytes; for blue, green, red. The data is opaque.

R16g16b16 = 9_u32

3 guint16 values; for red, green, blue. Since: 4.6

R16g16b16a16Premultiplied = 10_u32

4 guint16 values; for red, green, blue, alpha. The color values are premultiplied with the alpha value. Since: 4.6

R16g16b16a16 = 11_u32

4 guint16 values; for red, green, blue, alpha. Since: 4.6

R16g16b16Float = 12_u32

3 half-float values; for red, green, blue. The data is opaque. Since: 4.6

R16g16b16a16FloatPremultiplied = 13_u32

4 half-float values; for red, green, blue and alpha. The color values are premultiplied with the alpha value. Since: 4.6

R16g16b16a16Float = 14_u32

4 half-float values; for red, green, blue and alpha. Since: 4.6

R32g32b32Float = 15_u32
R32g32b32a32FloatPremultiplied = 16_u32

4 float values; for red, green, blue and alpha. The color values are premultiplied with the alpha value. Since: 4.6

R32g32b32a32Float = 17_u32

4 float values; for red, green, blue and alpha. Since: 4.6

NFormats = 18_u32

The number of formats. This value will change as more formats get added, so do not rely on its concrete integer.

Class Method Summary

Instance Method Summary

Class methods inherited from struct Enum

g_type : UInt64 g_type

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


[View source]

Instance Method Detail

def a8b8g8r8? #

[View source]
def a8r8g8b8? #

[View source]
def a8r8g8b8_premultiplied? #

[View source]
def b8g8r8? #

[View source]
def b8g8r8a8? #

[View source]
def b8g8r8a8_premultiplied? #

[View source]
def n_formats? #

[View source]
def r16g16b16? #

[View source]
def r16g16b16_float? #

[View source]
def r16g16b16a16? #

[View source]
def r16g16b16a16_float? #

[View source]
def r16g16b16a16_float_premultiplied? #

[View source]
def r16g16b16a16_premultiplied? #

[View source]
def r32g32b32_float? #

[View source]
def r32g32b32a32_float? #

[View source]
def r32g32b32a32_float_premultiplied? #

[View source]
def r8g8b8? #

[View source]
def r8g8b8a8? #

[View source]
def r8g8b8a8_premultiplied? #

[View source]