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

#include <IccMpeXml.h>

+ Inheritance diagram for CIccMpeXmlCurveSet:
+ Collaboration diagram for CIccMpeXmlCurveSet:

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 ~CIccMpeXmlCurveSet ()
 
- Public Member Functions inherited from CIccMpeCurveSet
virtual void Apply (CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const
 Name: CIccMpeCurveSet::Apply.
 
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 Name: CIccMpeCurveSet::Begin.
 
 CIccMpeCurveSet (const CIccMpeCurveSet &curveSet)
 Name: CIccMpeCurveSet::CIccMpeCurveSet.
 
 CIccMpeCurveSet (int nSize=0)
 Name: CIccMpeCurveSet::CIccMpeCurveSet.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccMpeCurveSet::Describe.
 
virtual icElemTypeSignature GetType () const
 
virtual CIccMultiProcessElementNewCopy () const
 
CIccMpeCurveSetoperator= (const CIccMpeCurveSet &curveSet)
 Name: &CIccMpeCurveSet::operator=.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccMpeCurveSet::Read.
 
bool SetCurve (int nIndex, icCurveSetCurvePtr newCurve)
 Name: CIccMpeCurveSet::SetCurve.
 
bool SetSize (int nNewSize)
 Name: CIccMpeCurveSet::SetSize.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 Name: CIccMpeCurveSet::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccMpeCurveSet::Write.
 
virtual ~CIccMpeCurveSet ()
 Name: CIccMpeCurveSet::~CIccMpeCurveSet.
 
- 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 CIccMpeCurveSet
icCurveSetCurvePtrm_curve
 
icPositionNumberm_position
 
- Protected Attributes inherited from CIccMultiProcessElement
icUInt16Number m_nInputChannels
 
icUInt16Number m_nOutputChannels
 

Detailed Description

Definition at line 109 of file IccMpeXml.h.

Constructor & Destructor Documentation

◆ ~CIccMpeXmlCurveSet()

virtual CIccMpeXmlCurveSet::~CIccMpeXmlCurveSet ( )
inlinevirtual

Definition at line 112 of file IccMpeXml.h.

112{}

Member Function Documentation

◆ GetClassName()

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

Reimplemented from CIccMpeCurveSet.

Definition at line 114 of file IccMpeXml.h.

114{ return "CIccMpeXmlCurveSet"; }

◆ GetExtension()

virtual IIccExtensionMpe * CIccMpeXmlCurveSet::GetExtension ( )
inlinevirtual

Reimplemented from CIccMultiProcessElement.

Definition at line 116 of file IccMpeXml.h.

116{ return this; }

◆ ParseXml()

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

Implements CIccMpeXml.

Definition at line 1121 of file IccMpeXml.cpp.

1122{
1123 icUInt16Number nChannels = (icUInt16Number)atoi(icXmlAttrValue(pNode, "InputChannels"));
1124
1125 if (!nChannels || atoi(icXmlAttrValue(pNode, "OutputChannels")) != nChannels) {
1126 parseStr += "Invalid InputChannels or OutputChannels In CurveSetElement\n";
1127 return false;
1128 }
1129
1130 SetSize(nChannels);
1131 int nIndex = 0;
1132 for (pNode = pNode->children, nIndex = 0;
1133 pNode;
1134 pNode=pNode->next) {
1135 if (pNode->type == XML_ELEMENT_NODE) {
1136 if (nIndex >= nChannels) {
1137 return false;
1138 }
1139 else if (!strcmp((const char*)pNode->name, "DuplicateCurve")) {
1140 const char *attr = icXmlAttrValue(pNode, "Index", NULL);
1141
1142 if (attr) {
1143 int nCopyIndex = atoi(attr);
1144 if (nCopyIndex >= 0 && nCopyIndex < nIndex) {
1145 m_curve[nIndex] = m_curve[nCopyIndex];
1146 nIndex++;
1147 }
1148 else {
1149 parseStr += "Invalid index for duplicate CurveSet Curve\n";
1150 return false;
1151 }
1152 }
1153 else {
1154 parseStr += "Missing index for duplicate CurveSet Curve\n";
1155 return false;
1156 }
1157 }
1158 else {
1159 icCurveSetCurvePtr pCurve = ParseXmlCurve(pNode, parseStr);
1160
1161 if (!pCurve)
1162 return false;
1163
1164 if (!SetCurve(nIndex, pCurve))
1165 return false;
1166 nIndex++;
1167 }
1168 }
1169 }
1170
1171 if (!pNode && nIndex == nChannels)
1172 return true;
1173
1174 return false;
1175}
static icCurveSetCurvePtr ParseXmlCurve(xmlNode *pNode, std::string parseStr)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
Class: CIccCurveSetCurve.
bool SetSize(int nNewSize)
Name: CIccMpeCurveSet::SetSize.
icCurveSetCurvePtr * m_curve
bool SetCurve(int nIndex, icCurveSetCurvePtr newCurve)
Name: CIccMpeCurveSet::SetCurve.
unsigned short icUInt16Number

References icXmlAttrValue(), and ParseXmlCurve().

+ Here is the call graph for this function:

◆ ToXml()

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

Implements CIccMpeXml.

Definition at line 1048 of file IccMpeXml.cpp.

1049{
1050 char line[256];
1051 sprintf(line, "<CurveSetElement InputChannels=\"%d\" OutputChannels=\"%d\"", NumInputChannels(), NumOutputChannels());
1052 xml += blanks + line;
1053
1054 if (m_nReserved) {
1055 sprintf(line, " Reserved=\"%u\"", m_nReserved);
1056 xml += line;
1057 }
1058 xml += ">\n";
1059
1060 int i, j;
1061
1062 for (i=0; i<NumInputChannels(); i++) {
1063 CIccCurveSetCurve* curve = m_curve[i];
1064
1065 //check for duplicate curves
1066 for (j = 0; j < i; j++) {
1067 if (m_curve[i] == m_curve[j])
1068 break;
1069 }
1070
1071 //handle case of duplicate curve
1072 if (j < i) {
1073 sprintf(line, "<DuplicateCurve Index=\"%d\"/>\n", j);
1074 xml += blanks + " ";
1075 xml += line;
1076 }
1077 else if (!ToXmlCurve(xml, blanks, m_curve[i]))
1078 return false;
1079 }
1080
1081 xml += blanks + "</CurveSetElement>\n";
1082 return true;
1083}
static bool ToXmlCurve(std::string &xml, std::string blanks, icCurveSetCurvePtr pCurve)
virtual icUInt16Number NumInputChannels() const
Definition IccTagMPE.h:159
virtual icUInt16Number NumOutputChannels() const
Definition IccTagMPE.h:160
icUInt32Number m_nReserved
Definition IccTagMPE.h:188

References ToXmlCurve().

+ Here is the call graph for this function:

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