Important: The information in this document is obsolete and should not be used for new development.
Color Packing for Color Spaces
The ColorSync Manager bitmapCMBitMap
data type (page 3-61) includes a field that identifies the color space in which the color values of the bitmap image are expressed. The following enumeration defines the types of packing for a color space's storage format. The enumeration also defines an alpha channel that can be added as a component of a color value to define the degree of opacity or transparency of a color. These constants are combined with abstract data color space constants (page 3-23) to create values that identify a bitmap's color space (page 3-26). Your application does not specify color packing constants directly.
enum { cmNoColorPacking = 0x0000, cmAlphaSpace = 0x0080, cmWord5ColorPacking= 0x0500, cmLong8ColorPacking= 0x0800, cmLong10ColorPacking= 0x0a00, cmAlphaFirstPacking= 0x1000, cmOneBitDirectPacking= 0x0b00 cmAlphaLastPacking= 0x0000, cm24_8ColorPacking= 0x2100, cm32_8ColorPacking= cmLong8ColorPacking, cm40_8ColorPacking= 0x2200, cm48_8ColorPacking= 0x2300, cm56_8ColorPacking= 0x2400, cm64_8ColorPacking= 0x2500, cm32_16ColorPacking= 0x2600, cm32_32ColorPacking= 0x2700 };Enumerator descriptions
cmNoColorPacking
- This constant is not used for ColorSync bitmaps.
cmAlphaSpace
- An alpha channel component is added to the color value.
cmWord5ColorPacking
- The color values for three 5-bit color channels are stored consecutively in a 16-bit word, with the highest order bit unused.
cmLong8ColorPacking
- The color values for three or four 8-bit color channels are stored consecutively in a 32-bit long. For three channels, this constant is combined with either cmAlphaFirstPacking or cmAlphaLastPacking to indicate whether the unused eight bits are located at the beginning or end.
cmLong10ColorPacking
- The color values for three 10-bit color channels are stored consecutively in a 32-bit long, with the two highest order bits unused.
cmAlphaFirstPacking
- An alpha channel is added to the color value as its first component.
cmOneBitDirectPacking
- One bit is used as the pixel format. This storage format is used by the resulting bitmap pointed to by the
resultBitMap
field of theCWCheckBitMap
function (page 3-123); the bitmap must be only 1 bit deep.- cm24_8ColorPacking
- The color values for three 8-bit color channels are stored in consecutive bytes, for a total of 24 bits.
- cm32_8ColorPacking
- The color values for four 8-bit color channels are stored in consecutive bytes, for a total of 32 bits.
- cm40_8ColorPacking
- The color values for five 8-bit color channels are stored in consecutive bytes, for a total of 40 bits.
- cm48_8ColorPacking
- The color values for six 8-bit color channels are stored in consecutive bytes, for a total of 48 bits.
- cm56_8ColorPacking
- The color values for seven 8-bit color channels are stored in consecutive bytes, for a total of 56 bits.
- cm64_8ColorPacking
- The color values for eight 8-bit color channels are stored in consecutive bytes, for a total of 64 bits.
- cm32_16ColorPacking
- The color values for two 16-bit color channels are stored in a 32-bit word.
- cm32_32ColorPacking
- The color value for a 32-bit color channel is stored in a 32-bit word.