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

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlChromaticity:
+ Collaboration diagram for CIccTagXmlChromaticity:

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 ~CIccTagXmlChromaticity ()
 
- Public Member Functions inherited from CIccTagChromaticity
 CIccTagChromaticity (const CIccTagChromaticity &ITCh)
 Name: CIccTagChromaticity::CIccTagChromaticity.
 
 CIccTagChromaticity (int nSize=3)
 Name: CIccTagChromaticity::CIccTagChromaticity.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccTagChromaticity::Describe.
 
icUInt32Number GetSize () const
 
virtual icTagTypeSignature GetType () const
 Function: GetType()
 
icChromaticityNumberGetxy (icUInt32Number index)
 
virtual bool IsArrayType ()
 
virtual CIccTagNewCopy () const
 Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.
 
CIccTagChromaticityoperator= (const CIccTagChromaticity &ChromTag)
 Name: CIccTagChromaticity::operator=.
 
icChromaticityNumberoperator[] (icUInt32Number index)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccTagChromaticity::Read.
 
bool SetSize (icUInt16Number nSize, bool bZeroNew=true)
 Name: CIccTagChromaticity::SetSize.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 Name: CIccTagChromaticity::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccTagChromaticity::Write.
 
virtual ~CIccTagChromaticity ()
 Name: CIccTagChromaticity::~CIccTagChromaticity.
 
- 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 IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool IsSupported ()
 Function: IsSupported(size, pIO) - Check if tag fully supported for apply purposes.
 
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)
 

Additional Inherited Members

- Static Public Member Functions inherited from CIccTag
static CIccTagCreate (icTagTypeSignature sig)
 Name: CIccTag::Create.
 
- Public Attributes inherited from CIccTagChromaticity
icUInt16Number m_nColorantType
 
- Public Attributes inherited from CIccTag
icUInt32Number m_nReserved
 
- Protected Attributes inherited from CIccTagChromaticity
icUInt16Number m_nChannels
 
icChromaticityNumberm_xy
 

Detailed Description

Definition at line 242 of file IccTagXml.h.

Constructor & Destructor Documentation

◆ ~CIccTagXmlChromaticity()

virtual CIccTagXmlChromaticity::~CIccTagXmlChromaticity ( )
inlinevirtual

Definition at line 245 of file IccTagXml.h.

245{}

Member Function Documentation

◆ GetClassName()

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

Reimplemented from CIccTagChromaticity.

Definition at line 247 of file IccTagXml.h.

247{return "CIccTagXmlChromaticity"; }

◆ GetExtension()

virtual IIccExtensionTag * CIccTagXmlChromaticity::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

Definition at line 249 of file IccTagXml.h.

249{return this; }

◆ ParseXml()

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

Implements CIccTagXml.

Definition at line 946 of file IccTagXml.cpp.

947{
948
949 pNode = icXmlFindNode(pNode, "Colorant");
950
951 if (pNode)
952 m_nColorantType = icGetColorantValue(pNode->children ? (const icChar*)pNode->children->content : "");
953
954
955 icUInt16Number n = (icUInt16Number)icXmlNodeCount(pNode, "Channel");
956
957 if (n) {
959 SetSize(n);
960
961 for (i=0; pNode; pNode=pNode->next) {
962 if (pNode->type == XML_ELEMENT_NODE &&
963 !icXmlStrCmp(pNode->name, "Channel") &&
964 i<n) {
965 xmlAttr *x = icXmlFindAttr(pNode, "x");
966 xmlAttr *y = icXmlFindAttr(pNode, "y");
967
968 if (x && y) {
969 m_xy[i].x = icDtoUF((icFloatNumber)atof(icXmlAttrValue(x)));
970 m_xy[i].y = icDtoUF((icFloatNumber)atof(icXmlAttrValue(y)));
971 i++;
972 }
973 else
974 return false;
975 }
976 }
977 return i==n;
978 }
979 return false;
980}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
char icChar
Definition IccDefs.h:109
icU16Fixed16Number icDtoUF(icFloatNumber num)
Definition IccUtil.cpp:566
icColorantEncoding icGetColorantValue(const icChar *str)
icUInt32Number icXmlNodeCount(xmlNode *pNode, const char *szNodeName)
xmlAttr * icXmlFindAttr(xmlNode *pNode, const char *szAttrName)
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
#define icXmlStrCmp(x, y)
Definition IccUtilXml.h:134
unsigned int icUInt32Number
bool SetSize(icUInt16Number nSize, bool bZeroNew=true)
Name: CIccTagChromaticity::SetSize.
icUInt16Number m_nColorantType
icChromaticityNumber * m_xy
unsigned short icUInt16Number
icU16Fixed16Number x
icU16Fixed16Number y

References icDtoUF(), icGetColorantValue(), icXmlAttrValue(), icXmlFindAttr(), icXmlFindNode(), icXmlNodeCount(), and icXmlStrCmp.

+ Here is the call graph for this function:

◆ ToXml()

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

Implements CIccTagXml.

Definition at line 927 of file IccTagXml.cpp.

928{
929 char buf[256];
930 int i;
931
932 CIccInfo info;
933 sprintf(buf, "<Colorant>%s</Colorant>\n",info.GetColorantEncoding((icColorantEncoding)m_nColorantType));
934 xml += blanks + buf;
935
936 for (i=0; i<(int)m_nChannels; i++) {
937 sprintf(buf, " <Channel x=\"" icXmlFloatFmt "f\" y=\"" icXmlFloatFmt "\"/>\n", (float)icUFtoD(m_xy[i].x),
938 (float)icUFtoD(m_xy[i].y));
939 xml += blanks + buf;
940 }
941
942 return true;
943}
icFloatNumber icUFtoD(icU16Fixed16Number num)
Definition IccUtil.cpp:580
#define icXmlFloatFmt
Type: Class.
Definition IccUtil.h:303
const icChar * GetColorantEncoding(icColorantEncoding colorant)
Definition IccUtil.cpp:2317
icUInt16Number m_nChannels
icColorantEncoding
Colorant and Phosphor Encodings used in chromaticity type.

References CIccInfo::GetColorantEncoding(), icUFtoD(), and icXmlFloatFmt.

+ Here is the call graph for this function:

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