0N/A/*
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A// This file is available under and governed by the GNU General Public
0N/A// License version 2 only, as published by the Free Software Foundation.
0N/A// However, the following notice accompanied the original version of this
0N/A// file:
0N/A//
2693N/A//---------------------------------------------------------------------------------
0N/A//
2693N/A// Little Color Management System
6271N/A// Copyright (c) 1998-2012 Marti Maria Saguer
0N/A//
0N/A// Permission is hereby granted, free of charge, to any person obtaining
0N/A// a copy of this software and associated documentation files (the "Software"),
0N/A// to deal in the Software without restriction, including without limitation
0N/A// the rights to use, copy, modify, merge, publish, distribute, sublicense,
0N/A// and/or sell copies of the Software, and to permit persons to whom the Software
0N/A// is furnished to do so, subject to the following conditions:
0N/A//
0N/A// The above copyright notice and this permission notice shall be included in
0N/A// all copies or substantial portions of the Software.
0N/A//
0N/A// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0N/A// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
0N/A// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0N/A// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
0N/A// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
0N/A// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
0N/A// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2693N/A//
2693N/A//---------------------------------------------------------------------------------
2693N/A//
0N/A
2693N/A#include "lcms2_internal.h"
0N/A
1002N/A// CIECAM 02 appearance model. Many thanks to Jordi Vilar for the debugging.
0N/A
0N/A// ---------- Implementation --------------------------------------------
0N/A
0N/Atypedef struct {
0N/A
2693N/A cmsFloat64Number XYZ[3];
2693N/A cmsFloat64Number RGB[3];
2693N/A cmsFloat64Number RGBc[3];
2693N/A cmsFloat64Number RGBp[3];
2693N/A cmsFloat64Number RGBpa[3];
2693N/A cmsFloat64Number a, b, h, e, H, A, J, Q, s, t, C, M;
2693N/A cmsFloat64Number abC[2];
2693N/A cmsFloat64Number abs[2];
2693N/A cmsFloat64Number abM[2];
0N/A
2693N/A} CAM02COLOR;
0N/A
0N/Atypedef struct {
0N/A
0N/A CAM02COLOR adoptedWhite;
2693N/A cmsFloat64Number LA, Yb;
2693N/A cmsFloat64Number F, c, Nc;
2693N/A cmsUInt32Number surround;
2693N/A cmsFloat64Number n, Nbb, Ncb, z, FL, D;
0N/A
2693N/A cmsContext ContextID;
2693N/A
2693N/A} cmsCIECAM02;
0N/A
0N/A
0N/Astatic
2693N/AcmsFloat64Number compute_n(cmsCIECAM02* pMod)
0N/A{
2693N/A return (pMod -> Yb / pMod -> adoptedWhite.XYZ[1]);
0N/A}
0N/A
0N/Astatic
2693N/AcmsFloat64Number compute_z(cmsCIECAM02* pMod)
0N/A{
2693N/A return (1.48 + pow(pMod -> n, 0.5));
0N/A}
0N/A
0N/Astatic
2693N/AcmsFloat64Number computeNbb(cmsCIECAM02* pMod)
0N/A{
2693N/A return (0.725 * pow((1.0 / pMod -> n), 0.2));
0N/A}
0N/A
0N/Astatic
2693N/AcmsFloat64Number computeFL(cmsCIECAM02* pMod)
0N/A{
2693N/A cmsFloat64Number k, FL;
0N/A
0N/A k = 1.0 / ((5.0 * pMod->LA) + 1.0);
0N/A FL = 0.2 * pow(k, 4.0) * (5.0 * pMod->LA) + 0.1 *
0N/A (pow((1.0 - pow(k, 4.0)), 2.0)) *
0N/A (pow((5.0 * pMod->LA), (1.0 / 3.0)));
0N/A
0N/A return FL;
0N/A}
0N/A
0N/Astatic
2693N/AcmsFloat64Number computeD(cmsCIECAM02* pMod)
0N/A{
2693N/A cmsFloat64Number D;
0N/A
0N/A D = pMod->F - (1.0/3.6)*(exp(((-pMod ->LA-42) / 92.0)));
0N/A
0N/A return D;
0N/A}
0N/A
0N/A
0N/Astatic
0N/ACAM02COLOR XYZtoCAT02(CAM02COLOR clr)
0N/A{
0N/A clr.RGB[0] = (clr.XYZ[0] * 0.7328) + (clr.XYZ[1] * 0.4296) + (clr.XYZ[2] * -0.1624);
0N/A clr.RGB[1] = (clr.XYZ[0] * -0.7036) + (clr.XYZ[1] * 1.6975) + (clr.XYZ[2] * 0.0061);
0N/A clr.RGB[2] = (clr.XYZ[0] * 0.0030) + (clr.XYZ[1] * 0.0136) + (clr.XYZ[2] * 0.9834);
0N/A
0N/A return clr;
0N/A}
0N/A
0N/Astatic
2693N/ACAM02COLOR ChromaticAdaptation(CAM02COLOR clr, cmsCIECAM02* pMod)
0N/A{
2693N/A cmsUInt32Number i;
2693N/A
0N/A for (i = 0; i < 3; i++) {
0N/A clr.RGBc[i] = ((pMod -> adoptedWhite.XYZ[1] *
0N/A (pMod->D / pMod -> adoptedWhite.RGB[i])) +
0N/A (1.0 - pMod->D)) * clr.RGB[i];
0N/A }
0N/A
0N/A return clr;
0N/A}
0N/A
0N/A
0N/Astatic
2693N/ACAM02COLOR CAT02toHPE(CAM02COLOR clr)
0N/A{
2693N/A cmsFloat64Number M[9];
0N/A
0N/A M[0] =(( 0.38971 * 1.096124) + (0.68898 * 0.454369) + (-0.07868 * -0.009628));
0N/A M[1] =(( 0.38971 * -0.278869) + (0.68898 * 0.473533) + (-0.07868 * -0.005698));
0N/A M[2] =(( 0.38971 * 0.182745) + (0.68898 * 0.072098) + (-0.07868 * 1.015326));
0N/A M[3] =((-0.22981 * 1.096124) + (1.18340 * 0.454369) + ( 0.04641 * -0.009628));
0N/A M[4] =((-0.22981 * -0.278869) + (1.18340 * 0.473533) + ( 0.04641 * -0.005698));
0N/A M[5] =((-0.22981 * 0.182745) + (1.18340 * 0.072098) + ( 0.04641 * 1.015326));
0N/A M[6] =(-0.009628);
0N/A M[7] =(-0.005698);
0N/A M[8] =( 1.015326);
0N/A
0N/A clr.RGBp[0] = (clr.RGBc[0] * M[0]) + (clr.RGBc[1] * M[1]) + (clr.RGBc[2] * M[2]);
0N/A clr.RGBp[1] = (clr.RGBc[0] * M[3]) + (clr.RGBc[1] * M[4]) + (clr.RGBc[2] * M[5]);
0N/A clr.RGBp[2] = (clr.RGBc[0] * M[6]) + (clr.RGBc[1] * M[7]) + (clr.RGBc[2] * M[8]);
0N/A
0N/A return clr;
0N/A}
0N/A
0N/Astatic
2693N/ACAM02COLOR NonlinearCompression(CAM02COLOR clr, cmsCIECAM02* pMod)
0N/A{
2693N/A cmsUInt32Number i;
2693N/A cmsFloat64Number temp;
0N/A
0N/A for (i = 0; i < 3; i++) {
0N/A if (clr.RGBp[i] < 0) {
0N/A
0N/A temp = pow((-1.0 * pMod->FL * clr.RGBp[i] / 100.0), 0.42);
0N/A clr.RGBpa[i] = (-1.0 * 400.0 * temp) / (temp + 27.13) + 0.1;
0N/A }
0N/A else {
0N/A temp = pow((pMod->FL * clr.RGBp[i] / 100.0), 0.42);
0N/A clr.RGBpa[i] = (400.0 * temp) / (temp + 27.13) + 0.1;
0N/A }
0N/A }
1002N/A
1002N/A clr.A = (((2.0 * clr.RGBpa[0]) + clr.RGBpa[1] +
1002N/A (clr.RGBpa[2] / 20.0)) - 0.305) * pMod->Nbb;
1002N/A
0N/A return clr;
0N/A}
0N/A
0N/Astatic
2693N/ACAM02COLOR ComputeCorrelates(CAM02COLOR clr, cmsCIECAM02* pMod)
0N/A{
2693N/A cmsFloat64Number a, b, temp, e, t, r2d, d2r;
0N/A
0N/A a = clr.RGBpa[0] - (12.0 * clr.RGBpa[1] / 11.0) + (clr.RGBpa[2] / 11.0);
0N/A b = (clr.RGBpa[0] + clr.RGBpa[1] - (2.0 * clr.RGBpa[2])) / 9.0;
0N/A
0N/A r2d = (180.0 / 3.141592654);
0N/A if (a == 0) {
0N/A if (b == 0) clr.h = 0;
0N/A else if (b > 0) clr.h = 90;
0N/A else clr.h = 270;
0N/A }
0N/A else if (a > 0) {
0N/A temp = b / a;
0N/A if (b > 0) clr.h = (r2d * atan(temp));
0N/A else if (b == 0) clr.h = 0;
0N/A else clr.h = (r2d * atan(temp)) + 360;
0N/A }
0N/A else {
0N/A temp = b / a;
0N/A clr.h = (r2d * atan(temp)) + 180;
0N/A }
0N/A
0N/A d2r = (3.141592654 / 180.0);
0N/A e = ((12500.0 / 13.0) * pMod->Nc * pMod->Ncb) *
0N/A (cos((clr.h * d2r + 2.0)) + 3.8);
0N/A
0N/A if (clr.h < 20.14) {
0N/A temp = ((clr.h + 122.47)/1.2) + ((20.14 - clr.h)/0.8);
0N/A clr.H = 300 + (100*((clr.h + 122.47)/1.2)) / temp;
0N/A }
0N/A else if (clr.h < 90.0) {
0N/A temp = ((clr.h - 20.14)/0.8) + ((90.00 - clr.h)/0.7);
0N/A clr.H = (100*((clr.h - 20.14)/0.8)) / temp;
0N/A }
0N/A else if (clr.h < 164.25) {
0N/A temp = ((clr.h - 90.00)/0.7) + ((164.25 - clr.h)/1.0);
0N/A clr.H = 100 + ((100*((clr.h - 90.00)/0.7)) / temp);
0N/A }
0N/A else if (clr.h < 237.53) {
0N/A temp = ((clr.h - 164.25)/1.0) + ((237.53 - clr.h)/1.2);
0N/A clr.H = 200 + ((100*((clr.h - 164.25)/1.0)) / temp);
0N/A }
0N/A else {
0N/A temp = ((clr.h - 237.53)/1.2) + ((360 - clr.h + 20.14)/0.8);
0N/A clr.H = 300 + ((100*((clr.h - 237.53)/1.2)) / temp);
0N/A }
0N/A
0N/A clr.J = 100.0 * pow((clr.A / pMod->adoptedWhite.A),
0N/A (pMod->c * pMod->z));
0N/A
0N/A clr.Q = (4.0 / pMod->c) * pow((clr.J / 100.0), 0.5) *
0N/A (pMod->adoptedWhite.A + 4.0) * pow(pMod->FL, 0.25);
0N/A
0N/A t = (e * pow(((a * a) + (b * b)), 0.5)) /
0N/A (clr.RGBpa[0] + clr.RGBpa[1] +
0N/A ((21.0 / 20.0) * clr.RGBpa[2]));
0N/A
0N/A clr.C = pow(t, 0.9) * pow((clr.J / 100.0), 0.5) *
0N/A pow((1.64 - pow(0.29, pMod->n)), 0.73);
0N/A
0N/A clr.M = clr.C * pow(pMod->FL, 0.25);
0N/A clr.s = 100.0 * pow((clr.M / clr.Q), 0.5);
0N/A
0N/A return clr;
0N/A}
0N/A
0N/A
0N/Astatic
2693N/ACAM02COLOR InverseCorrelates(CAM02COLOR clr, cmsCIECAM02* pMod)
0N/A{
0N/A
2693N/A cmsFloat64Number t, e, p1, p2, p3, p4, p5, hr, d2r;
0N/A d2r = 3.141592654 / 180.0;
0N/A
0N/A t = pow( (clr.C / (pow((clr.J / 100.0), 0.5) *
0N/A (pow((1.64 - pow(0.29, pMod->n)), 0.73)))),
0N/A (1.0 / 0.9) );
0N/A e = ((12500.0 / 13.0) * pMod->Nc * pMod->Ncb) *
0N/A (cos((clr.h * d2r + 2.0)) + 3.8);
0N/A
0N/A clr.A = pMod->adoptedWhite.A * pow(
0N/A (clr.J / 100.0),
0N/A (1.0 / (pMod->c * pMod->z)));
0N/A
0N/A p1 = e / t;
0N/A p2 = (clr.A / pMod->Nbb) + 0.305;
0N/A p3 = 21.0 / 20.0;
0N/A
0N/A hr = clr.h * d2r;
0N/A
0N/A if (fabs(sin(hr)) >= fabs(cos(hr))) {
0N/A p4 = p1 / sin(hr);
0N/A clr.b = (p2 * (2.0 + p3) * (460.0 / 1403.0)) /
0N/A (p4 + (2.0 + p3) * (220.0 / 1403.0) *
0N/A (cos(hr) / sin(hr)) - (27.0 / 1403.0) +
0N/A p3 * (6300.0 / 1403.0));
0N/A clr.a = clr.b * (cos(hr) / sin(hr));
0N/A }
0N/A else {
0N/A p5 = p1 / cos(hr);
0N/A clr.a = (p2 * (2.0 + p3) * (460.0 / 1403.0)) /
0N/A (p5 + (2.0 + p3) * (220.0 / 1403.0) -
0N/A ((27.0 / 1403.0) - p3 * (6300.0 / 1403.0)) *
0N/A (sin(hr) / cos(hr)));
0N/A clr.b = clr.a * (sin(hr) / cos(hr));
0N/A }
0N/A
0N/A clr.RGBpa[0] = ((460.0 / 1403.0) * p2) +
0N/A ((451.0 / 1403.0) * clr.a) +
0N/A ((288.0 / 1403.0) * clr.b);
0N/A clr.RGBpa[1] = ((460.0 / 1403.0) * p2) -
0N/A ((891.0 / 1403.0) * clr.a) -
0N/A ((261.0 / 1403.0) * clr.b);
0N/A clr.RGBpa[2] = ((460.0 / 1403.0) * p2) -
0N/A ((220.0 / 1403.0) * clr.a) -
0N/A ((6300.0 / 1403.0) * clr.b);
0N/A
0N/A return clr;
0N/A}
0N/A
0N/Astatic
2693N/ACAM02COLOR InverseNonlinearity(CAM02COLOR clr, cmsCIECAM02* pMod)
0N/A{
2693N/A cmsUInt32Number i;
2693N/A cmsFloat64Number c1;
0N/A
0N/A for (i = 0; i < 3; i++) {
0N/A if ((clr.RGBpa[i] - 0.1) < 0) c1 = -1;
0N/A else c1 = 1;
0N/A clr.RGBp[i] = c1 * (100.0 / pMod->FL) *
0N/A pow(((27.13 * fabs(clr.RGBpa[i] - 0.1)) /
0N/A (400.0 - fabs(clr.RGBpa[i] - 0.1))),
0N/A (1.0 / 0.42));
0N/A }
0N/A
0N/A return clr;
0N/A}
0N/A
0N/Astatic
0N/ACAM02COLOR HPEtoCAT02(CAM02COLOR clr)
0N/A{
2693N/A cmsFloat64Number M[9];
0N/A
0N/A M[0] = (( 0.7328 * 1.910197) + (0.4296 * 0.370950));
0N/A M[1] = (( 0.7328 * -1.112124) + (0.4296 * 0.629054));
0N/A M[2] = (( 0.7328 * 0.201908) + (0.4296 * 0.000008) - 0.1624);
0N/A M[3] = ((-0.7036 * 1.910197) + (1.6975 * 0.370950));
0N/A M[4] = ((-0.7036 * -1.112124) + (1.6975 * 0.629054));
0N/A M[5] = ((-0.7036 * 0.201908) + (1.6975 * 0.000008) + 0.0061);
0N/A M[6] = (( 0.0030 * 1.910197) + (0.0136 * 0.370950));
0N/A M[7] = (( 0.0030 * -1.112124) + (0.0136 * 0.629054));
0N/A M[8] = (( 0.0030 * 0.201908) + (0.0136 * 0.000008) + 0.9834);;
0N/A
0N/A clr.RGBc[0] = (clr.RGBp[0] * M[0]) + (clr.RGBp[1] * M[1]) + (clr.RGBp[2] * M[2]);
0N/A clr.RGBc[1] = (clr.RGBp[0] * M[3]) + (clr.RGBp[1] * M[4]) + (clr.RGBp[2] * M[5]);
0N/A clr.RGBc[2] = (clr.RGBp[0] * M[6]) + (clr.RGBp[1] * M[7]) + (clr.RGBp[2] * M[8]);
2693N/A return clr;
0N/A}
0N/A
0N/A
0N/Astatic
2693N/ACAM02COLOR InverseChromaticAdaptation(CAM02COLOR clr, cmsCIECAM02* pMod)
0N/A{
2693N/A cmsUInt32Number i;
0N/A for (i = 0; i < 3; i++) {
0N/A clr.RGB[i] = clr.RGBc[i] /
0N/A ((pMod->adoptedWhite.XYZ[1] * pMod->D / pMod->adoptedWhite.RGB[i]) + 1.0 - pMod->D);
0N/A }
2693N/A return clr;
0N/A}
0N/A
0N/A
0N/Astatic
0N/ACAM02COLOR CAT02toXYZ(CAM02COLOR clr)
0N/A{
0N/A clr.XYZ[0] = (clr.RGB[0] * 1.096124) + (clr.RGB[1] * -0.278869) + (clr.RGB[2] * 0.182745);
0N/A clr.XYZ[1] = (clr.RGB[0] * 0.454369) + (clr.RGB[1] * 0.473533) + (clr.RGB[2] * 0.072098);
0N/A clr.XYZ[2] = (clr.RGB[0] * -0.009628) + (clr.RGB[1] * -0.005698) + (clr.RGB[2] * 1.015326);
0N/A
2693N/A return clr;
0N/A}
0N/A
0N/A
2693N/AcmsHANDLE CMSEXPORT cmsCIECAM02Init(cmsContext ContextID, const cmsViewingConditions* pVC)
0N/A{
2693N/A cmsCIECAM02* lpMod;
0N/A
2693N/A _cmsAssert(pVC != NULL);
2693N/A
2693N/A if((lpMod = (cmsCIECAM02*) _cmsMallocZero(ContextID, sizeof(cmsCIECAM02))) == NULL) {
2693N/A return NULL;
0N/A }
0N/A
2693N/A lpMod ->ContextID = ContextID;
0N/A
0N/A lpMod ->adoptedWhite.XYZ[0] = pVC ->whitePoint.X;
0N/A lpMod ->adoptedWhite.XYZ[1] = pVC ->whitePoint.Y;
0N/A lpMod ->adoptedWhite.XYZ[2] = pVC ->whitePoint.Z;
0N/A
0N/A lpMod -> LA = pVC ->La;
0N/A lpMod -> Yb = pVC ->Yb;
0N/A lpMod -> D = pVC ->D_value;
0N/A lpMod -> surround = pVC ->surround;
0N/A
0N/A switch (lpMod -> surround) {
0N/A
0N/A
6271N/A case CUTSHEET_SURROUND:
6271N/A lpMod->F = 0.8;
6271N/A lpMod->c = 0.41;
6271N/A lpMod->Nc = 0.8;
6271N/A break;
0N/A
6271N/A case DARK_SURROUND:
6271N/A lpMod -> F = 0.8;
6271N/A lpMod -> c = 0.525;
6271N/A lpMod -> Nc = 0.8;
6271N/A break;
0N/A
6271N/A case DIM_SURROUND:
6271N/A lpMod -> F = 0.9;
6271N/A lpMod -> c = 0.59;
6271N/A lpMod -> Nc = 0.95;
6271N/A break;
0N/A
6271N/A default:
6271N/A // Average surround
6271N/A lpMod -> F = 1.0;
6271N/A lpMod -> c = 0.69;
6271N/A lpMod -> Nc = 1.0;
0N/A }
0N/A
0N/A lpMod -> n = compute_n(lpMod);
0N/A lpMod -> z = compute_z(lpMod);
0N/A lpMod -> Nbb = computeNbb(lpMod);
0N/A lpMod -> FL = computeFL(lpMod);
1002N/A
2693N/A if (lpMod -> D == D_CALCULATE) {
2693N/A lpMod -> D = computeD(lpMod);
1002N/A }
1002N/A
0N/A lpMod -> Ncb = lpMod -> Nbb;
0N/A
0N/A lpMod -> adoptedWhite = XYZtoCAT02(lpMod -> adoptedWhite);
0N/A lpMod -> adoptedWhite = ChromaticAdaptation(lpMod -> adoptedWhite, lpMod);
0N/A lpMod -> adoptedWhite = CAT02toHPE(lpMod -> adoptedWhite);
0N/A lpMod -> adoptedWhite = NonlinearCompression(lpMod -> adoptedWhite, lpMod);
0N/A
2693N/A return (cmsHANDLE) lpMod;
0N/A
0N/A}
0N/A
2693N/Avoid CMSEXPORT cmsCIECAM02Done(cmsHANDLE hModel)
0N/A{
2693N/A cmsCIECAM02* lpMod = (cmsCIECAM02*) hModel;
2693N/A
2693N/A if (lpMod) _cmsFree(lpMod ->ContextID, lpMod);
0N/A}
0N/A
0N/A
2693N/Avoid CMSEXPORT cmsCIECAM02Forward(cmsHANDLE hModel, const cmsCIEXYZ* pIn, cmsJCh* pOut)
0N/A{
0N/A CAM02COLOR clr;
2693N/A cmsCIECAM02* lpMod = (cmsCIECAM02*) hModel;
2693N/A
2693N/A _cmsAssert(lpMod != NULL);
2693N/A _cmsAssert(pIn != NULL);
2693N/A _cmsAssert(pOut != NULL);
0N/A
0N/A clr.XYZ[0] = pIn ->X;
0N/A clr.XYZ[1] = pIn ->Y;
0N/A clr.XYZ[2] = pIn ->Z;
0N/A
0N/A clr = XYZtoCAT02(clr);
0N/A clr = ChromaticAdaptation(clr, lpMod);
0N/A clr = CAT02toHPE(clr);
0N/A clr = NonlinearCompression(clr, lpMod);
0N/A clr = ComputeCorrelates(clr, lpMod);
0N/A
0N/A pOut ->J = clr.J;
0N/A pOut ->C = clr.C;
0N/A pOut ->h = clr.h;
0N/A}
0N/A
2693N/Avoid CMSEXPORT cmsCIECAM02Reverse(cmsHANDLE hModel, const cmsJCh* pIn, cmsCIEXYZ* pOut)
0N/A{
0N/A CAM02COLOR clr;
2693N/A cmsCIECAM02* lpMod = (cmsCIECAM02*) hModel;
0N/A
2693N/A _cmsAssert(lpMod != NULL);
2693N/A _cmsAssert(pIn != NULL);
2693N/A _cmsAssert(pOut != NULL);
0N/A
0N/A clr.J = pIn -> J;
0N/A clr.C = pIn -> C;
0N/A clr.h = pIn -> h;
0N/A
0N/A clr = InverseCorrelates(clr, lpMod);
0N/A clr = InverseNonlinearity(clr, lpMod);
0N/A clr = HPEtoCAT02(clr);
0N/A clr = InverseChromaticAdaptation(clr, lpMod);
0N/A clr = CAT02toXYZ(clr);
0N/A
0N/A pOut ->X = clr.XYZ[0];
0N/A pOut ->Y = clr.XYZ[1];
0N/A pOut ->Z = clr.XYZ[2];
0N/A}
1002N/A