Pixel formats

Window pixel formats define how color space information is stored in the GPU memory.

The RGBA color space uses the Red Green Blue (RGB) color model with extra information about the alpha (transparency or opacity) channel. Applications that want to disregard the alpha channel can choose a pixel format with an X.

The Screen API supports the following window pixel formats (pixel format descriptions from www.fourcc.org):

Format Description
SCREEN_FORMAT_BYTE  
SCREEN_FORMAT_RGBA4444 16 bits per pixel (4 bits per channel) RGB with alpha channel.
SCREEN_FORMAT_RGBX4444 16 bits per pixel (4 bits per channel) RGB with alpha channel disregarded.
SCREEN_FORMAT_RGBA5551 16 bits per pixel, 2 bytes containing R, G, and B values (5 bits per channel with single bit alpha channel).
SCREEN_FORMAT_RGBX5551 16 bits per pixel, 2 bytes containing R, G, and B values (5 bits per channel with single bit alpha channel, disregarded).
SCREEN_FORMAT_RGB565 16 bits per pixel; uses five bits for red, six bits for green and five bits for blue. This pixel format represents each pixel in the following order (high byte to low byte): RRRR RGGG GGGB BBBB.
SCREEN_FORMAT_RGB888 24 bits per pixel (8 bits per channel) RGB.
SCREEN_FORMAT_RGBA8888 32 bits per pixel (8 bits per channel) RGB with alpha channel.
SCREEN_FORMAT_RGBX8888 32 bits per pixel (8 bits per channel) RGB with alpha channel disregarded.
SCREEN_FORMAT_YVU9 9 bits per pixel planar YUV format. 8-bit Y plane and 8-bit 4x4 subsampled V and U planes. Registered by Intel.
SCREEN_FORMAT_YUV420 Standard NTSC TV transmission format.
SCREEN_FORMAT_NV12 12 bits per pixel planar YUV format. 8-bit Y plane and 2x2 subsampled, interleaved U and V planes.
SCREEN_FORMAT_YV12 12 bits per pixel planar YUV format. 8-bit Y plane and 8-bit 2x2 subsampled U and V planes.
SCREEN_FORMAT_UYVY 16 bits per pixel packed YUV format. YUV 4:2:2 — Y sample at every pixel, U and V sampled at every second pixel horizontally on each line. A macropixel contains 2 pixels in 1 u_int32.
SCREEN_FORMAT_YUY2 16 bits per pixel packed YUV format. YUV 4:2:2 as in UYVY, but with different component ordering within the u_int32 macropixel.
SCREEN_FORMAT_YVYU 16 bits per pixel packed YUV format. YUV 4:2:2 as for UYVY, but with different component ordering within the u_int32 macropixel.
SCREEN_FORMAT_V422 Packed YUV format. Inverted version of UYVY.
SCREEN_FORMAT_AYUV Packed YUV format. Combined YUV and alpha.