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

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlMultiProcessElement:
+ Collaboration diagram for CIccTagXmlMultiProcessElement:

Public Member Functions

virtual const char * GetClassName () const
 
virtual IIccExtensionTagGetExtension ()
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
virtual ~CIccTagXmlMultiProcessElement ()
 
- Public Member Functions inherited from CIccTagMultiProcessElement
virtual void Apply (CIccApplyTagMpe *pApply, icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel) const
 Name: CIccTagMultiProcessElement::Apply.
 
virtual void Attach (CIccMultiProcessElement *pElement)
 Name: CIccTagMultiProcessElement::Attach.
 
virtual bool Begin (icElemInterp nInterp=icElemInterpLinear, IIccProfileConnectionConditions *pProfilePCC=NULL, IIccProfileConnectionConditions *pAppliedPCC=NULL, IIccCmmEnvVarLookup *pCmmEnvVarLookup=NULL)
 Name: CIccTagMultiProcessElement::Begin.
 
 CIccTagMultiProcessElement (const CIccTagMultiProcessElement &lut)
 Name: CIccTagMultiProcessElement::CIccTagMultiProcessElement.
 
 CIccTagMultiProcessElement (icUInt16Number nInputChannels=0, icUInt16Number nOutputChannels=0)
 Name: CIccTagMultiProcessElement::CIccTagMultiProcessElement.
 
void DeleteElement (int nIndex)
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccTagMultiProcessElement::Describe.
 
IIccProfileConnectionConditionsGetAppliedPCC ()
 
IIccCmmEnvVarLookupGetCmmEnvLookup ()
 
CIccMultiProcessElementGetElement (int nIndex)
 Name: CIccTagMultiProcessElement::GetElement.
 
virtual CIccApplyTagMpeGetNewApply ()
 Name: CIccTagMultiProcessElement::GetNewApply.
 
IIccProfileConnectionConditionsGetProfilePCC ()
 
virtual icTagTypeSignature GetType () const
 Function: GetType()
 
virtual void Insert (CIccMultiProcessElement *pElement)
 Name: CIccTagMultiProcessElement::Insert.
 
bool IsLateBinding () const
 Name: CIccTagMultiProcessElement::IsLateBinding.
 
bool IsLateBindingReflectance () const
 Name: CIccTagMultiProcessElement::IsLateBindingReflectance.
 
virtual bool IsSupported ()
 Name: CIccTagMultiProcessElement::IsSupported.
 
virtual CIccTagNewCopy () const
 Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.
 
icUInt32Number NumElements () const
 
icUInt16Number NumInputChannels () const
 
icUInt16Number NumOutputChannels () const
 
CIccTagMultiProcessElementoperator= (const CIccTagMultiProcessElement &lut)
 Name: &operator=.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccTagMultiProcessElement::Read.
 
void SetChannels (icUInt16Number nInputChannels, icUInt16Number nOutputChannels)
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 Name: CIccTagMultiProcessElement::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccTagMultiProcessElement::Write.
 
virtual ~CIccTagMultiProcessElement ()
 Name: CIccTagMultiProcessElement::~CIccTagMultiProcessElement.
 
- Public Member Functions inherited from CIccTag
 CIccTag ()
 Name: CIccTag::CIccTag.
 
virtual void DetachIO ()
 Function: ReadAll() - Read All sub data for tag from file.
 
virtual icArraySignature GetTagArrayType () const
 
virtual icStructSignature GetTagStructType () const
 
virtual bool IsArrayType ()
 
virtual bool IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool Read (icUInt32Number size, CIccIO *pIO, CIccProfile *pProfile)
 Function: Read(size, pIO) - Read tag from file.
 
virtual bool ReadAll ()
 Function: ReadAll() - Read All sub data for tag from file.
 
virtual ~CIccTag ()
 Name: CIccTag::CIccTag.
 
- Public Member Functions inherited from CIccTagXml
virtual const char * GetExtClassName () const
 
virtual const char * GetExtDerivedClassName () const
 
virtual ~CIccTagXml (void)
 

Static Public Member Functions

static CIccMultiProcessElementCreateElement (const icChar *szElementNodeName)
 
- Static Public Member Functions inherited from CIccTag
static CIccTagCreate (icTagTypeSignature sig)
 Name: CIccTag::Create.
 

Protected Member Functions

bool ParseElement (xmlNode *pNode, std::string &parseStr)
 
- Protected Member Functions inherited from CIccTagMultiProcessElement
virtual void Clean ()
 Name: CIccTagMultiProcessElement::Clean.
 
virtual icInt32Number ElementIndex (CIccMultiProcessElement *pElem)
 Name: CIccTagMultiProcessElement::ElementIndex.
 
virtual CIccMultiProcessElementList::iterator GetFirstElem ()
 
virtual CIccMultiProcessElementList::iterator GetLastElem ()
 
virtual void GetNextElemIterator (CIccMultiProcessElementList::iterator &itr)
 Name: CIccTagMultiProcessElement::GetNextElemIterator.
 

Additional Inherited Members

- Public Attributes inherited from CIccTag
icUInt32Number m_nReserved
 
- Protected Attributes inherited from CIccTagMultiProcessElement
CIccMultiProcessElementListm_list
 
icUInt16Number m_nBufChannels
 
icUInt16Number m_nInputChannels
 
icUInt16Number m_nOutputChannels
 
icUInt32Number m_nProcElements
 
IIccProfileConnectionConditionsm_pAppliedPCC
 
IIccCmmEnvVarLookupm_pCmmEnvVarLookup
 
icPositionNumberm_position
 
IIccProfileConnectionConditionsm_pProfilePCC
 

Detailed Description

Definition at line 595 of file IccTagXml.h.

Constructor & Destructor Documentation

◆ ~CIccTagXmlMultiProcessElement()

virtual CIccTagXmlMultiProcessElement::~CIccTagXmlMultiProcessElement ( )
inlinevirtual

Definition at line 598 of file IccTagXml.h.

598{}

Member Function Documentation

◆ CreateElement()

CIccMultiProcessElement * CIccTagXmlMultiProcessElement::CreateElement ( const icChar * szElementNodeName)
static

Definition at line 3964 of file IccTagXml.cpp.

3965{
3966 if (!strcmp(szElementNodeName, "CurveSetElement")) {
3967 return new CIccMpeXmlCurveSet;
3968 }
3969 if (!strcmp(szElementNodeName, "MatrixElement")) {
3970 return new CIccMpeXmlMatrix;
3971 }
3972 if (!strcmp(szElementNodeName, "CLutElement")) {
3973 return new CIccMpeXmlCLUT;
3974 }
3975 if (!strcmp(szElementNodeName, "ExtCLutElement")) {
3976 return new CIccMpeXmlExtCLUT;
3977 }
3978 if (!strcmp(szElementNodeName, "CalculatorElement")) {
3979 return new CIccMpeXmlCalculator;
3980 }
3981 if (!strcmp(szElementNodeName, "TintArrayElement")) {
3982 return new CIccMpeXmlTintArray;
3983 }
3984 if (!strcmp(szElementNodeName, "ToneMapElement")) {
3985 return new CIccMpeXmlToneMap;
3986 }
3987 if (!strcmp(szElementNodeName, "JabToXYZElement")) {
3988 return new CIccMpeXmlJabToXYZ;
3989 }
3990 if (!strcmp(szElementNodeName, "UnknownElement")) {
3991 return new CIccMpeXmlUnknown;
3992 }
3993 if (!strcmp(szElementNodeName, "XYZToJabElement")) {
3994 return new CIccMpeXmlXYZToJab;
3995 }
3996 if (!strcmp(szElementNodeName, "EmissionMatrixElement")) {
3997 return new CIccMpeXmlEmissionMatrix;
3998 }
3999 if (!strcmp(szElementNodeName, "InvEmissionMatrixElement")) {
4000 return new CIccMpeXmlInvEmissionMatrix;
4001 }
4002 if (!strcmp(szElementNodeName, "EmissionCLutElement")) {
4003 return new CIccMpeXmlEmissionCLUT;
4004 }
4005 if (!strcmp(szElementNodeName, "ReflectanceCLutElement")) {
4006 return new CIccMpeXmlReflectanceCLUT;
4007 }
4008 if (!strcmp(szElementNodeName, "EmissionObserverElement")) {
4009 return new CIccMpeXmlEmissionObserver;
4010 }
4011 if (!strcmp(szElementNodeName, "ReflectanceObserverElement")) {
4013 }
4014 if (!strcmp(szElementNodeName, "BAcsElement")) {
4015 return new CIccMpeXmlBAcs;
4016 }
4017 if (!strcmp(szElementNodeName, "EAcsElement")) {
4018 return new CIccMpeXmlEAcs;
4019 }
4020 return NULL;
4021}

Referenced by CIccMpeXmlCalculator::ParseImport().

+ Here is the caller graph for this function:

◆ GetClassName()

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

Reimplemented from CIccTagMultiProcessElement.

Definition at line 600 of file IccTagXml.h.

600{return "CIccTagXmlMultiProcessElement"; }

◆ GetExtension()

virtual IIccExtensionTag * CIccTagXmlMultiProcessElement::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

Definition at line 602 of file IccTagXml.h.

602{return this; }

◆ ParseElement()

bool CIccTagXmlMultiProcessElement::ParseElement ( xmlNode * pNode,
std::string & parseStr )
protected

Definition at line 4024 of file IccTagXml.cpp.

4025{
4026 xmlAttr *attr;
4027
4028 if (pNode->type != XML_ELEMENT_NODE) {
4029 return false;
4030 }
4031
4032 CIccMultiProcessElement *pMpe = CreateElement((const icChar*)pNode->name);
4033
4034 if (!pMpe) {
4035 parseStr += std::string("Unknown Element Type (") + (const icChar*)pNode->name + ")\n";
4036 return false;
4037 }
4038
4040
4041 IIccExtensionMpe *pExt = pMpe->GetExtension();
4042
4043 if (pExt) {
4044 if (!strcmp(pExt->GetExtClassName(), "CIccMpeXml")) {
4045 CIccMpeXml* pXmlMpe = (CIccMpeXml*)pExt;
4046
4047 if (pXmlMpe->ParseXml(pNode, parseStr)) {
4048 if ((attr=icXmlFindAttr(pNode, "Reserved"))) {
4049 sscanf(icXmlAttrValue(attr), "%u", &pMpe->m_nReserved);
4050 }
4051
4052 ptr.ptr = pMpe;
4053 m_list->push_back(ptr);
4054 }
4055 else {
4056 parseStr += std::string("Unable to parse element of type ") + pMpe->GetClassName() + "\n";
4057 delete pMpe;
4058 return false;
4059 }
4060 }
4061 else {
4062 parseStr += std::string("Element ") + pMpe->GetClassName() + "isn't of type CIccMpeXml\n";
4063 delete pMpe;
4064 return false;
4065 }
4066 }
4067 else {
4068 parseStr += std::string("Element ") + pMpe->GetClassName() + "isn't of type CIccMpeXml\n";
4069 delete pMpe;
4070 return false;
4071 }
4072
4073 return true;
4074}
char icChar
Definition IccDefs.h:109
xmlAttr * icXmlFindAttr(xmlNode *pNode, const char *szAttrName)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
virtual bool ParseXml(xmlNode *pNode, std::string &parseStr)=0
Class: CIccMultiProcessElement.
Definition IccTagMPE.h:146
virtual IIccExtensionMpe * GetExtension()
Definition IccTagMPE.h:182
virtual const icChar * GetClassName() const =0
icUInt32Number m_nReserved
Definition IccTagMPE.h:188
Class: CIccProcessElementPtr.
Definition IccTagMPE.h:115
CIccMultiProcessElement * ptr
Definition IccTagMPE.h:117
CIccMultiProcessElementList * m_list
Definition IccTagMPE.h:419
static CIccMultiProcessElement * CreateElement(const icChar *szElementNodeName)
virtual const char * GetExtClassName()=0

References CIccMultiProcessElement::GetClassName(), IIccExtensionMpe::GetExtClassName(), CIccMultiProcessElement::GetExtension(), icXmlAttrValue(), icXmlFindAttr(), CIccMultiProcessElement::m_nReserved, CIccMpeXml::ParseXml(), and CIccMultiProcessElementPtr::ptr.

+ Here is the call graph for this function:

◆ ParseXml()

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

Implements CIccTagXml.

Definition at line 4077 of file IccTagXml.cpp.

4078{
4079 pNode = icXmlFindNode(pNode, "MultiProcessElements");
4080
4081 if (!pNode) {
4082 parseStr += "Cannot Find MultiProcessElements\n";
4083 return false;
4084 }
4085
4086 xmlAttr *pInputChannels = icXmlFindAttr(pNode, "InputChannels");
4087 xmlAttr *pOutputChannels = icXmlFindAttr(pNode, "OutputChannels");
4088
4089 if (!pInputChannels || !pOutputChannels) {
4090 parseStr += "Invalid channels in MultiProcessElements\n";
4091 return false;
4092 }
4093
4094 m_nInputChannels = atoi(icXmlAttrValue(pInputChannels));
4095 m_nOutputChannels = atoi(icXmlAttrValue(pOutputChannels));
4096
4097 if (!m_list) {
4099 }
4100 else {
4101 m_list->clear();
4102 }
4103
4104 xmlNode *elemNode;
4105 for (elemNode = pNode->children; elemNode; elemNode = elemNode->next) {
4106 if (elemNode->type == XML_ELEMENT_NODE) {
4107 if (!ParseElement(elemNode, parseStr)) {
4108 char str[100];
4109 parseStr += "Unable to parse element (";
4110 parseStr += (char*)elemNode->name;
4111 sprintf(str, ") starting on line %d\n", elemNode->line);
4112 parseStr += str;
4113 return false;
4114 }
4115 }
4116 }
4117
4118 return true;
4119}
std::list< CIccMultiProcessElementPtr > CIccMultiProcessElementList
Definition IccTagMPE.h:120
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:415
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:416
bool ParseElement(xmlNode *pNode, std::string &parseStr)

References icXmlAttrValue(), icXmlFindAttr(), and icXmlFindNode().

+ Here is the call graph for this function:

◆ ToXml()

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

Implements CIccTagXml.

Definition at line 3928 of file IccTagXml.cpp.

3929{
3930 std::string info;
3931 char line[256];
3932
3933 CIccMultiProcessElementList::iterator i;
3934
3935 sprintf(line, "<MultiProcessElements InputChannels=\"%d\" OutputChannels=\"%d\">\n", NumInputChannels(), NumOutputChannels());
3936 xml += blanks + line;
3937
3938 for (i=m_list->begin(); i!=m_list->end(); i++) {
3939 if (i->ptr) {
3940 CIccMultiProcessElement *pMpe = i->ptr;
3941
3942 IIccExtensionMpe *pMpeExt = pMpe->GetExtension();
3943
3944 if (pMpeExt) {
3945 if (!strcmp(pMpeExt->GetExtClassName(), "CIccMpeXml")) {
3946 CIccMpeXml *pMpeXml = (CIccMpeXml*)pMpeExt;
3947
3948 pMpeXml->ToXml(xml, blanks + " ");
3949 }
3950 else {
3951 return false;
3952 }
3953 }
3954 else {
3955 return false;
3956 }
3957 }
3958 }
3959 xml += blanks + "</MultiProcessElements>\n";
3960 return true;
3961}
virtual bool ToXml(std::string &xml, std::string blanks="")=0
icUInt16Number NumInputChannels() const
Definition IccTagMPE.h:393
icUInt16Number NumOutputChannels() const
Definition IccTagMPE.h:394

References IIccExtensionMpe::GetExtClassName(), CIccMultiProcessElement::GetExtension(), and CIccMpeXml::ToXml().

+ Here is the call graph for this function:

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