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

#include <IccMpeBasic.h>

+ Inheritance diagram for CIccMpeExtCLUT:
+ Collaboration diagram for CIccMpeExtCLUT:

Public Member Functions

 CIccMpeExtCLUT ()
 Name: CIccMpeExtCLUT::CIccMpeExtCLUT.
 
 CIccMpeExtCLUT (const CIccMpeExtCLUT &clut)
 Name: CIccMpeExtCLUT::CIccMpeExtCLUT.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccMpeExtCLUT::Describe.
 
virtual const icCharGetClassName () const
 
icUInt16Number GetStorageType ()
 
virtual icElemTypeSignature GetType () const
 
virtual CIccMultiProcessElementNewCopy () const
 
CIccMpeExtCLUToperator= (const CIccMpeExtCLUT &clut)
 Name: &CIccMpeExtCLUT::operator=.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccMpeExtCLUT::Read.
 
bool SetStorageType (icUInt16Number nStorateType)
 Name: CIccMpeExtCLUT::SetStorageType.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 Name: CIccMpeExtCLUT::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccMpeExtCLUT::Write.
 
virtual ~CIccMpeExtCLUT ()
 
- Public Member Functions inherited from CIccMpeCLUT
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.
 
CIccCLUTGetCLUT ()
 
virtual CIccApplyMpeGetNewApply (CIccApplyTagMpe *pApplyTag)
 Name: CIccMpeCLUT::Begin.
 
CIccMpeCLUToperator= (const CIccMpeCLUT &clut)
 Name: &CIccMpeCLUT::operator=.
 
void SetCLUT (CIccCLUT *pCLUT)
 Name: CIccMpeCLUT::SetCLUT.
 
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

icUInt16Number m_nReserved2
 
icUInt16Number m_storageType
 
- Protected Attributes inherited from CIccMpeCLUT
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

Definition at line 719 of file IccMpeBasic.h.

Constructor & Destructor Documentation

◆ CIccMpeExtCLUT() [1/2]

CIccMpeExtCLUT::CIccMpeExtCLUT ( )

Name: CIccMpeExtCLUT::CIccMpeExtCLUT.

Purpose:

Args:

Return:

Definition at line 5784 of file IccMpeBasic.cpp.

5785{
5786 m_pCLUT = NULL;
5787 m_nInputChannels = 0;
5789
5790 m_nReserved = 0;
5791 m_nReserved2 = 0;
5792
5794}
CIccCLUT * m_pCLUT
icUInt16Number m_nReserved2
icUInt16Number m_storageType
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
icUInt32Number m_nReserved
Definition IccTagMPE.h:188
@ icValueTypeFloat32

References icValueTypeFloat32, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, m_nReserved2, CIccMpeCLUT::m_pCLUT, and m_storageType.

◆ CIccMpeExtCLUT() [2/2]

CIccMpeExtCLUT::CIccMpeExtCLUT ( const CIccMpeExtCLUT & clut)

Name: CIccMpeExtCLUT::CIccMpeExtCLUT.

Purpose:

Args:

Return:

Definition at line 5806 of file IccMpeBasic.cpp.

5806 : CIccMpeCLUT(clut)
5807{
5810}
CIccMpeCLUT()
Name: CIccMpeCLUT::CIccMpeCLUT.

References m_nReserved2, and m_storageType.

◆ ~CIccMpeExtCLUT()

virtual CIccMpeExtCLUT::~CIccMpeExtCLUT ( )
inlinevirtual

Definition at line 726 of file IccMpeBasic.h.

726{}

Member Function Documentation

◆ Describe()

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

Name: CIccMpeExtCLUT::Describe.

Purpose:

Args:

Return:

Reimplemented from CIccMpeCLUT.

Definition at line 5842 of file IccMpeBasic.cpp.

5843{
5844 if (m_pCLUT) {
5845 char desc[256];
5846 sprintf(desc, "EXT_ELEM_CLUT(%d)", m_storageType);
5847
5848 m_pCLUT->DumpLut(sDescription, desc, icSigUnknownData, icSigUnknownData, nVerboseness);
5849 }
5850}
void DumpLut(std::string &sDescription, const icChar *szName, icColorSpaceSignature csInput, icColorSpaceSignature csOutput, int nVerboseness, bool bUseLegacy=false)
Name: CIccCLUT::DumpLut.
#define icSigUnknownData

References CIccCLUT::DumpLut(), icSigUnknownData, CIccMpeCLUT::m_pCLUT, and m_storageType.

+ Here is the call graph for this function:

◆ GetClassName()

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

Reimplemented from CIccMpeCLUT.

Reimplemented in CIccMpeXmlExtCLUT.

Definition at line 729 of file IccMpeBasic.h.

729{ return "CIccMpeExtCLUT"; }

◆ GetStorageType()

icUInt16Number CIccMpeExtCLUT::GetStorageType ( )
inline

Definition at line 739 of file IccMpeBasic.h.

739{ return m_storageType; }

◆ GetType()

virtual icElemTypeSignature CIccMpeExtCLUT::GetType ( ) const
inlinevirtual

Reimplemented from CIccMpeCLUT.

Definition at line 728 of file IccMpeBasic.h.

728{ return icSigExtCLutElemType; }
@ icSigExtCLutElemType

References icSigExtCLutElemType.

Referenced by Validate(), and Write().

+ Here is the caller graph for this function:

◆ NewCopy()

virtual CIccMultiProcessElement * CIccMpeExtCLUT::NewCopy ( ) const
inlinevirtual

Reimplemented from CIccMpeCLUT.

Definition at line 725 of file IccMpeBasic.h.

725{ return new CIccMpeExtCLUT(*this);}
CIccMpeExtCLUT()
Name: CIccMpeExtCLUT::CIccMpeExtCLUT.

◆ operator=()

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

Name: &CIccMpeExtCLUT::operator=.

Purpose:

Args:

Return:

Definition at line 5822 of file IccMpeBasic.cpp.

5823{
5825
5828
5829 return *this;
5830}
CIccMpeCLUT & operator=(const CIccMpeCLUT &clut)
Name: &CIccMpeCLUT::operator=.

References m_nReserved2, m_storageType, and CIccMpeCLUT::operator=().

+ Here is the call graph for this function:

◆ Read()

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

Name: CIccMpeExtCLUT::Read.

Purpose:

Args:

Return:

Reimplemented from CIccMpeCLUT.

Definition at line 5890 of file IccMpeBasic.cpp.

5891{
5893
5894 icUInt32Number headerSize = sizeof(icTagTypeSignature) +
5895 sizeof(icUInt32Number) +
5896 sizeof(icUInt16Number) +
5897 sizeof(icUInt16Number) +
5898 sizeof(icUInt16Number) +
5899 sizeof(icUInt16Number) +
5900 16 * sizeof(icUInt8Number);
5901
5902 if (headerSize > size)
5903 return false;
5904
5905 icUInt32Number dataSize = size - headerSize;
5906
5907 if (!pIO) {
5908 return false;
5909 }
5910
5911 if (!pIO->Read32(&sig))
5912 return false;
5913
5914 if (!pIO->Read32(&m_nReserved))
5915 return false;
5916
5917 if (!pIO->Read16(&m_nInputChannels))
5918 return false;
5919
5920 if (!pIO->Read16(&m_nOutputChannels))
5921 return false;
5922
5923 if (!pIO->Read16(&m_storageType))
5924 return false;
5925
5926 if (!pIO->Read16(&m_nReserved2))
5927 return false;
5928
5929 icUInt8Number gridPoints[16];
5930
5931 if (pIO->Read8(gridPoints, 16)!=16) {
5932 return false;
5933 }
5934
5936
5937 if (m_nInputChannels > 16 || nPoints > dataSize)
5938 return false;
5939
5941
5942 if (!m_pCLUT)
5943 return false;
5944
5946
5947 if (!m_pCLUT->Init(gridPoints, dataSize, icGetStorageTypeBytes(m_storageType)))
5948 return false;
5949
5950 icFloatNumber *pData = m_pCLUT->GetData(0);
5951
5952 if (!pData)
5953 return false;
5954
5955 nPoints = m_pCLUT->NumPoints()*m_nOutputChannels;
5956
5957 if (nPoints > dataSize)
5958 return false;
5959
5960 switch(m_storageType) {
5961 case icValueTypeUInt8:
5962 if (pIO->ReadUInt8Float(pData,nPoints)!= nPoints)
5963 return false;
5964 break;
5965
5966 case icValueTypeUInt16:
5967 if (nPoints * 2 > dataSize)
5968 return false;
5969
5970 if (pIO->ReadUInt16Float(pData,nPoints)!= nPoints)
5971 return false;
5972 break;
5973
5974 case icValueTypeFloat16:
5975 if (nPoints * 2 > dataSize)
5976 return false;
5977
5978 if (pIO->ReadFloat16Float(pData,nPoints)!= nPoints)
5979 return false;
5980 break;
5981
5982 case icValueTypeFloat32:
5983 if (pIO->ReadFloat32Float(pData,nPoints)!= nPoints)
5984 return false;
5985 break;
5986
5987 default:
5988 return false;
5989 }
5990 return true;
5991}
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)
icUInt8Number icGetStorageTypeBytes(icUInt16Number nStorageType)
Definition IccUtil.cpp:1375
icTagTypeSignature
unsigned int icUInt32Number
Class: CIccCLUT.
Definition IccTagLut.h:326
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 ReadFloat16Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:269
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 ReadUInt8Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:203
icInt32Number ReadUInt16Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:236
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
unsigned char icUInt8Number
Number definitions.
unsigned short icUInt16Number
@ icValueTypeFloat16
@ icValueTypeUInt8
@ icValueTypeUInt16

References CIccCLUT::GetData(), icGetStorageTypeBytes(), icValueTypeFloat16, icValueTypeFloat32, icValueTypeUInt16, icValueTypeUInt8, CIccCLUT::Init(), CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, m_nReserved2, CIccMpeCLUT::m_pCLUT, m_storageType, NoClip(), CIccCLUT::NumPoints(), CIccIO::Read16(), CIccIO::Read32(), CIccIO::Read8(), CIccIO::ReadFloat16Float(), CIccIO::ReadFloat32Float(), CIccIO::ReadUInt16Float(), CIccIO::ReadUInt8Float(), CIccCLUT::SetClipFunc(), and sig.

+ Here is the call graph for this function:

◆ SetStorageType()

bool CIccMpeExtCLUT::SetStorageType ( icUInt16Number nStorateType)

Name: CIccMpeExtCLUT::SetStorageType.

Purpose: Sets storage type of the data stored in the CLUT

Args: nStorageType is type of data to use

Return: true if valid storage type, false otherwise

Definition at line 5865 of file IccMpeBasic.cpp.

5866{
5867 m_storageType = nStorateType;
5868
5869 switch (nStorateType) {
5870 case icValueTypeUInt8:
5871 case icValueTypeUInt16:
5872 case icValueTypeFloat16:
5873 case icValueTypeFloat32:
5874 return true;
5875 }
5876 return false;
5877}

References icValueTypeFloat16, icValueTypeFloat32, icValueTypeUInt16, icValueTypeUInt8, and m_storageType.

◆ Validate()

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

Name: CIccMpeExtCLUT::Validate.

Purpose:

Args:

Return:

Reimplemented from CIccMpeCLUT.

Definition at line 6081 of file IccMpeBasic.cpp.

6082{
6083 std::string mpeSigPath = sigPath + icGetSigPath(GetType());
6084 icValidateStatus rv = CIccMpeCLUT::Validate(sigPath, sReport, pMPE, pProfile);
6085
6087 CIccInfo Info;
6088 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
6089
6090 sReport += icMsgValidateCriticalError;
6091 sReport += sSigPathName;
6092 sReport += " - Invalid value type!\n";
6094 }
6095
6096 return rv;
6097}
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 icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
Name: CIccMpeCLUT::Validate.
virtual icElemTypeSignature GetType() const
#define icMaxValueType

References CIccInfo::GetSigPathName(), GetType(), icGetSigPath(), icMaxValueType, icMsgValidateCriticalError, icValidateCriticalError, m_storageType, and CIccMpeCLUT::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccMpeExtCLUT::Write ( CIccIO * pIO)
virtual

Name: CIccMpeExtCLUT::Write.

Purpose:

Args:

Return:

Reimplemented from CIccMpeCLUT.

Definition at line 6003 of file IccMpeBasic.cpp.

6004{
6006
6007 if (!pIO)
6008 return false;
6009
6010 if (!pIO->Write32(&sig))
6011 return false;
6012
6013 if (!pIO->Write32(&m_nReserved))
6014 return false;
6015
6016 if (!pIO->Write16(&m_nInputChannels))
6017 return false;
6018
6019 if (!pIO->Write16(&m_nOutputChannels))
6020 return false;
6021
6022 if (!pIO->Write16(&m_storageType))
6023 return false;
6024
6025 if (!pIO->Write16(&m_nReserved2))
6026 return false;
6027
6028 if (m_pCLUT) {
6029 icUInt8Number gridPoints[16];
6030 int i;
6031
6032 for (i=0; i<16; i++)
6033 gridPoints[i] = m_pCLUT->GridPoint(i);
6034
6035 if (pIO->Write8(gridPoints, 16)!=16)
6036 return false;
6037
6038 icFloatNumber *pData = m_pCLUT->GetData(0);
6040
6041 switch(m_storageType) {
6042 case icValueTypeUInt8:
6043 if (pIO->WriteUInt8Float(pData,nPoints)!= nPoints)
6044 return false;
6045 break;
6046
6047 case icValueTypeUInt16:
6048 if (pIO->WriteUInt16Float(pData,nPoints)!= nPoints)
6049 return false;
6050 break;
6051
6052 case icValueTypeFloat16:
6053 if (pIO->WriteFloat16Float(pData,nPoints)!= nPoints)
6054 return false;
6055 break;
6056
6057 case icValueTypeFloat32:
6058 if (pIO->WriteFloat32Float(pData,nPoints)!= nPoints)
6059 return false;
6060 break;
6061
6062 default:
6063 return false;
6064 }
6065 }
6066
6067 return true;
6068}
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 WriteFloat16Float(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:285
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
icInt32Number WriteFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:321
icInt32Number WriteUInt8Float(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:219
icInt32Number WriteUInt16Float(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:252
long icInt32Number
icElemTypeSignature
Multi-Processing Element type signatures.

References CIccCLUT::GetData(), GetType(), CIccCLUT::GridPoint(), icValueTypeFloat16, icValueTypeFloat32, icValueTypeUInt16, icValueTypeUInt8, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, m_nReserved2, CIccMpeCLUT::m_pCLUT, m_storageType, CIccCLUT::NumPoints(), sig, CIccIO::Write16(), CIccIO::Write32(), CIccIO::Write8(), CIccIO::WriteFloat16Float(), CIccIO::WriteFloat32Float(), CIccIO::WriteUInt16Float(), and CIccIO::WriteUInt8Float().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_nReserved2

icUInt16Number CIccMpeExtCLUT::m_nReserved2
protected

Definition at line 743 of file IccMpeBasic.h.

Referenced by CIccMpeExtCLUT(), CIccMpeExtCLUT(), operator=(), Read(), and Write().

◆ m_storageType

icUInt16Number CIccMpeExtCLUT::m_storageType
protected

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