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

#include <IccMpeXml.h>

+ Inheritance diagram for CIccMpeXmlCurveSet:
+ Collaboration diagram for CIccMpeXmlCurveSet:

Public Member Functions

virtual ~CIccMpeXmlCurveSet ()
 
virtual void Apply (CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const
 
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual icAcsSignature GetBAcsSig ()
 
virtual const char * GetClassName () const
 
virtual icAcsSignature GetEAcsSig ()
 
virtual const char * GetExtClassName ()
 
virtual IIccExtensionMpeGetExtension ()
 
virtual CIccApplyMpeGetNewApply (CIccApplyTagMpe *pApplyTag)
 
virtual icElemTypeSignature GetType () const
 
virtual bool IsAcs ()
 
virtual bool IsLateBinding () const
 
virtual bool IsLateBindingReflectance () const
 
virtual bool IsSupported ()
 
virtual CIccMultiProcessElementNewCopy () const
 
virtual icUInt16Number NumInputChannels () const
 
virtual icUInt16Number NumOutputChannels () const
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
bool SetCurve (int nIndex, icCurveSetCurvePtr newCurve)
 
bool SetSize (int nNewSize)
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 
virtual bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccMultiProcessElementCreate (icElemTypeSignature sig)
 

Data Fields

icUInt32Number m_nReserved
 

Protected Attributes

icCurveSetCurvePtrm_curve
 
icUInt16Number m_nInputChannels
 
icUInt16Number m_nOutputChannels
 
icPositionNumberm_position
 

Detailed Description

Constructor & Destructor Documentation

◆ ~CIccMpeXmlCurveSet()

virtual CIccMpeXmlCurveSet::~CIccMpeXmlCurveSet ( )
inlinevirtual
112{}

Member Function Documentation

◆ Apply()

void CIccMpeCurveSet::Apply ( CIccApplyMpe pApply,
icFloatNumber pDestPixel,
const icFloatNumber pSrcPixel 
) const
virtualinherited

Name: CIccMpeCurveSet::Apply

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

3457{
3458 int i;
3459 for (i=0; i<m_nInputChannels; i++) {
3460 *pDestPixel++ = m_curve[i]->Apply(*pSrcPixel++);
3461 }
3462}
virtual icFloatNumber Apply(icFloatNumber v) const =0
icCurveSetCurvePtr * m_curve
Definition IccMpeBasic.h:451
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191

References CIccCurveSetCurve::Apply(), CIccMpeCurveSet::m_curve, and CIccMultiProcessElement::m_nInputChannels.

+ Here is the call graph for this function:

◆ Begin()

bool CIccMpeCurveSet::Begin ( icElemInterp  nInterp,
CIccTagMultiProcessElement pMPE 
)
virtualinherited

Name: CIccMpeCurveSet::Begin

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

3423{
3424 if (!m_curve)
3425 return false;
3426
3427 icCurveMap map;
3428
3429 int i;
3430 for (i=0; i<m_nInputChannels; i++) {
3431 if (!m_curve[i])
3432 return false;
3433
3434 if (!map[m_curve[i]]) {
3435 if (!m_curve[i]->Begin(nInterp, pMPE)) {
3436 return false;
3437 }
3438 //ensure that Begin is called only once for each curve
3439 map[m_curve[i]] = (CIccCurveSetCurve*)1;
3440 }
3441 }
3442
3443 return true;
3444}
std::map< icCurveSetCurvePtr, icCurveSetCurvePtr > icCurveMap
Definition IccMpeBasic.cpp:2999
Definition IccMpeBasic.h:215
virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
Definition IccMpeBasic.cpp:3422

References CIccCurveSetCurve::Begin(), CIccMpeCurveSet::m_curve, and CIccMultiProcessElement::m_nInputChannels.

+ Here is the call graph for this function:

◆ Create()

CIccMultiProcessElement * CIccMultiProcessElement::Create ( icElemTypeSignature  sig)
staticinherited

Name: CIccMultiProcessElement::Create

Purpose:

Args:

Return:

132{
134}
static CIccMultiProcessElement * CreateElement(icElemTypeSignature elemTypeSig)
Definition IccMpeFactory.h:213

References CIccMpeCreator::CreateElement().

Referenced by CIccDefaultEncProfileConverter::ConvertFromParams(), CIccSampledCalculatorCurve::Read(), CIccMpeCalculator::Read(), and CIccTagMultiProcessElement::Read().

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

◆ Describe()

void CIccMpeCurveSet::Describe ( std::string &  sDescription,
int  nVerboseness 
)
virtualinherited

Name: CIccMpeCurveSet::Describe

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

3204{
3205 if (m_curve) {
3206 icChar buf[81];
3207 int i;
3208
3209 sprintf(buf, "BEGIN_CURVE_SET %d\n", m_nInputChannels);
3210 sDescription += buf;
3211
3212 for (i=0; i<m_nInputChannels; i++) {
3213 sprintf(buf, "Curve %d of %d\n", i+1, m_nInputChannels);
3214 sDescription += buf;
3215 if (m_curve[i]) {
3216 m_curve[i]->Describe(sDescription, nVerboseness);
3217 }
3218 }
3219 sDescription += "END_CURVE_SET\n";
3220 }
3221}
char icChar
Definition IccDefs.h:110
virtual void Describe(std::string &sDescription, int nVerboseness=100)=0

References CIccCurveSetCurve::Describe(), CIccMpeCurveSet::m_curve, and CIccMultiProcessElement::m_nInputChannels.

+ Here is the call graph for this function:

◆ GetBAcsSig()

virtual icAcsSignature CIccMultiProcessElement::GetBAcsSig ( )
inlinevirtualinherited

Reimplemented in CIccMpeBAcs.

178{ return icSigAcsZero; }
#define icSigAcsZero
Definition icProfileHeader.h:1100

Referenced by CIccMpeAcs::Describe().

+ Here is the caller graph for this function:

◆ GetClassName()

virtual const char * CIccMpeXmlCurveSet::GetClassName ( ) const
inlinevirtual

Reimplemented from CIccMpeCurveSet.

114{ return "CIccMpeXmlCurveSet"; }

◆ GetEAcsSig()

virtual icAcsSignature CIccMultiProcessElement::GetEAcsSig ( )
inlinevirtualinherited

Reimplemented in CIccMpeEAcs.

179{ return icSigAcsZero; }

◆ GetExtClassName()

virtual const char * CIccMpeXml::GetExtClassName ( )
inlinevirtualinherited

Implements IIccExtensionMpe.

84{ return "CIccMpeXml"; }

◆ GetExtension()

virtual IIccExtensionMpe * CIccMpeXmlCurveSet::GetExtension ( )
inlinevirtual

Reimplemented from CIccMultiProcessElement.

116{ return this; }

◆ GetNewApply()

CIccApplyMpe * CIccMultiProcessElement::GetNewApply ( CIccApplyTagMpe pApplyTag)
virtualinherited

Name: CIccMultiProcessElement::GetNewApply()

Purpose:

Args:

Return:

Reimplemented in CIccMpeCLUT, CIccMpeCalculator, and CIccMpeSpectralCLUT.

147{
148 return new CIccApplyMpe(this);
149}
Definition IccTagMPE.h:203

References CIccApplyMpe::CIccApplyMpe().

Referenced by CIccApplyTagMpe::AppendElem(), and CIccMpeCalculator::GetNewApply().

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

◆ GetType()

virtual icElemTypeSignature CIccMpeCurveSet::GetType ( ) const
inlinevirtualinherited

Implements CIccMultiProcessElement.

437{ return icSigCurveSetElemType; }
@ icSigCurveSetElemType
Definition icProfileHeader.h:643

References icSigCurveSetElemType.

Referenced by CIccMpeCurveSet::Validate(), and CIccMpeCurveSet::Write().

+ Here is the caller graph for this function:

◆ IsAcs()

virtual bool CIccMultiProcessElement::IsAcs ( )
inlinevirtualinherited

Reimplemented in CIccMpeAcs.

177{ return false; }

Referenced by CIccTagMultiProcessElement::Apply().

+ Here is the caller graph for this function:

◆ IsLateBinding()

virtual bool CIccMultiProcessElement::IsLateBinding ( ) const
inlinevirtualinherited

Reimplemented in CIccMpeCalculator, CIccMpeSpectralMatrix, CIccMpeSpectralCLUT, and CIccMpeSpectralObserver.

184{ return false; }

Referenced by CIccMpeCalculator::IsLateBinding(), and CIccTagMultiProcessElement::IsLateBinding().

+ Here is the caller graph for this function:

◆ IsLateBindingReflectance()

virtual bool CIccMultiProcessElement::IsLateBindingReflectance ( ) const
inlinevirtualinherited

Reimplemented in CIccMpeCalculator, CIccMpeReflectanceCLUT, and CIccMpeReflectanceObserver.

185{ return false; }

Referenced by CIccMpeCalculator::IsLateBindingReflectance(), and CIccTagMultiProcessElement::IsLateBindingReflectance().

+ Here is the caller graph for this function:

◆ IsSupported()

virtual bool CIccMultiProcessElement::IsSupported ( )
inlinevirtualinherited

Reimplemented in CIccMpeUnknown.

162{ return true; }

Referenced by CIccTagMultiProcessElement::IsSupported().

+ Here is the caller graph for this function:

◆ NewCopy()

virtual CIccMultiProcessElement * CIccMpeCurveSet::NewCopy ( ) const
inlinevirtualinherited

Implements CIccMultiProcessElement.

430{ return new CIccMpeCurveSet(*this);}
Definition IccMpeBasic.h:425

References CIccMpeCurveSet::CIccMpeCurveSet().

+ Here is the call graph for this function:

◆ NumInputChannels()

◆ NumOutputChannels()

◆ ParseXml()

bool CIccMpeXmlCurveSet::ParseXml ( xmlNode *  pNode,
std::string &  parseStr 
)
virtual

Implements CIccMpeXml.

1127{
1128 icUInt16Number nChannels = (icUInt16Number)atoi(icXmlAttrValue(pNode, "InputChannels"));
1129
1130 if (!nChannels || atoi(icXmlAttrValue(pNode, "OutputChannels")) != nChannels) {
1131 parseStr += "Invalid InputChannels or OutputChannels In CurveSetElement\n";
1132 return false;
1133 }
1134
1135 SetSize(nChannels);
1136 int nIndex = 0;
1137 for (pNode = pNode->children, nIndex = 0;
1138 pNode;
1139 pNode=pNode->next) {
1140 if (pNode->type == XML_ELEMENT_NODE) {
1141 if (nIndex >= nChannels) {
1142 return false;
1143 }
1144 else if (!strcmp((const char*)pNode->name, "DuplicateCurve")) {
1145 const char *attr = icXmlAttrValue(pNode, "Index", NULL);
1146
1147 if (attr) {
1148 int nCopyIndex = atoi(attr);
1149 if (nCopyIndex >= 0 && nCopyIndex < nIndex) {
1150 m_curve[nIndex] = m_curve[nCopyIndex];
1151 nIndex++;
1152 }
1153 else {
1154 parseStr += "Invalid index for duplicate CurveSet Curve\n";
1155 return false;
1156 }
1157 }
1158 else {
1159 parseStr += "Missing index for duplicate CurveSet Curve\n";
1160 return false;
1161 }
1162 }
1163 else {
1164 icCurveSetCurvePtr pCurve = ParseXmlCurve(pNode, parseStr);
1165
1166 if (!pCurve)
1167 return false;
1168
1169 if (!SetCurve(nIndex, pCurve))
1170 return false;
1171 nIndex++;
1172 }
1173 }
1174 }
1175
1176 if (!pNode && nIndex == nChannels)
1177 return true;
1178
1179 return false;
1180}
unsigned short icUInt16Number
Definition icProfileHeader.h:256
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault="")
Definition IccUtilXml.cpp:572
static icCurveSetCurvePtr ParseXmlCurve(xmlNode *pNode, std::string parseStr)
Definition IccMpeXml.cpp:1087
bool SetSize(int nNewSize)
Definition IccMpeBasic.cpp:3112
bool SetCurve(int nIndex, icCurveSetCurvePtr newCurve)
Definition IccMpeBasic.cpp:3168

References icXmlAttrValue(), CIccMpeCurveSet::m_curve, ParseXmlCurve(), CIccMpeCurveSet::SetCurve(), and CIccMpeCurveSet::SetSize().

+ Here is the call graph for this function:

◆ Read()

bool CIccMpeCurveSet::Read ( icUInt32Number  size,
CIccIO pIO 
)
virtualinherited

Name: CIccMpeCurveSet::Read

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

3237{
3239
3240 icUInt32Number startPos = pIO->Tell();
3241
3242 icUInt32Number headerSize = sizeof(icTagTypeSignature) +
3243 sizeof(icUInt32Number) +
3244 sizeof(icUInt16Number) +
3245 sizeof(icUInt16Number);
3246
3247 if (headerSize > size)
3248 return false;
3249
3250 if (!pIO) {
3251 return false;
3252 }
3253
3254 icUInt16Number nInputChannels, nOutputChannels;
3255
3256 if (!pIO->Read32(&sig))
3257 return false;
3258
3259 if (!pIO->Read32(&m_nReserved))
3260 return false;
3261
3262 if (!pIO->Read16(&nInputChannels))
3263 return false;
3264
3265 if (!pIO->Read16(&nOutputChannels))
3266 return false;
3267
3268 if (nInputChannels != nOutputChannels)
3269 return false;
3270
3271 if (nInputChannels > size - headerSize || nInputChannels * 2*sizeof(icUInt32Number) > size - headerSize)
3272 return false;
3273
3274 if (!SetSize(nInputChannels))
3275 return false;
3276
3277 if (m_curve) {
3278 int i;
3279
3280 if (headerSize + m_nInputChannels*2*sizeof(icUInt32Number) > size)
3281 return false;
3282
3283 for (i=0; i<m_nInputChannels; i++) {
3284 if (!pIO->Read32(&m_position[i].offset)) {
3285 return false;
3286 }
3287 if (!pIO->Read32(&m_position[i].size)) {
3288 return false;
3289 }
3290 }
3291
3292 icCurveOffsetMap map;
3293 icCurveElemSignature curveSig;
3294 for (i=0; i<m_nInputChannels; i++) {
3295 if (!map[m_position[i].offset]) {
3296 icUInt32Number pos;
3297 if (!m_position[i].offset || !m_position[i].size) {
3298 return false;
3299 }
3300
3301 pos = startPos + m_position[i].offset;
3302 if (pIO->Seek(pos, icSeekSet)!=(icInt32Number)pos) {
3303 return false;
3304 }
3305
3306 if (!pIO->Read32(&curveSig)) {
3307 return false;
3308 }
3309 m_curve[i] = CIccCurveSetCurve::Create(curveSig);
3310
3311 if (!m_curve[i]) {
3312 return false;
3313 }
3314
3315 if (pIO->Seek(pos, icSeekSet)!=(icInt32Number)pos) {
3316 return false;
3317 }
3318
3319 if (!m_curve[i]->Read(m_position[i].size, pIO)) {
3320 return false;
3321 }
3322
3323 map[m_position[i].offset] = m_curve[i];
3324 }
3325 else {
3326 m_curve[i] = map[m_position[i].offset];
3327 }
3328 }
3329 }
3330
3331 return true;
3332}
icCurveElemSignature
Definition icProfileHeader.h:1056
long icInt32Number
Definition icProfileHeader.h:291
icElemTypeSignature
Definition icProfileHeader.h:641
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icUInt32Number offset
Definition icProfileHeader.h:1461
icTagTypeSignature
Definition icProfileHeader.h:526
icUInt32Number size
Definition icProfileHeader.h:1462
std::map< icUInt32Number, CIccCurveSetCurve * > icCurveOffsetMap
Definition IccMpeBasic.cpp:3223
@ icSeekSet
Definition IccIO.h:83
static CIccCurveSetCurve * Create(icCurveElemSignature sig)
Definition IccMpeBasic.cpp:2960
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Definition IccMpeBasic.cpp:3236
icPositionNumber * m_position
Definition IccMpeBasic.h:453
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
icUInt32Number m_nReserved
Definition IccTagMPE.h:188

References CIccCurveSetCurve::Create(), icSeekSet, CIccMpeCurveSet::m_curve, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nReserved, CIccMpeCurveSet::m_position, icPositionNumber::offset, CIccCurveSetCurve::Read(), CIccIO::Read16(), CIccIO::Read32(), CIccIO::Seek(), CIccMpeCurveSet::SetSize(), icPositionNumber::size, and CIccIO::Tell().

+ Here is the call graph for this function:

◆ SetCurve()

bool CIccMpeCurveSet::SetCurve ( int  nIndex,
icCurveSetCurvePtr  newCurve 
)
inherited

Name: CIccMpeCurveSet::SetCurve

Purpose:

Args:

Return:

3169{
3170 if (nIndex<0 || nIndex>m_nInputChannels)
3171 return false;
3172
3173 if (m_curve) {
3174 int i;
3175
3176 for (i = 0; i < m_nInputChannels; i++)
3177 if (i != nIndex && m_curve[i] == m_curve[nIndex])
3178 break;
3179
3180 if (i == m_nInputChannels && m_curve[nIndex]) {
3181 delete m_curve[nIndex];
3182 }
3183
3184 m_curve[nIndex] = newCurve;
3185 }
3186 else
3187 return false;
3188
3189 return true;
3190}

References CIccMpeCurveSet::m_curve, and CIccMultiProcessElement::m_nInputChannels.

Referenced by CDevLinkWriter::begin(), CIccDefaultEncProfileConverter::ConvertFromParams(), main(), and ParseXml().

+ Here is the caller graph for this function:

◆ SetSize()

bool CIccMpeCurveSet::SetSize ( int  nNewSize)
inherited

Name: CIccMpeCurveSet::SetSize

Purpose:

Args:

Return:

3113{
3114 if (m_curve) {
3115 icCurveMap map;
3116 int i;
3117
3118 for (i=0; i<m_nInputChannels; i++) {
3119 if (!map[m_curve[i]]) {
3120 map[m_curve[i]] = (CIccCurveSetCurve*)1;
3121 delete m_curve[i];
3122 }
3123 }
3124 free(m_curve);
3125 }
3126 if (m_position) {
3127 free(m_position);
3128 }
3129
3130 if (nNewSize) {
3131 m_curve = (icCurveSetCurvePtr*)calloc(nNewSize, sizeof(icCurveSetCurvePtr));
3132
3133 if (!m_curve) {
3134 m_position = NULL;
3136 return false;
3137 }
3138
3139 m_position = (icPositionNumber*)calloc(nNewSize, sizeof(icPositionNumber));
3140
3141 if (!m_position) {
3142 free(m_curve);
3143 m_curve = NULL;
3144
3146 return false;
3147 }
3149 }
3150 else {
3151 m_curve = NULL;
3153 }
3154
3155 return true;
3156}
Definition icProfileHeader.h:1460

References CIccMpeCurveSet::m_curve, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, and CIccMpeCurveSet::m_position.

Referenced by CIccMpeCurveSet::~CIccMpeCurveSet(), CIccDefaultEncProfileConverter::ConvertFromParams(), ParseXml(), and CIccMpeCurveSet::Read().

+ Here is the caller graph for this function:

◆ ToXml()

bool CIccMpeXmlCurveSet::ToXml ( std::string &  xml,
std::string  blanks = "" 
)
virtual

Implements CIccMpeXml.

1051{
1052 char line[256];
1053 sprintf(line, "<CurveSetElement InputChannels=\"%d\" OutputChannels=\"%d\"", NumInputChannels(), NumOutputChannels());
1054 xml += blanks + line;
1055
1056 if (m_nReserved) {
1057 sprintf(line, " Reserved=\"%u\"", m_nReserved);
1058 xml += line;
1059 }
1060 xml += ">\n";
1061
1062 int i, j;
1063
1064 for (i=0; i<NumInputChannels(); i++) {
1065 CIccCurveSetCurve* curve = m_curve[i];
1066
1067 //check for duplicate curves
1068 for (j = 0; j < i; j++) {
1069 if (m_curve[i] == m_curve[j])
1070 break;
1071 }
1072
1073 //handle case of duplicate curve
1074 if (j < i) {
1075 sprintf(line, "<DuplicateCurve Index=\"%d\"/>\n", j);
1076 xml += blanks + " ";
1077 xml += line;
1078 }
1079 else if (!ToXmlCurve(xml, blanks, m_curve[i]))
1080 return false;
1081 }
1082
1083 xml += blanks + "</CurveSetElement>\n";
1084 return true;
1085}
static bool ToXmlCurve(std::string &xml, std::string blanks, icCurveSetCurvePtr pCurve)
Definition IccMpeXml.cpp:1024
virtual icUInt16Number NumInputChannels() const
Definition IccTagMPE.h:159
virtual icUInt16Number NumOutputChannels() const
Definition IccTagMPE.h:160

References CIccMpeCurveSet::m_curve, CIccMultiProcessElement::m_nReserved, CIccMultiProcessElement::NumInputChannels(), CIccMultiProcessElement::NumOutputChannels(), and ToXmlCurve().

+ Here is the call graph for this function:

◆ Validate()

icValidateStatus CIccMpeCurveSet::Validate ( std::string  sigPath,
std::string &  sReport,
const CIccTagMultiProcessElement pMPE = NULL,
const CIccProfile pProfile = NULL 
) const
virtualinherited

Name: CIccMpeCurveSet::Validate

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

3475{
3476 std::string mpeSigPath = sigPath + icGetSigPath(GetType());
3477 icValidateStatus rv = CIccMultiProcessElement::Validate(sigPath, sReport, pMPE, pProfile);
3478
3479 bool empty=false;
3480 if (m_curve) {
3481 int i;
3482 for (i=0; !empty && i<m_nInputChannels; i++) {
3483 if (!m_curve[i]) {
3484 empty = true;
3485 }
3486 else {
3487 rv = icMaxStatus(rv, m_curve[i]->Validate(mpeSigPath, sReport, pMPE, pProfile));
3488 }
3489 }
3490 }
3491 else
3492 empty = true;
3493
3494 if (empty) {
3495 CIccInfo Info;
3496 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
3497
3498 sReport += icMsgValidateCriticalError;
3499 sReport += sSigPathName;
3500 sReport += " - Has Empty Curve Element(s)!\n";
3502 }
3503
3504 return rv;
3505}
icValidateStatus
Definition IccDefs.h:119
@ icValidateCriticalError
Definition IccDefs.h:123
ICCPROFLIB_API std::string icGetSigPath(icUInt32Number sig)
Definition IccUtil.cpp:1191
ICCPROFLIB_API const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
ICCPROFLIB_API icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Definition IccUtil.cpp:244
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
virtual icElemTypeSignature GetType() const
Definition IccMpeBasic.h:437
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
Definition IccMpeBasic.cpp:3474
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const =0
Definition IccTagMPE.cpp:454

References CIccInfo::GetSigPathName(), CIccMpeCurveSet::GetType(), icGetSigPath(), icMaxStatus(), icMsgValidateCriticalError, icValidateCriticalError, CIccMpeCurveSet::m_curve, CIccMultiProcessElement::m_nInputChannels, CIccCurveSetCurve::Validate(), and CIccMultiProcessElement::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccMpeCurveSet::Write ( CIccIO pIO)
virtualinherited

Name: CIccMpeCurveSet::Write

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

3345{
3347
3348 if (!pIO)
3349 return false;
3350
3351 icUInt32Number elemStart = pIO->Tell();
3352
3353 if (!pIO->Write32(&sig))
3354 return false;
3355
3356 if (!pIO->Write32(&m_nReserved))
3357 return false;
3358
3359 if (!pIO->Write16(&m_nInputChannels))
3360 return false;
3361
3362 if (!pIO->Write16(&m_nInputChannels))
3363 return false;
3364
3365 if (m_curve && m_nInputChannels) {
3366 int i;
3367 icCurvePtrMap map;
3368 icUInt32Number start, end;
3369 icUInt32Number zeros[2] = { 0, 0};
3370 icPositionNumber position;
3371
3372 icUInt32Number startTable = pIO->Tell();
3373
3374 //First write empty position table
3375 for (i=0; i<m_nInputChannels; i++) {
3376 if (pIO->Write32(&zeros[0], 2)!=2)
3377 return false;
3378 }
3379
3380 //Now Write curves
3381 for (i=0; i<m_nInputChannels; i++) {
3382 if (m_curve[i]) {
3383 if (map.find(m_curve[i])==map.end()) {
3384 start = pIO->Tell();
3385 m_curve[i]->Write(pIO);
3386 end = pIO->Tell();
3387 pIO->Align32();
3388 position.offset = start - elemStart;
3389 position.size = end - start;
3390 map[m_curve[i]] = position;
3391 }
3392 m_position[i] = map[m_curve[i]];
3393 }
3394 }
3395 end = pIO->Tell();
3396
3397 //Back fill position table
3398 pIO->Seek(startTable, icSeekSet);
3399 for (i=0; i<m_nInputChannels; i++) {
3400 if (!pIO->Write32(&m_position[i].offset))
3401 return false;
3402 if (!pIO->Write32(&m_position[i].size))
3403 return false;
3404 }
3405
3406 pIO->Seek(end, icSeekSet);
3407 }
3408
3409 return true;
3410}
std::map< CIccCurveSetCurve *, icPositionNumber > icCurvePtrMap
Definition IccMpeBasic.cpp:3224
virtual bool Write(CIccIO *pIO)=0
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

References CIccIO::Align32(), CIccMpeCurveSet::GetType(), icSeekSet, CIccMpeCurveSet::m_curve, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nReserved, CIccMpeCurveSet::m_position, icPositionNumber::offset, CIccIO::Seek(), icPositionNumber::size, CIccIO::Tell(), CIccCurveSetCurve::Write(), CIccIO::Write16(), and CIccIO::Write32().

+ Here is the call graph for this function:

Field Documentation

◆ m_curve

◆ m_nInputChannels

icUInt16Number CIccMultiProcessElement::m_nInputChannels
protectedinherited

Referenced by CIccMpeBAcs::CIccMpeBAcs(), CIccMpeBAcs::CIccMpeBAcs(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCAM::CIccMpeCAM(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeExtCLUT::CIccMpeExtCLUT(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeToneMap::CIccMpeToneMap(), CIccMpeToneMap::CIccMpeToneMap(), CIccMultiProcessElement::CIccMultiProcessElement(), CIccMpeAcs::Apply(), CIccMpeCurveSet::Apply(), CIccMpeMatrix::Apply(), CIccMpeAcs::Begin(), CIccMpeCurveSet::Begin(), CIccMpeMatrix::Begin(), CIccMpeCLUT::Begin(), CIccMpeEmissionMatrix::Begin(), CIccMpeInvEmissionMatrix::Begin(), CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), CIccMpeEmissionObserver::Begin(), CIccMpeReflectanceObserver::Begin(), CIccMpeSpectralCLUT::copyData(), CIccMpeSpectralMatrix::copyData(), CIccMpeSpectralObserver::copyData(), CIccMpeCurveSet::Describe(), CIccMpeMatrix::Describe(), CIccMpeCalculator::Describe(), CIccMpeSpectralMatrix::Describe(), CIccMpeSpectralObserver::Describe(), CIccMpeXmlCalculator::Flatten(), CIccMultiProcessElement::NumInputChannels(), CIccMpeEmissionMatrix::numVectors(), CIccMpeBAcs::operator=(), CIccMpeCalculator::operator=(), CIccMpeCLUT::operator=(), CIccMpeCurveSet::operator=(), CIccMpeEAcs::operator=(), CIccMpeMatrix::operator=(), CIccMpeTintArray::operator=(), CIccMpeToneMap::operator=(), CIccMpeXmlTintArray::ParseXml(), CIccMpeXmlToneMap::ParseXml(), CIccMpeXmlMatrix::ParseXml(), CIccMpeXmlCLUT::ParseXml(), CIccMpeXmlExtCLUT::ParseXml(), CIccMpeXmlBAcs::ParseXml(), CIccMpeXmlEAcs::ParseXml(), CIccMpeXmlJabToXYZ::ParseXml(), CIccMpeXmlXYZToJab::ParseXml(), CIccMpeXmlCalculator::ParseXml(), CIccMpeXmlEmissionCLUT::ParseXml(), CIccMpeXmlReflectanceCLUT::ParseXml(), CIccMpeAcs::Read(), CIccMpeCurveSet::Read(), CIccMpeTintArray::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeCLUT::SetCLUT(), CIccMpeCurveSet::SetCurve(), CIccMpeSpectralCLUT::SetData(), CIccMpeCalculator::SetSize(), CIccMpeMatrix::SetSize(), CIccMpeSpectralMatrix::SetSize(), CIccMpeSpectralObserver::SetSize(), CIccMpeCurveSet::SetSize(), CIccMpeCurveSet::Validate(), CIccMpeTintArray::Validate(), CIccMpeToneMap::Validate(), CIccMpeCAM::Validate(), CIccMpeInvEmissionMatrix::Validate(), CIccMpeAcs::Write(), CIccMpeCurveSet::Write(), CIccMpeTintArray::Write(), CIccMpeToneMap::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccMpeCalculator::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), and CIccMpeSpectralObserver::Write().

◆ m_nOutputChannels

icUInt16Number CIccMultiProcessElement::m_nOutputChannels
protectedinherited

Referenced by CIccMpeBAcs::CIccMpeBAcs(), CIccMpeBAcs::CIccMpeBAcs(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCAM::CIccMpeCAM(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeExtCLUT::CIccMpeExtCLUT(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeToneMap::CIccMpeToneMap(), CIccMpeToneMap::CIccMpeToneMap(), CIccMultiProcessElement::CIccMultiProcessElement(), CIccMpeTintArray::Apply(), CIccMpeToneMap::Apply(), CIccMpeMatrix::Apply(), CIccMpeAcs::Begin(), CIccMpeTintArray::Begin(), CIccMpeToneMap::Begin(), CIccMpeMatrix::Begin(), CIccMpeEmissionMatrix::Begin(), CIccMpeInvEmissionMatrix::Begin(), CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), CIccMpeEmissionObserver::Begin(), CIccMpeReflectanceObserver::Begin(), CIccMpeToneMap::ClearToneFuncs(), CIccMpeSpectralCLUT::copyData(), CIccMpeSpectralMatrix::copyData(), CIccMpeSpectralObserver::copyData(), CIccMpeToneMap::CopyToneFuncs(), CIccMpeMatrix::Describe(), CIccMpeCalculator::Describe(), CIccMpeSpectralMatrix::Describe(), CIccMpeSpectralObserver::Describe(), CIccMpeTintArray::Describe(), CIccMpeToneMap::Describe(), CIccMpeXmlCalculator::Flatten(), CIccMpeToneMap::Insert(), CIccMultiProcessElement::NumOutputChannels(), CIccMpeInvEmissionMatrix::numVectors(), CIccMpeBAcs::operator=(), CIccMpeCalculator::operator=(), CIccMpeCLUT::operator=(), CIccMpeCurveSet::operator=(), CIccMpeEAcs::operator=(), CIccMpeMatrix::operator=(), CIccMpeTintArray::operator=(), CIccMpeToneMap::operator=(), CIccMpeXmlTintArray::ParseXml(), CIccMpeXmlToneMap::ParseXml(), CIccMpeXmlMatrix::ParseXml(), CIccMpeXmlCLUT::ParseXml(), CIccMpeXmlExtCLUT::ParseXml(), CIccMpeXmlBAcs::ParseXml(), CIccMpeXmlEAcs::ParseXml(), CIccMpeXmlJabToXYZ::ParseXml(), CIccMpeXmlXYZToJab::ParseXml(), CIccMpeXmlCalculator::ParseXml(), CIccMpeXmlEmissionCLUT::ParseXml(), CIccMpeXmlReflectanceCLUT::ParseXml(), CIccMpeAcs::Read(), CIccMpeTintArray::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeCLUT::SetCLUT(), CIccMpeSpectralCLUT::SetData(), CIccMpeToneMap::SetNumOutputChannels(), CIccMpeCalculator::SetSize(), CIccMpeMatrix::SetSize(), CIccMpeSpectralMatrix::SetSize(), CIccMpeSpectralObserver::SetSize(), CIccMpeCurveSet::SetSize(), CIccMpeTintArray::SetVectorSize(), CIccMpeTintArray::Validate(), CIccMpeToneMap::Validate(), CIccMpeCAM::Validate(), CIccMpeSpectralMatrix::Validate(), CIccMpeSpectralObserver::Validate(), CIccMpeAcs::Write(), CIccMpeTintArray::Write(), CIccMpeToneMap::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccMpeCalculator::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), and CIccMpeSpectralObserver::Write().

◆ m_nReserved

icUInt32Number CIccMultiProcessElement::m_nReserved
inherited

Referenced by CIccMpeAcs::CIccMpeAcs(), CIccMpeBAcs::CIccMpeBAcs(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCalculator::CIccMpeCalculator(), CIccMpeCAM::CIccMpeCAM(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeCurveSet::CIccMpeCurveSet(), CIccMpeEAcs::CIccMpeEAcs(), CIccMpeExtCLUT::CIccMpeExtCLUT(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeMatrix::CIccMpeMatrix(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralMatrix::CIccMpeSpectralMatrix(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeSpectralObserver::CIccMpeSpectralObserver(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeTintArray::CIccMpeTintArray(), CIccMpeToneMap::CIccMpeToneMap(), CIccMpeToneMap::CIccMpeToneMap(), CIccMultiProcessElement::CIccMultiProcessElement(), CIccMpeSpectralCLUT::copyData(), CIccMpeSpectralMatrix::copyData(), CIccMpeSpectralObserver::copyData(), CIccMpeBAcs::operator=(), CIccMpeCalculator::operator=(), CIccMpeCLUT::operator=(), CIccMpeCurveSet::operator=(), CIccMpeEAcs::operator=(), CIccMpeMatrix::operator=(), CIccMpeTintArray::operator=(), CIccMpeToneMap::operator=(), CIccTagXmlMultiProcessElement::ParseElement(), CIccMpeXmlCalculator::ParseImport(), CIccMpeAcs::Read(), CIccMpeCurveSet::Read(), CIccMpeTintArray::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeCalculator::Read(), CIccMpeSpectralMatrix::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeSpectralObserver::Read(), ToXml(), CIccMpeXmlTintArray::ToXml(), CIccMpeXmlToneMap::ToXml(), CIccMpeXmlMatrix::ToXml(), CIccMpeXmlCLUT::ToXml(), CIccMpeXmlExtCLUT::ToXml(), CIccMpeXmlBAcs::ToXml(), CIccMpeXmlEAcs::ToXml(), CIccMpeXmlJabToXYZ::ToXml(), CIccMpeXmlXYZToJab::ToXml(), CIccMpeXmlCalculator::ToXml(), CIccMpeXmlEmissionMatrix::ToXml(), CIccMpeXmlInvEmissionMatrix::ToXml(), CIccMpeXmlEmissionCLUT::ToXml(), CIccMpeXmlReflectanceCLUT::ToXml(), CIccMpeXmlEmissionObserver::ToXml(), CIccMpeXmlReflectanceObserver::ToXml(), CIccMultiProcessElement::Validate(), CIccMpeAcs::Write(), CIccMpeCurveSet::Write(), CIccMpeTintArray::Write(), CIccMpeToneMap::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccMpeCalculator::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), and CIccMpeSpectralObserver::Write().

◆ m_position


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