Brixomatic commented on a change in pull request #114:
URL: https://github.com/apache/commons-imaging/pull/114#discussion_r548923359
##########
File path: src/main/java/org/apache/commons/imaging/color/ColorConversions.java
##########
@@ -16,44 +16,46 @@
*/
package org.apache.commons.imaging.color;
+import java.awt.Color;
public final class ColorConversions {
- private static final double REF_X = 95.047; // Observer= 2°, Illuminant=
D65
+
+ // White reference
+ /** see:
https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */
+ private static final double REF_X = 95.047; // Observer= 2°, Illuminant=
D65
+
+ /** see:
https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */
private static final double REF_Y = 100.000;
+
+ /** see:
https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */
private static final double REF_Z = 108.883;
+ /** see:
https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */
+ private static final double XYZ_m = 7.787037; // match in slope. Note
commonly seen 7.787 gives worse results
+
+ /** see:
https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */
+ private static final double XYZ_t0 = 0.008856;
Review comment:
Extracted these constants to give them a name that matches the published
formulas
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]