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

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlSpectralViewingConditions:
+ Collaboration diagram for CIccTagXmlSpectralViewingConditions:

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 ~CIccTagXmlSpectralViewingConditions ()
 
- Public Member Functions inherited from CIccTagSpectralViewingConditions
icFloatNumberapplyRangeToObserver (const icSpectralRange &newRange) const
 
 CIccTagSpectralViewingConditions ()
 Name: CIccTagSpectralViewingConditions::CIccTagSpectralViewingConditions.
 
 CIccTagSpectralViewingConditions (const CIccTagSpectralViewingConditions &ITRCS)
 Name: CIccTagSpectralViewingConditions::CIccTagSpectralViewingConditions.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccTagSpectralViewingConditions::Describe.
 
const icFloatNumbergetIlluminant (icSpectralRange &illumRange) const
 
icFloatNumber getIlluminantCCT () const
 
const icFloatNumbergetObserver (icSpectralRange &observerRange) const
 
CIccMatrixMathgetObserverMatrix (const icSpectralRange &newRange) const
 
icIlluminant getStdIllumiant () const
 
icStandardObserver getStdObserver () const
 
virtual icTagTypeSignature GetType () const
 Function: GetType()
 
virtual CIccTagNewCopy () const
 Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.
 
CIccTagSpectralViewingConditionsoperator= (const CIccTagSpectralViewingConditions &RespCurveSet16Tag)
 Name: CIccTagSpectralViewingConditions::operator=.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccTagSpectralViewingConditions::Read.
 
bool setIlluminant (icFloatNumber *pWhiteXYZ)
 
bool setIlluminant (icIlluminant illumId, const icSpectralRange &illumRange, const icFloatNumber *illum, icFloatNumber illumCCT=0.0f)
 
bool setObserver (icStandardObserver observerId, const icSpectralRange &observerRange, const icFloatNumber *observer)
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 Name: CIccTagSpectralViewingConditions::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccTagSpectralViewingConditions::Write.
 
virtual ~CIccTagSpectralViewingConditions ()
 Name: CIccTagSpectralViewingConditions::~CIccTagResponseCurveSet16.
 
- 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 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 CIccTagSpectralViewingConditions
icFloatXYZNumber m_illuminantXYZ
 
icUInt16Number m_reserved2
 
icUInt16Number m_reserved3
 
icFloatXYZNumber m_surroundXYZ
 
- Public Attributes inherited from CIccTag
icUInt32Number m_nReserved
 
- Protected Attributes inherited from CIccTagSpectralViewingConditions
icFloatNumber m_colorTemperature
 
icFloatNumberm_illuminant
 
icSpectralRange m_illuminantRange
 
icFloatNumberm_observer
 
icSpectralRange m_observerRange
 
icIlluminant m_stdIlluminant
 
icStandardObserver m_stdObserver
 

Detailed Description

Definition at line 448 of file IccTagXml.h.

Constructor & Destructor Documentation

◆ ~CIccTagXmlSpectralViewingConditions()

virtual CIccTagXmlSpectralViewingConditions::~CIccTagXmlSpectralViewingConditions ( )
inlinevirtual

Definition at line 451 of file IccTagXml.h.

451{}

Member Function Documentation

◆ GetClassName()

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

Reimplemented from CIccTagSpectralViewingConditions.

Definition at line 453 of file IccTagXml.h.

453{return "CIccTagXmlSpectralViewingConditions"; }

◆ GetExtension()

virtual IIccExtensionTag * CIccTagXmlSpectralViewingConditions::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

Definition at line 455 of file IccTagXml.h.

455{return this; }

◆ ParseXml()

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

Implements CIccTagXml.

Definition at line 2044 of file IccTagXml.cpp.

2045{
2046 xmlNode *pChild;
2047 xmlAttr *attr;
2048
2049 memset(&m_illuminantXYZ, 0, sizeof(m_illuminantXYZ));
2050 memset(&m_surroundXYZ, 0, sizeof(m_surroundXYZ));
2054 m_reserved2 = 0;
2055 m_reserved3 = 0;
2056
2057 pChild = icXmlFindNode(pNode, "StdObserver");
2058 if (pChild && pChild->children && pChild->children->content) {
2059 m_stdObserver = icGetNamedStandardObserverValue((icChar*)pChild->children->content);
2060 }
2061
2062 pChild = icXmlFindNode(pNode, "IlluminantXYZ");
2063 if (pChild) {
2064
2065 attr = icXmlFindAttr(pChild, "X");
2066 if (attr) {
2068 }
2069
2070 attr = icXmlFindAttr(pChild, "Y");
2071 if (attr) {
2073 }
2074
2075 attr = icXmlFindAttr(pChild, "Z");
2076 if (attr) {
2078 }
2079 }
2080
2081 pChild = icXmlFindNode(pNode, "ObserverFuncs");
2082 if (pChild) {
2083 attr = icXmlFindAttr(pChild, "start");
2084 if (attr) {
2086 }
2087 attr = icXmlFindAttr(pChild, "end");
2088 if (attr) {
2090 }
2091 attr = icXmlFindAttr(pChild, "steps");
2092 if (attr) {
2094 }
2095 attr = icXmlFindAttr(pChild, "reserved");
2096 if (attr) {
2098 }
2099
2100 if (pChild->children && pChild->children->content) {
2101 CIccFloatArray vals;
2102 vals.ParseTextArray((icChar*)pChild->children->content);
2103 if (vals.GetSize()!=m_observerRange.steps*3)
2104 return false;
2106 if (!m_observer)
2107 return false;
2108 icFloatNumber *pBuf = vals.GetBuf();
2109 memcpy(m_observer, pBuf, m_observerRange.steps*3*sizeof(icFloatNumber));
2110 }
2111 }
2112
2113 pChild = icXmlFindNode(pNode, "StdIlluminant");
2114 if (pChild && pChild->children && pChild->children->content) {
2115 m_stdIlluminant = icGetIlluminantValue((icChar*)pChild->children->content);
2116 }
2117
2118 pChild = icXmlFindNode(pNode, "ColorTemperature");
2119 if (pChild && pChild->children && pChild->children->content) {
2120 m_colorTemperature = (icFloatNumber)atof((icChar*)pChild->children->content);
2121 }
2122
2123 pChild = icXmlFindNode(pNode, "IlluminantSPD");
2124 if (pChild) {
2125 attr = icXmlFindAttr(pChild, "start");
2126 if (attr) {
2128 }
2129 attr = icXmlFindAttr(pChild, "end");
2130 if (attr) {
2132 }
2133 attr = icXmlFindAttr(pChild, "steps");
2134 if (attr) {
2136 }
2137 attr = icXmlFindAttr(pChild, "reserved");
2138 if (attr) {
2140 }
2141
2142 if (pChild->children && pChild->children->content && m_illuminantRange.steps) {
2143 CIccFloatArray vals;
2144 vals.ParseTextArray((icChar*)pChild->children->content);
2145 if (vals.GetSize()!=m_illuminantRange.steps)
2146 return false;
2148 if (!m_illuminant)
2149 return false;
2150 icFloatNumber *pBuf = vals.GetBuf();
2151 memcpy(m_illuminant, pBuf, m_illuminantRange.steps * sizeof(icFloatNumber));
2152 }
2153 else {
2155 }
2156 }
2157
2158 pChild = icXmlFindNode(pNode, "SurroundXYZ");
2159 if (pChild) {
2160 attr = icXmlFindAttr(pChild, "X");
2161 if (attr) {
2163 }
2164
2165 attr = icXmlFindAttr(pChild, "Y");
2166 if (attr) {
2168 }
2169
2170 attr = icXmlFindAttr(pChild, "Z");
2171 if (attr) {
2173 }
2174 }
2175
2176 return true;
2177}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
char icChar
Definition IccDefs.h:109
icFloat16Number icFtoF16(icFloat32Number num)
Definition IccUtil.cpp:673
xmlAttr * icXmlFindAttr(xmlNode *pNode, const char *szAttrName)
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
icIlluminant icGetIlluminantValue(const icChar *str)
icStandardObserver icGetNamedStandardObserverValue(const icChar *str)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
bool setIlluminant(icIlluminant illumId, const icSpectralRange &illumRange, const icFloatNumber *illum, icFloatNumber illumCCT=0.0f)
bool ParseTextArray(const char *szText)
icUInt32Number GetSize()
Definition IccUtilXml.h:166
unsigned short icUInt16Number
@ icIlluminantUnknown
@ icStdObsUnknown
icFloat32Number Z
icFloat32Number Y
icFloat32Number X
icUInt16Number steps
icFloat16Number start
icFloat16Number end

References CIccXmlArrayType< T, Tsig >::GetBuf(), CIccXmlArrayType< T, Tsig >::GetSize(), icFtoF16(), icGetIlluminantValue(), icGetNamedStandardObserverValue(), icIlluminantUnknown, icStdObsUnknown, icXmlAttrValue(), icXmlFindAttr(), icXmlFindNode(), and CIccXmlArrayType< T, Tsig >::ParseTextArray().

+ Here is the call graph for this function:

◆ ToXml()

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

Implements CIccTagXml.

Definition at line 1959 of file IccTagXml.cpp.

1960{
1961 char buf[256];
1962 int i, j;
1963 icFloatNumber *ptr;
1964 CIccInfo info;
1965
1966 sprintf(buf, "<StdObserver>%s</StdObserver>\n", info.GetStandardObserverName(m_stdObserver));
1967 xml += blanks + buf;
1968
1969 sprintf(buf, "<IlluminantXYZ X=\"" icXmlFloatFmt "\" Y=\"" icXmlFloatFmt "\" Z=\"" icXmlFloatFmt "\"/>\n",
1971 xml += blanks + buf;
1972
1973 if (m_observer) {
1974 sprintf(buf, "<ObserverFuncs start=\"" icXmlHalfFmt "\" end=\"" icXmlHalfFmt "\" steps=\"%d\"",
1976 xml += blanks + buf;
1977
1978 if (m_reserved2) {
1979 sprintf(buf, " Reserved=\"%d\"", m_reserved2);
1980 xml += buf;
1981 }
1982 xml += ">\n";
1983
1984 ptr = &m_observer[0];
1985
1986 for (j=0; j<3; j++) {
1987 xml += blanks;
1988 for (i=0; i<m_observerRange.steps; i++) {
1989 if (i && !(i%8)) {
1990 xml += "\n";
1991 xml += blanks;
1992 }
1993 sprintf(buf, " " icXmlFloatFmt, *ptr);
1994 ptr++;
1995 xml += buf;
1996 }
1997 xml += "\n";
1998 }
1999 xml += blanks + "</ObserverFuncs>\n";
2000 }
2001
2002 sprintf(buf, "<StdIlluminant>%s</StdIlluminant>\n", info.GetIlluminantName(m_stdIlluminant));
2003 xml += blanks + buf;
2004
2005 sprintf(buf, "<ColorTemperature>" icXmlFloatFmt "</ColorTemperature>\n", m_colorTemperature);
2006 xml += blanks + buf;
2007
2008 if (m_illuminant) {
2009 sprintf(buf, "<IlluminantSPD start=\"" icXmlHalfFmt "\" end=\"" icXmlHalfFmt "\" steps=\"%d\"",
2011 xml += blanks + buf;
2012
2013 if (m_reserved3) {
2014 sprintf(buf, " Reserved=\"%d\"", m_reserved3);
2015 xml += buf;
2016 }
2017 xml += ">\n";
2018
2019 ptr = &m_illuminant[0];
2020
2021 xml += blanks;
2022 for (i=0; i<m_illuminantRange.steps; i++) {
2023 if (i && !(i%8)) {
2024 xml += "\n";
2025 xml += blanks;
2026 }
2027 sprintf(buf, " " icXmlFloatFmt, *ptr);
2028 ptr++;
2029 xml += buf;
2030 }
2031 xml += "\n";
2032
2033 xml += blanks + "</IlluminantSPD>\n";
2034 }
2035
2036 sprintf(buf, "<SurroundXYZ X=\"" icXmlFloatFmt "\" Y=\"" icXmlFloatFmt "\" Z=\"" icXmlFloatFmt "\"/>\n",
2038 xml += blanks + buf;
2039
2040
2041 return true;
2042}
icFloatNumber icF16toF(icFloat16Number num)
Definition IccUtil.cpp:629
#define icXmlHalfFmt
#define icXmlFloatFmt
Type: Class.
Definition IccUtil.h:303
const icChar * GetIlluminantName(icIlluminant val)
Definition IccUtil.cpp:2169
const icChar * GetStandardObserverName(icStandardObserver val)
Definition IccUtil.cpp:2151

References CIccInfo::GetIlluminantName(), CIccInfo::GetStandardObserverName(), icF16toF(), icXmlFloatFmt, and icXmlHalfFmt.

+ Here is the call graph for this function:

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