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

#include <IccMpeXml.h>

+ Inheritance diagram for CIccMpeXmlReflectanceCLUT:
+ Collaboration diagram for CIccMpeXmlReflectanceCLUT:

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 ~CIccMpeXmlReflectanceCLUT ()
 
- Public Member Functions inherited from CIccMpeReflectanceCLUT
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 Name: CIccMpeReflectanceCLUT::Begin.
 
 CIccMpeReflectanceCLUT ()
 
 CIccMpeReflectanceCLUT (const CIccMpeReflectanceCLUT &ITPC)
 
virtual icElemTypeSignature GetType () const
 
virtual bool IsLateBindingReflectance () const
 
virtual CIccMpeReflectanceCLUTNewCopy () const
 
CIccMpeReflectanceCLUToperator= (const CIccMpeReflectanceCLUT &ITPC)
 
virtual ~CIccMpeReflectanceCLUT ()
 
- Public Member Functions inherited from CIccMpeSpectralCLUT
virtual void Apply (CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const
 Name: CIccMpeEmissionCLUT::Apply.
 
 CIccMpeSpectralCLUT ()
 Name: CIccMpeSpectralCLUT::CIccMpeSpectralCLUT.
 
 CIccMpeSpectralCLUT (const CIccMpeSpectralCLUT &ITPC)
 Name: CIccMpeSpectralCLUT::CIccMpeSpectralCLUT.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccMpeSpectralCLUT::Describe.
 
CIccCLUTGetApplyCLUT ()
 
CIccCLUTGetCLUT ()
 
virtual CIccApplyMpeGetNewApply (CIccApplyTagMpe *pApplyTag)
 Name: CIccMpeSpectralCLUT::GetNewApply.
 
icFloatNumberGetWhite ()
 
virtual bool IsLateBinding () const
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccMpeSpectralCLUT::Read.
 
void SetData (CIccCLUT *pCLUT, icUInt16Number nStorageType, const icSpectralRange &range, icFloatNumber *pWhite, icUInt16Number nOutputChannels=3)
 Name: CIccMpeSpectralCLUT::SetCLUT.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 Name: CIccMpeSpectralCLUT::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccMpeSpectralCLUT::Write.
 
virtual ~CIccMpeSpectralCLUT ()
 Name: CIccMpeSpectralCLUT::~CIccMpeSpectralCLUT.
 
- Public Member Functions inherited from CIccMultiProcessElement
 CIccMultiProcessElement ()
 
virtual icAcsSignature GetBAcsSig ()
 
virtual icAcsSignature GetEAcsSig ()
 
virtual bool IsAcs ()
 
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 Member Functions inherited from CIccMpeReflectanceCLUT
virtual const char * GetDescribeName () const
 
- Protected Member Functions inherited from CIccMpeSpectralCLUT
void copyData (const CIccMpeSpectralCLUT &ITPC)
 Name: &CIccMpeSpectralCLUT::operator=.
 
- Protected Attributes inherited from CIccMpeSpectralCLUT
icUInt32Number m_flags
 
icCLUTElemType m_interpType
 
icUInt16Number m_nStorageType
 
CIccCLUTm_pApplyCLUT
 
CIccCLUTm_pCLUT
 
icFloatNumberm_pWhite
 
icSpectralRange m_Range
 
- Protected Attributes inherited from CIccMultiProcessElement
icUInt16Number m_nInputChannels
 
icUInt16Number m_nOutputChannels
 

Detailed Description

Definition at line 382 of file IccMpeXml.h.

Constructor & Destructor Documentation

◆ ~CIccMpeXmlReflectanceCLUT()

virtual CIccMpeXmlReflectanceCLUT::~CIccMpeXmlReflectanceCLUT ( )
inlinevirtual

Definition at line 385 of file IccMpeXml.h.

385{}

Member Function Documentation

◆ GetClassName()

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

Reimplemented from CIccMpeReflectanceCLUT.

Definition at line 387 of file IccMpeXml.h.

387{ return "CIccMpeXmlReflectanceCLUT"; }

◆ GetExtension()

virtual IIccExtensionMpe * CIccMpeXmlReflectanceCLUT::GetExtension ( )
inlinevirtual

Reimplemented from CIccMultiProcessElement.

Definition at line 389 of file IccMpeXml.h.

389{ return this; }

◆ ParseXml()

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

Implements CIccMpeXml.

Definition at line 3329 of file IccMpeXml.cpp.

3330{
3331 m_nStorageType = (icUInt16Number)atoi(icXmlAttrValue(pNode, "StorageType", "0"));
3332
3333 m_nInputChannels = atoi(icXmlAttrValue(pNode, "InputChannels"));
3334 m_nOutputChannels = atoi(icXmlAttrValue(pNode, "OutputChannels"));
3335 m_flags = atoi(icXmlAttrValue(pNode, "Flags", 0));
3336
3338 parseStr += "Invalid InputChannels or OutputChannels In CLutElement\n";
3339 return false;
3340 }
3341
3342 xmlNode *pData;
3343
3344 pData = icXmlFindNode(pNode->children, "Wavelengths");
3345 if (pData) {
3346 icFloatNumber dStart = (icFloatNumber)atof(icXmlAttrValue(pData, "start"));
3347 icFloatNumber dEnd = (icFloatNumber)atof(icXmlAttrValue(pData, "end"));
3348 icUInt16Number nSteps = atoi(icXmlAttrValue(pData, "steps"));
3349
3350 if (dStart >= dEnd ||!nSteps) {
3351 parseStr += "Invalid Spectral Range\n";
3352 return false;
3353 }
3354 m_Range.start = icFtoF16(dStart);
3355 m_Range.end = icFtoF16(dEnd);
3356 m_Range.steps = nSteps;
3357 }
3358 else {
3359 parseStr += "Missing Spectral Range\n";
3360 return false;
3361 }
3362
3363 if (m_pWhite)
3364 free(m_pWhite);
3365
3366 m_pWhite = (icFloatNumber *)malloc(m_Range.steps*sizeof(icFloatNumber));
3367 if (!m_pWhite) {
3368 parseStr += "White buffer memory error\n";
3369 return false;
3370 }
3371
3372 pData = icXmlFindNode(pNode->children, "WhiteData");
3373 if (pData) {
3374
3375 if (!CIccFloatArray::ParseArray(m_pWhite, m_Range.steps, pData->children))
3376 return false;
3377 }
3378 else {
3379 parseStr += "Missing WhiteData";
3380 }
3381
3382 if (m_pCLUT) {
3383 delete m_pCLUT;
3384 m_pCLUT = NULL;
3385 }
3386
3387 if (m_pApplyCLUT) {
3388 delete m_pApplyCLUT;
3389 m_pApplyCLUT = NULL;
3390 }
3391
3393 if (pCLut) {
3394 m_pCLUT = pCLut;
3395 return true;
3396 }
3397
3398 return false;
3399}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
CIccCLUT * icCLutFromXml(xmlNode *pNode, int nIn, int nOut, icConvertType nType, std::string &parseStr)
icFloat16Number icFtoF16(icFloat32Number num)
Definition IccUtil.cpp:673
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
@ icConvertFloat
Class: CIccCLUT.
Definition IccTagLut.h:326
icUInt32Number m_flags
icUInt16Number m_nStorageType
icSpectralRange m_Range
icFloatNumber * m_pWhite
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
static bool ParseArray(T *buf, icUInt32Number nBufSize, xmlNode *pNode)
unsigned short icUInt16Number
icUInt16Number steps
icFloat16Number start
icFloat16Number end

References icCLutFromXml(), icConvertFloat, icFtoF16(), icXmlAttrValue(), icXmlFindNode(), and CIccXmlArrayType< T, Tsig >::ParseArray().

+ Here is the call graph for this function:

◆ ToXml()

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

Implements CIccMpeXml.

Definition at line 3288 of file IccMpeXml.cpp.

3289{
3290 char buf[256];
3291 std::string reserved;
3292
3293 xml += blanks + "<ReflectanceCLutElem";
3294
3295 if (m_nReserved) {
3296 sprintf(buf, " Reserved=\"%u\"", m_nReserved);
3297 xml += buf;
3298 }
3299
3300 sprintf(buf, " InputChannels=\"%d\" OutputChannels=\"%d\" Flags=\"%d\">\n", NumInputChannels(), NumOutputChannels(), m_flags);
3301 xml += buf;
3302
3303 sprintf(buf, " <Wavelengths start=\"" icXmlHalfFmt "\" end=\"" icXmlHalfFmt "\" steps=\"%d\"/>\n", icF16toF(m_Range.start), icF16toF(m_Range.end), m_Range.steps);
3304 xml += buf;
3305
3306 int i;
3307
3308 if (m_pWhite) {
3309 xml += blanks + " <WhiteData>\n";
3310
3311 xml += blanks + " ";
3312 for (i=0; i<(int)m_Range.steps; i++) {
3313 sprintf(buf, " " icXmlFloatFmt, m_pWhite[i]);
3314 xml += buf;
3315 }
3316 xml += "\n";
3317
3318 xml += blanks + " </WhiteData>\n";
3319 }
3320
3321 if (!icCLUTDataToXml(xml, m_pCLUT, icConvertFloat, blanks, true))
3322 return false;
3323
3324 xml += blanks + "</ReflectanceCLutElem>\n";
3325
3326 return true;
3327}
icFloatNumber icF16toF(icFloat16Number num)
Definition IccUtil.cpp:629
bool icCLUTDataToXml(std::string &xml, CIccCLUT *pCLUT, icConvertType nType, std::string blanks, bool bSaveGridPoints)
#define icXmlHalfFmt
#define icXmlFloatFmt
virtual icUInt16Number NumInputChannels() const
Definition IccTagMPE.h:159
virtual icUInt16Number NumOutputChannels() const
Definition IccTagMPE.h:160
icUInt32Number m_nReserved
Definition IccTagMPE.h:188

References icCLUTDataToXml(), icConvertFloat, icF16toF(), icXmlFloatFmt, and icXmlHalfFmt.

+ Here is the call graph for this function:

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