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

#include <IccMpeSpectral.h>

+ Inheritance diagram for CIccMpeEmissionMatrix:
+ Collaboration diagram for CIccMpeEmissionMatrix:

Public Member Functions

 CIccMpeEmissionMatrix ()
 
 CIccMpeEmissionMatrix (const CIccMpeEmissionMatrix &ITPC)
 
virtual ~CIccMpeEmissionMatrix ()
 
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
 
CIccMpeEmissionMatrixoperator= (const CIccMpeEmissionMatrix &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: CIccMpeEmissionMatrix

Purpose: The Observed Emission Matrix Element

Constructor & Destructor Documentation

◆ CIccMpeEmissionMatrix() [1/2]

CIccMpeEmissionMatrix::CIccMpeEmissionMatrix ( )
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:

◆ CIccMpeEmissionMatrix() [2/2]

CIccMpeEmissionMatrix::CIccMpeEmissionMatrix ( const CIccMpeEmissionMatrix ITPC)
inline
151: CIccMpeSpectralMatrix(ITPC) {}

References CIccMpeSpectralMatrix::CIccMpeSpectralMatrix().

Referenced by NewCopy().

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

◆ ~CIccMpeEmissionMatrix()

virtual CIccMpeEmissionMatrix::~CIccMpeEmissionMatrix ( )
inlinevirtual
154{}

Member Function Documentation

◆ Apply()

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

Name: CIccMpeEmissionMatrix::Apply

Purpose:

Args:

Return:

Implements CIccMpeSpectralMatrix.

652{
653 if (m_pApplyMtx) {
654 m_pApplyMtx->VectorMult(dstPixel, srcPixel);
655 dstPixel[0] += m_xyzOffset[0];
656 dstPixel[1] += m_xyzOffset[1];
657 dstPixel[2] += m_xyzOffset[2];
658 }
659 else {
660 dstPixel[0] = 0;
661 dstPixel[1] = 0;
662 dstPixel[2] = 0;
663 }
664}
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 CIccMpeEmissionMatrix::Begin ( icElemInterp  nInterp,
CIccTagMultiProcessElement pMPE 
)
virtual

Name: CIccMpeEmissionMatrix::Begin

Purpose:

Args:

Return:

Implements CIccMpeSpectralMatrix.

596{
597 if (!m_pOffset ||!pMPE || !m_pMatrix || m_nOutputChannels != 3)
598 return false;
599
600 IIccProfileConnectionConditions *pAppliedPCC = pMPE->GetAppliedPCC();
601 if (!pAppliedPCC)
602 return false;
603
605 if (!pSVC)
606 return false;
607
608 CIccMatrixMath observer(3, m_Range.steps);
609 icFloat32Number *pSrc, *pMtx;
610
611 if (!pAppliedPCC->getEmissiveObserver(m_Range, m_pWhite, observer.entry(0)))
612 return false;
613
614 //convert m_Matrix emission values to a matrix of XYZ column vectors
616
617 if (!m_pApplyMtx)
618 return false;
619
620 icFloatNumber xyz[3];
621 int i;
622
623 pSrc = m_pMatrix;
624 pMtx = m_pApplyMtx->entry(0);
625 for (i=0; i<m_nInputChannels; i++) {
626 observer.VectorMult(xyz, pSrc);
627 pSrc += m_Range.steps;
628
629 pMtx[0] = xyz[0];
630 pMtx[m_nInputChannels] = xyz[1];
631 pMtx[2*m_nInputChannels] = xyz[2];
632 pMtx++;
633 }
634
635 //Now convert offset emission to XYZ offset
636 observer.VectorMult(m_xyzOffset, m_pOffset);
637
638 return true;
639}
float icFloat32Number
Definition icProfileHeader.h:313
icUInt16Number steps
Definition icProfileHeader.h:1469
float icFloatNumber
Definition IccDefs.h:101
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
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(), 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 operator=(), and CIccMpeInvEmissionMatrix::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 * CIccMpeEmissionMatrix::GetClassName ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeXmlEmissionMatrix.

157{ return "CIccMpeEmissionMatrix"; }

◆ GetDescribeName()

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

Implements CIccMpeSpectralMatrix.

163{ return "ELEM_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 CIccMpeEmissionMatrix::GetType ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

@ icSigEmissionMatrixElemType
Definition icProfileHeader.h:660

References icSigEmissionMatrixElemType.

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

Implements CIccMultiProcessElement.

153{ return new CIccMpeEmissionMatrix(*this);}
CIccMpeEmissionMatrix()
Definition IccMpeSpectral.h:150

References CIccMpeEmissionMatrix().

+ Here is the call graph for this function:

◆ NumInputChannels()

◆ NumOutputChannels()

◆ numVectors()

virtual icUInt16Number CIccMpeEmissionMatrix::numVectors ( ) const
inlineprotectedvirtual

Implements CIccMpeSpectralMatrix.

164{ return m_nInputChannels; }

References CIccMultiProcessElement::m_nInputChannels.

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

+ Here is the caller graph for this function:

◆ operator=()

CIccMpeEmissionMatrix & CIccMpeEmissionMatrix::operator= ( const CIccMpeEmissionMatrix ITPC)
inline
152{ 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 CIccMpeSpectralMatrix::Validate ( std::string  sigPath,
std::string &  sReport,
const CIccTagMultiProcessElement pMPE = NULL,
const CIccProfile pProfile = NULL 
) const
virtualinherited

Name: CIccMpeSpectralMatrix::Validate

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeInvEmissionMatrix.

518{
519 std::string mpeSigPath = sigPath + icGetSigPath(GetType());
520 icValidateStatus rv = CIccMultiProcessElement::Validate(sigPath, sReport, pMPE, pProfile);
521
522 if (!m_Range.steps) {
523 CIccInfo Info;
524 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
525
527 sReport += sSigPathName;
528 sReport += " - Cannot have zero spectral range steps!\n";
530 }
531
532 if (m_nOutputChannels != 3) {
533 CIccInfo Info;
534 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
535
537 sReport += sSigPathName;
538 sReport += " - Output Channels must be 3!\n";
540 }
541
542 if (!m_pWhite) {
543 CIccInfo Info;
544 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
545
547 sReport += sSigPathName;
548 sReport += " - Has Empty White data!\n";
550 }
551
552 if (!m_pMatrix) {
553 CIccInfo Info;
554 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
555
557 sReport += sSigPathName;
558 sReport += " - Has Empty Matrix data!\n";
560 }
561
562 if (!m_pOffset) {
563 CIccInfo Info;
564 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
565
567 sReport += sSigPathName;
568 sReport += " - Has Empty Matrix Constant data!\n";
570 }
571
572 if (m_Range.start>= m_Range.end || !m_Range.steps) {
573 CIccInfo Info;
574 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
575
577 sReport += sSigPathName;
578 sReport += " - Has an invalid spectral range!\n";
580 }
581
582 return rv;
583}
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, CIccMpeSpectralMatrix::m_pMatrix, CIccMpeSpectralMatrix::m_pOffset, CIccMpeSpectralMatrix::m_pWhite, CIccMpeSpectralMatrix::m_Range, icSpectralRange::start, icSpectralRange::steps, and CIccMultiProcessElement::Validate().

Referenced by CIccMpeInvEmissionMatrix::Validate().

+ Here is the call graph for this function:
+ Here is the caller 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

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