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

#include <IccMpeXml.h>

+ Inheritance diagram for CIccMpeXmlEmissionCLUT:
+ Collaboration diagram for CIccMpeXmlEmissionCLUT:

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 ~CIccMpeXmlEmissionCLUT ()
 
- Public Member Functions inherited from CIccMpeEmissionCLUT
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 Name: CIccMpeEmissionCLUT::Begin.
 
 CIccMpeEmissionCLUT ()
 
 CIccMpeEmissionCLUT (const CIccMpeEmissionCLUT &ITPC)
 
virtual icElemTypeSignature GetType () const
 
virtual CIccMultiProcessElementNewCopy () const
 
CIccMpeEmissionCLUToperator= (const CIccMpeEmissionCLUT &ITPC)
 
virtual ~CIccMpeEmissionCLUT ()
 
- 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 IsLateBindingReflectance () const
 
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 CIccMpeEmissionCLUT
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 369 of file IccMpeXml.h.

Constructor & Destructor Documentation

◆ ~CIccMpeXmlEmissionCLUT()

virtual CIccMpeXmlEmissionCLUT::~CIccMpeXmlEmissionCLUT ( )
inlinevirtual

Definition at line 372 of file IccMpeXml.h.

372{}

Member Function Documentation

◆ GetClassName()

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

Reimplemented from CIccMpeEmissionCLUT.

Definition at line 374 of file IccMpeXml.h.

374{ return "CIccMpeXmlEmissionCLUT"; }

◆ GetExtension()

virtual IIccExtensionMpe * CIccMpeXmlEmissionCLUT::GetExtension ( )
inlinevirtual

Reimplemented from CIccMultiProcessElement.

Definition at line 376 of file IccMpeXml.h.

376{ return this; }

◆ ParseXml()

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

Implements CIccMpeXml.

Definition at line 3216 of file IccMpeXml.cpp.

3217{
3218 m_nStorageType = (icUInt16Number)atoi(icXmlAttrValue(pNode, "StorageType", "0"));
3219
3220 m_nInputChannels = atoi(icXmlAttrValue(pNode, "InputChannels"));
3221 m_nOutputChannels = atoi(icXmlAttrValue(pNode, "OutputChannels"));
3222 m_flags = atoi(icXmlAttrValue(pNode, "Flags", 0));
3223
3225 parseStr += "Invalid InputChannels or OutputChannels In CLutElement\n";
3226 return false;
3227 }
3228
3229 xmlNode *pData;
3230
3231 pData = icXmlFindNode(pNode->children, "Wavelengths");
3232 if (pData) {
3233 icFloatNumber dStart = (icFloatNumber)atof(icXmlAttrValue(pData, "start"));
3234 icFloatNumber dEnd = (icFloatNumber)atof(icXmlAttrValue(pData, "end"));
3235 icUInt16Number nSteps = atoi(icXmlAttrValue(pData, "steps"));
3236
3237 if (dStart >= dEnd ||!nSteps) {
3238 parseStr += "Invalid Spectral Range\n";
3239 return false;
3240 }
3241 m_Range.start = icFtoF16(dStart);
3242 m_Range.end = icFtoF16(dEnd);
3243 m_Range.steps = nSteps;
3244 }
3245 else {
3246 parseStr += "Missing Spectral Range\n";
3247 return false;
3248 }
3249
3250 if (m_pWhite)
3251 free(m_pWhite);
3252
3253 m_pWhite = (icFloatNumber *)malloc(m_Range.steps*sizeof(icFloatNumber));
3254 if (!m_pWhite) {
3255 parseStr += "White buffer memory error\n";
3256 return false;
3257 }
3258
3259 pData = icXmlFindNode(pNode->children, "WhiteData");
3260 if (pData) {
3261
3262 if (!CIccFloatArray::ParseArray(m_pWhite, m_Range.steps, pData->children))
3263 return false;
3264 }
3265 else {
3266 parseStr += "Missing White Data";
3267 }
3268
3269 if (m_pCLUT) {
3270 delete m_pCLUT;
3271 m_pCLUT = NULL;
3272 }
3273
3274 if (m_pApplyCLUT) {
3275 delete m_pApplyCLUT;
3276 m_pApplyCLUT = NULL;
3277 }
3278
3280 if (pCLut) {
3281 m_pCLUT = pCLut;
3282 return true;
3283 }
3284
3285 return false;
3286}
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 CIccMpeXmlEmissionCLUT::ToXml ( std::string & xml,
std::string blanks = "" )
virtual

Implements CIccMpeXml.

Definition at line 3175 of file IccMpeXml.cpp.

3176{
3177 char buf[256];
3178 std::string reserved;
3179
3180 xml += blanks + "<EmissionCLutElement";
3181
3182 if (m_nReserved) {
3183 sprintf(buf, " Reserved=\"%u\"", m_nReserved);
3184 xml += buf;
3185 }
3186
3187 sprintf(buf, " InputChannels=\"%d\" OutputChannels=\"%d\" Flags=\"%d\" StorageType=\"%d\">\n", NumInputChannels(), NumOutputChannels(), m_flags, m_nStorageType);
3188 xml += buf;
3189
3190 sprintf(buf, " <Wavelengths start=\"" icXmlHalfFmt "\" end=\"" icXmlHalfFmt "\" steps=\"%d\"/>\n", icF16toF(m_Range.start), icF16toF(m_Range.end), m_Range.steps);
3191 xml += blanks + buf;
3192
3193 int i;
3194
3195 if (m_pWhite) {
3196 xml += blanks + " <WhiteData>\n";
3197
3198 xml += blanks + " ";
3199 for (i=0; i<(int)m_Range.steps; i++) {
3200 sprintf(buf, " " icXmlFloatFmt, m_pWhite[i]);
3201 xml += buf;
3202 }
3203 xml += "\n";
3204
3205 xml += blanks + " </WhiteData>\n";
3206 }
3207
3208 if (!icCLUTDataToXml(xml, m_pCLUT, icConvertFloat, blanks, true))
3209 return false;
3210
3211 xml += blanks + "</EmissionCLutElement>\n";
3212
3213 return true;
3214}
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: