test: dec97/dll32/ps2color.h File Reference

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

# ps2color.h File Reference

Go to the source code of this file.

## Functions

BOOL | GetPS2ColorRenderingDictionary (CHANDLE cp, DWORD Intent, MEMPTR lpMem, LPDWORD lpcbSize, BOOL AllowBinary)
BOOL | GetPS2ColorSpaceArray (CHANDLE cp, DWORD InputIntent, DWORD InpDrvClrSp, MEMPTR lpBuffer, LPDWORD lpcbSize, BOOL AllowBinary)
BOOL EXTERN | GetPS2ColorRenderingIntent (CHANDLE cp, DWORD Intent, MEMPTR lpMem, LPDWORD lpcbSize)

## Function Documentation

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

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

Definition at line 938 of file aug98/dll32/csprof.c.

    00940 {
    00941     SINT       Index;
    00942     SINT       Size;
    00943
    00944     if (!cp)
    00945         return FALSE;
    00946
    00947     Size = (SINT) *lpcbSize;
    00948     if( ( lpMem == NULL ) || ( Size == 0 ) )
    00949     {
    00950         lpMem = NULL;
    00951         Size = 0;
    00952         *lpcbSize = 0;
    00953     }
    00954
    00955     switch(Intent)
    00956     {
    00957         case icPerceptual:
    00958         if( DoesCPTagExist(cp, icSigPs2Intent0Tag) &&
    00959             GetCPTagIndex(cp, icSigPs2Intent0Tag, (LPSINT) &Index) &&
    00960             GetCPElementDataSize(cp, Index, (LPSINT) &Size) &&
    00961             ( ( lpMem == NULL ) ||
    00962                 GetCPElementData(cp, Index, lpMem, Size) ) )
    00963         {
    00964         }
    00965         break;
    00966
    00967         case icRelativeColorimetric:
    00968         if( DoesCPTagExist(cp, icSigPs2Intent1Tag) &&
    00969             GetCPTagIndex(cp, icSigPs2Intent1Tag, (LPSINT) &Index) &&
    00970             GetCPElementDataSize(cp, Index, (LPSINT) &Size) &&
    00971             ( ( lpMem == NULL ) ||
    00972                 GetCPElementData(cp, Index, lpMem, Size) ) )
    00973         {
    00974         }
    00975         break;
    00976
    00977         case icSaturation:
    00978         if( DoesCPTagExist(cp, icSigPs2Intent2Tag) &&
    00979             GetCPTagIndex(cp, icSigPs2Intent2Tag, (LPSINT) &Index) &&
    00980             GetCPElementDataSize(cp, Index, (LPSINT) &Size) &&
    00981             ( ( lpMem == NULL ) ||
    00982                 GetCPElementData(cp, Index, lpMem, Size ) )
    00983           )
    00984         {
    00985         }
    00986         break;
    00987         case icAbsoluteColorimetric:
    00988         if( DoesCPTagExist(cp, icSigPs2Intent3Tag) &&
    00989             GetCPTagIndex(cp, icSigPs2Intent3Tag, (LPSINT) &Index) &&
    00990             GetCPElementDataSize(cp, Index, (LPSINT) &Size) &&
    00991             ( ( lpMem == NULL ) ||
    00992                 GetCPElementData(cp, Index, lpMem, Size) ) )
    00993         {
    00994         }
    00995         break;
    00996         default:
    00997             Size = 0 ;
    00998         break;
    00999     }
    01000
    01001     if (Size != 0)
    01002     {
    01003         if (lpMem)
    01004         {
    01005             lpMem[Size] = '\0';
    01006         }
    01007         Size ++;
    01008         *lpcbSize = (DWORD) Size;
    01009         return (TRUE);
    01010     }
    01011     else
    01012     {
    01013         return(FALSE);
    01014     }
    01015 }

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