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

#include <IccEval.h>

+ Inheritance diagram for CIccEvalCompare:
+ Collaboration diagram for CIccEvalCompare:

Public Member Functions

virtual void Compare (icFloatNumber *pPixel, icFloatNumber *deviceLab, icFloatNumber *destLab1, icFloatNumber *destLab2)=0
 
icStatusCMM EvaluateProfile (CIccProfile *pProfile, icUInt8Number nGran=0, icRenderingIntent nIntent=((icRenderingIntent) 0x3f3f3f3f), icXformInterp nInterp=icInterpLinear, bool buseMpeTags=true)
 
icStatusCMM EvaluateProfile (const icChar *szProfilePath, icUInt8Number nGran=0, icRenderingIntent nIntent=((icRenderingIntent) 0x3f3f3f3f), icXformInterp nInterp=icInterpLinear, bool buseMpeTags=true)
 

Detailed Description

Definition at line 81 of file IccEval.h.

Member Function Documentation

◆ Compare()

virtual void CIccEvalCompare::Compare ( icFloatNumber * pPixel,
icFloatNumber * deviceLab,
icFloatNumber * destLab1,
icFloatNumber * destLab2 )
pure virtual

Implemented in CIccMinMaxEval, and CIccMinMaxEval.

◆ EvaluateProfile() [1/2]

icStatusCMM CIccEvalCompare::EvaluateProfile ( CIccProfile * pProfile,
icUInt8Number nGran = 0,
icRenderingIntent nIntent = ((icRenderingIntent) 0x3f3f3f3f),
icXformInterp nInterp = icInterpLinear,
bool buseMpeTags = true )

Definition at line 82 of file IccEval.cpp.

85{
86 if (!pProfile)
87 {
89 }
90
91 if (pProfile->m_Header.deviceClass!=icSigInputClass &&
92 pProfile->m_Header.deviceClass!=icSigDisplayClass &&
93 pProfile->m_Header.deviceClass!=icSigOutputClass &&
94 pProfile->m_Header.deviceClass!=icSigColorSpaceClass)
95 {
97 }
98
99 CIccCmm dev2Lab(icSigUnknownData, icSigLabData);
100 CIccCmm Lab2Dev2Lab(icSigLabData, icSigLabData, false);
101
102 icStatusCMM result;
103
104 result = dev2Lab.AddXform(*pProfile, nIntent, nInterp, NULL, icXformLutColorimetric, buseMpeTags);
105
106 if (result!=icCmmStatOk) {
107 return result;
108 }
109
110 result = dev2Lab.Begin();
111 if (result != icCmmStatOk) {
112 return result;
113 }
114
115 result = Lab2Dev2Lab.AddXform(*pProfile, nIntent, nInterp, NULL, icXformLutColorimetric, buseMpeTags);
116 if (result != icCmmStatOk) {
117 return result;
118 }
119
120 result = Lab2Dev2Lab.AddXform(*pProfile, nIntent, nInterp, NULL, icXformLutColorimetric, buseMpeTags);
121 if (result != icCmmStatOk) {
122 return result;
123 }
124
125 result = Lab2Dev2Lab.Begin();
126 if (result != icCmmStatOk) {
127 return result;
128 }
129
130 icFloatNumber sPixel[15];
131 icFloatNumber devPcs[15], roundPcs1[15], roundPcs2[15];
132
133 int ndim = icGetSpaceSamples(pProfile->m_Header.colorSpace);
134 int ndim1 = ndim+1;
135
136 // determine granularity
137 if (!nGran)
138 {
139 CIccTagLutAtoB* pTag = (CIccTagLutAtoB*)pProfile->FindTag(icSigAToB0Tag+(nIntent==icAbsoluteColorimetric ? icRelativeColorimetric : nIntent));
140 if (!pTag || ndim==3)
141 {
142 nGran = 33;
143 }
144 else {
145 CIccCLUT* pClut = pTag->GetCLUT();
146 if (pClut)
147 nGran = pClut->GridPoints()+2;
148 else
149 nGran = 33;
150 }
151 }
152
153 int i, j;
154 icFloatNumber stepsize = (icFloatNumber)(1.0/(icFloatNumber)(nGran-1));
155 icFloatNumber* steps = new icFloatNumber[ndim1];
156 icFloatNumber nstart = 0.0;
157 icFloatNumber nEnd = (icFloatNumber)(1.0+stepsize/2.0);
158 for(j=0; j<ndim1; j++) {
159 steps[j] = nstart;
160 }
161
162 while(steps[0]==nstart) {
163 for(j=0; j<ndim; j++) {
164 sPixel[j] = icMin(steps[j+1],1.0);
165 }
166 steps[ndim] = (steps[ndim]+stepsize);
167 for(i=ndim; i>=0; i--) {
168 if(steps[i]>nEnd) {
169 steps[i] = nstart;
170 steps[i-1] = (steps[i-1]+stepsize);
171 }
172 else break;
173 }
174
175 dev2Lab.Apply(devPcs, sPixel); //Convert device value to pcs from input table
176 Lab2Dev2Lab.Apply(roundPcs1, devPcs); //First round trip gets color into output gamut
177 Lab2Dev2Lab.Apply(roundPcs2, roundPcs1); //Second round trip find reproducibility error
178
179 icLabFromPcs(devPcs);
180 icLabFromPcs(roundPcs1);
181 icLabFromPcs(roundPcs2);
182
183 Compare(sPixel, devPcs, roundPcs1, roundPcs2);
184 }
185
186 return icCmmStatOk;
187}
@ icXformLutColorimetric
Definition IccCmm.h:135
icStatusCMM
CMM return status values.
Definition IccCmm.h:90
@ icCmmStatInvalidProfile
Definition IccCmm.h:95
@ icCmmStatCantOpenProfile
Definition IccCmm.h:93
@ icCmmStatOk
Definition IccCmm.h:92
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
icUInt32Number icGetSpaceSamples(icColorSpaceSignature sig)
Definition IccUtil.cpp:1303
void icLabFromPcs(icFloatNumber *Lab)
Floating point encoding of Lab in PCS is in range 0.0 to 1.0.
Definition IccUtil.cpp:919
icFloatNumber icMin(icFloatNumber v1, icFloatNumber v2)
Definition IccUtil.cpp:898
Class: CIccCLUT.
Definition IccTagLut.h:326
icUInt8Number GridPoints() const
Definition IccTagLut.h:349
virtual void Compare(icFloatNumber *pPixel, icFloatNumber *deviceLab, icFloatNumber *destLab1, icFloatNumber *destLab2)=0
CIccCLUT * GetCLUT() const
Definition IccTagLut.h:469
Class: CIccTagLutAtoB.
Definition IccTagLut.h:502
@ icSigDisplayClass
@ icSigOutputClass
@ icSigInputClass
@ icSigColorSpaceClass
@ icSigLabData
#define icSigUnknownData
@ icSigAToB0Tag
@ icRelativeColorimetric
@ icAbsoluteColorimetric

References CIccMBB::GetCLUT(), CIccCLUT::GridPoints(), icAbsoluteColorimetric, icCmmStatCantOpenProfile, icCmmStatInvalidProfile, icCmmStatOk, icGetSpaceSamples(), icLabFromPcs(), icMin(), icRelativeColorimetric, icSigAToB0Tag, icSigColorSpaceClass, icSigDisplayClass, icSigInputClass, icSigLabData, icSigOutputClass, icSigUnknownData, and icXformLutColorimetric.

Referenced by AnalyzeRoundTrip(), and main().

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

◆ EvaluateProfile() [2/2]

icStatusCMM CIccEvalCompare::EvaluateProfile ( const icChar * szProfilePath,
icUInt8Number nGran = 0,
icRenderingIntent nIntent = ((icRenderingIntent) 0x3f3f3f3f),
icXformInterp nInterp = icInterpLinear,
bool buseMpeTags = true )

Definition at line 189 of file IccEval.cpp.

191{
192 CIccProfile *pProfile = ReadIccProfile(szProfilePath);
193
194 if (!pProfile)
196
197 icStatusCMM result = EvaluateProfile(pProfile, nGrid, nIntent, nInterp, buseMpeTags);
198
199 delete pProfile;
200
201 return result;
202}
CIccProfile * ReadIccProfile(const icChar *szFilename, bool bUseSubProfile)
Name: ReadIccProfile.
icStatusCMM EvaluateProfile(CIccProfile *pProfile, icUInt8Number nGran=0, icRenderingIntent nIntent=((icRenderingIntent) 0x3f3f3f3f), icXformInterp nInterp=icInterpLinear, bool buseMpeTags=true)
Definition IccEval.cpp:82

References icCmmStatCantOpenProfile, and ReadIccProfile().

+ Here is the call graph for this function:

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