|
Préférences
Moteurs de recherche
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.4.2
java.awt.color
|
Field Summary | |
static int |
CS_CIEXYZ
The CIEXYZ conversion color space defined above. |
static int |
CS_GRAY
The built-in linear gray scale color space. |
static int |
CS_LINEAR_RGB
A built-in linear RGB color space. |
static int |
CS_PYCC
The Photo YCC conversion color space. |
static int |
CS_sRGB
The sRGB color space defined at http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html . |
static int |
TYPE_2CLR
Generic 2 component color spaces. |
static int |
TYPE_3CLR
Generic 3 component color spaces. |
static int |
TYPE_4CLR
Generic 4 component color spaces. |
static int |
TYPE_5CLR
Generic 5 component color spaces. |
static int |
TYPE_6CLR
Generic 6 component color spaces. |
static int |
TYPE_7CLR
Generic 7 component color spaces. |
static int |
TYPE_8CLR
Generic 8 component color spaces. |
static int |
TYPE_9CLR
Generic 9 component color spaces. |
static int |
TYPE_ACLR
Generic 10 component color spaces. |
static int |
TYPE_BCLR
Generic 11 component color spaces. |
static int |
TYPE_CCLR
Generic 12 component color spaces. |
static int |
TYPE_CMY
Any of the family of CMY color spaces. |
static int |
TYPE_CMYK
Any of the family of CMYK color spaces. |
static int |
TYPE_DCLR
Generic 13 component color spaces. |
static int |
TYPE_ECLR
Generic 14 component color spaces. |
static int |
TYPE_FCLR
Generic 15 component color spaces. |
static int |
TYPE_GRAY
Any of the family of GRAY color spaces. |
static int |
TYPE_HLS
Any of the family of HLS color spaces. |
static int |
TYPE_HSV
Any of the family of HSV color spaces. |
static int |
TYPE_Lab
Any of the family of Lab color spaces. |
static int |
TYPE_Luv
Any of the family of Luv color spaces. |
static int |
TYPE_RGB
Any of the family of RGB color spaces. |
static int |
TYPE_XYZ
Any of the family of XYZ color spaces. |
static int |
TYPE_YCbCr
Any of the family of YCbCr color spaces. |
static int |
TYPE_Yxy
Any of the family of Yxy color spaces. |
Constructor Summary | |
protected |
ColorSpace(int type,
int numcomponents)
Constructs a ColorSpace object given a color space type and the number of components. |
Method Summary | |
abstract float[] |
fromCIEXYZ(float[] colorvalue)
Transforms a color value assumed to be in the CS_CIEXYZ conversion color space into this ColorSpace. |
abstract float[] |
fromRGB(float[] rgbvalue)
Transforms a color value assumed to be in the default CS_sRGB color space into this ColorSpace. |
static ColorSpace |
getInstance(int colorspace)
Returns a ColorSpace representing one of the specific predefined color spaces. |
float |
getMaxValue(int component)
Returns the maximum normalized color component value for the specified component. |
float |
getMinValue(int component)
Returns the minimum normalized color component value for the specified component. |
String |
getName(int idx)
Returns the name of the component given the component index. |
int |
getNumComponents()
Returns the number of components of this ColorSpace. |
int |
getType()
Returns the color space type of this ColorSpace (for example TYPE_RGB, TYPE_XYZ, ...). |
boolean |
isCS_sRGB()
Returns true if the ColorSpace is CS_sRGB. |
abstract float[] |
toCIEXYZ(float[] colorvalue)
Transforms a color value assumed to be in this ColorSpace into the CS_CIEXYZ conversion color space. |
abstract float[] |
toRGB(float[] colorvalue)
Transforms a color value assumed to be in this ColorSpace into a value in the default CS_sRGB color space. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TYPE_XYZ
public static final int TYPE_Lab
public static final int TYPE_Luv
public static final int TYPE_YCbCr
public static final int TYPE_Yxy
public static final int TYPE_RGB
public static final int TYPE_GRAY
public static final int TYPE_HSV
public static final int TYPE_HLS
public static final int TYPE_CMYK
public static final int TYPE_CMY
public static final int TYPE_2CLR
public static final int TYPE_3CLR
public static final int TYPE_4CLR
public static final int TYPE_5CLR
public static final int TYPE_6CLR
public static final int TYPE_7CLR
public static final int TYPE_8CLR
public static final int TYPE_9CLR
public static final int TYPE_ACLR
public static final int TYPE_BCLR
public static final int TYPE_CCLR
public static final int TYPE_DCLR
public static final int TYPE_ECLR
public static final int TYPE_FCLR
public static final int CS_sRGB
public static final int CS_LINEAR_RGB
public static final int CS_CIEXYZ
public static final int CS_PYCC
public static final int CS_GRAY
Constructor Detail |
protected ColorSpace(int type, int numcomponents)
type
- One of the ColorSpace
type constants.numcomponents
- The number of components in the color space.Method Detail |
public static ColorSpace getInstance(int colorspace)
colorspace
- a specific color space identified by one of
the predefined class constants (e.g. CS_sRGB, CS_LINEAR_RGB,
CS_CIEXYZ, CS_GRAY, or CS_PYCC)
ColorSpace
object.public boolean isCS_sRGB()
true
if this is a CS_sRGB
color
space, false
if it is not.public abstract float[] toRGB(float[] colorvalue)
This method transforms color values using algorithms designed
to produce the best perceptual match between input and output
colors. In order to do colorimetric conversion of color values,
you should use the toCIEXYZ
method of this color space to first convert from the input
color space to the CS_CIEXYZ color space, and then use the
fromCIEXYZ
method of the CS_sRGB color space to
convert from CS_CIEXYZ to the output color space.
See toCIEXYZ
and
fromCIEXYZ
for further information.
colorvalue
- a float array with length of at least the number
of components in this ColorSpace
ArrayIndexOutOfBoundsException
- if array length is not
at least the number of components in this ColorSpace.public abstract float[] fromRGB(float[] rgbvalue)
This method transforms color values using algorithms designed
to produce the best perceptual match between input and output
colors. In order to do colorimetric conversion of color values,
you should use the toCIEXYZ
method of the CS_sRGB color space to first convert from the input
color space to the CS_CIEXYZ color space, and then use the
fromCIEXYZ
method of this color space to
convert from CS_CIEXYZ to the output color space.
See toCIEXYZ
and
fromCIEXYZ
for further information.
rgbvalue
- a float array with length of at least 3
ArrayIndexOutOfBoundsException
- if array length is not
at least 3.public abstract float[] toCIEXYZ(float[] colorvalue)
This method transforms color values using relative colorimetry,
as defined by the International Color Consortium standard. This
means that the XYZ values returned by this method are represented
relative to the D50 white point of the CS_CIEXYZ color space.
This representation is useful in a two-step color conversion
process in which colors are transformed from an input color
space to CS_CIEXYZ and then to an output color space. This
representation is not the same as the XYZ values that would
be measured from the given color value by a colorimeter.
A further transformation is necessary to compute the XYZ values
that would be measured using current CIE recommended practices.
See the toCIEXYZ
method of
ICC_ColorSpace
for further information.
colorvalue
- a float array with length of at least the number
of components in this ColorSpace
ArrayIndexOutOfBoundsException
- if array length is not
at least the number of components in this ColorSpace.public abstract float[] fromCIEXYZ(float[] colorvalue)
This method transforms color values using relative colorimetry,
as defined by the International Color Consortium standard. This
means that the XYZ argument values taken by this method are represented
relative to the D50 white point of the CS_CIEXYZ color space.
This representation is useful in a two-step color conversion
process in which colors are transformed from an input color
space to CS_CIEXYZ and then to an output color space. The color
values returned by this method are not those that would produce
the XYZ value passed to the method when measured by a colorimeter.
If you have XYZ values corresponding to measurements made using
current CIE recommended practices, they must be converted to D50
relative values before being passed to this method.
See the fromCIEXYZ
method of
ICC_ColorSpace
for further information.
colorvalue
- a float array with length of at least 3
ArrayIndexOutOfBoundsException
- if array length is not
at least 3.public int getType()
ColorSpace
.public int getNumComponents()
ColorSpace
.public String getName(int idx)
idx
- The component index.
public float getMinValue(int component)
component
- The component index.
IllegalArgumentException
- if component is less than 0 or
greater than numComponents - 1.public float getMaxValue(int component)
component
- The component index.
IllegalArgumentException
- if component is less than 0 or
greater than numComponents - 1.