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
, andGrafVars
records.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
RGBColor
record 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 anRGBColor
record that defines the foreground color you desire, then you pass that record as a parameter to theRGBForeColor
procedure.When creating a
PixMap
record for an indexed device, Color QuickDraw creates aColorTable
record that defines the best colors available for the pixel image on that graphics device. The Color Manager also stores aColorTable
record for the currently available colors in the graphics device's CLUT.One of the fields in a
ColorTable
record requires a value of typecSpecArray
, which is defined as an array ofColorSpec
records. Typically, your application needs to createColorTable
records andColorSpec
records 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
SeedCFill
andCalcCMask
procedures by writing your own color search functions and pointing to them in thematchProc
parameters for these procedures. WhenSeedCFill
orCalcCMask
calls your color search function, theGDRefCon
field of the currentGDevice
record (described in the chapter "Graphics Devices") contains a pointer to aMatchRec
record. 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
PixPat
records. Although you can createPixPat
records 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
CQDProcs
record only if you customize one or more of QuickDraw's low-level drawing routines.Finally, the
GrafVars
record contains color information that supplements the information in theCGrafPort
record, of which it is logically a part.