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

getcsa.c File Reference

#include "generic.h"
#include "icmstr.h"

Go to the source code of this file.

Defines

#define ICMSEG

Functions

BOOL IsSRGB (CHANDLE cp)
SINT CreateColSpArray (CHANDLE cp, MEMPTR lpMem, CSIG CPTag, BOOL AllowBinary)
SINT CreateColSpProc (CHANDLE cp, MEMPTR lpMem, CSIG CPTag, BOOL AllowBinary)
SINT CreateFloatString (CHANDLE cp, MEMPTR lpMem, CSIG CPTag)
SINT SendCSABWPoint (MEMPTR lpMem, CSIG Intent, LPSFLOAT IlluminantWP, LPSFLOAT MediaWP)
void GetMediaWP (CHANDLE cp, CSIG InputIntent, LPSFLOAT IlluminantWP, LPSFLOAT MediaWP)
BOOL GetDeviceRGB (MEMPTR lpMem, LPDWORD lpcbSize, DWORD InpDrvClrSp, BOOL BackupCSA)
BOOL GetDeviceCMYK (MEMPTR lpMem, LPDWORD lpcbSize, DWORD InpDrvClrSp)
BOOL GetDeviceGray (MEMPTR lpMem, LPDWORD lpcbSize, DWORD InpDrvClrSp)
SINT GetPublicArrayName (CHANDLE cp, CSIG IntentSig, MEMPTR PublicArrayName)
SINT BeginGlobalDict (MEMPTR lpMem)
SINT EndGlobalDict (MEMPTR lpMem)
SINT EnableGlobalDict (MEMPTR lpMem)
BOOL GetPS2CSA_DEFG (CHANDLE cp, MEMPTR lpMem, LPDWORD lpcbSize, CSIG InputIntent, SINT Index, int Type, BOOL AllowBinary)
BOOL GetPS2CSA_ABC (CHANDLE cp, MEMPTR lpMem, LPDWORD lpcbSize, CSIG InputIntent, DWORD InpDrvClrSp, BOOL AllowBinary, BOOL BackupCSA)
BOOL GetPS2CSA_ABC_LAB (CHANDLE cp, MEMPTR lpMem, LPDWORD lpcbSize, CSIG InputIntent, DWORD InpDrvClrSp, BOOL AllowBinary)
BOOL GetPS2CSA_MONO_ABC (CHANDLE cp, MEMPTR lpMem, LPDWORD lpcbSize, CSIG InputIntent, BOOL AllowBinary)
BOOL GetPS2CSA_MONO_A (CHANDLE cp, MEMPTR lpMem, LPDWORD lpcbSize, CSIG InputIntent, BOOL AllowBinary)
BOOL GetPS2CSA_MONO (CHANDLE cp, MEMPTR lpMem, LPDWORD lpcbSize, DWORD InpDrvClrSp, CSIG InputIntent, BOOL AllowBinary)
BOOL GetCSAFromProfile (CHANDLE cp, MEMPTR lpMem, LPDWORD lpcbSize, DWORD InpDrvClrSp, CSIG DrvColorSpace, BOOL AllowBinary)
BOOL GetPS2CSA_DEFG_Intent (CHANDLE cp, MEMPTR lpBuffer, LPDWORD lpcbSize, DWORD InpDrvClrSp, CSIG Intent, int Type, BOOL AllowBinary)
BOOL EXTERN GetPS2ColorSpaceArray (CHANDLE cp, DWORD InputIntent, DWORD InpDrvClrSp, MEMPTR lpBuffer, LPDWORD lpcbSize, BOOL AllowBinary)

Variables

char * DecodeABCLab []


Define Documentation

#define ICMSEG
 


Function Documentation

SINT BeginGlobalDict MEMPTR  lpMem  ) 
 

Definition at line 207 of file aug98/dll32/getcsa.c.

00208 { 00209 MEMPTR lpOldMem = lpMem; 00210 00211 lpMem += WriteNewLineObject (lpMem, GlobalDictOp); 00212 lpMem += WriteObject (lpMem, BeginOp); 00213 00214 return (lpMem - lpOldMem); 00215 }

SINT CreateColSpArray CHANDLE  cp,
MEMPTR  lpMem,
CSIG  CPTag,
BOOL  AllowBinary
 

Definition at line 1372 of file aug98/dll32/getcsa.c.

References AllowBinary, BeginArray, DecodeABCArray, DefOp, DoesCPTagExist(), EndArray, FAR, GetCPElement(), GetCPElementSize(), GetCPTagIndex(), icUInt16Number, Index, lpcpCurveType, LPMEMPTR, LPSINT, MAX_LINELENG, MemAlloc(), MemFree(), MEMPTR, NewLine, NULL, SINT, Slash, ui16toSINT, ui32toSINT, WriteHNAToken(), WriteInt, WriteIntStringU2S(), WriteNewLineObject(), and WriteObject.

01373 { 01374 SINT i, nCount, Index; 01375 MEMPTR lpTable; 01376 MEMPTR Buff = NULL; 01377 SINT MemSize = 0; 01378 MEMPTR lpOldMem, lpLineStart; 01379 HGLOBAL hBuff; 01380 lpOldMem = lpMem; 01381 01382 lpLineStart = lpMem; 01383 01384 if (DoesCPTagExist (cp, CPTag) && 01385 GetCPTagIndex (cp, CPTag, (LPSINT) & Index) && 01386 GetCPElementSize (cp, Index, (LPSINT) & MemSize) && 01387 MemAlloc (MemSize, (HGLOBAL FAR *)&hBuff, (LPMEMPTR) & Buff) && 01388 GetCPElement (cp, Index, Buff, MemSize)) 01389 { 01390 nCount = ui32toSINT (((lpcpCurveType) Buff)->curve.count); 01391 if (nCount > 1) 01392 { 01393 lpMem += WriteNewLineObject (lpMem, Slash); 01394 lpMem += WriteObject (lpMem, DecodeABCArray); 01395 lpMem += WriteInt (lpMem, (SINT) CPTag); 01396 01397 lpTable = (MEMPTR) (((lpcpCurveType) Buff)->curve.data); 01398 if (!AllowBinary) // Output ASCII CS 01399 { 01400 lpMem += WriteObject (lpMem, BeginArray); 01401 for (i = 0; i < nCount; i++) 01402 { 01403 lpMem += WriteInt (lpMem, ui16toSINT (lpTable)); 01404 lpTable += sizeof (icUInt16Number); 01405 if (((SINT) (lpMem - lpLineStart)) > MAX_LINELENG) 01406 { 01407 lpLineStart = lpMem; 01408 lpMem += WriteObject (lpMem, NewLine); 01409 } 01410 } 01411 lpMem += WriteObject (lpMem, EndArray); 01412 } else 01413 { // Output BINARY CS 01414 lpMem += WriteHNAToken (lpMem, 149, nCount); 01415 lpMem += WriteIntStringU2S (lpMem, lpTable, nCount); 01416 } 01417 lpMem += WriteObject (lpMem, DefOp); 01418 } 01419 MemFree (hBuff); 01420 } 01421 return ((SINT) (lpMem - lpOldMem)); 01422 }

SINT CreateColSpProc CHANDLE  cp,
MEMPTR  lpMem,
CSIG  CPTag,
BOOL  AllowBinary
 

Definition at line 1287 of file aug98/dll32/getcsa.c.

References AllowBinary, BeginFunction, DecodeA3, DecodeABCArray, DoesCPTagExist(), EndClip, EndFunction, FAR, GetCPElement(), GetCPElementSize(), GetCPTagIndex(), Index, IndexArray, IndexArray16b, lpcpCurveType, LPMEMPTR, LPSINT, MemAlloc(), MemFree(), MEMPTR, NULL, Scale16, SINT, StartClip, ui16toSINT, ui32toSINT, WriteInt, and WriteObject.

01288 { 01289 SINT nCount, Index; 01290 MEMPTR lpTable; 01291 MEMPTR Buff = NULL; 01292 SINT MemSize = 0; 01293 MEMPTR lpOldMem; 01294 HGLOBAL hBuff; 01295 lpOldMem = lpMem; 01296 lpMem += WriteObject (lpMem, BeginFunction); 01297 if (DoesCPTagExist (cp, CPTag) && 01298 GetCPTagIndex (cp, CPTag, (LPSINT) & Index) && 01299 GetCPElementSize (cp, Index, (LPSINT) & MemSize) && 01300 MemAlloc (MemSize, (HGLOBAL FAR *)&hBuff, (LPMEMPTR) & Buff) && 01301 GetCPElement (cp, Index, Buff, MemSize)) 01302 { 01303 nCount = ui32toSINT (((lpcpCurveType) Buff)->curve.count); 01304 if (nCount != 0) 01305 { 01306 if (nCount == 1) // Gamma supplied in ui16 format 01307 { 01308 lpTable = (MEMPTR) (((lpcpCurveType) Buff)->curve.data); 01309 lpMem += WriteInt (lpMem, ui16toSINT (lpTable)); 01310 lpMem += WriteObject (lpMem, DecodeA3); 01311 } else 01312 { 01313 lpMem += WriteObject (lpMem, StartClip); 01314 lpTable = (MEMPTR) (((lpcpCurveType) Buff)->curve.data); 01315 lpMem += WriteObject (lpMem, DecodeABCArray); 01316 lpMem += WriteInt (lpMem, (SINT) CPTag); 01317 01318 if (!AllowBinary) // Output ASCII CS 01319 { 01320 lpMem += WriteObject (lpMem, IndexArray); 01321 } else 01322 { // Output BINARY CS 01323 lpMem += WriteObject (lpMem, IndexArray16b); 01324 } 01325 lpMem += WriteObject (lpMem, Scale16); 01326 lpMem += WriteObject (lpMem, EndClip); 01327 } 01328 } 01329 MemFree (hBuff); 01330 } 01331 lpMem += WriteObject (lpMem, EndFunction); 01332 return ((SINT) (lpMem - lpOldMem)); 01333 }

SINT CreateFloatString CHANDLE  cp,
MEMPTR  lpMem,
CSIG  CPTag
 

Definition at line 1341 of file aug98/dll32/getcsa.c.

References FAR, GetCPElement(), GetCPElementSize(), GetCPTagIndex(), icS15Fixed16Number, Index, lpcpXYZType, LPMEMPTR, LPSINT, MemAlloc(), MemFree(), MEMPTR, NULL, si16f16toSFLOAT, SINT, and WriteFloat().

01342 { 01343 SINT i, Index; 01344 MEMPTR lpTable; 01345 MEMPTR Buff = NULL; 01346 SINT MemSize = 0; 01347 MEMPTR lpOldMem; 01348 HGLOBAL hBuff; 01349 lpOldMem = lpMem; 01350 if (GetCPTagIndex (cp, CPTag, (LPSINT) & Index) && 01351 GetCPElementSize (cp, Index, (LPSINT) & MemSize) && 01352 MemAlloc (MemSize, (HGLOBAL FAR *)&hBuff, (LPMEMPTR) & Buff) && 01353 GetCPElement (cp, Index, Buff, MemSize)) 01354 { 01355 lpTable = (MEMPTR) & (((lpcpXYZType) Buff)->data); 01356 for (i = 0; i < 3; i++) 01357 { 01358 lpMem += WriteFloat (lpMem, si16f16toSFLOAT (lpTable)); 01359 lpTable += sizeof (icS15Fixed16Number); 01360 } 01361 MemFree (hBuff); 01362 } 01363 return ((SINT) (lpMem - lpOldMem)); 01364 }

SINT EnableGlobalDict MEMPTR  lpMem  ) 
 

Definition at line 227 of file aug98/dll32/getcsa.c.

00228 { 00229 MEMPTR lpOldMem = lpMem; 00230 00231 lpMem += WriteNewLineObject (lpMem, CurrentGlobalOp); 00232 lpMem += WriteObject (lpMem, TrueOp); 00233 lpMem += WriteObject (lpMem, SetGlobalOp); 00234 return (lpMem - lpOldMem); 00235 }

SINT EndGlobalDict MEMPTR  lpMem  ) 
 

Definition at line 217 of file aug98/dll32/getcsa.c.

00218 { 00219 MEMPTR lpOldMem = lpMem; 00220 00221 lpMem += WriteNewLineObject (lpMem, EndOp); 00222 lpMem += WriteObject (lpMem, SetGlobalOp); 00223 00224 return (lpMem - lpOldMem); 00225 }

BOOL GetCSAFromProfile CHANDLE  cp,
MEMPTR  lpMem,
LPDWORD  lpcbSize,
DWORD  InpDrvClrSp,
CSIG  DrvColorSpace,
BOOL  AllowBinary
[static]
 

Definition at line 1450 of file aug98/dll32/getcsa.c.

References AllowBinary, Convert2Ascii(), DoesCPTagExist(), FALSE, GetCPElementData(), GetCPElementDataSize(), GetCPTagIndex(), icSigGrayData, icSigPs2CSATag, Index, LPSINT, NULL, SINT, Size, and TRUE.

01457 { 01458 SINT Index; 01459 SINT Size; 01460 if ((DrvColorSpace == icSigGrayData) && (InpDrvClrSp != icSigGrayData)) 01461 return FALSE; 01462 01463 if (DoesCPTagExist (cp, icSigPs2CSATag) && 01464 GetCPTagIndex (cp, icSigPs2CSATag, (LPSINT) & Index) && 01465 GetCPElementDataSize (cp, Index, (LPSINT) & Size) && 01466 ((lpMem == NULL) || GetCPElementData (cp, Index, lpMem, Size)) && 01467 (*lpcbSize = Convert2Ascii (cp, Index, lpMem, *lpcbSize, Size, AllowBinary))) 01468 { 01469 return TRUE; 01470 } else 01471 { 01472 return FALSE; 01473 } 01474 }

BOOL GetDeviceCMYK MEMPTR  lpMem,
LPDWORD  lpcbSize,
DWORD  InpDrvClrSp
[static]
 

Definition at line 92 of file aug98/dll32/getcsa.c.

References DeviceCMYKTag, DWORD, FALSE, icSigCmykData, MEMPTR, NULL, TRUE, and WriteNewLineObject().

00096 { 00097 MEMPTR lpOldMem = lpMem; 00098 if ((InpDrvClrSp != icSigCmykData) && 00099 (InpDrvClrSp != 0)) 00100 return FALSE; 00101 if (lpMem == NULL) 00102 { 00103 *lpcbSize = lstrlen (DeviceCMYKTag) + 8; 00104 return (TRUE); 00105 } 00106 lpMem += WriteNewLineObject (lpMem, DeviceCMYKTag); 00107 00108 *lpcbSize = (DWORD) (lpMem - lpOldMem); 00109 return (TRUE); 00110 00111 }

BOOL GetDeviceGray MEMPTR  lpMem,
LPDWORD  lpcbSize,
DWORD  InpDrvClrSp
[static]
 

Definition at line 117 of file aug98/dll32/getcsa.c.

References DeviceGrayTag, DeviceRGBTag, DWORD, icSigDefData, icSigGrayData, icSigRgbData, MEMPTR, NULL, TRUE, and WriteNewLineObject().

00121 { 00122 MEMPTR lpOldMem = lpMem; 00123 if ((InpDrvClrSp == icSigRgbData) || 00124 (InpDrvClrSp == icSigDefData) || 00125 (InpDrvClrSp == 0)) 00126 { 00127 if (lpMem == NULL) 00128 { 00129 *lpcbSize = lstrlen (DeviceRGBTag) + 8; 00130 return (TRUE); 00131 } 00132 lpMem += WriteNewLineObject (lpMem, DeviceRGBTag); 00133 00134 *lpcbSize = (DWORD) (lpMem - lpOldMem); 00135 return (TRUE); 00136 } else if (InpDrvClrSp == icSigGrayData) 00137 { 00138 if (lpMem == NULL) 00139 { 00140 *lpcbSize = lstrlen (DeviceGrayTag) + 8; 00141 return (TRUE); 00142 } 00143 lpMem += WriteNewLineObject (lpMem, DeviceGrayTag); 00144 00145 *lpcbSize = (DWORD) (lpMem - lpOldMem); 00146 return (TRUE); 00147 } 00148 }

BOOL GetDeviceRGB MEMPTR  lpMem,
LPDWORD  lpcbSize,
DWORD  InpDrvClrSp,
BOOL  BackupCSA
[static]
 

Definition at line 41 of file aug98/dll32/getcsa.c.

References DeviceRGBTag, DWORD, FALSE, icSigDefData, icSigRgbData, MEMPTR, NotSupportDEFG_S, NULL, SupportDEFG_E, TRUE, and WriteNewLineObject().

00046 { 00047 MEMPTR lpOldMem = lpMem; 00048 if ((InpDrvClrSp != icSigRgbData) && 00049 (InpDrvClrSp != icSigDefData) && 00050 (InpDrvClrSp != 0)) 00051 return FALSE; 00052 00053 if (lpMem == NULL) 00054 { 00055 *lpcbSize = lstrlen (DeviceRGBTag) + 8; 00056 return (TRUE); 00057 } 00058 00059 if (BackupCSA) 00060 { 00061 lpMem += WriteNewLineObject (lpMem, NotSupportDEFG_S); 00062 } 00063 00064 lpMem += WriteNewLineObject (lpMem, DeviceRGBTag); 00065 00066 if (BackupCSA) 00067 { 00068 lpMem += WriteNewLineObject (lpMem, SupportDEFG_E); 00069 } 00070 00071 *lpcbSize = (DWORD) (lpMem - lpOldMem); 00072 return (TRUE); 00073 }

void GetMediaWP CHANDLE  cp,
CSIG  InputIntent,
LPSFLOAT  IlluminantWP,
LPSFLOAT  MediaWP
[static]
 

Definition at line 193 of file aug98/dll32/getcsa.c.

References GetCPMediaWhitePoint(), icAbsoluteColorimetric, and LPSFLOAT.

00195 { 00196 if (InputIntent == icAbsoluteColorimetric) 00197 { 00198 if (!GetCPMediaWhitePoint (cp, (LPSFLOAT) & MediaWP)) // .. Media WhitePoint 00199 { 00200 MediaWP[0] = IlluminantWP[0]; 00201 MediaWP[1] = IlluminantWP[1]; 00202 MediaWP[2] = IlluminantWP[2]; 00203 } 00204 } 00205 }

BOOL EXTERN GetPS2ColorSpaceArray CHANDLE  cp,
DWORD  InputIntent,
DWORD  InpDrvClrSp,
MEMPTR  lpBuffer,
LPDWORD  lpcbSize,
BOOL  AllowBinary
 

Definition at line 1579 of file aug98/dll32/getcsa.c.

01586 { 01587 CSIG ColorSpace, Intent; 01588 BOOL Success = FALSE; 01589 DWORD dwSaveSize; 01590 if (!cp) 01591 return Success; 01592 01593 if (!GetCPDevSpace (cp, (LPCSIG) & ColorSpace) || 01594 !GetCPRenderIntent (cp, (LPCSIG) & Intent)) 01595 { 01596 return Success; 01597 } 01598 dwSaveSize = *lpcbSize; 01599 if (InputIntent == icUseRenderingIntent) 01600 InputIntent = (DWORD)Intent; 01601 01602 // Get ColorSpace from Profile. 01603 if ((CSIG) InputIntent == Intent) 01604 { 01605 Success = GetCSAFromProfile (cp, lpBuffer, lpcbSize, 01606 InpDrvClrSp, ColorSpace, AllowBinary); 01607 } 01608 if (!Success) 01609 { 01610 switch (ColorSpace) 01611 { 01612 case icSigRgbData: 01613 Success = GetPS2CSA_DEFG_Intent (cp, lpBuffer, lpcbSize, 01614 InpDrvClrSp, (CSIG) InputIntent, 01615 TYPE_CIEBASEDDEF, AllowBinary); 01616 if (Success) 01617 { // Create CieBasedABC or DeviceRGB 01618 // for the printer 01619 // which does not support CieBasedDEF(G). 01620 DWORD cbNewSize = 0; 01621 MEMPTR lpNewBuffer; 01622 MEMPTR lpOldBuffer; 01623 if (lpBuffer) 01624 { 01625 lpNewBuffer = lpBuffer + *lpcbSize; 01626 lpOldBuffer = lpNewBuffer; 01627 lpNewBuffer += WriteObject (lpNewBuffer, NewLine); 01628 cbNewSize = dwSaveSize - (DWORD) (lpNewBuffer - lpBuffer); 01629 } else 01630 lpNewBuffer = NULL; 01631 01632 if (!GetPS2CSA_ABC (cp, lpNewBuffer, &cbNewSize, 01633 (CSIG)InputIntent, InpDrvClrSp, 01634 AllowBinary, 1)) // create a backup CSA 01635 GetDeviceRGB (lpNewBuffer, &cbNewSize, InpDrvClrSp, 1); 01636 01637 if (lpBuffer) 01638 { 01639 lpNewBuffer += cbNewSize; 01640 *lpcbSize += (DWORD) (lpNewBuffer - lpOldBuffer); 01641 } else 01642 *lpcbSize += cbNewSize; 01643 01644 } 01645 if (!Success) 01646 { // Create CieBasedABC 01647 Success = GetPS2CSA_ABC (cp, lpBuffer, lpcbSize, 01648 (CSIG)InputIntent, InpDrvClrSp, 01649 AllowBinary, 0); 01650 } 01651 if (!Success) 01652 { // Create DeviceRGB 01653 Success = GetDeviceRGB (lpBuffer, lpcbSize, InpDrvClrSp, 0); 01654 Success = FALSE; 01655 } 01656 break; 01657 case icSigCmykData: 01658 Success = GetPS2CSA_DEFG_Intent (cp, lpBuffer, lpcbSize, 01659 InpDrvClrSp, (CSIG) InputIntent, 01660 TYPE_CIEBASEDDEFG, AllowBinary); 01661 if (Success) 01662 { // Create DeviceCMYK for the printer 01663 // which does not support CieBasedDEF(G). 01664 DWORD cbNewSize = 0; 01665 MEMPTR lpNewBuffer; 01666 MEMPTR lpOldBuffer; 01667 if (lpBuffer) 01668 { 01669 lpNewBuffer = lpBuffer + *lpcbSize; 01670 lpOldBuffer = lpNewBuffer; 01671 lpNewBuffer += WriteObject (lpNewBuffer, NewLine); 01672 lpNewBuffer += WriteNewLineObject (lpNewBuffer, NotSupportDEFG_S); 01673 cbNewSize = dwSaveSize - (DWORD) (lpNewBuffer - lpBuffer); 01674 } else 01675 lpNewBuffer = NULL; 01676 01677 GetDeviceCMYK (lpNewBuffer, &cbNewSize, InpDrvClrSp); 01678 01679 if (lpBuffer) 01680 { 01681 lpNewBuffer += cbNewSize; 01682 lpNewBuffer += WriteNewLineObject (lpNewBuffer, SupportDEFG_E); 01683 *lpcbSize += (DWORD) (lpNewBuffer - lpOldBuffer); 01684 } else 01685 *lpcbSize += cbNewSize; 01686 } 01687 if (!Success) 01688 { // Create DeviceCMYK 01689 Success = GetDeviceCMYK (lpBuffer, lpcbSize, InpDrvClrSp); 01690 Success = FALSE; 01691 } 01692 break; 01693 case icSigGrayData: 01694 Success = GetPS2CSA_MONO (cp, lpBuffer, lpcbSize, InpDrvClrSp, 01695 (CSIG)InputIntent, AllowBinary); 01696 if (!Success) 01697 { // Create DeviceGray 01698 Success = GetDeviceGray (lpBuffer, lpcbSize, InpDrvClrSp); 01699 Success = FALSE; 01700 } 01701 break; 01702 case icSigLabData: 01703 Success = GetPS2CSA_DEFG_Intent (cp, lpBuffer, lpcbSize, 01704 InpDrvClrSp, (CSIG) InputIntent, 01705 TYPE_CIEBASEDDEF, AllowBinary); 01706 if (Success) 01707 { // Create CieBasedABC or DeviceRGB 01708 // for the printer 01709 // which does not support CieBasedDEF(G). 01710 DWORD cbNewSize = 0; 01711 MEMPTR lpNewBuffer; 01712 MEMPTR lpOldBuffer; 01713 if (lpBuffer) 01714 { 01715 lpNewBuffer = lpBuffer + *lpcbSize; 01716 lpOldBuffer = lpNewBuffer; 01717 lpNewBuffer += WriteObject (lpNewBuffer, NewLine); 01718 lpNewBuffer += WriteNewLineObject (lpNewBuffer, NotSupportDEFG_S); 01719 cbNewSize = dwSaveSize - (DWORD) (lpNewBuffer - lpBuffer); 01720 } else 01721 lpNewBuffer = NULL; 01722 01723 GetPS2CSA_ABC_LAB (cp, lpNewBuffer, &cbNewSize, 01724 (CSIG)InputIntent, InpDrvClrSp, AllowBinary); 01725 01726 if (lpBuffer) 01727 { 01728 lpNewBuffer += cbNewSize; 01729 lpNewBuffer += WriteNewLineObject (lpNewBuffer, SupportDEFG_E); 01730 *lpcbSize += (DWORD) (lpNewBuffer - lpOldBuffer); 01731 } else 01732 *lpcbSize += cbNewSize; 01733 } 01734 if (!Success) 01735 { // Create CieBasedABC 01736 Success = GetPS2CSA_ABC_LAB (cp, lpBuffer, lpcbSize, 01737 (CSIG)InputIntent, InpDrvClrSp, AllowBinary); 01738 } 01739 break; 01740 01741 default: 01742 break; 01743 } 01744 } 01745 return Success; 01746 }

BOOL GetPS2CSA_ABC CHANDLE  cp,
MEMPTR  lpMem,
LPDWORD  lpcbSize,
CSIG  InputIntent,
DWORD  InpDrvClrSp,
BOOL  AllowBinary,
BOOL  BackupCSA
 

Definition at line 642 of file aug98/dll32/getcsa.c.

00645 { 00646 CSIG PCS, Dev; 00647 SFLOAT IlluminantWP[3]; 00648 SFLOAT MediaWP[3]; 00649 00650 SINT i; 00651 MEMPTR lpOldMem = lpMem; 00652 SINT Ret = 0; 00653 00654 // Check if we can generate the CS. 00655 // Required tags are: red, green and blue Colorants. 00656 // As for TRC tags - we are quite flexible here - if we cannot find the 00657 // required tag - we assume the linear responce 00658 if (!GetCPConnSpace (cp, (LPCSIG) & PCS) || 00659 !GetCPDevSpace (cp, (LPCSIG) & Dev) || 00660 (Dev != icSigRgbData) || 00661 !DoesTRCAndColorantTagExist(cp)) 00662 { 00663 return (FALSE); 00664 } 00665 if ((InpDrvClrSp != icSigRgbData) && 00666 (InpDrvClrSp != icSigDefData) && 00667 (InpDrvClrSp != 0)) 00668 { 00669 return (FALSE); 00670 } 00671 // Estimate the memory size required to hold CS 00672 00673 if (lpMem == NULL) // This is a size request 00674 { 00675 *lpcbSize = 65530; 00676 return (TRUE); 00677 } 00678 00679 // Get info about Illuminant White Point from the header 00680 GetCPWhitePoint (cp, (LPSFLOAT) & IlluminantWP); // .. Illuminant 00681 00682 // Support absolute whitePoint 00683 GetMediaWP(cp, InputIntent, IlluminantWP, MediaWP); 00684 00685 //*********** Creating global data 00686 00687 lpMem += WriteNewLineObject (lpMem, CieBasedABCBegin); 00688 00689 if (IsSRGB(cp)) 00690 { 00691 lpMem += WriteNewLineObject (lpMem, AdobeCSA); 00692 } 00693 else 00694 { 00695 lpMem += EnableGlobalDict(lpMem); 00696 00697 if (BackupCSA) 00698 { 00699 lpMem += WriteNewLineObject (lpMem, NotSupportDEFG_S); 00700 } 00701 00702 lpMem += BeginGlobalDict(lpMem); 00703 00704 lpMem += CreateColSpArray (cp, lpMem, icSigRedTRCTag, AllowBinary); 00705 lpMem += CreateColSpArray (cp, lpMem, icSigGreenTRCTag, AllowBinary); 00706 lpMem += CreateColSpArray (cp, lpMem, icSigBlueTRCTag, AllowBinary); 00707 00708 lpMem += WriteNewLineObject (lpMem, EndOp); 00709 00710 if (BackupCSA) 00711 { 00712 lpMem += WriteNewLineObject (lpMem, SupportDEFG_E); 00713 } 00714 lpMem += WriteNewLineObject (lpMem, SetGlobalOp); 00715 00716 if (BackupCSA) 00717 { 00718 lpMem += WriteNewLineObject (lpMem, NotSupportDEFG_S); 00719 } 00720 00721 //*********** Start creating the ColorSpace 00722 lpMem += WriteNewLineObject (lpMem, BeginArray); // Begin array 00723 //********** /CIEBasedABC 00724 lpMem += WriteObject (lpMem, CIEBasedABCTag); // Create entry 00725 lpMem += WriteObject (lpMem, BeginDict); // Begin dictionary 00726 00727 //********** Black/White Point 00728 lpMem += SendCSABWPoint(lpMem, InputIntent, IlluminantWP, MediaWP); 00729 00730 //********** /DecodeABC 00731 lpMem += WriteNewLineObject (lpMem, DecodeABCTag); 00732 lpMem += WriteObject (lpMem, BeginArray); 00733 00734 lpMem += WriteObject (lpMem, NewLine); 00735 lpMem += CreateColSpProc (cp, lpMem, icSigRedTRCTag, AllowBinary); 00736 lpMem += WriteObject (lpMem, NewLine); 00737 lpMem += CreateColSpProc (cp, lpMem, icSigGreenTRCTag, AllowBinary); 00738 lpMem += WriteObject (lpMem, NewLine); 00739 lpMem += CreateColSpProc (cp, lpMem, icSigBlueTRCTag, AllowBinary); 00740 lpMem += WriteObject (lpMem, EndArray); 00741 00742 //********** /MatrixABC 00743 lpMem += WriteNewLineObject (lpMem, MatrixABCTag); 00744 lpMem += WriteObject (lpMem, BeginArray); 00745 00746 lpMem += CreateFloatString (cp, lpMem, icSigRedColorantTag); 00747 lpMem += CreateFloatString (cp, lpMem, icSigGreenColorantTag); 00748 lpMem += CreateFloatString (cp, lpMem, icSigBlueColorantTag); 00749 00750 lpMem += WriteObject (lpMem, EndArray); 00751 00752 //********** /RangeLMN 00753 lpMem += WriteNewLineObject (lpMem, RangeLMNTag); 00754 lpMem += WriteObject (lpMem, RangeLMN); 00755 00756 //********** /DecodeLMN 00757 if (InputIntent == icAbsoluteColorimetric) 00758 { 00759 // Support absolute whitePoint 00760 lpMem += WriteNewLineObject (lpMem, DecodeLMNTag); 00761 lpMem += WriteObject (lpMem, BeginArray); 00762 for (i = 0; i < 3; i ++) 00763 { 00764 lpMem += WriteObject (lpMem, BeginFunction); 00765 lpMem += WriteFloat (lpMem, (double)MediaWP[i]/IlluminantWP[i]); 00766 lpMem += WriteObject (lpMem, MulOp); 00767 lpMem += WriteObject (lpMem, EndFunction); 00768 } 00769 lpMem += WriteObject (lpMem, EndArray); 00770 } 00771 00772 //********** End dictionary definition 00773 lpMem += WriteNewLineObject (lpMem, EndDict); 00774 lpMem += WriteObject (lpMem, EndArray); 00775 00776 if (BackupCSA) 00777 { 00778 lpMem += WriteNewLineObject (lpMem, SupportDEFG_E); 00779 } 00780 00781 } 00782 lpMem += WriteNewLineObject (lpMem, CieBasedABCEnd); 00783 *lpcbSize = (DWORD) ((lpMem - lpOldMem)); 00784 return (TRUE); 00785 }

BOOL GetPS2CSA_ABC_LAB CHANDLE  cp,
MEMPTR  lpMem,
LPDWORD  lpcbSize,
CSIG  InputIntent,
DWORD  InpDrvClrSp,
BOOL  AllowBinary
 

Definition at line 812 of file aug98/dll32/getcsa.c.

00814 { 00815 CSIG PCS, Dev; 00816 SFLOAT IlluminantWP[3]; 00817 SFLOAT MediaWP[3]; 00818 00819 SINT i; 00820 MEMPTR lpOldMem = lpMem; 00821 SINT Ret = 0; 00822 // Check if we can generate the CS. 00823 // Required tags are: red, green and blue Colorants. 00824 // As for TRC tags - we are quite flexible here - if we cannot find the 00825 // required tag - we assume the linear responce 00826 if (!GetCPConnSpace (cp, (LPCSIG) & PCS) || 00827 !GetCPDevSpace (cp, (LPCSIG) & Dev) || 00828 (Dev != icSigLabData)) 00829 { 00830 return (FALSE); 00831 } 00832 if ((InpDrvClrSp != icSigLabData) && 00833 (InpDrvClrSp != icSigDefData) && 00834 (InpDrvClrSp != 0)) 00835 { 00836 return (FALSE); 00837 } 00838 // Estimate the memory size required to hold CS 00839 00840 if (lpMem == NULL) // This is a size request 00841 { 00842 *lpcbSize = 65530; 00843 return (TRUE); 00844 } 00845 // Get info about Illuminant White Point from the header 00846 GetCPWhitePoint (cp, (LPSFLOAT) & IlluminantWP); // .. Illuminant 00847 00848 // Support absolute whitePoint 00849 GetMediaWP(cp, InputIntent, IlluminantWP, MediaWP); 00850 00851 //*********** Start creating the ColorSpace 00852 lpMem += WriteNewLineObject (lpMem, BeginArray); // Begin array 00853 00854 //********** /CIEBasedABC 00855 lpMem += WriteObject (lpMem, CIEBasedABCTag); // Create entry 00856 lpMem += WriteObject (lpMem, BeginDict); // Begin dictionary 00857 00858 //********** Black/White Point 00859 lpMem += SendCSABWPoint(lpMem, InputIntent, IlluminantWP, MediaWP); 00860 00861 //********** /RangeABC 00862 lpMem += WriteNewLineObject (lpMem, RangeABCTag); 00863 lpMem += WriteObject (lpMem, RangeABC_Lab); 00864 00865 //********** /DecodeABC 00866 lpMem += WriteNewLineObject (lpMem, DecodeABCTag); 00867 lpMem += WriteObject (lpMem, DecodeABCLab1); 00868 00869 //********** /MatrixABC 00870 lpMem += WriteNewLineObject (lpMem, MatrixABCTag); 00871 lpMem += WriteObject (lpMem, MatrixABCLab); 00872 00873 //********** /DecodeLMN 00874 lpMem += WriteNewLineObject (lpMem, DecodeLMNTag); 00875 lpMem += WriteObject (lpMem, BeginArray); 00876 for (i = 0; i < 3; i ++) 00877 { 00878 lpMem += WriteObject (lpMem, BeginFunction); 00879 lpMem += WriteObject (lpMem, DecodeLMNLab); 00880 if (InputIntent == icAbsoluteColorimetric) 00881 { 00882 lpMem += WriteFloat (lpMem, (double) MediaWP[i]); 00883 } 00884 else 00885 { 00886 lpMem += WriteFloat (lpMem, (double) IlluminantWP[i]); 00887 } 00888 lpMem += WriteObject (lpMem, MulOp); 00889 lpMem += WriteObject (lpMem, EndFunction); 00890 lpMem += WriteObject (lpMem, NewLine); 00891 } 00892 lpMem += WriteObject (lpMem, EndArray); 00893 00894 00895 //********** End dictionary definition 00896 lpMem += WriteNewLineObject (lpMem, EndDict); 00897 lpMem += WriteObject (lpMem, EndArray); 00898 00899 lpMem += WriteNewLineObject (lpMem, CieBasedABCEnd); 00900 *lpcbSize = (DWORD) ((lpMem - lpOldMem)); 00901 return (TRUE); 00902 }

BOOL GetPS2CSA_DEFG CHANDLE  cp,
MEMPTR  lpMem,
LPDWORD  lpcbSize,
CSIG  InputIntent,
SINT  Index,
int  Type,
BOOL  AllowBinary
[static]
 

Definition at line 261 of file aug98/dll32/getcsa.c.

References AllowBinary, BeginArray, BeginDict, BeginFunction, BeginGlobalDict(), BeginString, CieBasedDEFBegin, CieBasedDEFEnd, CieBasedDEFGBegin, CieBasedDEFGEnd, CIEBasedDEFGTag, CIEBasedDEFTag, Clip01, CP_POSTSCRIPT_ERR, CreateInputArray(), CreateOutputArray(), CSIG, DecodeABCLab, DecodeABCTag, DecodeDEFGTag, DecodeDEFTag, DecodeLMNLab, DecodeLMNTag, DWORD, EnableGlobalDict(), EncodeABCLab1, EncodeABCLab2, EndArray, EndClip, EndDict, EndFunction, EndOp, EndString, FALSE, FAR, GetCLUTinfo(), GetCPConnSpace, GetCPElement(), GetCPElementSize(), GetCPElementType(), GetCPTagSig(), GetCPWhitePoint(), GetMediaWP(), GetPublicArrayName(), icAbsoluteColorimetric, icSigLabData, icSigLut16Type, icSigLut8Type, icSigXYZData, icUInt16Number, Index, IndexArray, IndexArray16b, InputArray, lpcpLut16Type, lpcpLut8Type, LPCSIG, LPMEMPTR, LPSFLOAT, LPSINT, MatrixABCLab, MatrixABCTag, MAX_LINELENG, MemAlloc(), MemFree(), MEMPTR, MulOp, NewLine, NULL, OutputArray, RangeLMN, RangeLMNTag, Scale16, Scale16XYZ, Scale8, SendCSABWPoint(), SetCPLastError(), SetGlobalOp, SFLOAT, SINT, StartClip, SupportDEFG_E, SupportDEFG_S, TableTag, TempBfSize, TestingDEFG, TFunction8XYZ, TRUE, TYPE_CIEBASEDDEF, TYPE_CIEBASEDDEFG, ui16toSINT, WriteByteString(), WriteFloat(), WriteHex, WriteHexBuffer(), WriteInt, WriteInt2ByteString(), WriteNewLineObject(), WriteObject, WriteObjectN(), and WriteStringToken().

00269 { 00270 CSIG PCS, LutTag; 00271 CSIG IntentSig; 00272 SFLOAT IlluminantWP[3]; 00273 SFLOAT MediaWP[3]; 00274 SINT nInputCh, nOutputCh, nGrids, SecondGrids; 00275 SINT nInputTable, nOutputTable, nNumbers; 00276 SINT i, j, k; 00277 MEMPTR lpTable; 00278 MEMPTR lpOldMem = lpMem; 00279 MEMPTR lpLut = NULL; 00280 MEMPTR lpLineStart; 00281 HGLOBAL hLut = 0; 00282 SINT LutSize; 00283 char PublicArrayName[TempBfSize]; 00284 // Check if we can generate the CS. 00285 // Required tags are: red, green and blue Colorants. 00286 // As for TRC tags - we are quite flexible here - if we cannot find the 00287 // required tag - we assume the linear responce 00288 if (!GetCPConnSpace (cp, (LPCSIG) & PCS) || 00289 (PCS != icSigLabData) && (PCS != icSigXYZData) || 00290 !GetCPTagSig (cp, Index, (LPCSIG) & IntentSig)) 00291 { 00292 return (FALSE); 00293 } 00294 if (!GetCPElementType (cp, Index, (LPCSIG) & LutTag) || 00295 ((LutTag != icSigLut8Type) && (LutTag != icSigLut16Type)) || 00296 !GetCPElementSize (cp, Index, (LPSINT) & LutSize) || 00297 !MemAlloc (LutSize, (HGLOBAL FAR *) &hLut, (LPMEMPTR) & lpLut) || 00298 !GetCPElement (cp, Index, lpLut, LutSize)) 00299 { 00300 if (0 != hLut) 00301 { 00302 MemFree (hLut); 00303 } 00304 return (FALSE); 00305 } 00306 // Estimate the memory size required to hold CS 00307 00308 GetCLUTinfo(LutTag, lpLut, &nInputCh, &nOutputCh, 00309 &nGrids, &nInputTable, &nOutputTable, &i); 00310 00311 // Level 2 printers support only tri-component CIEBasedABC input, 00312 // but can have either 3 or 4 output channels. 00313 if (!(nOutputCh == 3) || 00314 !((nInputCh == 3) && (Type == TYPE_CIEBASEDDEF)) && 00315 !((nInputCh == 4) && (Type == TYPE_CIEBASEDDEFG))) 00316 { 00317 SetCPLastError (CP_POSTSCRIPT_ERR); 00318 MemFree (hLut); 00319 return (FALSE); 00320 } 00321 if (lpMem == NULL) // This is a size request 00322 { 00323 if (Type == TYPE_CIEBASEDDEFG) 00324 *lpcbSize = nOutputCh * nGrids * nGrids * nGrids * nGrids * 2; // LUT HEX bytes 00325 else 00326 *lpcbSize = nOutputCh * nGrids * nGrids * nGrids * 2; // LUT HEX bytes 00327 00328 *lpcbSize = *lpcbSize + 00329 nInputCh * nInputTable * 6 + 00330 nOutputCh * nOutputTable * 6 + // Number of INT bytes 00331 nInputCh * (lstrlen (IndexArray) + 00332 lstrlen (StartClip) + 00333 lstrlen (EndClip)) + 00334 nOutputCh * (lstrlen (IndexArray) + 00335 lstrlen (StartClip) + 00336 lstrlen (EndClip)) + 00337 4096; // + other PS stuff 00338 00339 00340 return (TRUE); 00341 } 00342 // Get info about Illuminant White Point from the header 00343 GetCPWhitePoint (cp, (LPSFLOAT) & IlluminantWP); // .. Illuminant 00344 00345 // Support absolute whitePoint 00346 GetMediaWP(cp, InputIntent, IlluminantWP, MediaWP); 00347 00348 //*********** Testing CieBasedDEFG support 00349 lpMem += WriteNewLineObject (lpMem, TestingDEFG); 00350 00351 //*********** Creating global data 00352 GetPublicArrayName (cp, IntentSig, PublicArrayName); 00353 if (Type == TYPE_CIEBASEDDEFG) 00354 lpMem += WriteNewLineObject (lpMem, CieBasedDEFGBegin); 00355 else 00356 lpMem += WriteNewLineObject (lpMem, CieBasedDEFBegin); 00357 00358 lpMem += EnableGlobalDict(lpMem); 00359 lpMem += WriteNewLineObject (lpMem, SupportDEFG_S); 00360 lpMem += BeginGlobalDict(lpMem); 00361 00362 lpMem += CreateInputArray (lpMem, nInputCh, nInputTable, 00363 (MEMPTR) PublicArrayName, LutTag, lpLut, AllowBinary, NULL); 00364 00365 if (Type == TYPE_CIEBASEDDEFG) 00366 { 00367 i = nInputTable * nInputCh + 00368 nGrids * nGrids * nGrids * nGrids * nOutputCh; 00369 } else 00370 { 00371 i = nInputTable * nInputCh + 00372 nGrids * nGrids * nGrids * nOutputCh; 00373 } 00374 lpMem += CreateOutputArray (lpMem, nOutputCh, nOutputTable, i, 00375 (MEMPTR) PublicArrayName, LutTag, lpLut, AllowBinary, NULL); 00376 00377 lpMem += WriteNewLineObject (lpMem, EndOp); 00378 lpMem += WriteNewLineObject (lpMem, SupportDEFG_E); 00379 lpMem += WriteNewLineObject (lpMem, SetGlobalOp); 00380 lpMem += WriteNewLineObject (lpMem, SupportDEFG_S); 00381 00382 //*********** Start creating the ColorSpace 00383 lpMem += WriteNewLineObject (lpMem, BeginArray); // Begin array 00384 00385 //********** /CIEBasedDEF(G) 00386 if (Type == TYPE_CIEBASEDDEFG) 00387 lpMem += WriteObject (lpMem, CIEBasedDEFGTag); 00388 else 00389 lpMem += WriteObject (lpMem, CIEBasedDEFTag); 00390 lpMem += WriteObject (lpMem, BeginDict); // Begin dictionary 00391 00392 //********** Black/White Point 00393 lpMem += SendCSABWPoint(lpMem, InputIntent, IlluminantWP, MediaWP); 00394 00395 //********** /DecodeDEF(G) 00396 lpLineStart = lpMem; 00397 if (Type == TYPE_CIEBASEDDEFG) 00398 lpMem += WriteNewLineObject (lpMem, DecodeDEFGTag); 00399 else 00400 lpMem += WriteNewLineObject (lpMem, DecodeDEFTag); 00401 00402 lpMem += WriteObject (lpMem, BeginArray); 00403 for (i = 0; i < nInputCh; i++) 00404 { 00405 lpLineStart = lpMem; 00406 00407 lpMem += WriteNewLineObject (lpMem, BeginFunction); 00408 #if 0 00409 if (PCS == icSigLabData) 00410 { 00411 lpMem += WriteObject (lpMem, 00412 (0 == i) ? EncodeABCLab1 : EncodeABCLab2); 00413 } 00414 #endif 00415 lpMem += WriteObject (lpMem, StartClip); 00416 lpMem += WriteObject (lpMem, InputArray); 00417 lpMem += WriteObjectN (lpMem, (MEMPTR) PublicArrayName, lstrlen (PublicArrayName)); 00418 lpMem += WriteInt (lpMem, i); 00419 00420 if (!AllowBinary) // Output ASCII 00421 { 00422 lpMem += WriteObject (lpMem, IndexArray); 00423 } else 00424 { // Output BINARY 00425 if (LutTag == icSigLut8Type) 00426 { 00427 lpMem += WriteObject (lpMem, IndexArray); 00428 } else 00429 { 00430 lpMem += WriteObject (lpMem, IndexArray16b); 00431 } 00432 } 00433 lpMem += WriteObject (lpMem, (LutTag == icSigLut8Type) ? Scale8 : Scale16); 00434 lpMem += WriteObject (lpMem, EndClip); 00435 lpMem += WriteObject (lpMem, EndFunction); 00436 } 00437 lpMem += WriteObject (lpMem, EndArray); 00438 00439 //********** /Table 00440 lpMem += WriteNewLineObject (lpMem, TableTag); 00441 lpMem += WriteObject (lpMem, BeginArray); 00442 00443 lpMem += WriteInt (lpMem, nGrids); // Send down Nh 00444 lpMem += WriteInt (lpMem, nGrids); // Send down Ni 00445 lpMem += WriteInt (lpMem, nGrids); // Send down Nj 00446 nNumbers = nGrids * nGrids * nOutputCh; 00447 SecondGrids = 1; 00448 if (Type == TYPE_CIEBASEDDEFG) 00449 { 00450 lpMem += WriteInt (lpMem, nGrids); // Send down Nk 00451 // nNumbers = nGrids * nGrids * nGrids * nOutputCh ; 00452 SecondGrids = nGrids; 00453 } 00454 lpMem += WriteNewLineObject (lpMem, BeginArray); 00455 for (i = 0; i < nGrids; i++) // Nh strings should be sent 00456 { 00457 if (Type == TYPE_CIEBASEDDEFG) 00458 { 00459 lpMem += WriteNewLineObject (lpMem, BeginArray); 00460 } 00461 for (k = 0; k < SecondGrids; k++) 00462 { 00463 lpLineStart = lpMem; 00464 lpMem += WriteObject (lpMem, NewLine); 00465 if (LutTag == icSigLut8Type) 00466 { 00467 lpTable = (MEMPTR) (((lpcpLut8Type) lpLut)->lut.data) + 00468 nInputTable * nInputCh + 00469 nNumbers * (i * SecondGrids + k); 00470 } else 00471 { 00472 lpTable = (MEMPTR) (((lpcpLut16Type) lpLut)->lut.data) + 00473 2 * nInputTable * nInputCh + 00474 2 * nNumbers * (i * SecondGrids + k); 00475 } 00476 00477 if (!AllowBinary) // Output ASCII 00478 { 00479 lpMem += WriteObject (lpMem, BeginString); 00480 if (LutTag == icSigLut8Type) 00481 lpMem += WriteHexBuffer (lpMem, lpTable, lpLineStart, nNumbers); 00482 else 00483 { 00484 for (j = 0; j < nNumbers; j++) 00485 { 00486 lpMem += WriteHex (lpMem, ui16toSINT (lpTable) / 256); 00487 lpTable += sizeof (icUInt16Number); 00488 if (((SINT) (lpMem - lpLineStart)) > MAX_LINELENG) 00489 { 00490 lpLineStart = lpMem; 00491 lpMem += WriteObject (lpMem, NewLine); 00492 } 00493 } 00494 } 00495 lpMem += WriteObject (lpMem, EndString); 00496 } else 00497 { // Output BINARY 00498 lpMem += WriteStringToken (lpMem, 143, nNumbers); 00499 if (LutTag == icSigLut8Type) 00500 lpMem += WriteByteString (lpMem, lpTable, nNumbers); 00501 else 00502 lpMem += WriteInt2ByteString (lpMem, lpTable, nNumbers); 00503 } 00504 lpMem += WriteObject (lpMem, NewLine); 00505 } 00506 if (Type == TYPE_CIEBASEDDEFG) 00507 { 00508 lpMem += WriteObject (lpMem, EndArray); 00509 } 00510 } 00511 lpMem += WriteObject (lpMem, EndArray); 00512 lpMem += WriteObject (lpMem, EndArray); // End array 00513 00514 //********** /DecodeABC 00515 lpLineStart = lpMem; 00516 lpMem += WriteNewLineObject (lpMem, DecodeABCTag); 00517 lpMem += WriteObject (lpMem, BeginArray); 00518 for (i = 0; i < nOutputCh; i++) 00519 { 00520 lpLineStart = lpMem; 00521 lpMem += WriteNewLineObject (lpMem, BeginFunction); 00522 lpMem += WriteObject (lpMem, Clip01); 00523 lpMem += WriteObject (lpMem, OutputArray); 00524 lpMem += WriteObjectN (lpMem, (MEMPTR) PublicArrayName, lstrlen (PublicArrayName)); 00525 lpMem += WriteInt (lpMem, i); 00526 00527 if (!AllowBinary) // Output ASCII CRD 00528 { 00529 lpMem += WriteObject (lpMem, NewLine); 00530 00531 if (LutTag == icSigLut8Type) 00532 { 00533 lpMem += WriteObject (lpMem, TFunction8XYZ); 00534 } else 00535 { 00536 lpMem += WriteObject (lpMem, IndexArray); 00537 lpMem += WriteObject (lpMem, Scale16XYZ); 00538 } 00539 } else 00540 { // Output BINARY CRD 00541 if (LutTag == icSigLut8Type) 00542 { 00543 lpMem += WriteObject (lpMem, TFunction8XYZ); 00544 } else 00545 { 00546 lpMem += WriteObject (lpMem, IndexArray16b); 00547 lpMem += WriteObject (lpMem, Scale16XYZ); 00548 } 00549 } 00550 00551 // Now, We get CieBasedXYZ output. Output range 0 --> 1.99997 00552 // If the connection space is absolute XYZ, We need to convert 00553 // from relative XYZ to absolute XYZ. 00554 if ((PCS == icSigXYZData) && 00555 (InputIntent == icAbsoluteColorimetric)) 00556 { 00557 lpMem += WriteFloat (lpMem, (double)MediaWP[i]/IlluminantWP[i]); 00558 lpMem += WriteObject (lpMem, MulOp); 00559 } 00560 // If the connection space is Lab, We need to convert XYZ to Lab. 00561 else if (PCS == icSigLabData) 00562 lpMem += WriteObject (lpMem, DecodeABCLab[i]); 00563 lpMem += WriteObject (lpMem, EndFunction); 00564 } 00565 lpMem += WriteObject (lpMem, EndArray); 00566 00567 if (PCS == icSigLabData) 00568 { 00569 //********** /MatrixABC 00570 lpMem += WriteNewLineObject (lpMem, MatrixABCTag); 00571 lpMem += WriteObject (lpMem, MatrixABCLab); 00572 00573 //********** /DecodeLMN 00574 lpLineStart = lpMem; 00575 lpMem += WriteNewLineObject (lpMem, DecodeLMNTag); 00576 lpMem += WriteObject (lpMem, BeginArray); 00577 for (i = 0; i < 3; i++) 00578 { 00579 lpLineStart = lpMem; 00580 lpMem += WriteNewLineObject (lpMem, BeginFunction); 00581 lpMem += WriteObject (lpMem, DecodeLMNLab); 00582 if (InputIntent == icAbsoluteColorimetric) 00583 lpMem += WriteFloat (lpMem, (double) MediaWP[i]); 00584 else 00585 lpMem += WriteFloat (lpMem, (double) IlluminantWP[i]); 00586 lpMem += WriteObject (lpMem, MulOp); 00587 lpMem += WriteObject (lpMem, EndFunction); 00588 } 00589 lpMem += WriteObject (lpMem, EndArray); 00590 } else 00591 { 00592 //********** /RangeLMN 00593 lpMem += WriteNewLineObject (lpMem, RangeLMNTag); 00594 lpMem += WriteObject (lpMem, RangeLMN); 00595 } 00596 00597 //********** End dictionary definition 00598 lpMem += WriteNewLineObject (lpMem, EndDict); 00599 lpMem += WriteObject (lpMem, EndArray); 00600 00601 if (Type == TYPE_CIEBASEDDEFG) 00602 lpMem += WriteNewLineObject (lpMem, CieBasedDEFGEnd); 00603 else 00604 lpMem += WriteNewLineObject (lpMem, CieBasedDEFEnd); 00605 00606 lpMem += WriteNewLineObject (lpMem, SupportDEFG_E); 00607 00608 *lpcbSize = (DWORD) (lpMem - lpOldMem); 00609 00610 MemFree (hLut); 00611 return (TRUE); 00612 }

BOOL GetPS2CSA_DEFG_Intent CHANDLE  cp,
MEMPTR  lpBuffer,
LPDWORD  lpcbSize,
DWORD  InpDrvClrSp,
CSIG  Intent,
int  Type,
BOOL  AllowBinary
 

Definition at line 1502 of file aug98/dll32/getcsa.c.

01510 { 01511 SINT Index; 01512 BOOL Success = FALSE; 01513 CSIG icSigAToBx; 01514 01515 // Try to create CieBasedDEFG CSA first. 01516 if (((Type == TYPE_CIEBASEDDEFG) && (InpDrvClrSp != icSigCmykData) || 01517 (Type == TYPE_CIEBASEDDEF) && (InpDrvClrSp != icSigDefData)) && 01518 (InpDrvClrSp != 0)) 01519 { 01520 return (FALSE); 01521 } 01522 switch (Intent) 01523 { 01524 case icPerceptual: 01525 icSigAToBx = icSigAToB0Tag; 01526 break; 01527 case icRelativeColorimetric: 01528 icSigAToBx = icSigAToB1Tag; 01529 break; 01530 case icSaturation: 01531 icSigAToBx = icSigAToB2Tag; 01532 break; 01533 case icAbsoluteColorimetric: 01534 icSigAToBx = icSigAToB1Tag; 01535 break; 01536 default: 01537 return Success; 01538 } 01539 01540 if (DoesCPTagExist (cp, icSigAToBx) && 01541 GetCPTagIndex (cp, icSigAToBx, (LPSINT) & Index)) 01542 { 01543 Success = GetPS2CSA_DEFG (cp, lpBuffer, lpcbSize, Intent, Index, Type, AllowBinary); 01544 } 01545 01546 return Success; 01547 }

BOOL GetPS2CSA_MONO CHANDLE  cp,
MEMPTR  lpMem,
LPDWORD  lpcbSize,
DWORD  InpDrvClrSp,
CSIG  InputIntent,
BOOL  AllowBinary
[static]
 

Definition at line 1253 of file aug98/dll32/getcsa.c.

References AllowBinary, BOOL, FALSE, GetPS2CSA_MONO_A(), GetPS2CSA_MONO_ABC(), icSigDefData, icSigGrayData, and icSigRgbData.

01255 { 01256 BOOL Success = FALSE; 01257 #if 0 01258 if ((InpDrvClrSp == icSigRgbData) || 01259 (InpDrvClrSp == icSigDefData) || 01260 (InpDrvClrSp == 0)) 01261 { 01262 Success = GetPS2CSA_MONO_ABC (cp, lpMem, lpcbSize, InputIntent, AllowBinary); 01263 } else if (InpDrvClrSp == icSigGrayData) 01264 { 01265 Success = GetPS2CSA_MONO_A (cp, lpMem, lpcbSize, InputIntent, AllowBinary); 01266 } 01267 #else 01268 if ((InpDrvClrSp == icSigGrayData) || 01269 (InpDrvClrSp == 0)) 01270 { 01271 Success = GetPS2CSA_MONO_A (cp, lpMem, lpcbSize, InputIntent, AllowBinary); 01272 } 01273 else 01274 { 01275 Success = FALSE; 01276 } 01277 #endif 01278 return Success; 01279 }

BOOL GetPS2CSA_MONO_A CHANDLE  cp,
MEMPTR  lpMem,
LPDWORD  lpcbSize,
CSIG  InputIntent,
BOOL  AllowBinary
[static]
 

Definition at line 1087 of file aug98/dll32/getcsa.c.

References BeginArray, BeginDict, BeginFunction, CieBasedABegin, CieBasedAEnd, CIEBasedATag, CSIG, DecodeA3, DecodeALab, DecodeATag, DecodeLMNLab, DoesCPTagExist(), DWORD, EndArray, EndClip, EndDict, EndFunction, FALSE, FAR, GetCPConnSpace, GetCPElement(), GetCPElementSize(), GetCPElementType(), GetCPTagIndex(), GetCPWhitePoint(), GetMediaWP(), icAbsoluteColorimetric, icSigCurveType, icSigGrayTRCTag, icSigLabData, icUInt16Number, Index, IndexArray, lpcpCurveType, LPCSIG, LPMEMPTR, LPSFLOAT, LPSINT, MatrixATag, MAX_LINELENG, MemAlloc(), MemFree(), MEMPTR, NewLine, NULL, RangeLMN, RangeLMNTag, Scale16, SendCSABWPoint(), SFLOAT, SINT, StartClip, TRUE, ui16toSINT, ui32toSINT, WriteFloat(), WriteInt, WriteNewLineObject(), and WriteObject.

01089 { 01090 SINT nCount; 01091 CSIG Tag, PCS; 01092 SINT i, Index; 01093 MEMPTR lpTable; 01094 SFLOAT IlluminantWP[3]; 01095 SFLOAT MediaWP[3]; 01096 MEMPTR lpBuff = NULL; 01097 SINT MemSize = 0; 01098 MEMPTR lpOldMem = lpMem; 01099 HGLOBAL hBuff; 01100 MEMPTR lpLineStart; 01101 // Check if we can generate the CS 01102 if (!DoesCPTagExist (cp, icSigGrayTRCTag) || 01103 !GetCPTagIndex (cp, icSigGrayTRCTag, &Index) || 01104 !GetCPElementType (cp, Index, (LPCSIG) & Tag) || 01105 (Tag != icSigCurveType) || 01106 !GetCPConnSpace (cp, (LPCSIG) & PCS) || 01107 !GetCPElementSize (cp, Index, (LPSINT) & MemSize) || 01108 !MemAlloc (MemSize, (HGLOBAL FAR *)&hBuff, (LPMEMPTR) & lpBuff) || 01109 !GetCPElement (cp, Index, lpBuff, MemSize)) 01110 { 01111 if (NULL != lpBuff) 01112 { 01113 MemFree (hBuff); 01114 } 01115 return (FALSE); 01116 } 01117 nCount = ui32toSINT (((lpcpCurveType) lpBuff)->curve.count); 01118 01119 // Estimate the memory size required to hold CS 01120 *lpcbSize = nCount * 6 + // Number of INT elements 01121 3 * (lstrlen (IndexArray) + 01122 lstrlen (StartClip) + 01123 lstrlen (EndClip)) + 01124 2048; // + other PS stuff 01125 if (lpMem == NULL) // This is a size request 01126 { 01127 MemFree (hBuff); 01128 return (TRUE); 01129 } 01130 // Get info about Illuminant White Point from the header 01131 GetCPWhitePoint (cp, (LPSFLOAT) & IlluminantWP); // .. Illuminant 01132 01133 // Support absolute whitePoint 01134 GetMediaWP(cp, InputIntent, IlluminantWP, MediaWP); 01135 01136 //*********** Start creating the ColorSpace 01137 lpMem += WriteNewLineObject (lpMem, CieBasedABegin); 01138 01139 lpMem += WriteNewLineObject (lpMem, BeginArray); // Begin array 01140 //********** /CIEBasedA 01141 lpMem += WriteObject (lpMem, CIEBasedATag); // Create entry 01142 lpMem += WriteObject (lpMem, BeginDict); // Begin dictionary 01143 01144 //********** Black/White Point 01145 lpMem += SendCSABWPoint(lpMem, InputIntent, IlluminantWP, MediaWP); 01146 01147 //********** /DecodeA 01148 lpMem += WriteObject (lpMem, NewLine); 01149 lpLineStart = lpMem; 01150 01151 if (nCount != 0) 01152 { 01153 lpMem += WriteObject (lpMem, DecodeATag); 01154 01155 lpMem += WriteObject (lpMem, BeginFunction); 01156 if (nCount == 1) // Gamma supplied in ui16 format 01157 { 01158 lpTable = (MEMPTR) (((lpcpCurveType) lpBuff)->curve.data); 01159 lpMem += WriteInt (lpMem, ui16toSINT (lpTable)); 01160 lpMem += WriteObject (lpMem, DecodeA3); 01161 // If the PCS is Lab, we need to convert Lab to XYZ 01162 // Now, the range is from 0 --> 0.99997. 01163 // Actually, the conversion from Lab to XYZ is not needed. 01164 if (PCS == icSigLabData) 01165 { 01166 lpMem += WriteObject (lpMem, DecodeALab); 01167 lpMem += WriteObject (lpMem, DecodeLMNLab); 01168 } 01169 } else 01170 { 01171 lpMem += WriteObject (lpMem, StartClip); 01172 lpTable = (MEMPTR) (((lpcpCurveType) lpBuff)->curve.data); 01173 lpMem += WriteObject (lpMem, BeginArray); 01174 for (i = 0; i < nCount; i++) 01175 { 01176 lpMem += WriteInt (lpMem, ui16toSINT (lpTable)); 01177 lpTable += sizeof (icUInt16Number); 01178 if (((SINT) (lpMem - lpLineStart)) > MAX_LINELENG) 01179 { 01180 lpLineStart = lpMem; 01181 lpMem += WriteObject (lpMem, NewLine); 01182 } 01183 } 01184 lpMem += WriteObject (lpMem, EndArray); 01185 lpLineStart = lpMem; 01186 lpMem += WriteObject (lpMem, NewLine); 01187 01188 lpMem += WriteObject (lpMem, IndexArray); 01189 lpMem += WriteObject (lpMem, Scale16); 01190 // If the PCS is Lab, we need to convert Lab to XYZ 01191 // Now, the range is from 0 --> .99997. 01192 // Actually, the conversion from Lab to XYZ is not needed. 01193 if (PCS == icSigLabData) 01194 { 01195 lpMem += WriteObject (lpMem, DecodeALab); 01196 lpMem += WriteObject (lpMem, DecodeLMNLab); 01197 } 01198 lpMem += WriteObject (lpMem, EndClip); 01199 } 01200 lpMem += WriteObject (lpMem, EndFunction); 01201 } 01202 01203 //********** /MatrixA 01204 lpMem += WriteNewLineObject (lpMem, MatrixATag); 01205 lpMem += WriteObject (lpMem, BeginArray); 01206 for (i = 0; i < 3; i++) 01207 { 01208 if (InputIntent == icAbsoluteColorimetric) 01209 lpMem += WriteFloat (lpMem, (double) MediaWP[i]); 01210 else 01211 lpMem += WriteFloat (lpMem, (double) IlluminantWP[i]); 01212 } 01213 lpMem += WriteObject (lpMem, EndArray); 01214 01215 //********** /RangeLMN 01216 lpMem += WriteNewLineObject (lpMem, RangeLMNTag); 01217 lpMem += WriteObject (lpMem, RangeLMN); 01218 01219 //********** /End dictionary 01220 lpMem += WriteObject (lpMem, EndDict); // End dictionary definition 01221 lpMem += WriteObject (lpMem, EndArray); 01222 01223 MemFree (hBuff); 01224 01225 lpMem += WriteNewLineObject (lpMem, CieBasedAEnd); 01226 *lpcbSize = (DWORD) (lpMem - lpOldMem); 01227 return (TRUE); 01228 }

BOOL GetPS2CSA_MONO_ABC CHANDLE  cp,
MEMPTR  lpMem,
LPDWORD  lpcbSize,
CSIG  InputIntent,
BOOL  AllowBinary
[static]
 

Definition at line 927 of file aug98/dll32/getcsa.c.

References BeginArray, BeginDict, BeginFunction, CieBasedABCBegin, CieBasedABCEnd, CIEBasedABCTag, CSIG, DecodeA3, DecodeABCTag, DoesCPTagExist(), DupOp, DWORD, EndArray, EndClip, EndDict, EndFunction, FALSE, FAR, GetCPConnSpace, GetCPElement(), GetCPElementSize(), GetCPElementType(), GetCPTagIndex(), GetCPWhitePoint(), GetMediaWP(), icAbsoluteColorimetric, icSigCurveType, icSigGrayTRCTag, icUInt16Number, Index, IndexArray, lpcpCurveType, LPCSIG, LPMEMPTR, LPSFLOAT, LPSINT, MatrixABCTag, MAX_LINELENG, MemAlloc(), MemFree(), MEMPTR, NewLine, NULL, RangeLMN, RangeLMNTag, Scale16, SendCSABWPoint(), SFLOAT, SINT, StartClip, TRUE, ui16toSINT, ui32toSINT, WriteFloat(), WriteInt, WriteNewLineObject(), and WriteObject.

00929 { 00930 SINT nCount; 00931 CSIG Tag, PCS; 00932 SINT i, j, Index; 00933 MEMPTR lpTable; 00934 SFLOAT IlluminantWP[3]; 00935 SFLOAT MediaWP[3]; 00936 MEMPTR lpBuff = NULL; 00937 SINT MemSize = 0; 00938 MEMPTR lpOldMem = lpMem; 00939 HGLOBAL hBuff; 00940 MEMPTR lpLineStart; 00941 // Check if we can generate the CS 00942 if (!DoesCPTagExist (cp, icSigGrayTRCTag) || 00943 !GetCPTagIndex (cp, icSigGrayTRCTag, &Index) || 00944 !GetCPElementType (cp, Index, (LPCSIG) & Tag) || 00945 (Tag != icSigCurveType) || 00946 !GetCPConnSpace (cp, (LPCSIG) & PCS) || 00947 !GetCPElementSize (cp, Index, (LPSINT) & MemSize) || 00948 !MemAlloc (MemSize, (HGLOBAL FAR *)&hBuff, (LPMEMPTR) & lpBuff) || 00949 !GetCPElement (cp, Index, lpBuff, MemSize)) 00950 { 00951 if (NULL != lpBuff) 00952 { 00953 MemFree (hBuff); 00954 } 00955 return (FALSE); 00956 } 00957 nCount = ui32toSINT (((lpcpCurveType) lpBuff)->curve.count); 00958 00959 // Estimate the memory size required to hold CS 00960 *lpcbSize = nCount * 6 + // Number of INT elements 00961 3 * (lstrlen (IndexArray) + 00962 lstrlen (StartClip) + 00963 lstrlen (EndClip)) + 00964 2048; // + other PS stuff 00965 if (lpMem == NULL) // This is a size request 00966 { 00967 MemFree (hBuff); 00968 return (TRUE); 00969 } 00970 // Get info about Illuminant White Point from the header 00971 GetCPWhitePoint (cp, (LPSFLOAT) & IlluminantWP); // .. Illuminant 00972 00973 // Support absolute whitePoint 00974 GetMediaWP(cp, InputIntent, IlluminantWP, MediaWP); 00975 00976 //*********** Start creating the ColorSpace 00977 lpMem += WriteNewLineObject (lpMem, CieBasedABCBegin); 00978 00979 lpMem += WriteNewLineObject (lpMem, BeginArray); // Begin array 00980 //********** /CIEBasedABC 00981 lpMem += WriteObject (lpMem, CIEBasedABCTag); // Create entry 00982 lpMem += WriteObject (lpMem, BeginDict); // Begin dictionary 00983 00984 //********** Black/White Point 00985 lpMem += SendCSABWPoint(lpMem, InputIntent, IlluminantWP, MediaWP); 00986 00987 //********** /DecodeABC 00988 lpMem += WriteObject (lpMem, NewLine); 00989 lpLineStart = lpMem; 00990 00991 if (nCount != 0) 00992 { 00993 lpMem += WriteObject (lpMem, DecodeABCTag); 00994 lpMem += WriteObject (lpMem, BeginArray); 00995 00996 lpMem += WriteObject (lpMem, BeginFunction); 00997 if (nCount == 1) // Gamma supplied in ui16 format 00998 { 00999 lpTable = (MEMPTR) (((lpcpCurveType) lpBuff)->curve.data); 01000 lpMem += WriteInt (lpMem, ui16toSINT (lpTable)); 01001 lpMem += WriteObject (lpMem, DecodeA3); 01002 } else 01003 { 01004 lpMem += WriteObject (lpMem, StartClip); 01005 lpTable = (MEMPTR) (((lpcpCurveType) lpBuff)->curve.data); 01006 lpMem += WriteObject (lpMem, BeginArray); 01007 for (i = 0; i < nCount; i++) 01008 { 01009 lpMem += WriteInt (lpMem, ui16toSINT (lpTable)); 01010 lpTable += sizeof (icUInt16Number); 01011 if (((SINT) (lpMem - lpLineStart)) > MAX_LINELENG) 01012 { 01013 lpLineStart = lpMem; 01014 lpMem += WriteObject (lpMem, NewLine); 01015 } 01016 } 01017 lpMem += WriteObject (lpMem, EndArray); 01018 lpLineStart = lpMem; 01019 lpMem += WriteObject (lpMem, NewLine); 01020 01021 lpMem += WriteObject (lpMem, IndexArray); 01022 lpMem += WriteObject (lpMem, Scale16); 01023 lpMem += WriteObject (lpMem, EndClip); 01024 } 01025 lpMem += WriteObject (lpMem, EndFunction); 01026 lpMem += WriteObject (lpMem, DupOp); 01027 lpMem += WriteObject (lpMem, DupOp); 01028 lpMem += WriteObject (lpMem, EndArray); 01029 } 01030 //********** /MatrixABC 01031 lpMem += WriteNewLineObject (lpMem, MatrixABCTag); 01032 lpMem += WriteObject (lpMem, BeginArray); 01033 for (i = 0; i < 3; i ++) 01034 { 01035 for (j = 0; j < 3; j++) 01036 { 01037 if (i != j) 01038 lpMem += WriteFloat (lpMem, (double)0); 01039 else 01040 { 01041 if (InputIntent == icAbsoluteColorimetric) 01042 lpMem += WriteFloat (lpMem, (double)MediaWP[i]); 01043 else 01044 lpMem += WriteFloat (lpMem, (double)IlluminantWP[i]); 01045 } 01046 } 01047 } 01048 lpMem += WriteObject (lpMem, EndArray); 01049 01050 //********** /RangeLMN 01051 lpMem += WriteNewLineObject (lpMem, RangeLMNTag); 01052 lpMem += WriteObject (lpMem, RangeLMN); 01053 01054 01055 lpMem += WriteObject (lpMem, EndDict); // End dictionary definition 01056 lpMem += WriteObject (lpMem, EndArray); 01057 01058 MemFree (hBuff); 01059 01060 lpMem += WriteNewLineObject (lpMem, CieBasedABCEnd); 01061 *lpcbSize = (DWORD) (lpMem - lpOldMem); 01062 return (TRUE); 01063 }

SINT GetPublicArrayName CHANDLE  cp,
CSIG  IntentSig,
MEMPTR  PublicArrayName
 

Definition at line 154 of file aug98/dll32/getcsa.c.

00155 { 00156 MEMPTR OldPtr; 00157 OldPtr = PublicArrayName; 00158 PublicArrayName[0] = 0; 00159 MemCopy (PublicArrayName, (MEMPTR) & IntentSig, sizeof (CSIG)); 00160 PublicArrayName += sizeof (CSIG); 00161 PublicArrayName[0] = 0; 00162 return (PublicArrayName - OldPtr); 00163 }

BOOL IsSRGB CHANDLE  cp  ) 
 

Definition at line 799 of file aug98/dll32/getcrd.c.

00800 { 00801 BOOL match = FALSE; 00802 SINT RedTRCIndex, GreenTRCIndex, BlueTRCIndex, RedCIndex, GreenCIndex, BlueCIndex; 00803 SINT MemSize; 00804 SINT RedTRCSize=0, GreenTRCSize=0, BlueTRCSize=0, RedCSize=0, GreenCSize=0, BlueCSize=0; 00805 HGLOBAL hMem; 00806 MEMPTR lpRed = NULL,lpGreen, lpBlue, lpRedC, lpGreenC, lpBlueC; 00807 DWORD crc; 00808 00809 if (GetCPTagIndex (cp, icSigRedTRCTag, &RedTRCIndex) && 00810 GetCPElementSize (cp, RedTRCIndex, &RedTRCSize) && 00811 00812 GetCPTagIndex (cp, icSigGreenTRCTag, &GreenTRCIndex) && 00813 GetCPElementSize (cp, GreenTRCIndex, &GreenTRCSize) && 00814 00815 GetCPTagIndex (cp, icSigBlueTRCTag, &BlueTRCIndex) && 00816 GetCPElementSize (cp, BlueTRCIndex, &BlueTRCSize) && 00817 00818 GetCPTagIndex (cp, icSigRedColorantTag, &RedCIndex) && 00819 GetCPElementSize (cp, RedCIndex, &RedCSize) && 00820 00821 GetCPTagIndex (cp, icSigGreenColorantTag, &GreenCIndex) && 00822 GetCPElementSize (cp, GreenCIndex, &GreenCSize) && 00823 00824 GetCPTagIndex (cp, icSigBlueColorantTag, &BlueCIndex) && 00825 GetCPElementSize (cp, BlueCIndex, &BlueCSize) ) 00826 { 00827 MemSize = RedTRCSize + GreenTRCSize + BlueTRCSize + RedCSize + GreenCSize + BlueCSize; 00828 00829 if ( (MemSize == 6240) && // #bytes in sRGBColorTags 00830 MemAlloc (MemSize, (HGLOBAL FAR *)&hMem, (LPMEMPTR)&lpRed) ) 00831 { 00832 lpGreen = lpRed + RedTRCSize; 00833 lpBlue = lpGreen + GreenTRCSize; 00834 lpRedC = lpBlue + BlueTRCSize; 00835 lpGreenC = lpRedC + RedCSize; 00836 lpBlueC = lpGreenC + GreenCSize; 00837 00838 if (GetCPElement (cp, RedTRCIndex, lpRed, RedTRCSize) && 00839 GetCPElement (cp, GreenTRCIndex, lpGreen, GreenTRCSize ) && 00840 GetCPElement (cp, BlueTRCIndex, lpBlue, BlueTRCSize ) && 00841 GetCPElement (cp, RedCIndex, lpRedC, RedCSize) && 00842 GetCPElement (cp, GreenCIndex, lpGreenC, GreenCSize ) && 00843 GetCPElement (cp, BlueCIndex, lpBlueC, BlueCSize )) 00844 { 00845 crc = crc32( lpRed, 6240 ); 00846 match = (crc == SRGBCRC); 00847 } 00848 MemFree(hMem); 00849 } 00850 } 00851 return (match); 00852 }

SINT SendCSABWPoint MEMPTR  lpMem,
CSIG  Intent,
LPSFLOAT  IlluminantWP,
LPSFLOAT  MediaWP
[static]
 

Definition at line 165 of file aug98/dll32/getcsa.c.

References BeginArray, BlackPoint, BlackPointTag, EndArray, icAbsoluteColorimetric, Intent, MEMPTR, SINT, WhitePointTag, WriteFloat(), WriteNewLineObject(), and WriteObject.

00167 { 00168 SINT i; 00169 MEMPTR lpOldMem = lpMem; 00170 00171 //********** /BlackPoint 00172 lpMem += WriteNewLineObject (lpMem, BlackPointTag); 00173 lpMem += WriteObject (lpMem, BlackPoint); 00174 00175 //********** /WhitePoint 00176 lpMem += WriteNewLineObject (lpMem, WhitePointTag); 00177 lpMem += WriteObject (lpMem, BeginArray); 00178 for (i = 0; i < 3; i++) 00179 { 00180 if (Intent == icAbsoluteColorimetric) 00181 { 00182 lpMem += WriteFloat (lpMem, (double) MediaWP[i]); 00183 } 00184 else 00185 { 00186 lpMem += WriteFloat (lpMem, (double) IlluminantWP[i]); 00187 } 00188 } 00189 lpMem += WriteObject (lpMem, EndArray); 00190 return (SINT)(lpMem - lpOldMem); 00191 }


Variable Documentation

char* DecodeABCLab[] [static]
 

Initial value:

{"50 mul 16 add 116 div ", "128 mul 128 sub 500 div", "128 mul 128 sub 200 div"}

Definition at line 6 of file aug98/dll32/getcsa.c.

Referenced by GetPS2CSA_DEFG().


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