public class CIELABColorSpace extends java.awt.color.ColorSpace implements NamedColorSpace
The L* coordinate of an object is the lightness intensity as measured on a scale from 0 to 100, where 0 represents black and 100 represents white.
The a* coordinate of an object represents the position of the object’s color on a pure green and pure red scale, where -127 represents pure green and +127 represents pure red.
The b* coordinate represents the position of the object’s color on a pure blue and pure yellow scale, where -127 represents pure blue and +127 represents pure yellow.
The distance that can be calculated between two colors, is directly proportional to the difference between the two colors as perceived by the human eye.
The above description has been derived from http://www.optelvision.com/documents/optel-vision-s-explanation-on-cielab-color-space.pdf
Modifier and Type | Class and Description |
---|---|
static class |
CIELABColorSpace.OutsideGamutHandling |
CS_CIEXYZ, CS_GRAY, CS_LINEAR_RGB, CS_PYCC, CS_sRGB, TYPE_2CLR, TYPE_3CLR, TYPE_4CLR, TYPE_5CLR, TYPE_6CLR, TYPE_7CLR, TYPE_8CLR, TYPE_9CLR, TYPE_ACLR, TYPE_BCLR, TYPE_CCLR, TYPE_CMY, TYPE_CMYK, TYPE_DCLR, TYPE_ECLR, TYPE_FCLR, TYPE_GRAY, TYPE_HLS, TYPE_HSV, TYPE_Lab, TYPE_Luv, TYPE_RGB, TYPE_XYZ, TYPE_YCbCr, TYPE_Yxy
Constructor and Description |
---|
CIELABColorSpace() |
Modifier and Type | Method and Description |
---|---|
float[] |
fromCIEXYZ(float[] colorvalue)
XYT to Lab.
|
float[] |
fromRGB(float[] rgbvalue) |
float |
getMaxValue(int component) |
float |
getMinValue(int component) |
java.lang.String |
getName() |
java.lang.String |
getName(int component) |
CIELABColorSpace.OutsideGamutHandling |
getOutsideGamutHandling() |
static void |
main(java.lang.String[] arg) |
void |
setOutsideGamutHandling(CIELABColorSpace.OutsideGamutHandling b) |
float[] |
toCIEXYZ(float[] colorvalue)
Lab to XYZ.
|
float[] |
toRGB(float[] colorvalue) |
public float[] toRGB(float[] colorvalue)
toRGB
in class java.awt.color.ColorSpace
public float[] fromRGB(float[] rgbvalue)
fromRGB
in class java.awt.color.ColorSpace
public float[] toCIEXYZ(float[] colorvalue)
X = xr*Xw; Y = yr*Yw; Z = zr*Zw;where
xr = fx^3, if fx^3 > eps = (116*fx - 16)/k, if fx^3 <= eps yr = ((L+16)/116)^3, if L > k*eps = L/k, if L <= k*eps zr = fz^3, if fz^3 > eps = (116*fz - 16)/k, if fz^3 <= eps fx = a/500+fy fz = fy - b / 200 fy = (L+16)/116 eps = 216/24389 k = 24389/27Source: http://www.brucelindbloom.com/index.html?Equations.html
toCIEXYZ
in class java.awt.color.ColorSpace
colorvalue
- Lab color value.public float[] fromCIEXYZ(float[] colorvalue)
L = 116*fy - 16 a = 500 * (fx - fy) b = 200 * (fy - fz)where
fx = xr^(1/3), if xr > eps = (k*xr + 16) / 116 if xr <= eps fy = yr^(1/3), if yr > eps = (k*yr + 16) / 116 if yr <= eps fz = zr^(1/3), if zr > eps = (k*zr + 16) / 116 if zr <= eps xr = X / Xw yr = Y / Yw zr = Z / Zw eps = 216/24389 k = 24389/27Source: http://www.brucelindbloom.com/index.html?Equations.html
fromCIEXYZ
in class java.awt.color.ColorSpace
colorvalue
- CIEXYZ color value.public java.lang.String getName()
getName
in interface NamedColorSpace
public float getMinValue(int component)
getMinValue
in class java.awt.color.ColorSpace
public float getMaxValue(int component)
getMaxValue
in class java.awt.color.ColorSpace
public java.lang.String getName(int component)
getName
in class java.awt.color.ColorSpace
public void setOutsideGamutHandling(CIELABColorSpace.OutsideGamutHandling b)
public CIELABColorSpace.OutsideGamutHandling getOutsideGamutHandling()
public static void main(java.lang.String[] arg)