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 on the Mac OS /
Chapter 7 - Color Manager


Summary of the Color Manager

Constants and Data Types

CONST
struct MatchRec {
   unsigned shortred;
   unsigned shortgreen;
   unsigned shortblue;
   long        matchData;
};
typedef struct MatchRec MatchRec;
struct ITab {
   long        iTabSeed;      /* copy of CTSeed from source CTable */
   short       iTabRes;       /* bits/channel resolution of iTable */
   unsigned chariTTable[1];   /* byte colortable index values */
};
typedef struct ITab ITab;
typedef ITab *ITabPtr, **ITabHandle;
struct SProcRec {
   Handle            nxtSrch;    /* handle to next SProcRec */
   ColorSearchProcPtrsrchProc; /* pointer to search function */
};
typedef struct SProcRec SProcRec;
typedef SProcRec *SProcPtr, **SProcHndl;
struct CProcRec {
   Handle            nxtComp; /* handle to next CProcRec */
   ColorComplementProcPtrcompProc;/* pointer to complement function */
};
typedef struct CProcRec CProcRec;
typedef CProcRec *CProcPtr, **CProcHndl;
struct ReqListRec {
   short reqLSize;            /* request list size */
   short reqLData[1]          /* request list data */
};
typedef struct ReqListRec ReqListRec;

Color Manager Functions

Managing Colors

pascal long Color2Index(const RGBColor *myColor); 
pascal void Index2Color(long index, 
RGBColor *aColor); 
pascal void InvertColor(RGBColor *myColor); 
pascal Boolean RealColor(const RGBColor *color); 
pascal void GetSubTable(CTabHandle myColors, 
short iTabRes, 
CTabHandle targetTbl); 
pascal void MakeITable (CTabHandle cTabH, 
ITabHandle iTabH, 
short res); 

Managing Color Tables

pascal long GetCTSeed(void); 
pascal void ProtectEntry(short index, 
Boolean protect); 
pascal void ReserveEntry(short index, 
Boolean reserve); 
pascal void SetEntries(short start, 
short count, 
CSpecArray aTable); 
pascal void SaveEntries(CTabHandle srcTable, 
CTabHandle resultTable, 
ReqListRec*selection); 
pascal void RestoreEntries (CTabHandle srcTable, 
CTabHandle dstTable, 
ReqListRec *selection); 

Operations on Search and Complement Functions

pascal void AddSearch(ColorSearchProcPtr searchProc); 
pascal void AddComp(ColorComplementProcPtr compProc); 
pascal void DelSearch(ColorSearchProcPtr searchProc); 
pascal void DelComp(ColorComplementProcPtr compProc); 
pascal void SetClientID(short id); 

Application-Defined Functions

pascal Boolean MySearchProc(RGBColor *rgb,
long *position);
pascal void MyCompProc	(RGBColor *rgb);


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1996