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

#include <IccMpeSpectral.h>

+ Inheritance diagram for CIccMpeInvEmissionMatrix:
+ Collaboration diagram for CIccMpeInvEmissionMatrix:

Public Member Functions

 CIccMpeInvEmissionMatrix ()
 
 CIccMpeInvEmissionMatrix (const CIccMpeInvEmissionMatrix &ITPC)
 
virtual ~CIccMpeInvEmissionMatrix ()
 
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 icCharGetClassName () const
 
virtual icAcsSignature GetEAcsSig ()
 
virtual IIccExtensionMpeGetExtension ()
 
icFloatNumberGetMatrix ()
 
virtual CIccApplyMpeGetNewApply (CIccApplyTagMpe *pApplyTag)
 
icFloatNumberGetOffset ()
 
const icSpectralRangeGetRange ()
 
virtual icElemTypeSignature GetType () const
 
icFloatNumberGetWhite ()
 
virtual bool IsAcs ()
 
virtual bool IsLateBinding () const
 
virtual bool IsLateBindingReflectance () const
 
virtual bool IsSupported ()
 
virtual CIccMultiProcessElementNewCopy () const
 
virtual icUInt16Number NumInputChannels () const
 
virtual icUInt16Number NumOutputChannels () const
 
CIccMpeInvEmissionMatrixoperator= (const CIccMpeInvEmissionMatrix &ITPC)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
bool SetSize (icUInt16Number nInputChannels, icUInt16Number nOutputChannels, const icSpectralRange &range)
 
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 CIccMpeSpectralMatrix &ITPC)
 
virtual const char * GetDescribeName () const
 
virtual icUInt16Number numVectors () const
 

Protected Attributes

icUInt16Number m_nInputChannels
 
icUInt16Number m_nOutputChannels
 
icUInt16Number m_nReserved2
 
CIccMatrixMathm_pApplyMtx
 
icFloatNumberm_pMatrix
 
icFloatNumberm_pOffset
 
icFloatNumberm_pWhite
 
icSpectralRange m_Range
 
icUInt32Number m_size
 
icFloatNumber m_xyzOffset [3]
 

Detailed Description

Class: CIccMpeInvEmissionMatrix

Purpose: The Inverse Observed Emission Matrix Element

Constructor & Destructor Documentation

◆ CIccMpeInvEmissionMatrix() [1/2]

CIccMpeInvEmissionMatrix::CIccMpeInvEmissionMatrix ( )
inline
CIccMpeSpectralMatrix()
Definition IccMpeSpectral.cpp:101

References CIccMpeSpectralMatrix::CIccMpeSpectralMatrix().

Referenced by CIccBasicMpeFactory::CreateElement().

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

◆ CIccMpeInvEmissionMatrix() [2/2]

CIccMpeInvEmissionMatrix::CIccMpeInvEmissionMatrix ( const CIccMpeInvEmissionMatrix ITPC)
inline
178: CIccMpeSpectralMatrix(ITPC) {}

References CIccMpeSpectralMatrix::CIccMpeSpectralMatrix().

Referenced by NewCopy().

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

◆ ~CIccMpeInvEmissionMatrix()

virtual CIccMpeInvEmissionMatrix::~CIccMpeInvEmissionMatrix ( )
inlinevirtual
181{}

Member Function Documentation

◆ Apply()

void CIccMpeInvEmissionMatrix::Apply ( CIccApplyMpe pApply,
icFloatNumber dstPixel,
const icFloatNumber srcPixel 
) const
virtual

Name: CIccMpeInvEmissionMatrix::Apply

Purpose:

Args:

Return:

Implements CIccMpeSpectralMatrix.

735{
736 if (m_pApplyMtx) {
737 icFloatNumber xyz[3];
738 xyz[0] = srcPixel[0] - m_xyzOffset[0];
739 xyz[1] = srcPixel[1] - m_xyzOffset[1];
740 xyz[2] = srcPixel[2] - m_xyzOffset[2];
741 m_pApplyMtx->VectorMult(dstPixel, xyz);
742 }
743 else {
744 dstPixel[0] = 0;
745 dstPixel[1] = 0;
746 dstPixel[2] = 0;
747 }
748}
float icFloatNumber
Definition IccDefs.h:101
virtual void VectorMult(icFloatNumber *pDst, const icFloatNumber *pSrc) const
Definition IccMatrixMath.cpp:154
icFloatNumber m_xyzOffset[3]
Definition IccMpeSpectral.h:135
CIccMatrixMath * m_pApplyMtx
Definition IccMpeSpectral.h:134

References CIccMpeSpectralMatrix::m_pApplyMtx, CIccMpeSpectralMatrix::m_xyzOffset, and CIccMatrixMath::VectorMult().

+ Here is the call graph for this function:

◆ Begin()

bool CIccMpeInvEmissionMatrix::Begin ( icElemInterp  nInterp,
CIccTagMultiProcessElement pMPE 
)
virtual

Name: CIccMpeInvEmissionMatrix::Begin

Purpose:

Args:

Return:

Implements CIccMpeSpectralMatrix.

678{
679 if (!m_pOffset ||!pMPE || !m_pMatrix || m_nInputChannels != 3 || m_nOutputChannels != 3)
680 return false;
681
682 IIccProfileConnectionConditions *pAppliedPCC = pMPE->GetAppliedPCC();
683 if (!pAppliedPCC)
684 return false;
685
687 if (!pSVC)
688 return false;
689
690 CIccMatrixMath observer(3, m_Range.steps);
691 icFloat32Number *pSrc, *pMtx;
692
693 if (!pAppliedPCC->getEmissiveObserver(m_Range, m_pWhite, observer.entry(0)))
694 return false;
695
696 observer.VectorMult(m_xyzOffset, m_pOffset);
697
698 //convert m_Matrix emission values to a matrix of XYZ column vectors
700
701 if (!m_pApplyMtx)
702 return false;
703
704 icFloatNumber xyz[3];
705 int i;
706
707 pSrc = m_pMatrix;
708 pMtx = m_pApplyMtx->entry(0);
709 for (i=0; i<m_nInputChannels; i++) {
710 observer.VectorMult(xyz, pSrc);
711 pSrc += m_Range.steps;
712
713 pMtx[0] = xyz[0];
714 pMtx[m_nInputChannels] = xyz[1];
715 pMtx[2*m_nInputChannels] = xyz[2];
716 pMtx++;
717 }
718
720
721 return true;
722}
float icFloat32Number
Definition icProfileHeader.h:313
icUInt16Number steps
Definition icProfileHeader.h:1469
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
icFloatNumber * entry(icUInt16Number nRow, icUInt16Number nCol=0)
Definition IccMatrixMath.h:111
bool Invert()
Definition IccMatrixMath.cpp:276
Definition IccTagBasic.h:1692
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
IIccProfileConnectionConditions * GetAppliedPCC()
Definition IccTagMPE.h:403
icFloatNumber * m_pOffset
Definition IccMpeSpectral.h:131
icSpectralRange m_Range
Definition IccMpeSpectral.h:126
icFloatNumber * m_pWhite
Definition IccMpeSpectral.h:129
icFloatNumber * m_pMatrix
Definition IccMpeSpectral.h:130

References CIccMatrixMath::CIccMatrixMath(), CIccMatrixMath::entry(), CIccTagMultiProcessElement::GetAppliedPCC(), IIccProfileConnectionConditions::getEmissiveObserver(), IIccProfileConnectionConditions::getPccViewingConditions(), CIccMatrixMath::Invert(), CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMpeSpectralMatrix::m_pApplyMtx, CIccMpeSpectralMatrix::m_pMatrix, CIccMpeSpectralMatrix::m_pOffset, CIccMpeSpectralMatrix::m_pWhite, CIccMpeSpectralMatrix::m_Range, CIccMpeSpectralMatrix::m_xyzOffset, icSpectralRange::steps, and CIccMatrixMath::VectorMult().

+ Here is the call graph for this function:

◆ copyData()

void CIccMpeSpectralMatrix::copyData ( const CIccMpeSpectralMatrix matrix)
protectedinherited

Name: &CIccMpeSpectralMatrix::operator=

Purpose:

Args:

Return:

178{
179 m_nReserved = matrix.m_nReserved;
180 m_nReserved2 = matrix.m_nReserved2;
181
184
186
187 if (m_pMatrix)
188 free(m_pMatrix);
189
190 m_size = matrix.m_size;
191 if (matrix.m_pMatrix) {
192 int num = m_size * sizeof(icFloatNumber);
193 m_pMatrix = (icFloatNumber*)malloc(num);
194 memcpy(m_pMatrix, matrix.m_pMatrix, num);
195 }
196 else
197 m_pMatrix = NULL;
198
199 if (m_pOffset)
200 free(m_pOffset);
201
202 if (matrix.m_pOffset) {
203 int num = m_Range.steps * sizeof(icFloatNumber);
204 m_pOffset = (icFloatNumber*)malloc(num);
205 memcpy(m_pOffset, matrix.m_pOffset, num);
206 }
207 else
208 m_pOffset = NULL;
209
210 if (m_pWhite)
211 free(m_pWhite);
212
213 if (matrix.m_pWhite) {
214 int num = m_Range.steps * sizeof(icFloatNumber);
215 m_pWhite = (icFloatNumber*)malloc(num);
216 memcpy(m_pWhite, matrix.m_pWhite, num);
217 }
218 else
219 m_pWhite = NULL;
220
221 m_pApplyMtx = NULL;
222}
icUInt32Number m_nReserved
Definition IccTagMPE.h:188
icUInt16Number m_nReserved2
Definition IccMpeSpectral.h:127
icUInt32Number m_size
Definition IccMpeSpectral.h:132

References CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, CIccMpeSpectralMatrix::m_nReserved2, CIccMpeSpectralMatrix::m_pApplyMtx, CIccMpeSpectralMatrix::m_pMatrix, CIccMpeSpectralMatrix::m_pOffset, CIccMpeSpectralMatrix::m_pWhite, CIccMpeSpectralMatrix::m_Range, CIccMpeSpectralMatrix::m_size, and icSpectralRange::steps.

Referenced by CIccMpeEmissionMatrix::operator=(), and 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 CIccMpeSpectralMatrix::Describe ( std::string &  sDescription,
int  nVerboseness 
)
virtualinherited

Name: CIccMpeSpectralMatrix::Describe

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

311{
312 icChar buf[81];
313 int i, j;
314 icFloatNumber *data = m_pMatrix;
315
316 sprintf(buf, "BEGIN_%s %d %d \n", GetDescribeName(), m_nInputChannels, m_nOutputChannels);
317 sDescription += buf;
318
319 sprintf(buf, "RANGE %f %f %d\n", icF16toF(m_Range.start), icF16toF(m_Range.end), m_Range.steps);
320 sDescription += buf;
321
322 sDescription += "White\n";
323 for (j=0; j<(int)m_Range.steps; j++) {
324 if (j)
325 sDescription += " ";
326 sprintf(buf, "%12.8lf", m_pWhite[j]);
327 sDescription += buf;
328 }
329 sDescription += "\n";
330
331 sDescription += "BLACK_OFFSET\n";
332 for (j=0; j<(int)m_Range.steps; j++) {
333 if (j)
334 sDescription += " ";
335 sprintf(buf, "%12.8lf", m_pOffset[j]);
336 sDescription += buf;
337 }
338 sDescription += "\n";
339
340 if (data) {
341 sDescription += "CHANNEL_DATA\n";
342 for (j=0; j<m_nOutputChannels; j++) {
343 for (i=0; i<(int)m_Range.steps; i++) {
344 if (i)
345 sDescription += " ";
346 sprintf(buf, "%12.8lf", data[i]);
347 sDescription += buf;
348 }
349 sDescription += "\n";
350 data += m_nInputChannels;
351 }
352 }
353
354 sprintf(buf, "END_%s\n", GetDescribeName());
355 sDescription += buf;
356}
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, CIccMpeSpectralMatrix::GetDescribeName(), icF16toF(), CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMpeSpectralMatrix::m_pMatrix, CIccMpeSpectralMatrix::m_pOffset, CIccMpeSpectralMatrix::m_pWhite, CIccMpeSpectralMatrix::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 icChar * CIccMpeInvEmissionMatrix::GetClassName ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeXmlInvEmissionMatrix.

184{ return "CIccMpeEmissionMatrix"; }

◆ GetDescribeName()

virtual const char * CIccMpeInvEmissionMatrix::GetDescribeName ( ) const
inlineprotectedvirtual

Implements CIccMpeSpectralMatrix.

192{ return "ELEM_INV_OBS_EMIS_MATRIX"; }

◆ GetEAcsSig()

virtual icAcsSignature CIccMultiProcessElement::GetEAcsSig ( )
inlinevirtualinherited

Reimplemented in CIccMpeEAcs.

179{ return icSigAcsZero; }

◆ GetExtension()

◆ GetMatrix()

icFloatNumber * CIccMpeSpectralMatrix::GetMatrix ( )
inlineinherited
111{return m_pMatrix;}

References CIccMpeSpectralMatrix::m_pMatrix.

◆ 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:

◆ GetOffset()

icFloatNumber * CIccMpeSpectralMatrix::GetOffset ( )
inlineinherited
112{return m_pOffset;}

References CIccMpeSpectralMatrix::m_pOffset.

◆ GetRange()

const icSpectralRange & CIccMpeSpectralMatrix::GetRange ( )
inlineinherited
106{ return m_Range;}

References CIccMpeSpectralMatrix::m_Range.

◆ GetType()

virtual icElemTypeSignature CIccMpeInvEmissionMatrix::GetType ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

@ icSigInvEmissionMatrixElemType
Definition icProfileHeader.h:661

References icSigInvEmissionMatrixElemType.

Referenced by Validate().

+ Here is the caller graph for this function:

◆ GetWhite()

icFloatNumber * CIccMpeSpectralMatrix::GetWhite ( )
inlineinherited
110{ return m_pWhite;}

References CIccMpeSpectralMatrix::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 CIccMpeSpectralMatrix::IsLateBinding ( ) const
inlinevirtualinherited

Reimplemented from CIccMultiProcessElement.

119{ return true; }

◆ IsLateBindingReflectance()

virtual bool CIccMultiProcessElement::IsLateBindingReflectance ( ) const
inlinevirtualinherited

Reimplemented in CIccMpeCalculator, CIccMpeReflectanceCLUT, and CIccMpeReflectanceObserver.

185{ return false; }

Referenced by CIccMpeCalculator::IsLateBindingReflectance(), and CIccTagMultiProcessElement::IsLateBindingReflectance().

+ Here is the caller graph for this function:

◆ 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 CIccMultiProcessElement * CIccMpeInvEmissionMatrix::NewCopy ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

180{ return new CIccMpeInvEmissionMatrix(*this);}
CIccMpeInvEmissionMatrix()
Definition IccMpeSpectral.h:177

References CIccMpeInvEmissionMatrix().

+ Here is the call graph for this function:

◆ NumInputChannels()

◆ NumOutputChannels()

◆ numVectors()

virtual icUInt16Number CIccMpeInvEmissionMatrix::numVectors ( ) const
inlineprotectedvirtual

Implements CIccMpeSpectralMatrix.

193{ return m_nOutputChannels; }

References CIccMultiProcessElement::m_nOutputChannels.

Referenced by CIccMpeXmlInvEmissionMatrix::ParseXml(), and CIccMpeXmlInvEmissionMatrix::ToXml().

+ Here is the caller graph for this function:

◆ operator=()

CIccMpeInvEmissionMatrix & CIccMpeInvEmissionMatrix::operator= ( const CIccMpeInvEmissionMatrix ITPC)
inline
179{ copyData(ITPC); return *this; }
void copyData(const CIccMpeSpectralMatrix &ITPC)
Definition IccMpeSpectral.cpp:177

References CIccMpeSpectralMatrix::copyData().

+ Here is the call graph for this function:

◆ Read()

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

Name: CIccMpeSpectralMatrix::Read

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

369{
371
372 icUInt32Number headerSize = sizeof(icElemTypeSignature) +
373 sizeof(icUInt32Number) +
374 sizeof(icUInt16Number) +
375 sizeof(icUInt16Number) +
376 sizeof(icUInt16Number) +
377 sizeof(icUInt16Number) +
378 sizeof(icUInt16Number) +
379 sizeof(icUInt16Number);
380
381 if (headerSize > size)
382 return false;
383
384 if (!pIO) {
385 return false;
386 }
387
388 icUInt16Number nInputChannels, nOutputChannels;
389 icSpectralRange range;
390
391 if (!pIO->Read32(&sig))
392 return false;
393
394 if (!pIO->Read32(&m_nReserved))
395 return false;
396
397 if (!pIO->Read16(&nInputChannels))
398 return false;
399
400 if (!pIO->Read16(&nOutputChannels))
401 return false;
402
403 if (!pIO->Read16(&range.start))
404 return false;
405
406 if (!pIO->Read16(&range.end))
407 return false;
408
409 if (!pIO->Read16(&range.steps))
410 return false;
411
412 if (!pIO->Read16(&m_nReserved2))
413 return false;
414
415 SetSize(nInputChannels, nOutputChannels, range);
416 if (!m_pWhite || !m_pMatrix || !m_pOffset)
417 return false;
418
419 if (size<headerSize + (int)range.steps*sizeof(icFloatNumber))
420 return false;
421
422 //Read White data
423 if (pIO->ReadFloat32Float(m_pWhite, range.steps)!=range.steps)
424 return false;
425
426 if (size<headerSize + (int)range.steps*sizeof(icFloatNumber) + m_size * sizeof(icFloatNumber))
427 return false;
428
429 //Read Matrix data
431 return false;
432
433 if (size>=headerSize + 2*(int)range.steps*sizeof(icFloatNumber) + m_size * sizeof(icFloatNumber)) {
434 if (pIO->ReadFloat32Float(m_pOffset, range.steps)!=range.steps)
435 return false;
436 }
437 else {
438 memset(m_pOffset, 0, (int)range.steps*sizeof(icFloatNumber));
439 }
440
441 return true;
442}
unsigned short icUInt16Number
Definition icProfileHeader.h:256
long icInt32Number
Definition icProfileHeader.h:291
icElemTypeSignature
Definition icProfileHeader.h:641
unsigned long icUInt32Number
Definition icProfileHeader.h:262
Definition icProfileHeader.h:1466
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
bool SetSize(icUInt16Number nInputChannels, icUInt16Number nOutputChannels, const icSpectralRange &range)
Definition IccMpeSpectral.cpp:260

References icSpectralRange::end, CIccMultiProcessElement::m_nReserved, CIccMpeSpectralMatrix::m_nReserved2, CIccMpeSpectralMatrix::m_pMatrix, CIccMpeSpectralMatrix::m_pOffset, CIccMpeSpectralMatrix::m_pWhite, CIccMpeSpectralMatrix::m_size, CIccIO::Read16(), CIccIO::Read32(), CIccIO::ReadFloat32Float(), CIccMpeSpectralMatrix::SetSize(), icSpectralRange::start, and icSpectralRange::steps.

+ Here is the call graph for this function:

◆ SetSize()

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

Name: CIccMpeSpectralMatrix::SetSize

Purpose:

Args:

Return:

261{
262 if (m_pMatrix) {
263 free(m_pMatrix);
264 m_pMatrix = NULL;
265 }
266
267 if (m_pWhite) {
268 free(m_pWhite);
269 m_pWhite = NULL;
270 }
271
272 if (m_pOffset) {
273 free(m_pOffset);
274 m_pOffset = NULL;
275 }
276
277 if (m_pApplyMtx) {
278 delete m_pApplyMtx;
279 m_pApplyMtx = NULL;
280 }
281
282 m_nInputChannels = nInputChannels;
283 m_nOutputChannels = nOutputChannels;
284 m_Range = range;
285
287
288 m_pMatrix = (icFloatNumber*)calloc(m_size, sizeof(icFloatNumber));
289 m_pOffset = (icFloatNumber*)calloc(range.steps, sizeof(icFloatNumber));
290 m_pWhite = (icFloatNumber*)calloc(range.steps, sizeof(icFloatNumber));
291
292 if (!m_pMatrix || !m_pOffset || !m_pWhite) {
293 m_size = 0;
294 return false;
295 }
296
297 return true;
298}
virtual icUInt16Number numVectors() const =0

References CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMpeSpectralMatrix::m_pApplyMtx, CIccMpeSpectralMatrix::m_pMatrix, CIccMpeSpectralMatrix::m_pOffset, CIccMpeSpectralMatrix::m_pWhite, CIccMpeSpectralMatrix::m_Range, CIccMpeSpectralMatrix::m_size, CIccMpeSpectralMatrix::numVectors(), and icSpectralRange::steps.

Referenced by CIccMpeXmlEmissionMatrix::ParseXml(), CIccMpeXmlInvEmissionMatrix::ParseXml(), and CIccMpeSpectralMatrix::Read().

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

◆ Validate()

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

Name: CIccMpeInvEmissionMatrix::Validate

Purpose:

Args:

Return:

Reimplemented from CIccMpeSpectralMatrix.

761{
762 std::string mpeSigPath = sigPath + icGetSigPath(GetType());
763 icValidateStatus rv = CIccMpeSpectralMatrix::Validate(sigPath, sReport, pMPE, pProfile);
764
765 if (m_nInputChannels != 3) {
766 CIccInfo Info;
767 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
768
770 sReport += sSigPathName;
771 sReport += " - Input Channels must be 3!\n";
773 }
774
775 return rv;
776}
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 icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
Definition IccMpeSpectral.cpp:517
virtual icElemTypeSignature GetType() const
Definition IccMpeSpectral.h:183

References CIccInfo::GetSigPathName(), GetType(), icGetSigPath(), icMaxStatus(), icMsgValidateCriticalError, icValidateCriticalError, CIccMultiProcessElement::m_nInputChannels, and CIccMpeSpectralMatrix::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccMpeSpectralMatrix::Write ( CIccIO pIO)
virtualinherited

Name: CIccMpeSpectralMatrix::Write

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

455{
457
458 if (!pIO)
459 return false;
460
461 if (!pIO->Write32(&sig))
462 return false;
463
464 if (!pIO->Write32(&m_nReserved))
465 return false;
466
467 if (!pIO->Write16(&m_nInputChannels))
468 return false;
469
470 if (!pIO->Write16(&m_nOutputChannels))
471 return false;
472
473 if (!pIO->Write16(&m_Range.start))
474 return false;
475
476 if (!pIO->Write16(&m_Range.end))
477 return false;
478
479 if (!pIO->Write16(&m_Range.steps))
480 return false;
481
482 if (!pIO->Write16(&m_nReserved2))
483 return false;
484
485 if (m_pWhite) {
487 return false;
488 }
489 else if (m_Range.steps) {
490 return false;
491 }
492
493 if (m_pMatrix) {
495 return false;
496 }
497
498 //Write Constant data
499 if (m_pOffset) {
501 return false;
502 }
503
504 return true;
505}
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
virtual icElemTypeSignature GetType() const =0

References icSpectralRange::end, CIccMultiProcessElement::GetType(), CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, CIccMpeSpectralMatrix::m_nReserved2, CIccMpeSpectralMatrix::m_pMatrix, CIccMpeSpectralMatrix::m_pOffset, CIccMpeSpectralMatrix::m_pWhite, CIccMpeSpectralMatrix::m_Range, CIccMpeSpectralMatrix::m_size, icSpectralRange::start, icSpectralRange::steps, CIccIO::Write16(), CIccIO::Write32(), and CIccIO::WriteFloat32Float().

+ Here is the call graph for this function:

Field Documentation

◆ 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(), 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(), 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(), 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(), 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(), CIccMpeXmlReflectanceObserver::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_nReserved2

◆ m_pApplyMtx

◆ m_pMatrix

◆ m_pOffset

◆ m_pWhite

◆ m_Range

◆ m_size

◆ m_xyzOffset

icFloatNumber CIccMpeSpectralMatrix::m_xyzOffset[3]
protectedinherited

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