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

getcrd.c File Reference

#include "generic.h"

Go to the source code of this file.

Defines

#define ICMSEG
#define REVCURVE_RATIO   2

Functions

SINT EXTERN CreateLutCRD (CHANDLE cp, SINT Index, MEMPTR lpMem, DWORD InputIntent, BOOL AllowBinary)
BOOL GetRevCurve (MEMPTR lpBuff, MEMPTR lpCurve, MEMPTR lpRevCurve)
SINT EXTERN CreateMonoCRD (CHANDLE cp, SINT Index, MEMPTR lpMem, DWORD InputIntent)
BOOL EXTERN GetPS2ColorRenderingDictionary (CHANDLE cp, DWORD Intent, MEMPTR lpMem, LPDWORD lpcbSize, BOOL AllowBinary)

Variables

char ICMSEG BeginString [] = "<"
char ICMSEG EndString [] = ">"
char ICMSEG BeginArray [] = "["
char ICMSEG EndArray [] = "]"
char ICMSEG BeginFunction [] = "{"
char ICMSEG EndFunction [] = "}bind "
char ICMSEG BeginDict [] = "<<"
char ICMSEG EndDict [] = ">>"
char ICMSEG BlackPoint [] = "[0 0 0]"
char ICMSEG DictType [] = "/ColorRenderingType 1 "
char ICMSEG WhitePointTag [] = "/WhitePoint "
char ICMSEG BlackPointTag [] = "/BlackPoint "
char ICMSEG RangePQRTag [] = "/RangePQR "
char ICMSEG TransformPQRTag [] = "/TransformPQR "
char ICMSEG MatrixPQRTag [] = "/MatrixPQR "
char ICMSEG RangeABCTag [] = "/RangeABC "
char ICMSEG MatrixATag [] = "/MatrixA "
char ICMSEG MatrixABCTag [] = "/MatrixABC "
char ICMSEG EncodeABCTag [] = "/EncodeABC "
char ICMSEG RangeLMNTag [] = "/RangeLMN "
char ICMSEG MatrixLMNTag [] = "/MatrixLMN "
char ICMSEG EncodeLMNTag [] = "/EncodeLMN "
char ICMSEG RenderTableTag [] = "/RenderTable "
char ICMSEG CIEBasedATag [] = "/CIEBasedA "
char ICMSEG CIEBasedABCTag [] = "/CIEBasedABC "
char ICMSEG CIEBasedDEFGTag [] = "/CIEBasedDEFG "
char ICMSEG CIEBasedDEFTag [] = "/CIEBasedDEF "
char ICMSEG DecodeATag [] = "/DecodeA "
char ICMSEG DecodeABCTag [] = "/DecodeABC "
char ICMSEG DecodeLMNTag [] = "/DecodeLMN "
char ICMSEG DeviceRGBTag [] = "/DeviceRGB "
char ICMSEG DeviceCMYKTag [] = "/DeviceCMYK "
char ICMSEG DeviceGrayTag [] = "/DeviceGray "
char ICMSEG TableTag [] = "/Table "
char ICMSEG DecodeDEFGTag [] = "/DecodeDEFG "
char ICMSEG DecodeDEFTag [] = "/DecodeDEF "
char ICMSEG NullOp [] = ""
char ICMSEG DupOp [] = "dup "
char ICMSEG UserDictOp [] = "userdict "
char ICMSEG GlobalDictOp [] = "globaldict "
char ICMSEG CurrentGlobalOp [] = "currentglobal "
char ICMSEG SetGlobalOp [] = "setglobal "
char ICMSEG DefOp [] = "def "
char ICMSEG BeginOp [] = "begin "
char ICMSEG EndOp [] = "end "
char ICMSEG TrueOp [] = "true "
char ICMSEG FalseOp [] = "false "
char ICMSEG MulOp [] = "mul "
char ICMSEG DivOp [] = "div "
char ICMSEG NewLine [] = "\n"
char ICMSEG Slash [] = "/"
char ICMSEG Space [] = " "
char ICMSEG CRDBegin [] = "%** CRD Begin "
char ICMSEG CRDEnd [] = "%** CRD End "
char ICMSEG CieBasedDEFGBegin [] = "%** CieBasedDEFG CSA Begin "
char ICMSEG CieBasedDEFBegin [] = "%** CieBasedDEF CSA Begin "
char ICMSEG CieBasedABCBegin [] = "%** CieBasedABC CSA Begin "
char ICMSEG CieBasedABegin [] = "%** CieBasedA CSA Begin "
char ICMSEG CieBasedDEFGEnd [] = "%** CieBasedDEFG CSA End "
char ICMSEG CieBasedDEFEnd [] = "%** CieBasedDEF CSA End "
char ICMSEG CieBasedABCEnd [] = "%** CieBasedABC CSA End "
char ICMSEG CieBasedAEnd [] = "%** CieBasedA CSA End "
char ICMSEG RangeABC [] = "[ 0 1 0 1 0 1 ] "
char ICMSEG RangeLMN [] = "[ 0 2 0 2 0 2 ] "
char ICMSEG Identity [] = "[1 0 0 0 1 0 0 0 1]"
char ICMSEG RangeABC_Lab [] = "[0 100 -128 127 -128 127]"
char ICMSEG Clip01 [] = "dup 1.0 ge{pop 1.0}{dup 0.0 lt{pop 0.0}if}ifelse "
char ICMSEG DecodeA3 [] = "256 div exp "
char ICMSEG DecodeA3Rev [] = "256 div 1.0 exch div exp "
char ICMSEG DecodeABCArray [] = "DecodeABC_"
char ICMSEG InputArray [] = "Inp_"
char ICMSEG OutputArray [] = "Out_"
char ICMSEG PreViewInArray [] = "IPV_"
char ICMSEG PreViewOutArray [] = "OPV_"
char ICMSEG IndexArray16b []
char ICMSEG IndexArray []
char ICMSEG TestingDEFG []
char ICMSEG SupportDEFG_S [] = "SupportDEFG? { "
char ICMSEG NotSupportDEFG_S [] = "SupportDEFG? not { "
char ICMSEG SupportDEFG_E [] = "}if "
char ICMSEG StartClip [] = "dup 1.0 le{dup 0.0 ge{"
char ICMSEG EndClip [] = "}if}if "
char ICMSEG Scale8 [] = "255 div "
char ICMSEG Scale16 [] = "65535 div "
char ICMSEG Scale16XYZ [] = "32768 div "
char ICMSEG TFunction8 [] = "exch 255 mul round cvi get 255 div "
char ICMSEG TFunction8XYZ [] = "exch 255 mul round cvi get 128 div "
char ICMSEG MatrixABCLab [] = "[1 1 1 1 0 0 0 0 -1]"
char ICMSEG DecodeABCLab1 [] = "[{16 add 116 div} bind {500 div} bind {200 div} bind]"
char ICMSEG DecodeALab [] = " 50 mul 16 add 116 div "
char ICMSEG DecodeLMNLab []
char ICMSEG RangeLMNLab [] = "[0 1 0 1 0 1]"
char ICMSEG EncodeLMNLab []
char ICMSEG MatrixABCLabCRD [] = "[0 500 0 116 -500 200 0 0 -200]"
char ICMSEG MatrixABCXYZCRD [] = "[0 1 0 1 0 0 0 0 1]"
char ICMSEG EncodeABCLab1 [] = "16 sub 100 div "
char ICMSEG EncodeABCLab2 [] = "128 add 255 div "
char * TransformPQR [3]


Define Documentation

#define ICMSEG
 

#define REVCURVE_RATIO   2
 

Definition at line 5 of file dec97/dll32/getcrd.c.


Function Documentation

SINT EXTERN CreateLutCRD CHANDLE  cp,
SINT  Index,
MEMPTR  lpMem,
DWORD  InputIntent,
BOOL  AllowBinary
 

Definition at line 164 of file dec97/dll32/getcrd.c.

References AllowBinary, BeginArray, BeginDict, BeginString, CP_POSTSCRIPT_ERR, CRDBegin, CRDEnd, CreateInputArray(), CreateOutputArray(), CSIG, DictType, EnableGlobalDict(), EndArray, EndClip, EndDict, EndOp, EndString, FALSE, FAR, GetCLUTinfo(), GetCPConnSpace, GetCPElement(), GetCPElementSize(), GetCPElementType(), GetCPMediaWhitePoint(), GetCPTagSig(), GetCPWhitePoint(), GetPublicArrayName(), icAbsoluteColorimetric, icSigLut16Type, icSigLut8Type, icUInt16Number, Index, IndexArray, lpcpLut16Type, lpcpLut8Type, LPCSIG, LPMEMPTR, LPSFLOAT, LPSINT, MAX_LINELENG, MemAlloc(), MemFree(), MEMPTR, NewLine, NULL, RenderTableTag, SendCRDABC(), SendCRDBWPoint(), SendCRDLMN(), SendCRDOutputTable(), SendCRDPQR(), SetCPLastError(), SetGlobalOp, SFLOAT, SINT, StartClip, TempBfSize, ui16toSINT, WriteByteString(), WriteHex, WriteHexBuffer(), WriteInt, WriteInt2ByteString(), WriteObject, and WriteStringToken().

00165 { 00166 SINT nInputCh, nOutputCh, nGrids; 00167 SINT nInputTable, nOutputTable, nNumbers; 00168 CSIG Tag, PCS; 00169 CSIG IntentSig; 00170 00171 SINT Ret; 00172 SINT i, j; 00173 MEMPTR lpTable; 00174 00175 SFLOAT IlluminantWP[3]; 00176 SFLOAT MediaWP[3]; 00177 MEMPTR Buff = NULL; 00178 SINT MemSize = 0; 00179 MEMPTR lpOldMem = lpMem; 00180 char PublicArrayName[TempBfSize]; 00181 HGLOBAL hMem; 00182 MEMPTR lpLineStart; 00183 // Check if we can generate the CRD 00184 if (!GetCPTagSig (cp, Index, (LPCSIG) & IntentSig) || 00185 !GetCPElementType (cp, Index, (LPCSIG) & Tag) || 00186 ((Tag != icSigLut8Type) && (Tag != icSigLut16Type)) || 00187 !GetCPConnSpace (cp, (LPCSIG) & PCS) || 00188 !GetCPElementSize (cp, Index, (LPSINT) & MemSize) || 00189 !MemAlloc (MemSize, (HGLOBAL FAR *)&hMem, (LPMEMPTR) & Buff) || 00190 !GetCPElement (cp, Index, Buff, MemSize)) 00191 { 00192 if (NULL != Buff) 00193 { 00194 MemFree (hMem); 00195 } 00196 return (0); 00197 } 00198 GetCLUTinfo(Tag, Buff, &nInputCh, &nOutputCh, 00199 &nGrids, &nInputTable, &nOutputTable, &i); 00200 // Level 2 printers support only tri-component CIEBasedABC input, 00201 // but can have either 3 or 4 output channels. 00202 if (((nOutputCh != 3) && 00203 (nOutputCh != 4)) || 00204 (nInputCh != 3)) 00205 { 00206 SetCPLastError (CP_POSTSCRIPT_ERR); 00207 MemFree (hMem); 00208 return (0); 00209 } 00210 Ret = nInputCh * nInputTable * 6 + 00211 nOutputCh * nOutputTable * 6 + // Number of INT bytes 00212 nOutputCh * nGrids * nGrids * nGrids * 2 + // LUT HEX bytes 00213 nInputCh * (lstrlen (IndexArray) + 00214 lstrlen (StartClip) + 00215 lstrlen (EndClip)) + 00216 nOutputCh * (lstrlen (IndexArray) + 00217 lstrlen (StartClip) + 00218 lstrlen (EndClip)) + 00219 2048; // + other PS stuff 00220 00221 if (lpMem == NULL) // This is a size request 00222 { 00223 MemFree (hMem); 00224 return (Ret); 00225 } 00226 // Get all necessary params from the header 00227 // GetCPRenderIntent (cp, (LPCSIG) & Intent); // Get Intent 00228 GetCPWhitePoint (cp, (LPSFLOAT) & IlluminantWP); // .. Illuminant 00229 00230 // Support absolute whitePoint 00231 if (InputIntent == icAbsoluteColorimetric) 00232 { 00233 if (!GetCPMediaWhitePoint (cp, (LPSFLOAT) & MediaWP)) // .. Media WhitePoint 00234 { 00235 MediaWP[0] = IlluminantWP[0]; 00236 MediaWP[1] = IlluminantWP[1]; 00237 MediaWP[2] = IlluminantWP[2]; 00238 } 00239 } 00240 00241 //******** Define golbal array used in EncodeABC and RenderTaber 00242 GetPublicArrayName (cp, IntentSig, PublicArrayName); 00243 lpMem += WriteObject (lpMem, NewLine); 00244 lpMem += WriteObject (lpMem, CRDBegin); 00245 00246 lpMem += EnableGlobalDict(lpMem); 00247 00248 lpMem += CreateInputArray (lpMem, nInputCh, nInputTable, 00249 (MEMPTR) PublicArrayName, Tag, Buff, AllowBinary, NULL); 00250 00251 i = nInputTable * nInputCh + 00252 nGrids * nGrids * nGrids * nOutputCh; 00253 lpMem += CreateOutputArray (lpMem, nOutputCh, nOutputTable, i, 00254 (MEMPTR) PublicArrayName, Tag, Buff, AllowBinary, NULL); 00255 00256 lpMem += WriteObject (lpMem, NewLine); 00257 lpMem += WriteObject (lpMem, SetGlobalOp); 00258 lpMem += WriteObject (lpMem, EndOp); 00259 00260 00261 //************* Start writing CRD **************************** 00262 lpMem += WriteObject (lpMem, NewLine); 00263 lpMem += WriteObject (lpMem, BeginDict); // Begin dictionary 00264 lpMem += WriteObject (lpMem, DictType); // Dictionary type 00265 00266 //********** Send Black/White Point. 00267 lpMem += SendCRDBWPoint(lpMem, IlluminantWP); 00268 00269 //********** Send PQR - used for Absolute Colorimetric ***** 00270 lpMem += SendCRDPQR(lpMem, InputIntent, IlluminantWP); 00271 00272 //********** Send LMN - For Absolute Colorimetric use WhitePoint's XYZs 00273 lpMem += SendCRDLMN(lpMem, InputIntent, IlluminantWP, MediaWP, PCS); 00274 00275 // ******** Create MatrixABC and EncodeABC stuff 00276 lpMem += SendCRDABC(lpMem, PublicArrayName, 00277 PCS, nInputCh, Buff, NULL, Tag, AllowBinary); 00278 00279 //********** /RenderTable 00280 lpMem += WriteObject (lpMem, NewLine); 00281 lpMem += WriteObject (lpMem, RenderTableTag); 00282 lpMem += WriteObject (lpMem, BeginArray); 00283 00284 lpMem += WriteInt (lpMem, nGrids); // Send down Na 00285 lpMem += WriteInt (lpMem, nGrids); // Send down Nb 00286 lpMem += WriteInt (lpMem, nGrids); // Send down Nc 00287 00288 lpLineStart = lpMem; 00289 lpMem += WriteObject (lpMem, NewLine); 00290 lpMem += WriteObject (lpMem, BeginArray); 00291 nNumbers = nGrids * nGrids * nOutputCh; 00292 for (i = 0; i < nGrids; i++) // Na strings should be sent 00293 { 00294 lpMem += WriteObject (lpMem, NewLine); 00295 lpLineStart = lpMem; 00296 if (Tag == icSigLut8Type) 00297 { 00298 lpTable = (MEMPTR) (((lpcpLut8Type) Buff)->lut.data) + 00299 nInputTable * nInputCh + 00300 nNumbers * i; 00301 } else 00302 { 00303 lpTable = (MEMPTR) (((lpcpLut16Type) Buff)->lut.data) + 00304 2 * nInputTable * nInputCh + 00305 2 * nNumbers * i; 00306 } 00307 if (!AllowBinary) // Output ASCII CRD 00308 { 00309 lpMem += WriteObject (lpMem, BeginString); 00310 if (Tag == icSigLut8Type) 00311 lpMem += WriteHexBuffer (lpMem, lpTable, lpLineStart, nNumbers); 00312 else 00313 { 00314 for (j = 0; j < nNumbers; j++) 00315 { 00316 lpMem += WriteHex (lpMem, ui16toSINT (lpTable) / 256); 00317 lpTable += sizeof (icUInt16Number); 00318 if (((SINT) (lpMem - lpLineStart)) > MAX_LINELENG) 00319 { 00320 lpLineStart = lpMem; 00321 lpMem += WriteObject (lpMem, NewLine); 00322 } 00323 } 00324 } 00325 lpMem += WriteObject (lpMem, EndString); 00326 } else 00327 { // Output BINARY CRD 00328 lpMem += WriteStringToken (lpMem, 143, nNumbers); 00329 if (Tag == icSigLut8Type) 00330 lpMem += WriteByteString (lpMem, lpTable, nNumbers); 00331 else 00332 lpMem += WriteInt2ByteString (lpMem, lpTable, nNumbers); 00333 } 00334 } 00335 00336 lpMem += WriteObject (lpMem, EndArray); // End array 00337 lpMem += WriteInt (lpMem, nOutputCh); // Send down m 00338 00339 //********** Send Output Table. 00340 lpMem += SendCRDOutputTable(lpMem, PublicArrayName, 00341 nOutputCh, Tag, FALSE, AllowBinary); 00342 00343 lpMem += WriteObject (lpMem, EndArray); // End array 00344 lpMem += WriteObject (lpMem, EndDict); // End dictionary definition 00345 00346 lpMem += WriteObject (lpMem, NewLine); 00347 lpMem += WriteObject (lpMem, CRDEnd); 00348 00349 // Testing Convert binary to ascii 00350 // i = ConvertBinaryData2Ascii(lpOldMem, (SINT)(lpMem - lpOldMem), Ret); 00351 // lpMem = lpOldMem + i; 00352 // Testing Convert binary to ascii 00353 00354 MemFree (hMem); 00355 return ((SINT) ((unsigned long) (lpMem - lpOldMem))); 00356 }

SINT EXTERN CreateMonoCRD CHANDLE  cp,
SINT  Index,
MEMPTR  lpMem,
DWORD  InputIntent
 

Definition at line 452 of file dec97/dll32/getcrd.c.

References BeginArray, BeginDict, BeginFunction, CSIG, DecodeA3Rev, DictType, DupOp, EncodeABCLab1, EncodeABCTag, EndArray, EndClip, EndDict, EndFunction, FALSE, FAR, GetCPConnSpace, GetCPElement(), GetCPElementSize(), GetCPElementType(), GetCPMediaWhitePoint(), GetCPWhitePoint(), GetRevCurve(), icAbsoluteColorimetric, icSigCurveType, icSigLabData, icSigXYZData, icUInt16Number, Index, IndexArray, lpcpCurveType, LPCSIG, LPMEMPTR, LPSFLOAT, LPSINT, MatrixABCLabCRD, MatrixABCTag, MatrixABCXYZCRD, MAX_LINELENG, MemAlloc(), MemFree(), MEMPTR, NewLine, NULL, PUSHORT, REVCURVE_RATIO, Scale16, SendCRDBWPoint(), SendCRDLMN(), SendCRDPQR(), SFLOAT, SINT, StartClip, ui16toSINT, ui32toSINT, WriteInt, and WriteObject.

00453 { 00454 SINT nCount; 00455 CSIG Tag, PCS; 00456 00457 MEMPTR Buff = NULL; 00458 SINT MemSize = 0; 00459 MEMPTR lpOldMem = lpMem; 00460 MEMPTR lpCurve, lpRevCurve; 00461 HGLOBAL hRevCurve; 00462 SINT Ret = 0; 00463 HGLOBAL hMem; 00464 SINT i; 00465 MEMPTR lpTable; 00466 SFLOAT IlluminantWP[3]; 00467 SFLOAT MediaWP[3]; 00468 MEMPTR lpLineStart; 00469 // Check if we can generate the CRD 00470 if (!GetCPElementType (cp, Index, (LPCSIG) & Tag) || 00471 (Tag != icSigCurveType) || 00472 !GetCPConnSpace (cp, (LPCSIG) & PCS) || 00473 !GetCPElementSize (cp, Index, (LPSINT) & MemSize) || 00474 !MemAlloc (MemSize, (HGLOBAL FAR *)&hMem, (LPMEMPTR) & Buff) || 00475 !GetCPElement (cp, Index, Buff, MemSize)) 00476 { 00477 if (NULL != Buff) 00478 { 00479 MemFree (hMem); 00480 } 00481 return (0); 00482 } 00483 nCount = ui32toSINT (((lpcpCurveType) Buff)->curve.count); 00484 00485 // Estimate the memory size required to hold CRD 00486 Ret = nCount * 6 * 2 + // Number of INT elements 00487 2048; // + other PS stuff 00488 if (lpMem == NULL) // This is a size request 00489 { 00490 MemFree (hMem); 00491 return (Ret); 00492 } 00493 if (!MemAlloc (nCount * 2 * (REVCURVE_RATIO + 1), 00494 (HGLOBAL FAR *) &hRevCurve, (LPMEMPTR) & lpRevCurve)) 00495 { 00496 MemFree (hMem); 00497 return (FALSE); 00498 } 00499 lpCurve = lpRevCurve + 2 * REVCURVE_RATIO * nCount; 00500 GetRevCurve (Buff, lpCurve, lpRevCurve); 00501 00502 // GetCPCMMType (cp, (LPCSIG) & Intent); // Get Intent 00503 GetCPWhitePoint (cp, (LPSFLOAT) & IlluminantWP); // .. Illuminant 00504 00505 // Support absolute whitePoint 00506 if (InputIntent == icAbsoluteColorimetric) 00507 { 00508 if (!GetCPMediaWhitePoint (cp, (LPSFLOAT) & MediaWP)) // .. Media WhitePoint 00509 { 00510 MediaWP[0] = IlluminantWP[0]; 00511 MediaWP[1] = IlluminantWP[1]; 00512 MediaWP[2] = IlluminantWP[2]; 00513 } 00514 } 00515 00516 //************* Start writing CRD **************************** 00517 lpMem += WriteObject (lpMem, NewLine); 00518 lpMem += WriteObject (lpMem, BeginDict); // Begin dictionary 00519 lpMem += WriteObject (lpMem, DictType); // Dictionary type 00520 00521 //********** Send Black/White Point. 00522 lpMem += SendCRDBWPoint(lpMem, IlluminantWP); 00523 00524 //********** /TransformPQR 00525 lpMem += SendCRDPQR(lpMem, InputIntent, IlluminantWP); 00526 00527 //********** /MatrixLMN 00528 lpMem += SendCRDLMN(lpMem, InputIntent, IlluminantWP, MediaWP, PCS); 00529 00530 //********** /MatrixABC 00531 if (PCS == icSigXYZData) 00532 { // Switch ABC to BAC, since we want to output B which is converted from Y. 00533 lpMem += WriteObject (lpMem, NewLine); 00534 lpMem += WriteObject (lpMem, MatrixABCTag); 00535 lpMem += WriteObject (lpMem, MatrixABCXYZCRD); 00536 } 00537 else if (PCS == icSigLabData) 00538 { 00539 lpMem += WriteObject (lpMem, NewLine); 00540 lpMem += WriteObject (lpMem, MatrixABCTag); 00541 lpMem += WriteObject (lpMem, MatrixABCLabCRD); 00542 } 00543 //********** /EncodeABC 00544 if (nCount != 0) 00545 { 00546 lpMem += WriteObject (lpMem, NewLine); 00547 lpLineStart = lpMem; 00548 lpMem += WriteObject (lpMem, EncodeABCTag); 00549 lpMem += WriteObject (lpMem, BeginArray); 00550 lpMem += WriteObject (lpMem, BeginFunction); 00551 if (nCount == 1) // Gamma supplied in ui16 format 00552 { 00553 lpTable = (MEMPTR) (((lpcpCurveType) Buff)->curve.data); 00554 lpMem += WriteInt (lpMem, ui16toSINT (lpTable)); 00555 lpMem += WriteObject (lpMem, DecodeA3Rev); 00556 } else 00557 { 00558 if (PCS == icSigLabData) 00559 { 00560 lpMem += WriteObject (lpMem, EncodeABCLab1); 00561 } 00562 lpMem += WriteObject (lpMem, StartClip); 00563 lpMem += WriteObject (lpMem, BeginArray); 00564 for (i = 0; i < nCount * REVCURVE_RATIO; i++) 00565 { 00566 lpMem += WriteInt (lpMem, (SINT) (*((PUSHORT) lpRevCurve))); 00567 lpRevCurve += sizeof (icUInt16Number); 00568 if (((SINT) (lpMem - lpLineStart)) > MAX_LINELENG) 00569 { 00570 lpLineStart = lpMem; 00571 lpMem += WriteObject (lpMem, NewLine); 00572 } 00573 } 00574 lpMem += WriteObject (lpMem, EndArray); 00575 lpLineStart = lpMem; 00576 lpMem += WriteObject (lpMem, NewLine); 00577 00578 lpMem += WriteObject (lpMem, IndexArray); 00579 lpMem += WriteObject (lpMem, Scale16); 00580 lpMem += WriteObject (lpMem, EndClip); 00581 } 00582 lpMem += WriteObject (lpMem, EndFunction); 00583 lpMem += WriteObject (lpMem, DupOp); 00584 lpMem += WriteObject (lpMem, DupOp); 00585 lpMem += WriteObject (lpMem, EndArray); 00586 } 00587 lpMem += WriteObject (lpMem, EndDict); // End dictionary definition 00588 00589 MemFree (hRevCurve); 00590 MemFree (hMem); 00591 return ((SINT) ((unsigned long) (lpMem - lpOldMem))); 00592 }

BOOL EXTERN GetPS2ColorRenderingDictionary CHANDLE  cp,
DWORD  Intent,
MEMPTR  lpMem,
LPDWORD  lpcbSize,
BOOL  AllowBinary
 

Definition at line 596 of file dec97/dll32/getcrd.c.

References AllowBinary, Convert2Ascii(), CreateLutCRD(), CreateMonoCRD(), CSIG, DoesCPTagExist(), DWORD, FALSE, GetCPElementData(), GetCPElementDataSize(), GetCPTagIndex(), icAbsoluteColorimetric, icPerceptual, icRelativeColorimetric, icSaturation, icSigBToA0Tag, icSigBToA1Tag, icSigBToA2Tag, icSigGrayTRCTag, icSigPs2CRD0Tag, icSigPs2CRD1Tag, icSigPs2CRD2Tag, icSigPs2CRD3Tag, Index, Intent, LPSINT, NULL, SINT, and Size.

00602 { 00603 SINT Index; 00604 SINT Ret, Size; 00605 CSIG icSigPs2CRDx, icSigBToAx; 00606 00607 if (!cp) 00608 return FALSE; 00609 00610 if ((lpMem == NULL) || (*lpcbSize == 0)) 00611 { 00612 lpMem = NULL; 00613 *lpcbSize = 0; 00614 } 00615 Ret = 0; 00616 Size = (SINT) * lpcbSize; 00617 00618 switch (Intent) 00619 { 00620 case icPerceptual: 00621 icSigPs2CRDx = icSigPs2CRD0Tag; 00622 icSigBToAx = icSigBToA0Tag; 00623 break; 00624 00625 case icRelativeColorimetric: 00626 icSigPs2CRDx = icSigPs2CRD1Tag; 00627 icSigBToAx = icSigBToA1Tag; 00628 break; 00629 00630 case icSaturation: 00631 icSigPs2CRDx = icSigPs2CRD2Tag; 00632 icSigBToAx = icSigBToA2Tag; 00633 break; 00634 00635 case icAbsoluteColorimetric: 00636 icSigPs2CRDx = icSigPs2CRD3Tag; 00637 icSigBToAx = icSigBToA1Tag; 00638 break; 00639 00640 default: 00641 *lpcbSize = (DWORD) Ret; 00642 return (Ret > 0); 00643 } 00644 00645 if ( 00646 (DoesCPTagExist (cp, icSigPs2CRDx) && 00647 GetCPTagIndex (cp, icSigPs2CRDx, (LPSINT) & Index) && 00648 GetCPElementDataSize (cp, Index, (LPSINT) & Ret) && 00649 ((Size == 0) || 00650 GetCPElementData (cp, Index, lpMem, Size)) && 00651 (Ret = Convert2Ascii (cp, Index, lpMem, Size, Ret, AllowBinary)) 00652 ) || 00653 (DoesCPTagExist (cp, icSigBToAx) && 00654 GetCPTagIndex (cp, icSigBToAx, (LPSINT) & Index) && 00655 (Ret = CreateLutCRD (cp, Index, lpMem, Intent, AllowBinary)) 00656 ) || 00657 (DoesCPTagExist (cp, icSigGrayTRCTag) && 00658 GetCPTagIndex (cp, icSigGrayTRCTag, (LPSINT) & Index) && 00659 (Ret = CreateMonoCRD (cp, Index, lpMem, Intent)) 00660 ) 00661 ) 00662 { 00663 } 00664 00665 *lpcbSize = (DWORD) Ret; 00666 return (Ret > 0); 00667 }

BOOL GetRevCurve MEMPTR  lpBuff,
MEMPTR  lpCurve,
MEMPTR  lpRevCurve
[static]
 

Definition at line 373 of file dec97/dll32/getcrd.c.

References icUInt16Number, lpcpCurveType, MEMPTR, PUSHORT, REVCURVE_RATIO, SFLOAT, SINT, TRUE, ui16toSINT, ui32toSINT, and USHORT.

00374 { 00375 SINT i, j, nCount; 00376 MEMPTR lpTable; 00377 PUSHORT lpInput, lpOutput; 00378 SFLOAT fTemp; 00379 SINT iBegin, iEnd, iTemp; 00380 nCount = ui32toSINT (((lpcpCurveType) lpBuff)->curve.count); 00381 lpTable = (MEMPTR) (((lpcpCurveType) lpBuff)->curve.data); 00382 lpOutput = (PUSHORT) lpRevCurve; 00383 lpInput = (PUSHORT) lpCurve; 00384 00385 for (i = 0; i < nCount; i++) 00386 { 00387 lpInput[i] = (USHORT) (ui16toSINT (lpTable)); 00388 lpTable += sizeof (icUInt16Number); 00389 } 00390 00391 j = nCount * REVCURVE_RATIO; 00392 for (i = 0; i < j; i++) 00393 { 00394 fTemp = (SFLOAT) i *65535 / (j - 1); 00395 lpOutput[i] = (fTemp < 65535) ? (USHORT) fTemp : (USHORT) 65535; 00396 } 00397 00398 for (i = 0; i < j; i++) 00399 { 00400 iBegin = 0; 00401 iEnd = nCount - 1; 00402 for (;;) 00403 { 00404 if ((iEnd - iBegin) <= 1) 00405 break; 00406 iTemp = (iEnd + iBegin) / 2; 00407 if (lpOutput[i] < lpInput[iTemp]) 00408 iEnd = iTemp; 00409 else 00410 iBegin = iTemp; 00411 } 00412 if (lpOutput[i] <= lpInput[iBegin]) 00413 fTemp = (SFLOAT) iBegin; 00414 else if (lpOutput[i] >= lpInput[iEnd]) 00415 fTemp = (SFLOAT) iEnd; 00416 else 00417 { 00418 fTemp = ((SFLOAT) (lpInput[iEnd] - lpOutput[i])) / 00419 (lpOutput[i] - lpInput[iBegin]); 00420 fTemp = (iBegin * fTemp + iEnd) / (fTemp + 1); 00421 } 00422 fTemp = (fTemp / (nCount - 1)) * 65535; 00423 lpOutput[i] = (fTemp < 65535) ? (USHORT) fTemp : (USHORT) 65535; 00424 } 00425 00426 return TRUE; 00427 }


Variable Documentation

char ICMSEG BeginArray[] = "["
 

Definition at line 9 of file dec97/dll32/getcrd.c.

char ICMSEG BeginDict[] = "<<"
 

Definition at line 13 of file dec97/dll32/getcrd.c.

char ICMSEG BeginFunction[] = "{"
 

Definition at line 11 of file dec97/dll32/getcrd.c.

char ICMSEG BeginOp[] = "begin "
 

Definition at line 53 of file dec97/dll32/getcrd.c.

char ICMSEG BeginString[] = "<"
 

Definition at line 7 of file dec97/dll32/getcrd.c.

char ICMSEG BlackPoint[] = "[0 0 0]"
 

Definition at line 15 of file dec97/dll32/getcrd.c.

char ICMSEG BlackPointTag[] = "/BlackPoint "
 

Definition at line 19 of file dec97/dll32/getcrd.c.

char ICMSEG CieBasedABCBegin[] = "%** CieBasedABC CSA Begin "
 

Definition at line 67 of file dec97/dll32/getcrd.c.

char ICMSEG CieBasedABCEnd[] = "%** CieBasedABC CSA End "
 

Definition at line 71 of file dec97/dll32/getcrd.c.

char ICMSEG CIEBasedABCTag[] = "/CIEBasedABC "
 

Definition at line 33 of file dec97/dll32/getcrd.c.

char ICMSEG CieBasedABegin[] = "%** CieBasedA CSA Begin "
 

Definition at line 68 of file dec97/dll32/getcrd.c.

char ICMSEG CieBasedAEnd[] = "%** CieBasedA CSA End "
 

Definition at line 72 of file dec97/dll32/getcrd.c.

char ICMSEG CIEBasedATag[] = "/CIEBasedA "
 

Definition at line 32 of file dec97/dll32/getcrd.c.

char ICMSEG CieBasedDEFBegin[] = "%** CieBasedDEF CSA Begin "
 

Definition at line 66 of file dec97/dll32/getcrd.c.

char ICMSEG CieBasedDEFEnd[] = "%** CieBasedDEF CSA End "
 

Definition at line 70 of file dec97/dll32/getcrd.c.

char ICMSEG CieBasedDEFGBegin[] = "%** CieBasedDEFG CSA Begin "
 

Definition at line 65 of file dec97/dll32/getcrd.c.

char ICMSEG CieBasedDEFGEnd[] = "%** CieBasedDEFG CSA End "
 

Definition at line 69 of file dec97/dll32/getcrd.c.

char ICMSEG CIEBasedDEFGTag[] = "/CIEBasedDEFG "
 

Definition at line 34 of file dec97/dll32/getcrd.c.

char ICMSEG CIEBasedDEFTag[] = "/CIEBasedDEF "
 

Definition at line 35 of file dec97/dll32/getcrd.c.

char ICMSEG Clip01[] = "dup 1.0 ge{pop 1.0}{dup 0.0 lt{pop 0.0}if}ifelse "
 

Definition at line 80 of file dec97/dll32/getcrd.c.

char ICMSEG CRDBegin[] = "%** CRD Begin "
 

Definition at line 63 of file dec97/dll32/getcrd.c.

char ICMSEG CRDEnd[] = "%** CRD End "
 

Definition at line 64 of file dec97/dll32/getcrd.c.

char ICMSEG CurrentGlobalOp[] = "currentglobal "
 

Definition at line 50 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeA3[] = "256 div exp "
 

Definition at line 81 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeA3Rev[] = "256 div 1.0 exch div exp "
 

Definition at line 82 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeABCArray[] = "DecodeABC_"
 

Definition at line 83 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeABCLab1[] = "[{16 add 116 div} bind {500 div} bind {200 div} bind]"
 

Definition at line 120 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeABCTag[] = "/DecodeABC "
 

Definition at line 37 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeALab[] = " 50 mul 16 add 116 div "
 

Definition at line 121 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeATag[] = "/DecodeA "
 

Definition at line 36 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeDEFGTag[] = "/DecodeDEFG "
 

Definition at line 43 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeDEFTag[] = "/DecodeDEF "
 

Definition at line 44 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeLMNLab[]
 

Initial value:

\ "dup 0.206897 ge{dup dup mul mul}{0.137931 sub 0.128419 mul} ifelse "

Definition at line 122 of file dec97/dll32/getcrd.c.

char ICMSEG DecodeLMNTag[] = "/DecodeLMN "
 

Definition at line 38 of file dec97/dll32/getcrd.c.

char ICMSEG DefOp[] = "def "
 

Definition at line 52 of file dec97/dll32/getcrd.c.

char ICMSEG DeviceCMYKTag[] = "/DeviceCMYK "
 

Definition at line 40 of file dec97/dll32/getcrd.c.

char ICMSEG DeviceGrayTag[] = "/DeviceGray "
 

Definition at line 41 of file dec97/dll32/getcrd.c.

char ICMSEG DeviceRGBTag[] = "/DeviceRGB "
 

Definition at line 39 of file dec97/dll32/getcrd.c.

char ICMSEG DictType[] = "/ColorRenderingType 1 "
 

Definition at line 16 of file dec97/dll32/getcrd.c.

char ICMSEG DivOp[] = "div "
 

Definition at line 58 of file dec97/dll32/getcrd.c.

char ICMSEG DupOp[] = "dup "
 

Definition at line 47 of file dec97/dll32/getcrd.c.

char ICMSEG EncodeABCLab1[] = "16 sub 100 div "
 

Definition at line 131 of file dec97/dll32/getcrd.c.

char ICMSEG EncodeABCLab2[] = "128 add 255 div "
 

Definition at line 132 of file dec97/dll32/getcrd.c.

char ICMSEG EncodeABCTag[] = "/EncodeABC "
 

Definition at line 27 of file dec97/dll32/getcrd.c.

char ICMSEG EncodeLMNLab[]
 

Initial value:

"\ dup 0.008856 le{7.787 mul 0.13793 add}{0.3333 exp}ifelse "

Definition at line 126 of file dec97/dll32/getcrd.c.

char ICMSEG EncodeLMNTag[] = "/EncodeLMN "
 

Definition at line 30 of file dec97/dll32/getcrd.c.

char ICMSEG EndArray[] = "]"
 

Definition at line 10 of file dec97/dll32/getcrd.c.

char ICMSEG EndClip[] = "}if}if "
 

Definition at line 112 of file dec97/dll32/getcrd.c.

char ICMSEG EndDict[] = ">>"
 

Definition at line 14 of file dec97/dll32/getcrd.c.

char ICMSEG EndFunction[] = "}bind "
 

Definition at line 12 of file dec97/dll32/getcrd.c.

char ICMSEG EndOp[] = "end "
 

Definition at line 54 of file dec97/dll32/getcrd.c.

char ICMSEG EndString[] = ">"
 

Definition at line 8 of file dec97/dll32/getcrd.c.

char ICMSEG FalseOp[] = "false "
 

Definition at line 56 of file dec97/dll32/getcrd.c.

char ICMSEG GlobalDictOp[] = "globaldict "
 

Definition at line 49 of file dec97/dll32/getcrd.c.

char ICMSEG Identity[] = "[1 0 0 0 1 0 0 0 1]"
 

Definition at line 75 of file dec97/dll32/getcrd.c.

char ICMSEG IndexArray[]
 

Initial value:

\ " dup length 1 sub 3 -1 roll mul dup dup floor cvi \ exch ceiling cvi 3 index exch get 4 -1 roll 3 -1 roll get \ dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add "

Definition at line 99 of file dec97/dll32/getcrd.c.

char ICMSEG IndexArray16b[]
 

Initial value:

\ " dup length 1 sub 3 -1 roll mul dup dup floor cvi \ exch ceiling cvi 3 index exch get 32768 add 4 -1 roll 3 -1 roll get 32768 add \ dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add "

Definition at line 94 of file dec97/dll32/getcrd.c.

char ICMSEG InputArray[] = "Inp_"
 

Definition at line 84 of file dec97/dll32/getcrd.c.

char ICMSEG MatrixABCLab[] = "[1 1 1 1 0 0 0 0 -1]"
 

Definition at line 119 of file dec97/dll32/getcrd.c.

char ICMSEG MatrixABCLabCRD[] = "[0 500 0 116 -500 200 0 0 -200]"
 

Definition at line 129 of file dec97/dll32/getcrd.c.

char ICMSEG MatrixABCTag[] = "/MatrixABC "
 

Definition at line 26 of file dec97/dll32/getcrd.c.

char ICMSEG MatrixABCXYZCRD[] = "[0 1 0 1 0 0 0 0 1]"
 

Definition at line 130 of file dec97/dll32/getcrd.c.

char ICMSEG MatrixATag[] = "/MatrixA "
 

Definition at line 25 of file dec97/dll32/getcrd.c.

char ICMSEG MatrixLMNTag[] = "/MatrixLMN "
 

Definition at line 29 of file dec97/dll32/getcrd.c.

char ICMSEG MatrixPQRTag[] = "/MatrixPQR "
 

Definition at line 22 of file dec97/dll32/getcrd.c.

char ICMSEG MulOp[] = "mul "
 

Definition at line 57 of file dec97/dll32/getcrd.c.

char ICMSEG NewLine[] = "\n"
 

Definition at line 60 of file dec97/dll32/getcrd.c.

char ICMSEG NotSupportDEFG_S[] = "SupportDEFG? not { "
 

Definition at line 108 of file dec97/dll32/getcrd.c.

char ICMSEG NullOp[] = ""
 

Definition at line 46 of file dec97/dll32/getcrd.c.

char ICMSEG OutputArray[] = "Out_"
 

Definition at line 85 of file dec97/dll32/getcrd.c.

char ICMSEG PreViewInArray[] = "IPV_"
 

Definition at line 86 of file dec97/dll32/getcrd.c.

char ICMSEG PreViewOutArray[] = "OPV_"
 

Definition at line 87 of file dec97/dll32/getcrd.c.

char ICMSEG RangeABC[] = "[ 0 1 0 1 0 1 ] "
 

Definition at line 73 of file dec97/dll32/getcrd.c.

char ICMSEG RangeABC_Lab[] = "[0 100 -128 127 -128 127]"
 

Definition at line 76 of file dec97/dll32/getcrd.c.

char ICMSEG RangeABCTag[] = "/RangeABC "
 

Definition at line 24 of file dec97/dll32/getcrd.c.

char ICMSEG RangeLMN[] = "[ 0 2 0 2 0 2 ] "
 

Definition at line 74 of file dec97/dll32/getcrd.c.

char ICMSEG RangeLMNLab[] = "[0 1 0 1 0 1]"
 

Definition at line 125 of file dec97/dll32/getcrd.c.

char ICMSEG RangeLMNTag[] = "/RangeLMN "
 

Definition at line 28 of file dec97/dll32/getcrd.c.

char ICMSEG RangePQRTag[] = "/RangePQR "
 

Definition at line 20 of file dec97/dll32/getcrd.c.

char ICMSEG RenderTableTag[] = "/RenderTable "
 

Definition at line 31 of file dec97/dll32/getcrd.c.

char ICMSEG Scale16[] = "65535 div "
 

Definition at line 115 of file dec97/dll32/getcrd.c.

char ICMSEG Scale16XYZ[] = "32768 div "
 

Definition at line 116 of file dec97/dll32/getcrd.c.

char ICMSEG Scale8[] = "255 div "
 

Definition at line 114 of file dec97/dll32/getcrd.c.

char ICMSEG SetGlobalOp[] = "setglobal "
 

Definition at line 51 of file dec97/dll32/getcrd.c.

char ICMSEG Slash[] = "/"
 

Definition at line 61 of file dec97/dll32/getcrd.c.

char ICMSEG Space[] = " "
 

Definition at line 62 of file dec97/dll32/getcrd.c.

char ICMSEG StartClip[] = "dup 1.0 le{dup 0.0 ge{"
 

Definition at line 111 of file dec97/dll32/getcrd.c.

char ICMSEG SupportDEFG_E[] = "}if "
 

Definition at line 109 of file dec97/dll32/getcrd.c.

char ICMSEG SupportDEFG_S[] = "SupportDEFG? { "
 

Definition at line 107 of file dec97/dll32/getcrd.c.

char ICMSEG TableTag[] = "/Table "
 

Definition at line 42 of file dec97/dll32/getcrd.c.

char ICMSEG TestingDEFG[]
 

Initial value:

\ "/SupportDEFG? {/CIEBasedDEFG /ColorSpaceFamily resourcestatus { pop pop true}{false} ifelse} def"

Definition at line 104 of file dec97/dll32/getcrd.c.

char ICMSEG TFunction8[] = "exch 255 mul round cvi get 255 div "
 

Definition at line 117 of file dec97/dll32/getcrd.c.

char ICMSEG TFunction8XYZ[] = "exch 255 mul round cvi get 128 div "
 

Definition at line 118 of file dec97/dll32/getcrd.c.

char* TransformPQR[3]
 

Initial value:

{ "4 index 0 get div 2 index 0 get mul 4 {exch pop} repeat ", "4 index 1 get div 2 index 1 get mul 4 {exch pop} repeat ", "4 index 2 get div 2 index 2 get mul 4 {exch pop} repeat " }

Definition at line 133 of file dec97/dll32/getcrd.c.

char ICMSEG TransformPQRTag[] = "/TransformPQR "
 

Definition at line 21 of file dec97/dll32/getcrd.c.

char ICMSEG TrueOp[] = "true "
 

Definition at line 55 of file dec97/dll32/getcrd.c.

char ICMSEG UserDictOp[] = "userdict "
 

Definition at line 48 of file dec97/dll32/getcrd.c.

char ICMSEG WhitePointTag[] = "/WhitePoint "
 

Definition at line 18 of file dec97/dll32/getcrd.c.


Generated on Sat May 15 19:43:51 2004 for test by doxygen 1.3.7