• Home
  • Raw
  • Download

Lines Matching refs:clr

103 CAM02COLOR XYZtoCAT02(CAM02COLOR clr)  in XYZtoCAT02()  argument
105 clr.RGB[0] = (clr.XYZ[0] * 0.7328) + (clr.XYZ[1] * 0.4296) + (clr.XYZ[2] * -0.1624); in XYZtoCAT02()
106 clr.RGB[1] = (clr.XYZ[0] * -0.7036) + (clr.XYZ[1] * 1.6975) + (clr.XYZ[2] * 0.0061); in XYZtoCAT02()
107 clr.RGB[2] = (clr.XYZ[0] * 0.0030) + (clr.XYZ[1] * 0.0136) + (clr.XYZ[2] * 0.9834); in XYZtoCAT02()
109 return clr; in XYZtoCAT02()
113 CAM02COLOR ChromaticAdaptation(CAM02COLOR clr, cmsCIECAM02* pMod) in ChromaticAdaptation() argument
118 clr.RGBc[i] = ((pMod -> adoptedWhite.XYZ[1] * in ChromaticAdaptation()
120 (1.0 - pMod->D)) * clr.RGB[i]; in ChromaticAdaptation()
123 return clr; in ChromaticAdaptation()
128 CAM02COLOR CAT02toHPE(CAM02COLOR clr) in CAT02toHPE() argument
142 clr.RGBp[0] = (clr.RGBc[0] * M[0]) + (clr.RGBc[1] * M[1]) + (clr.RGBc[2] * M[2]); in CAT02toHPE()
143 clr.RGBp[1] = (clr.RGBc[0] * M[3]) + (clr.RGBc[1] * M[4]) + (clr.RGBc[2] * M[5]); in CAT02toHPE()
144 clr.RGBp[2] = (clr.RGBc[0] * M[6]) + (clr.RGBc[1] * M[7]) + (clr.RGBc[2] * M[8]); in CAT02toHPE()
146 return clr; in CAT02toHPE()
150 CAM02COLOR NonlinearCompression(CAM02COLOR clr, cmsCIECAM02* pMod) in NonlinearCompression() argument
156 if (clr.RGBp[i] < 0) { in NonlinearCompression()
158 temp = pow((-1.0 * pMod->FL * clr.RGBp[i] / 100.0), 0.42); in NonlinearCompression()
159 clr.RGBpa[i] = (-1.0 * 400.0 * temp) / (temp + 27.13) + 0.1; in NonlinearCompression()
162 temp = pow((pMod->FL * clr.RGBp[i] / 100.0), 0.42); in NonlinearCompression()
163 clr.RGBpa[i] = (400.0 * temp) / (temp + 27.13) + 0.1; in NonlinearCompression()
167 clr.A = (((2.0 * clr.RGBpa[0]) + clr.RGBpa[1] + in NonlinearCompression()
168 (clr.RGBpa[2] / 20.0)) - 0.305) * pMod->Nbb; in NonlinearCompression()
170 return clr; in NonlinearCompression()
174 CAM02COLOR ComputeCorrelates(CAM02COLOR clr, cmsCIECAM02* pMod) in ComputeCorrelates() argument
178 a = clr.RGBpa[0] - (12.0 * clr.RGBpa[1] / 11.0) + (clr.RGBpa[2] / 11.0); in ComputeCorrelates()
179 b = (clr.RGBpa[0] + clr.RGBpa[1] - (2.0 * clr.RGBpa[2])) / 9.0; in ComputeCorrelates()
183 if (b == 0) clr.h = 0; in ComputeCorrelates()
184 else if (b > 0) clr.h = 90; in ComputeCorrelates()
185 else clr.h = 270; in ComputeCorrelates()
189 if (b > 0) clr.h = (r2d * atan(temp)); in ComputeCorrelates()
190 else if (b == 0) clr.h = 0; in ComputeCorrelates()
191 else clr.h = (r2d * atan(temp)) + 360; in ComputeCorrelates()
195 clr.h = (r2d * atan(temp)) + 180; in ComputeCorrelates()
200 (cos((clr.h * d2r + 2.0)) + 3.8); in ComputeCorrelates()
202 if (clr.h < 20.14) { in ComputeCorrelates()
203 temp = ((clr.h + 122.47)/1.2) + ((20.14 - clr.h)/0.8); in ComputeCorrelates()
204 clr.H = 300 + (100*((clr.h + 122.47)/1.2)) / temp; in ComputeCorrelates()
206 else if (clr.h < 90.0) { in ComputeCorrelates()
207 temp = ((clr.h - 20.14)/0.8) + ((90.00 - clr.h)/0.7); in ComputeCorrelates()
208 clr.H = (100*((clr.h - 20.14)/0.8)) / temp; in ComputeCorrelates()
210 else if (clr.h < 164.25) { in ComputeCorrelates()
211 temp = ((clr.h - 90.00)/0.7) + ((164.25 - clr.h)/1.0); in ComputeCorrelates()
212 clr.H = 100 + ((100*((clr.h - 90.00)/0.7)) / temp); in ComputeCorrelates()
214 else if (clr.h < 237.53) { in ComputeCorrelates()
215 temp = ((clr.h - 164.25)/1.0) + ((237.53 - clr.h)/1.2); in ComputeCorrelates()
216 clr.H = 200 + ((100*((clr.h - 164.25)/1.0)) / temp); in ComputeCorrelates()
219 temp = ((clr.h - 237.53)/1.2) + ((360 - clr.h + 20.14)/0.8); in ComputeCorrelates()
220 clr.H = 300 + ((100*((clr.h - 237.53)/1.2)) / temp); in ComputeCorrelates()
223 clr.J = 100.0 * pow((clr.A / pMod->adoptedWhite.A), in ComputeCorrelates()
226 clr.Q = (4.0 / pMod->c) * pow((clr.J / 100.0), 0.5) * in ComputeCorrelates()
230 (clr.RGBpa[0] + clr.RGBpa[1] + in ComputeCorrelates()
231 ((21.0 / 20.0) * clr.RGBpa[2])); in ComputeCorrelates()
233 clr.C = pow(t, 0.9) * pow((clr.J / 100.0), 0.5) * in ComputeCorrelates()
236 clr.M = clr.C * pow(pMod->FL, 0.25); in ComputeCorrelates()
237 clr.s = 100.0 * pow((clr.M / clr.Q), 0.5); in ComputeCorrelates()
239 return clr; in ComputeCorrelates()
244 CAM02COLOR InverseCorrelates(CAM02COLOR clr, cmsCIECAM02* pMod) in InverseCorrelates() argument
250 t = pow( (clr.C / (pow((clr.J / 100.0), 0.5) * in InverseCorrelates()
254 (cos((clr.h * d2r + 2.0)) + 3.8); in InverseCorrelates()
256 clr.A = pMod->adoptedWhite.A * pow( in InverseCorrelates()
257 (clr.J / 100.0), in InverseCorrelates()
261 p2 = (clr.A / pMod->Nbb) + 0.305; in InverseCorrelates()
264 hr = clr.h * d2r; in InverseCorrelates()
268 clr.b = (p2 * (2.0 + p3) * (460.0 / 1403.0)) / in InverseCorrelates()
272 clr.a = clr.b * (cos(hr) / sin(hr)); in InverseCorrelates()
276 clr.a = (p2 * (2.0 + p3) * (460.0 / 1403.0)) / in InverseCorrelates()
280 clr.b = clr.a * (sin(hr) / cos(hr)); in InverseCorrelates()
283 clr.RGBpa[0] = ((460.0 / 1403.0) * p2) + in InverseCorrelates()
284 ((451.0 / 1403.0) * clr.a) + in InverseCorrelates()
285 ((288.0 / 1403.0) * clr.b); in InverseCorrelates()
286 clr.RGBpa[1] = ((460.0 / 1403.0) * p2) - in InverseCorrelates()
287 ((891.0 / 1403.0) * clr.a) - in InverseCorrelates()
288 ((261.0 / 1403.0) * clr.b); in InverseCorrelates()
289 clr.RGBpa[2] = ((460.0 / 1403.0) * p2) - in InverseCorrelates()
290 ((220.0 / 1403.0) * clr.a) - in InverseCorrelates()
291 ((6300.0 / 1403.0) * clr.b); in InverseCorrelates()
293 return clr; in InverseCorrelates()
297 CAM02COLOR InverseNonlinearity(CAM02COLOR clr, cmsCIECAM02* pMod) in InverseNonlinearity() argument
303 if ((clr.RGBpa[i] - 0.1) < 0) c1 = -1; in InverseNonlinearity()
305 clr.RGBp[i] = c1 * (100.0 / pMod->FL) * in InverseNonlinearity()
306 pow(((27.13 * fabs(clr.RGBpa[i] - 0.1)) / in InverseNonlinearity()
307 (400.0 - fabs(clr.RGBpa[i] - 0.1))), in InverseNonlinearity()
311 return clr; in InverseNonlinearity()
315 CAM02COLOR HPEtoCAT02(CAM02COLOR clr) in HPEtoCAT02() argument
329 clr.RGBc[0] = (clr.RGBp[0] * M[0]) + (clr.RGBp[1] * M[1]) + (clr.RGBp[2] * M[2]); in HPEtoCAT02()
330 clr.RGBc[1] = (clr.RGBp[0] * M[3]) + (clr.RGBp[1] * M[4]) + (clr.RGBp[2] * M[5]); in HPEtoCAT02()
331 clr.RGBc[2] = (clr.RGBp[0] * M[6]) + (clr.RGBp[1] * M[7]) + (clr.RGBp[2] * M[8]); in HPEtoCAT02()
332 return clr; in HPEtoCAT02()
337 CAM02COLOR InverseChromaticAdaptation(CAM02COLOR clr, cmsCIECAM02* pMod) in InverseChromaticAdaptation() argument
341 clr.RGB[i] = clr.RGBc[i] / in InverseChromaticAdaptation()
344 return clr; in InverseChromaticAdaptation()
349 CAM02COLOR CAT02toXYZ(CAM02COLOR clr) in CAT02toXYZ() argument
351 clr.XYZ[0] = (clr.RGB[0] * 1.096124) + (clr.RGB[1] * -0.278869) + (clr.RGB[2] * 0.182745); in CAT02toXYZ()
352 clr.XYZ[1] = (clr.RGB[0] * 0.454369) + (clr.RGB[1] * 0.473533) + (clr.RGB[2] * 0.072098); in CAT02toXYZ()
353 clr.XYZ[2] = (clr.RGB[0] * -0.009628) + (clr.RGB[1] * -0.005698) + (clr.RGB[2] * 1.015326); in CAT02toXYZ()
355 return clr; in CAT02toXYZ()
438 CAM02COLOR clr; in cmsCIECAM02Forward() local
445 memset(&clr, 0, sizeof(clr)); in cmsCIECAM02Forward()
447 clr.XYZ[0] = pIn ->X; in cmsCIECAM02Forward()
448 clr.XYZ[1] = pIn ->Y; in cmsCIECAM02Forward()
449 clr.XYZ[2] = pIn ->Z; in cmsCIECAM02Forward()
451 clr = XYZtoCAT02(clr); in cmsCIECAM02Forward()
452 clr = ChromaticAdaptation(clr, lpMod); in cmsCIECAM02Forward()
453 clr = CAT02toHPE(clr); in cmsCIECAM02Forward()
454 clr = NonlinearCompression(clr, lpMod); in cmsCIECAM02Forward()
455 clr = ComputeCorrelates(clr, lpMod); in cmsCIECAM02Forward()
457 pOut ->J = clr.J; in cmsCIECAM02Forward()
458 pOut ->C = clr.C; in cmsCIECAM02Forward()
459 pOut ->h = clr.h; in cmsCIECAM02Forward()
464 CAM02COLOR clr; in cmsCIECAM02Reverse() local
471 memset(&clr, 0, sizeof(clr)); in cmsCIECAM02Reverse()
473 clr.J = pIn -> J; in cmsCIECAM02Reverse()
474 clr.C = pIn -> C; in cmsCIECAM02Reverse()
475 clr.h = pIn -> h; in cmsCIECAM02Reverse()
477 clr = InverseCorrelates(clr, lpMod); in cmsCIECAM02Reverse()
478 clr = InverseNonlinearity(clr, lpMod); in cmsCIECAM02Reverse()
479 clr = HPEtoCAT02(clr); in cmsCIECAM02Reverse()
480 clr = InverseChromaticAdaptation(clr, lpMod); in cmsCIECAM02Reverse()
481 clr = CAT02toXYZ(clr); in cmsCIECAM02Reverse()
483 pOut ->X = clr.XYZ[0]; in cmsCIECAM02Reverse()
484 pOut ->Y = clr.XYZ[1]; in cmsCIECAM02Reverse()
485 pOut ->Z = clr.XYZ[2]; in cmsCIECAM02Reverse()