summaryrefslogtreecommitdiff
path: root/xicc/cam02ref.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-02 19:25:17 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-02 19:25:17 +0200
commitc2ca7be5a751879159f3cb591a64bb9568b79762 (patch)
tree04e38d4f4a2aad4d789bda0a65b7abb80a3439a2 /xicc/cam02ref.h
parent45c152c326d87478fbf41714b4b8e2f7b57a282b (diff)
parent3db384424bd7398ffbb7a355cab8f15f3add009f (diff)
Updated version 1.9.1+repack from 'upstream/1.9.1+repack'
with Debian dir 98a996367aa69ae41accf9c6d369f600bc94de80
Diffstat (limited to 'xicc/cam02ref.h')
-rw-r--r--xicc/cam02ref.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/xicc/cam02ref.h b/xicc/cam02ref.h
index 29f7d2a..28c3fd3 100644
--- a/xicc/cam02ref.h
+++ b/xicc/cam02ref.h
@@ -22,6 +22,8 @@
/* with the ICC convention (not 100.0 as assumed by the CIECAM spec.) */
/* Note that all whites are assumed to be normalised (ie. Y = 1.0) */
+#define HHKR_MUL 0.25
+
#undef DIAG /* Print internal value diagnostics for each conversion */
/* ---------------------------------- */
@@ -122,7 +124,8 @@ double Lv /* Luminence of white in the Viewing/Scene/Image field (cd/m^2) */
static void cam02ref_free(cam02ref *s);
static int cam02ref_set_view(cam02ref *s, ViewingCondition Ev, double Wxyz[3],
- double Yb, double La, double Lv, double Yf, double Yg, double Gxyz[3], int hk);
+ double Yb, double La, double Lv, double Yf, double Yg, double Gxyz[3],
+ int hk, double hkscale);
static int cam02ref_XYZ_to_cam(cam02ref *s, double *Jab, double *xyz);
static int cam02ref_cam_to_XYZ(cam02ref *s, double XYZ[3], double Jab[3]);
@@ -160,7 +163,8 @@ double Lv, /* Luminence of white in the Viewing/Scene/Image field (cd/m^2) */
double Yf, /* Flare as a fraction of the reference white (Y range 0.0 .. 1.0) */
double Yg, /* Glare as a fraction of the adapting/surround (Y range 0.0 .. 1.0) */
double Gxyz[3], /* The Glare white coordinates (typically the Ambient color) */
-int hk /* Flag, NZ to use Helmholtz-Kohlraush effect */
+int hk, /* Flag, NZ to use Helmholtz-Kohlraush effect */
+double hkscale /* HK effect scaling factor */
) {
double tt;
@@ -185,6 +189,7 @@ int hk /* Flag, NZ to use Helmholtz-Kohlraush effect */
s->Gxyz[2] = Wxyz[2];
}
s->hk = hk;
+ s->hkscale = hkscale;
/* Compute the internal parameters by category */
switch(s->Ev) {
@@ -442,7 +447,7 @@ double XYZ[3]
/* Helmholtz-Kohlraush effect */
if (s->hk && J < 1.0) {
- double JJ, kk = C/300.0 * sin(DBL_PI * fabs(0.5 * (h - 90.0))/180.0);
+ double JJ, kk = s->hkscale * HHKR_MUL * C/300.0 * sin(DBL_PI * fabs(0.5 * (h - 90.0))/180.0);
if (kk > 0.9) /* Limit kk to a reasonable range */
kk = 0.9;
JJ = J + (1.0 - J) * kk;
@@ -508,7 +513,7 @@ double Jab[3]
/* Helmholtz-Kohlraush effect */
if (s->hk && J < 1.0) {
- double kk = C/300.0 * sin(DBL_PI * fabs(0.5 * (h - 90.0))/180.0);
+ double kk = s->hkscale * HHKR_MUL * C/300.0 * sin(DBL_PI * fabs(0.5 * (h - 90.0))/180.0);
if (kk > 0.9) /* Limit kk to a reasonable range */
kk = 0.9;
J = (J - kk)/(1.0 - kk);