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

icc_i386.h

Go to the documentation of this file.
00001 #ifndef ICC_I386_H 00002 #define ICC_I386_H 00003 #include "windows.h" 00004 00005 #ifdef __cplusplus 00006 extern "C" 00007 { 00008 #endif 00009 00010 // ColorProfile errors - can be later added to global Errors 00011 // 00012 typedef enum 00013 { 00014 CP_NULL_POINTER_ERR = 10000, 00015 CP_MEMORY_ALLOC_ERR, 00016 CP_FILE_OPEN_ERR, 00017 CP_FILE_READ_ERR, 00018 CP_FORMAT_ERR, 00019 CP_OUT_OF_RANGE_ERR, 00020 CP_NO_MEMORY_ERR, 00021 CP_NOT_FOUND_ERR, 00022 CP_POSTSCRIPT_ERR 00023 } cpError; 00024 00025 00026 /*------------------------------------------------------------------------*/ 00027 // Application specific data 00028 // 00029 // We use here the same concept that is used in WINSOCK 1.1 specifications. 00030 // All the data that come from the ColorProfile are in "network" format, 00031 // and we deal with that data using "host" format. The "host" byte order can 00032 // be either big- or little-endian, the size of the integers and floats 00033 // may vary too, we only require that all "host" type data must have 00034 // the precision equal or higher of the "network" data. 00035 // The platfornm-specific implementation must provide macros or functions 00036 // to convert from "network" to "host" representation. 00037 // Currently we do not write data into profile, so no conversion 00038 // from "host" to "network" is required. 00039 // 00040 // The basic types that should be defined to work with ColorProfiles are: 00041 // 00042 // BOOL - any size variable that can hold either TRUE or FALSE 00043 // BYTES - exactly 8-bit 00044 // SINT - signed int capable of holding at least 32 bits 00045 // SFLOAT - signed float capable of holding at least 32 bits 00046 // CSIG - entity that can hold at least 32 bits of signature 00047 // in host format 00048 // ATTRIB - entity that can hold at least 64 bits of attributes 00049 // in host format 00050 // MEMPTR - Pointer to the memory block which can refernce more 00051 // than 64K of BYTES 00052 // 00053 // 00054 /*------------------------------------------------------------------------*/ 00055 00056 #ifndef BOOL 00057 typedef int BOOL; // Any variable that can hold 00058 #endif // a boolean TRUE/FALSE 00059 00060 typedef unsigned char BYTES; // Exactly 8 bits 00061 00062 typedef short SHORT; // Exactly 16 bits signed int 00063 00064 typedef unsigned short USHORT; // Exactly 16 bits unsigned signed int 00065 00066 typedef signed long SINT; // The signed integer type that can 00067 // hold more than 32768( > 16bits) 00068 00069 typedef float SFLOAT; // The type that can hold a floating 00070 // or fixed point variable 00071 // at least with 5 digits after point, 00072 // both positive and negtive 00073 00074 typedef unsigned long CSIG; // Type that can hold a Signature - 00075 // 32-bits or more 00076 00077 typedef unsigned long ATTRIB[2]; // Type that can hold attributes, 00078 // it's more than or equal to 64 bits 00079 00080 typedef BYTES __huge *MEMPTR; // Pointer to the memory that can 00081 // access more than 64K BYTES 00082 typedef MEMPTR __huge *PMEMPTR; 00083 00084 typedef SHORT __huge *PSHORT; 00085 typedef USHORT __huge *PUSHORT; 00086 #define EXTERN __loadds __far __pascal 00087 00088 00089 /*------------------------------------------------------------------------*/ 00090 // Pointers to the platform-specific data types. 00091 // 00092 /*------------------------------------------------------------------------*/ 00093 00094 // Those pointers are platform and OS specific. For all 16-bit apps 00095 // we have to explicitly declare those pointers as __far for them 00096 // to be able to point to the data in case DS !=SS. 00097 // Pointers that will be used to sequentially access the 00098 // data (like anypointer[i] and so on) must be declared __huge 00099 // in order to provide correct passing of 64K selector boundary. 00100 // For NT apps and other 32-bit apps all pointers are 32-bits, so no 00101 // __far and __huge declaration is necessary. 00102 00103 typedef BYTES __far *LPBYTES; 00104 typedef SINT __far *LPSINT; 00105 typedef SFLOAT __far *LPSFLOAT; 00106 typedef CSIG __far *LPCSIG; 00107 typedef ATTRIB __far *LPATTRIB; 00108 typedef MEMPTR __far *LPMEMPTR; 00109 00110 typedef icProfile __huge *lpcpProfile; 00111 typedef icHeader __huge *lpcpHeader; 00112 typedef icTagList __huge *lpcpTagList; 00113 typedef icTag __huge *lpcpTag; 00114 typedef icTagBase __huge *lpcpTagBase; 00115 00116 typedef icCurveType __huge *lpcpCurveType; 00117 typedef icLut16Type __huge *lpcpLut16Type; 00118 typedef icLut8Type __huge *lpcpLut8Type; 00119 typedef icXYZType __huge *lpcpXYZType; 00120 00121 00122 //=========================================================================== 00123 // Macros to convert from Color Profile to Platform-specific 00124 // data representation. 00125 // We assume here that all data in ColorProfile are accessed through 00126 // pointer to BYTES. The only valid way to use those macros 00127 // is to call them this way: 00128 // MEMPTR lpMem; 00129 // ... 00130 // lpMem = ..........; 00131 // z = XtoY(lpMem); 00132 00133 #define ui8toSINT(a) ((SINT) (a)) 00134 #define ui16toSINT(a) ((SINT) ( ( ((a)[0]<<8) & 0x00FF00) | \ 00135 ( (a)[1] & 0x00FF))) 00136 #define ui32toSINT(a) ((SINT) ( ( (((SINT)(a)[0])<<24) & 0x00FF000000) | \ 00137 ( (((SINT)(a)[1])<<16) & 0x00FF0000 ) | \ 00138 ( ( (a)[2] <<8) & 0x00FF00 ) | \ 00139 ( (a)[3] & 0x00FF ))) 00140 00141 #define si8toSINT(a) ((SINT) (a)) 00142 #define si16toSINT(a) ((SINT) ( ((SINT)(a)[0])<<8 | \ 00143 ( (a)[1] & 0x00FF))) 00144 #define si32toSINT(a) ((SINT) ( ((SINT)(a)[0])<<24 | \ 00145 ( (((SINT)(a)[1])<<16) & 0x00FF0000) | \ 00146 ( ( (a)[2] <<8) & 0x00FF00 ) | \ 00147 ( (a)[3] & 0x00FF ))) 00148 00149 #define ui8f8toSFLOAT(a) ((SFLOAT)( (a)[0] + (a)[1]/256.0) ) 00150 #define ui16f16toSFLOAT(a) ((SFLOAT)( (a)[0]*256.0 + \ 00151 (a)[1] + \ 00152 ( (a)[2] + \ 00153 (a)[3]/256.0 ) /256.0 )) 00154 00155 00156 #define si16f16toSFLOAT(a) ( ((SFLOAT)( ((SINT)(a)[0])<<24 | \ 00157 ((((SINT)(a)[1])<<16) & 0x00FF0000) | \ 00158 ( ((a)[2] <<8) & 0x00FF00 ) | \ 00159 ( (a)[3] & 0x00FF ) \ 00160 )) /65536.0) 00161 00162 00163 #define SigtoCSIG(a) ((CSIG) ( ( (((SINT)(a)[0])<<24) & 0x00FF000000) | \ 00164 ( (((SINT)(a)[1])<<16) & 0x00FF0000 ) | \ 00165 ( ( (a)[2] <<8) & 0x00FF00 ) | \ 00166 ( (a)[3] & 0x00FF ) ) ) 00167 00168 00169 #ifdef __cplusplus 00170 } 00171 #endif 00172 00173 #endif // ICC_I386_H

Generated on Sat May 15 19:40:19 2004 for test by doxygen 1.3.7