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

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlColorantOrder:
+ Collaboration diagram for CIccTagXmlColorantOrder:

Public Member Functions

virtual ~CIccTagXmlColorantOrder ()
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual void DetachIO ()
 
virtual const char * GetClassName () const
 
icUInt8NumberGetData (int index)
 
virtual const char * GetExtClassName () const
 
virtual const char * GetExtDerivedClassName () const
 
virtual IIccExtensionTagGetExtension ()
 
icUInt32Number GetSize () const
 
virtual icArraySignature GetTagArrayType () const
 
virtual icStructSignature GetTagStructType () const
 
virtual icTagTypeSignature GetType () const
 
virtual bool IsArrayType ()
 
virtual bool IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool IsSupported ()
 
virtual CIccTagNewCopy () const
 
icUInt8Numberoperator[] (int 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 (icUInt16Number 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 Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccTagCreate (icTagTypeSignature sig)
 

Data Fields

icUInt32Number m_nReserved
 

Protected Attributes

icUInt32Number m_nCount
 
icUInt8Numberm_pData
 

Detailed Description

Constructor & Destructor Documentation

◆ ~CIccTagXmlColorantOrder()

virtual CIccTagXmlColorantOrder::~CIccTagXmlColorantOrder ( )
inlinevirtual
399{}

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()

void CIccTagColorantOrder::Describe ( std::string &  sDescription,
int  nVerboseness 
)
virtualinherited

Name: CIccTagColorantOrder::Describe

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

Reimplemented from CIccTag.

8500{
8501 icChar buf[128];
8502
8503 sprintf(buf, "Colorant Count : %u\n", m_nCount);
8504 sDescription += buf;
8505 sDescription += "Order of Colorants:\n";
8506
8507 for (int i=0; i<(int)m_nCount; i++) {
8508 sprintf(buf, "%u\n", m_pData[i]);
8509 sDescription += buf;
8510 }
8511}
char icChar
Definition IccDefs.h:110
icUInt32Number m_nCount
Definition IccTagBasic.h:1375
icUInt8Number * m_pData
Definition IccTagBasic.h:1376

References CIccTagColorantOrder::m_nCount, and CIccTagColorantOrder::m_pData.

◆ 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()

virtual const char * CIccTagXmlColorantOrder::GetClassName ( ) const
inlinevirtual

Reimplemented from CIccTagColorantOrder.

401{return "CIccTagXmlColorantOrder"; }

◆ GetData()

icUInt8Number * CIccTagColorantOrder::GetData ( int  index)
inlineinherited
1369{ return &m_pData[index]; }

References CIccTagColorantOrder::m_pData.

◆ 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()

virtual IIccExtensionTag * CIccTagXmlColorantOrder::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

403{return this; }

◆ GetSize()

icUInt32Number CIccTagColorantOrder::GetSize ( ) const
inlineinherited
1371{return m_nCount;}

References CIccTagColorantOrder::m_nCount.

◆ 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()

virtual icTagTypeSignature CIccTagColorantOrder::GetType ( ) const
inlinevirtualinherited

Function: GetType()

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

Reimplemented from CIccTag.

1361{ return icSigColorantOrderType; }
@ icSigColorantOrderType
Definition icProfileHeader.h:530

References icSigColorantOrderType.

Referenced by CIccTagColorantOrder::Write().

+ Here is the caller graph for this function:

◆ IsArrayType()

virtual bool CIccTag::IsArrayType ( )
inlinevirtualinherited

Reimplemented in CIccTagXYZ, CIccTagChromaticity, CIccTagSparseMatrixArray, CIccTagFixedNum< T, Tsig >, CIccTagNum< T, Tsig >, CIccTagFloatNum< T, Tsig >, and CIccTagData.

135{ return false; }

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

+ Here is the caller graph for this function:

◆ 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()

virtual bool CIccTag::IsNumArrayType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagSparseMatrixArray, CIccTagFixedNum< T, Tsig >, CIccTagNum< T, Tsig >, and CIccTagFloatNum< T, Tsig >.

137{ return false;} //If true then CIccTag can be cast as a CIccTagNumArray

Referenced by CIccArrayNamedColor::FindDeviceColor(), CIccArrayNamedColor::FindPcsColor(), CIccArrayNamedColor::FindSpectralColor(), CIccTagStruct::GetElemNumberValue(), CIccStructNamedColor::GetNumArray(), CIccMpeXmlTintArray::ParseXml(), and CIccMpeTintArray::Read().

+ Here is the caller graph for this function:

◆ 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()

virtual CIccTag * CIccTagColorantOrder::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.

1358{return new CIccTagColorantOrder(*this);}
Definition IccTagBasic.h:1353

References CIccTagColorantOrder::CIccTagColorantOrder().

+ Here is the call graph for this function:

◆ operator[]()

icUInt8Number & CIccTagColorantOrder::operator[] ( int  index)
inlineinherited
1368{ return m_pData[index]; }

References CIccTagColorantOrder::m_pData.

◆ ParseXml()

bool CIccTagXmlColorantOrder::ParseXml ( xmlNode *  pNode,
std::string &  parseStr 
)
virtual

Implements CIccTagXml.

1790{
1791 pNode = icXmlFindNode(pNode, "ColorantOrder");
1792
1793 if (pNode) {
1794 int n = icXmlNodeCount(pNode->children, "n");
1795
1796 if (n) {
1797 SetSize(n);
1798
1799 if (m_pData) {
1800 if (CIccUInt8Array::ParseArray(m_pData, n, pNode->children))
1801 return true;
1802 }
1803 }
1804 }
1805 return false;
1806}
icUInt32Number icXmlNodeCount(xmlNode *pNode, const char *szNodeName)
Definition IccUtilXml.cpp:703
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
Definition IccUtilXml.cpp:687
bool SetSize(icUInt16Number nsize, bool bZeronew=true)
Definition IccTagBasic.cpp:8525
static bool ParseArray(T *buf, icUInt32Number nBufSize, xmlNode *pNode)
Definition IccUtilXml.cpp:1034

References icXmlFindNode(), icXmlNodeCount(), CIccTagColorantOrder::m_pData, CIccXmlArrayType< T, Tsig >::ParseArray(), and CIccTagColorantOrder::SetSize().

+ Here is the call graph for this function:

◆ Read() [1/2]

bool CIccTagColorantOrder::Read ( icUInt32Number  size,
CIccIO pIO 
)
virtualinherited

Name: CIccTagColorantOrder::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.

8414{
8416 icUInt32Number nCount;
8417
8418 if (sizeof(icTagTypeSignature) +
8419 sizeof(icUInt32Number) +
8420 sizeof(icUInt32Number) > size)
8421 return false;
8422
8423 if (!pIO) {
8424 return false;
8425 }
8426
8427 if (!pIO->Read32(&sig))
8428 return false;
8429
8430 if (!pIO->Read32(&m_nReserved))
8431 return false;
8432
8433 if (!pIO->Read32(&nCount))
8434 return false;
8435
8436 icUInt32Number nNum = (size - 3*sizeof(icUInt32Number))/sizeof(icUInt8Number);
8437
8438 if (nNum < nCount)
8439 return false;
8440
8441 if (!SetSize((icUInt16Number)nCount))
8442 return false;
8443
8444 if (pIO->Read8(&m_pData[0], m_nCount) != (icInt32Number)m_nCount)
8445 return false;
8446
8447 return true;
8448}
unsigned char icUInt8Number
Definition icProfileHeader.h:250
unsigned short icUInt16Number
Definition icProfileHeader.h:256
long icInt32Number
Definition icProfileHeader.h:291
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icTagTypeSignature
Definition icProfileHeader.h:526
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
icUInt32Number m_nReserved
Definition IccTagBasic.h:235

References CIccTagColorantOrder::m_nCount, CIccTag::m_nReserved, CIccTagColorantOrder::m_pData, CIccIO::Read32(), CIccIO::Read8(), and CIccTagColorantOrder::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()

bool CIccTagColorantOrder::SetSize ( icUInt16Number  nSize,
bool  bZeroNew = true 
)
inherited

Name: CIccTagColorantOrder::SetSize

Purpose: Sets the size of the data array.

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

8526{
8527 if (m_nCount == nSize)
8528 return true;
8529
8531
8532 if (!m_pData) {
8533 m_nCount = 0;
8534 return false;
8535 }
8536
8537 if (bZeroNew && nSize > m_nCount) {
8538 memset(&m_pData[m_nCount], 0, (nSize - m_nCount)*sizeof(icUInt8Number));
8539 }
8540
8541 m_nCount = nSize;
8542
8543 return true;
8544}
ICCPROFLIB_API void * icRealloc(void *ptr, size_t size)
Definition IccUtil.cpp:111

References icRealloc(), CIccTagColorantOrder::m_nCount, and CIccTagColorantOrder::m_pData.

Referenced by ParseXml(), and CIccTagColorantOrder::Read().

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

◆ ToXml()

bool CIccTagXmlColorantOrder::ToXml ( std::string &  xml,
std::string  blanks = "" 
)
virtual

Implements CIccTagXml.

1774{
1775 char buf[40];
1776 int i;
1777
1778 xml += blanks + "<ColorantOrder>\n"; //+ blanks + " ";
1779 for (i=0; i<(int)m_nCount; i++) {
1780 sprintf(buf, " <n>%d</n>\n", m_pData[i]);
1781 xml += blanks + buf;
1782 }
1783
1784 xml += blanks + "</ColorantOrder>\n";
1785
1786 return true;
1787}

References CIccTagColorantOrder::m_nCount, and CIccTagColorantOrder::m_pData.

◆ Validate()

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

Name: CIccTagColorantOrder::Validate

Purpose: Check tag data validity.

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

Return: icValidateStatusOK if valid, or other error status.

Reimplemented from CIccTag.

8562{
8563 icValidateStatus rv = CIccTag::Validate(sigPath, sReport, pProfile);
8564
8565 CIccInfo Info;
8566 std::string sSigPathName = Info.GetSigPathName(sigPath);
8567
8568 if (!pProfile) {
8569 sReport += icMsgValidateWarning;
8570 sReport += sSigPathName;
8571 sReport += " - Tag validation incomplete: Pointer to profile unavailable.\n";
8573 return rv;
8574 }
8575
8576 if (sigPath==icGetSigPath(icSigColorantTableTag)) {
8577 if (m_nCount != icGetSpaceSamples(pProfile->m_Header.colorSpace)) {
8578 sReport += icMsgValidateNonCompliant;
8579 sReport += sSigPathName;
8580 sReport += " - Incorrect number of colorants.\n";
8582 }
8583 }
8584 else if (sigPath==icGetSigPath(icSigColorantTableOutTag)) {
8585 if (m_nCount != icGetSpaceSamples(pProfile->m_Header.pcs)) {
8586 sReport += icMsgValidateNonCompliant;
8587 sReport += sSigPathName;
8588 sReport += " - Incorrect number of colorants.\n";
8590 }
8591 }
8592 else {
8593 sReport += icMsgValidateWarning;
8594 sReport += sSigPathName;
8595 sReport += " - Unknown number of required colorants.\n";
8597 }
8598
8599 return rv;
8600}
@ icSigColorantTableTag
Definition icProfileHeader.h:389
@ icSigColorantTableOutTag
Definition icProfileHeader.h:390
icValidateStatus
Definition IccDefs.h:119
@ icValidateWarning
Definition IccDefs.h:121
@ icValidateNonCompliant
Definition IccDefs.h:122
ICCPROFLIB_API icUInt32Number icGetSpaceSamples(icColorSpaceSignature sig)
Definition IccUtil.cpp:1303
ICCPROFLIB_API std::string icGetSigPath(icUInt32Number sig)
Definition IccUtil.cpp:1191
ICCPROFLIB_API const char * icMsgValidateWarning
Definition IccUtil.cpp:90
ICCPROFLIB_API icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Definition IccUtil.cpp:244
ICCPROFLIB_API const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
Definition IccTagBasic.cpp:164

References icHeader::colorSpace, CIccInfo::GetSigPathName(), icGetSigPath(), icGetSpaceSamples(), icMaxStatus(), icMsgValidateNonCompliant, icMsgValidateWarning, icSigColorantTableOutTag, icSigColorantTableTag, icValidateNonCompliant, icValidateWarning, CIccTagColorantOrder::m_nCount, icHeader::pcs, and CIccTag::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccTagColorantOrder::Write ( CIccIO pIO)
virtualinherited

Name: CIccTagColorantOrder::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.

8466{
8468
8469 if (!pIO)
8470 return false;
8471
8472 if (!pIO->Write32(&sig))
8473 return false;
8474
8475 if (!pIO->Write32(&m_nReserved))
8476 return false;
8477
8478 if (!pIO->Write32(&m_nCount))
8479 return false;
8480
8481 if (pIO->Write8(&m_pData[0], m_nCount) != (icInt32Number)m_nCount)
8482 return false;
8483
8484 return true;
8485}
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
virtual icTagTypeSignature GetType() const
Definition IccTagBasic.h:1361

References CIccTagColorantOrder::GetType(), CIccTagColorantOrder::m_nCount, CIccTag::m_nReserved, CIccTagColorantOrder::m_pData, CIccIO::Write32(), and CIccIO::Write8().

+ Here is the call graph for this function:

Field Documentation

◆ m_nCount

◆ 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_pData


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