test: csprof.h Source File

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

# csprof.h

Go to the documentation of this file.

    00001 #ifndef SUPPORT_H
    00002 #define SUPPORT_H
    00003 #include "windows.h"
    00004 #include "icc.h"
    00005 #include "icc_i386.h"
    00006
    00007 #ifdef  __cplusplus
    00008 extern "C"
    00009 {
    00010 #endif
    00011
    00012 #define  TYPE_CIEBASEDDEF   1
    00013 #define  TYPE_CIEBASEDDEFG  2
    00014 #define  TempBfSize         128
    00015 #define  CIEXYZRange        1.99997
    00016 #define  MAX_LINELENG       240
    00017
    00018 /*------------------------------------------------------------------------*/
    00019 //               Foreword to the functions format.
    00020 //  All functions return TRUE if successful
    00021 //  and FALSE if not. Exact reason for the FALSE return can be determined
    00022 //  by calling GetLastCPError() function.
    00023 //  This allows us to use the "C" standard left-to-right evaluation order
    00024 //  for the logical expression and the requirement that logical AND
    00025 //  operation is performed until FALSE condition is met. That way we can use
    00026 //  expression like:
    00027 //        if( LoadCP() && ValidateCP() &&
    00028 //            DoesCPTagExist() && GetCPTagSig() &&
    00029 //            ValidateCPElement())
    00030 //        {   // Profile element is OK
    00031 //            Process CP Element........
    00032 //        }else
    00033 //        {     //Something is wrong
    00034 //            Err=GetLastCPError();
    00035 //        }
    00036
    00037 // Implementation-specific representation of the handle to the ColorProfile
    00038
    00039 typedef     MEMPTR      CHANDLE,        // For the convinience and speed
    00040             __far       *LPCHANDLE;     // let's use the pointer to the
    00041                                         // memory block of the profile
    00042                                         // as the profile handle
    00043
    00044 BOOL    EXTERN LoadCP(LPCSTR filename, HGLOBAL FAR *phMem, LPCHANDLE lphCP);
    00045 BOOL    EXTERN LoadCP32(LPCSTR filename, HGLOBAL *phMem, LPCHANDLE lpCP);
    00046
    00047 BOOL    EXTERN FreeCP(HGLOBAL hMem);
    00048
    00049 /* Checks if the profile has all required fields  for
    00050     this specific type of the color profile             */
    00051 BOOL    EXTERN ValidateCP(CHANDLE hCP);
    00052
    00053 BOOL    EXTERN DoesCPTagExist(CHANDLE hCP, CSIG CPTag);
    00054 BOOL    EXTERN GetCPTagIndex(CHANDLE hCP, CSIG CPTag, LPSINT lpIndex);
    00055
    00056 BOOL    EXTERN GetCPElementCount(CHANDLE hCP, LPSINT lpIndex);
    00057 BOOL    EXTERN ValidateCPElement(CHANDLE hCP, SINT Index);
    00058 BOOL    EXTERN GetCPTagSig(CHANDLE hCP, SINT Index, LPCSIG lpCPTag);
    00059 BOOL    EXTERN GetCPElementType(CHANDLE hCP, SINT Index, LPCSIG lpCSig);
    00060
    00061 BOOL    EXTERN GetCPElementSize(CHANDLE hCP, SINT Index, LPSINT lpSize);
    00062 BOOL    EXTERN GetCPElementDataSize(CHANDLE hCP, SINT Index, LPSINT lpSize);
    00063 BOOL    EXTERN GetCPElement(CHANDLE hCP, SINT Index, MEMPTR lpData, SINT Size);
    00064 BOOL    EXTERN GetCPElementData(CHANDLE hCP, SINT Index, MEMPTR lpData, SINT Size);
    00065 BOOL    EXTERN GetCPElementDataType(CHANDLE CP, SINT Index, long far *lpDataType);
    00066
    00067 // Functions that get all information from the Color Profile Header
    00068 BOOL    EXTERN GetCPSize(CHANDLE hCP, LPSINT lpSize);
    00069 BOOL    EXTERN GetCPCMMType(CHANDLE hCP, LPCSIG lpType);
    00070 BOOL    EXTERN GetCPVersion(CHANDLE hCP, LPSINT lpVers);
    00071 BOOL    EXTERN GetCPClass(CHANDLE hCP, LPCSIG lpClass);
    00072 BOOL    EXTERN GetCPDevSpace(CHANDLE hCP, LPCSIG lpDevSpace);
    00073 BOOL    EXTERN GetCPConnSpace(CHANDLE hCP, LPCSIG lpConnSpace);
    00074 BOOL    EXTERN GetCPTarget(CHANDLE hCP, LPCSIG lpTarget);
    00075 BOOL    EXTERN GetCPManufacturer(CHANDLE hCP, LPCSIG lpManuf);
    00076 BOOL    EXTERN GetCPModel(CHANDLE hCP, LPCSIG lpModel);
    00077 BOOL    EXTERN GetCPFlags(CHANDLE hCP, LPSINT lpFlags);
    00078 BOOL    EXTERN GetCPAttributes(CHANDLE hCP, LPATTRIB lpAttributes);
    00079 BOOL    EXTERN GetCPWhitePoint(CHANDLE CP,  LPSFLOAT lpWP);
    00080 BOOL    EXTERN GetCPMediaWhitePoint(CHANDLE CP,  LPSFLOAT lpMediaWP);
    00081 BOOL    EXTERN GetCPRenderIntent(CHANDLE CP, LPSINT lpIntent);
    00082 BOOL    EXTERN GetPS2ColorRenderingIntent(CHANDLE cp, DWORD Intent,
    00083                MEMPTR lpMem, LPDWORD Size);
    00084
    00085 SINT    EXTERN GetCPLastCPError();
    00086 BOOL    EXTERN SetCPLastCPError(SINT cpError);
    00087 BOOL    EXTERN SetCPLastError(SINT LastError);
    00088 #ifndef ICMDLL
    00089 BOOL    EXTERN ValidColorSpace(LPPDEVICE lppd, LPICMINFO lpICMI, LPCSIG lpDevCS);
    00090 #endif
    00091
    00092 BOOL    EXTERN GetCPWhitePoint(CHANDLE CP,  LPSFLOAT lpWP);
    00093 SINT    WriteInt(MEMPTR lpMem, SINT Number);
    00094 SINT    WriteHex(MEMPTR lpMem, SINT Number);
    00095 SINT    WriteNewLineObject(MEMPTR lpMem, MEMPTR Obj);
    00096 SINT    WriteObject(MEMPTR lpMem, MEMPTR Obj);
    00097 SINT    WriteObjectN(MEMPTR lpMem, MEMPTR Obj, SINT n);
    00098 SINT    WriteHexBuffer(MEMPTR lpMem, MEMPTR lpBuff, MEMPTR lpLineStart, DWORD dwBytes);
    00099 SINT    WriteFloat(MEMPTR lpMem, double dFloat);
    00100 SINT    WriteStringToken(MEMPTR lpMem, BYTE Token, SINT sNum);
    00101 SINT    WriteByteString(MEMPTR lpMem, MEMPTR lpBuff, SINT sBytes);
    00102 SINT    WriteInt2ByteString(MEMPTR lpMem, MEMPTR lpBuff, SINT sBytes);
    00103 SINT    WriteIntStringU2S(MEMPTR lpMem, MEMPTR lpBuff, SINT sNum);
    00104 SINT    WriteIntStringU2S_L(MEMPTR lpMem, MEMPTR lpBuff, SINT sNum);
    00105 SINT    WriteHNAToken(MEMPTR lpMem, BYTE Token, SINT sNum);
    00106 SINT    WriteAscii85(MEMPTR lpDest, unsigned long inword, SINT nBytes);
    00107 SINT    ConvertBinaryData2Ascii(MEMPTR lpMem, SINT DataSize, SINT BufSize);
    00108 SINT    Convert2Ascii(CHANDLE CP, SINT Index,
    00109                 MEMPTR lpData, SINT BufSize, SINT DataSize, BOOL AllowBinary);
    00110 #ifdef ICMDLL
    00111 SINT    MemCopy(MEMPTR Dest, MEMPTR Source, SINT Length);
    00112 DWORD   FAR  PASCAL crc32(MEMPTR buff, DWORD  length);
    00113 #endif
    00114 //SRGB98
    00115 BOOL    EXTERN InvertMatrix (double FAR * lpInMatrix, double FAR * lpOutMatrix);
    00116 BOOL    EXTERN MemAlloc(SINT Size, HGLOBAL FAR *hMemory, LPMEMPTR lpMH);
    00117 BOOL    EXTERN MemFree(HGLOBAL hMem);
    00118 DWORD FIXED_2DOT30(float);
    00119 DWORD FIXED_16DOT16(float);
    00120 BOOL   DoesTRCAndColorantTagExist(CHANDLE cp);
    00121 BOOL   GetTRCElementSize(CHANDLE cp, CSIG icSigXTRCTag, LPSINT pIndex, LPSINT pTRCSize);
    00122 #ifdef  __cplusplus
    00123 }
    00124 #endif
    00125
    00126 #endif  //  __SUPPORT_H