IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
CIccFileIO Class Reference

#include <IccIO.h>

+ Inheritance diagram for CIccFileIO:
+ Collaboration diagram for CIccFileIO:

Public Member Functions

 CIccFileIO ()
 
virtual ~CIccFileIO ()
 
bool Align32 ()
 Write operation to make sure that filelength is evenly divisible by 4.
 
bool Attach (FILE *f)
 
virtual void Close ()
 
void Detach ()
 
virtual icInt32Number GetLength ()
 
bool Open (const icChar *szFilename, const icChar *szAttr)
 
icInt32Number Read16 (void *pBuf16, icInt32Number nNum=1)
 
icInt32Number Read32 (void *pBuf32, icInt32Number nNum=1)
 
icInt32Number Read64 (void *pBuf64, icInt32Number nNum=1)
 
virtual icInt32Number Read8 (void *pBuf, icInt32Number nNum=1)
 
icInt32Number ReadFloat16Float (void *pBufFloat, icInt32Number nNum=1)
 
icInt32Number ReadFloat32Float (void *pBufFloat, icInt32Number nNum=1)
 
icInt32Number ReadLine (void *pBuf8, icInt32Number nNum=256)
 
icInt32Number ReadUInt16Float (void *pBufFloat, icInt32Number nNum=1)
 
icInt32Number ReadUInt8Float (void *pBufFloat, icInt32Number nNum=1)
 
virtual icInt32Number Seek (icInt32Number nOffset, icSeekVal pos)
 
bool Sync32 (icUInt32Number nOffset=0)
 Operation to make sure read position is evenly divisible by 4.
 
virtual icInt32Number Tell ()
 
icInt32Number Write16 (void *pBuf16, icInt32Number nNum=1)
 
icInt32Number Write32 (void *pBuf32, icInt32Number nNum=1)
 
icInt32Number Write64 (void *pBuf64, icInt32Number nNum=1)
 
virtual icInt32Number Write8 (void *pBuf, icInt32Number nNum=1)
 
icInt32Number WriteFloat16Float (void *pBuf16, icInt32Number nNum=1)
 
icInt32Number WriteFloat32Float (void *pBufFloat, icInt32Number nNum=1)
 
icInt32Number WriteUInt16Float (void *pBuf16, icInt32Number nNum=1)
 
icInt32Number WriteUInt8Float (void *pBuf16, icInt32Number nNum=1)
 

Protected Attributes

FILE * m_fFile
 

Detailed Description

Type: Class

Purpose: Handles generic File IO

Constructor & Destructor Documentation

◆ CIccFileIO()

CIccFileIO::CIccFileIO ( )
372 : CIccIO()
373{
374 m_fFile = NULL;
375}
Definition IccIO.h:97
FILE * m_fFile
Definition IccIO.h:174

References m_fFile.

Referenced by CIccStandardFileIO::OpenFile().

+ Here is the caller graph for this function:

◆ ~CIccFileIO()

CIccFileIO::~CIccFileIO ( )
virtual
378{
379 Close();
380}
virtual void Close()
Definition IccIO.cpp:443

References Close().

+ Here is the call graph for this function:

Member Function Documentation

◆ Align32()

bool CIccIO::Align32 ( )
inherited

Write operation to make sure that filelength is evenly divisible by 4.

342{
343 int mod = GetLength() % 4;
344 if (mod != 0) {
345 icUInt8Number buf[4]={0,0,0,0};
346 if (Seek(0, icSeekEnd)<0)
347 return false;
348
349 if (Write8(buf, 4-mod) != 4-mod)
350 return false;
351 }
352
353 return true;
354
355}
unsigned char icUInt8Number
Definition icProfileHeader.h:250
@ icSeekEnd
Definition IccIO.h:85
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105
virtual icInt32Number GetLength()
Definition IccIO.h:130
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.h:132

References CIccIO::GetLength(), icSeekEnd, CIccIO::Seek(), and CIccIO::Write8().

Referenced by CIccMpeCurveSet::Write(), CIccMpeToneMap::Write(), CIccMpeCalculator::Write(), CIccTagSparseMatrixArray::Write(), CIccProfileDescText::Write(), CIccTagStruct::Write(), CIccTagArray::Write(), CIccTagDict::Write(), CIccTagCurve::Write(), CIccTagParametricCurve::Write(), CIccTagLutAtoB::Write(), CIccTagMultiProcessElement::Write(), and CIccTagProfileSequenceId::Write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Attach()

bool CIccFileIO::Attach ( FILE *  f)
427{
428 if (m_fFile)
429 fclose(m_fFile);
430
431 m_fFile = f;
432
433 return m_fFile != NULL;
434}

References m_fFile.

Referenced by SaveIccProfile().

+ Here is the caller graph for this function:

◆ Close()

void CIccFileIO::Close ( )
virtual

Reimplemented from CIccIO.

444{
445 if (m_fFile) {
446 fclose(m_fFile);
447 m_fFile = NULL;
448 }
449}

References m_fFile.

Referenced by ~CIccFileIO(), main(), and main().

+ Here is the caller graph for this function:

◆ Detach()

void CIccFileIO::Detach ( )
438{
439 m_fFile = NULL;
440}

References m_fFile.

Referenced by SaveIccProfile().

+ Here is the caller graph for this function:

◆ GetLength()

icInt32Number CIccFileIO::GetLength ( )
virtual

Reimplemented from CIccIO.

471{
472 if (!m_fFile)
473 return 0;
474
475 fflush(m_fFile);
476 icInt32Number current = (icInt32Number)ftell(m_fFile), end;
477 fseek (m_fFile, 0, SEEK_END);
478 end = (icInt32Number)ftell(m_fFile);
479 fseek (m_fFile, current, SEEK_SET);
480 return end;
481}
long icInt32Number
Definition icProfileHeader.h:291

References m_fFile.

Referenced by main(), and main().

+ Here is the caller graph for this function:

◆ Open()

bool CIccFileIO::Open ( const icChar szFilename,
const icChar szAttr 
)
383{
384#ifdef WIN32
385 char myAttr[20];
386
387 if (!strchr(szAttr, 'b')) {
388 myAttr[0] = szAttr[0];
389 myAttr[1] = 'b';
390 strcpy(myAttr+2, szAttr+1);
391 szAttr = myAttr;
392 }
393#endif
394
395 if (m_fFile)
396 fclose(m_fFile);
397
398 m_fFile = fopen(szFilename, szAttr);
399
400 return m_fFile != NULL;
401}

References m_fFile.

Referenced by CalcProfileID(), main(), main(), CIccStandardFileIO::OpenFile(), OpenIccProfile(), ReadIccProfile(), SaveIccProfile(), and ValidateIccProfile().

+ Here is the caller graph for this function:

◆ Read16()

icInt32Number CIccIO::Read16 ( void *  pBuf16,
icInt32Number  nNum = 1 
)
inherited
115{
116 nNum = Read8(pBuf16, nNum<<1)>>1;
117 icSwab16Array(pBuf16, nNum);
118
119 return nNum;
120}
void icSwab16Array(void *pVoid, int num)
Definition IccUtil.h:218
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104

References icSwab16Array(), and CIccIO::Read8().

Referenced by icCLutFromXml(), CIccTagXmlCurve::ParseXml(), CIccSampledCurveSegmentXml::ParseXml(), CIccSinglSampledeCurveXml::ParseXml(), CIccTagXmlFloatNum< T, A, Tsig >::ParseXml(), CIccMpeUnknown::Read(), CIccMpeAcs::Read(), CIccFormulaCurveSegment::Read(), CIccSegmentedCurve::Read(), CIccSingleSampledCurve::Read(), CIccSampledCalculatorCurve::Read(), CIccMpeCurveSet::Read(), CIccMpeTintArray::Read(), CIccToneMapFunc::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeCalculator::Read(), CIccMpeSpectralMatrix::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeSpectralObserver::Read(), CIccTagUtf16Text::Read(), CIccTagTextDescription::Read(), CIccTagChromaticity::Read(), CIccTagSparseMatrixArray::Read(), CIccTagNum< T, Tsig >::Read(), CIccTagMultiLocalizedUnicode::Read(), CIccTagDateTime::Read(), CIccTagColorantTable::Read(), CIccResponseCurveStruct::Read(), CIccTagResponseCurveSet16::Read(), CIccTagSpectralDataInfo::Read(), CIccTagSpectralViewingConditions::Read(), CIccTagDict::Read(), CIccTagParametricCurve::Read(), CIccTagLutAtoB::Read(), CIccTagLut16::Read(), CIccTagGamutBoundaryDesc::Read(), CIccTagMultiProcessElement::Read(), CIccIO::ReadFloat16Float(), and CIccIO::ReadUInt16Float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Read32()

icInt32Number CIccIO::Read32 ( void *  pBuf32,
icInt32Number  nNum = 1 
)
inherited
144{
145 nNum = Read8(pBuf32, nNum<<2)>>2;
146 icSwab32Array(pBuf32, nNum);
147
148 return nNum;
149}
void icSwab32Array(void *pVoid, int num)
Definition IccUtil.h:239

References icSwab32Array(), and CIccIO::Read8().

Referenced by CIccTagStruct::LoadElem(), CIccMpeUnknown::Read(), CIccMpeAcs::Read(), CIccFormulaCurveSegment::Read(), CIccSampledCurveSegment::Read(), CIccSegmentedCurve::Read(), CIccSingleSampledCurve::Read(), CIccSampledCalculatorCurve::Read(), CIccMpeCurveSet::Read(), CIccMpeTintArray::Read(), CIccToneMapFunc::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccCalculatorFunc::Read(), CIccMpeCalculator::Read(), CIccMpeSpectralMatrix::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeSpectralObserver::Read(), CIccTagUnknown::Read(), CIccTagText::Read(), CIccTagUtf8Text::Read(), CIccTagZipUtf8Text::Read(), CIccTagUtf16Text::Read(), CIccTagTextDescription::Read(), CIccTagSignature::Read(), CIccTagNamedColor2::Read(), CIccTagXYZ::Read(), CIccTagChromaticity::Read(), CIccTagCicp::Read(), CIccTagSparseMatrixArray::Read(), CIccTagFixedNum< T, Tsig >::Read(), CIccTagNum< T, Tsig >::Read(), CIccTagFloatNum< T, Tsig >::Read(), CIccTagMeasurement::Read(), CIccTagMultiLocalizedUnicode::Read(), CIccTagData::Read(), CIccTagDateTime::Read(), CIccTagColorantOrder::Read(), CIccTagColorantTable::Read(), CIccTagViewingConditions::Read(), CIccProfileDescText::Read(), CIccTagProfileSeqDesc::Read(), CIccResponseCurveStruct::Read(), CIccTagResponseCurveSet16::Read(), CIccTagSpectralDataInfo::Read(), CIccTagSpectralViewingConditions::Read(), CIccTagEmbeddedHeightImage::Read(), CIccTagEmbeddedNormalImage::Read(), CIccTagStruct::Read(), CIccTagArray::Read(), CIccTagDict::Read(), CIccTagCurve::Read(), CIccTagParametricCurve::Read(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), CIccTagLut16::Read(), CIccTagGamutBoundaryDesc::Read(), CIccTagMultiProcessElement::Read(), CIccTagProfileSequenceId::Read(), CIccTagEmbeddedProfile::Read(), and CIccIO::ReadFloat32Float().

+ Here is the call graph for this function:

◆ Read64()

icInt32Number CIccIO::Read64 ( void *  pBuf64,
icInt32Number  nNum = 1 
)
inherited
174{
175 nNum = Read8(pBuf64, nNum<<3)>>3;
176 icSwab64Array(pBuf64, nNum);
177
178 return nNum;
179}
void icSwab64Array(void *pVoid, int num)
Definition IccUtil.h:264

References icSwab64Array(), and CIccIO::Read8().

Referenced by CIccTagXmlFloatNum< T, A, Tsig >::ParseXml(), CIccTagNum< T, Tsig >::Read(), CIccTagFloatNum< T, Tsig >::Read(), and CIccTagProfileSeqDesc::Read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Read8()

icInt32Number CIccFileIO::Read8 ( void *  pBuf,
icInt32Number  nNum = 1 
)
virtual

Reimplemented from CIccIO.

453{
454 if (!m_fFile)
455 return 0;
456
457 return (icInt32Number)fread(pBuf, 1, nNum, m_fFile);
458}

References m_fFile.

Referenced by main(), and main().

+ Here is the caller graph for this function:

◆ ReadFloat16Float()

icInt32Number CIccIO::ReadFloat16Float ( void *  pBufFloat,
icInt32Number  nNum = 1 
)
inherited
270{
271 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
272 icFloat16Number tmp;
274
275 for (i=0; i<nNum; i++) {
276 if (Read16(&tmp, 1)!=1)
277 break;
278 *ptr = icF16toF(tmp);
279 ptr++;
280 }
281
282 return i;
283}
icUInt16Number icFloat16Number
Definition icProfileHeader.h:310
float icFloatNumber
Definition IccDefs.h:101
ICCPROFLIB_API icFloat32Number icF16toF(icFloat16Number num)
Definition IccUtil.cpp:629
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114

References icF16toF(), and CIccIO::Read16().

Referenced by CIccTagXmlFloatNum< T, A, Tsig >::ParseXml(), CIccSingleSampledCurve::Read(), CIccMpeExtCLUT::Read(), CIccMpeSpectralCLUT::Read(), CIccTagSparseMatrixArray::Read(), and CIccTagFloatNum< T, Tsig >::Read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadFloat32Float()

icInt32Number CIccIO::ReadFloat32Float ( void *  pBufFloat,
icInt32Number  nNum = 1 
)
inherited
303{
304 if (sizeof(icFloat32Number)==sizeof(icFloatNumber))
305 return Read32(pBufFloat, nNum);
306
307 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
308 icFloat32Number tmp;
310
311 for (i=0; i<nNum; i++) {
312 if (Read32(&tmp, 1)!=1)
313 break;
314 *ptr = (icFloatNumber)tmp;
315 ptr++;
316 }
317
318 return i;
319}
float icFloat32Number
Definition icProfileHeader.h:313
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143

References CIccIO::Read32().

Referenced by icCLutFromXml(), CIccTagXmlCurve::ParseXml(), CIccSampledCurveSegmentXml::ParseXml(), CIccSinglSampledeCurveXml::ParseXml(), CIccTagXmlFloatNum< T, A, Tsig >::ParseXml(), CIccFormulaCurveSegment::Read(), CIccSampledCurveSegment::Read(), CIccSegmentedCurve::Read(), CIccSingleSampledCurve::Read(), CIccSampledCalculatorCurve::Read(), CIccToneMapFunc::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeSpectralMatrix::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeSpectralObserver::Read(), CIccTagSparseMatrixArray::Read(), CIccTagSpectralViewingConditions::Read(), CIccTagEmbeddedHeightImage::Read(), and CIccTagGamutBoundaryDesc::Read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadLine()

icInt32Number CIccIO::ReadLine ( void *  pBuf8,
icInt32Number  nNum = 256 
)
inherited
94{
95 icInt32Number n=0;
96 icInt8Number c, *ptr=(icInt8Number*)pBuf8;
97
98 while(n<nNum) {
99 if (!Read8(&c)) {
100 break;
101 }
102 if (c=='\n') {
103 break;
104 }
105 else if (c!='\r') {
106 *ptr++ = c;
107 n++;
108 }
109 }
110 *ptr = '\0';
111 return n;
112}
char icInt8Number
Definition icProfileHeader.h:279

References CIccIO::Read8().

Referenced by icXmlParseTextString(), and CIccTagXmlTextDescription::ParseXml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadUInt16Float()

icInt32Number CIccIO::ReadUInt16Float ( void *  pBufFloat,
icInt32Number  nNum = 1 
)
inherited
237{
238 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
239 icUInt16Number tmp;
241
242 for (i=0; i<nNum; i++) {
243 if (Read16(&tmp, 1)!=1)
244 break;
245 *ptr = (icFloatNumber)((icFloatNumber)tmp / 65535.0);
246 ptr++;
247 }
248
249 return i;
250}
unsigned short icUInt16Number
Definition icProfileHeader.h:256

References CIccIO::Read16().

Referenced by CIccSingleSampledCurve::Read(), CIccMpeExtCLUT::Read(), CIccMpeSpectralCLUT::Read(), CIccTagNamedColor2::Read(), CIccTagSparseMatrixArray::Read(), CIccTagCurve::Read(), CIccTagLut16::Read(), and CIccCLUT::ReadData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadUInt8Float()

icInt32Number CIccIO::ReadUInt8Float ( void *  pBufFloat,
icInt32Number  nNum = 1 
)
inherited
204{
205 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
206 icUInt8Number tmp;
208
209 for (i=0; i<nNum; i++) {
210 if (Read8(&tmp, 1)!=1)
211 break;
212 *ptr = (icFloatNumber)((icFloatNumber)tmp / 255.0);
213 ptr++;
214 }
215
216 return i;
217}

References CIccIO::Read8().

Referenced by CIccSingleSampledCurve::Read(), CIccMpeExtCLUT::Read(), CIccMpeSpectralCLUT::Read(), CIccTagSparseMatrixArray::Read(), CIccTagLut8::Read(), and CIccCLUT::ReadData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Seek()

icInt32Number CIccFileIO::Seek ( icInt32Number  nOffset,
icSeekVal  pos 
)
virtual

Reimplemented from CIccIO.

485{
486 if (!m_fFile)
487 return -1;
488
489 return !fseek(m_fFile, nOffset, pos) ? (icInt32Number)ftell(m_fFile) : -1;
490}

References m_fFile.

◆ Sync32()

bool CIccIO::Sync32 ( icUInt32Number  nOffset = 0)
inherited

Operation to make sure read position is evenly divisible by 4.

358{
359 nOffset &= 0x3;
360
361 icUInt32Number nPos = ((Tell() - nOffset + 3)>>2)<<2;
362 if (Seek(nPos + nOffset, icSeekSet)<0)
363 return false;
364 return true;
365}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
@ icSeekSet
Definition IccIO.h:83
virtual icInt32Number Tell()
Definition IccIO.h:133

References icSeekSet, CIccIO::Seek(), and CIccIO::Tell().

Referenced by CIccProfileDescText::Read(), and CIccTagLutAtoB::Read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Tell()

icInt32Number CIccFileIO::Tell ( )
virtual

Reimplemented from CIccIO.

494{
495 if (!m_fFile)
496 return -1;
497
498 return (icInt32Number)ftell(m_fFile);
499}

References m_fFile.

◆ Write16()

icInt32Number CIccIO::Write16 ( void *  pBuf16,
icInt32Number  nNum = 1 
)
inherited
123{
124#ifndef ICC_BYTE_ORDER_LITTLE_ENDIAN
125 return Write8(pBuf16, nNum<<1)>>1;
126#else
127 icUInt16Number *ptr = (icUInt16Number*)pBuf16;
128 icUInt16Number tmp;
130
131 for (i=0; i<nNum; i++) {
132 tmp = *ptr;
133 icSwab16(tmp);
134 if (Write8(&tmp, 2)!=2)
135 break;
136 ptr++;
137 }
138
139 return i;
140#endif
141}
#define icSwab16(flt)
Definition IccUtil.h:288

References CIccIO::Write8().

Referenced by CIccMpeAcs::Write(), CIccFormulaCurveSegment::Write(), CIccSegmentedCurve::Write(), CIccSingleSampledCurve::Write(), CIccSampledCalculatorCurve::Write(), CIccMpeCurveSet::Write(), CIccMpeTintArray::Write(), CIccToneMapFunc::Write(), CIccMpeToneMap::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccMpeCalculator::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), CIccMpeSpectralObserver::Write(), CIccTagUtf16Text::Write(), CIccTagTextDescription::Write(), CIccTagChromaticity::Write(), CIccTagSparseMatrixArray::Write(), CIccTagNum< T, Tsig >::Write(), CIccTagMultiLocalizedUnicode::Write(), CIccTagDateTime::Write(), CIccTagColorantTable::Write(), CIccResponseCurveStruct::Write(), CIccTagResponseCurveSet16::Write(), CIccTagSpectralDataInfo::Write(), CIccTagSpectralViewingConditions::Write(), CIccTagDict::Write(), CIccTagParametricCurve::Write(), CIccTagLutAtoB::Write(), CIccTagLut16::Write(), CIccTagGamutBoundaryDesc::Write(), CIccMpeUnknown::Write(), CIccTagMultiProcessElement::Write(), CIccIO::WriteFloat16Float(), and CIccIO::WriteUInt16Float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Write32()

icInt32Number CIccIO::Write32 ( void *  pBuf32,
icInt32Number  nNum = 1 
)
inherited
153{
154#ifndef ICC_BYTE_ORDER_LITTLE_ENDIAN
155 return Write8(pBuf32, nNum<<2)>>2;
156#else
157 icUInt32Number *ptr = (icUInt32Number*)pBuf32;
158 icUInt32Number tmp;
160
161 for (i=0; i<nNum; i++) {
162 tmp = *ptr;
163 icSwab32(tmp);
164 if (Write8(&tmp, 4)!=4)
165 break;
166 ptr++;
167 }
168
169 return i;
170#endif
171}
#define icSwab32(flt)
Definition IccUtil.h:289

References CIccIO::Write8().

Referenced by CIccMpeAcs::Write(), CIccFormulaCurveSegment::Write(), CIccSampledCurveSegment::Write(), CIccSegmentedCurve::Write(), CIccSingleSampledCurve::Write(), CIccSampledCalculatorCurve::Write(), CIccMpeCurveSet::Write(), CIccMpeTintArray::Write(), CIccToneMapFunc::Write(), CIccMpeToneMap::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccCalculatorFunc::Write(), CIccMpeCalculator::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), CIccMpeSpectralObserver::Write(), CIccTagUnknown::Write(), CIccTagText::Write(), CIccTagUtf8Text::Write(), CIccTagZipUtf8Text::Write(), CIccTagUtf16Text::Write(), CIccTagTextDescription::Write(), CIccTagSignature::Write(), CIccTagNamedColor2::Write(), CIccTagXYZ::Write(), CIccTagChromaticity::Write(), CIccTagCicp::Write(), CIccTagSparseMatrixArray::Write(), CIccTagFixedNum< T, Tsig >::Write(), CIccTagNum< T, Tsig >::Write(), CIccTagFloatNum< T, Tsig >::Write(), CIccTagMeasurement::Write(), CIccTagMultiLocalizedUnicode::Write(), CIccTagData::Write(), CIccTagDateTime::Write(), CIccTagColorantOrder::Write(), CIccTagColorantTable::Write(), CIccTagViewingConditions::Write(), CIccTagProfileSeqDesc::Write(), CIccResponseCurveStruct::Write(), CIccTagResponseCurveSet16::Write(), CIccTagSpectralDataInfo::Write(), CIccTagSpectralViewingConditions::Write(), CIccTagEmbeddedHeightImage::Write(), CIccTagEmbeddedNormalImage::Write(), CIccTagStruct::Write(), CIccTagArray::Write(), CIccTagDict::Write(), CIccTagEmbeddedProfile::Write(), CIccTagCurve::Write(), CIccTagParametricCurve::Write(), CIccTagLutAtoB::Write(), CIccTagLut8::Write(), CIccTagLut16::Write(), CIccTagGamutBoundaryDesc::Write(), CIccMpeUnknown::Write(), CIccTagMultiProcessElement::Write(), CIccTagProfileSequenceId::Write(), and CIccIO::WriteFloat32Float().

+ Here is the call graph for this function:

◆ Write64()

icInt32Number CIccIO::Write64 ( void *  pBuf64,
icInt32Number  nNum = 1 
)
inherited
183{
184#ifndef ICC_BYTE_ORDER_LITTLE_ENDIAN
185 return Write8(pBuf64, nNum<<3)>>3;
186#else
187 icUInt64Number *ptr = (icUInt64Number*)pBuf64;
188 icUInt64Number tmp;
190
191 for (i=0; i<nNum; i++) {
192 tmp = *ptr;
193 icSwab64(tmp);
194 if (Write8(&tmp, 8)!=8)
195 break;
196 ptr++;
197 }
198
199 return i;
200#endif
201}
icUInt32Number icUInt64Number[2]
Definition icProfileHeader.h:268
#define icSwab64(flt)
Definition IccUtil.h:290

References CIccIO::Write8().

Referenced by CIccTagNum< T, Tsig >::Write(), CIccTagFloatNum< T, Tsig >::Write(), and CIccTagProfileSeqDesc::Write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Write8()

icInt32Number CIccFileIO::Write8 ( void *  pBuf,
icInt32Number  nNum = 1 
)
virtual

Reimplemented from CIccIO.

462{
463 if (!m_fFile)
464 return 0;
465
466 return (icInt32Number)fwrite(pBuf, 1, nNum, m_fFile);
467}

References m_fFile.

Referenced by main().

+ Here is the caller graph for this function:

◆ WriteFloat16Float()

icInt32Number CIccIO::WriteFloat16Float ( void *  pBuf16,
icInt32Number  nNum = 1 
)
inherited
286{
287 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
288 icUInt16Number tmp;
290
291 for (i=0; i<nNum; i++) {
292 tmp = icFtoF16(*ptr);
293
294 if (Write16(&tmp, 1)!=1)
295 break;
296 ptr++;
297 }
298
299 return i;
300}
ICCPROFLIB_API icFloat16Number icFtoF16(icFloat32Number num)
Definition IccUtil.cpp:673
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:122

References icFtoF16(), and CIccIO::Write16().

Referenced by CIccSingleSampledCurve::Write(), CIccMpeExtCLUT::Write(), CIccMpeSpectralCLUT::Write(), CIccTagSparseMatrixArray::Write(), and CIccTagFloatNum< T, Tsig >::Write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WriteFloat32Float()

icInt32Number CIccIO::WriteFloat32Float ( void *  pBufFloat,
icInt32Number  nNum = 1 
)
inherited
322{
323 if (sizeof(icFloat32Number)==sizeof(icFloatNumber))
324 return Write32(pBufFloat, nNum);
325
326 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
327 icFloat32Number tmp;
329
330 for (i=0; i<nNum; i++) {
331 tmp = (icFloat32Number)*ptr;
332
333 if (Write32(&tmp, 1)!=1)
334 break;
335 ptr++;
336 }
337
338 return i;
339}
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152

References CIccIO::Write32().

Referenced by CIccFormulaCurveSegment::Write(), CIccSampledCurveSegment::Write(), CIccSegmentedCurve::Write(), CIccSingleSampledCurve::Write(), CIccSampledCalculatorCurve::Write(), CIccToneMapFunc::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), CIccMpeSpectralObserver::Write(), CIccTagSparseMatrixArray::Write(), CIccTagSpectralViewingConditions::Write(), CIccTagEmbeddedHeightImage::Write(), and CIccTagGamutBoundaryDesc::Write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WriteUInt16Float()

icInt32Number CIccIO::WriteUInt16Float ( void *  pBuf16,
icInt32Number  nNum = 1 
)
inherited
253{
254 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
255 icUInt16Number tmp;
257
258 for (i=0; i<nNum; i++) {
259 tmp = (icUInt16Number)(__max(0.0, __min(1.0, *ptr)) * 65535.0 + 0.5);
260
261 if (Write16(&tmp, 1)!=1)
262 break;
263 ptr++;
264 }
265
266 return i;
267}
#define __max(a, b)
Definition IccIO.cpp:78
#define __min
Definition IccArrayBasic.cpp:87

References CIccIO::Write16().

Referenced by CIccSingleSampledCurve::Write(), CIccMpeExtCLUT::Write(), CIccMpeSpectralCLUT::Write(), CIccTagNamedColor2::Write(), CIccTagSparseMatrixArray::Write(), CIccTagCurve::Write(), CIccTagLut16::Write(), and CIccCLUT::WriteData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WriteUInt8Float()

icInt32Number CIccIO::WriteUInt8Float ( void *  pBuf16,
icInt32Number  nNum = 1 
)
inherited
220{
221 icFloatNumber *ptr = (icFloatNumber*)pBufFloat;
222 icUInt8Number tmp;
224
225 for (i=0; i<nNum; i++) {
226 tmp = (icUInt8Number)(__max(0.0, __min(1.0, *ptr)) * 255.0 + 0.5);
227
228 if (Write8(&tmp, 1)!=1)
229 break;
230 ptr++;
231 }
232
233 return i;
234}

References CIccIO::Write8().

Referenced by CIccSingleSampledCurve::Write(), CIccMpeExtCLUT::Write(), CIccMpeSpectralCLUT::Write(), CIccTagSparseMatrixArray::Write(), CIccTagLut8::Write(), and CIccCLUT::WriteData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ m_fFile

FILE* CIccFileIO::m_fFile
protected

The documentation for this class was generated from the following files: