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

Class: CIccMpeTintArray. More...

#include <IccMpeBasic.h>

+ Inheritance diagram for CIccMpeTintArray:
+ Collaboration diagram for CIccMpeTintArray:

Public Member Functions

virtual void Apply (CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const
 Name: CIccMpeTintArray::Apply.
 
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 Name: CIccMpeTintArray::Begin.
 
 CIccMpeTintArray (const CIccMpeTintArray &tintArray)
 Name: CIccMpeTintArray::CIccMpeTintArray.
 
 CIccMpeTintArray (int nVectorSize=1)
 Name: CIccMpeTintArray::CIccMpeTintArray.
 
virtual void Describe (std::string &sDescription, int nVerboseness=0)
 Name: CIccMpeTintArray::Describe.
 
CIccTagNumArrayGetArray ()
 
virtual const icCharGetClassName () const
 
virtual icElemTypeSignature GetType () const
 
virtual CIccMultiProcessElementNewCopy () const
 
CIccMpeTintArrayoperator= (const CIccMpeTintArray &tintArray)
 Name: &CIccMpeTintArray::operator=.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccMpeTintArray::Read.
 
void SetArray (CIccTagNumArray *pTag)
 Name: CIccMpeTintArray::SetCurve.
 
void SetVectorSize (int nVectorSize)
 Name: CIccMpeTintArray::SetVectorSize.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 Name: CIccMpeTintArray::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccMpeTintArray::Write.
 
virtual ~CIccMpeTintArray ()
 Name: CIccMpeTintArray::~CIccMpeTintArray.
 
- Public Member Functions inherited from CIccMultiProcessElement
 CIccMultiProcessElement ()
 
virtual icAcsSignature GetBAcsSig ()
 
virtual icAcsSignature GetEAcsSig ()
 
virtual IIccExtensionMpeGetExtension ()
 
virtual CIccApplyMpeGetNewApply (CIccApplyTagMpe *pApplyTag)
 Name: CIccMultiProcessElement::GetNewApply()
 
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

CIccTagNumArraym_Array
 
- 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: CIccMpeTintArray.

Purpose: The curve set process element

Definition at line 464 of file IccMpeBasic.h.

Constructor & Destructor Documentation

◆ CIccMpeTintArray() [1/2]

CIccMpeTintArray::CIccMpeTintArray ( int nVectorSize = 1)

Name: CIccMpeTintArray::CIccMpeTintArray.

Purpose:

Args:

Return:

Definition at line 3497 of file IccMpeBasic.cpp.

3498{
3499 m_nReserved = 0;
3500 m_nInputChannels = 1;
3501 m_nOutputChannels = nVectorSize;
3502 m_Array = NULL;
3503}
CIccTagNumArray * m_Array
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
icUInt32Number m_nReserved
Definition IccTagMPE.h:188

◆ CIccMpeTintArray() [2/2]

CIccMpeTintArray::CIccMpeTintArray ( const CIccMpeTintArray & tintArray)

Name: CIccMpeTintArray::CIccMpeTintArray.

Purpose:

Args:

Return:

Definition at line 3517 of file IccMpeBasic.cpp.

3518{
3519 m_nReserved = tintArray.m_nReserved;
3520
3523
3524 if (tintArray.m_Array)
3525 m_Array = (CIccTagNumArray*)tintArray.m_Array->NewCopy();
3526
3527}
virtual CIccTag * NewCopy() const
Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.
Class: CIccTagNumArray.

References m_Array, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, and CIccTag::NewCopy().

+ Here is the call graph for this function:

◆ ~CIccMpeTintArray()

CIccMpeTintArray::~CIccMpeTintArray ( )
virtual

Name: CIccMpeTintArray::~CIccMpeTintArray.

Purpose:

Args:

Return:

Definition at line 3566 of file IccMpeBasic.cpp.

3567{
3568 if (m_Array)
3569 delete m_Array;
3570}

Member Function Documentation

◆ Apply()

void CIccMpeTintArray::Apply ( CIccApplyMpe * pApply,
icFloatNumber * pDestPixel,
const icFloatNumber * pSrcPixel ) const
virtual

Name: CIccMpeTintArray::Apply.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 3778 of file IccMpeBasic.cpp.

3779{
3780 if (m_Array) {
3781 m_Array->Interpolate(pDestPixel, *pSrcPixel, m_nOutputChannels);
3782 }
3783 else
3784 memset(pDestPixel, 0, m_nOutputChannels*sizeof(icFloatNumber));
3785}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
virtual bool Interpolate(icFloatNumber *DstVector, icFloatNumber pos, icUInt32Number nVectorSize=1, icFloatNumber *zeroVals=NULL) const =0

◆ Begin()

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

Name: CIccMpeTintArray::Begin.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 3755 of file IccMpeBasic.cpp.

3756{
3757 if (!m_Array)
3758 return false;
3759
3761
3762 if (nVals/m_nOutputChannels<2 || nVals % m_nOutputChannels != 0)
3763 return false;
3764
3765 return true;
3766}
unsigned int icUInt32Number
virtual icUInt32Number GetNumValues() const =0

◆ Describe()

void CIccMpeTintArray::Describe ( std::string & sDescription,
int nVerboseness = 0 )
virtual

Name: CIccMpeTintArray::Describe.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 3616 of file IccMpeBasic.cpp.

3617{
3618 if (m_Array) {
3619 icChar buf[81];
3620
3621 sprintf(buf, "BEGIN_TINT_ARRAY %d\n", m_nOutputChannels);
3622 sDescription += buf;
3623
3624 m_Array->Describe(sDescription, nVerboseness);
3625
3626 sDescription += "END_TINT_ARRAY\n";
3627 }
3628}
char icChar
Definition IccDefs.h:109
virtual void Describe(std::string &sDescription, int nVerboseness=0)
Function: Describe(sDescription) Each derived tag will implement it's own Describe() function.

◆ GetArray()

CIccTagNumArray * CIccMpeTintArray::GetArray ( )
inline

Definition at line 478 of file IccMpeBasic.h.

478{ return m_Array; }

◆ GetClassName()

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

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeXmlTintArray.

Definition at line 481 of file IccMpeBasic.h.

481{ return "CIccMpeTintArray"; }

◆ GetType()

virtual icElemTypeSignature CIccMpeTintArray::GetType ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Definition at line 480 of file IccMpeBasic.h.

480{ return icSigTintArrayElemType; }
@ icSigTintArrayElemType

References icSigTintArrayElemType.

◆ NewCopy()

virtual CIccMultiProcessElement * CIccMpeTintArray::NewCopy ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Definition at line 470 of file IccMpeBasic.h.

470{ return new CIccMpeTintArray(*this);}
CIccMpeTintArray(int nVectorSize=1)
Name: CIccMpeTintArray::CIccMpeTintArray.

◆ operator=()

CIccMpeTintArray & CIccMpeTintArray::operator= ( const CIccMpeTintArray & tintArray)

Name: &CIccMpeTintArray::operator=.

Purpose:

Args:

Return:

Definition at line 3539 of file IccMpeBasic.cpp.

3540{
3542
3543 if (m_Array) {
3544 delete m_Array;
3545 }
3546
3549
3550 if (tintArray.m_Array)
3551 m_Array = (CIccTagNumArray*)tintArray.m_Array->NewCopy();
3552
3553 return *this;
3554}

References m_Array, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, and CIccTag::NewCopy().

+ Here is the call graph for this function:

◆ Read()

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

Name: CIccMpeTintArray::Read.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 3640 of file IccMpeBasic.cpp.

3641{
3642 if (m_Array)
3643 delete m_Array;
3644 m_Array = NULL;
3645
3647
3648 icUInt32Number startPos = pIO->Tell();
3649
3650 icUInt32Number headerSize = sizeof(icElemTypeSignature) +
3651 sizeof(icUInt32Number) +
3652 sizeof(icUInt16Number) +
3653 sizeof(icUInt16Number);
3654
3655 if (headerSize +sizeof(icTagTypeSignature) > size)
3656 return false;
3657
3658 if (!pIO) {
3659 return false;
3660 }
3661
3662 icUInt16Number nInputChannels, nOutputChannels;
3663
3664 if (!pIO->Read32(&sig))
3665 return false;
3666
3667 if (!pIO->Read32(&m_nReserved))
3668 return false;
3669
3670 if (!pIO->Read16(&nInputChannels))
3671 return false;
3672
3673 if (!pIO->Read16(&nOutputChannels))
3674 return false;
3675
3676 if (nInputChannels != 1 || !nOutputChannels)
3677 return false;
3678
3679 m_nInputChannels = nInputChannels;
3680 m_nOutputChannels = nOutputChannels;
3681
3682 icUInt32Number arrayPos = pIO->Tell();
3683
3684 icTagTypeSignature tagType;
3685 if (!pIO->Read32(&tagType))
3686 return false;
3687
3688 CIccTag *pTag = CIccTag::Create(tagType);
3689 if (!pTag)
3690 return false;
3691
3692 if (!pTag->IsNumArrayType()) {
3693 delete pTag;
3694 }
3695
3696 m_Array = (CIccTagNumArray*)pTag;
3697 pIO->Seek(arrayPos, icSeekSet);
3698 if (!m_Array->Read(size-headerSize, pIO)) {
3699 return false;
3700 }
3701
3703 if (nVals/m_nOutputChannels <2 || (nVals%m_nOutputChannels) != 0) {
3704 return false;
3705 }
3706
3707 return true;
3708}
icArraySignature sig
@ icSeekSet
Definition IccIO.h:83
icTagTypeSignature
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
virtual icInt32Number Tell()
Definition IccIO.h:133
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.h:132
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
Class: CIccTag.
static CIccTag * Create(icTagTypeSignature sig)
Name: CIccTag::Create.
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Function: Read(size, pIO) - Read tag from file.
virtual bool IsNumArrayType() const
unsigned short icUInt16Number
icElemTypeSignature
Multi-Processing Element type signatures.

References CIccTag::Create(), icSeekSet, CIccTag::IsNumArrayType(), CIccIO::Read16(), CIccIO::Read32(), CIccIO::Seek(), sig, and CIccIO::Tell().

+ Here is the call graph for this function:

◆ SetArray()

void CIccMpeTintArray::SetArray ( CIccTagNumArray * pArray)

Name: CIccMpeTintArray::SetCurve.

Purpose:

Args:

Return:

Definition at line 3597 of file IccMpeBasic.cpp.

3598{
3599 if (m_Array)
3600 delete m_Array;
3601
3602 m_Array = pArray;
3603}

◆ SetVectorSize()

void CIccMpeTintArray::SetVectorSize ( int nVectorSize)

Name: CIccMpeTintArray::SetVectorSize.

Purpose:

Args:

Return:

Definition at line 3582 of file IccMpeBasic.cpp.

3583{
3584 m_nOutputChannels = nVectorSize;
3585}

◆ Validate()

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

Name: CIccMpeTintArray::Validate.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 3797 of file IccMpeBasic.cpp.

3798{
3799 std::string mpeSigPath = sigPath + icGetSigPath(GetType());
3800 icValidateStatus rv = CIccMultiProcessElement::Validate(sigPath, sReport, pMPE, pProfile);
3801
3802 if (m_nInputChannels!=1) {
3803 CIccInfo Info;
3804 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
3805
3806 sReport += icMsgValidateCriticalError;
3807 sReport += sSigPathName;
3808 sReport += " - Bad number of input channels!\n";
3810 }
3811
3812 if (!m_nOutputChannels) {
3813 CIccInfo Info;
3814 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
3815
3816 sReport += icMsgValidateCriticalError;
3817 sReport += sSigPathName;
3818 sReport += " - Bad number of output channels!\n";
3820 }
3821
3822 if (!m_Array) {
3823 CIccInfo Info;
3824 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
3825
3826 sReport += icMsgValidateCriticalError;
3827 sReport += sSigPathName;
3828 sReport += " - Has no tint values(s)!\n";
3830 }
3831 else {
3833 bool bBad = false;
3834
3835 /*
3836 * NOTE: nVals is unsigned as is m_nOutputChannels
3837 * so the result will never be < 0
3838 */
3839 /*
3840 if (nVals/m_nOutputChannels<0) {
3841 CIccInfo Info;
3842 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
3843
3844 sReport += icMsgValidateCriticalError;
3845 sReport += sSigPathName;
3846 sReport += " - Needs two or more tint steps!\n";
3847 bBad = true;
3848 }
3849 */
3850 if ((nVals % m_nOutputChannels)!=0) {
3851 CIccInfo Info;
3852 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
3853
3854 sReport += icMsgValidateCriticalError;
3855 sReport += sSigPathName;
3856 sReport += " - Array size must be multiple of output channels!\n";
3857 bBad = true;
3858 }
3859
3860 if (bBad) {
3862 }
3863 }
3864
3865 return rv;
3866}
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().

+ Here is the call graph for this function:

◆ Write()

bool CIccMpeTintArray::Write ( CIccIO * pIO)
virtual

Name: CIccMpeTintArray::Write.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 3720 of file IccMpeBasic.cpp.

3721{
3722 if (!m_Array)
3723 return false;
3724
3726
3727 if (!pIO)
3728 return false;
3729
3730 if (!pIO->Write32(&sig))
3731 return false;
3732
3733 if (!pIO->Write32(&m_nReserved))
3734 return false;
3735
3736 if (!pIO->Write16(&m_nInputChannels))
3737 return false;
3738
3739 if (!pIO->Write16(&m_nOutputChannels))
3740 return false;
3741
3742 return m_Array->Write(pIO);
3743}
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:122
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
virtual bool Write(CIccIO *pIO)
Function: Write(pIO) Each derived tag will implement it's own Write() function.

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

+ Here is the call graph for this function:

Member Data Documentation

◆ m_Array

CIccTagNumArray* CIccMpeTintArray::m_Array
protected

Definition at line 494 of file IccMpeBasic.h.

Referenced by CIccMpeTintArray(), and operator=().


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