Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 4 - Color QuickDraw / Color QuickDraw Reference
Data Structures /


ColorTable

When creating a PixMap record (described on page 4-37) for a particular graphics device, Color QuickDraw creates a ColorTable record that defines the best colors available for the pixel image on that particular graphics device. The Color Manager also creates a ColorTable record of all available colors for use by the CLUT on indexed devices.

Typically, your application needs to create ColorTable records only if it uses the Palette Manager, as described in the chapter "Palette Manager" in Inside Macintosh: Advanced Color Imaging. The data structure of type ColorTable is shown here.

TYPE CTabHandle   =\xF0^CTabPtr;
CTabPtr           =\xF0^ColorTable;
ColorTable        =\xF0
RECORD
   ctSeed:  LongInt;    {unique identifier from table}
   ctFlags: Integer;    {flags describing the value in the }
                        { ctTable field; clear for a pixel map}
   ctSize:\xF0 Integer;    {number\xF0of\xF0entries\xF0in\xF0the next field }
                        { minus 1}
   ctTable: cSpecArray; {an array of ColorSpec records}
END;
Field Description
ctSeed
Identifies a particular instance of a color table. The Color Manager uses the ctSeed value to compare an indexed device's color table with its associated inverse table (a table it uses for fast color lookup). When the color table for a graphics device has been changed, the Color Manager needs to rebuild the inverse table. See the chapter "Color Manager" in Advanced Color Imaging on the Mac OS for more information on inverse tables.
ctFlags
Flags that distinguish pixel map color tables from color tables in GDevice records (which are described in the chapter "Graphics Devices" in this book).
ctSize
One less than the number of entries in the table.
ctTable
An array of ColorSpec entries, each containing a pixel value and a color specified by an RGBColor record, as described in the previous section.
Your application should never need to directly change the fields of a ColorTable record. If you find it absolutely necessary for your application to so, immediately use the CTabChanged procedure to notify Color QuickDraw that your application has changed the ColorTable record. The CTabChanged procedure is described on page 4-88.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996