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

Class: CIccMpeReflectanceCLUT. More...

#include <IccMpeSpectral.h>

+ Inheritance diagram for CIccMpeReflectanceCLUT:
+ Collaboration diagram for CIccMpeReflectanceCLUT:

Public Member Functions

virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 Name: CIccMpeReflectanceCLUT::Begin.
 
 CIccMpeReflectanceCLUT ()
 
 CIccMpeReflectanceCLUT (const CIccMpeReflectanceCLUT &ITPC)
 
virtual const icCharGetClassName () const
 
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 IIccExtensionMpeGetExtension ()
 
virtual bool IsAcs ()
 
virtual bool IsSupported ()
 
virtual icUInt16Number NumInputChannels () const
 
virtual icUInt16Number NumOutputChannels () const
 
virtual ~CIccMultiProcessElement ()
 

Protected Member Functions

virtual const char * GetDescribeName () const
 
- Protected Member Functions inherited from CIccMpeSpectralCLUT
void copyData (const CIccMpeSpectralCLUT &ITPC)
 Name: &CIccMpeSpectralCLUT::operator=.
 

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

Class: CIccMpeReflectanceCLUT.

Purpose: The Reflectance CLUT Element

Definition at line 303 of file IccMpeSpectral.h.

Constructor & Destructor Documentation

◆ CIccMpeReflectanceCLUT() [1/2]

CIccMpeReflectanceCLUT::CIccMpeReflectanceCLUT ( )
inline

Definition at line 306 of file IccMpeSpectral.h.

CIccMpeSpectralCLUT()
Name: CIccMpeSpectralCLUT::CIccMpeSpectralCLUT.

◆ CIccMpeReflectanceCLUT() [2/2]

CIccMpeReflectanceCLUT::CIccMpeReflectanceCLUT ( const CIccMpeReflectanceCLUT & ITPC)
inline

Definition at line 307 of file IccMpeSpectral.h.

307: CIccMpeSpectralCLUT(ITPC) {}

◆ ~CIccMpeReflectanceCLUT()

virtual CIccMpeReflectanceCLUT::~CIccMpeReflectanceCLUT ( )
inlinevirtual

Definition at line 310 of file IccMpeSpectral.h.

310{}

Member Function Documentation

◆ Begin()

bool CIccMpeReflectanceCLUT::Begin ( icElemInterp nInterp,
CIccTagMultiProcessElement * pMPE )
virtual

Name: CIccMpeReflectanceCLUT::Begin.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 1518 of file IccMpeSpectral.cpp.

1519{
1521 return false;
1522
1523 switch (m_nInputChannels) {
1524 case 1:
1526 break;
1527 case 2:
1529 break;
1530 case 3:
1531 if (nInterp==icElemInterpTetra)
1533 else
1535 break;
1536 case 4:
1538 break;
1539 case 5:
1541 break;
1542 case 6:
1544 break;
1545 default:
1547 break;
1548 }
1549
1550 IIccProfileConnectionConditions *pAppliedPCC = pMPE->GetAppliedPCC();
1551 if (!pAppliedPCC)
1552 return false;
1553
1554 const CIccTagSpectralViewingConditions *pSVC = pAppliedPCC->getPccViewingConditions();
1555 if (!pSVC)
1556 return false;
1557
1558 CIccMatrixMath observer(3, m_Range.steps);
1559 icSpectralRange illumRange;
1560 const icFloatNumber *illum = pSVC->getIlluminant(illumRange);
1561
1562 if (!pAppliedPCC->getEmissiveObserver(illumRange, illum, observer.entry(0)))
1563 return false;
1564
1565 //
1566 icFloatNumber xyzi[3];
1567
1568 //apply illuminant to observer and calculate XYZ of illuminant
1569 icFloatNumber *pObs = observer.entry(0);
1570 int i, j;
1571 for (i=0; i<3; i++) {
1572 xyzi[i] = 0.0;
1573 for (j=0; j<illumRange.steps; j++) {
1574 *pObs *= illum[j];
1575 xyzi[i] += *pObs;
1576 pObs++;
1577 }
1578 }
1579
1580 //concatenate reflectance range mapping to observer+illuminant
1581 CIccMatrixMath *rangeRef = CIccMatrixMath::rangeMap(m_Range, illumRange);
1582 CIccMatrixMath *pApplyMtx;
1583 if (!rangeRef)
1584 pApplyMtx = &observer;
1585 else
1586 pApplyMtx = rangeRef->Mult(&observer);
1587
1588 if (m_pApplyCLUT)
1589 delete m_pApplyCLUT;
1590
1592
1593 if (!m_pApplyCLUT) {
1594 if (pApplyMtx!=&observer)
1595 delete pApplyMtx;
1596 return false;
1597 }
1598
1601
1602 icFloatNumber *pSrc = m_pCLUT->GetData(0);
1604
1605 icFloatNumber xyzW[3];
1606
1607 pApplyMtx->VectorMult(xyzW, m_pWhite);
1608
1609 bool bUseAbsolute = (m_flags & icRelativeSpectralData)!=0;
1610 bool bLab = (m_flags & icLabSpectralData) != 0;
1611
1612 icFloatNumber xyzscale[3];
1613 if (!bUseAbsolute) {
1614 xyzscale[0] = xyzi[0] / xyzW[0];
1615 xyzscale[1] = xyzi[1] / xyzW[1];
1616 xyzscale[2] = xyzi[2] / xyzW[2];
1617 }
1618
1619 for (i=0; i<(int)m_pCLUT->NumPoints(); i++) {
1620 pApplyMtx->VectorMult(pDst, pSrc);
1621
1622 if (!bUseAbsolute) {
1623 pDst[0] *= xyzscale[0];
1624 pDst[1] *= xyzscale[1];
1625 pDst[2] *= xyzscale[2];
1626 }
1627
1628 if (bLab) {
1629 icXYZtoLab(pDst, pDst, xyzi);
1630 // icLabToPcs(pDst);
1631 }
1632 else {
1633 // icXyzToPcs(pDst);
1634 }
1635 pSrc += m_Range.steps;
1636 pDst += m_nOutputChannels;
1637 }
1638
1639 if (pApplyMtx!=&observer)
1640 delete pApplyMtx;
1641
1643
1644 return true;
1645}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
static icFloatNumber NoClip(icFloatNumber v)
@ ic1dInterp
@ ic3dInterpTetra
@ ic6dInterp
@ icNdInterp
@ ic2dInterp
@ ic4dInterp
@ ic5dInterp
@ ic3dInterp
@ icElemInterpTetra
Definition IccTagMPE.h:95
void icXYZtoLab(icFloatNumber *Lab, const icFloatNumber *XYZ, const icFloatNumber *WhiteXYZ)
Definition IccUtil.cpp:846
Class: CIccCLUT.
Definition IccTagLut.h:326
icUInt16Number GetOutputChannels() const
Definition IccTagLut.h:357
void SetClipFunc(icCLUTCLIPFUNC ClipFunc)
Definition IccTagLut.h:379
void Begin()
Name: CIccCLUT::Begin.
icUInt32Number NumPoints() const
Definition IccTagLut.h:348
icFloatNumber * GetData(int index)
Definition IccTagLut.h:347
const icUInt8Number * GridPointArray() const
Definition IccTagLut.h:351
bool Init(icUInt8Number nGridPoints, icUInt32Number nMaxSize=0, icUInt8Number nBytesPerPoint=4)
Name: CIccCLUT::Init.
Type: Class.
CIccMatrixMath * Mult(const CIccMatrixMath *matrix) const
Name: CIccMatrixMath::Mult.
static CIccMatrixMath * rangeMap(const icSpectralRange &from, const icSpectralRange &to)
Name: CIccMatrixMath::rangeMap.
virtual void VectorMult(icFloatNumber *pDst, const icFloatNumber *pSrc) const
Name: CIccMatrixMath::VectorMult.
icUInt32Number m_flags
icSpectralRange m_Range
icCLUTElemType m_interpType
icFloatNumber * m_pWhite
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
IIccProfileConnectionConditions * GetAppliedPCC()
Definition IccTagMPE.h:403
Class: CIccTagSpectralViewingConditions.
const icFloatNumber * getIlluminant(icSpectralRange &illumRange) const
icFloatNumber * getEmissiveObserver(const icSpectralRange &range, const icFloatNumber *pWhite, icFloatNumber *obsMatrix=NULL)
Definition IccPcc.cpp:231
virtual const CIccTagSpectralViewingConditions * getPccViewingConditions()=0
unsigned char icUInt8Number
Number definitions.
unsigned short icUInt16Number
#define icRelativeSpectralData
MPE Spectral Data Conversion flags.
#define icLabSpectralData
spectral range
icUInt16Number steps

References CIccCLUT::Begin(), CIccMatrixMath::entry(), CIccTagMultiProcessElement::GetAppliedPCC(), CIccCLUT::GetData(), IIccProfileConnectionConditions::getEmissiveObserver(), CIccTagSpectralViewingConditions::getIlluminant(), CIccCLUT::GetOutputChannels(), IIccProfileConnectionConditions::getPccViewingConditions(), CIccCLUT::GridPointArray(), ic1dInterp, ic2dInterp, ic3dInterp, ic3dInterpTetra, ic4dInterp, ic5dInterp, ic6dInterp, icElemInterpTetra, icLabSpectralData, icNdInterp, icRelativeSpectralData, icXYZtoLab(), CIccCLUT::Init(), CIccMpeSpectralCLUT::m_flags, CIccMpeSpectralCLUT::m_interpType, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMpeSpectralCLUT::m_pApplyCLUT, CIccMpeSpectralCLUT::m_pCLUT, CIccMpeSpectralCLUT::m_pWhite, CIccMpeSpectralCLUT::m_Range, CIccMatrixMath::Mult(), NoClip(), CIccCLUT::NumPoints(), CIccMatrixMath::rangeMap(), CIccCLUT::SetClipFunc(), icSpectralRange::steps, and CIccMatrixMath::VectorMult().

+ Here is the call graph for this function:

◆ GetClassName()

virtual const icChar * CIccMpeReflectanceCLUT::GetClassName ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeXmlReflectanceCLUT.

Definition at line 313 of file IccMpeSpectral.h.

313{ return "CIccMpeReflectanceCLUT"; }

◆ GetDescribeName()

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

Implements CIccMpeSpectralCLUT.

Definition at line 320 of file IccMpeSpectral.h.

320{ return "ELEM_REFLECTANCE_CLUT"; }

◆ GetType()

virtual icElemTypeSignature CIccMpeReflectanceCLUT::GetType ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Definition at line 312 of file IccMpeSpectral.h.

@ icSigReflectanceCLUTElemType

References icSigReflectanceCLUTElemType.

◆ IsLateBindingReflectance()

virtual bool CIccMpeReflectanceCLUT::IsLateBindingReflectance ( ) const
inlinevirtual

Reimplemented from CIccMultiProcessElement.

Definition at line 317 of file IccMpeSpectral.h.

317{ return true; }

◆ NewCopy()

virtual CIccMpeReflectanceCLUT * CIccMpeReflectanceCLUT::NewCopy ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Definition at line 309 of file IccMpeSpectral.h.

309{ return new CIccMpeReflectanceCLUT(*this);}

◆ operator=()

CIccMpeReflectanceCLUT & CIccMpeReflectanceCLUT::operator= ( const CIccMpeReflectanceCLUT & ITPC)
inline

Definition at line 308 of file IccMpeSpectral.h.

308{ copyData(ITPC); return *this; }
void copyData(const CIccMpeSpectralCLUT &ITPC)
Name: &CIccMpeSpectralCLUT::operator=.

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