78#define __max(a,b) (((a) > (b)) ? (a) : (b))
81#define __min(a,b) (((a) < (b)) ? (a) : (b))
84#ifdef USEREFICCMAXNAMESPACE
116 nNum = Read8(pBuf16, nNum<<1)>>1;
124#ifndef ICC_BYTE_ORDER_LITTLE_ENDIAN
125 return Write8(pBuf16, nNum<<1)>>1;
131 for (i=0; i<nNum; i++) {
134 if (Write8(&tmp, 2)!=2)
145 nNum = Read8(pBuf32, nNum<<2)>>2;
154#ifndef ICC_BYTE_ORDER_LITTLE_ENDIAN
155 return Write8(pBuf32, nNum<<2)>>2;
161 for (i=0; i<nNum; i++) {
164 if (Write8(&tmp, 4)!=4)
175 nNum = Read8(pBuf64, nNum<<3)>>3;
184#ifndef ICC_BYTE_ORDER_LITTLE_ENDIAN
185 return Write8(pBuf64, nNum<<3)>>3;
191 for (i=0; i<nNum; i++) {
194 if (Write8(&tmp, 8)!=8)
209 for (i=0; i<nNum; i++) {
210 if (Read8(&tmp, 1)!=1)
225 for (i=0; i<nNum; i++) {
228 if (Write8(&tmp, 1)!=1)
242 for (i=0; i<nNum; i++) {
243 if (Read16(&tmp, 1)!=1)
258 for (i=0; i<nNum; i++) {
261 if (Write16(&tmp, 1)!=1)
275 for (i=0; i<nNum; i++) {
276 if (Read16(&tmp, 1)!=1)
291 for (i=0; i<nNum; i++) {
294 if (Write16(&tmp, 1)!=1)
305 return Read32(pBufFloat, nNum);
311 for (i=0; i<nNum; i++) {
312 if (Read32(&tmp, 1)!=1)
324 return Write32(pBufFloat, nNum);
330 for (i=0; i<nNum; i++) {
333 if (Write32(&tmp, 1)!=1)
343 int mod = GetLength() % 4;
349 if (Write8(buf, 4-mod) != 4-mod)
387 if (!strchr(szAttr,
'b')) {
388 myAttr[0] = szAttr[0];
390 strcpy(myAttr+2, szAttr+1);
398 m_fFile = fopen(szFilename, szAttr);
409 if (!wcschr(szAttr,
'b')) {
410 myAttr[0] = szAttr[0];
412 wcscpy(myAttr+2, szAttr+1);
419 m_fFile = _wfopen(szFilename, szAttr);
479 fseek (
m_fFile, current, SEEK_SET);
594 else if (nOffset < 0)
675 if (!
Attach(pData, nSize, bWrite)) {
843 memset(pBuf, 0, nRead);
902#ifdef USEREFICCMAXNAMESPACE
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
icFloat16Number icFtoF16(icFloat32Number num)
icFloatNumber icF16toF(icFloat16Number num)
void icSwab16Array(void *pVoid, int num)
void icSwab64Array(void *pVoid, int num)
void icSwab32Array(void *pVoid, int num)
unsigned int icUInt32Number
bool Attach(CIccIO *pIO, icInt32Number nSize=0, bool bOwnIO=false)
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
icInt32Number m_nStartPos
virtual icInt32Number Tell()
virtual icInt32Number Read8(void *pBuf, icInt32Number nNum=1)
virtual icInt32Number GetLength()
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
virtual icInt32Number Tell()
virtual icInt32Number Read8(void *pBuf, icInt32Number nNum=1)
virtual icInt32Number GetLength()
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
bool Open(const icChar *szFilename, const icChar *szAttr)
icInt32Number ReadFloat16Float(void *pBufFloat, icInt32Number nNum=1)
icInt32Number ReadFloat32Float(void *pBufFloat, icInt32Number nNum=1)
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
virtual icInt32Number GetLength()
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
icInt32Number WriteFloat16Float(void *pBuf16, icInt32Number nNum=1)
virtual icInt32Number Tell()
bool Align32()
Write operation to make sure that filelength is evenly divisible by 4.
icInt32Number ReadUInt8Float(void *pBufFloat, icInt32Number nNum=1)
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
icInt32Number ReadLine(void *pBuf8, icInt32Number nNum=256)
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
icInt32Number Write64(void *pBuf64, icInt32Number nNum=1)
icInt32Number WriteFloat32Float(void *pBufFloat, icInt32Number nNum=1)
icInt32Number WriteUInt8Float(void *pBuf16, icInt32Number nNum=1)
icInt32Number ReadUInt16Float(void *pBufFloat, icInt32Number nNum=1)
icInt32Number Read64(void *pBuf64, icInt32Number nNum=1)
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
bool Sync32(icUInt32Number nOffset=0)
Operation to make sure read position is evenly divisible by 4.
icInt32Number WriteUInt16Float(void *pBuf16, icInt32Number nNum=1)
virtual icInt32Number Tell()
bool Alloc(icUInt32Number nSize, bool bWrite=false)
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
virtual icInt32Number Read8(void *pBuf, icInt32Number nNum=1)
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
virtual icInt32Number GetLength()
bool Attach(icUInt8Number *pData, icUInt32Number nSize, bool bWrite=false)
virtual icInt32Number Read8(void *pBuf, icInt32Number nNum=1)
virtual icInt32Number GetLength()
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
virtual icInt32Number Tell()