diff options
author | Marti Maria <marti.maria@littlecms.com> | 2022-01-29 19:02:09 +0100 |
---|---|---|
committer | Marti Maria <marti.maria@littlecms.com> | 2022-01-29 19:02:09 +0100 |
commit | 7cc53b4e9ab39e37da69955fe059f4b47514b41a (patch) | |
tree | 535cab67a0d02e6a30e69c769da5c52441a4d429 | |
parent | 5ed033f2d0b5c5ef5dcff2c66c65abb7f3039490 (diff) | |
download | lcms2-7cc53b4e9ab39e37da69955fe059f4b47514b41a.tar.gz |
update copyright notices
Update copyrights to generate the release
56 files changed, 401 insertions, 59 deletions
diff --git a/include/lcms2.h b/include/lcms2.h index 89c3120..1fab760 100644 --- a/include/lcms2.h +++ b/include/lcms2.h @@ -23,7 +23,7 @@ // //--------------------------------------------------------------------------------- // -// Version 2.13rc2 +// Version 2.13 // #ifndef _lcms2_H diff --git a/plugins/fast_float/doc/LittleCMS floating point extensions 1.5.pdf b/plugins/fast_float/doc/LittleCMS floating point extensions 1.5.pdf Binary files differindex fa8af5c..45d2bc7 100644 --- a/plugins/fast_float/doc/LittleCMS floating point extensions 1.5.pdf +++ b/plugins/fast_float/doc/LittleCMS floating point extensions 1.5.pdf diff --git a/plugins/fast_float/src/fast_16_tethra.c b/plugins/fast_float/src/fast_16_tethra.c index ffe20c0..8f7f769 100644 --- a/plugins/fast_float/src/fast_16_tethra.c +++ b/plugins/fast_float/src/fast_16_tethra.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_8_curves.c b/plugins/fast_float/src/fast_8_curves.c index ba4d607..aaaa760 100644 --- a/plugins/fast_float/src/fast_8_curves.c +++ b/plugins/fast_float/src/fast_8_curves.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_8_matsh.c b/plugins/fast_float/src/fast_8_matsh.c index 855e6a4..893b761 100644 --- a/plugins/fast_float/src/fast_8_matsh.c +++ b/plugins/fast_float/src/fast_8_matsh.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_8_matsh_sse.c b/plugins/fast_float/src/fast_8_matsh_sse.c index 8c9a58c..efeac2d 100644 --- a/plugins/fast_float/src/fast_8_matsh_sse.c +++ b/plugins/fast_float/src/fast_8_matsh_sse.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_8_tethra.c b/plugins/fast_float/src/fast_8_tethra.c index 0136a02..7f72184 100644 --- a/plugins/fast_float/src/fast_8_tethra.c +++ b/plugins/fast_float/src/fast_8_tethra.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_15bits.c b/plugins/fast_float/src/fast_float_15bits.c index 6141490..33a41b9 100644 --- a/plugins/fast_float/src/fast_float_15bits.c +++ b/plugins/fast_float/src/fast_float_15bits.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_15mats.c b/plugins/fast_float/src/fast_float_15mats.c index c2f4721..aaa3697 100644 --- a/plugins/fast_float/src/fast_float_15mats.c +++ b/plugins/fast_float/src/fast_float_15mats.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_cmyk.c b/plugins/fast_float/src/fast_float_cmyk.c index b576e43..bdb7348 100644 --- a/plugins/fast_float/src/fast_float_cmyk.c +++ b/plugins/fast_float/src/fast_float_cmyk.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_curves.c b/plugins/fast_float/src/fast_float_curves.c index 48dd0b6..2cfca90 100644 --- a/plugins/fast_float/src/fast_float_curves.c +++ b/plugins/fast_float/src/fast_float_curves.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_internal.h b/plugins/fast_float/src/fast_float_internal.h index 34e2eac..58cb66f 100644 --- a/plugins/fast_float/src/fast_float_internal.h +++ b/plugins/fast_float/src/fast_float_internal.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_lab.c b/plugins/fast_float/src/fast_float_lab.c index 376e93d..2ffbad5 100644 --- a/plugins/fast_float/src/fast_float_lab.c +++ b/plugins/fast_float/src/fast_float_lab.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_matsh.c b/plugins/fast_float/src/fast_float_matsh.c index 9424b62..1f87935 100644 --- a/plugins/fast_float/src/fast_float_matsh.c +++ b/plugins/fast_float/src/fast_float_matsh.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_separate.c b/plugins/fast_float/src/fast_float_separate.c index ce53282..ec297bb 100644 --- a/plugins/fast_float/src/fast_float_separate.c +++ b/plugins/fast_float/src/fast_float_separate.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_sup.c b/plugins/fast_float/src/fast_float_sup.c index 9e059c7..fc0f303 100644 --- a/plugins/fast_float/src/fast_float_sup.c +++ b/plugins/fast_float/src/fast_float_sup.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/src/fast_float_tethra.c b/plugins/fast_float/src/fast_float_tethra.c index 8f95a6d..dd37e73 100644 --- a/plugins/fast_float/src/fast_float_tethra.c +++ b/plugins/fast_float/src/fast_float_tethra.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify diff --git a/plugins/fast_float/testbed/fast_float_testbed.c b/plugins/fast_float/testbed/fast_float_testbed.c index cb3d12a..a6de0b2 100644 --- a/plugins/fast_float/testbed/fast_float_testbed.c +++ b/plugins/fast_float/testbed/fast_float_testbed.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System, fast floating point extensions -// Copyright (c) 1998-2020 Marti Maria Saguer, all rights reserved +// Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved // // // This program is free software: you can redistribute it and/or modify @@ -2393,7 +2393,7 @@ void TestGrayTransformPerformance1() int main() { trace("FastFloating point extensions testbed - 1.5\n"); - trace("Copyright (c) 1998-2021 Marti Maria Saguer, all rights reserved\n"); + trace("Copyright (c) 1998-2022 Marti Maria Saguer, all rights reserved\n"); trace("\nInstalling error logger ... "); cmsSetLogErrorHandler(FatalErrorQuit); diff --git a/src/cmsalpha.c b/src/cmsalpha.c index 5e30172..d0cd189 100644 --- a/src/cmsalpha.c +++ b/src/cmsalpha.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmscam02.c b/src/cmscam02.c index 5444b38..f7838ee 100644 --- a/src/cmscam02.c +++ b/src/cmscam02.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmscam16.c b/src/cmscam16.c new file mode 100644 index 0000000..c6dcbaa --- /dev/null +++ b/src/cmscam16.c @@ -0,0 +1,342 @@ +//--------------------------------------------------------------------------------- +// +// Little Color Management System +// Copyright (c) 1998-2022 Marti Maria Saguer +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the Software +// is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//--------------------------------------------------------------------------------- +// + +#include "cmscam16.h" + +// CIECAM 16 and CIECAM 16 UCS appearance models. + +// ---------- Implementation -------------------------------------------- + +// Some needed constants +#ifndef M_PI +# define M_PI 3.14159265358979323846 +#endif + + +typedef struct { + + cmsContext ContextID; + + cmsCIEXYZ XYZ_w; + cmsFloat64Number RGB_w[3]; + cmsFloat64Number D_RGB[3]; + cmsFloat64Number D_RGB_inv[3]; + cmsFloat64Number RGB_cw[3]; + cmsFloat64Number RGB_aw[3]; + + cmsFloat64Number LA, Yb, Yw; + cmsFloat64Number F, c, Nc; + cmsUInt32Number surround; + cmsFloat64Number n, Nbb, Ncb, z, FL, FL4, D, k, A_w; + + +} cmsCIECAM16; + + +/** +* Valid correlates are +*/ + +static +cmsFloat64Number radians(cmsFloat64Number deg) +{ + return (fmod(deg, 360.0) * M_PI) / 180.0; +} + +static +cmsFloat64Number degrees(cmsFloat64Number rad) +{ + cmsFloat64Number deg = fmod(rad * 180.0 / M_PI, 360); + + while (deg < 0) + { + deg += 360.0; + } + + return deg; +} + +static +cmsFloat64Number lerp(cmsFloat64Number l, cmsFloat64Number h, cmsFloat64Number a) +{ + return (cmsFloat64Number) l + (h-l) * a; +} + +static +cmsFloat64Number clip(cmsFloat64Number l, cmsFloat64Number h, cmsFloat64Number a) +{ + if (a < l) return l; + if (a > h) return h; + return a; +} + +static +cmsFloat64Number sgn(cmsFloat64Number s) +{ + if (s < 0.0) return -1.0; + if (s > 0.0) return +1.0; + return 0.0; +} + + +static +void M16(cmsFloat64Number RGB[3], const cmsCIEXYZ* xyz) +{ + RGB[0] = +0.401288 * xyz->X + 0.650173 * xyz->Y - 0.051461 * xyz->Z; + RGB[1] = -0.250268 * xyz->X + 1.204414 * xyz->Y + 0.045854 * xyz->Z; + RGB[2] = -0.002079 * xyz->X + 0.048952 * xyz->Y + 0.953127 * xyz->Z; +} + +static +void M16_inv(cmsCIEXYZ* xyz, const cmsFloat64Number RGB[3]) +{ + xyz->X = +1.862067855087233e+0 * RGB[0] - 1.011254630531685e+0 * RGB[1] + 1.491867754444518e-1 * RGB[2]; + xyz->Y = +3.875265432361372e-1 * RGB[0] + 6.214474419314753e-1 * RGB[1] - 8.973985167612518e-3 * RGB[2]; + xyz->Z = -1.584149884933386e-2 * RGB[0] - 3.412293802851557e-2 * RGB[1] + 1.049964436877850e+0 * RGB[2]; +} + +static +cmsFloat64Number adapt(cmsFloat64Number F_L, cmsFloat64Number component) +{ + cmsFloat64Number x = pow(F_L * fabs(component) * 0.01, 0.42); + + return sgn(component) * 400.0 * x / (x + 27.13); +} + +static +cmsFloat64Number unadapt(cmsFloat64Number F_L, cmsFloat64Number component) +{ + const cmsFloat64Number exponent = 1.0 / 0.42; + cmsFloat64Number constant = 100 / F_L * pow(27.13, exponent); + cmsFloat64Number cabs; + + cabs = fabs(component); + + return sgn(component) * constant * pow(cabs / (400.0 - cabs), exponent); +} + + +static +void elem_mul(cmsFloat64Number res[3], const cmsFloat64Number v0[3], const cmsFloat64Number v1[3]) +{ + res[0] = v0[0] * v1[0]; + res[1] = v0[1] * v1[1]; + res[2] = v0[2] * v1[2]; +} + + +cmsHANDLE CMSEXPORT cmsCIECAM16Init(cmsContext ContextID, const cmsViewingConditions* vc) +{ + cmsCIECAM16* p; + cmsFloat64Number k4; + + p = (cmsCIECAM16*)_cmsMallocZero(ContextID, sizeof(cmsCIECAM16)); + + if (p == NULL) { + return NULL; + } + + p->ContextID = ContextID; + + p->XYZ_w = vc->whitePoint; + + p->LA = vc->La; + p->Yb = vc->Yb; + p->Yw = vc->whitePoint.Y; + + p->surround = vc->surround; + + p->c = (p->surround >= 1) ? lerp(0.59, 0.69, p->surround - 1) : lerp(0.525, 0.59, p->surround); + + p->F = (p->c >= 0.59) ? lerp(0.9, 1.0, (p->c - 0.59) / .1) : lerp(0.8, 0.9, (p->c - 0.525) / 0.065); + + p->Nc = p->F; + p->k = 1.0 / (5.0 * p->LA + 1.0); + + k4 = p->k * p->k * p->k * p->k; + + p->FL = k4 * p->LA + 0.1 * (1 - k4) * (1 - k4) * pow(5.0 * p->LA, 1.0 / 3.0); + + p->FL4 = pow(p->FL, 0.25); + + p->n = p->Yb / p->Yw; + + p->z = 1.48 + sqrt(p->n); // Lightness non-linearity exponent (modified by c) + p->Nbb = 0.725 * pow(p->n, -0.2); // Chromatic induction factors + p->Ncb = p->Nbb; + + // CAM16 has discounting for anything but d==1 + p->D = (vc->D_value < 1.0) ? clip(0, 1, p->F * (1.0 - 1.0 / 3.6 * exp((-p->LA - 42.0) / 92.0))) : 1.0; + + M16(p->RGB_w, &p->XYZ_w); // Cone responses of the white point + + p->D_RGB[0] = lerp(1, p->Yw / p->RGB_w[0], p->D); // p->D * p->Yw / p->RGB_w[0] + 1.0 - p->D; + p->D_RGB[1] = lerp(1, p->Yw / p->RGB_w[1], p->D); // p->D * p->Yw / p->RGB_w[1] + 1.0 - p->D; + p->D_RGB[2] = lerp(1, p->Yw / p->RGB_w[2], p->D); // p->D * p->Yw / p->RGB_w[2] + 1.0 - p->D; + + p->D_RGB_inv[0] = 1.0 / p->D_RGB[0]; + p->D_RGB_inv[1] = 1.0 / p->D_RGB[1]; + p->D_RGB_inv[2] = 1.0 / p->D_RGB[2]; + + p->RGB_cw[0] = p-> RGB_w[0] * p->D_RGB[0]; + p->RGB_cw[1] = p-> RGB_w[1] * p->D_RGB[1]; + p->RGB_cw[2] = p-> RGB_w[2] * p->D_RGB[2]; + + p->RGB_aw[0] = adapt(p->FL, p->RGB_cw[0]); + p->RGB_aw[1] = adapt(p->FL, p->RGB_cw[1]); + p->RGB_aw[2] = adapt(p->FL, p->RGB_cw[2]); + + p->A_w = p->Nbb * (2.0 * p->RGB_aw[0] + p->RGB_aw[1] + 0.05 * p->RGB_aw[2]); + + + return (cmsHANDLE)p; + +} + +void CMSEXPORT cmsCIECAM16Forward(cmsHANDLE hModel, const cmsCIEXYZ* pIn, cmsCIECAM16Color* pOut) +{ + cmsFloat64Number RGB[3], RGB_a[3]; + cmsFloat64Number a, b, h_rad, e_t, A, J_root, t, alpha; + + cmsCIECAM16* p = (cmsCIECAM16*)hModel; + + M16(RGB, pIn); + + RGB_a[0] = adapt(p->FL, RGB[0] * p->D_RGB[0]); + RGB_a[1] = adapt(p->FL, RGB[1] * p->D_RGB[1]); + RGB_a[2] = adapt(p->FL, RGB[2] * p->D_RGB[2]); + + a = RGB_a[0] + (-12 * RGB_a[1] + RGB_a[2]) / 11; // redness-greenness + b = (RGB_a[0] + RGB_a[1] - 2 * RGB_a[2]) / 9; // yellowness-blueness + + h_rad = atan2(b, a); // hue in radians + pOut->h = degrees(h_rad); // hue in degrees + + e_t = 0.25 * (cos(h_rad + 2) + 3.8); + + A = p->Nbb * (2.0 * RGB_a[0] + RGB_a[1] + 0.05 * RGB_a[2]); + + J_root = pow(A / p->A_w, 0.5 * p->c * p->z); + + pOut->J = 100 * J_root * J_root; // lightness + pOut->Q = (4 / p->c * J_root * (p->A_w + 4) * p->FL4); // brightness + + t = (5e4 / 13.0 * p->Nc * p->Ncb * e_t * sqrt(a * a + b * b) / + (RGB_a[0] + RGB_a[1] + 1.05 * RGB_a[2] + 0.305)); + + alpha = pow(t, 0.9) * pow(1.64 - pow(0.29, p->n), 0.73); + + pOut->C = alpha * J_root; // chroma + pOut->M = pOut->C * p->FL4; // colorfulness + pOut->s = 50 * sqrt(p->c * alpha / (p->A_w + 4)); // saturation + +} + + + +void CMSEXPORT cmsCIECAM16Reverse(cmsHANDLE hModel, cmsUInt32Number flags, const cmsCIECAM16Color* pIn, cmsCIEXYZ* pOut) +{ + cmsCIECAM16* p = (cmsCIECAM16*)hModel; + + cmsFloat64Number h_rad, sin_h, cos_h; + cmsFloat64Number J_root, alpha, t, e_t, A, p_1, p_2, r, a, b, denom; + cmsFloat64Number RGB_c[3], RGB_f[3]; + + h_rad = radians(pIn->h); + sin_h = sin(h_rad); + cos_h = cos(h_rad); + + if (flags & cmsCAM16_FROM_Q) + { + if (pIn->Q == 0.0) + { + pOut->X = pOut->Y = pOut->Z = 0.0; + return; + } + + J_root = 0.25 * p->c * pIn->Q / ((p->A_w + 4) * p->FL4); + } + else + { + if (pIn->J == 0.0) + { + pOut->X = pOut->Y = pOut->Z = 0.0; + return; + } + + J_root = sqrt(pIn->J) * 0.1; + } + + + if (flags & cmsCAM16_FROM_s) + { + alpha = 0.0004 * pIn->s * pIn->s * (p->A_w + 4.0) / p->c; + } + else + if (flags & cmsCAM16_FROM_M) + { + alpha = (pIn->M / p->FL4) / J_root; + } + else + { + alpha = pIn->C / J_root; + } + + + t = pow(alpha * pow(1.64 - pow(0.29, p->n), -0.73), 10.0 / 9.0); + + e_t = 0.25 * (cos(h_rad + 2) + 3.8); + + A = p->A_w * pow(J_root, 2.0 / p->c / p->z); + + p_1 = 5e4 / 13.0 * p->Nc * p->Ncb * e_t; + + p_2 = A / p->Nbb; + + r = 23 * (p_2 + 0.305) * t / (23 * p_1 + t * (11 * cos_h + 108 * sin_h)); + a = r * cos_h; + b = r * sin_h; + + denom = 1.0 / 1403.0; + + RGB_c[0] = unadapt(p->FL, (460 * p_2 + 451 * a + 288 * b) * denom); + RGB_c[1] = unadapt(p->FL, (460 * p_2 - 891 * a - 261 * b) * denom); + RGB_c[2] = unadapt(p->FL, (460 * p_2 - 220 * a - 6300 * b) * denom); + + elem_mul(RGB_f, p->D_RGB_inv, RGB_c); + + M16_inv(pOut, RGB_f); + +} + + +void CMSEXPORT cmsCIECAM16Done(cmsHANDLE hModel) +{ + cmsCIECAM16* lpMod = (cmsCIECAM16*)hModel; + + if (lpMod) _cmsFree(lpMod->ContextID, lpMod); +} + diff --git a/src/cmscgats.c b/src/cmscgats.c index 051c3dc..e922305 100644 --- a/src/cmscgats.c +++ b/src/cmscgats.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2021 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmscnvrt.c b/src/cmscnvrt.c index b471da7..fe25525 100644 --- a/src/cmscnvrt.c +++ b/src/cmscnvrt.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmserr.c b/src/cmserr.c index 2483eea..1563b7b 100644 --- a/src/cmserr.c +++ b/src/cmserr.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsgamma.c b/src/cmsgamma.c index 5d4c481..1c4a223 100644 --- a/src/cmsgamma.c +++ b/src/cmsgamma.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmshalf.c b/src/cmshalf.c index 292b6fd..7a96959 100644 --- a/src/cmshalf.c +++ b/src/cmshalf.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsintrp.c b/src/cmsintrp.c index 22de3e5..5cd6d16 100644 --- a/src/cmsintrp.c +++ b/src/cmsintrp.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsio0.c b/src/cmsio0.c index 353ddc9..0143efb 100644 --- a/src/cmsio0.c +++ b/src/cmsio0.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsio1.c b/src/cmsio1.c index 28e8c18..db18b9f 100644 --- a/src/cmsio1.c +++ b/src/cmsio1.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmslut.c b/src/cmslut.c index 9e67b31..649e2ff 100644 --- a/src/cmslut.c +++ b/src/cmslut.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsmd5.c b/src/cmsmd5.c index 88b2d77..f0af214 100644 --- a/src/cmsmd5.c +++ b/src/cmsmd5.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsmtrx.c b/src/cmsmtrx.c index 9e05355..86a66f7 100644 --- a/src/cmsmtrx.c +++ b/src/cmsmtrx.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsnamed.c b/src/cmsnamed.c index 07eb47c..28e67f2 100644 --- a/src/cmsnamed.c +++ b/src/cmsnamed.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsopt.c b/src/cmsopt.c index 56cdf29..78d2a83 100644 --- a/src/cmsopt.c +++ b/src/cmsopt.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmspack.c b/src/cmspack.c index 8f8df9c..955687c 100644 --- a/src/cmspack.c +++ b/src/cmspack.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2021 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmspcs.c b/src/cmspcs.c index 9f03fc5..3d6323a 100644 --- a/src/cmspcs.c +++ b/src/cmspcs.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsplugin.c b/src/cmsplugin.c index 8c9e4c8..dbda3fd 100644 --- a/src/cmsplugin.c +++ b/src/cmsplugin.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsps2.c b/src/cmsps2.c index b4bd0c4..4bb17b0 100644 --- a/src/cmsps2.c +++ b/src/cmsps2.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmssamp.c b/src/cmssamp.c index 6434d53..868664a 100644 --- a/src/cmssamp.c +++ b/src/cmssamp.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmssm.c b/src/cmssm.c index 284c77a..fb6965e 100644 --- a/src/cmssm.c +++ b/src/cmssm.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmstypes.c b/src/cmstypes.c index 1a0d874..c05a3ec 100644 --- a/src/cmstypes.c +++ b/src/cmstypes.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsvirt.c b/src/cmsvirt.c index b2adb97..bffb88e 100644 --- a/src/cmsvirt.c +++ b/src/cmsvirt.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmswtpnt.c b/src/cmswtpnt.c index 8cfacf2..a8e41b2 100644 --- a/src/cmswtpnt.c +++ b/src/cmswtpnt.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/cmsxform.c b/src/cmsxform.c index 3ae15a8..c7183fc 100644 --- a/src/cmsxform.c +++ b/src/cmsxform.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/src/lcms2_internal.h b/src/lcms2_internal.h index 3e25d92..ecb5baf 100644 --- a/src/lcms2_internal.h +++ b/src/lcms2_internal.h @@ -1,7 +1,7 @@ // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/testbed/testcms2.h b/testbed/testcms2.h index 97beb6b..306934e 100755 --- a/testbed/testcms2.h +++ b/testbed/testcms2.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/testbed/testplugin.c b/testbed/testplugin.c index b5c0f09..6c9aee7 100755 --- a/testbed/testplugin.c +++ b/testbed/testplugin.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/testbed/zoo_icc.c b/testbed/zoo_icc.c index 0d99101..d208e9a 100755 --- a/testbed/zoo_icc.c +++ b/testbed/zoo_icc.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/utils/common/utils.h b/utils/common/utils.h index f2d65b7..eed90cb 100644 --- a/utils/common/utils.h +++ b/utils/common/utils.h @@ -2,7 +2,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/utils/common/vprf.c b/utils/common/vprf.c index 9f7d228..9417932 100644 --- a/utils/common/vprf.c +++ b/utils/common/vprf.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/utils/common/xgetopt.c b/utils/common/xgetopt.c index 39764f3..339ba2d 100644 --- a/utils/common/xgetopt.c +++ b/utils/common/xgetopt.c @@ -2,7 +2,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/utils/jpgicc/jpgicc.c b/utils/jpgicc/jpgicc.c index e33ba21..16732c5 100644 --- a/utils/jpgicc/jpgicc.c +++ b/utils/jpgicc/jpgicc.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), @@ -1251,7 +1251,7 @@ int main(int argc, char* argv[]) { fprintf(stderr, "Little CMS ICC profile applier for JPEG - v3.3 [LittleCMS %2.2f]\n\n", LCMS_VERSION / 1000.0); - fprintf(stderr, "Copyright (c) 1998-2020 Marti Maria Saguer. See COPYING file for details.\n"); + fprintf(stderr, "Copyright (c) 1998-2022 Marti Maria Saguer. See COPYING file for details.\n"); fflush(stderr); InitUtils("jpgicc"); diff --git a/utils/linkicc/linkicc.c b/utils/linkicc/linkicc.c index 507d4a9..0301363 100644 --- a/utils/linkicc/linkicc.c +++ b/utils/linkicc/linkicc.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), @@ -271,7 +271,7 @@ int main(int argc, char *argv[]) // Here we are fprintf(stderr, "Little CMS ICC device link generator - v3.0 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0); - fprintf(stderr, "Copyright (c) 1998-2020 Marti Maria Saguer. See COPYING file for details.\n"); + fprintf(stderr, "Copyright (c) 1998-2022 Marti Maria Saguer. See COPYING file for details.\n"); fflush(stderr); // Initialize diff --git a/utils/psicc/psicc.c b/utils/psicc/psicc.c index 682b2e9..be4d1c6 100644 --- a/utils/psicc/psicc.c +++ b/utils/psicc/psicc.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), @@ -213,7 +213,7 @@ int main(int argc, char *argv[]) int nargs; fprintf(stderr, "Little CMS ICC PostScript generator - v2.1 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0); - fprintf(stderr, "Copyright (c) 1998-2020 Marti Maria Saguer. See COPYING file for details.\n"); + fprintf(stderr, "Copyright (c) 1998-2022 Marti Maria Saguer. See COPYING file for details.\n"); fflush(stderr); // Initialize diff --git a/utils/tificc/tifdiff.c b/utils/tificc/tifdiff.c index 0ad6e15..14a91b0 100644 --- a/utils/tificc/tifdiff.c +++ b/utils/tificc/tifdiff.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), diff --git a/utils/transicc/transicc.c b/utils/transicc/transicc.c index ffed247..4dc58c8 100644 --- a/utils/transicc/transicc.c +++ b/utils/transicc/transicc.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2020 Marti Maria Saguer +// Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), @@ -1254,7 +1254,7 @@ int main(int argc, char *argv[]) int nPatch = 0; fprintf(stderr, "LittleCMS ColorSpace conversion calculator - 5.0 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0); - fprintf(stderr, "Copyright (c) 1998-2020 Marti Maria Saguer. See COPYING file for details.\n"); + fprintf(stderr, "Copyright (c) 1998-2022 Marti Maria Saguer. See COPYING file for details.\n"); fflush(stderr); InitUtils("transicc"); |