00636 {
00637
CSIG PCS, Dev;
00638
SFLOAT IlluminantWP[3];
00639
SFLOAT MediaWP[3];
00640
00641
SINT i;
00642
MEMPTR lpOldMem = lpMem;
00643
SINT Ret = 0;
00644
00645
00646
00647
00648
if (!
GetCPConnSpace (cp, (LPCSIG) & PCS) ||
00649 !
GetCPDevSpace (cp, (LPCSIG) & Dev) ||
00650 (Dev !=
icSigRgbData) ||
00651 !
DoesCPTagExist (cp, icSigRedColorantTag) ||
00652 !
DoesCPTagExist (cp, icSigGreenColorantTag) ||
00653 !
DoesCPTagExist (cp, icSigBlueColorantTag) ||
00654 !
DoesCPTagExist (cp, icSigRedTRCTag) ||
00655 !
DoesCPTagExist (cp, icSigGreenTRCTag) ||
00656 !
DoesCPTagExist (cp, icSigBlueTRCTag))
00657 {
00658
return (
FALSE);
00659 }
00660
if ((InpDrvClrSp !=
icSigRgbData) &&
00661 (InpDrvClrSp !=
icSigDefData) &&
00662 (InpDrvClrSp != 0))
00663 {
00664
return (
FALSE);
00665 }
00666
00667
00668
if (lpMem ==
NULL)
00669 {
00670 *lpcbSize = 65530;
00671
return (
TRUE);
00672 }
00673
00674
GetCPWhitePoint (cp, (LPSFLOAT) & IlluminantWP);
00675
00676
00677
GetMediaWP(cp, InputIntent, IlluminantWP, MediaWP);
00678
00679
00680 lpMem +=
WriteObject (lpMem, NewLine);
00681 lpMem +=
WriteObject (lpMem, CieBasedABCBegin);
00682
00683 lpMem +=
EnableGlobalDict(lpMem);
00684
00685 lpMem +=
CreateColSpArray (cp, lpMem, icSigRedTRCTag, AllowBinary);
00686 lpMem +=
CreateColSpArray (cp, lpMem, icSigGreenTRCTag, AllowBinary);
00687 lpMem +=
CreateColSpArray (cp, lpMem, icSigBlueTRCTag, AllowBinary);
00688
00689 lpMem +=
WriteObject (lpMem, NewLine);
00690 lpMem +=
WriteObject (lpMem, SetGlobalOp);
00691 lpMem +=
WriteObject (lpMem, EndOp);
00692
00693
00694
00695 lpMem +=
WriteObject (lpMem, NewLine);
00696 lpMem +=
WriteObject (lpMem, BeginArray);
00697
00698 lpMem +=
WriteObject (lpMem, CIEBasedABCTag);
00699 lpMem +=
WriteObject (lpMem, BeginDict);
00700
00701
00702 lpMem +=
SendCSABWPoint(lpMem, InputIntent, IlluminantWP, MediaWP);
00703
00704
00705 lpMem +=
WriteObject (lpMem, NewLine);
00706 lpMem +=
WriteObject (lpMem, DecodeABCTag);
00707 lpMem +=
WriteObject (lpMem, BeginArray);
00708
00709 lpMem +=
WriteObject (lpMem, NewLine);
00710 lpMem +=
CreateColSpProc (cp, lpMem, icSigRedTRCTag, AllowBinary);
00711 lpMem +=
WriteObject (lpMem, NewLine);
00712 lpMem +=
CreateColSpProc (cp, lpMem, icSigGreenTRCTag, AllowBinary);
00713 lpMem +=
WriteObject (lpMem, NewLine);
00714 lpMem +=
CreateColSpProc (cp, lpMem, icSigBlueTRCTag, AllowBinary);
00715 lpMem +=
WriteObject (lpMem, EndArray);
00716
00717
00718 lpMem +=
WriteObject (lpMem, NewLine);
00719 lpMem +=
WriteObject (lpMem, MatrixABCTag);
00720 lpMem +=
WriteObject (lpMem, BeginArray);
00721
00722 lpMem +=
CreateFloatString (cp, lpMem, icSigRedColorantTag);
00723 lpMem +=
CreateFloatString (cp, lpMem, icSigGreenColorantTag);
00724 lpMem +=
CreateFloatString (cp, lpMem, icSigBlueColorantTag);
00725
00726 lpMem +=
WriteObject (lpMem, EndArray);
00727
00728
00729 lpMem +=
WriteObject (lpMem, NewLine);
00730 lpMem +=
WriteObject (lpMem, RangeLMNTag);
00731 lpMem +=
WriteObject (lpMem, RangeLMN);
00732
00733
00734
if (InputIntent ==
icAbsoluteColorimetric)
00735 {
00736
00737 lpMem +=
WriteObject (lpMem, NewLine);
00738 lpMem +=
WriteObject (lpMem, DecodeLMNTag);
00739 lpMem +=
WriteObject (lpMem, BeginArray);
00740
for (i = 0; i < 3; i ++)
00741 {
00742 lpMem +=
WriteObject (lpMem, BeginFunction);
00743 lpMem +=
WriteFloat (lpMem, (
double)MediaWP[i]/IlluminantWP[i]);
00744 lpMem +=
WriteObject (lpMem, MulOp);
00745 lpMem +=
WriteObject (lpMem, EndFunction);
00746 }
00747 lpMem +=
WriteObject (lpMem, EndArray);
00748 }
00749
00750
00751 lpMem +=
WriteObject (lpMem, NewLine);
00752 lpMem +=
WriteObject (lpMem, EndDict);
00753 lpMem +=
WriteObject (lpMem, EndArray);
00754
00755 lpMem +=
WriteObject (lpMem, NewLine);
00756 lpMem +=
WriteObject (lpMem, CieBasedABCEnd);
00757 *lpcbSize = (
DWORD) ((lpMem - lpOldMem));
00758
return (
TRUE);
00759 }