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

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