Class CIELABColorSpace
- java.lang.Object
-
- java.awt.color.ColorSpace
-
- org.jhotdraw.color.CIELABColorSpace
-
- All Implemented Interfaces:
- java.io.Serializable, NamedColorSpace
public class CIELABColorSpace extends java.awt.color.ColorSpace implements NamedColorSpace
The 1976 CIE L*a*b* color space (CIELAB).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
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classCIELABColorSpace.OutsideGamutHandling
-
Field Summary
-
Fields inherited from class java.awt.color.ColorSpace
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 Summary
Constructors Constructor and Description CIELABColorSpace()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description float[]fromCIEXYZ(float[] colorvalue)XYT to Lab.float[]fromRGB(float[] rgbvalue)floatgetMaxValue(int component)floatgetMinValue(int component)java.lang.StringgetName()java.lang.StringgetName(int component)CIELABColorSpace.OutsideGamutHandlinggetOutsideGamutHandling()static voidmain(java.lang.String[] arg)voidsetOutsideGamutHandling(CIELABColorSpace.OutsideGamutHandling b)float[]toCIEXYZ(float[] colorvalue)Lab to XYZ.float[]toRGB(float[] colorvalue)
-
-
-
Method Detail
-
toRGB
public float[] toRGB(float[] colorvalue)
- Specified by:
toRGBin classjava.awt.color.ColorSpace
-
fromRGB
public float[] fromRGB(float[] rgbvalue)
- Specified by:
fromRGBin classjava.awt.color.ColorSpace
-
toCIEXYZ
public float[] toCIEXYZ(float[] colorvalue)
Lab to XYZ.X = xr*Xw; Y = yr*Yw; Z = zr*Zw;
wherexr = 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- Specified by:
toCIEXYZin classjava.awt.color.ColorSpace- Parameters:
colorvalue- Lab color value.- Returns:
- CIEXYZ color value.
-
fromCIEXYZ
public float[] fromCIEXYZ(float[] colorvalue)
XYT to Lab.L = 116*fy - 16 a = 500 * (fx - fy) b = 200 * (fy - fz)
wherefx = 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- Specified by:
fromCIEXYZin classjava.awt.color.ColorSpace- Parameters:
colorvalue- CIEXYZ color value.- Returns:
- Lab color value.
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceNamedColorSpace
-
getMinValue
public float getMinValue(int component)
- Overrides:
getMinValuein classjava.awt.color.ColorSpace
-
getMaxValue
public float getMaxValue(int component)
- Overrides:
getMaxValuein classjava.awt.color.ColorSpace
-
getName
public java.lang.String getName(int component)
- Overrides:
getNamein classjava.awt.color.ColorSpace
-
setOutsideGamutHandling
public void setOutsideGamutHandling(CIELABColorSpace.OutsideGamutHandling b)
-
getOutsideGamutHandling
public CIELABColorSpace.OutsideGamutHandling getOutsideGamutHandling()
-
main
public static void main(java.lang.String[] arg)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG