From 6a95d947df50bf24331d6ddb0222f069a3d07cfd Mon Sep 17 00:00:00 2001 From: Amir Zaidi Date: Tue, 26 Mar 2019 17:56:57 +0100 Subject: [PATCH] Cleanup RawConverter exception and white point conversion --- .../main/java/amirz/dngprocessor/gl/RawConverter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/amirz/dngprocessor/gl/RawConverter.java b/app/src/main/java/amirz/dngprocessor/gl/RawConverter.java index be61e51..910f251 100644 --- a/app/src/main/java/amirz/dngprocessor/gl/RawConverter.java +++ b/app/src/main/java/amirz/dngprocessor/gl/RawConverter.java @@ -153,7 +153,7 @@ public RawConverter(SensorParams sensor, ProcessParams process, } if ((sensor.inputStride % 2) != 0) { throw new IllegalArgumentException("Invalid stride for RAW16 format (" - + sensor.inputStride + "), see graphics.h."); + + sensor.inputStride + ")"); } outWidth = argbOutput.getWidth(); @@ -237,7 +237,7 @@ public RawConverter(SensorParams sensor, ProcessParams process, XYZ[2] /= XYZ[1]; XYZ[1] = 1f; - float[] CA = mapWhiteMatrix(XYZ, D50_XYZ); + float[] CA = mapWhiteMatrix(XYZ); multiply(CA, sensorToXYZ, sensorToXYZ_D50); } @@ -266,7 +266,7 @@ public RawConverter(SensorParams sensor, ProcessParams process, square.setTransforms1(sensorToXYZ_D50); } - private float[] mapWhiteMatrix(float[] white_d50, float[] white_xyz) { + private float[] mapWhiteMatrix(float[] sensorWhiteXYZ) { float[] Mb = { 0.8951f, 0.2664f, -0.1614f, -0.7502f, 1.7135f, 0.0367f, @@ -274,10 +274,10 @@ private float[] mapWhiteMatrix(float[] white_d50, float[] white_xyz) { }; float[] w1 = new float[3]; - map(Mb, white_d50, w1); + map(Mb, sensorWhiteXYZ, w1); float[] w2 = new float[3]; - map(Mb, white_xyz, w2); + map(Mb, RawConverter.D50_XYZ, w2); float[] A = new float[9]; A[0] = (float) Math.max(0.1, Math.min(w1[0] > 0 ? w2[0] / w1[0] : 10, 10));