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

Class: CIccMpeCLUT. More...

#include <IccMpeBasic.h>

+ Inheritance diagram for CIccMpeCLUT:
+ Collaboration diagram for CIccMpeCLUT:

Public Member Functions

virtual void Apply (CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const
 Name: CIccMpeCLUT::Apply.
 
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 Name: CIccMpeCLUT::Begin.
 
 CIccMpeCLUT ()
 Name: CIccMpeCLUT::CIccMpeCLUT.
 
 CIccMpeCLUT (const CIccMpeCLUT &clut)
 Name: CIccMpeCLUT::CIccMpeCLUT.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccMpeCLUT::Describe.
 
virtual const icCharGetClassName () const
 
CIccCLUTGetCLUT ()
 
virtual CIccApplyMpeGetNewApply (CIccApplyTagMpe *pApplyTag)
 Name: CIccMpeCLUT::Begin.
 
virtual icElemTypeSignature GetType () const
 
virtual CIccMultiProcessElementNewCopy () const
 
CIccMpeCLUToperator= (const CIccMpeCLUT &clut)
 Name: &CIccMpeCLUT::operator=.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccMpeCLUT::Read.
 
void SetCLUT (CIccCLUT *pCLUT)
 Name: CIccMpeCLUT::SetCLUT.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 Name: CIccMpeCLUT::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccMpeCLUT::Write.
 
virtual ~CIccMpeCLUT ()
 Name: CIccMpeCLUT::~CIccMpeCLUT.
 
- Public Member Functions inherited from CIccMultiProcessElement
 CIccMultiProcessElement ()
 
virtual icAcsSignature GetBAcsSig ()
 
virtual icAcsSignature GetEAcsSig ()
 
virtual IIccExtensionMpeGetExtension ()
 
virtual bool IsAcs ()
 
virtual bool IsLateBinding () const
 
virtual bool IsLateBindingReflectance () const
 
virtual bool IsSupported ()
 
virtual icUInt16Number NumInputChannels () const
 
virtual icUInt16Number NumOutputChannels () const
 
virtual ~CIccMultiProcessElement ()
 

Protected Attributes

icCLUTElemType m_interpType
 
CIccCLUTm_pCLUT
 
- Protected Attributes inherited from CIccMultiProcessElement
icUInt16Number m_nInputChannels
 
icUInt16Number m_nOutputChannels
 

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
 

Detailed Description

Class: CIccMpeCLUT.

Purpose: The float Color LookUp Table tag

Definition at line 655 of file IccMpeBasic.h.

Constructor & Destructor Documentation

◆ CIccMpeCLUT() [1/2]

CIccMpeCLUT::CIccMpeCLUT ( )

Name: CIccMpeCLUT::CIccMpeCLUT.

Purpose:

Args:

Return:

Definition at line 5362 of file IccMpeBasic.cpp.

5363{
5364 m_pCLUT = NULL;
5365 m_nInputChannels = 0;
5368 m_nReserved = 0;
5369}
@ ic1dInterp
CIccCLUT * m_pCLUT
icCLUTElemType m_interpType
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
icUInt32Number m_nReserved
Definition IccTagMPE.h:188

References ic1dInterp.

◆ CIccMpeCLUT() [2/2]

CIccMpeCLUT::CIccMpeCLUT ( const CIccMpeCLUT & clut)

Name: CIccMpeCLUT::CIccMpeCLUT.

Purpose:

Args:

Return:

Definition at line 5381 of file IccMpeBasic.cpp.

5382{
5383 if (clut.m_pCLUT)
5384 m_pCLUT = new CIccCLUT(*clut.m_pCLUT);
5385 else
5386 m_pCLUT = NULL;
5387
5388 m_nReserved = clut.m_nReserved;
5392}
Class: CIccCLUT.
Definition IccTagLut.h:326

References ic1dInterp, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, and m_pCLUT.

◆ ~CIccMpeCLUT()

CIccMpeCLUT::~CIccMpeCLUT ( )
virtual

Name: CIccMpeCLUT::~CIccMpeCLUT.

Purpose:

Args:

Return:

Definition at line 5431 of file IccMpeBasic.cpp.

5432{
5433 if (m_pCLUT)
5434 delete m_pCLUT;
5435}

Member Function Documentation

◆ Apply()

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

Name: CIccMpeCLUT::Apply.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 5656 of file IccMpeBasic.cpp.

5657{
5658 const CIccCLUT *pCLUT = m_pCLUT;
5659
5660 switch(m_interpType) {
5661 case ic1dInterp:
5662 pCLUT->Interp1d(dstPixel, srcPixel);
5663 break;
5664 case ic2dInterp:
5665 pCLUT->Interp2d(dstPixel, srcPixel);
5666 break;
5667 case ic3dInterpTetra:
5668 pCLUT->Interp3dTetra(dstPixel, srcPixel);
5669 break;
5670 case ic3dInterp:
5671 pCLUT->Interp3d(dstPixel, srcPixel);
5672 break;
5673 case ic4dInterp:
5674 pCLUT->Interp4d(dstPixel, srcPixel);
5675 break;
5676 case ic5dInterp:
5677 pCLUT->Interp5d(dstPixel, srcPixel);
5678 break;
5679 case ic6dInterp:
5680 pCLUT->Interp6d(dstPixel, srcPixel);
5681 break;
5682 case icNdInterp:
5683 CIccApplyMpeCLUT* pApplyCLUT = (CIccApplyMpeCLUT*)pApply;
5684 pCLUT->InterpND(dstPixel, srcPixel, pApplyCLUT->m_pApply);
5685 break;
5686 }
5687}
@ ic3dInterpTetra
@ ic6dInterp
@ icNdInterp
@ ic2dInterp
@ ic4dInterp
@ ic5dInterp
@ ic3dInterp
Class: CIccApplyMpeCLUT.
CIccApplyCLUT * m_pApply
void Interp4d(icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
Name: CIccCLUT::Interp4d.
void Interp2d(icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
Name: CIccCLUT::Interp2d.
void Interp6d(icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
Name: CIccCLUT::Interp6d.
void Interp3d(icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
Name: CIccCLUT::Interp3d.
void Interp5d(icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
Name: CIccCLUT::Interp5d.
void Interp3dTetra(icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
Name: CIccCLUT::Interp3dTetra.
void Interp1d(icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
Name: CIccCLUT::Interp1d.
void InterpND(icFloatNumber *destPixel, const icFloatNumber *srcPixel, CIccApplyCLUT *pApply) const
Name: CIccCLUT::InterpND.

References ic1dInterp, ic2dInterp, ic3dInterp, ic3dInterpTetra, ic4dInterp, ic5dInterp, ic6dInterp, icNdInterp, CIccCLUT::Interp1d(), CIccCLUT::Interp2d(), CIccCLUT::Interp3d(), CIccCLUT::Interp3dTetra(), CIccCLUT::Interp4d(), CIccCLUT::Interp5d(), CIccCLUT::Interp6d(), CIccCLUT::InterpND(), and CIccApplyMpeCLUT::m_pApply.

+ Here is the call graph for this function:

◆ Begin()

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

Name: CIccMpeCLUT::Begin.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 5610 of file IccMpeBasic.cpp.

5611{
5612 if (!m_pCLUT)
5613 return false;
5614
5615 m_pCLUT->Begin();
5616
5617 switch (m_nInputChannels) {
5618 case 1:
5620 break;
5621 case 2:
5623 break;
5624 case 3:
5625 if (nInterp==icElemInterpTetra)
5627 else
5629 break;
5630 case 4:
5632 break;
5633 case 5:
5635 break;
5636 case 6:
5638 break;
5639 default:
5641 break;
5642 }
5643 return true;
5644}
@ icElemInterpTetra
Definition IccTagMPE.h:95
void Begin()
Name: CIccCLUT::Begin.

References ic1dInterp, ic2dInterp, ic3dInterp, ic3dInterpTetra, ic4dInterp, ic5dInterp, ic6dInterp, icElemInterpTetra, and icNdInterp.

◆ Describe()

void CIccMpeCLUT::Describe ( std::string & sDescription,
int nVerboseness )
virtual

Name: CIccMpeCLUT::Describe.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeExtCLUT.

Definition at line 5470 of file IccMpeBasic.cpp.

5471{
5472 if (m_pCLUT) {
5473 m_pCLUT->DumpLut(sDescription, "ELEM_CLUT", icSigUnknownData, icSigUnknownData, nVerboseness);
5474 }
5475}
void DumpLut(std::string &sDescription, const icChar *szName, icColorSpaceSignature csInput, icColorSpaceSignature csOutput, int nVerboseness, bool bUseLegacy=false)
Name: CIccCLUT::DumpLut.
#define icSigUnknownData

References icSigUnknownData.

◆ GetClassName()

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

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeExtCLUT, CIccMpeXmlCLUT, and CIccMpeXmlExtCLUT.

Definition at line 665 of file IccMpeBasic.h.

665{ return "CIccMpeCLUT"; }

◆ GetCLUT()

CIccCLUT * CIccMpeCLUT::GetCLUT ( )
inline

Definition at line 678 of file IccMpeBasic.h.

678{ return m_pCLUT; }

◆ GetNewApply()

CIccApplyMpe * CIccMpeCLUT::GetNewApply ( CIccApplyTagMpe * pApplyTag)
virtual

Name: CIccMpeCLUT::Begin.

Purpose:

Args:

Return:

Reimplemented from CIccMultiProcessElement.

Definition at line 5728 of file IccMpeBasic.cpp.

5729{
5730 if (!m_pCLUT) {
5731 return NULL;
5732 }
5733
5734 CIccApplyCLUT* pApply = m_pCLUT->GetNewApply();
5735 if (!pApply)
5736 return NULL;
5737
5738 CIccApplyMpeCLUT * rv = new CIccApplyMpeCLUT(this, pApply);
5739 if (!rv)
5740 delete pApply;
5741
5742 return rv;
5743}
Class: CIccApplyCLUT.
Definition IccTagLut.h:302
CIccApplyCLUT * GetNewApply()

◆ GetType()

virtual icElemTypeSignature CIccMpeCLUT::GetType ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeExtCLUT.

Definition at line 664 of file IccMpeBasic.h.

664{ return icSigCLutElemType; }
@ icSigCLutElemType

References icSigCLutElemType.

◆ NewCopy()

virtual CIccMultiProcessElement * CIccMpeCLUT::NewCopy ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeExtCLUT.

Definition at line 661 of file IccMpeBasic.h.

661{ return new CIccMpeCLUT(*this);}
CIccMpeCLUT()
Name: CIccMpeCLUT::CIccMpeCLUT.

◆ operator=()

CIccMpeCLUT & CIccMpeCLUT::operator= ( const CIccMpeCLUT & clut)

Name: &CIccMpeCLUT::operator=.

Purpose:

Args:

Return:

Definition at line 5404 of file IccMpeBasic.cpp.

5405{
5406 if (m_pCLUT)
5407 delete m_pCLUT;
5408
5409 if (clut.m_pCLUT)
5410 m_pCLUT = new CIccCLUT(*clut.m_pCLUT);
5411 else
5412 m_pCLUT = NULL;
5413
5414 m_nReserved = clut.m_nReserved;
5417
5418 return *this;
5419}

References CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, and m_pCLUT.

Referenced by CIccMpeExtCLUT::operator=().

+ Here is the caller graph for this function:

◆ Read()

bool CIccMpeCLUT::Read ( icUInt32Number size,
CIccIO * pIO )
virtual

Name: CIccMpeCLUT::Read.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeExtCLUT.

Definition at line 5487 of file IccMpeBasic.cpp.

5488{
5490
5491 icUInt32Number headerSize = sizeof(icTagTypeSignature) +
5492 sizeof(icUInt32Number) +
5493 sizeof(icUInt16Number) +
5494 sizeof(icUInt16Number) +
5495 16 * sizeof(icUInt8Number);
5496
5497 if (headerSize > size)
5498 return false;
5499
5500 icUInt32Number dataSize = size - headerSize;
5501
5502 if (!pIO) {
5503 return false;
5504 }
5505
5506 if (!pIO->Read32(&sig))
5507 return false;
5508
5509 if (!pIO->Read32(&m_nReserved))
5510 return false;
5511
5512 if (!pIO->Read16(&m_nInputChannels))
5513 return false;
5514
5515 if (!pIO->Read16(&m_nOutputChannels))
5516 return false;
5517
5518 icUInt8Number gridPoints[16];
5519
5520 if (pIO->Read8(gridPoints, 16)!=16) {
5521 return false;
5522 }
5523
5525
5526 if (m_nInputChannels > 16 || nPoints > dataSize || nPoints * sizeof (icFloat32Number) > dataSize)
5527 return false;
5528
5530
5531 if (!m_pCLUT)
5532 return false;
5533
5535
5536 m_pCLUT->Init(gridPoints);
5537
5538 icFloatNumber *pData = m_pCLUT->GetData(0);
5539
5540 if (!pData)
5541 return false;
5542
5543 nPoints = m_pCLUT->NumPoints()*m_nOutputChannels;
5544
5545 if (pIO->ReadFloat32Float(pData,nPoints)!= nPoints)
5546 return false;
5547
5548 return true;
5549}
icArraySignature sig
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
static icFloatNumber NoClip(icFloatNumber v)
icTagTypeSignature
unsigned int icUInt32Number
void SetClipFunc(icCLUTCLIPFUNC ClipFunc)
Definition IccTagLut.h:379
icUInt32Number NumPoints() const
Definition IccTagLut.h:348
icFloatNumber * GetData(int index)
Definition IccTagLut.h:347
bool Init(icUInt8Number nGridPoints, icUInt32Number nMaxSize=0, icUInt8Number nBytesPerPoint=4)
Name: CIccCLUT::Init.
icInt32Number ReadFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:302
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
unsigned char icUInt8Number
Number definitions.
float icFloat32Number
unsigned short icUInt16Number

References NoClip(), CIccIO::Read16(), CIccIO::Read32(), CIccIO::Read8(), CIccIO::ReadFloat32Float(), and sig.

+ Here is the call graph for this function:

◆ SetCLUT()

void CIccMpeCLUT::SetCLUT ( CIccCLUT * pCLUT)

Name: CIccMpeCLUT::SetCLUT.

Purpose:

Args:

Return:

Definition at line 5447 of file IccMpeBasic.cpp.

5448{
5449 if (m_pCLUT)
5450 delete m_pCLUT;
5451
5452 m_pCLUT = pCLUT;
5453 if (pCLUT) {
5454 pCLUT->SetClipFunc(NoClip);
5455 m_nInputChannels = pCLUT->GetInputDim();
5457 }
5458}
icUInt8Number GetInputDim() const
Definition IccTagLut.h:356
icUInt16Number GetOutputChannels() const
Definition IccTagLut.h:357

References CIccCLUT::GetInputDim(), CIccCLUT::GetOutputChannels(), NoClip(), and CIccCLUT::SetClipFunc().

Referenced by CDevLinkWriter::begin(), and main().

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

◆ Validate()

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

Name: CIccMpeCLUT::Validate.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeExtCLUT.

Definition at line 5699 of file IccMpeBasic.cpp.

5700{
5701 std::string mpeSigPath = sigPath + icGetSigPath(GetType());
5702 icValidateStatus rv = CIccMultiProcessElement::Validate(sigPath, sReport, pMPE, pProfile);
5703
5704 if (!m_pCLUT) {
5705 CIccInfo Info;
5706 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
5707
5708 sReport += icMsgValidateCriticalError;
5709 sReport += sSigPathName;
5710 sReport += " - Has No CLUT!\n";
5712 }
5713
5714 return rv;
5715}
icValidateStatus
Definition IccDefs.h:118
@ icValidateCriticalError
Definition IccDefs.h:122
std::string icGetSigPath(icUInt32Number nSig)
Definition IccUtil.cpp:1191
const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
Type: Class.
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
virtual icElemTypeSignature GetType() const
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const =0
Name: CIccProcessElement::Validate.

References CIccInfo::GetSigPathName(), icGetSigPath(), icMsgValidateCriticalError, icValidateCriticalError, and CIccMultiProcessElement::Validate().

Referenced by CIccMpeExtCLUT::Validate().

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

◆ Write()

bool CIccMpeCLUT::Write ( CIccIO * pIO)
virtual

Name: CIccMpeCLUT::Write.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeExtCLUT.

Definition at line 5561 of file IccMpeBasic.cpp.

5562{
5564
5565 if (!pIO)
5566 return false;
5567
5568 if (!pIO->Write32(&sig))
5569 return false;
5570
5571 if (!pIO->Write32(&m_nReserved))
5572 return false;
5573
5574 if (!pIO->Write16(&m_nInputChannels))
5575 return false;
5576
5577 if (!pIO->Write16(&m_nOutputChannels))
5578 return false;
5579
5580 if (m_pCLUT) {
5581 icUInt8Number gridPoints[16];
5582 int i;
5583
5584 for (i=0; i<16; i++)
5585 gridPoints[i] = m_pCLUT->GridPoint(i);
5586
5587 if (pIO->Write8(gridPoints, 16)!=16)
5588 return false;
5589
5590 icFloatNumber *pData = m_pCLUT->GetData(0);
5592
5593 if (pIO->WriteFloat32Float(pData, nPoints) != nPoints)
5594 return false;
5595 }
5596
5597 return true;
5598}
icUInt8Number GridPoint(int index) const
Definition IccTagLut.h:350
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105
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
long icInt32Number
icElemTypeSignature
Multi-Processing Element type signatures.

References sig, CIccIO::Write16(), CIccIO::Write32(), CIccIO::Write8(), and CIccIO::WriteFloat32Float().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_interpType

icCLUTElemType CIccMpeCLUT::m_interpType
protected

Definition at line 683 of file IccMpeBasic.h.

◆ m_pCLUT


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