The data formats that describe the organization and characteristics of individual pixels in a texture.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
There are three varieties of pixel formats: ordinary, packed, and compressed. For ordinary and packed formats, the name of the pixel format specifies the order of components (such as
BGRA), bits per component (such as
32), and data type for the component (such as
Unorm). If the pixel format name has the
_s suffix, then sRGB gamma compression and decompression are applied during the reading and writing of color values in the pixel. For compressed formats, the name of the pixel format specifies a compression family (such as
The storage size of each pixel format is determined by the sum of its components. For example, the storage size of
BGRA8Unorm is 32 bits (four 8-bit components) and the storage size of
BGR5A1Unorm is 16 bits (three 5-bit components and one 1-bit component).
For normalized signed integer formats (
Snorm), component values in the range
[-1 are stored as
MIN is the greatest negative integer and
MAX is the greatest positive integer that can be stored, given the bit size of the component. For normalized unsigned integer formats (
Unorm), component values in the range
[0 are stored as
[0, MAX, where
MAX is the greatest unsigned integer that can be stored, given the bit size of the component.
Format data is stored in little-endian order (that is, the least-significant byte in the least-significant address). For formats with components that are themselves byte-aligned and more than one byte, the components are little-endian.