test: dec97/dll32/getcrd.h File Reference

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

# getcrd.h File Reference

Go to the source code of this file.

## Functions

BOOL EXTERN | GetPS2ColorRenderingDictionary (CHANDLE cp, DWORD Intent, MEMPTR lpMem, LPDWORD lpcbSize, BOOL AllowBinary)
SINT | SendCRDLMN (MEMPTR lpMem, CSIG Intent, LPSFLOAT whitePoint, LPSFLOAT mediaWP, CSIG pcs)
SINT | SendCRDPQR (MEMPTR lpMem, CSIG Intent, LPSFLOAT whitePoint)
SINT | SendCRDABC (MEMPTR lpMem, MEMPTR PublicArrayName, CSIG pcs, SINT nInputCh, MEMPTR Buff, LPSFLOAT e, CSIG LutTag, BOOL bAllowBinary)
SINT | SendCRDBWPoint (MEMPTR lpMem, LPSFLOAT whitePoint)
SINT | SendCRDOutputTable (MEMPTR lpMem, MEMPTR PublicArrayName, SINT nOutputCh, CSIG LutTag, BOOL bHost, BOOL bAllowBinary)

## Function Documentation

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

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

    01050 {
    01051     SINT Index;
    01052     SINT Ret, Size;
    01053     CSIG icSigPs2CRDx, icSigBToAx;
    01054
    01055     if (!cp)
    01056         return FALSE;
    01057
    01058     if ((lpMem == NULL) || (*lpcbSize == 0))
    01059     {
    01060         lpMem = NULL;
    01061         *lpcbSize = 0;
    01062     }
    01063     Ret = 0;
    01064     Size = (SINT) * lpcbSize;
    01065
    01066     switch (Intent)
    01067     {
    01068         case icPerceptual:
    01069             icSigPs2CRDx = icSigPs2CRD0Tag;
    01070             icSigBToAx = icSigBToA0Tag;
    01071             break;
    01072
    01073         case icRelativeColorimetric:
    01074             icSigPs2CRDx = icSigPs2CRD1Tag;
    01075             icSigBToAx = icSigBToA1Tag;
    01076             break;
    01077
    01078         case icSaturation:
    01079             icSigPs2CRDx = icSigPs2CRD2Tag;
    01080             icSigBToAx = icSigBToA2Tag;
    01081             break;
    01082
    01083         case icAbsoluteColorimetric:
    01084             icSigPs2CRDx = icSigPs2CRD3Tag;
    01085             icSigBToAx = icSigBToA1Tag;
    01086             break;
    01087
    01088         default:
    01089             *lpcbSize = (DWORD) Ret;
    01090             return (Ret > 0);
    01091     }
    01092
    01093     if (
    01094         (DoesCPTagExist (cp, icSigPs2CRDx) &&
    01095          GetCPTagIndex (cp, icSigPs2CRDx, (LPSINT) & Index) &&
    01096          GetCPElementDataSize (cp, Index, (LPSINT) & Ret) &&
    01097          ((Size == 0) ||
    01098           GetCPElementData (cp, Index, lpMem, Size)) &&
    01099          (Ret = Convert2Ascii (cp, Index, lpMem, Size, Ret, AllowBinary))
    01100         ) ||
    01101         (DoesCPTagExist (cp, icSigBToAx) &&
    01102          GetCPTagIndex (cp, icSigBToAx, (LPSINT) & Index) &&
    01103          (Ret = CreateLutCRD (cp, Index, lpMem, Intent, AllowBinary))
    01104         ) ||
    01105         // SRGB98 Support Windows 98 sRGB icc profile.
    01106         // Create CRD from TRC and Colorant Tags.
    01107         (DoesTRCAndColorantTagExist (cp) &&
    01108          (Ret = CreateMatrixCRD (cp, lpMem, Intent, AllowBinary))
    01109         ) ||
    01110         (DoesCPTagExist (cp, icSigGrayTRCTag) &&
    01111          GetCPTagIndex (cp, icSigGrayTRCTag, (LPSINT) & Index) &&
    01112          (Ret = CreateMonoCRD (cp, Index, lpMem, Intent))
    01113         )
    01114        )
    01115     {
    01116     }
    01117
    01118     *lpcbSize = (DWORD) Ret;
    01119     return (Ret > 0);
    01120 }

SINT SendCRDABC | ( | MEMPTR | lpMem,
|  | MEMPTR | PublicArrayName,
|  | CSIG | pcs,
|  | SINT | nInputCh,
|  | MEMPTR | Buff,
|  | LPSFLOAT | e,
|  | CSIG | LutTag,
|  | BOOL | bAllowBinary
| ) |

Definition at line 1756 of file aug98/dll32/profcrd.c.

    01758 {
    01759     MEMPTR  lpOldMem;
    01760     SINT    i, j;
    01761     double TempMatrixABC[9];
    01762     MEMPTR lpTable;
    01763     MEMPTR lpLineStart;
    01764     lpOldMem = lpMem;
    01765
    01766  //********** /RangeABC
    01767     lpMem += WriteNewLineObject (lpMem, RangeABCTag);
    01768     lpMem += WriteObject (lpMem, RangeABC);
    01769  //********** /MatrixABC
    01770     lpMem += WriteNewLineObject (lpMem, MatrixABCTag);
    01771     if (pcs == icSigXYZData)
    01772     {
    01773         lpMem += WriteObject (lpMem, BeginArray);
    01774         if (e)
    01775         {
    01776             for (i = 0; i < 3; i++)
    01777             {
    01778                 for (j = 0; j < 3; j++)
    01779                 {
    01780                     lpMem += WriteFloat (lpMem, e[i + j * 3]);
    01781                 }
    01782             }
    01783         }
    01784         else
    01785         {
    01786             if (LutTag == icSigLut8Type)
    01787             {
    01788                 lpTable = (MEMPTR) & ((lpcpLut8Type) Buff)->lut.e00;
    01789             } else
    01790             {
    01791                 lpTable = (MEMPTR) & ((lpcpLut16Type) Buff)->lut.e00;
    01792             }
    01793             for (i = 0; i < 9; i++)
    01794             {
    01795                 TempMatrixABC[i] = ((double) si16f16toSFLOAT (lpTable)) / CIEXYZRange;
    01796                 lpTable += sizeof (icS15Fixed16Number);
    01797             }
    01798             for (i = 0; i < 3; i++)
    01799             {
    01800                 for (j = 0; j < 3; j++)
    01801                 {
    01802                     lpMem += WriteFloat (lpMem, TempMatrixABC[i + j * 3]);
    01803                 }
    01804             }
    01805         }
    01806         lpMem += WriteObject (lpMem, EndArray);
    01807     } else
    01808     {
    01809         lpMem += WriteObject (lpMem, MatrixABCLabCRD);
    01810     }
    01811  //********** /EncodeABC
    01812     if (nInputCh == 0)
    01813         return (SINT)(lpMem - lpOldMem);
    01814
    01815     lpLineStart = lpMem;
    01816     lpMem += WriteNewLineObject (lpMem, EncodeABCTag);
    01817     lpMem += WriteObject (lpMem, BeginArray);
    01818     for (i = 0; i < nInputCh; i++)
    01819     {
    01820         lpLineStart = lpMem;
    01821         lpMem += WriteNewLineObject (lpMem, BeginFunction);
    01822         if (pcs == icSigLabData)
    01823         {
    01824             lpMem += WriteObject (lpMem,
    01825                                   (0 == i) ? EncodeABCLab1 : EncodeABCLab2);
    01826         }
    01827         lpMem += WriteObject (lpMem, StartClip);
    01828         if (e)
    01829             lpMem += WriteObject (lpMem, PreViewInArray);
    01830         else
    01831             lpMem += WriteObject (lpMem, InputArray);
    01832         lpMem += WriteObjectN (lpMem, (MEMPTR) PublicArrayName, lstrlen (PublicArrayName));
    01833         lpMem += WriteInt (lpMem, i);
    01834
    01835         if (!bAllowBinary)              // Output ASCII CRD
    01836         {
    01837             lpMem += WriteNewLineObject (lpMem, IndexArray);
    01838         } else
    01839         {                               // Output BINARY CRD
    01840             if (LutTag == icSigLut8Type)
    01841             {
    01842                 lpMem += WriteObject (lpMem, IndexArray);
    01843             } else
    01844             {
    01845                 lpMem += WriteObject (lpMem, IndexArray16b);
    01846             }
    01847         }
    01848         lpMem += WriteObject (lpMem, (LutTag == icSigLut8Type) ?
    01849                               Scale8 : Scale16);
    01850         lpMem += WriteObject (lpMem, EndClip);
    01851         lpMem += WriteObject (lpMem, EndFunction);
    01852     }
    01853     lpMem += WriteObject (lpMem, EndArray);
    01854     return (SINT)(lpMem - lpOldMem);
    01855 }

SINT SendCRDBWPoint | ( | MEMPTR | lpMem,
|  | LPSFLOAT | whitePoint
| ) |

Definition at line 1858 of file aug98/dll32/profcrd.c.

    01859 {
    01860     MEMPTR  lpOldMem;
    01861     SINT    i;
    01862
    01863     lpOldMem = lpMem;
    01864
    01865 //********** /BlackPoint
    01866     lpMem += WriteNewLineObject (lpMem, BlackPointTag);
    01867     lpMem += WriteObject (lpMem, BlackPoint);
    01868
    01869 //********** /WhitePoint
    01870     lpMem += WriteNewLineObject (lpMem, WhitePointTag);
    01871     lpMem += WriteObject (lpMem, BeginArray);
    01872     for (i = 0; i < 3; i++)
    01873     {
    01874         lpMem += WriteFloat (lpMem, (double)(whitePoint[i]));
    01875     }
    01876     lpMem += WriteObject (lpMem, EndArray);
    01877     return (SINT)(lpMem - lpOldMem);
    01878 }

SINT SendCRDLMN | ( | MEMPTR | lpMem,
|  | CSIG | Intent,
|  | LPSFLOAT | whitePoint,
|  | LPSFLOAT | mediaWP,
|  | CSIG | pcs
| ) |

Definition at line 1650 of file aug98/dll32/profcrd.c.

    01651 {
    01652     MEMPTR  lpOldMem;
    01653     SINT    i, j;
    01654
    01655     lpOldMem = lpMem;
    01656
    01657 //********** /MatrixLMN
    01658     if (icAbsoluteColorimetric == Intent)
    01659     {
    01660         lpMem += WriteNewLineObject (lpMem, MatrixLMNTag);
    01661
    01662         lpMem += WriteObject (lpMem, BeginArray);
    01663         for (i = 0; i < 3; i++)
    01664         {
    01665             for (j = 0; j < 3; j++)
    01666                 lpMem += WriteFloat (lpMem,
    01667                     (double) (i == j) ? whitePoint[i] / mediaWP[i] : 0.0);
    01668         }
    01669         lpMem += WriteObject (lpMem, EndArray);
    01670     }
    01671  //********** /RangeLMN
    01672     lpMem += WriteNewLineObject (lpMem, RangeLMNTag);
    01673     if (pcs == icSigXYZData)
    01674     {
    01675         lpMem += WriteObject (lpMem, BeginArray);
    01676         for (i = 0; i < 3; i++)
    01677         {
    01678             lpMem += WriteFloat (lpMem, (double) 0);
    01679             lpMem += WriteFloat (lpMem, (double) whitePoint[i]);
    01680         }
    01681         lpMem += WriteObject (lpMem, EndArray);
    01682     } else
    01683     {
    01684         lpMem += WriteObject (lpMem, RangeLMNLab);
    01685     }
    01686
    01687  //********** /EncodeLMN
    01688     lpMem += WriteNewLineObject (lpMem, EncodeLMNTag);
    01689     lpMem += WriteObject (lpMem, BeginArray);
    01690     for (i = 0; i < 3; i++)
    01691     {
    01692         lpMem += WriteObject (lpMem, BeginFunction);
    01693         if (pcs != icSigXYZData)
    01694         {
    01695             lpMem += WriteFloat (lpMem, (double)whitePoint[i]);
    01696             lpMem += WriteObject (lpMem, DivOp);
    01697             lpMem += WriteObject (lpMem, EncodeLMNLab);
    01698         }
    01699         lpMem += WriteObject (lpMem, EndFunction);
    01700     }
    01701     lpMem += WriteObject (lpMem, EndArray);
    01702
    01703     return (SINT)(lpMem - lpOldMem);
    01704 }

SINT SendCRDOutputTable | ( | MEMPTR | lpMem,
|  | MEMPTR | PublicArrayName,
|  | SINT | nOutputCh,
|  | CSIG | LutTag,
|  | BOOL | bHost,
|  | BOOL | bAllowBinary
| ) |

Definition at line 1880 of file aug98/dll32/profcrd.c.

    01882 {
    01883     MEMPTR  lpOldMem;
    01884     SINT    i;
    01885
    01886     lpOldMem = lpMem;
    01887
    01888     for (i = 0; i < nOutputCh; i++)
    01889     {
    01890         lpMem += WriteNewLineObject (lpMem, BeginFunction);
    01891         lpMem += WriteObject (lpMem, Clip01);
    01892         if (bHost)
    01893             lpMem += WriteObject (lpMem, PreViewOutArray);
    01894         else
    01895             lpMem += WriteObject (lpMem, OutputArray);
    01896         lpMem += WriteObjectN (lpMem, (MEMPTR) PublicArrayName, lstrlen (PublicArrayName));
    01897         lpMem += WriteInt (lpMem, i);
    01898
    01899         if (!bAllowBinary)               // Output ASCII CRD
    01900         {
    01901             lpMem += WriteObject (lpMem, NewLine);
    01902             if (LutTag == icSigLut8Type)
    01903             {
    01904                 lpMem += WriteObject (lpMem, TFunction8);
    01905             } else
    01906             {
    01907                 lpMem += WriteObject (lpMem, IndexArray);
    01908                 lpMem += WriteObject (lpMem, Scale16);
    01909             }
    01910         } else
    01911         {                               // Output BINARY CRD
    01912             if (LutTag == icSigLut8Type)
    01913             {
    01914                 lpMem += WriteObject (lpMem, TFunction8);
    01915             } else
    01916             {
    01917                 lpMem += WriteObject (lpMem, IndexArray16b);
    01918                 lpMem += WriteObject (lpMem, Scale16);
    01919             }
    01920         }
    01921
    01922         lpMem += WriteObject (lpMem, EndFunction);
    01923     }
    01924     return (SINT)(lpMem - lpOldMem);
    01925 }

SINT SendCRDPQR | ( | MEMPTR | lpMem,
|  | CSIG | Intent,
|  | LPSFLOAT | whitePoint
| ) |

Definition at line 1708 of file aug98/dll32/profcrd.c.

    01709 {
    01710     MEMPTR  lpOldMem;
    01711     SINT    i;
    01712
    01713     lpOldMem = lpMem;
    01714
    01715     if (icAbsoluteColorimetric != Intent)
    01716     {
    01717      //********** /RangePQR
    01718         lpMem += WriteNewLineObject (lpMem, RangePQRTag);
    01719         lpMem += WriteObject (lpMem, RangePQR);
    01720
    01721      //********** /MatrixPQR
    01722         lpMem += WriteNewLineObject (lpMem, MatrixPQRTag);
    01723         lpMem += WriteObject (lpMem, MatrixPQR);
    01724     }
    01725     else
    01726     {
    01727     //********** /RangePQR
    01728         lpMem += WriteNewLineObject (lpMem, RangePQRTag);
    01729         lpMem += WriteObject (lpMem, BeginArray);
    01730         for (i = 0; i < 3; i++)
    01731         {
    01732             lpMem += WriteFloat (lpMem, (double) 0);
    01733             lpMem += WriteFloat (lpMem, (double)(whitePoint[i]));
    01734         }
    01735         lpMem += WriteObject (lpMem, EndArray);
    01736     //********** /MatrixPQR
    01737         lpMem += WriteNewLineObject (lpMem, MatrixPQRTag);
    01738         lpMem += WriteObject (lpMem, Identity);
    01739     }
    01740 //********** /TransformPQR
    01741     lpMem += WriteNewLineObject (lpMem, TransformPQRTag);
    01742     lpMem += WriteObject (lpMem, BeginArray);
    01743     for (i = 0; i < 3; i++)
    01744     {
    01745         lpMem += WriteObject (lpMem, BeginFunction);
    01746         lpMem += WriteObject (lpMem,
    01747             (icAbsoluteColorimetric != Intent) ? TransformPQR[i] : NullOp);
    01748         lpMem += WriteObject (lpMem, EndFunction);
    01749     }
    01750     lpMem += WriteObject (lpMem, EndArray);
    01751
    01752     return (SINT)(lpMem - lpOldMem);
    01753 }