Enumeration Case

MTLPixelFormat.bgra10_xr_srgb

A 64-bit extended range pixel format with sRGB conversion and four fixed-point components: 10-bit blue, 10-bit green, 10-bit red, and 10-bit alpha.

Declaration

Current

case bgra10_xr_srgb = 553

Previous

case bgra10_XR_sRGB = 553

Discussion

Pixel data is stored in blue, green, red, and alpha order, from least significant bit to most significant bit. Each component is stored in a 16-bit chunk that's arranged as follows:

  • The 10 left-most bits store the component's data.

  • The 6 right-most bits are used as padding, and their value is 0.

Bit layout diagram showing the pixel data storage arrangement of the bgra10_XR_sRGB pixel format. The blue component is stored in bits 6 to 15, the green component is stored in bits 22 to 31, the red component is stored in bits 38 to 47, and the alpha component is stored in bits 54 to 63. Bits 0 to 5, 16 to 21, 32 to 37, and 48 to 53 are used as padding.

The blue, green, and red components are gamma encoded, and their values range from -0.5271 to 1.66894, before gamma expansion. The alpha component is always clamped to a [0.0, 1.0] range in sampling, rendering, and writing operations, despite supporting values outside this range.

To display wide color values on devices with wide color displays, you can set this pixel format on the colorPixelFormat property of an MTKView or the pixelFormat property of a CAMetalLayer.

See Also

Extended Range and Wide Color Pixel Formats

case bgra10_xr

A 64-bit extended range pixel format with four fixed-point components: 10-bit blue, 10-bit green, 10-bit red, and 10-bit alpha.

case bgr10_xr

A 32-bit extended range pixel format with three fixed-point components: 10-bit blue, 10-bit green, and 10-bit red.

case bgr10_xr_srgb

A 32-bit extended range pixel format with sRGB conversion and three fixed-point components: 10-bit blue, 10-bit green, and 10-bit red.

case bgr10a2Unorm

A 32-bit packed pixel format with four normalized unsigned integer components: 10-bit blue, 10-bit green, 10-bit red, and 2-bit alpha.