test: aug98/dll32/getcsa.h File Reference

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

# getcsa.h File Reference

Go to the source code of this file.

## Functions

BOOL EXTERN | GetPS2ColorSpaceArray (CHANDLE cp, DWORD InputIntent, DWORD InpDrvClrSp, MEMPTR lpBuffer, LPDWORD lpcbSize, BOOL AllowBinary)
BOOL | GetPS2CSA_DEFG_Intent (CHANDLE cp, MEMPTR lpBuffer, LPDWORD lpcbSize, DWORD InpDrvClrSp, CSIG Intent, 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)
SINT | GetPublicArrayName (CHANDLE cp, CSIG IntentSig, MEMPTR PublicArrayName)
SINT | CreateInputArray (MEMPTR lpMem, SINT nInputCh, SINT nInputTable, MEMPTR Intent, CSIG Tag, MEMPTR Buff, BOOL AllowBinary, MEMPTR)
SINT | CreateOutputArray (MEMPTR lpMem, SINT nOutputCh, SINT nOutputTable, SINT Offset, MEMPTR Intent, CSIG Tag, MEMPTR Buff, BOOL AllowBinary, MEMPTR)
VOID | GetCLUTinfo (CSIG LutTag, MEMPTR lpLut, LPSINT nInputCh, LPSINT nOutputCh, LPSINT nGrids, LPSINT nInputTable, LPSINT nOutputTable, LPSINT size)
SINT | EnableGlobalDict (MEMPTR lpMem)
SINT | BeginGlobalDict (MEMPTR lpMem)
SINT | EndGlobalDict (MEMPTR lpMem)

## 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 CreateInputArray | ( | MEMPTR | lpMem,
|  | SINT | nInputCh,
|  | SINT | nInputTable,
|  | MEMPTR | Intent,
|  | CSIG | Tag,
|  | MEMPTR | Buff,
|  | BOOL | AllowBinary,
|  | MEMPTR |
| ) |

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

    01566 {
    01567     SINT i, j;
    01568     MEMPTR lpOldMem;
    01569     MEMPTR lpTable;
    01570     MEMPTR lpLineStart;
    01571     lpOldMem = lpMem;
    01572
    01573     if (lpHostClut)
    01574     {
    01575         nInputCh = (SINT)(((LPHOSTCLUT)lpHostClut)->inputChan);
    01576         nInputTable = (SINT)(((LPHOSTCLUT)lpHostClut)->inputEnt);
    01577         Tag = (((LPHOSTCLUT)lpHostClut)->lutBits == 8)?
    01578                icSigLut8Type : icSigLut16Type;
    01579     }
    01580
    01581     for (i = 0; i < nInputCh; i++)
    01582     {
    01583         lpLineStart = lpMem;
    01584         lpMem += WriteNewLineObject (lpMem, Slash);
    01585         if (lpHostClut)
    01586             lpMem += WriteObject (lpMem, PreViewInArray);
    01587         else
    01588             lpMem += WriteObject (lpMem, InputArray);
    01589         lpMem += WriteObjectN (lpMem, Intent, lstrlen (Intent));
    01590         lpMem += WriteInt (lpMem, i);
    01591
    01592         if (lpHostClut)
    01593         {
    01594             lpTable = ((LPHOSTCLUT)lpHostClut)->inputArray[i];
    01595         }
    01596         else
    01597         {
    01598             if (Tag == icSigLut8Type)
    01599                 lpTable = (MEMPTR) (((lpcpLut8Type) Buff)->lut.data) + nInputTable * i;
    01600             else
    01601                 lpTable = (MEMPTR) (((lpcpLut16Type) Buff)->lut.data) + 2 * nInputTable * i;
    01602         }
    01603         if (!bAllowBinary)               // Output ASCII CRD
    01604         {
    01605             if (Tag == icSigLut8Type)
    01606             {
    01607                 lpMem += WriteObject (lpMem, BeginString);
    01608                 lpMem += WriteHexBuffer (lpMem, lpTable,lpLineStart, nInputTable);
    01609                 lpMem += WriteObject (lpMem, EndString);
    01610             } else
    01611             {
    01612                 lpMem += WriteObject (lpMem, BeginArray);
    01613                 for (j = 0; j < nInputTable; j++)
    01614                 {
    01615                     if(lpHostClut)
    01616                         lpMem += WriteInt (lpMem, *((PUSHORT)lpTable));
    01617                     else
    01618                         lpMem += WriteInt (lpMem, ui16toSINT (lpTable));
    01619                     lpTable += sizeof (icUInt16Number);
    01620                     if (((SINT) (lpMem - lpLineStart)) > MAX_LINELENG)
    01621                     {
    01622                         lpLineStart = lpMem;
    01623                         lpMem += WriteObject (lpMem, NewLine);
    01624                     }
    01625                 }
    01626                 lpMem += WriteObject (lpMem, EndArray);
    01627             }
    01628         } else
    01629         {                               // Output BINARY CRD
    01630             if (Tag == icSigLut8Type)
    01631             {
    01632                 lpMem += WriteStringToken (lpMem, 143, 256);
    01633                 lpMem += WriteByteString (lpMem, lpTable, 256L);
    01634             } else
    01635             {
    01636                 lpMem += WriteHNAToken (lpMem, 149, nInputTable);
    01637                 if (lpHostClut)
    01638                     lpMem += WriteIntStringU2S_L (lpMem, lpTable, nInputTable);
    01639                 else
    01640                     lpMem += WriteIntStringU2S (lpMem, lpTable, nInputTable);
    01641             }
    01642         }
    01643         lpMem += WriteObject (lpMem, DefOp);
    01644     }
    01645
    01646     return ((SINT) (lpMem - lpOldMem));
    01647 }

SINT CreateOutputArray | ( | MEMPTR | lpMem,
|  | SINT | nOutputCh,
|  | SINT | nOutputTable,
|  | SINT | Offset,
|  | MEMPTR | Intent,
|  | CSIG | Tag,
|  | MEMPTR | Buff,
|  | BOOL | AllowBinary,
|  | MEMPTR |
| ) |

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

    01455 {
    01456     SINT i, j;
    01457     MEMPTR lpOldMem;
    01458     MEMPTR lpTable;
    01459     MEMPTR lpLineStart;
    01460     lpOldMem = lpMem;
    01461
    01462     if (lpHostClut)
    01463     {
    01464         nOutputCh = (SINT)(((LPHOSTCLUT)lpHostClut)->outputChan);
    01465         nOutputTable = (SINT)(((LPHOSTCLUT)lpHostClut)->outputEnt);
    01466         Tag = (((LPHOSTCLUT)lpHostClut)->lutBits == 8)?
    01467               icSigLut8Type : icSigLut16Type;
    01468     }
    01469
    01470     for (i = 0; i < nOutputCh; i++)
    01471     {
    01472         lpLineStart = lpMem;
    01473         lpMem += WriteNewLineObject (lpMem, Slash);
    01474         if (lpHostClut)
    01475             lpMem += WriteObject (lpMem, PreViewOutArray);
    01476         else
    01477             lpMem += WriteObject (lpMem, OutputArray);
    01478         lpMem += WriteObjectN (lpMem, Intent, lstrlen (Intent));
    01479         lpMem += WriteInt (lpMem, i);
    01480
    01481         if (lpHostClut)
    01482             lpTable = ((LPHOSTCLUT)lpHostClut)->outputArray[i];
    01483         else
    01484         {
    01485             if (Tag == icSigLut8Type)
    01486                 lpTable = (MEMPTR) (((lpcpLut8Type) Buff)->lut.data) +
    01487                     Offset +
    01488                     nOutputTable * i;
    01489             else
    01490                 lpTable = (MEMPTR) (((lpcpLut16Type) Buff)->lut.data) +
    01491                     2 * Offset +
    01492                     2 * nOutputTable * i;
    01493         }
    01494
    01495         if (!AllowBinary)               // Output ASCII CRD
    01496         {
    01497             if (Tag == icSigLut8Type)
    01498             {
    01499                 lpMem += WriteObject (lpMem, BeginString);
    01500                 lpMem += WriteHexBuffer (lpMem, lpTable, lpLineStart, nOutputTable);
    01501                 lpMem += WriteObject (lpMem, EndString);
    01502             } else
    01503             {
    01504                 lpMem += WriteObject (lpMem, BeginArray);
    01505                 for (j = 0; j < nOutputTable; j++)
    01506                 {
    01507                     if (lpHostClut)
    01508                         lpMem += WriteInt (lpMem, *((PUSHORT)lpTable));
    01509                     else
    01510                         lpMem += WriteInt (lpMem, ui16toSINT (lpTable));
    01511                     lpTable += sizeof (icUInt16Number);
    01512                     if (((SINT) (lpMem - lpLineStart)) > MAX_LINELENG)
    01513                     {
    01514                         lpLineStart = lpMem;
    01515                         lpMem += WriteObject (lpMem, NewLine);
    01516                     }
    01517                 }
    01518                 lpMem += WriteObject (lpMem, EndArray);
    01519             }
    01520         } else
    01521         {                               // Output BINARY CRD
    01522             if (Tag == icSigLut8Type)
    01523             {
    01524                 lpMem += WriteStringToken (lpMem, 143, 256);
    01525                 lpMem += WriteByteString (lpMem, lpTable, 256L);
    01526             } else
    01527             {
    01528                 lpMem += WriteHNAToken (lpMem, 149, nOutputTable);
    01529                 if (lpHostClut)
    01530                     lpMem += WriteIntStringU2S_L (lpMem, lpTable, nOutputTable);
    01531                 else
    01532                     lpMem += WriteIntStringU2S (lpMem, lpTable, nOutputTable);
    01533             }
    01534         }
    01535         lpMem += WriteObject (lpMem, DefOp);
    01536     }
    01537
    01538     return ((SINT) (lpMem - lpOldMem));
    01539 }

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 }

VOID GetCLUTinfo | ( | CSIG | LutTag,
|  | MEMPTR | lpLut,
|  | LPSINT | nInputCh,
|  | LPSINT | nOutputCh,
|  | LPSINT | nGrids,
|  | LPSINT | nInputTable,
|  | LPSINT | nOutputTable,
|  | LPSINT | size
| ) |

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

    00101 {
    00102     if (LutTag == icSigLut8Type)
    00103     {
    00104         *nInputCh = ui8toSINT (((lpcpLut8Type) lpLut)->lut.inputChan);
    00105         *nOutputCh = ui8toSINT (((lpcpLut8Type) lpLut)->lut.outputChan);
    00106         *nGrids = ui8toSINT (((lpcpLut8Type) lpLut)->lut.clutPoints);
    00107         *nInputTable = 256L;
    00108         *nOutputTable = 256L;
    00109         *size = 1;  // one byte for each input\output table entry
    00110     } else
    00111     {
    00112         *nInputCh = ui8toSINT (((lpcpLut16Type) lpLut)->lut.inputChan);
    00113         *nOutputCh = ui8toSINT (((lpcpLut16Type) lpLut)->lut.outputChan);
    00114         *nGrids = ui8toSINT (((lpcpLut16Type) lpLut)->lut.clutPoints);
    00115         *nInputTable = ui16toSINT (((lpcpLut16Type) lpLut)->lut.inputEnt);
    00116         *nOutputTable = ui16toSINT (((lpcpLut16Type) lpLut)->lut.outputEnt);
    00117         *size = 2;  // two bytes for each input\output table entry
    00118     }
    00119 }

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_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 }

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 }