summaryrefslogtreecommitdiff
path: root/xicc/specplot.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-25 10:16:00 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-25 10:16:00 +0100
commitf6b8e0eae4374f339487a33e3e4fe5462d5816e1 (patch)
tree5f5f764fd6cda404b2ad6e85762c03fce3a335db /xicc/specplot.c
parent615ab5513e79c4abc5bbe5c993587785b6a1738b (diff)
New upstream version 2.0.0upstream/2.0.0
Diffstat (limited to 'xicc/specplot.c')
-rwxr-xr-x[-rw-r--r--]xicc/specplot.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xicc/specplot.c b/xicc/specplot.c
index 9e43856..de819ed 100644..100755
--- a/xicc/specplot.c
+++ b/xicc/specplot.c
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <math.h>
+#include "cgats.h"
#include "xspect.h"
#include "numlib.h"
#include "plot.h"
@@ -112,10 +113,17 @@ static int do_spec(
|| mt == inst_mrt_emission_flash
|| mt == inst_mrt_ambient_flash) {
- /* Compute XYZ of illuminant */
- if (icx_ill_sp2XYZ(xyz, icxOT_CIE_1931_2, NULL, icxIT_custom, 0, &tsp) != 0)
+ /* Compute absolute XYZ of illuminant */
+ if (icx_ill_sp2XYZ(xyz, icxOT_CIE_1931_2, NULL, icxIT_custom, 0, &tsp, 1) != 0)
warning("icx_ill_sp2XYZ returned error");
+ printf("Abs. Y = %f\n", xyz[1]);
+
+ /* Normalise to Y = 1 */
+ xyz[0] /= xyz[1];
+ xyz[2] /= xyz[1];
+ xyz[1] /= xyz[1];
+
icmXYZ2Yxy(Yxy, xyz);
icmXYZ2Lab(&icmD50, Lab, xyz);