IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
CIccTagXmlFixedNum< T, Tsig > Class Template Reference

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlFixedNum< T, Tsig >:
+ Collaboration diagram for CIccTagXmlFixedNum< T, Tsig >:

Public Member Functions

virtual ~CIccTagXmlFixedNum ()
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual void DetachIO ()
 
virtual const char * GetClassName () const
 
virtual const char * GetExtClassName () const
 
virtual const char * GetExtDerivedClassName () const
 
virtual IIccExtensionTagGetExtension ()
 
virtual icUInt32Number GetNumValues () const
 
icUInt32Number GetSize () const
 Returns the size of the data array.
 
virtual icArraySignature GetTagArrayType () const
 
virtual icStructSignature GetTagStructType () const
 
virtual icTagTypeSignature GetType () const
 
virtual bool GetValues (icFloatNumber *DstVector, icUInt32Number nStart=0, icUInt32Number nVectorSize=1) const
 
virtual bool Interpolate (icFloatNumber *DstVector, icFloatNumber val, icUInt32Number nVectorSize=1, icFloatNumber *zeroVals=NULL) const
 
virtual bool IsArrayType ()
 
virtual bool IsMatrixArray () const
 
virtual bool IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool IsSupported ()
 
virtual CIccTagNewCopy () const
 
T & operator[] (icUInt32Number index)
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO, CIccProfile *pProfile)
 
virtual bool ReadAll ()
 
bool SetSize (icUInt32Number nSize, bool bZeroNew=true)
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 
virtual bool ValuePos (icFloatNumber &DstPos, icFloatNumber val, bool &bNoZero) const
 
virtual bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccTagCreate (icTagTypeSignature sig)
 

Data Fields

icUInt32Number m_nReserved
 

Protected Attributes

icUInt32Number m_nSize
 
T * m_Num
 

Detailed Description

template<class T, icTagTypeSignature Tsig>
class CIccTagXmlFixedNum< T, Tsig >

Constructor & Destructor Documentation

◆ ~CIccTagXmlFixedNum()

template<class T , icTagTypeSignature Tsig>
virtual CIccTagXmlFixedNum< T, Tsig >::~CIccTagXmlFixedNum ( )
inlinevirtual
286{}

Member Function Documentation

◆ Create()

CIccTag * CIccTag::Create ( icTagTypeSignature  sig)
staticinherited

Name: CIccTag::Create

Purpose: This is a static tag creator based upon tag signature type

Args: sig = tag type signature

Return: Pointer to Allocated tag

144{
145 return CIccTagCreator::CreateTag(sig);
146}
static CIccTag * CreateTag(icTagTypeSignature tagTypeSig)
Definition IccTagFactory.h:279

References CIccTagCreator::CreateTag().

Referenced by CIccDefaultEncProfileConverter::ConvertFromParams(), CIccTagStruct::LoadElem(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccMpeTintArray::Read(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), CIccTagLut16::Read(), CIccTagLut8::SetColorSpaces(), CIccTagLut16::SetColorSpaces(), and CIccProfileDescText::SetType().

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

◆ Describe()

template<class T , icTagTypeSignature Tsig>
void CIccTagFixedNum< T, Tsig >::Describe ( std::string &  sDescription,
int  nVerboseness 
)
virtualinherited

Name: CIccTagFixedNum::Describe

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

Reimplemented from CIccTag.

5321{
5322 icChar buf[128] = { 0 };
5323
5324 if (m_nSize == 1 ) {
5325 if (Tsig==icSigS15Fixed16ArrayType)
5326 sprintf(buf, "Value = %.4lf\n", icFtoD(m_Num[0]));
5327 else
5328 sprintf(buf, "Value = %.4lf\n", icUFtoD(m_Num[0]));
5329 sDescription += buf;
5330 }
5331 else {
5333
5334 if (Tsig==icSigS15Fixed16ArrayType && m_nSize==9) {
5335 sDescription += "Matrix Form:\n";
5336 icMatrixDump(sDescription, (icS15Fixed16Number*)m_Num);
5337
5338 sDescription += "\nArrayForm:\n";
5339 }
5340 sDescription.reserve(sDescription.size() + m_nSize*79);
5341
5342 for (i=0; i<m_nSize; i++) {
5343 if (Tsig==icSigS15Fixed16ArrayType)
5344 sprintf(buf, "Value[%u] = %8.4lf\n", i, icFtoD(m_Num[i]));
5345 else
5346 sprintf(buf, "Value[%u] = %8.4lf\n", i, icUFtoD(m_Num[i]));
5347 sDescription += buf;
5348 }
5349 }
5350}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
@ icSigS15Fixed16ArrayType
Definition icProfileHeader.h:556
icInt32Number icS15Fixed16Number
Definition icProfileHeader.h:302
char icChar
Definition IccDefs.h:110
ICCPROFLIB_API void icMatrixDump(std::string &sDump, icS15Fixed16Number *pMatrix)
Definition IccUtil.cpp:988
ICCPROFLIB_API icFloatNumber icFtoD(icS15Fixed16Number num)
Definition IccUtil.cpp:559
ICCPROFLIB_API icFloatNumber icUFtoD(icU16Fixed16Number num)
Definition IccUtil.cpp:580
T * m_Num
Definition IccTagBasic.h:933
icUInt32Number m_nSize
Definition IccTagBasic.h:934

References icMatrixDump(), icSigS15Fixed16ArrayType, CIccTagFixedNum< T, Tsig >::m_nSize, and CIccTagFixedNum< T, Tsig >::m_Num.

+ Here is the call graph for this function:

◆ DetachIO()

virtual void CIccTag::DetachIO ( )
inlinevirtualinherited

Function: ReadAll() - Read All sub data for tag from file. Called by CIccProfile::ReadAll() to read all sub data for tag

Returns true if ReadAll is successful.

183{}

◆ GetClassName()

template<class T , icTagTypeSignature Tsig>
const icChar * CIccTagXmlFixedNum< T, Tsig >::GetClassName ( ) const
virtual

Name: CIccTagFixedNum::GetClassName

Purpose: Returns the tag type class name

Reimplemented from CIccTagFixedNum< T, Tsig >.

1209{
1210 if (Tsig==icSigS15Fixed16ArrayType)
1211 return "CIccTagXmlS15Fixed16";
1212 else
1213 return "CIccTagXmlU16Fixed16";
1214}

References icSigS15Fixed16ArrayType.

◆ GetExtClassName()

virtual const char * CIccTagXml::GetExtClassName ( ) const
inlinevirtualinherited

Implements IIccExtensionTag.

79{ return "CIccTagXml"; }

Referenced by icProfDescToXml(), and icXmlParseProfDesc().

+ Here is the caller graph for this function:

◆ GetExtDerivedClassName()

virtual const char * CIccTagXml::GetExtDerivedClassName ( ) const
inlinevirtualinherited

Implements IIccExtensionTag.

Reimplemented in CIccCurveXml.

80{ return ""; }

◆ GetExtension()

template<class T , icTagTypeSignature Tsig>
virtual IIccExtensionTag * CIccTagXmlFixedNum< T, Tsig >::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

290{return this; }

◆ GetNumValues()

template<class T , icTagTypeSignature Tsig>
virtual icUInt32Number CIccTagFixedNum< T, Tsig >::GetNumValues ( ) const
inlinevirtualinherited

Implements CIccTagNumArray.

924{ return GetSize(); }
icUInt32Number GetSize() const
Returns the size of the data array.
Definition IccTagBasic.h:918

References CIccTagFixedNum< T, Tsig >::GetSize().

+ Here is the call graph for this function:

◆ GetSize()

template<class T , icTagTypeSignature Tsig>
icUInt32Number CIccTagFixedNum< T, Tsig >::GetSize ( ) const
inlineinherited

Returns the size of the data array.

918{ return m_nSize; }

References CIccTagFixedNum< T, Tsig >::m_nSize.

Referenced by CIccTagFixedNum< T, Tsig >::GetNumValues().

+ Here is the caller graph for this function:

◆ GetTagArrayType()

virtual icArraySignature CIccTag::GetTagArrayType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagArray.

133{ return icSigUndefinedArray; }
@ icSigUndefinedArray
Definition icProfileHeader.h:617

References icSigUndefinedArray.

Referenced by icGetTagArrayHandlerOfType(), and CIccProfileXml::ParseTag().

+ Here is the caller graph for this function:

◆ GetTagStructType()

virtual icStructSignature CIccTag::GetTagStructType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagStruct.

132{ return icSigUndefinedStruct; }
@ icSigUndefinedStruct
Definition icProfileHeader.h:606

References icSigUndefinedStruct.

Referenced by icGetTagStructHandlerOfType(), CIccArrayColorantInfo::Validate(), and CIccArrayNamedColor::Validate().

+ Here is the caller graph for this function:

◆ GetType()

template<class T , icTagTypeSignature Tsig>
virtual icTagTypeSignature CIccTagFixedNum< T, Tsig >::GetType ( ) const
inlinevirtualinherited

Function: GetType()

Purpose: Get Tag Type. Each derived tag will implement it's own GetType() function.

Reimplemented from CIccTag.

907{ return Tsig; }

Referenced by CIccTagFixedNum< T, Tsig >::Write().

+ Here is the caller graph for this function:

◆ GetValues()

template<class T , icTagTypeSignature Tsig>
bool CIccTagFixedNum< T, Tsig >::GetValues ( icFloatNumber DstVector,
icUInt32Number  nStart = 0,
icUInt32Number  nVectorSize = 1 
) const
virtualinherited

Name: CIccTagFixedNum::GetValues

Purpose: Gets values from the num array tag as floating point numbers

Args: nSize - number of data entries, bZeroNew - flag to zero newly formed values

Implements CIccTagNumArray.

5397{
5398 if (nVectorSize+nStart >m_nSize)
5399 return false;
5400
5402
5403 switch (Tsig) {
5405 for (i=0; i<m_nSize; i++) {
5406 DstVector[i] = (icFloatNumber)icFtoD(m_Num[i+nStart]);
5407 }
5408 break;
5410 for (i=0; i<m_nSize; i++) {
5411 DstVector[i] = (icFloatNumber)icUFtoD(m_Num[i+nStart]);
5412 }
5413 break;
5414 default:
5415 return false;
5416 }
5417 return true;
5418}
@ icSigU16Fixed16ArrayType
Definition icProfileHeader.h:567
float icFloatNumber
Definition IccDefs.h:101

References icSigS15Fixed16ArrayType, icSigU16Fixed16ArrayType, CIccTagFixedNum< T, Tsig >::m_nSize, and CIccTagFixedNum< T, Tsig >::m_Num.

◆ Interpolate()

template<class T , icTagTypeSignature Tsig>
bool CIccTagFixedNum< T, Tsig >::Interpolate ( icFloatNumber DstVector,
icFloatNumber  pos,
icUInt32Number  nVectorSize = 1,
icFloatNumber zeroVals = NULL 
) const
virtualinherited

Name: CIccTagFixedNum::Interpolate

Purpose: Gets values from the num array tag as floating point numbers

Args: nSize - number of data entries, bZeroNew - flag to zero newly formed values

Implements CIccTagNumArray.

5435{
5436 icUInt32Number nVector = m_nSize / nVectorSize;
5437
5438 if (!nVector)
5439 return false;
5440
5441 if (zeroVals)
5442 nVector ++;
5443 else if (nVector<=1)
5444 return false;
5445
5446 if (pos<0.0)
5447 pos=0.0;
5448 if (pos>1.0)
5449 pos=1.0;
5450
5451 icFloatNumber fpos = (icFloatNumber)(nVector-1) * pos;
5452 icUInt32Number iPos = (icUInt32Number)fpos;
5453 icFloatNumber x = fpos - iPos;
5454
5455 if (iPos == nVector-1) {
5456 iPos--;
5457 x = (icFloatNumber)1.0;
5458 }
5459
5460 T *lo, *hi;
5461
5462 if (zeroVals) {
5463 if (!iPos) {
5464 lo = NULL;
5465 hi = m_Num;
5466 }
5467 else {
5468 lo = &m_Num[(iPos-1)*nVectorSize];
5469 hi = &lo[nVectorSize];
5470 }
5471 }
5472 else {
5473 lo = &m_Num[iPos*nVectorSize];
5474 hi = &lo[nVectorSize];
5475 }
5476
5478
5479 switch (Tsig) {
5481 if (!lo) {
5482 if (zeroVals) {
5483 for (i = 0; i < m_nSize; i++) {
5484 DstVector[i] = (icFloatNumber)(zeroVals[i] * (1.0f - x) + icFtoD(hi[i]) * x);
5485 }
5486 }
5487 else {
5488 for (i = 0; i < m_nSize; i++) {
5489 DstVector[i] = (icFloatNumber)(icFtoD(hi[i]) * x);
5490 }
5491 }
5492 }
5493 else {
5494 for (i=0; i<m_nSize; i++) {
5495 DstVector[i] = (icFloatNumber)(icFtoD(lo[i])*(1.0-x) + icFtoD(hi[i])*x);
5496 }
5497 }
5498 break;
5500 if (!lo) {
5501 if (zeroVals) {
5502 for (i = 0; i < m_nSize; i++) {
5503 DstVector[i] = (icFloatNumber)(zeroVals[i] * (1.0 - x) + icUFtoD(hi[i]) * x);
5504 }
5505 }
5506 else {
5507 for (i = 0; i < m_nSize; i++) {
5508 DstVector[i] = (icFloatNumber)(icUFtoD(hi[i]) * x);
5509 }
5510 }
5511 }
5512 else {
5513 for (i=0; i<m_nSize; i++) {
5514 DstVector[i] = (icFloatNumber)(icUFtoD(lo[i])*(1.0-x) + icUFtoD(hi[i])*x);
5515 }
5516 }
5517 break;
5518 default:
5519 return false;
5520 }
5521 return true;
5522}

References icSigS15Fixed16ArrayType, icSigU16Fixed16ArrayType, CIccTagFixedNum< T, Tsig >::m_nSize, and CIccTagFixedNum< T, Tsig >::m_Num.

◆ IsArrayType()

template<class T , icTagTypeSignature Tsig>
virtual bool CIccTagFixedNum< T, Tsig >::IsArrayType ( )
inlinevirtualinherited

Reimplemented from CIccTag.

905{ return m_nSize > 1; }

References CIccTagFixedNum< T, Tsig >::m_nSize.

◆ IsMatrixArray()

template<class T , icTagTypeSignature Tsig>
virtual bool CIccTagFixedNum< T, Tsig >::IsMatrixArray ( ) const
inlinevirtualinherited

Implements CIccTagNumArray.

930{ return false; }

◆ IsMBBType()

virtual bool CIccTag::IsMBBType ( )
inlinevirtualinherited

Reimplemented in CIccMBB.

136{ return false; } //If true then CIccTag can be cast as an CIccMBB

Referenced by CIccProfileXml::ParseTag().

+ Here is the caller graph for this function:

◆ IsNumArrayType()

template<class T , icTagTypeSignature Tsig>
virtual bool CIccTagFixedNum< T, Tsig >::IsNumArrayType ( ) const
inlinevirtualinherited

Reimplemented from CIccTag.

921{ return true; }

◆ IsSupported()

virtual bool CIccTag::IsSupported ( )
inlinevirtualinherited

Function: IsSupported(size, pIO) - Check if tag fully supported for apply purposes. By Default inherited classes are supported. Unknown tag types are not supported.

Returns true if tag type is supported.

Reimplemented in CIccTagUnknown, CIccTagEmbeddedProfile, and CIccTagMultiProcessElement.

153{ return true; }

◆ NewCopy()

template<class T , icTagTypeSignature Tsig>
virtual CIccTag * CIccTagFixedNum< T, Tsig >::NewCopy ( ) const
inlinevirtualinherited

Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.

Parameter(s): none

Returns a new CIccTag object that is a copy of this object.

Reimplemented from CIccTag.

902{ return new CIccTagFixedNum<T, Tsig>(*this); }
Definition IccTagBasic.h:897

◆ operator[]()

template<class T , icTagTypeSignature Tsig>
T & CIccTagFixedNum< T, Tsig >::operator[] ( icUInt32Number  index)
inlineinherited
915{return m_Num[index];}

References CIccTagFixedNum< T, Tsig >::m_Num.

Referenced by main().

+ Here is the caller graph for this function:

◆ ParseXml()

template<class T , icTagTypeSignature Tsig>
bool CIccTagXmlFixedNum< T, Tsig >::ParseXml ( xmlNode *  pNode,
std::string &  parseStr 
)
virtual

Implements CIccTagXml.

1271{
1272 pNode = icXmlFindNode(pNode, "Array");
1273 pNode = pNode->children;
1274
1276
1277 if (!a.ParseArray(pNode) || !a.GetSize()) {
1278 return false;
1279 }
1280
1281 icUInt32Number i, n = a.GetSize();
1282 icFloatNumber *buf = a.GetBuf();
1283
1284 this->SetSize(n);
1285
1286 for (i=0; i<n; i++) {
1287 if (Tsig==icSigS15Fixed16ArrayType) {
1288 this->m_Num[i] = icDtoF(buf[i]);
1289 }
1290 else {
1291 this->m_Num[i] = icDtoUF(buf[i]);
1292 }
1293 }
1294 return true;
1295}
ICCPROFLIB_API icS15Fixed16Number icDtoF(icFloatNumber num)
Definition IccUtil.cpp:545
ICCPROFLIB_API icU16Fixed16Number icDtoUF(icFloatNumber num)
Definition IccUtil.cpp:566
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
Definition IccUtilXml.cpp:687
bool SetSize(icUInt32Number nSize, bool bZeroNew=true)
Definition IccTagBasic.cpp:5364
Definition IccUtilXml.h:145
static bool ParseArray(T *buf, icUInt32Number nBufSize, xmlNode *pNode)
Definition IccUtilXml.cpp:1034
T * GetBuf()
Definition IccUtilXml.h:165
icUInt32Number GetSize()
Definition IccUtilXml.h:166

References CIccXmlArrayType< T, Tsig >::GetBuf(), CIccXmlArrayType< T, Tsig >::GetSize(), icDtoF(), icDtoUF(), icSigS15Fixed16ArrayType, icXmlFindNode(), and CIccXmlArrayType< T, Tsig >::ParseArray().

+ Here is the call graph for this function:

◆ Read() [1/2]

template<class T , icTagTypeSignature Tsig>
bool CIccTagFixedNum< T, Tsig >::Read ( icUInt32Number  size,
CIccIO pIO 
)
virtualinherited

Name: CIccTagFixedNum::Read

Purpose: Read in the tag contents into a data block

Args: size - # of bytes in tag, pIO - IO object to read tag from

Return: true = successful, false = failure

Reimplemented from CIccTag.

5246{
5248
5249 if (sizeof(icTagTypeSignature) +
5250 sizeof(icUInt32Number) +
5251 sizeof(T) > size)
5252 return false;
5253
5254 if (!pIO) {
5255 return false;
5256 }
5257
5258 if (!pIO->Read32(&sig))
5259 return false;
5260
5261 if (!pIO->Read32(&m_nReserved))
5262 return false;
5263
5264 icUInt32Number nSize=((size-2*sizeof(icUInt32Number)) / sizeof(T));
5265
5266 if (!SetSize(nSize))
5267 return false;
5268
5269 if (pIO->Read32(m_Num, nSize) != (icInt32Number)nSize )
5270 return false;
5271
5272 return true;
5273}
long icInt32Number
Definition icProfileHeader.h:291
icTagTypeSignature
Definition icProfileHeader.h:526
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
icUInt32Number m_nReserved
Definition IccTagBasic.h:235

References CIccTag::m_nReserved, CIccTagFixedNum< T, Tsig >::m_Num, CIccIO::Read32(), and CIccTagFixedNum< T, Tsig >::SetSize().

+ Here is the call graph for this function:

◆ Read() [2/2]

virtual bool CIccTag::Read ( icUInt32Number  size,
CIccIO pIO,
CIccProfile pProfile 
)
inlinevirtualinherited

Function: Read(size, pIO) - Read tag from file. Each derived tag will implement it's own Read() function.

Parameter(s): size - number of bytes in tag including the type signature. pIO - IO object used to read in tag. The IO object should already be initialized to point to the begining of the tag.

Returns true if Read is successful.

Reimplemented in CIccTagEmbeddedProfile.

197{ return Read(size, pIO); }
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Definition IccTagBasic.h:167

References CIccTag::Read().

+ Here is the call graph for this function:

◆ ReadAll()

virtual bool CIccTag::ReadAll ( )
inlinevirtualinherited

Function: ReadAll() - Read All sub data for tag from file. Called by CIccProfile::ReadAll() to read all sub data for tag

Returns true if ReadAll is successful.

Reimplemented in CIccTagEmbeddedProfile.

175{ return true; }

◆ SetSize()

template<class T , icTagTypeSignature Tsig>
bool CIccTagFixedNum< T, Tsig >::SetSize ( icUInt32Number  nSize,
bool  bZeroNew = true 
)
inherited

Name: CIccTagFixedNum::SetSize

Purpose: Sets the size of the data array.

Args: nSize - number of data entries, bZeroNew - flag to zero newly formed values

5365{
5366 if (nSize==m_nSize)
5367 return true;
5368
5369 m_Num = (T*)icRealloc(m_Num, nSize*sizeof(T));
5370
5371 if (!m_Num) {
5372 m_nSize = 0;
5373 return false;
5374 }
5375
5376 if (bZeroNew && m_nSize < nSize) {
5377 memset(&m_Num[m_nSize], 0, (nSize-m_nSize)*sizeof(T));
5378 }
5379 m_nSize = nSize;
5380
5381 return true;
5382}
ICCPROFLIB_API void * icRealloc(void *ptr, size_t size)
Definition IccUtil.cpp:111

References CIccTagFixedNum< T, Tsig >::m_nSize, and CIccTagFixedNum< T, Tsig >::m_Num.

Referenced by CIccTagFixedNum< T, Tsig >::Read().

+ Here is the caller graph for this function:

◆ ToXml()

template<class T , icTagTypeSignature Tsig>
bool CIccTagXmlFixedNum< T, Tsig >::ToXml ( std::string &  xml,
std::string  blanks = "" 
)
virtual

Implements CIccTagXml.

1220{
1221 char buf[256];
1222 int i;
1223
1224 if (Tsig==icSigS15Fixed16ArrayType) {
1225 int n = 8;
1226 xml += blanks + "<Array>\n";
1227 for (i=0; i<(int)this->m_nSize; i++) {
1228 if (!(i%n)) {
1229 if (i)
1230 xml += "\n";
1231 xml += blanks + blanks;
1232 }
1233 else {
1234 xml += " ";
1235 }
1236 sprintf(buf, icXmlFloatFmt, (float)icFtoD(this->m_Num[i]));
1237 xml += buf;
1238 }
1239
1240 if ((i%n)!=1) {
1241 xml += "\n";
1242 }
1243 }
1244 else {
1245 for (i=0; i<(int)this->m_nSize; i++) {
1246
1247 if (!(i%8)) {
1248 if (i)
1249 xml += "\n";
1250 xml += blanks + blanks;
1251 }
1252 else {
1253 xml += " ";
1254 }
1255 sprintf(buf, icXmlFloatFmt, (float)icUFtoD(this->m_Num[i]));
1256 xml += buf;
1257 }
1258
1259 if ((i%8)!=1) {
1260 xml += "\n";
1261 }
1262 }
1263 xml += blanks + "</Array>\n";
1264 return true;
1265}
#define icXmlFloatFmt
Definition IccXmlConfig.h:75

References icSigS15Fixed16ArrayType.

◆ Validate()

icValidateStatus CIccTag::Validate ( std::string  sigPath,
std::string &  sReport,
const CIccProfile pProfile = NULL 
) const
virtualinherited

Function: Validate Each derived tag will implement it's own IsValid() function

Parameter(s): sig - signature of tag being validated, sDescription - A string to put tag validation report.

Name: CIccTag::Validate

Purpose: Check tag data validity. In base class we only look at the tag's reserved data value

Args: sig = signature of tag being validated, sReport = String to add report information to

Return: icValidateStatusOK if valid, or other error status.

Reimplemented in CIccTagGamutBoundaryDesc, CIccTagText, CIccTagUtf8Text, CIccTagZipUtf8Text, CIccTagUtf16Text, CIccTagTextDescription, CIccTagSignature, CIccTagNamedColor2, CIccTagXYZ, CIccTagChromaticity, CIccTagCicp, CIccTagSparseMatrixArray, CIccTagNum< T, Tsig >, CIccTagFloatNum< T, Tsig >, CIccTagMeasurement, CIccTagMultiLocalizedUnicode, CIccTagData, CIccTagDateTime, CIccTagColorantOrder, CIccTagColorantTable, CIccTagViewingConditions, CIccTagProfileSeqDesc, CIccTagResponseCurveSet16, CIccTagSpectralDataInfo, CIccTagSpectralViewingConditions, CIccTagEmbeddedHeightImage, CIccTagEmbeddedNormalImage, CIccTagStruct, CIccTagArray, CIccTagDict, CIccTagEmbeddedProfile, CIccTagCurve, CIccTagParametricCurve, CIccTagSegmentedCurve, CIccTagMultiProcessElement, and CIccTagProfileSequenceId.

165{
167
168 if (m_nReserved != 0) {
169 CIccInfo Info;
170 sReport += icMsgValidateNonCompliant;
171 sReport += Info.GetSigPathName(sigPath);
172 sReport += " - Reserved Value must be zero.\n";
173
175 }
176
177 return rv;
178}
icValidateStatus
Definition IccDefs.h:119
@ icValidateOK
Definition IccDefs.h:120
@ icValidateNonCompliant
Definition IccDefs.h:122
ICCPROFLIB_API const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614

References CIccInfo::GetSigPathName(), icMsgValidateNonCompliant, icValidateNonCompliant, icValidateOK, and CIccTag::m_nReserved.

Referenced by CIccTagGamutBoundaryDesc::Validate(), CIccMBB::Validate(), CIccTagLutAtoB::Validate(), CIccTagLutBtoA::Validate(), CIccTagLut8::Validate(), CIccTagLut16::Validate(), CIccArrayUnknown::Validate(), CIccArrayColorantInfo::Validate(), CIccArrayNamedColor::Validate(), CIccStructUnknown::Validate(), CIccTagText::Validate(), CIccTagUtf8Text::Validate(), CIccTagZipUtf8Text::Validate(), CIccTagUtf16Text::Validate(), CIccTagTextDescription::Validate(), CIccTagSignature::Validate(), CIccTagNamedColor2::Validate(), CIccTagXYZ::Validate(), CIccTagChromaticity::Validate(), CIccTagCicp::Validate(), CIccTagNum< T, Tsig >::Validate(), CIccTagFloatNum< T, Tsig >::Validate(), CIccTagMeasurement::Validate(), CIccTagMultiLocalizedUnicode::Validate(), CIccTagData::Validate(), CIccTagDateTime::Validate(), CIccTagColorantOrder::Validate(), CIccTagColorantTable::Validate(), CIccTagViewingConditions::Validate(), CIccTagProfileSeqDesc::Validate(), CIccTagResponseCurveSet16::Validate(), CIccTagSpectralDataInfo::Validate(), CIccTagSpectralViewingConditions::Validate(), CIccTagEmbeddedHeightImage::Validate(), CIccTagEmbeddedNormalImage::Validate(), CIccTagStruct::Validate(), CIccTagArray::Validate(), CIccTagDict::Validate(), CIccTagEmbeddedProfile::Validate(), CIccTagCurve::Validate(), CIccTagParametricCurve::Validate(), and CIccTagProfileSequenceId::Validate().

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

◆ ValuePos()

template<class T , icTagTypeSignature Tsig>
bool CIccTagFixedNum< T, Tsig >::ValuePos ( icFloatNumber DstPos,
icFloatNumber  val,
bool &  bNoZero 
) const
virtualinherited

Name: CIccTagFixedNum::ValuePos

Purpose: Gets position of a value int the num array tag

Args: DstPos - position of val in array val - value to look for in array. bNoZero - flag indicating whether first entry is zero

Implements CIccTagNumArray.

5538{
5539 if(val<0.0)
5540 return false;
5541
5542 icFloatNumber nv = 0.0;
5543 icFloatNumber lv = 0.0;
5544 switch (Tsig) {
5546 lv = icFtoD(m_Num[0]);
5547 break;
5549 lv = icUFtoD(m_Num[0]);
5550 break;
5551 default:
5552 return false;
5553 }
5554 bNoZero = (lv!=0.0);
5555
5556 if (val<lv) {
5557 DstPos = val/lv - 1.0f;
5558 return true;
5559 }
5560
5562 for (i=1; i<m_nSize; i++, lv=nv) {
5563 switch (Tsig) {
5565 nv = icFtoD(m_Num[i]);
5566 break;
5568 nv = icUFtoD(m_Num[i]);
5569 break;
5570 default:
5571 return false;
5572 }
5573 if (val<=nv) {
5574 DstPos = (val-lv)/(nv-lv) + i - 1.0f;
5575 return true;
5576 }
5577 }
5578
5579 return false;
5580}

References icSigS15Fixed16ArrayType, icSigU16Fixed16ArrayType, CIccTagFixedNum< T, Tsig >::m_nSize, and CIccTagFixedNum< T, Tsig >::m_Num.

◆ Write()

template<class T , icTagTypeSignature Tsig>
bool CIccTagFixedNum< T, Tsig >::Write ( CIccIO pIO)
virtualinherited

Name: CIccTagFixedNum::Write

Purpose: Write the tag to a file

Args: pIO - The IO object to write tag to.

Return: true = succesful, false = failure

Reimplemented from CIccTag.

5291{
5293
5294 if (!pIO)
5295 return false;
5296
5297 if (!pIO->Write32(&sig))
5298 return false;
5299
5300 if (!pIO->Write32(&m_nReserved))
5301 return false;
5302
5303 if (pIO->Write32(m_Num, m_nSize) != (icInt32Number)m_nSize)
5304 return false;
5305
5306 return true;
5307}
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
virtual icTagTypeSignature GetType() const
Definition IccTagBasic.h:907

References CIccTagFixedNum< T, Tsig >::GetType(), CIccTag::m_nReserved, CIccTagFixedNum< T, Tsig >::m_nSize, CIccTagFixedNum< T, Tsig >::m_Num, and CIccIO::Write32().

+ Here is the call graph for this function:

Field Documentation

◆ m_nReserved

icUInt32Number CIccTag::m_nReserved
inherited

Referenced by CIccTag::CIccTag(), CIccTagMultiProcessElement::CIccTagMultiProcessElement(), CIccTagMultiProcessElement::CIccTagMultiProcessElement(), CIccTagMultiProcessElement::operator=(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), 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(), CIccTagProfileSeqDesc::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(), CIccTag::Validate(), 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(), 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(), CIccTagMultiProcessElement::Write(), and CIccTagProfileSequenceId::Write().

◆ m_nSize

◆ m_Num


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