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: Advanced Color Imaging Reference /
Chapter 5 - Color Manager Reference /
Color Manager Functions / Managing Colors


GetSubTable

Used by system software to search one color table for the best matches to colors in another color table. You can use this function to determine the best indexes in the current GDevice data structure's CLUT for a set of colors in your application's color table.

pascal void GetSubTable (
CTabHandle myColors, 
short iTabRes,
CTabHandle targetTbl);
myColors
A handle to a color table containing the colors for which you want matches.
iTabRes
The resolution of the inverse table to be used.
targetTbl
A handle to a color table whose colors are to be matched.
DISCUSSION
The GetSubTable function searches one color table for the best matches to colors in another color table. Supply the colors you want matched in the myColors parameter. Supply the color table to be searched in the targetTbl parameter. GetSubTable stores indexes from the color table in targetTbl in the value field of the color table in the myColors parameter.

The Color Manager uses the Color2Index function for each RGBColor data structure in the color table of the myColors parameter. It determines the best match in the target table and stores that index value in the color table of the myColors parameter.

If you supply NULL for targetTbl, then the Color Manager searches the current GDevice data structure's CLUT, and uses its inverse table. Otherwise a temporary inverse table is built, with a resolution of the value in the iTabRes parameter.

SPECIAL CONSIDERATIONS
Depending on the requested resolution, building the inverse table can require large amounts of temporary space in the application heap: twice the size of the table itself, plus a fixed overhead of 3-15 KB for each inverse table resolution.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996