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

#include <IccIO.h>

+ Inheritance diagram for CIccMemIO:
+ Collaboration diagram for CIccMemIO:

Public Member Functions

 CIccMemIO ()
 
virtual ~CIccMemIO ()
 
bool Align32 ()
 Write operation to make sure that filelength is evenly divisible by 4.
 
bool Alloc (icUInt32Number nSize, bool bWrite=false)
 
bool Attach (icUInt8Number *pData, icUInt32Number nSize, bool bWrite=false)
 
virtual void Close ()
 
icUInt8NumberGetData ()
 
virtual icInt32Number GetLength ()
 
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

bool m_bFreeData
 
icUInt32Number m_nAvail
 
icUInt32Number m_nPos
 
icUInt32Number m_nSize
 
icUInt8Numberm_pData
 

Detailed Description

Type: Class

Purpose: Handles generic memory IO

Constructor & Destructor Documentation

◆ CIccMemIO()

CIccMemIO::CIccMemIO ( )
649 : CIccIO()
650{
651 m_pData = NULL;
652 m_nSize = 0;
653 m_nAvail = 0;
654 m_nPos = 0;
655
656 m_bFreeData = false;
657}
Definition IccIO.h:97
icUInt32Number m_nPos
Definition IccIO.h:241
icUInt32Number m_nSize
Definition IccIO.h:239
icUInt32Number m_nAvail
Definition IccIO.h:240
bool m_bFreeData
Definition IccIO.h:243
icUInt8Number * m_pData
Definition IccIO.h:238

References m_bFreeData, m_nAvail, m_nPos, m_nSize, and m_pData.

Referenced by OpenProfile(), and ReadIccProfile().

+ Here is the caller graph for this function:

◆ ~CIccMemIO()

CIccMemIO::~CIccMemIO ( )
virtual
660{
661 Close();
662}
virtual void Close()
Definition IccIO.cpp:709

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:

◆ Alloc()

bool CIccMemIO::Alloc ( icUInt32Number  nSize,
bool  bWrite = false 
)
666{
667 if (m_pData)
668 Close();
669
670 icUInt8Number *pData = (icUInt8Number*)malloc(nSize);
671
672 if (!pData)
673 return false;
674
675 if (!Attach(pData, nSize, bWrite)) {
676 free(pData);
677 return false;
678 }
679
680 m_bFreeData = true;
681
682 return true;
683}
bool Attach(icUInt8Number *pData, icUInt32Number nSize, bool bWrite=false)
Definition IccIO.cpp:686

References Attach(), Close(), m_bFreeData, and m_pData.

Referenced by OpenProfile().

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

◆ Attach()

bool CIccMemIO::Attach ( icUInt8Number pData,
icUInt32Number  nSize,
bool  bWrite = false 
)
687{
688 if (!pData)
689 return false;
690
691 if (m_pData)
692 Close();
693
694 m_pData = pData;
695 m_nPos = 0;
696
697 if (bWrite) {
698 m_nAvail = nSize;
699 m_nSize = 0;
700 }
701 else {
702 m_nAvail = m_nSize = nSize;
703 }
704
705 return true;
706}

References Close(), m_nAvail, m_nPos, m_nSize, and m_pData.

Referenced by Alloc(), OpenIccProfile(), CIccTagStruct::ParseMem(), CIccTagProfileSequenceId::ParseMem(), ReadIccProfile(), and ValidateIccProfile().

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

◆ Close()

void CIccMemIO::Close ( )
virtual

Reimplemented from CIccIO.

710{
711 if (m_pData) {
712 if (m_bFreeData) {
713 free(m_pData);
714
715 m_bFreeData = false;
716 }
717 m_pData = NULL;
718 }
719}

References m_bFreeData, and m_pData.

Referenced by ~CIccMemIO(), Alloc(), and Attach().

+ Here is the caller graph for this function:

◆ GetData()

icUInt8Number * CIccMemIO::GetData ( )
inline
235{ return m_pData; }

References m_pData.

Referenced by MyTagDialog::MyTagDialog(), and OpenProfile().

+ Here is the caller graph for this function:

◆ GetLength()

icInt32Number CIccMemIO::GetLength ( )
virtual

Reimplemented from CIccIO.

753{
754 if (!m_pData)
755 return 0;
756
757 return m_nSize;
758}

References m_nSize, and m_pData.

Referenced by MyTagDialog::MyTagDialog().

+ 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 CIccMemIO::Read8 ( void *  pBuf,
icInt32Number  nNum = 1 
)
virtual

Reimplemented from CIccIO.

723{
724 if (!m_pData)
725 return 0;
726 if (nNum > 0) {
727 nNum = __min((icInt32Number) (m_nSize - m_nPos), nNum);
728 memcpy(pBuf, m_pData + m_nPos, nNum);
729 m_nPos += nNum;
730 }
731 return nNum;
732}
long icInt32Number
Definition icProfileHeader.h:291
#define __min
Definition IccArrayBasic.cpp:87

References m_nPos, m_nSize, and m_pData.

◆ 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 CIccMemIO::Seek ( icInt32Number  nOffset,
icSeekVal  pos 
)
virtual

Reimplemented from CIccIO.

762{
763 if (!m_pData)
764 return -1;
765
766 icInt32Number nPos;
767 switch(pos) {
768 case icSeekSet:
769 nPos = nOffset;
770 break;
771 case icSeekCur:
772 nPos = (icInt32Number)m_nPos + nOffset;
773 break;
774 case icSeekEnd:
775 nPos = (icInt32Number)m_nSize + nOffset;
776 break;
777 default:
778 nPos = 0;
779 break;
780 }
781
782 if (nPos < 0)
783 return -1;
784
785 icUInt32Number uPos = (icUInt32Number)nPos;
786
787 if (uPos > m_nSize && m_nSize != m_nAvail && uPos <=m_nAvail) {
788 memset(m_pData+m_nSize, 0, (icInt32Number)(uPos - m_nSize));
789 m_nSize = uPos;
790 }
791 if (uPos > m_nSize)
792 return -1;
793
794 m_nPos = uPos;
795
796 return nPos;
797}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
@ icSeekSet
Definition IccIO.h:83
@ icSeekCur
Definition IccIO.h:84

References icSeekCur, icSeekEnd, icSeekSet, m_nAvail, m_nPos, m_nSize, and m_pData.

◆ 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}
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 CIccMemIO::Tell ( )
virtual

Reimplemented from CIccIO.

801{
802 if (!m_pData)
803 return -1;
804
805 return (icInt32Number)m_nPos;
806}

References m_nPos, and m_pData.

◆ 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 CIccMemIO::Write8 ( void *  pBuf,
icInt32Number  nNum = 1 
)
virtual

Reimplemented from CIccIO.

736{
737 if (!m_pData)
738 return 0;
739
740 nNum = __min((icInt32Number)(m_nAvail-m_nPos), nNum);
741
742 memcpy(m_pData + m_nPos, pBuf, nNum);
743
744 m_nPos += nNum;
745 if (m_nPos > m_nSize)
746 m_nSize = m_nPos;
747
748 return nNum;
749}

References m_nAvail, m_nPos, m_nSize, and m_pData.

◆ 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

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_bFreeData

bool CIccMemIO::m_bFreeData
protected

Referenced by CIccMemIO(), Alloc(), and Close().

◆ m_nAvail

icUInt32Number CIccMemIO::m_nAvail
protected

Referenced by CIccMemIO(), Attach(), Seek(), and Write8().

◆ m_nPos

icUInt32Number CIccMemIO::m_nPos
protected

Referenced by CIccMemIO(), Attach(), Read8(), Seek(), Tell(), and Write8().

◆ m_nSize

icUInt32Number CIccMemIO::m_nSize
protected

◆ m_pData

icUInt8Number* CIccMemIO::m_pData
protected

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