public class CIELabColorSpace
extends 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 and Description |
---|
CIELabColorSpace()
Default constructor using the D65 white point.
|
CIELabColorSpace(float[] whitePoint)
CIE Lab space constructor which allows to give an arbitrary white point.
|
Modifier and Type | Method and Description |
---|---|
float[] |
fromCIEXYZ(float[] colorvalue) |
float[] |
fromRGB(float[] rgbvalue) |
static float[] |
getD50WhitePoint()
Returns the D50 white point.
|
static float[] |
getD65WhitePoint()
Returns the D65 white point.
|
float |
getMaxValue(int component) |
float |
getMinValue(int component) |
java.lang.String |
getName(int component) |
float[] |
getWhitePoint()
Returns the configured white point.
|
float[] |
toCIEXYZ(float[] colorvalue) |
float[] |
toCIEXYZNative(float l,
float a,
float b)
Transforms a color value assumed to be in this
ColorSpace
into the CS_CIEXYZ conversion color space. |
java.awt.Color |
toColor(float[] colorvalue,
float alpha)
Creates a
Color instance from color values usually used by the L*a*b* color space
by scaling them to the 0.0..1.0 range expected by Color's constructor. |
java.awt.Color |
toColor(float l,
float a,
float b,
float alpha)
Creates a
Color instance from color values usually used by the L*a*b* color space
by scaling them to the 0.0..1.0 range expected by Color's constructor. |
float[] |
toNativeComponents(float[] comps)
Converts normalized (0..1) color components to CIE L*a*b*'s native value range.
|
float[] |
toRGB(float[] colorvalue) |
public CIELabColorSpace()
public CIELabColorSpace(float[] whitePoint)
whitePoint
- the white point in XYZ coordinates (valid values: 0.0f to 1.0f, although
values slightly larger than 1.0f are common)public static float[] getD65WhitePoint()
public static float[] getD50WhitePoint()
public float[] getWhitePoint()
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 float[] fromCIEXYZ(float[] colorvalue)
fromCIEXYZ
in class java.awt.color.ColorSpace
public float[] fromRGB(float[] rgbvalue)
fromRGB
in class java.awt.color.ColorSpace
public float[] toCIEXYZ(float[] colorvalue)
toCIEXYZ
in class java.awt.color.ColorSpace
public float[] toCIEXYZNative(float l, float a, float b)
ColorSpace
into the CS_CIEXYZ conversion color space. This method uses component values
in CIE Lab's native color ranges rather than the normalized values between 0 and 1.l
- the L* component (values between 0 and 100)a
- the a* component (usually between -128 and +128)b
- the b* component (usually between -128 and +128)toCIEXYZ(float[])
public float[] toRGB(float[] colorvalue)
toRGB
in class java.awt.color.ColorSpace
public float[] toNativeComponents(float[] comps)
comps
- the normalized components.public java.awt.Color toColor(float[] colorvalue, float alpha)
Color
instance from color values usually used by the L*a*b* color space
by scaling them to the 0.0..1.0 range expected by Color's constructor.colorvalue
- the original color values
(native value range, i.e. not normalized to 0.0..1.0)alpha
- the alpha componentpublic java.awt.Color toColor(float l, float a, float b, float alpha)
Color
instance from color values usually used by the L*a*b* color space
by scaling them to the 0.0..1.0 range expected by Color's constructor.l
- the L* component (values between 0 and 100)a
- the a* component (usually between -128 and +127)b
- the b* component (usually between -128 and +127)alpha
- the alpha component (values between 0 and 1)Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.