Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

pi_app.h

Go to the documentation of this file.
00001 /* 00002 File: PI_App.h 00003 00004 Contains: 00005 00006 Written by: U. J. Krabbenhoeft 00007 00008 Version: 00009 00010 Copyright: � 1993-1997 by Heidelberger Druckmaschinen AG, all rights reserved. 00011 00012 */ 00013 00014 #ifndef PI_Application_h 00015 #define PI_Application_h 00016 00017 #ifndef PI_Machine_h 00018 /*#include "PI_Machine.h"*/ 00019 #endif 00020 00021 #define CM_MAX_COLOR_CHANNELS 8 00022 typedef unsigned long CMBitmapColorSpace; 00023 typedef long CMError; 00024 typedef unsigned int PI_OSType; 00025 typedef struct CMPrivateProfileRecord *CMProfileRef; 00026 00027 #ifndef LHApplication_h 00028 #include "App.h" 00029 #endif 00030 00031 #ifdef MS_Icm 00032 #include "Windef.h" 00033 #include "WinGdi.h" 00034 #include <wtypes.h> 00035 #include "icm.h" 00036 #endif 00037 00038 struct PI_NAMEDCOLOR { 00039 unsigned long namedColorIndex; 00040 char *pName; 00041 }; 00042 00043 struct PI_GRAYCOLOR { 00044 unsigned short gray; 00045 }; 00046 00047 struct PI_RGBCOLOR { 00048 unsigned short red; 00049 unsigned short green; 00050 unsigned short blue; 00051 }; 00052 00053 struct PI_CMYKCOLOR { 00054 unsigned short cyan; 00055 unsigned short magenta; 00056 unsigned short yellow; 00057 unsigned short black; 00058 }; 00059 00060 struct PI_XYZCOLOR { 00061 unsigned short X; 00062 unsigned short Y; 00063 unsigned short Z; 00064 }; 00065 00066 struct PI_YxyCOLOR { 00067 unsigned short Y; 00068 unsigned short x; 00069 unsigned short y; 00070 }; 00071 00072 struct PI_LabCOLOR { 00073 unsigned short L; 00074 unsigned short a; 00075 unsigned short b; 00076 }; 00077 00078 struct PI_GENERIC3CHANNEL { 00079 unsigned short ch1; 00080 unsigned short ch2; 00081 unsigned short ch3; 00082 }; 00083 00084 struct PI_HiFiCOLOR { 00085 unsigned char channel[CM_MAX_COLOR_CHANNELS]; 00086 }; 00087 00088 00089 typedef union CMColor { 00090 struct PI_GRAYCOLOR gray; 00091 struct PI_RGBCOLOR rgb; 00092 struct PI_CMYKCOLOR cmyk; 00093 struct PI_XYZCOLOR XYZ; 00094 struct PI_YxyCOLOR Yxy; 00095 struct PI_LabCOLOR Lab; 00096 struct PI_GENERIC3CHANNEL gen3ch; 00097 struct PI_NAMEDCOLOR namedColor; 00098 struct PI_HiFiCOLOR hifi; 00099 } CMColor; 00100 00101 #ifdef MS_Icm 00102 enum { 00103 /* General Errors */ 00104 cmopenErr = -200, /* I/O Error used in ProfileAccess.c only */ 00105 cmparamErr = ERROR_INVALID_PARAMETER, 00106 00107 cmProfileError = ERROR_INVALID_PROFILE, 00108 cmMethodError = -203, /* This is an internal error, no CalcFunction found */ 00109 cmCantConcatenateError = -208, /* No concatenation possible */ 00110 00111 cmInvalidColorSpace = ERROR_COLORSPACE_MISMATCH, /* no match between Profile colorspace bitmap type */ 00112 cmInvalidSrcMap = -210, /* Source bitmap color space is invalid */ 00113 cmInvalidDstMap = -211, /* Destination bitmap color space is invalid */ 00114 00115 cmNamedColorNotFound = ERROR_INVALID_COLORINDEX, /* index > count of named colors */ 00116 00117 cmElementTagNotFound = ERROR_TAG_NOT_FOUND, 00118 00119 userCanceledErr = -128, /* callback proc returned to cancel calculation */ 00120 badProfileError = ERROR_INVALID_PROFILE, /* header->magic != icMagicNumber used in ProfileAccess.c only */ 00121 memFullErr = ERROR_NOT_ENOUGH_MEMORY 00122 }; 00123 #else 00124 enum cmErrorCodes{ 00125 /* General Errors */ 00126 cmopenErr = -200, /* I/O Error used in ProfileAccess.c only */ 00127 cmparamErr = 86, 00128 00129 cmProfileError = 2301, 00130 cmMethodError = -203, /* This is an internal error, no CalcFunction found */ 00131 cmCantConcatenateError = -208, /* No concatenation possible */ 00132 00133 cmInvalidColorSpace = -209, /* no match between Profile colorspace bitmap type */ 00134 cmInvalidSrcMap = -210, /* Source bitmap color space is invalid */ 00135 cmInvalidDstMap = -211, /* Destination bitmap color space is invalid */ 00136 00137 cmNamedColorNotFound = -216, /* index > count of named colors */ 00138 00139 cmElementTagNotFound = 2302, 00140 00141 userCanceledErr = -128, /* callback proc returned to cancel calculation */ 00142 badProfileError = -228, /* header->magic != icMagicNumber used in ProfileAccess.c only */ 00143 memFullErr = 8 00144 }; 00145 #endif 00146 00147 #if RenderInt 00148 #define CallCMBitmapCallBackProc(f,a,b,c) (!((*f)(a,b,c))) 00149 #else 00150 #define CallCMBitmapCallBackProc(f,a,b,c ) ((*f)((a)-(b),c)) 00151 #endif 00152 00153 #ifdef __cplusplus 00154 extern "C" { 00155 #endif 00156 00157 #if PRAGMA_ALIGN_SUPPORTED 00158 #pragma options align=mac68k 00159 #endif 00160 00161 #if PRAGMA_IMPORT_SUPPORTED 00162 #pragma import on 00163 #endif 00164 00165 typedef icHeader CMCoreProfileHeader; 00166 00167 00168 /* Param for CWConcatColorWorld() */ 00169 struct CMConcatProfileSet { 00170 unsigned short keyIndex; /* Zero-based */ 00171 unsigned short count; /* Min 1 */ 00172 CMProfileRef profileSet[1]; /* Variable. Ordered from Source -> Dest */ 00173 }; 00174 typedef struct CMConcatProfileSet CMConcatProfileSet; 00175 00176 typedef icDateTimeNumber CMDateTime; 00177 struct CMUniqueIdentification { 00178 icHeader profileHeader; 00179 CMDateTime calibrationDate; 00180 unsigned long ASCIIProfileDescriptionLen; 00181 char ASCIIProfileDescription[1]; /* variable length */ 00182 }; 00183 typedef struct CMUniqueIdentification CMUniqueIdentification; 00184 00185 00186 enum { 00187 cmNoColorPacking = 0x0000, 00188 cmAlphaSpace = 0x0080, 00189 cmWord5ColorPacking = 0x0500, 00190 cmWord565ColorPacking = 0x0600, 00191 cmLong8ColorPacking = 0x0800, 00192 cmLong10ColorPacking = 0x0A00, 00193 cmAlphaFirstPacking = 0x1000, 00194 cmOneBitDirectPacking = 0x0B00, /* for gamut check. highest bit first */ 00195 cmAlphaLastPacking = 0x0000, 00196 cm8PerChannelPacking = 0x2000, 00197 cm10PerChannelPacking = 0x0A00, 00198 cm16PerChannelPacking = 0x4000, 00199 00200 cm32_32ColorPacking = 0x2700 00201 }; 00202 00203 00204 enum { 00205 cmNoSpace = 0, 00206 cmRGBSpace = 1, 00207 cmCMYKSpace = 2, 00208 cmHSVSpace = 3, 00209 cmHLSSpace = 4, 00210 cmYXYSpace = 5, 00211 cmXYZSpace = 6, 00212 cmLUVSpace = 7, 00213 cmLABSpace = 8, 00214 cmCMYSpace = 9, 00215 cmGraySpace = 10, 00216 cmReservedSpace2 = 11, 00217 cmGamutResultSpace = 12, 00218 00219 cmGenericSpace = 13, /*UWE: GenericDataFormat */ 00220 cmBGRSpace = 14, /*UWE: BGR */ 00221 cmYCCSpace = 15, /*UWE: YCC */ 00222 cmNamedIndexedSpace = 16, /* */ 00223 00224 cmMCFiveSpace = 17, 00225 cmMCSixSpace = 18, 00226 cmMCSevenSpace = 19, 00227 cmMCEightSpace = 20, 00228 00229 cmKYMCSpace = 29, 00230 cmRGBASpace = cmRGBSpace + cmAlphaSpace, 00231 cmGrayASpace = cmGraySpace + cmAlphaSpace, 00232 cmRGB16Space = cmWord5ColorPacking + cmRGBSpace, 00233 cmRGB16_565Space = cmWord565ColorPacking + cmRGBSpace, 00234 cmRGB32Space = cmLong8ColorPacking + cmRGBSpace, 00235 cmARGB32Space = cmLong8ColorPacking + cmAlphaFirstPacking + cmRGBASpace, 00236 cmCMYK32Space = cmLong8ColorPacking + cmCMYKSpace, 00237 cmKYMC32Space = cmLong8ColorPacking + cmKYMCSpace, 00238 cmHSV32Space = cmLong10ColorPacking + cmHSVSpace, 00239 cmHLS32Space = cmLong10ColorPacking + cmHLSSpace, 00240 cmYXY32Space = cmLong10ColorPacking + cmYXYSpace, 00241 cmXYZ32Space = cmLong10ColorPacking + cmXYZSpace, 00242 cmLUV32Space = cmLong10ColorPacking + cmLUVSpace, 00243 cmLAB32Space = cmLong10ColorPacking + cmLABSpace, 00244 cmGamutResult1Space = cmOneBitDirectPacking + cmGamutResultSpace, 00245 cmRGB24Space = cm8PerChannelPacking + cmRGBSpace, 00246 cmRGBA32Space = cm8PerChannelPacking + cmAlphaLastPacking + cmRGBASpace, 00247 cmCMY24Space = cm8PerChannelPacking + cmCMYSpace, 00248 cmLAB24Space = cm8PerChannelPacking + cmLABSpace, 00249 00250 cmGraySpace8Bit = cmGraySpace + cm8PerChannelPacking, 00251 cmYCC24Space = cm8PerChannelPacking + cmYCCSpace, 00252 cmYCC32Space = cmLong8ColorPacking + cmYCCSpace, 00253 cmYCCASpace = cmYCCSpace + cmAlphaSpace, 00254 cmYCCA32Space = cm8PerChannelPacking + cmAlphaLastPacking + cmYCCASpace, 00255 cmAYCC32Space = cmLong8ColorPacking + cmAlphaFirstPacking + cmYCCASpace, 00256 cmBGR24Space = cm8PerChannelPacking + cmBGRSpace, 00257 cmBGR32Space = cmLong8ColorPacking + cmBGRSpace + cmAlphaSpace, 00258 00259 cmNamedIndexed24Space = cmNamedIndexedSpace, 00260 cmNamedIndexed32Space = cm32_32ColorPacking + cmNamedIndexedSpace, 00261 00262 cmMCFive8Space = cmMCFiveSpace + cm8PerChannelPacking, 00263 cmMCSix8Space = cmMCSixSpace + cm8PerChannelPacking, 00264 cmMCSeven8Space = cmMCSevenSpace + cm8PerChannelPacking, 00265 cmMCEight8Space = cmMCEightSpace + cm8PerChannelPacking 00266 #if ( CM_MAX_COLOR_CHANNELS == 16 ) 00267 , 00268 cmMC9Space = cmMCEight8Space + 1, 00269 cmMCaSpace = cmMCEight8Space + 2, 00270 cmMCbSpace = cmMCEight8Space + 3, 00271 cmMCcSpace = cmMCEight8Space + 4, 00272 cmMCdSpace = cmMCEight8Space + 5, 00273 cmMCeSpace = cmMCEight8Space + 6, 00274 cmMCfSpace = cmMCEight8Space + 7, 00275 cmMC2Space = cmMCEight8Space + 8, 00276 cmMC98Space = cmMC9Space + cm8PerChannelPacking, 00277 cmMCa8Space = cmMCaSpace + cm8PerChannelPacking, 00278 cmMCb8Space = cmMCbSpace + cm8PerChannelPacking, 00279 cmMCc8Space = cmMCcSpace + cm8PerChannelPacking, 00280 cmMCd8Space = cmMCdSpace + cm8PerChannelPacking, 00281 cmMCe8Space = cmMCeSpace + cm8PerChannelPacking, 00282 cmMCf8Space = cmMCfSpace + cm8PerChannelPacking, 00283 cmMC28Space = cmMC2Space + cm8PerChannelPacking 00284 #endif 00285 }; 00286 00287 struct CMBitmap { 00288 char * image; /* pointer to image data */ 00289 long width; /* count of pixel in one line */ 00290 long height; /* count of lines */ 00291 long rowBytes; /* offset in bytes from one line to next line */ 00292 long pixelSize; /* not used */ 00293 CMBitmapColorSpace space; /* color space see above, e.g. cmRGB24Space */ 00294 long user1; /* not used */ 00295 long user2; /* not used */ 00296 }; 00297 typedef struct CMBitmap CMBitmap; 00298 00299 typedef char CMColorName[32]; 00300 typedef CMColorName *pCMColorName; 00301 typedef const CMColorName *pcCMColorName; 00302 typedef struct tagCMNamedProfileInfo{ 00303 unsigned long dwVendorFlags; 00304 unsigned long dwCount; 00305 unsigned long dwCountDevCoordinates; 00306 CMColorName szPrefix; 00307 CMColorName szSuffix; 00308 }CMNamedProfileInfo; 00309 typedef CMNamedProfileInfo *pCMNamedProfileInfo; 00310 00311 /* rendering intent element values */ 00312 00313 enum { 00314 cmPerceptual = 0, /* Photographic images */ 00315 cmRelativeColorimetric = 1, /* Logo Colors */ 00316 cmSaturation = 2, /* Business graphics */ 00317 cmAbsoluteColorimetric = 3 /* Logo Colors */ 00318 }; 00319 00320 /* speed and quality flag options */ 00321 enum { 00322 cmNormalMode = 0, /* it uses the least significent two bits in the high word of flag */ 00323 cmDraftMode = 1, /* it should be evaulated like this: right shift 16 bits first, mask off the */ 00324 cmBestMode = 2, /* high 14 bits, and then compare with the enum to determine the option value. Do NOT shift if CWConcatColorWorld4MS is used */ 00325 cmBestMode16Bit = 3 /* calculate 16 bit combi LUT */ 00326 }; 00327 00328 /* constants for the profheader-flags */ 00329 #define kQualityMask 0x00030000 /* see Modes obove ( e.g. cmBestMode<<16 ) */ 00330 #define kLookupOnlyMask 0x00040000 00331 #define kCreateGamutLutMask 0x00080000 /* Set Bit disables gamut lut creation */ 00332 #define kUseRelColorimetric 0x00100000 00333 #define kStartWithXyzPCS 0x00200000 00334 #define kStartWithLabPCS 0x00400000 00335 #define kEndWithXyzPCS 0x00800000 00336 #define kEndWithLabPCS 0x01000000 00337 00338 typedef unsigned char PI_Boolean; 00339 00340 #if RenderInt 00341 typedef PI_Boolean (__stdcall *CMBitmapCallBackProcPtr)(long max, long progress, void *refCon); 00342 #else 00343 typedef PI_Boolean (*CMBitmapCallBackProcPtr)(long progress, void *refCon); 00344 #endif 00345 typedef CMBitmapCallBackProcPtr CMBitmapCallBackUPP; 00346 00347 /* Abstract data type for ColorWorld reference */ 00348 typedef struct CMPrivateColorWorldRecord *CMWorldRef; 00349 00350 /* Profile file and element access */ 00351 extern PI_Boolean CMProfileElementExists(CMProfileRef prof, PI_OSType tag); 00352 extern CMError CMGetProfileElement(CMProfileRef prof, PI_OSType tag, unsigned long *elementSize, void *elementData); 00353 extern CMError CMGetProfileHeader(CMProfileRef prof, CMCoreProfileHeader *header); 00354 extern CMError CMGetPartialProfileElement(CMProfileRef prof, PI_OSType tag, unsigned long offset, unsigned long *byteCount, void *elementData); 00355 extern CMError CMSetProfileElementSize(CMProfileRef prof, PI_OSType tag, unsigned long elementSize); 00356 extern CMError CMSetPartialProfileElement(CMProfileRef prof, PI_OSType tag, unsigned long offset, unsigned long byteCount, void *elementData); 00357 extern CMError CMSetProfileElement(CMProfileRef prof, PI_OSType tag, unsigned long elementSize, void *elementData); 00358 extern CMError CMSetProfileHeader(CMProfileRef prof, const CMCoreProfileHeader *header); 00359 /* Low-level matching functions */ 00360 extern CMError CWNewColorWorld(CMWorldRef *cw, CMProfileRef src, CMProfileRef dst); 00361 extern CMError CWConcatColorWorld(CMWorldRef *cw, CMConcatProfileSet *profileSet); 00362 extern CMError CWConcatColorWorld4MS ( CMWorldRef *storage, CMConcatProfileSet *profileSet, 00363 UINT32 *aIntentArr, UINT32 nIntents, 00364 UINT32 dwFlags ); 00365 extern CMError CWCreateLink4MS( CMWorldRef storage, CMConcatProfileSet *profileSet, UINT32 aIntentArr, icProfile **theLinkProfile ); 00366 extern CMError CWLinkColorWorld(CMWorldRef *cw, CMConcatProfileSet *profileSet); 00367 extern void CWDisposeColorWorld(CMWorldRef cw); 00368 extern CMError CWMatchColors(CMWorldRef cw, CMColor *myColors, unsigned long count); 00369 extern CMError CWCheckColors(CMWorldRef cw, CMColor *myColors, unsigned long count, unsigned char *result); 00370 extern CMError CWCheckColorsMS(CMWorldRef cw, CMColor *myColors, unsigned long count, unsigned char *result); 00371 extern CMError CWGetColorSpaces(CMWorldRef cw, CMBitmapColorSpace *In, CMBitmapColorSpace *Out ); 00372 /* Bitmap matching */ 00373 extern CMError CWMatchBitmap(CMWorldRef cw, CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *matchedBitmap); 00374 extern CMError CWCheckBitmap(CMWorldRef cw, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *resultBitmap); 00375 extern CMError CWMatchBitmapPlane(CMWorldRef cw, LH_CMBitmapPlane *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, LH_CMBitmapPlane *matchedBitmap); 00376 extern CMError CWCheckBitmapPlane(CMWorldRef cw, LH_CMBitmapPlane *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, LH_CMBitmapPlane *matchedBitmap); 00377 00378 extern void CMFullColorRemains( CMWorldRef Storage, long ColorMask ); /* Special function for cmyk to cmyk match */ 00379 extern void CMSetLookupOnlyMode( CMWorldRef Storage, PI_Boolean Mode ); /* Special function for setting or resetting LookupOnly Mode after NCMInit.., CMConcat.. */ 00380 extern CMError CMValidateProfile( CMProfileRef prof, PI_Boolean* valid ); 00381 00382 extern CMError CMConvNameToIndexProfile( CMProfileRef prof, pcCMColorName, unsigned long *, unsigned long ); 00383 extern CMError CMConvNameToIndexCW( CMWorldRef *Storage, pcCMColorName, unsigned long *, unsigned long ); 00384 extern CMError CMConvIndexToNameProfile( CMProfileRef prof, unsigned long *, pCMColorName, unsigned long ); 00385 extern CMError CMConvIndexToNameCW( CMWorldRef *Storage, unsigned long *, pCMColorName, unsigned long ); 00386 extern CMError CMGetNamedProfileInfoProfile( CMProfileRef prof, pCMNamedProfileInfo ); 00387 extern CMError CMGetNamedProfileInfoCW( CMWorldRef *Storage, pCMNamedProfileInfo ); 00388 /* 00389 extern CMError CMConvertNamedIndexToPCS( CMWorldRef cw, CMColor *theData, unsigned long pixCnt ); 00390 extern CMError CMConvertNamedIndexToColors( CMWorldRef cw, CMColor *theData, unsigned long pixCnt ); 00391 extern CMError CMConvertNamedIndexBitMap( CMWorldRef cw, CMBitmap *BitMap, CMBitmap *resultBitMap ); 00392 */ 00393 #if PRAGMA_IMPORT_SUPPORTED 00394 #pragma import off 00395 #endif 00396 00397 #if PRAGMA_ALIGN_SUPPORTED 00398 #pragma options align=reset 00399 #endif 00400 00401 #ifdef __cplusplus 00402 } 00403 #endif 00404 00405 00406 #endif

Generated on Sat May 15 19:41:09 2004 for test by doxygen 1.3.7