summaryrefslogtreecommitdiff
path: root/xicc/specplot.c
diff options
context:
space:
mode:
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);