java.lang.Object
imagingbook.common.color.cie.CieUtils
Defines static methods for converting between CIE-XYZ coordinates (3D) and xy chromaticity values (2D). See Sec. 14.1.2 of [1] for details.
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
xyToXYZ
(double x, double y) Calculates the XYZ coordinates for a given point (x,y) in the CIE xy-color diagram.static float[]
xyToXYZ
(float x, float y) Float version ofxyToXYZ(double, double)
.static double[]
xyYToXYZ
(double x, double y, double Y) Calculates the XYZ coordinates for a given point (x,y) in the CIE xy-color diagram, with Y explicitly specified.static float[]
xyYToXYZ
(float x, float y, float Y) Float version ofxyYToXYZ(double, double, double)
.static double[]
XYZToxy
(double[] XYZ) Calculates the 2D (x,y) color diagram coordinates for 3D XYZ color coordinates (X,Y,Z).static float[]
XYZToxy
(float[] XYZ) Float version ofXYZToxy(double[])
.static double[]
XYZToxyz
(double[] XYZ) Calculates the 3D (x,y,z) color diagram coordinates for 3D XYZ color coordinates (X,Y,Z).static float[]
XYZToxyz
(float[] XYZ) Float version ofXYZToxyz(double[])
.
-
Method Details
-
xyToXYZ
Calculates the XYZ coordinates for a given point (x,y) in the CIE xy-color diagram. XYZ is located on the 3D plane X + Y + Z = 1. Returns (0,0,0) for y = 0;- Parameters:
x
- x-coordinate (in the 2D xy-diagram)y
- y-coordinate (in the 2D xy-diagram)- Returns:
- the associated XYZ coordinate
-
xyToXYZ
Float version ofxyToXYZ(double, double)
.- Parameters:
x
- x-coordinate (in the 2D xy-diagram)y
- y-coordinate (in the 2D xy-diagram)- Returns:
- the associated XYZ coordinate
-
xyYToXYZ
Calculates the XYZ coordinates for a given point (x,y) in the CIE xy-color diagram, with Y explicitly specified.- Parameters:
x
- x-coordinate (in the 2D xy-diagram)y
- y-coordinate (in the 2D xy-diagram)Y
- the Y-coordinate (in 3D color space)- Returns:
- the associated XYZ coordinate
-
xyYToXYZ
Float version ofxyYToXYZ(double, double, double)
.- Parameters:
x
- x-coordinate (in the 2D xy-diagram)y
- y-coordinate (in the 2D xy-diagram)Y
- the Y-coordinate (in 3D color space)- Returns:
- the associated XYZ coordinate
-
XYZToxy
Calculates the 2D (x,y) color diagram coordinates for 3D XYZ color coordinates (X,Y,Z).- Parameters:
XYZ
- the XYZ coordinate (3D)- Returns:
- the xy-coordinate (2D)
-
XYZToxyz
Calculates the 3D (x,y,z) color diagram coordinates for 3D XYZ color coordinates (X,Y,Z).- Parameters:
XYZ
- the XYZ coordinate (3D)- Returns:
- the xyz-coordinate (3D)
-
XYZToxy
Float version ofXYZToxy(double[])
.- Parameters:
XYZ
- the XYZ coordinate (3D)- Returns:
- the xy-coordinate (2D)
-
XYZToxyz
Float version ofXYZToxyz(double[])
.- Parameters:
XYZ
- the XYZ coordinate (3D)- Returns:
- the xyz-coordinate (§D)
-