IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
CIccMpeXmlReflectanceObserver Class Reference

#include <IccMpeXml.h>

+ Inheritance diagram for CIccMpeXmlReflectanceObserver:
+ Collaboration diagram for CIccMpeXmlReflectanceObserver:

Public Member Functions

virtual ~CIccMpeXmlReflectanceObserver ()
 
virtual void Apply (CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const
 
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual icAcsSignature GetBAcsSig ()
 
virtual const char * GetClassName () const
 
virtual icAcsSignature GetEAcsSig ()
 
virtual const char * GetExtClassName ()
 
virtual IIccExtensionMpeGetExtension ()
 
virtual CIccApplyMpeGetNewApply (CIccApplyTagMpe *pApplyTag)
 
const icSpectralRangeGetRange ()
 
virtual icElemTypeSignature GetType () const
 
icFloatNumberGetWhite ()
 
virtual bool IsAcs ()
 
virtual bool IsLateBinding () const
 
virtual bool IsLateBindingReflectance () const
 
virtual bool IsSupported ()
 
virtual CIccMpeReflectanceObserverNewCopy () const
 
virtual icUInt16Number NumInputChannels () const
 
virtual icUInt16Number NumOutputChannels () const
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
bool SetSize (icUInt16Number nInputChannels, icUInt16Number nOutputChannels, const icSpectralRange &range)
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 
virtual bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccMultiProcessElementCreate (icElemTypeSignature sig)
 

Data Fields

icUInt32Number m_nReserved
 

Protected Member Functions

void copyData (const CIccMpeSpectralObserver &ITPC)
 
virtual const char * GetDescribeName () const
 

Protected Attributes

icUInt16Number m_flags
 
icUInt16Number m_nInputChannels
 
icUInt16Number m_nOutputChannels
 
CIccMatrixMathm_pApplyMtx
 
icFloatNumberm_pWhite
 
icSpectralRange m_Range
 
icFloatNumber m_xyzscale [3]
 
icFloatNumber m_xyzw [3]
 

Detailed Description

Constructor & Destructor Documentation

◆ ~CIccMpeXmlReflectanceObserver()

virtual CIccMpeXmlReflectanceObserver::~CIccMpeXmlReflectanceObserver ( )
inlinevirtual
411{}

Member Function Documentation

◆ Apply()

void CIccMpeSpectralObserver::Apply ( CIccApplyMpe pApply,
icFloatNumber dstPixel,
const icFloatNumber srcPixel 
) const
virtualinherited

Implements CIccMultiProcessElement.

1949{
1950 if (m_pApplyMtx) {
1951 icFloatNumber xyz[3];
1952 m_pApplyMtx->VectorMult(xyz, srcPixel);
1953
1954 bool bUseAbsolute = (m_flags & icRelativeSpectralData)!=0;
1955 bool bLab = (m_flags & icLabSpectralData) != 0;
1956
1957 if (!bUseAbsolute) {
1958 xyz[0] *= m_xyzscale[0];
1959 xyz[1] *= m_xyzscale[1];
1960 xyz[2] *= m_xyzscale[2];
1961 }
1962
1963 if (bLab) {
1964 icXYZtoLab(dstPixel, xyz, m_xyzw);
1965 // icLabToPcs(dstPixel);
1966 }
1967 else {
1968 memcpy(dstPixel, xyz, 3*sizeof(icFloatNumber));
1969 // icXyzToPcs(dstPixel);
1970 }
1971 }
1972}
#define icRelativeSpectralData
Definition icProfileHeader.h:1105
#define icLabSpectralData
Definition icProfileHeader.h:1108
float icFloatNumber
Definition IccDefs.h:101
ICCPROFLIB_API void icXYZtoLab(icFloatNumber *Lab, const icFloatNumber *XYZ=NULL, const icFloatNumber *WhiteXYZ=NULL)
Definition IccUtil.cpp:846
virtual void VectorMult(icFloatNumber *pDst, const icFloatNumber *pSrc) const
Definition IccMatrixMath.cpp:154
icUInt16Number m_flags
Definition IccMpeSpectral.h:361
icFloatNumber m_xyzw[3]
Definition IccMpeSpectral.h:366
CIccMatrixMath * m_pApplyMtx
Definition IccMpeSpectral.h:365
icFloatNumber m_xyzscale[3]
Definition IccMpeSpectral.h:367

References icXYZtoLab(), CIccMpeSpectralObserver::m_flags, CIccMpeSpectralObserver::m_pApplyMtx, CIccMpeSpectralObserver::m_xyzscale, CIccMpeSpectralObserver::m_xyzw, and CIccMatrixMath::VectorMult().

+ Here is the call graph for this function:

◆ Begin()

bool CIccMpeReflectanceObserver::Begin ( icElemInterp  nInterp,
CIccTagMultiProcessElement pMPE 
)
virtualinherited

Name: CIccMpeReflectanceObserver::Begin

Purpose:

Args:

Return:

Implements CIccMpeSpectralObserver.

2086{
2088 return false;
2089
2090 IIccProfileConnectionConditions *pAppliedPCC = pMPE->GetAppliedPCC();
2091 if (!pAppliedPCC)
2092 return false;
2093
2094 const CIccTagSpectralViewingConditions *pSVC = pAppliedPCC->getPccViewingConditions();
2095 if (!pSVC)
2096 return false;
2097
2098 CIccMatrixMath observer(3, m_Range.steps);
2099 icSpectralRange illumRange;
2100 const icFloatNumber *illum = pSVC->getIlluminant(illumRange);
2101
2102 if (!pAppliedPCC->getEmissiveObserver(illumRange, illum, observer.entry(0)))
2103 return false;
2104
2105 //
2106 //apply illuminant to observer and calculate XYZ of illuminant
2107 icFloatNumber *pObs = observer.entry(0);
2108 int i, j;
2109 for (i=0; i<3; i++) {
2110 m_xyzw[i] = 0.0;
2111 for (j=0; j<illumRange.steps; j++) {
2112 *pObs *= illum[j];
2113 m_xyzw[i] += *pObs;
2114 pObs++;
2115 }
2116 }
2117
2118 //concatenate reflectance range mapping to observer+illuminant
2119 CIccMatrixMath *rangeRef = CIccMatrixMath::rangeMap(m_Range, illumRange);
2120 if (!rangeRef)
2121 m_pApplyMtx = new CIccMatrixMath(observer);
2122 else
2123 m_pApplyMtx = rangeRef->Mult(&observer);
2124
2125 icFloatNumber xyzm[3];
2126
2128
2129 bool bUseAbsolute = (m_flags & icRelativeSpectralData)!=0;
2130 bool bLab = (m_flags & icLabSpectralData) != 0;
2131
2132 if (!bUseAbsolute) {
2133 m_xyzscale[0] = m_xyzw[0] / xyzm[0];
2134 m_xyzscale[1] = m_xyzw[1] / xyzm[1];
2135 m_xyzscale[2] = m_xyzw[2] / xyzm[2];
2136 }
2137
2138 return true;
2139}
icUInt16Number steps
Definition icProfileHeader.h:1469
Definition icProfileHeader.h:1466
Definition IccPcc.h:94
icFloatNumber * getEmissiveObserver(const icSpectralRange &range, const icFloatNumber *pWhite, icFloatNumber *obsMatrix=NULL)
Definition IccPcc.cpp:231
virtual const CIccTagSpectralViewingConditions * getPccViewingConditions()=0
Definition IccMatrixMath.h:94
CIccMatrixMath * Mult(const CIccMatrixMath *matrix) const
Definition IccMatrixMath.cpp:202
static CIccMatrixMath * rangeMap(const icSpectralRange &from, const icSpectralRange &to)
Definition IccMatrixMath.cpp:409
Definition IccTagBasic.h:1692
const icFloatNumber * getIlluminant(icSpectralRange &illumRange) const
Definition IccTagBasic.cpp:11405
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
IIccProfileConnectionConditions * GetAppliedPCC()
Definition IccTagMPE.h:403
icSpectralRange m_Range
Definition IccMpeSpectral.h:360
icFloatNumber * m_pWhite
Definition IccMpeSpectral.h:363

References CIccMatrixMath::CIccMatrixMath(), CIccMatrixMath::CIccMatrixMath(), CIccMatrixMath::entry(), CIccTagMultiProcessElement::GetAppliedPCC(), IIccProfileConnectionConditions::getEmissiveObserver(), CIccTagSpectralViewingConditions::getIlluminant(), IIccProfileConnectionConditions::getPccViewingConditions(), CIccMpeSpectralObserver::m_flags, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMpeSpectralObserver::m_pApplyMtx, CIccMpeSpectralObserver::m_pWhite, CIccMpeSpectralObserver::m_Range, CIccMpeSpectralObserver::m_xyzscale, CIccMpeSpectralObserver::m_xyzw, CIccMatrixMath::Mult(), CIccMatrixMath::rangeMap(), icSpectralRange::steps, and CIccMatrixMath::VectorMult().

+ Here is the call graph for this function:

◆ copyData()

void CIccMpeSpectralObserver::copyData ( const CIccMpeSpectralObserver matrix)
protectedinherited

Name: &CIccMpeSpectralObserver::operator=

Purpose:

Args:

Return:

1713{
1714 m_nReserved = matrix.m_nReserved;
1715
1718
1719 m_Range = m_Range;
1720
1721 if (m_pWhite)
1722 free(m_pWhite);
1723
1724 if (matrix.m_pWhite) {
1725 int num = m_Range.steps*sizeof(icFloatNumber);
1726 m_pWhite = (icFloatNumber*)malloc(num);
1727 memcpy(m_pWhite, matrix.m_pWhite, num);
1728 }
1729 else
1730 m_pWhite = NULL;
1731
1732 m_pApplyMtx = NULL;
1733}
icUInt32Number m_nReserved
Definition IccTagMPE.h:188

References CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, CIccMpeSpectralObserver::m_pApplyMtx, CIccMpeSpectralObserver::m_pWhite, CIccMpeSpectralObserver::m_Range, and icSpectralRange::steps.

Referenced by CIccMpeEmissionObserver::operator=(), and CIccMpeReflectanceObserver::operator=().

+ Here is the caller graph for this function:

◆ Create()

CIccMultiProcessElement * CIccMultiProcessElement::Create ( icElemTypeSignature  sig)
staticinherited

Name: CIccMultiProcessElement::Create

Purpose:

Args:

Return:

132{
134}
static CIccMultiProcessElement * CreateElement(icElemTypeSignature elemTypeSig)
Definition IccMpeFactory.h:213

References CIccMpeCreator::CreateElement().

Referenced by CIccDefaultEncProfileConverter::ConvertFromParams(), CIccSampledCalculatorCurve::Read(), CIccMpeCalculator::Read(), and CIccTagMultiProcessElement::Read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Describe()

void CIccMpeSpectralObserver::Describe ( std::string &  sDescription,
int  nVerboseness 
)
virtualinherited

Name: CIccMpeSpectralObserver::Describe

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

1800{
1801 icChar buf[81];
1802 int j;
1803
1804 sprintf(buf, "BEGIN_%s %d %d \n", GetDescribeName(), m_nInputChannels, m_nOutputChannels);
1805 sDescription += buf;
1806
1807 sprintf(buf, "RANGE %f %f %d\n", icF16toF(m_Range.start), icF16toF(m_Range.end), m_Range.steps);
1808 sDescription += buf;
1809
1810 sDescription += "White\n";
1811 for (j=0; j<(int)m_Range.steps; j++) {
1812 if (j)
1813 sDescription += " ";
1814 sprintf(buf, "%12.8lf", m_pWhite[j]);
1815 sDescription += buf;
1816 }
1817 sDescription += "\n";
1818
1819 sprintf(buf, "END_%s\n", GetDescribeName());
1820 sDescription += buf;
1821}
icFloat16Number start
Definition icProfileHeader.h:1467
icFloat16Number end
Definition icProfileHeader.h:1468
char icChar
Definition IccDefs.h:110
ICCPROFLIB_API icFloat32Number icF16toF(icFloat16Number num)
Definition IccUtil.cpp:629
virtual const char * GetDescribeName() const =0

References icSpectralRange::end, CIccMpeSpectralObserver::GetDescribeName(), icF16toF(), CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMpeSpectralObserver::m_pWhite, CIccMpeSpectralObserver::m_Range, icSpectralRange::start, and icSpectralRange::steps.

+ Here is the call graph for this function:

◆ GetBAcsSig()

virtual icAcsSignature CIccMultiProcessElement::GetBAcsSig ( )
inlinevirtualinherited

Reimplemented in CIccMpeBAcs.

178{ return icSigAcsZero; }
#define icSigAcsZero
Definition icProfileHeader.h:1100

Referenced by CIccMpeAcs::Describe().

+ Here is the caller graph for this function:

◆ GetClassName()

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

Reimplemented from CIccMpeReflectanceObserver.

413{ return "CIccMpeXmlReflectanceObserver"; }

◆ GetDescribeName()

virtual const char * CIccMpeReflectanceObserver::GetDescribeName ( ) const
inlineprotectedvirtualinherited

Implements CIccMpeSpectralObserver.

421{ return "ELEM_REFLECTANCE_OBSERVER"; }

◆ GetEAcsSig()

virtual icAcsSignature CIccMultiProcessElement::GetEAcsSig ( )
inlinevirtualinherited

Reimplemented in CIccMpeEAcs.

179{ return icSigAcsZero; }

◆ GetExtClassName()

virtual const char * CIccMpeXml::GetExtClassName ( )
inlinevirtualinherited

Implements IIccExtensionMpe.

84{ return "CIccMpeXml"; }

◆ GetExtension()

virtual IIccExtensionMpe * CIccMpeXmlReflectanceObserver::GetExtension ( )
inlinevirtual

Reimplemented from CIccMultiProcessElement.

415{ return this; }

◆ GetNewApply()

CIccApplyMpe * CIccMultiProcessElement::GetNewApply ( CIccApplyTagMpe pApplyTag)
virtualinherited

Name: CIccMultiProcessElement::GetNewApply()

Purpose:

Args:

Return:

Reimplemented in CIccMpeCLUT, CIccMpeCalculator, and CIccMpeSpectralCLUT.

147{
148 return new CIccApplyMpe(this);
149}
Definition IccTagMPE.h:203

References CIccApplyMpe::CIccApplyMpe().

Referenced by CIccApplyTagMpe::AppendElem(), and CIccMpeCalculator::GetNewApply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRange()

const icSpectralRange & CIccMpeSpectralObserver::GetRange ( )
inlineinherited
343{ return m_Range;}

References CIccMpeSpectralObserver::m_Range.

◆ GetType()

virtual icElemTypeSignature CIccMpeReflectanceObserver::GetType ( ) const
inlinevirtualinherited

Implements CIccMultiProcessElement.

@ icSigReflectanceObserverElemType
Definition icProfileHeader.h:665

References icSigReflectanceObserverElemType.

◆ GetWhite()

icFloatNumber * CIccMpeSpectralObserver::GetWhite ( )
inlineinherited
347{ return m_pWhite;}

References CIccMpeSpectralObserver::m_pWhite.

◆ IsAcs()

virtual bool CIccMultiProcessElement::IsAcs ( )
inlinevirtualinherited

Reimplemented in CIccMpeAcs.

177{ return false; }

Referenced by CIccTagMultiProcessElement::Apply().

+ Here is the caller graph for this function:

◆ IsLateBinding()

virtual bool CIccMpeSpectralObserver::IsLateBinding ( ) const
inlinevirtualinherited

Reimplemented from CIccMultiProcessElement.

354{ return true; }

◆ IsLateBindingReflectance()

virtual bool CIccMpeReflectanceObserver::IsLateBindingReflectance ( ) const
inlinevirtualinherited

Reimplemented from CIccMultiProcessElement.

418{ return true; }

◆ IsSupported()

virtual bool CIccMultiProcessElement::IsSupported ( )
inlinevirtualinherited

Reimplemented in CIccMpeUnknown.

162{ return true; }

Referenced by CIccTagMultiProcessElement::IsSupported().

+ Here is the caller graph for this function:

◆ NewCopy()

virtual CIccMpeReflectanceObserver * CIccMpeReflectanceObserver::NewCopy ( ) const
inlinevirtualinherited

Implements CIccMultiProcessElement.

410{ return new CIccMpeReflectanceObserver(*this);}
CIccMpeReflectanceObserver()
Definition IccMpeSpectral.h:407

References CIccMpeReflectanceObserver::CIccMpeReflectanceObserver().

+ Here is the call graph for this function:

◆ NumInputChannels()

◆ NumOutputChannels()

◆ ParseXml()

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

Implements CIccMpeXml.

3489{
3490 icUInt16Number nInputChannels = atoi(icXmlAttrValue(pNode, "InputChannels"));
3491 icUInt16Number nOutputChannels = atoi(icXmlAttrValue(pNode, "OutputChannels"));
3492 m_flags = atoi(icXmlAttrValue(pNode, "Flags"));
3493
3494 if (!nInputChannels || !nOutputChannels) {
3495 parseStr += "Invalid InputChannels or OutputChannels In ReflectanceObserverElement\n";
3496 return false;
3497 }
3498
3499 xmlNode *pData;
3500
3501 pData = icXmlFindNode(pNode->children, "Wavelengths");
3502 if (pData) {
3503 icFloatNumber dStart = (icFloatNumber)atof(icXmlAttrValue(pData, "start"));
3504 icFloatNumber dEnd = (icFloatNumber)atof(icXmlAttrValue(pData, "end"));
3505 icUInt16Number nSteps = atoi(icXmlAttrValue(pData, "steps"));
3506
3507 if (dStart >= dEnd || nSteps != nInputChannels) {
3508 parseStr += "Invalid Spectral Range\n";
3509 return false;
3510 }
3511 m_Range.start = icFtoF16(dStart);
3512 m_Range.end = icFtoF16(dEnd);
3513 m_Range.steps = nSteps;
3514 }
3515
3516 SetSize(nInputChannels, nOutputChannels, m_Range);
3517 if (!m_pWhite) {
3518 parseStr += "Unable to SetSize\n";
3519 return false;
3520 }
3521
3522 pData = icXmlFindNode(pNode->children, "WhiteData");
3523 if (pData) {
3524
3525 if (!CIccFloatArray::ParseArray(m_pWhite, m_Range.steps, pData->children))
3526 return false;
3527 }
3528 else {
3529 parseStr += "Missing White Data";
3530 }
3531
3532 return true;
3533}
unsigned short icUInt16Number
Definition icProfileHeader.h:256
ICCPROFLIB_API icFloat16Number icFtoF16(icFloat32Number num)
Definition IccUtil.cpp:673
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
Definition IccUtilXml.cpp:687
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault="")
Definition IccUtilXml.cpp:572
bool SetSize(icUInt16Number nInputChannels, icUInt16Number nOutputChannels, const icSpectralRange &range)
Definition IccMpeSpectral.cpp:1765
static bool ParseArray(T *buf, icUInt32Number nBufSize, xmlNode *pNode)
Definition IccUtilXml.cpp:1034

References icSpectralRange::end, icFtoF16(), icXmlAttrValue(), icXmlFindNode(), CIccMpeSpectralObserver::m_flags, CIccMpeSpectralObserver::m_pWhite, CIccMpeSpectralObserver::m_Range, CIccXmlArrayType< T, Tsig >::ParseArray(), CIccMpeSpectralObserver::SetSize(), icSpectralRange::start, and icSpectralRange::steps.

+ Here is the call graph for this function:

◆ Read()

bool CIccMpeSpectralObserver::Read ( icUInt32Number  size,
CIccIO pIO 
)
virtualinherited

Name: CIccMpeSpectralObserver::Read

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

1834{
1836
1837 icUInt32Number headerSize = sizeof(icElemTypeSignature) +
1838 sizeof(icUInt32Number) +
1839 sizeof(icUInt16Number) +
1840 sizeof(icUInt16Number) +
1841 sizeof(icUInt16Number) +
1842 sizeof(icUInt16Number) +
1843 sizeof(icUInt16Number) +
1844 sizeof(icUInt16Number);
1845
1846 if (headerSize > size)
1847 return false;
1848
1849 if (!pIO) {
1850 return false;
1851 }
1852
1853 icUInt16Number nInputChannels, nOutputChannels;
1854 icSpectralRange range;
1855
1856 if (!pIO->Read32(&sig))
1857 return false;
1858
1859 if (!pIO->Read32(&m_nReserved))
1860 return false;
1861
1862 if (!pIO->Read16(&nInputChannels))
1863 return false;
1864
1865 if (!pIO->Read16(&nOutputChannels))
1866 return false;
1867
1868 if (!pIO->Read16(&range.start))
1869 return false;
1870
1871 if (!pIO->Read16(&range.end))
1872 return false;
1873
1874 if (!pIO->Read16(&range.steps))
1875 return false;
1876
1877 if (!pIO->Read16(&m_flags))
1878 return false;
1879
1880 if (!SetSize(nInputChannels, nOutputChannels, range))
1881 return false;
1882
1883 if (!m_pWhite )
1884 return false;
1885
1886 if (size<headerSize + (int)range.steps*sizeof(icFloatNumber))
1887 return false;
1888
1889 //Read White data
1890 if (pIO->ReadFloat32Float(m_pWhite, range.steps)!=range.steps)
1891 return false;
1892
1893 return true;
1894}
icElemTypeSignature
Definition icProfileHeader.h:641
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icInt32Number ReadFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:302
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143

References icSpectralRange::end, CIccMpeSpectralObserver::m_flags, CIccMultiProcessElement::m_nReserved, CIccMpeSpectralObserver::m_pWhite, CIccIO::Read16(), CIccIO::Read32(), CIccIO::ReadFloat32Float(), CIccMpeSpectralObserver::SetSize(), icSpectralRange::start, and icSpectralRange::steps.

+ Here is the call graph for this function:

◆ SetSize()

bool CIccMpeSpectralObserver::SetSize ( icUInt16Number  nInputChannels,
icUInt16Number  nOutputChannels,
const icSpectralRange range 
)
inherited

Name: CIccMpeSpectralObserver::SetSize

Purpose:

Args:

Return:

1766{
1767 if (m_pWhite) {
1768 free(m_pWhite);
1769 m_pWhite = NULL;
1770 }
1771
1772 if (m_pApplyMtx) {
1773 delete m_pApplyMtx;
1774 m_pApplyMtx = NULL;
1775 }
1776
1777 m_nInputChannels = nInputChannels;
1778 m_nOutputChannels = nOutputChannels;
1779 m_Range = range;
1780
1781 m_pWhite = (icFloatNumber*)calloc(range.steps, sizeof(icFloatNumber));
1782
1783 if (!m_pWhite)
1784 return false;
1785
1786 return true;
1787}

References CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMpeSpectralObserver::m_pApplyMtx, CIccMpeSpectralObserver::m_pWhite, CIccMpeSpectralObserver::m_Range, and icSpectralRange::steps.

Referenced by CIccMpeXmlEmissionObserver::ParseXml(), ParseXml(), and CIccMpeSpectralObserver::Read().

+ Here is the caller graph for this function:

◆ ToXml()

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

Implements CIccMpeXml.

3536{
3537 char buf[128];
3538 sprintf(buf, "<ReflectanceObserverElement InputChannels=\"%d\" OutputChannels=\"%d\" Flags=\"%d\"", NumInputChannels(), NumOutputChannels(), m_flags);
3539 xml += blanks + buf;
3540
3541 if (m_nReserved) {
3542 sprintf(buf, " Reserved=\"%u\"", m_nReserved);
3543 xml += buf;
3544 }
3545 xml += ">\n";
3546
3547 sprintf(buf, " <Wavelengths start=\"" icXmlHalfFmt "\" end=\"" icXmlHalfFmt "\" steps=\"%d\"/>\n", icF16toF(m_Range.start), icF16toF(m_Range.end), m_Range.steps);
3548 xml += buf;
3549
3550 int i;
3551
3552 if (m_pWhite) {
3553 xml += blanks + " <WhiteData>\n";
3554
3555 xml += blanks + " ";
3556 for (i=0; i<(int)m_Range.steps; i++) {
3557 sprintf(buf, " " icXmlFloatFmt, m_pWhite[i]);
3558 xml += buf;
3559 }
3560 xml += "\n";
3561
3562 xml += blanks + " </WhiteData>\n";
3563 }
3564
3565 xml += blanks + "</ReflectanceObserverElement>\n";
3566
3567 return true;
3568}
#define icXmlHalfFmt
Definition IccXmlConfig.h:74
#define icXmlFloatFmt
Definition IccXmlConfig.h:75
virtual icUInt16Number NumInputChannels() const
Definition IccTagMPE.h:159
virtual icUInt16Number NumOutputChannels() const
Definition IccTagMPE.h:160

References icSpectralRange::end, icF16toF(), CIccMpeSpectralObserver::m_flags, CIccMultiProcessElement::m_nReserved, CIccMpeSpectralObserver::m_pWhite, CIccMpeSpectralObserver::m_Range, CIccMultiProcessElement::NumInputChannels(), CIccMultiProcessElement::NumOutputChannels(), icSpectralRange::start, and icSpectralRange::steps.

+ Here is the call graph for this function:

◆ Validate()

icValidateStatus CIccMpeSpectralObserver::Validate ( std::string  sigPath,
std::string &  sReport,
const CIccTagMultiProcessElement pMPE = NULL,
const CIccProfile pProfile = NULL 
) const
virtualinherited

Name: CIccMpeSpectralObserver::Validate

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

1985{
1986 std::string mpeSigPath = sigPath + icGetSigPath(GetType());
1987 icValidateStatus rv = CIccMultiProcessElement::Validate(sigPath, sReport, pMPE, pProfile);
1988
1989 if (!m_Range.steps) {
1990 CIccInfo Info;
1991 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
1992
1993 sReport += icMsgValidateCriticalError;
1994 sReport += sSigPathName;
1995 sReport += " - Cannot have zero spectral range steps!\n";
1997 }
1998
1999 if (m_nOutputChannels != 3) {
2000 CIccInfo Info;
2001 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
2002
2003 sReport += icMsgValidateCriticalError;
2004 sReport += sSigPathName;
2005 sReport += " - Output Channels must be 3!\n";
2007 }
2008
2009 if (!m_pWhite) {
2010 CIccInfo Info;
2011 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
2012
2013 sReport += icMsgValidateCriticalError;
2014 sReport += sSigPathName;
2015 sReport += " - Has Empty White data!\n";
2017 }
2018
2019
2020 if (m_Range.start>= m_Range.end || !m_Range.steps) {
2021 CIccInfo Info;
2022 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
2023
2024 sReport += icMsgValidateCriticalError;
2025 sReport += sSigPathName;
2026 sReport += " - Has an invalid spectral range!\n";
2028 }
2029
2030 return rv;
2031}
icValidateStatus
Definition IccDefs.h:119
@ icValidateCriticalError
Definition IccDefs.h:123
ICCPROFLIB_API std::string icGetSigPath(icUInt32Number sig)
Definition IccUtil.cpp:1191
ICCPROFLIB_API const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
ICCPROFLIB_API icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Definition IccUtil.cpp:244
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
virtual icElemTypeSignature GetType() const =0
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const =0
Definition IccTagMPE.cpp:454

References icSpectralRange::end, CIccInfo::GetSigPathName(), CIccMultiProcessElement::GetType(), icGetSigPath(), icMaxStatus(), icMsgValidateCriticalError, icValidateCriticalError, CIccMultiProcessElement::m_nOutputChannels, CIccMpeSpectralObserver::m_pWhite, CIccMpeSpectralObserver::m_Range, icSpectralRange::start, icSpectralRange::steps, and CIccMultiProcessElement::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccMpeSpectralObserver::Write ( CIccIO pIO)
virtualinherited

Name: CIccMpeSpectralObserver::Write

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

1907{
1909
1910 if (!pIO)
1911 return false;
1912
1913 if (!pIO->Write32(&sig))
1914 return false;
1915
1916 if (!pIO->Write32(&m_nReserved))
1917 return false;
1918
1919 if (!pIO->Write16(&m_nInputChannels))
1920 return false;
1921
1922 if (!pIO->Write16(&m_nOutputChannels))
1923 return false;
1924
1925 if (!pIO->Write16(&m_Range.start))
1926 return false;
1927
1928 if (!pIO->Write16(&m_Range.end))
1929 return false;
1930
1931 if (!pIO->Write16(&m_Range.steps))
1932 return false;
1933
1934 if (!pIO->Write16(&m_flags))
1935 return false;
1936
1937 if (m_pWhite) {
1939 return false;
1940 }
1941 else if (m_Range.steps) {
1942 return false;
1943 }
1944
1945 return true;
1946}
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:122
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
icInt32Number WriteFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:321

References icSpectralRange::end, CIccMultiProcessElement::GetType(), CIccMpeSpectralObserver::m_flags, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, CIccMpeSpectralObserver::m_pWhite, CIccMpeSpectralObserver::m_Range, icSpectralRange::start, icSpectralRange::steps, CIccIO::Write16(), CIccIO::Write32(), and CIccIO::WriteFloat32Float().

+ Here is the call graph for this function:

Field Documentation

◆ m_flags

◆ m_nInputChannels

icUInt16Number CIccMultiProcessElement::m_nInputChannels
protectedinherited

Referenced by CIccMpeBAcs::CIccMpeBAcs(), CIccMpeBAcs::CIccMpeBAcs(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCAM::CIccMpeCAM(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeExtCLUT::CIccMpeExtCLUT(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeToneMap::CIccMpeToneMap(), CIccMpeToneMap::CIccMpeToneMap(), CIccMultiProcessElement::CIccMultiProcessElement(), CIccMpeAcs::Apply(), CIccMpeCurveSet::Apply(), CIccMpeMatrix::Apply(), CIccMpeAcs::Begin(), CIccMpeCurveSet::Begin(), CIccMpeMatrix::Begin(), CIccMpeCLUT::Begin(), CIccMpeEmissionMatrix::Begin(), CIccMpeInvEmissionMatrix::Begin(), CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), CIccMpeEmissionObserver::Begin(), CIccMpeReflectanceObserver::Begin(), CIccMpeSpectralCLUT::copyData(), CIccMpeSpectralMatrix::copyData(), CIccMpeSpectralObserver::copyData(), CIccMpeCurveSet::Describe(), CIccMpeMatrix::Describe(), CIccMpeCalculator::Describe(), CIccMpeSpectralMatrix::Describe(), CIccMpeSpectralObserver::Describe(), CIccMpeXmlCalculator::Flatten(), CIccMultiProcessElement::NumInputChannels(), CIccMpeEmissionMatrix::numVectors(), CIccMpeBAcs::operator=(), CIccMpeCalculator::operator=(), CIccMpeCLUT::operator=(), CIccMpeCurveSet::operator=(), CIccMpeEAcs::operator=(), CIccMpeMatrix::operator=(), CIccMpeTintArray::operator=(), CIccMpeToneMap::operator=(), CIccMpeXmlTintArray::ParseXml(), CIccMpeXmlToneMap::ParseXml(), CIccMpeXmlMatrix::ParseXml(), CIccMpeXmlCLUT::ParseXml(), CIccMpeXmlExtCLUT::ParseXml(), CIccMpeXmlBAcs::ParseXml(), CIccMpeXmlEAcs::ParseXml(), CIccMpeXmlJabToXYZ::ParseXml(), CIccMpeXmlXYZToJab::ParseXml(), CIccMpeXmlCalculator::ParseXml(), CIccMpeXmlEmissionCLUT::ParseXml(), CIccMpeXmlReflectanceCLUT::ParseXml(), CIccMpeAcs::Read(), CIccMpeCurveSet::Read(), CIccMpeTintArray::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeCLUT::SetCLUT(), CIccMpeCurveSet::SetCurve(), CIccMpeSpectralCLUT::SetData(), CIccMpeCalculator::SetSize(), CIccMpeMatrix::SetSize(), CIccMpeSpectralMatrix::SetSize(), CIccMpeSpectralObserver::SetSize(), CIccMpeCurveSet::SetSize(), CIccMpeCurveSet::Validate(), CIccMpeTintArray::Validate(), CIccMpeToneMap::Validate(), CIccMpeCAM::Validate(), CIccMpeInvEmissionMatrix::Validate(), CIccMpeAcs::Write(), CIccMpeCurveSet::Write(), CIccMpeTintArray::Write(), CIccMpeToneMap::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccMpeCalculator::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), and CIccMpeSpectralObserver::Write().

◆ m_nOutputChannels

icUInt16Number CIccMultiProcessElement::m_nOutputChannels
protectedinherited

Referenced by CIccMpeBAcs::CIccMpeBAcs(), CIccMpeBAcs::CIccMpeBAcs(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCAM::CIccMpeCAM(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeExtCLUT::CIccMpeExtCLUT(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeToneMap::CIccMpeToneMap(), CIccMpeToneMap::CIccMpeToneMap(), CIccMultiProcessElement::CIccMultiProcessElement(), CIccMpeTintArray::Apply(), CIccMpeToneMap::Apply(), CIccMpeMatrix::Apply(), CIccMpeAcs::Begin(), CIccMpeTintArray::Begin(), CIccMpeToneMap::Begin(), CIccMpeMatrix::Begin(), CIccMpeEmissionMatrix::Begin(), CIccMpeInvEmissionMatrix::Begin(), CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), CIccMpeEmissionObserver::Begin(), CIccMpeReflectanceObserver::Begin(), CIccMpeToneMap::ClearToneFuncs(), CIccMpeSpectralCLUT::copyData(), CIccMpeSpectralMatrix::copyData(), CIccMpeSpectralObserver::copyData(), CIccMpeToneMap::CopyToneFuncs(), CIccMpeMatrix::Describe(), CIccMpeCalculator::Describe(), CIccMpeSpectralMatrix::Describe(), CIccMpeSpectralObserver::Describe(), CIccMpeTintArray::Describe(), CIccMpeToneMap::Describe(), CIccMpeXmlCalculator::Flatten(), CIccMpeToneMap::Insert(), CIccMultiProcessElement::NumOutputChannels(), CIccMpeInvEmissionMatrix::numVectors(), CIccMpeBAcs::operator=(), CIccMpeCalculator::operator=(), CIccMpeCLUT::operator=(), CIccMpeCurveSet::operator=(), CIccMpeEAcs::operator=(), CIccMpeMatrix::operator=(), CIccMpeTintArray::operator=(), CIccMpeToneMap::operator=(), CIccMpeXmlTintArray::ParseXml(), CIccMpeXmlToneMap::ParseXml(), CIccMpeXmlMatrix::ParseXml(), CIccMpeXmlCLUT::ParseXml(), CIccMpeXmlExtCLUT::ParseXml(), CIccMpeXmlBAcs::ParseXml(), CIccMpeXmlEAcs::ParseXml(), CIccMpeXmlJabToXYZ::ParseXml(), CIccMpeXmlXYZToJab::ParseXml(), CIccMpeXmlCalculator::ParseXml(), CIccMpeXmlEmissionCLUT::ParseXml(), CIccMpeXmlReflectanceCLUT::ParseXml(), CIccMpeAcs::Read(), CIccMpeTintArray::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeCLUT::SetCLUT(), CIccMpeSpectralCLUT::SetData(), CIccMpeToneMap::SetNumOutputChannels(), CIccMpeCalculator::SetSize(), CIccMpeMatrix::SetSize(), CIccMpeSpectralMatrix::SetSize(), CIccMpeSpectralObserver::SetSize(), CIccMpeCurveSet::SetSize(), CIccMpeTintArray::SetVectorSize(), CIccMpeTintArray::Validate(), CIccMpeToneMap::Validate(), CIccMpeCAM::Validate(), CIccMpeSpectralMatrix::Validate(), CIccMpeSpectralObserver::Validate(), CIccMpeAcs::Write(), CIccMpeTintArray::Write(), CIccMpeToneMap::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccMpeCalculator::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), and CIccMpeSpectralObserver::Write().

◆ m_nReserved

icUInt32Number CIccMultiProcessElement::m_nReserved
inherited

Referenced by CIccMpeAcs::CIccMpeAcs(), CIccMpeBAcs::CIccMpeBAcs(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCAM::CIccMpeCAM(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeExtCLUT::CIccMpeExtCLUT(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeToneMap::CIccMpeToneMap(), CIccMpeToneMap::CIccMpeToneMap(), CIccMultiProcessElement::CIccMultiProcessElement(), CIccMpeSpectralCLUT::copyData(), CIccMpeSpectralMatrix::copyData(), CIccMpeSpectralObserver::copyData(), CIccMpeBAcs::operator=(), CIccMpeCalculator::operator=(), CIccMpeCLUT::operator=(), CIccMpeCurveSet::operator=(), CIccMpeEAcs::operator=(), CIccMpeMatrix::operator=(), CIccMpeTintArray::operator=(), CIccMpeToneMap::operator=(), CIccTagXmlMultiProcessElement::ParseElement(), CIccMpeXmlCalculator::ParseImport(), CIccMpeAcs::Read(), CIccMpeCurveSet::Read(), CIccMpeTintArray::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeCalculator::Read(), CIccMpeSpectralMatrix::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeSpectralObserver::Read(), CIccMpeXmlCurveSet::ToXml(), CIccMpeXmlTintArray::ToXml(), CIccMpeXmlToneMap::ToXml(), CIccMpeXmlMatrix::ToXml(), CIccMpeXmlCLUT::ToXml(), CIccMpeXmlExtCLUT::ToXml(), CIccMpeXmlBAcs::ToXml(), CIccMpeXmlEAcs::ToXml(), CIccMpeXmlJabToXYZ::ToXml(), CIccMpeXmlXYZToJab::ToXml(), CIccMpeXmlCalculator::ToXml(), CIccMpeXmlEmissionMatrix::ToXml(), CIccMpeXmlInvEmissionMatrix::ToXml(), CIccMpeXmlEmissionCLUT::ToXml(), CIccMpeXmlReflectanceCLUT::ToXml(), CIccMpeXmlEmissionObserver::ToXml(), ToXml(), CIccMultiProcessElement::Validate(), CIccMpeAcs::Write(), CIccMpeCurveSet::Write(), CIccMpeTintArray::Write(), CIccMpeToneMap::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccMpeCalculator::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), and CIccMpeSpectralObserver::Write().

◆ m_pApplyMtx

◆ m_pWhite

◆ m_Range

◆ m_xyzscale

icFloatNumber CIccMpeSpectralObserver::m_xyzscale[3]
protectedinherited

◆ m_xyzw

icFloatNumber CIccMpeSpectralObserver::m_xyzw[3]
protectedinherited

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