Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
CIccMpeXmlTintArray Class Reference

#include <IccMpeXml.h>

+ Inheritance diagram for CIccMpeXmlTintArray:
+ Collaboration diagram for CIccMpeXmlTintArray:

Public Member Functions

virtual const char * GetClassName () const
 
virtual IIccExtensionMpeGetExtension ()
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
virtual ~CIccMpeXmlTintArray ()
 
- Public Member Functions inherited from CIccMpeTintArray
virtual void Apply (CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const
 Name: CIccMpeTintArray::Apply.
 
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 Name: CIccMpeTintArray::Begin.
 
 CIccMpeTintArray (const CIccMpeTintArray &tintArray)
 Name: CIccMpeTintArray::CIccMpeTintArray.
 
 CIccMpeTintArray (int nVectorSize=1)
 Name: CIccMpeTintArray::CIccMpeTintArray.
 
virtual void Describe (std::string &sDescription, int nVerboseness=0)
 Name: CIccMpeTintArray::Describe.
 
CIccTagNumArrayGetArray ()
 
virtual icElemTypeSignature GetType () const
 
virtual CIccMultiProcessElementNewCopy () const
 
CIccMpeTintArrayoperator= (const CIccMpeTintArray &tintArray)
 Name: &CIccMpeTintArray::operator=.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccMpeTintArray::Read.
 
void SetArray (CIccTagNumArray *pTag)
 Name: CIccMpeTintArray::SetCurve.
 
void SetVectorSize (int nVectorSize)
 Name: CIccMpeTintArray::SetVectorSize.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 Name: CIccMpeTintArray::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccMpeTintArray::Write.
 
virtual ~CIccMpeTintArray ()
 Name: CIccMpeTintArray::~CIccMpeTintArray.
 
- Public Member Functions inherited from CIccMultiProcessElement
 CIccMultiProcessElement ()
 
virtual icAcsSignature GetBAcsSig ()
 
virtual icAcsSignature GetEAcsSig ()
 
virtual CIccApplyMpeGetNewApply (CIccApplyTagMpe *pApplyTag)
 Name: CIccMultiProcessElement::GetNewApply()
 
virtual bool IsAcs ()
 
virtual bool IsLateBinding () const
 
virtual bool IsLateBindingReflectance () const
 
virtual bool IsSupported ()
 
virtual icUInt16Number NumInputChannels () const
 
virtual icUInt16Number NumOutputChannels () const
 
virtual ~CIccMultiProcessElement ()
 
- Public Member Functions inherited from CIccMpeXml
virtual const char * GetExtClassName ()
 
virtual ~CIccMpeXml (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from CIccMultiProcessElement
static CIccMultiProcessElementCreate (icElemTypeSignature sig)
 Name: CIccMultiProcessElement::Create.
 
- Public Attributes inherited from CIccMultiProcessElement
icUInt32Number m_nReserved
 
- Protected Attributes inherited from CIccMpeTintArray
CIccTagNumArraym_Array
 
- Protected Attributes inherited from CIccMultiProcessElement
icUInt16Number m_nInputChannels
 
icUInt16Number m_nOutputChannels
 

Detailed Description

Definition at line 125 of file IccMpeXml.h.

Constructor & Destructor Documentation

◆ ~CIccMpeXmlTintArray()

virtual CIccMpeXmlTintArray::~CIccMpeXmlTintArray ( )
inlinevirtual

Definition at line 128 of file IccMpeXml.h.

128{}

Member Function Documentation

◆ GetClassName()

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

Reimplemented from CIccMpeTintArray.

Definition at line 130 of file IccMpeXml.h.

130{ return "CIccMpeXmlTintArray"; }

◆ GetExtension()

virtual IIccExtensionMpe * CIccMpeXmlTintArray::GetExtension ( )
inlinevirtual

Reimplemented from CIccMultiProcessElement.

Definition at line 132 of file IccMpeXml.h.

132{ return this; }

◆ ParseXml()

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

Implements CIccMpeXml.

Definition at line 1564 of file IccMpeXml.cpp.

1565{
1566 icUInt16Number nInputChannels = atoi(icXmlAttrValue(pNode, "InputChannels"));
1567 icUInt16Number nOutputChannels = atoi(icXmlAttrValue(pNode, "OutputChannels"));
1568 if (!nInputChannels || !nOutputChannels) {
1569 parseStr += "Invalid InputChannels or OutputChannels In TintArrayElement\n";
1570 return false;
1571 }
1572 m_nInputChannels = nInputChannels;
1573 m_nOutputChannels = nOutputChannels;
1574
1575 for (pNode = pNode->children; pNode && pNode->type != XML_ELEMENT_NODE; pNode = pNode->next);
1576 if (pNode) {
1577 CIccTag *pTag = NULL;
1578 icSignature sigTag = (icSignature)0;
1579
1580 // get the tag signature
1581 std::string nodeName = (icChar*) pNode->name;
1582 icTagTypeSignature sigType = icGetTypeNameTagSig (nodeName.c_str());
1583
1584 if (sigType==icSigUnknownType){
1585 xmlAttr *attr = icXmlFindAttr(pNode, "type");
1587 }
1588
1589 CIccInfo info;
1590
1591 // create a tag based on the signature
1592 pTag = CIccTag::Create(sigType);
1593
1594 if (!pTag && !pTag->IsNumArrayType()) {
1595 parseStr+= "Invalid data type for Tint Array!\n";
1596 delete pTag;
1597 return false;
1598 }
1599
1600 IIccExtensionTag *pExt;
1601
1602 if (pTag && (pExt = pTag->GetExtension()) && !strcmp(pExt->GetExtClassName(), "CIccTagXml")) {
1603 CIccTagXml* pXmlTag = (CIccTagXml*)pExt;
1604 xmlAttr *attr;
1605
1606 if (pXmlTag->ParseXml(pNode->children, parseStr)) {
1607 if ((attr=icXmlFindAttr(pNode, "reserved"))) {
1608 sscanf(icXmlAttrValue(attr), "%u", &pTag->m_nReserved);
1609 }
1610 m_Array = (CIccTagNumArray*)pTag;
1611 }
1612 else {
1613 parseStr += "Unable to Parse \"";
1614 parseStr += info.GetTagTypeSigName(sigType);
1615 parseStr += "\" (";
1616 parseStr += nodeName;
1617 parseStr += ") Tint Tag\n";
1618 delete pTag;
1619 return false;
1620 }
1621 }
1622 else {
1623 parseStr += "Invalid tag extension for \"";
1624 parseStr += info.GetTagTypeSigName(sigType);
1625 parseStr += "\" (";
1626 parseStr += nodeName;
1627 parseStr += ") Tint Tag\n";
1628 if (pTag)
1629 delete pTag;
1630 return false;
1631 }
1632 }
1633 else {
1634 parseStr += "Tint Array missing tint values\n";
1635 return false;
1636 }
1637 return true;
1638}
char icChar
Definition IccDefs.h:109
icUInt32Number icGetSigVal(const icChar *pBuf)
Definition IccUtil.cpp:1258
xmlAttr * icXmlFindAttr(xmlNode *pNode, const char *szAttrName)
icTagTypeSignature icGetTypeNameTagSig(const icChar *szTagType)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
icTagTypeSignature
Type: Class.
Definition IccUtil.h:303
const icChar * GetTagTypeSigName(icTagTypeSignature sig)
Definition IccUtil.cpp:1594
CIccTagNumArray * m_Array
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
Class: CIccTag.
static CIccTag * Create(icTagTypeSignature sig)
Name: CIccTag::Create.
Class: CIccTagNumArray.
virtual bool ParseXml(xmlNode *pNode, std::string &parseStr)=0
virtual const char * GetExtClassName() const =0
#define icSigUnknownType
Convenience Enum Definitions - Not defined in ICC specification.
unsigned short icUInt16Number
icUInt32Number icSignature

References CIccTag::Create(), IIccExtensionTag::GetExtClassName(), CIccTag::GetExtension(), CIccInfo::GetTagTypeSigName(), icGetSigVal(), icGetTypeNameTagSig(), icSigUnknownType, icXmlAttrValue(), icXmlFindAttr(), CIccTag::IsNumArrayType(), CIccTag::m_nReserved, and CIccTagXml::ParseXml().

+ Here is the call graph for this function:

◆ ToXml()

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

Implements CIccMpeXml.

Definition at line 1529 of file IccMpeXml.cpp.

1530{
1531 char buf[128], line[128];
1532 sprintf(buf, "<TintArrayElement InputChannels=\"%d\" OutputChannels=\"%d\"", NumInputChannels(), NumOutputChannels());
1533 xml += blanks + buf;
1534
1535 if (m_nReserved) {
1536 sprintf(buf, " Reserved=\"%u\"", m_nReserved);
1537 xml += buf;
1538 }
1539 xml += ">\n";
1540
1541 IIccExtensionTag *pTagEx;
1542 if (m_Array && (pTagEx=m_Array->GetExtension()) && !strcmp(pTagEx->GetExtClassName(), "CIccTagXml")) {
1543 CIccTagXml *pTagXml = (CIccTagXml*)pTagEx;
1544 const icChar* tagSig = icGetTagSigTypeName(m_Array->GetType());
1545
1546 sprintf(line, " <%s>\n", tagSig); //parent node is the tag type
1547 xml += line;
1548
1549 //convert the rest of the tag to xml
1550 if (!pTagXml->ToXml(xml, " ")) {
1551 printf("Unable to output tag with type %s\n", icGetSigStr(buf, m_Array->GetType()));
1552 return false;
1553 }
1554 sprintf(line, " </%s>\n", tagSig);
1555 xml += line;
1556 }
1557
1558 xml += blanks + "</TintArrayElement>\n";
1559
1560 return true;
1561}
const icChar * icGetSigStr(icChar *pBuf, icUInt32Number nSig)
Definition IccUtil.cpp:1056
const icChar * icGetTagSigTypeName(icTagTypeSignature tagTypeSig)
virtual icUInt16Number NumInputChannels() const
Definition IccTagMPE.h:159
virtual icUInt16Number NumOutputChannels() const
Definition IccTagMPE.h:160
icUInt32Number m_nReserved
Definition IccTagMPE.h:188
virtual icTagTypeSignature GetType() const
Function: GetType()
virtual IIccExtensionTag * GetExtension()
virtual bool ToXml(std::string &xml, std::string blanks="")=0

References IIccExtensionTag::GetExtClassName(), icGetSigStr(), icGetTagSigTypeName(), and CIccTagXml::ToXml().

+ Here is the call graph for this function:

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