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

Type: Class. More...

#include <IccPcc.h>

+ Inheritance diagram for IIccProfileConnectionConditions:
+ Collaboration diagram for IIccProfileConnectionConditions:

Public Member Functions

virtual CIccTagMultiProcessElementgetCustomToStandardPcc ()=0
 
icFloatNumbergetEmissiveObserver (const icSpectralRange &range, const icFloatNumber *pWhite, icFloatNumber *obsMatrix=NULL)
 
virtual void getLumIlluminantXYZ (icFloatNumber *pXYZ)=0
 
virtual bool getMediaWhiteXYZ (icFloatNumber *pXYZ)=0
 
virtual void getNormIlluminantXYZ (icFloatNumber *pXYZ)=0
 
icFloatNumber getObserverIlluminantScaleFactor ()
 
icFloatNumber getObserverWhiteScaleFactor (const icFloatNumber *pWhite, const icSpectralRange &whiteRange)
 
icFloatNumber getPccCCT ()
 
icIlluminant getPccIlluminant ()
 
icStandardObserver getPccObserver ()
 
virtual const CIccTagSpectralViewingConditionsgetPccViewingConditions ()=0
 
CIccMatrixMathgetReflectanceObserver (const icSpectralRange &rangeRef)
 
virtual CIccTagMultiProcessElementgetStandardToCustomPcc ()=0
 
bool hasIlluminantSPD ()
 
bool isEquivalentPcc (IIccProfileConnectionConditions &IPCC)
 
bool isStandardPcc ()
 
virtual ~IIccProfileConnectionConditions ()
 

Detailed Description

Type: Class.

Purpose: Interface for accessing Connection Conditions

Definition at line 93 of file IccPcc.h.

Constructor & Destructor Documentation

◆ ~IIccProfileConnectionConditions()

virtual IIccProfileConnectionConditions::~IIccProfileConnectionConditions ( )
inlinevirtual

Definition at line 96 of file IccPcc.h.

96{}

Member Function Documentation

◆ getCustomToStandardPcc()

virtual CIccTagMultiProcessElement * IIccProfileConnectionConditions::getCustomToStandardPcc ( )
pure virtual

Implemented in CIccCombinedConnectionConditions.

Referenced by CIccCombinedConnectionConditions::getCustomToStandardPcc().

+ Here is the caller graph for this function:

◆ getEmissiveObserver()

icFloatNumber * IIccProfileConnectionConditions::getEmissiveObserver ( const icSpectralRange & range,
const icFloatNumber * pWhite,
icFloatNumber * obsMatrix = NULL )

Definition at line 231 of file IccPcc.cpp.

232{
234 if (!pView || !pWhite)
235 return NULL;
236
237 int i, n = range.steps, size = 3*n;
238 const icFloatNumber *fptr;
239 icFloatNumber *tptr;
240
241 icSpectralRange observerRange;
242 const icFloatNumber *observer = pView->getObserver(observerRange);
243
244 if (!obs)
245 obs = (icFloatNumber*)malloc(size*sizeof(icFloatNumber));
246
247 if (obs) {
248 CIccMatrixMath *mapRange=CIccMatrixMath::rangeMap(observerRange, range);
249
250 //Copy observer while adjusting to range
251 if (mapRange) {
252 fptr = &observer[0];
253 tptr = obs;
254 for (i = 0; i < 3; i++) {
255 mapRange->VectorMult(tptr, fptr);
256 fptr += observerRange.steps;
257 tptr += range.steps;
258 }
259 delete mapRange;
260 }
261 else {
262 memcpy(obs, observer, size*sizeof(icFloatNumber));
263 }
264
265 //Calculate scale constant
266 icFloatNumber k=0.0f;
267 fptr = &obs[range.steps]; //Using second color matching function
268 for (i=0; i<(int)range.steps; i++) {
269 k += fptr[i]*pWhite[i];
270 }
271
272 //Scale observer so application of observer against white results in 1.0.
273 for (i=0; i<size; i++) {
274 obs[i] = obs[i] / k;
275 }
276
277 CIccMatrixMath observerMtx(3,range.steps);
278 memcpy(observerMtx.entry(0), obs, size*sizeof(icFloatNumber));
279
280 icFloatNumber xyz[3];
281 observerMtx.VectorMult(xyz, pWhite);
282 }
283
284 return obs;
285}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
Type: Class.
static CIccMatrixMath * rangeMap(const icSpectralRange &from, const icSpectralRange &to)
Name: CIccMatrixMath::rangeMap.
virtual void VectorMult(icFloatNumber *pDst, const icFloatNumber *pSrc) const
Name: CIccMatrixMath::VectorMult.
Class: CIccTagSpectralViewingConditions.
const icFloatNumber * getObserver(icSpectralRange &observerRange) const
virtual const CIccTagSpectralViewingConditions * getPccViewingConditions()=0
spectral range
icUInt16Number steps

References CIccMatrixMath::entry(), CIccTagSpectralViewingConditions::getObserver(), getPccViewingConditions(), CIccMatrixMath::rangeMap(), icSpectralRange::steps, and CIccMatrixMath::VectorMult().

Referenced by CIccMpeEmissionCLUT::Begin(), CIccMpeEmissionMatrix::Begin(), CIccMpeEmissionObserver::Begin(), CIccMpeInvEmissionMatrix::Begin(), CIccMpeReflectanceCLUT::Begin(), and CIccMpeReflectanceObserver::Begin().

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

◆ getLumIlluminantXYZ()

virtual void IIccProfileConnectionConditions::getLumIlluminantXYZ ( icFloatNumber * pXYZ)
pure virtual

◆ getMediaWhiteXYZ()

virtual bool IIccProfileConnectionConditions::getMediaWhiteXYZ ( icFloatNumber * pXYZ)
pure virtual

◆ getNormIlluminantXYZ()

virtual void IIccProfileConnectionConditions::getNormIlluminantXYZ ( icFloatNumber * pXYZ)
pure virtual

Implemented in CIccCombinedConnectionConditions.

Referenced by isEquivalentPcc().

+ Here is the caller graph for this function:

◆ getObserverIlluminantScaleFactor()

icFloatNumber IIccProfileConnectionConditions::getObserverIlluminantScaleFactor ( )

Definition at line 162 of file IccPcc.cpp.

163{
165 if (!pView)
166 return 1.0;
167
168 icSpectralRange illumRange;
169 const icFloatNumber *illum = pView->getIlluminant(illumRange);
170
171 icSpectralRange obsRange;
172 const icFloatNumber *obs = pView->getObserver(obsRange);
173
174 int i, n = illumRange.steps;
175 CIccMatrixMath *mapRange=CIccMatrixMath::rangeMap(obsRange, illumRange);
176 icFloatNumber rv=0;
177
178 if (mapRange) {
179 icFloatNumber *Ycmf = new icFloatNumber[illumRange.steps];
180 mapRange->VectorMult(Ycmf, &obs[obsRange.steps]);
181 delete mapRange;
182
183 for (i=0; i<n; i++) {
184 rv += Ycmf[i]*illum[i];
185 }
186 delete [] Ycmf;
187 }
188 else {
189 const icFloatNumber *Ycmf = &obs[obsRange.steps];
190
191 for (i=0; i<n; i++) {
192 rv += Ycmf[i]*illum[i];
193 }
194 }
195 return rv;
196}
const icFloatNumber * getIlluminant(icSpectralRange &illumRange) const

References CIccTagSpectralViewingConditions::getIlluminant(), CIccTagSpectralViewingConditions::getObserver(), getPccViewingConditions(), CIccMatrixMath::rangeMap(), icSpectralRange::steps, and CIccMatrixMath::VectorMult().

+ Here is the call graph for this function:

◆ getObserverWhiteScaleFactor()

icFloatNumber IIccProfileConnectionConditions::getObserverWhiteScaleFactor ( const icFloatNumber * pWhite,
const icSpectralRange & whiteRange )

Definition at line 198 of file IccPcc.cpp.

199{
201 if (!pView)
202 return 1.0;
203
204 icSpectralRange obsRange;
205 const icFloatNumber *obs = pView->getObserver(obsRange);
206
207 int i, n = whiteRange.steps;
208 CIccMatrixMath *mapRange=CIccMatrixMath::rangeMap(obsRange, whiteRange);
209 icFloatNumber rv=0;
210
211 if (mapRange) {
212 icFloatNumber *Ycmf = new icFloatNumber[whiteRange.steps];
213 mapRange->VectorMult(Ycmf, &obs[obsRange.steps]);
214 delete mapRange;
215
216 for (i=0; i<n; i++) {
217 rv += Ycmf[i]*pWhite[i];
218 }
219 delete [] Ycmf;
220 }
221 else {
222 const icFloatNumber *Ycmf = &obs[obsRange.steps];
223
224 for (i=0; i<n; i++) {
225 rv += Ycmf[i]*pWhite[i];
226 }
227 }
228 return rv;
229}

References CIccTagSpectralViewingConditions::getObserver(), getPccViewingConditions(), CIccMatrixMath::rangeMap(), icSpectralRange::steps, and CIccMatrixMath::VectorMult().

+ Here is the call graph for this function:

◆ getPccCCT()

icFloatNumber IIccProfileConnectionConditions::getPccCCT ( )

Definition at line 121 of file IccPcc.cpp.

122{
124 if (!pCond)
125 return 0.0f;
126
127 return pCond->getIlluminantCCT();
128}
icFloatNumber getIlluminantCCT() const

References CIccTagSpectralViewingConditions::getIlluminantCCT(), and getPccViewingConditions().

Referenced by isEquivalentPcc().

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

◆ getPccIlluminant()

icIlluminant IIccProfileConnectionConditions::getPccIlluminant ( )

Definition at line 112 of file IccPcc.cpp.

113{
115 if (!pCond)
116 return icIlluminantD50;
117
118 return pCond->getStdIllumiant();
119}
icIlluminant getStdIllumiant() const
@ icIlluminantD50

References getPccViewingConditions(), CIccTagSpectralViewingConditions::getStdIllumiant(), and icIlluminantD50.

Referenced by isEquivalentPcc(), and isStandardPcc().

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

◆ getPccObserver()

icStandardObserver IIccProfileConnectionConditions::getPccObserver ( )

Definition at line 130 of file IccPcc.cpp.

131{
133 if (!pCond)
135
136 return pCond->getStdObserver();
137}
icStandardObserver getStdObserver() const
@ icStdObs1931TwoDegrees

References getPccViewingConditions(), CIccTagSpectralViewingConditions::getStdObserver(), and icStdObs1931TwoDegrees.

Referenced by isEquivalentPcc(), and isStandardPcc().

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

◆ getPccViewingConditions()

◆ getReflectanceObserver()

CIccMatrixMath * IIccProfileConnectionConditions::getReflectanceObserver ( const icSpectralRange & rangeRef)

Definition at line 287 of file IccPcc.cpp.

288{
289 CIccMatrixMath *pAdjust=NULL, *pMtx;
291
292 icSpectralRange illumRange;
293 const icFloatNumber *illum = pView->getIlluminant(illumRange);
294
295 pMtx = CIccMatrixMath::rangeMap(rangeRef, illumRange);
296 if (pMtx)
297 pAdjust = pMtx;
298
299 pMtx = pView->getObserverMatrix(illumRange);
300
301 if (pAdjust) {
302 pMtx = pAdjust->Mult(pMtx);
303 delete pAdjust;
304 }
305 pAdjust = pMtx;
306
307 pAdjust->VectorScale(illum);
308 pAdjust->Scale(1.0f / pAdjust->RowSum(1));
309
310 return pAdjust;
311}
icFloatNumber RowSum(icUInt16Number nRow) const
Name: CIccMatrixMath::RowSum.
void VectorScale(const icFloatNumber *vec)
Name: CIccMatrixMath::VectorScale.
CIccMatrixMath * Mult(const CIccMatrixMath *matrix) const
Name: CIccMatrixMath::Mult.
void Scale(icFloatNumber v)
Name: CIccMatrixMath::Scale.
CIccMatrixMath * getObserverMatrix(const icSpectralRange &newRange) const

References CIccTagSpectralViewingConditions::getIlluminant(), CIccTagSpectralViewingConditions::getObserverMatrix(), getPccViewingConditions(), CIccMatrixMath::Mult(), CIccMatrixMath::rangeMap(), CIccMatrixMath::RowSum(), CIccMatrixMath::Scale(), and CIccMatrixMath::VectorScale().

+ Here is the call graph for this function:

◆ getStandardToCustomPcc()

virtual CIccTagMultiProcessElement * IIccProfileConnectionConditions::getStandardToCustomPcc ( )
pure virtual

Implemented in CIccCombinedConnectionConditions.

Referenced by CIccCombinedConnectionConditions::getStandardToCustomPcc().

+ Here is the caller graph for this function:

◆ hasIlluminantSPD()

bool IIccProfileConnectionConditions::hasIlluminantSPD ( )

Definition at line 147 of file IccPcc.cpp.

148{
150 if (!pCond)
151 return false;
152
153 icSpectralRange illumRange;
154 const icFloatNumber *illum = pCond->getIlluminant(illumRange);
155
156 if (!illumRange.steps || !illum)
157 return false;
158
159 return true;
160}

References CIccTagSpectralViewingConditions::getIlluminant(), getPccViewingConditions(), and icSpectralRange::steps.

Referenced by isEquivalentPcc().

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

◆ isEquivalentPcc()

bool IIccProfileConnectionConditions::isEquivalentPcc ( IIccProfileConnectionConditions & IPCC)

Definition at line 79 of file IccPcc.cpp.

80{
83
84 if (illum!=IPCC.getPccIlluminant() || obs!= IPCC.getPccObserver())
85 return false;
86
87 if ((illum==icIlluminantDaylight || illum==icIlluminantBlackBody) && getPccCCT()!=IPCC.getPccCCT())
88 return false;
89
90 if (illum==icIlluminantUnknown)
91 return false;
92
93 if (obs==icStdObsCustom) {
94 if (!hasIlluminantSPD() && !IPCC.hasIlluminantSPD()) {
95 icFloatNumber XYZ1[3], XYZ2[3];
96 getNormIlluminantXYZ(&XYZ1[0]);
97 IPCC.getNormIlluminantXYZ(&XYZ2[0]);
98
99 if (XYZ1[0]!=XYZ2[0] ||
100 XYZ1[1]!=XYZ2[1] ||
101 XYZ1[2]!=XYZ2[2])
102 return false;
103 }
104 else {
105 return false;
106 }
107 }
108
109 return true;
110}
icIlluminant getPccIlluminant()
Definition IccPcc.cpp:112
virtual void getNormIlluminantXYZ(icFloatNumber *pXYZ)=0
icStandardObserver getPccObserver()
Definition IccPcc.cpp:130
icIlluminant
Pre-defined illuminants, used in measurement and viewing conditions type.
@ icIlluminantDaylight
@ icIlluminantBlackBody
@ icIlluminantUnknown
#define icStdObsCustom
icStandardObserver
Standard Observer, used in the measurmentType tag.

References getNormIlluminantXYZ(), getPccCCT(), getPccIlluminant(), getPccObserver(), hasIlluminantSPD(), icIlluminantBlackBody, icIlluminantDaylight, icIlluminantUnknown, and icStdObsCustom.

+ Here is the call graph for this function:

◆ isStandardPcc()

bool IIccProfileConnectionConditions::isStandardPcc ( )

Definition at line 139 of file IccPcc.cpp.

140{
142 return true;
143
144 return false;
145}

References getPccIlluminant(), getPccObserver(), icIlluminantD50, and icStdObs1931TwoDegrees.

+ Here is the call graph for this function:

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