Important: The information in this document is obsolete and should not be used for new development.
Data Structures
This section shows the Pascal data structures for thePixMap,CGrafPort,RGBColor,ColorSpec,ColorTable,MatchRec,PixPat,CQDProcs, andGrafVarsrecords.Analogous to the bitmap that basic QuickDraw uses to describe a bit image, a pixel map is used by Color QuickDraw to describe a pixel image. A pixel map, which is a data structure of type
PixMap, contains information about the dimensions and contents of a pixel image, as well as information about the image's storage format, depth, resolution, and color usage.As a basic graphics port (described in the chapter "Basic QuickDraw") defines the black-and-white and basic eight-color drawing environment for basic QuickDraw, a color graphics port defines the more sophisticated color drawing environment for Color QuickDraw. A color graphics port is defined by a data structure of type
CGrafPort.You usually specify a color to Color QuickDraw by creating an
RGBColorrecord in which you assign the red, green, and blue values of the color. For example, when you want to set the foreground color for drawing, you create anRGBColorrecord that defines the foreground color you desire, then you pass that record as a parameter to theRGBForeColorprocedure.When creating a
PixMaprecord for an indexed device, Color QuickDraw creates aColorTablerecord that defines the best colors available for the pixel image on that graphics device. The Color Manager also stores aColorTablerecord for the currently available colors in the graphics device's CLUT.One of the fields in a
ColorTablerecord requires a value of typecSpecArray, which is defined as an array ofColorSpecrecords. Typically, your application needs to createColorTablerecords andColorSpecrecords only if it uses the Palette Manager, as described in the chapter "Palette Manager" in Advanced Color Imaging on the Mac OS.You can customize the
SeedCFillandCalcCMaskprocedures by writing your own color search functions and pointing to them in thematchProcparameters for these procedures. WhenSeedCFillorCalcCMaskcalls your color search function, theGDRefConfield of the currentGDevicerecord (described in the chapter "Graphics Devices") contains a pointer to aMatchRecrecord. This record contains the RGB value of the seed pixel or seed color for which your color search function should search.Your application typically does not create
PixPatrecords. Although you can createPixPatrecords in your program code, it is usually easier to create pixel patterns using the pixel pattern resource, which is described on page 4-94.You need to use the
CQDProcsrecord only if you customize one or more of QuickDraw's low-level drawing routines.Finally, the
GrafVarsrecord contains color information that supplements the information in theCGrafPortrecord, of which it is logically a part.