Important: The information in this document is obsolete and should not be used for new development.
Data StructuresThis section shows the Pascal data structures for the
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
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 an
RGBColorrecord that defines the foreground color you desire, then you pass that record as a parameter to the
When creating a
PixMaprecord for an indexed device, Color QuickDraw creates a
ColorTablerecord that defines the best colors available for the pixel image on that graphics device. The Color Manager also stores a
ColorTablerecord for the currently available colors in the graphics device's CLUT.
One of the fields in a
ColorTablerecord requires a value of type
cSpecArray, which is defined as an array of
ColorSpecrecords. Typically, your application needs to create
ColorSpecrecords 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
CalcCMaskprocedures by writing your own color search functions and pointing to them in the
matchProcparameters for these procedures. When
CalcCMaskcalls your color search function, the
GDRefConfield of the current
GDevicerecord (described in the chapter "Graphics Devices") contains a pointer to a
MatchRecrecord. 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 create
PixPatrecords 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.
GrafVarsrecord contains color information that supplements the information in the
CGrafPortrecord, of which it is logically a part.