Class SRLAB2
- java.lang.Object
-
- micycle.peasygradients.colorspace.SRLAB2
-
- All Implemented Interfaces:
ColorSpaceTransform
public class SRLAB2 extends Object implements ColorSpaceTransform
The SRLAB2 color model is a compromise between the simplicity of CIELAB and the correctness of CIECAM02.In contrast to CIECAM02 or RLAB there are no parameters like the adapting luminance or the relative luminance of the surround; only the white point (which is assumed to be completely adapted) has to be known. Compared to RLAB the SRLAB2 model uses the more recent chromatic adaption model of CIECAM02.
For a fixed white point, successive linear transformations can be precalulated to form a single matrix, which reduces the complexity of the calculations to two matrix vector multiplications and the componentwise application of the compression function. The SRLAB2 model is almost as easy to use as CIELAB, while overcoming its errors especially visible in hue-changes of blue colors. *
Implementation of 'Deficiencies of the CIE-L*a*b* color space and introduction of the SRLAB2 color model'. See https://www.magnetkern.de/srlab2.html
-
-
Constructor Summary
Constructors Constructor Description SRLAB2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
fromRGB(double[] RGB)
Converts an RGB color into the corresponding color in the target color space.double[]
toRGB(double[] color)
Converts a color from the implementing color space to RGB.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface micycle.peasygradients.colorspace.ColorSpaceTransform
interpolateLinear
-
-
-
-
Method Detail
-
toRGB
public double[] toRGB(double[] color)
Description copied from interface:ColorSpaceTransform
Converts a color from the implementing color space to RGB. Implementations should focus on optimizing this conversion process for efficiency.- Specified by:
toRGB
in interfaceColorSpaceTransform
- Parameters:
color
- an array representing the color in the implementing color space. The specific meaning and length of this array depend on the color space.- Returns:
- an array of three doubles representing the color in RGB, with each component normalized to the range [0, 1]. The output may exceed this range before display calibration or clipping is applied.
-
fromRGB
public double[] fromRGB(double[] RGB)
Description copied from interface:ColorSpaceTransform
Converts an RGB color into the corresponding color in the target color space.- Specified by:
fromRGB
in interfaceColorSpaceTransform
- Parameters:
RGB
- an array of three doubles representing the red, green, and blue components of the color, each normalized to the range [0, 1]- Returns:
- an array of doubles representing the color in the target color space. The length and interpretation of this array depend on the specific color space.
-
-