PATHMac OS 8 Developer Documentation > Mutlimedia and Graphics > ColorSync Manager >

Managing Color With ColorSync


Color Packing for Color Spaces

Changed in ColorSync 2.5

The ColorSync bitmap data type CMBitmap 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 the constants described in Abstract Color Space Constants to create values that identify a bitmap's color space. Your application does not specify color packing constants directly, but rather uses the combined constants, which are described in Color Space Constants With Packing Formats .

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,
    cm48_16ColorPacking     = 0x2900,
    cm64_16ColorPacking     = 0x2A00
};

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 16-bits, 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 the function CWCheckBitMap ; 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.
cm48_16ColorPacking
The color values for three 16-bit color channels are stored in 48 consecutive bits.
cm64_16ColorPacking
The color values for four 16-bit color channels are stored in 64 consecutive bits.

VERSION NOTES

The constants cm48_16ColorPacking and cm64_16ColorPacking were added in ColorSync version 2.5.


© 1988-1999 Apple Computer, Inc. — (Last Updated 20 Jan 99)