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

#include <IccTagLut.h>

+ Inheritance diagram for CIccTagParametricCurve:
+ Collaboration diagram for CIccTagParametricCurve:

Public Member Functions

 CIccTagParametricCurve ()
 
 CIccTagParametricCurve (const CIccTagParametricCurve &ITPC)
 
virtual ~CIccTagParametricCurve ()
 
virtual icFloatNumber Apply (icFloatNumber v) const
 
virtual void Begin ()
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual void DetachIO ()
 
virtual void DumpLut (std::string &sDescription, const icChar *szName, icColorSpaceSignature csSig, int nIndex, int nVerboseness)
 
icFloatNumber Find (icFloatNumber v)
 
virtual const icCharGetClassName () const
 
virtual IIccExtensionTagGetExtension ()
 
icUInt16Number GetFunctionType () const
 
icUInt16Number GetNumParam () const
 
icFloatNumberGetParams () const
 
virtual icArraySignature GetTagArrayType () const
 
virtual icStructSignature GetTagStructType () const
 
virtual icTagTypeSignature GetType () const
 
virtual bool IsArrayType ()
 
virtual bool IsIdentity ()
 
virtual bool IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool IsSupported ()
 
virtual CIccTagNewCopy () const
 
CIccTagParametricCurveoperator= (const CIccTagParametricCurve &ParamCurveTag)
 
icFloatNumberoperator[] (int index)
 
icFloatNumber Param (int index) const
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO, CIccProfile *pProfile)
 
virtual bool ReadAll ()
 
bool SetFunctionType (icUInt16Number nFunctionType)
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 
virtual bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccTagCreate (icTagTypeSignature sig)
 

Data Fields

icUInt32Number m_nReserved
 
icUInt16Number m_nReserved2
 

Protected Member Functions

icFloatNumber Find (icFloatNumber v, icFloatNumber p0, icFloatNumber v0, icFloatNumber p1, icFloatNumber v1)
 

Protected Attributes

icFloatNumberm_dParam
 
icUInt16Number m_nFunctionType
 
icUInt16Number m_nNumParam
 

Detailed Description

Class: CIccTagParametricCurve

Purpose: The parametric curve type tag

Constructor & Destructor Documentation

◆ CIccTagParametricCurve() [1/2]

CIccTagParametricCurve::CIccTagParametricCurve ( )

Name: CIccTagParametricCurve::CIccTagParametricCurve

Purpose: Constructor

647{
648 m_nFunctionType = 0xffff;
649 m_nNumParam = 0;
650 m_dParam = NULL;
651 m_nReserved2 = 0;
652}
icUInt16Number m_nFunctionType
Definition IccTagLut.h:204
icFloatNumber * m_dParam
Definition IccTagLut.h:208
icUInt16Number m_nReserved2
Definition IccTagLut.h:202
icUInt16Number m_nNumParam
Definition IccTagLut.h:205

References m_dParam, m_nFunctionType, m_nNumParam, and m_nReserved2.

◆ CIccTagParametricCurve() [2/2]

CIccTagParametricCurve::CIccTagParametricCurve ( const CIccTagParametricCurve ITPC)

Name: CIccTagParametricCurve::CIccTagParametricCurve

Purpose: Copy Constructor

Args: ITPC = The CIccTagParametricCurve object to be copied

666{
669 m_nReserved2 = 0;
670
672 memcpy(m_dParam, ITPC.m_dParam, m_nNumParam*sizeof(icFloatNumber));
673}
float icFloatNumber
Definition IccDefs.h:101

References m_dParam, m_nFunctionType, m_nNumParam, and m_nReserved2.

Referenced by NewCopy().

+ Here is the caller graph for this function:

◆ ~CIccTagParametricCurve()

CIccTagParametricCurve::~CIccTagParametricCurve ( )
virtual

Name: CIccTagParametricCurve::~CIccTagParametricCurve

Purpose: Destructor

712{
713 if (m_dParam)
714 delete [] m_dParam;
715}

References m_dParam.

Member Function Documentation

◆ Apply()

icFloatNumber CIccTagParametricCurve::Apply ( icFloatNumber  X) const
virtual

Name: CIccTagParametricCurve::Apply

Purpose: Applies the curve to the value passed.

Args: x = value to be passed through the curve.

Return: The value modified by the curve.

Reimplemented from CIccCurve.

1025{
1026 double a, b;
1027
1028 switch(m_nFunctionType) {
1029 case 0x0000:
1030 return (icFloatNumber)pow(X, m_dParam[0]);
1031
1032 case 0x0001:
1033 a=m_dParam[1];
1034 b=m_dParam[2];
1035
1036 if (X >= -b/a) {
1037 return (icFloatNumber)pow((double)a*X + b, (double)m_dParam[0]);
1038 }
1039 else {
1040 return 0;
1041 }
1042
1043 case 0x0002:
1044 a=m_dParam[1];
1045 b=m_dParam[2];
1046
1047 if (X >= -b/a) {
1048 return (icFloatNumber)pow((double)a*X + b, (double)m_dParam[0]) + m_dParam[3];
1049 }
1050 else {
1051 return m_dParam[3];
1052 }
1053
1054 case 0x0003:
1055 if (X >= m_dParam[4]) {
1056 return (icFloatNumber)pow((double)m_dParam[1]*X + m_dParam[2], (double)m_dParam[0]);
1057 }
1058 else {
1059 return m_dParam[3]*X;
1060 }
1061
1062 case 0x0004:
1063 if (X >= m_dParam[4]) {
1064 return (icFloatNumber)pow((double)m_dParam[1]*X + m_dParam[2], (double)m_dParam[0]) + m_dParam[5];
1065 }
1066 else {
1067 return m_dParam[3]*X + m_dParam[6];
1068 }
1069
1070 default:
1071 return X;
1072 }
1073}

References m_dParam, and m_nFunctionType.

Referenced by Validate().

+ Here is the caller graph for this function:

◆ Begin()

virtual void CIccCurve::Begin ( )
inlinevirtualinherited

Reimplemented in CIccTagCurve, and CIccTagSegmentedCurve.

100{}

◆ Create()

CIccTag * CIccTag::Create ( icTagTypeSignature  sig)
staticinherited

Name: CIccTag::Create

Purpose: This is a static tag creator based upon tag signature type

Args: sig = tag type signature

Return: Pointer to Allocated tag

144{
145 return CIccTagCreator::CreateTag(sig);
146}
static CIccTag * CreateTag(icTagTypeSignature tagTypeSig)
Definition IccTagFactory.h:279

References CIccTagCreator::CreateTag().

Referenced by CIccDefaultEncProfileConverter::ConvertFromParams(), CIccTagStruct::LoadElem(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccMpeTintArray::Read(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), CIccTagLut16::Read(), CIccTagLut8::SetColorSpaces(), CIccTagLut16::SetColorSpaces(), and CIccProfileDescText::SetType().

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

◆ Describe()

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

Name: CIccTagParametricCurve::Describe

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

Reimplemented from CIccTag.

834{
835 icChar buf[128];
836
837 sprintf(buf, "FunctionType: %04Xh\n", m_nFunctionType);
838 sDescription += buf;
839
840 switch(m_nFunctionType) {
841case 0x0000:
842 sprintf(buf, "Y = X ^ %.4lf\n", m_dParam[0]);
843 sDescription += buf;
844 return;
845
846case 0x0001:
847 sprintf(buf, "Y = 0 when (X < %.4lf / %.4lf)\n",
848 -m_dParam[2], m_dParam[1]);
849 sDescription += buf;
850
851 sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf when (X >= %.4lf / %.4lf)\n",
852 m_dParam[1], m_dParam[2], m_dParam[0],
853 m_dParam[2], m_dParam[1]);
854 sDescription += buf;
855 return;
856
857case 0x0002:
858 sprintf(buf, "Y = %.4lf when (X < %.4lf / %.4lf)\n", m_dParam[3],
859 -m_dParam[2], m_dParam[1]);
860 sDescription += buf;
861
862 sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf + %.4lf when (X >= %.4lf / %.4lf)\n",
863 m_dParam[1], m_dParam[2], m_dParam[0],
864 m_dParam[3],
865 -m_dParam[2], m_dParam[1]);
866 sDescription += buf;
867 return;
868
869case 0x0003:
870 sprintf(buf, "Y = %lf * X when (X < %.4lf)\n",
871 m_dParam[3], m_dParam[4]);
872 sDescription += buf;
873
874 sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf when (X >= %.4lf)\n",
875 m_dParam[1], m_dParam[2], m_dParam[0],
876 m_dParam[4]);
877 sDescription += buf;
878 return;
879
880case 0x0004:
881 sprintf(buf, "Y = %lf * X + %.4lf when (X < %.4lf)\n",
882 m_dParam[3], m_dParam[6], m_dParam[4]);
883 sDescription += buf;
884
885 sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf + %.4lf when (X >= %.4lf)\n",
886 m_dParam[1], m_dParam[2], m_dParam[0],
887 m_dParam[5], m_dParam[4]);
888 sDescription += buf;
889 return;
890
891default:
892 int i;
893 sprintf(buf, "Unknown Function with %d parameters:\n", m_nNumParam);
894 sDescription += buf;
895
896 for (i=0; i<m_nNumParam; i++) {
897 sprintf(buf, "Param[%d] = %.4lf\n", i, m_dParam[i]);
898 sDescription += buf;
899 }
900 }
901}
char icChar
Definition IccDefs.h:110

References m_dParam, m_nFunctionType, and m_nNumParam.

Referenced by DumpLut().

+ Here is the caller graph for this function:

◆ DetachIO()

virtual void CIccTag::DetachIO ( )
inlinevirtualinherited

Function: ReadAll() - Read All sub data for tag from file. Called by CIccProfile::ReadAll() to read all sub data for tag

Returns true if ReadAll is successful.

183{}

◆ DumpLut()

void CIccTagParametricCurve::DumpLut ( std::string &  sDescription,
const icChar szName,
icColorSpaceSignature  csSig,
int  nIndex,
int  nVerboseness 
)
virtual

Name: CIccTagParametricCurve::DumpLut

Purpose: Dump data associated with the tag to a string. Basically has the same function as Describe()

Args: sDescription = string to concatenate tag dump to, szName = name of the curve to be printed, csSig = color space signature of the curve data, nIndex = the channel number of color space

Reimplemented from CIccCurve.

919{
920 icChar buf[128];
921
922 sprintf(buf, "BEGIN_CURVE %s\n", szName);
923 sDescription += buf;
924 Describe(sDescription, nVerboseness);
925}
virtual void Describe(std::string &sDescription, int nVerboseness)
Definition IccTagLut.cpp:833

References Describe().

+ Here is the call graph for this function:

◆ Find() [1/2]

icFloatNumber CIccCurve::Find ( icFloatNumber  v)
inlineinherited
103{ return Find(v, 0, Apply(0), 1.0, Apply(1.0)); }
virtual icFloatNumber Apply(icFloatNumber v) const
Definition IccTagLut.h:101
icFloatNumber Find(icFloatNumber v)
Definition IccTagLut.h:103

References CIccCurve::Apply(), and CIccCurve::Find().

+ Here is the call graph for this function:

◆ Find() [2/2]

icFloatNumber CIccCurve::Find ( icFloatNumber  v,
icFloatNumber  p0,
icFloatNumber  v0,
icFloatNumber  p1,
icFloatNumber  v1 
)
protectedinherited

Name: CIccCurve::Find

Purpose: Read in the tag contents into a data block

Args: v = index to be searched, v0 = index less than/equal to v, p0 = the value at index v0, v1 = index greater than/equal to v, p1 = value at index v1

Return: The value at the requested index

110{
111 if (v<=v0)
112 return p0;
113 if (v>=v1)
114 return p1;
115
116 if (p1-p0 <= 0.00001) {
117 icFloatNumber d0 = (icFloatNumber)fabs(v-v0);
118 icFloatNumber d1 = (icFloatNumber)fabs(v1-v);
119
120 if (d0<d1)
121 return p0;
122 return p1;
123 }
124
125 icFloatNumber np = (icFloatNumber)((p0 + p1)/2.0);
126 icFloatNumber nv = Apply(np);
127
128 if (v<=nv) {
129 return Find(v, p0, v0, np, nv);
130 }
131 return Find(v, np, nv, p1, v1);
132}

References CIccCurve::Apply(), and CIccCurve::Find().

Referenced by CIccCurve::Find(), and CIccCurve::Find().

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

◆ GetClassName()

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

Reimplemented from CIccTag.

Reimplemented in CIccTagXmlParametricCurve.

180{ return "CIccTagParametricCurve"; }

◆ GetExtension()

virtual IIccExtensionTag * CIccTag::GetExtension ( )
inlinevirtualinherited

Reimplemented in CIccTagXmlUnknown, CIccTagXmlText, CIccTagXmlUtf8Text, CIccTagXmlZipUtf8Text, CIccTagXmlZipXml, CIccTagXmlUtf16Text, CIccTagXmlTextDescription, CIccTagXmlSignature, CIccTagXmlNamedColor2, CIccTagXmlXYZ, CIccTagXmlChromaticity, CIccTagXmlCicp, CIccTagXmlSparseMatrixArray, CIccTagXmlFixedNum< T, Tsig >, CIccTagXmlNum< T, A, Tsig >, CIccTagXmlFloatNum< T, A, Tsig >, CIccTagXmlMeasurement, CIccTagXmlMultiLocalizedUnicode, CIccTagXmlTagData, CIccTagXmlDateTime, CIccTagXmlColorantOrder, CIccTagXmlColorantTable, CIccTagXmlViewingConditions, CIccTagXmlSpectralDataInfo, CIccTagXmlSpectralViewingConditions, CIccTagXmlProfileSeqDesc, CIccTagXmlResponseCurveSet16, CIccTagXmlCurve, CIccTagXmlParametricCurve, CIccTagXmlSegmentedCurve, CIccTagXmlLutAtoB, CIccTagXmlLutBtoA, CIccTagXmlLut8, CIccTagXmlLut16, CIccTagXmlMultiProcessElement, CIccTagXmlProfileSequenceId, CIccTagXmlDict, CIccTagXmlStruct, CIccTagXmlArray, CIccTagXmlGamutBoundaryDesc, CIccTagXmlEmbeddedHeightImage, CIccTagXmlEmbeddedNormalImage, and CIccTagXmlEmbeddedProfile.

143{return NULL;}

Referenced by icCurvesFromXml(), icCurvesToXml(), icProfDescToXml(), icXmlParseProfDesc(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccMpeXmlTintArray::ToXml(), CIccTagXmlStruct::ToXml(), CIccTagXmlArray::ToXml(), and CIccProfileXml::ToXmlWithBlanks().

+ Here is the caller graph for this function:

◆ GetFunctionType()

icUInt16Number CIccTagParametricCurve::GetFunctionType ( ) const
inline
191{return m_nFunctionType; }

References m_nFunctionType.

◆ GetNumParam()

icUInt16Number CIccTagParametricCurve::GetNumParam ( ) const
inline
193{ return m_nNumParam; }

References m_nNumParam.

Referenced by CIccTagXmlParametricCurve::ParseXml().

+ Here is the caller graph for this function:

◆ GetParams()

icFloatNumber * CIccTagParametricCurve::GetParams ( ) const
inline
194{ return m_dParam; }

References m_dParam.

Referenced by CIccTagXmlParametricCurve::ParseXml().

+ Here is the caller graph for this function:

◆ GetTagArrayType()

virtual icArraySignature CIccTag::GetTagArrayType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagArray.

133{ return icSigUndefinedArray; }
@ icSigUndefinedArray
Definition icProfileHeader.h:617

References icSigUndefinedArray.

Referenced by icGetTagArrayHandlerOfType(), and CIccProfileXml::ParseTag().

+ Here is the caller graph for this function:

◆ GetTagStructType()

virtual icStructSignature CIccTag::GetTagStructType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagStruct.

132{ return icSigUndefinedStruct; }
@ icSigUndefinedStruct
Definition icProfileHeader.h:606

References icSigUndefinedStruct.

Referenced by icGetTagStructHandlerOfType(), CIccArrayColorantInfo::Validate(), and CIccArrayNamedColor::Validate().

+ Here is the caller graph for this function:

◆ GetType()

virtual icTagTypeSignature CIccTagParametricCurve::GetType ( ) const
inlinevirtual

Function: GetType()

Purpose: Get Tag Type. Each derived tag will implement it's own GetType() function.

Reimplemented from CIccTag.

179{ return icSigParametricCurveType; }
@ icSigParametricCurveType
Definition icProfileHeader.h:552

References icSigParametricCurveType.

Referenced by Write().

+ Here is the caller graph for this function:

◆ IsArrayType()

virtual bool CIccTag::IsArrayType ( )
inlinevirtualinherited

Reimplemented in CIccTagXYZ, CIccTagChromaticity, CIccTagSparseMatrixArray, CIccTagFixedNum< T, Tsig >, CIccTagNum< T, Tsig >, CIccTagFloatNum< T, Tsig >, and CIccTagData.

135{ return false; }

Referenced by MyTagDialog::MyTagDialog(), and DumpTag().

+ Here is the caller graph for this function:

◆ IsIdentity()

bool CIccTagParametricCurve::IsIdentity ( )
virtual

Name: CIccTagParametricCurve::IsIdentity

Purpose: Checks if this is an identity curve.

Return: true if the curve is an identity

Reimplemented from CIccCurve.

995{
996 switch(m_nFunctionType) {
997 case 0x0000:
998 return IsUnity(m_dParam[0]);
999
1000 case 0x0001:
1001 case 0x0002:
1002 case 0x0003:
1003 case 0x0004:
1004 return false;
1005
1006 default:
1007 return true;
1008 }
1009}
static bool IsUnity(const icFloatNumber &num)
Definition IccTagLut.cpp:520

References IsUnity(), m_dParam, and m_nFunctionType.

+ Here is the call graph for this function:

◆ IsMBBType()

virtual bool CIccTag::IsMBBType ( )
inlinevirtualinherited

Reimplemented in CIccMBB.

136{ return false; } //If true then CIccTag can be cast as an CIccMBB

Referenced by CIccProfileXml::ParseTag().

+ Here is the caller graph for this function:

◆ IsNumArrayType()

virtual bool CIccTag::IsNumArrayType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagSparseMatrixArray, CIccTagFixedNum< T, Tsig >, CIccTagNum< T, Tsig >, and CIccTagFloatNum< T, Tsig >.

137{ return false;} //If true then CIccTag can be cast as a CIccTagNumArray

Referenced by CIccArrayNamedColor::FindDeviceColor(), CIccArrayNamedColor::FindPcsColor(), CIccArrayNamedColor::FindSpectralColor(), CIccTagStruct::GetElemNumberValue(), CIccStructNamedColor::GetNumArray(), CIccMpeXmlTintArray::ParseXml(), and CIccMpeTintArray::Read().

+ Here is the caller graph for this function:

◆ IsSupported()

virtual bool CIccTag::IsSupported ( )
inlinevirtualinherited

Function: IsSupported(size, pIO) - Check if tag fully supported for apply purposes. By Default inherited classes are supported. Unknown tag types are not supported.

Returns true if tag type is supported.

Reimplemented in CIccTagUnknown, CIccTagEmbeddedProfile, and CIccTagMultiProcessElement.

153{ return true; }

◆ NewCopy()

virtual CIccTag * CIccTagParametricCurve::NewCopy ( ) const
inlinevirtual

Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.

Parameter(s): none

Returns a new CIccTag object that is a copy of this object.

Reimplemented from CIccCurve.

176{ return new CIccTagParametricCurve(*this);}
CIccTagParametricCurve()
Definition IccTagLut.cpp:646

References CIccTagParametricCurve().

+ Here is the call graph for this function:

◆ operator=()

CIccTagParametricCurve & CIccTagParametricCurve::operator= ( const CIccTagParametricCurve ParamCurveTag)

Name: CIccTagParametricCurve::operator=

Purpose: Copy Operator

Args: ParamCurveTag = The CIccTagParametricCurve object to be copied

687{
688 if (&ParamCurveTag == this)
689 return *this;
690
691 m_nFunctionType = ParamCurveTag.m_nFunctionType;
692 m_nNumParam = ParamCurveTag.m_nNumParam;
693
694 if (m_dParam)
695 delete [] m_dParam;
697 memcpy(m_dParam, ParamCurveTag.m_dParam, m_nNumParam*sizeof(icFloatNumber));
698
699 return *this;
700}

References m_dParam, m_nFunctionType, and m_nNumParam.

◆ operator[]()

icFloatNumber & CIccTagParametricCurve::operator[] ( int  index)
inline
196{ return m_dParam[index]; }

References m_dParam.

◆ Param()

icFloatNumber CIccTagParametricCurve::Param ( int  index) const
inline
195{ return m_dParam[index]; }

References m_dParam.

◆ Read() [1/2]

bool CIccTagParametricCurve::Read ( icUInt32Number  size,
CIccIO pIO 
)
virtual

Name: CIccTagParametricCurve::Read

Purpose: Read in the tag contents into a data block

Args: size - # of bytes in tag, pIO - IO object to read tag from

Return: true = successful, false = failure

Reimplemented from CIccTag.

733{
735 icUInt16Number nFunctionType;
736
737 icUInt32Number nHdrSize = sizeof(icTagTypeSignature) +
738 sizeof(icUInt32Number) +
739 2*sizeof(icUInt16Number);
740
741 if ( nHdrSize > size)
742 return false;
743
744 if (!pIO) {
745 return false;
746 }
747
748 if (!pIO->Read32(&sig) ||
749 !pIO->Read32(&m_nReserved) ||
750 !pIO->Read16(&nFunctionType) ||
751 !pIO->Read16(&m_nReserved2))
752 return false;
753
754 SetFunctionType(nFunctionType);
755
756 if (!m_nNumParam) {
757 m_nNumParam = (icUInt16Number)((size-nHdrSize) / sizeof(icS15Fixed16Number));
759 }
760
761 if (m_nNumParam) {
762 int i;
763 if (nHdrSize + m_nNumParam*sizeof(icS15Fixed16Number) > size)
764 return false;
765
766 for (i=0; i<m_nNumParam; i++) {
768 if (!pIO->Read32(&num, 1))
769 return false;
770 m_dParam[i]=icFtoD(num);
771 }
772 }
773
774 return true;
775}
unsigned short icUInt16Number
Definition icProfileHeader.h:256
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icTagTypeSignature
Definition icProfileHeader.h:526
icInt32Number icS15Fixed16Number
Definition icProfileHeader.h:302
ICCPROFLIB_API icFloatNumber icFtoD(icS15Fixed16Number num)
Definition IccUtil.cpp:559
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
icUInt32Number m_nReserved
Definition IccTagBasic.h:235
bool SetFunctionType(icUInt16Number nFunctionType)
Definition IccTagLut.cpp:941

References icFtoD(), m_dParam, m_nNumParam, CIccTag::m_nReserved, m_nReserved2, CIccIO::Read16(), CIccIO::Read32(), and SetFunctionType().

+ Here is the call graph for this function:

◆ Read() [2/2]

virtual bool CIccTag::Read ( icUInt32Number  size,
CIccIO pIO,
CIccProfile pProfile 
)
inlinevirtualinherited

Function: Read(size, pIO) - Read tag from file. Each derived tag will implement it's own Read() function.

Parameter(s): size - number of bytes in tag including the type signature. pIO - IO object used to read in tag. The IO object should already be initialized to point to the begining of the tag.

Returns true if Read is successful.

Reimplemented in CIccTagEmbeddedProfile.

197{ return Read(size, pIO); }
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Definition IccTagBasic.h:167

References CIccTag::Read().

+ Here is the call graph for this function:

◆ ReadAll()

virtual bool CIccTag::ReadAll ( )
inlinevirtualinherited

Function: ReadAll() - Read All sub data for tag from file. Called by CIccProfile::ReadAll() to read all sub data for tag

Returns true if ReadAll is successful.

Reimplemented in CIccTagEmbeddedProfile.

175{ return true; }

◆ SetFunctionType()

bool CIccTagParametricCurve::SetFunctionType ( icUInt16Number  nFunctionType)

Name: CIccTagParametricCurve::SetFunctionType

Purpose: Sets the type of the function the Parametric curve represents

Args: nFunctionType = the type of the function encoded as 0-4

Return: always true!!

942{
943 icUInt16Number nNumParam;
944
945 switch(nFunctionType) {
946 case 0x0000:
947 nNumParam = 1;
948 break;
949
950 case 0x0001:
951 nNumParam = 3;
952 break;
953
954 case 0x0002:
955 nNumParam = 4;
956 break;
957
958 case 0x0003:
959 nNumParam = 5;
960 break;
961
962 case 0x0004:
963 nNumParam = 7;
964 break;
965
966 default:
967 nNumParam = 0;
968 }
969
970 if (m_dParam)
971 delete m_dParam;
972 m_nNumParam = nNumParam;
973 m_nFunctionType = nFunctionType;
974
975 if (m_nNumParam)
977 else
978 m_dParam = NULL;
979
980 return true;
981}

References m_dParam, m_nFunctionType, and m_nNumParam.

Referenced by CIccTagXmlParametricCurve::ParseXml(), and Read().

+ Here is the caller graph for this function:

◆ Validate()

icValidateStatus CIccTagParametricCurve::Validate ( std::string  sigPath,
std::string &  sReport,
const CIccProfile pProfile = NULL 
) const
virtual

Name: CIccTagParametricCurve::Validate

Purpose: Check tag data validity.

Args: sig = signature of tag being validated, sReport = String to add report information to

Return: icValidateStatusOK if valid, or other error status.

Reimplemented from CIccTag.

1091{
1092 icValidateStatus rv = CIccTag::Validate(sigPath, sReport, pProfile);
1093
1094 CIccInfo Info;
1095 std::string sSigPathName = Info.GetSigPathName(sigPath);
1096 icSignature sig = icGetFirstSigPathSig(sigPath);
1097
1098 if (m_nReserved2!=0) {
1099 sReport += icMsgValidateNonCompliant;
1100 sReport += sSigPathName;
1101 sReport += " - Reserved Value must be zero.\n";
1102
1104 }
1105
1106 switch(m_nFunctionType) {
1107case 0x0000:
1108 if (m_nNumParam!=1) {
1109 sReport += icMsgValidateCriticalError;
1110 sReport += sSigPathName;
1111 sReport += " - Number of parameters inconsistent with function type.\n";
1113 }
1114 break;
1115
1116case 0x0001:
1117 if (m_nNumParam!=3) {
1118 sReport += icMsgValidateCriticalError;
1119 sReport += sSigPathName;
1120 sReport += " - Number of parameters inconsistent with function type.\n";
1122 }
1123 break;
1124
1125case 0x0002:
1126 if (m_nNumParam!=4) {
1127 sReport += icMsgValidateCriticalError;
1128 sReport += sSigPathName;
1129 sReport += " - Number of parameters inconsistent with function type.\n";
1131 }
1132 break;
1133
1134case 0x0003:
1135 if (m_nNumParam!=5) {
1136 sReport += icMsgValidateCriticalError;
1137 sReport += sSigPathName;
1138 sReport += " - Number of parameters inconsistent with function type.\n";
1140 }
1141 break;
1142
1143case 0x0004:
1144 if (m_nNumParam!=7) {
1145 sReport += icMsgValidateCriticalError;
1146 sReport += sSigPathName;
1147 sReport += " - Number of parameters inconsistent with function type.\n";
1149 }
1150 break;
1151
1152default:
1153 sReport += icMsgValidateCriticalError;
1154 sReport += sSigPathName;
1155 sReport += " - Unknown function type.\n";
1157 }
1158
1159 if (sig==icSigBlueTRCTag || sig==icSigRedTRCTag || sig==icSigGreenTRCTag || sig==icSigGrayTRCTag) {
1160 icFloatNumber lval = Apply(0.0);
1161 icFloatNumber uval = Apply(1.0);
1162 if (lval>0.0 || uval<1.0) {
1163 sReport += icMsgValidateWarning;
1164 sReport += sSigPathName;
1165 sReport += " - Curve cannot be accurately inverted.\n";
1167 }
1168 }
1169
1170 return rv;
1171}
icUInt32Number icSignature
Definition icProfileHeader.h:271
@ icSigGrayTRCTag
Definition icProfileHeader.h:421
@ icSigGreenTRCTag
Definition icProfileHeader.h:424
@ icSigRedTRCTag
Definition icProfileHeader.h:463
@ icSigBlueTRCTag
Definition icProfileHeader.h:349
icValidateStatus
Definition IccDefs.h:119
@ icValidateWarning
Definition IccDefs.h:121
@ icValidateCriticalError
Definition IccDefs.h:123
@ icValidateNonCompliant
Definition IccDefs.h:122
ICCPROFLIB_API icSignature icGetFirstSigPathSig(std::string sigPath)
Definition IccUtil.cpp:1201
ICCPROFLIB_API const char * icMsgValidateWarning
Definition IccUtil.cpp:90
ICCPROFLIB_API const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
ICCPROFLIB_API icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Definition IccUtil.cpp:244
ICCPROFLIB_API const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
Definition IccTagBasic.cpp:164
virtual icFloatNumber Apply(icFloatNumber v) const
Definition IccTagLut.cpp:1024

References Apply(), CIccInfo::GetSigPathName(), icGetFirstSigPathSig(), icMaxStatus(), icMsgValidateCriticalError, icMsgValidateNonCompliant, icMsgValidateWarning, icSigBlueTRCTag, icSigGrayTRCTag, icSigGreenTRCTag, icSigRedTRCTag, icValidateCriticalError, icValidateNonCompliant, icValidateWarning, m_nFunctionType, m_nNumParam, m_nReserved2, and CIccTag::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccTagParametricCurve::Write ( CIccIO pIO)
virtual

Name: CIccTagParametricCurve::Write

Purpose: Write the tag to a file

Args: pIO - The IO object to write tag to.

Return: true = succesful, false = failure

Reimplemented from CIccTag.

792{
794
795 if (!pIO) {
796 return false;
797 }
798
799 sig = GetType();
800
801 if (!pIO->Write32(&sig) ||
802 !pIO->Write32(&m_nReserved) ||
803 !pIO->Write16(&m_nFunctionType) ||
804 !pIO->Write16(&m_nReserved2))
805 return false;
806
807 if (m_nNumParam) {
808 int i;
809 for (i=0; i<m_nNumParam; i++) {
811 if (!pIO->Write32(&num, 1))
812 return false;
813 }
814 }
815
816 if (!pIO->Align32())
817 return false;
818
819 return true;
820}
ICCPROFLIB_API icS15Fixed16Number icDtoF(icFloatNumber num)
Definition IccUtil.cpp:545
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:122
bool Align32()
Write operation to make sure that filelength is evenly divisible by 4.
Definition IccIO.cpp:341
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
virtual icTagTypeSignature GetType() const
Definition IccTagLut.h:179

References CIccIO::Align32(), GetType(), icDtoF(), m_dParam, m_nFunctionType, m_nNumParam, CIccTag::m_nReserved, m_nReserved2, CIccIO::Write16(), and CIccIO::Write32().

+ Here is the call graph for this function:

Field Documentation

◆ m_dParam

◆ m_nFunctionType

◆ m_nNumParam

◆ m_nReserved

icUInt32Number CIccTag::m_nReserved
inherited

Referenced by CIccTag::CIccTag(), CIccTagMultiProcessElement::CIccTagMultiProcessElement(), CIccTagMultiProcessElement::CIccTagMultiProcessElement(), CIccTagMultiProcessElement::operator=(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccTagText::Read(), CIccTagUtf8Text::Read(), CIccTagZipUtf8Text::Read(), CIccTagUtf16Text::Read(), CIccTagTextDescription::Read(), CIccTagSignature::Read(), CIccTagNamedColor2::Read(), CIccTagXYZ::Read(), CIccTagChromaticity::Read(), CIccTagCicp::Read(), CIccTagSparseMatrixArray::Read(), CIccTagFixedNum< T, Tsig >::Read(), CIccTagNum< T, Tsig >::Read(), CIccTagFloatNum< T, Tsig >::Read(), CIccTagMeasurement::Read(), CIccTagMultiLocalizedUnicode::Read(), CIccTagData::Read(), CIccTagDateTime::Read(), CIccTagColorantOrder::Read(), CIccTagColorantTable::Read(), CIccTagViewingConditions::Read(), CIccTagProfileSeqDesc::Read(), CIccTagResponseCurveSet16::Read(), CIccTagSpectralDataInfo::Read(), CIccTagSpectralViewingConditions::Read(), CIccTagEmbeddedHeightImage::Read(), CIccTagEmbeddedNormalImage::Read(), CIccTagStruct::Read(), CIccTagArray::Read(), CIccTagDict::Read(), CIccTagCurve::Read(), Read(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), CIccTagLut16::Read(), CIccTagGamutBoundaryDesc::Read(), CIccTagMultiProcessElement::Read(), CIccTagProfileSequenceId::Read(), CIccTagEmbeddedProfile::Read(), CIccTag::Validate(), CIccTagText::Write(), CIccTagUtf8Text::Write(), CIccTagZipUtf8Text::Write(), CIccTagUtf16Text::Write(), CIccTagTextDescription::Write(), CIccTagSignature::Write(), CIccTagNamedColor2::Write(), CIccTagXYZ::Write(), CIccTagChromaticity::Write(), CIccTagCicp::Write(), CIccTagSparseMatrixArray::Write(), CIccTagFixedNum< T, Tsig >::Write(), CIccTagNum< T, Tsig >::Write(), CIccTagFloatNum< T, Tsig >::Write(), CIccTagMeasurement::Write(), CIccTagMultiLocalizedUnicode::Write(), CIccTagData::Write(), CIccTagDateTime::Write(), CIccTagColorantOrder::Write(), CIccTagColorantTable::Write(), CIccTagViewingConditions::Write(), CIccTagProfileSeqDesc::Write(), CIccTagResponseCurveSet16::Write(), CIccTagSpectralDataInfo::Write(), CIccTagSpectralViewingConditions::Write(), CIccTagEmbeddedHeightImage::Write(), CIccTagEmbeddedNormalImage::Write(), CIccTagStruct::Write(), CIccTagArray::Write(), CIccTagDict::Write(), CIccTagEmbeddedProfile::Write(), CIccTagCurve::Write(), Write(), CIccTagLutAtoB::Write(), CIccTagLut8::Write(), CIccTagLut16::Write(), CIccTagGamutBoundaryDesc::Write(), CIccTagMultiProcessElement::Write(), and CIccTagProfileSequenceId::Write().

◆ m_nReserved2


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