:right-sidebar: True MemoryFormat =================================================================== .. currentmodule:: gi.repository.Gdk .. class:: MemoryFormat :no-contents-entry: ``GdkMemoryFormat`` 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). Fields ------ .. rst-class:: interim-class .. class:: MemoryFormat :no-index: .. attribute:: A16 One guint16 value; for alpha. .. versionadded:: 4.12 .. attribute:: A16_FLOAT One half-float value; for alpha. .. versionadded:: 4.12 .. attribute:: A32_FLOAT One float value; for alpha. .. versionadded:: 4.12 .. attribute:: A8 One byte; for alpha. .. versionadded:: 4.12 .. attribute:: A8B8G8R8 4 bytes; for alpha, blue, green, red. .. attribute:: A8B8G8R8_PREMULTIPLIED 4 bytes; for alpha, blue, green, red, The color values are premultiplied with the alpha value. .. versionadded:: 4.14 .. attribute:: A8R8G8B8 4 bytes; for alpha, red, green, blue. .. attribute:: A8R8G8B8_PREMULTIPLIED 4 bytes; for alpha, red, green, blue. The color values are premultiplied with the alpha value. .. attribute:: B8G8R8 3 bytes; for blue, green, red. The data is opaque. .. attribute:: B8G8R8A8 4 bytes; for blue, green, red, alpha. .. attribute:: B8G8R8A8_PREMULTIPLIED 4 bytes; for blue, green, red, alpha. The color values are premultiplied with the alpha value. .. attribute:: B8G8R8X8 4 bytes; for blue, green, red, unused. .. versionadded:: 4.14 .. attribute:: G16 One guint16 value; for grayscale. The data is opaque. .. versionadded:: 4.12 .. attribute:: G16A16 2 guint16 values; for grayscale, alpha. .. versionadded:: 4.12 .. attribute:: G16A16_PREMULTIPLIED 2 guint16 values; for grayscale, alpha. The color values are premultiplied with the alpha value. .. versionadded:: 4.12 .. attribute:: G8 One byte; for grayscale. The data is opaque. .. versionadded:: 4.12 .. attribute:: G8A8 2 bytes; for grayscale, alpha. .. versionadded:: 4.12 .. attribute:: G8A8_PREMULTIPLIED 2 bytes; for grayscale, alpha. The color values are premultiplied with the alpha value. .. versionadded:: 4.12 .. attribute:: N_FORMATS The number of formats. This value will change as more formats get added, so do not rely on its concrete integer. .. attribute:: R16G16B16 3 guint16 values; for red, green, blue. .. versionadded:: 4.6 .. attribute:: R16G16B16A16 4 guint16 values; for red, green, blue, alpha. .. versionadded:: 4.6 .. attribute:: R16G16B16A16_FLOAT 4 half-float values; for red, green, blue and alpha. .. versionadded:: 4.6 .. attribute:: R16G16B16A16_FLOAT_PREMULTIPLIED 4 half-float values; for red, green, blue and alpha. The color values are premultiplied with the alpha value. .. versionadded:: 4.6 .. attribute:: R16G16B16A16_PREMULTIPLIED 4 guint16 values; for red, green, blue, alpha. The color values are premultiplied with the alpha value. .. versionadded:: 4.6 .. attribute:: R16G16B16_FLOAT 3 half-float values; for red, green, blue. The data is opaque. .. versionadded:: 4.6 .. attribute:: R32G32B32A32_FLOAT 4 float values; for red, green, blue and alpha. .. versionadded:: 4.6 .. attribute:: R32G32B32A32_FLOAT_PREMULTIPLIED 4 float values; for red, green, blue and alpha. The color values are premultiplied with the alpha value. .. versionadded:: 4.6 .. attribute:: R32G32B32_FLOAT 3 float values; for red, green, blue. .. attribute:: R8G8B8 3 bytes; for red, green, blue. The data is opaque. .. attribute:: R8G8B8A8 4 bytes; for red, green, blue, alpha. .. attribute:: R8G8B8A8_PREMULTIPLIED 4 bytes; for red, green, blue, alpha The color values are premultiplied with the alpha value. .. attribute:: R8G8B8X8 4 bytes; for red, green, blue, unused. .. versionadded:: 4.14 .. attribute:: X8B8G8R8 4 bytes; for unused, blue, green, red. .. versionadded:: 4.14 .. attribute:: X8R8G8B8 4 bytes; for unused, red, green, blue. .. versionadded:: 4.14