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

#include <IccMpeBasic.h>

+ Inheritance diagram for CIccMpeCurveSet:
+ Collaboration diagram for CIccMpeCurveSet:

Public Member Functions

 CIccMpeCurveSet (const CIccMpeCurveSet &curveSet)
 
 CIccMpeCurveSet (int nSize=0)
 
virtual ~CIccMpeCurveSet ()
 
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 icCharGetClassName () const
 
virtual icAcsSignature GetEAcsSig ()
 
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
 
CIccMpeCurveSetoperator= (const CIccMpeCurveSet &curveSet)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
bool SetCurve (int nIndex, icCurveSetCurvePtr newCurve)
 
bool SetSize (int nNewSize)
 
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

Class: CIccMpeCurveSet

Purpose: The curve set process element

Constructor & Destructor Documentation

◆ CIccMpeCurveSet() [1/2]

CIccMpeCurveSet::CIccMpeCurveSet ( int  nSize = 0)

Name: CIccMpeCurveSet::CIccMpeCurveSet

Purpose:

Args:

Return:

2985{
2986 m_nReserved = 0;
2987 if (nSize) {
2989 m_curve = (icCurveSetCurvePtr*)calloc(nSize, sizeof(icCurveSetCurvePtr));
2990 m_position = (icPositionNumber*)calloc(nSize, sizeof(icPositionNumber));
2991 }
2992 else {
2994 m_curve = NULL;
2995 m_position = NULL;
2996 }
2997}
Definition icProfileHeader.h:1460
Definition IccMpeBasic.h:215
icCurveSetCurvePtr * m_curve
Definition IccMpeBasic.h:451
icPositionNumber * m_position
Definition IccMpeBasic.h:453
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
icUInt32Number m_nReserved
Definition IccTagMPE.h:188

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

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

+ Here is the caller graph for this function:

◆ CIccMpeCurveSet() [2/2]

CIccMpeCurveSet::CIccMpeCurveSet ( const CIccMpeCurveSet curveSet)

Name: CIccMpeCurveSet::CIccMpeCurveSet

Purpose:

Args:

Return:

3012{
3013 m_nReserved = curveSet.m_nReserved;
3014
3015 if (curveSet.m_nInputChannels) {
3016 int i;
3017
3021
3022 icCurveMap map;
3023 for (i=0; i<m_nInputChannels; i++) {
3024 CIccCurveSetCurve *ptr = curveSet.m_curve[i];
3025 if (ptr) {
3026 if (!map[ptr]) {
3027 m_curve[i] = ptr->NewCopy();
3028 map[ptr] = m_curve[i];
3029 }
3030 else
3031 m_curve[i] = map[ptr];
3032 }
3033 }
3034 }
3035 else {
3037 m_curve = NULL;
3038 }
3039}
std::map< icCurveSetCurvePtr, icCurveSetCurvePtr > icCurveMap
Definition IccMpeBasic.cpp:2999
virtual CIccCurveSetCurve * NewCopy() const =0

References m_curve, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, m_position, and CIccCurveSetCurve::NewCopy().

Referenced by NewCopy().

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

◆ ~CIccMpeCurveSet()

CIccMpeCurveSet::~CIccMpeCurveSet ( )
virtual

Name: CIccMpeCurveSet::~CIccMpeCurveSet

Purpose:

Args:

Return:

3098{
3099 SetSize(0);
3100}
bool SetSize(int nNewSize)
Definition IccMpeBasic.cpp:3112

References SetSize().

+ Here is the call graph for this function:

Member Function Documentation

◆ Apply()

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

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

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

+ Here is the call graph for this function:

◆ Begin()

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

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}
virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
Definition IccMpeBasic.cpp:3422

References CIccCurveSetCurve::Begin(), 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 
)
virtual

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(), 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 icChar * CIccMpeCurveSet::GetClassName ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeXmlCurveSet.

438{ return "CIccMpeCurveSet"; }

◆ GetEAcsSig()

virtual icAcsSignature CIccMultiProcessElement::GetEAcsSig ( )
inlinevirtualinherited

Reimplemented in CIccMpeEAcs.

179{ return icSigAcsZero; }

◆ GetExtension()

◆ 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
inlinevirtual

Implements CIccMultiProcessElement.

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

References icSigCurveSetElemType.

Referenced by Validate(), and 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
inlinevirtual

Implements CIccMultiProcessElement.

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

References CIccMpeCurveSet().

+ Here is the call graph for this function:

◆ NumInputChannels()

◆ NumOutputChannels()

◆ operator=()

CIccMpeCurveSet & CIccMpeCurveSet::operator= ( const CIccMpeCurveSet curveSet)

Name: &CIccMpeCurveSet::operator=

Purpose:

Args:

Return:

3052{
3054
3055 if (m_curve) {
3056 free(m_curve);
3057 }
3058
3059 if (curveSet.m_nInputChannels) {
3060 int i;
3061
3065
3066 icCurveMap map;
3067 for (i=0; i<m_nInputChannels; i++) {
3068 CIccCurveSetCurve *ptr = curveSet.m_curve[i];
3069 if (ptr) {
3070 if (!map[ptr]) {
3071 m_curve[i] = ptr->NewCopy();
3072 map[ptr] = m_curve[i];
3073 }
3074 else
3075 m_curve[i] = map[ptr];
3076 }
3077 }
3078 }
3079 else {
3081 m_curve = NULL;
3082 }
3083
3084 return *this;
3085}

References m_curve, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, m_position, and CIccCurveSetCurve::NewCopy().

+ Here is the call graph for this function:

◆ Read()

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

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
unsigned short icUInt16Number
Definition icProfileHeader.h:256
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
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

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

+ Here is the call graph for this function:

◆ SetCurve()

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

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 m_curve, and CIccMultiProcessElement::m_nInputChannels.

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

+ Here is the caller graph for this function:

◆ SetSize()

bool CIccMpeCurveSet::SetSize ( int  nNewSize)

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}

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

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

+ Here is the caller graph for this function:

◆ Validate()

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

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(), GetType(), icGetSigPath(), icMaxStatus(), icMsgValidateCriticalError, icValidateCriticalError, m_curve, CIccMultiProcessElement::m_nInputChannels, CIccCurveSetCurve::Validate(), and CIccMultiProcessElement::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccMpeCurveSet::Write ( CIccIO pIO)
virtual

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(), GetType(), icSeekSet, m_curve, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nReserved, 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(), 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(), Apply(), CIccMpeMatrix::Apply(), CIccMpeAcs::Begin(), Begin(), CIccMpeMatrix::Begin(), CIccMpeCLUT::Begin(), CIccMpeEmissionMatrix::Begin(), CIccMpeInvEmissionMatrix::Begin(), CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), CIccMpeEmissionObserver::Begin(), CIccMpeReflectanceObserver::Begin(), CIccMpeSpectralCLUT::copyData(), CIccMpeSpectralMatrix::copyData(), CIccMpeSpectralObserver::copyData(), Describe(), CIccMpeMatrix::Describe(), CIccMpeCalculator::Describe(), CIccMpeSpectralMatrix::Describe(), CIccMpeSpectralObserver::Describe(), CIccMpeXmlCalculator::Flatten(), CIccMultiProcessElement::NumInputChannels(), CIccMpeEmissionMatrix::numVectors(), CIccMpeBAcs::operator=(), CIccMpeCalculator::operator=(), CIccMpeCLUT::operator=(), 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(), Read(), CIccMpeTintArray::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeCLUT::SetCLUT(), SetCurve(), CIccMpeSpectralCLUT::SetData(), CIccMpeCalculator::SetSize(), CIccMpeMatrix::SetSize(), CIccMpeSpectralMatrix::SetSize(), CIccMpeSpectralObserver::SetSize(), SetSize(), Validate(), CIccMpeTintArray::Validate(), CIccMpeToneMap::Validate(), CIccMpeCAM::Validate(), CIccMpeInvEmissionMatrix::Validate(), CIccMpeAcs::Write(), 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(), 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=(), 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(), 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(), 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=(), operator=(), CIccMpeEAcs::operator=(), CIccMpeMatrix::operator=(), CIccMpeTintArray::operator=(), CIccMpeToneMap::operator=(), CIccTagXmlMultiProcessElement::ParseElement(), CIccMpeXmlCalculator::ParseImport(), CIccMpeAcs::Read(), Read(), CIccMpeTintArray::Read(), CIccMpeToneMap::Read(), CIccMpeMatrix::Read(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeCAM::Read(), CIccMpeCalculator::Read(), CIccMpeSpectralMatrix::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeSpectralObserver::Read(), CIccMpeXmlCurveSet::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(), Write(), CIccMpeTintArray::Write(), CIccMpeToneMap::Write(), CIccMpeMatrix::Write(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeCAM::Write(), CIccMpeCalculator::Write(), CIccMpeSpectralMatrix::Write(), CIccMpeSpectralCLUT::Write(), and CIccMpeSpectralObserver::Write().

◆ m_position

icPositionNumber* CIccMpeCurveSet::m_position
protected

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