Class NamedColorSpace
java.lang.Object
java.awt.color.ColorSpace
org.apache.xmlgraphics.java2d.color.NamedColorSpace
- All Implemented Interfaces:
Serializable, ColorSpaceOrigin
Implements a pseudo color space for a named color which is defined in the CIE XYZ color space.
At the moment, this color space always returns the fully opaque color regardless of the single
component value (tint) given to its conversion methods.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final Stringprivate final Stringprivate static final longprivate final float[]Fields inherited from class 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
ConstructorsConstructorDescriptionNamedColorSpace(String name, float[] xyz) Creates a new named color.NamedColorSpace(String name, float[] xyz, String profileName, String profileURI) Creates a new named color.NamedColorSpace(String name, Color color) Creates a new named color.NamedColorSpace(String name, Color color, String profileName, String profileURI) Creates a new named color. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckNumComponents(float[] colorvalue, int expected) booleanfloat[]fromCIEXYZ(float[] colorvalue) float[]fromRGB(float[] rgbvalue) Returns the color name.floatgetMaxValue(int component) floatgetMinValue(int component) getName(int component) Returns the name of the profile used to identify the color space in a particular context.Returns the URI identifying the associate color profile.Returns an sRGB-based color representing the full-tint color defined by this named color space.float[]getXYZ()Returns the XYZ coordinates of the named color.inthashCode()float[]toCIEXYZ(float[] colorvalue) float[]toRGB(float[] colorvalue) toString()Methods inherited from class ColorSpace
getInstance, getNumComponents, getType, isCS_sRGB
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
-
xyz
private final float[] xyz -
profileName
-
profileURI
-
-
Constructor Details
-
NamedColorSpace
Creates a new named color.- Parameters:
name- the color namexyz- the CIE XYZ coordinates (valid values: 0.0f to 1.0f, although values slightly larger than 1.0f are common)
-
NamedColorSpace
Creates a new named color.- Parameters:
name- the color namexyz- the CIE XYZ coordinates (valid values: 0.0f to 1.0f, although values slightly larger than 1.0f are common)profileName- Optional profile name associated with this color spaceprofileURI- Optional profile URI associated with this color space
-
NamedColorSpace
Creates a new named color.- Parameters:
name- the color namecolor- the color to use when the named color's specific color properties are not available.profileName- Optional profile name associated with this color spaceprofileURI- Optional profile URI associated with this color space
-
NamedColorSpace
-
-
Method Details
-
checkNumComponents
private void checkNumComponents(float[] colorvalue, int expected) -
getColorName
-
getProfileName
Returns the name of the profile used to identify the color space in a particular context.- Specified by:
getProfileNamein interfaceColorSpaceOrigin- Returns:
- the profile name
-
getProfileURI
Returns the URI identifying the associate color profile.- Specified by:
getProfileURIin interfaceColorSpaceOrigin- Returns:
- the profile URI
-
getXYZ
public float[] getXYZ()Returns the XYZ coordinates of the named color.- Returns:
- the XYZ coordinates of the named color
-
getRGBColor
Returns an sRGB-based color representing the full-tint color defined by this named color space.- Returns:
- the sRGB color
-
getMinValue
public float getMinValue(int component) - Overrides:
getMinValuein classColorSpace
-
getMaxValue
public float getMaxValue(int component) - Overrides:
getMaxValuein classColorSpace
-
getName
- Overrides:
getNamein classColorSpace
-
fromCIEXYZ
public float[] fromCIEXYZ(float[] colorvalue) - Specified by:
fromCIEXYZin classColorSpace
-
fromRGB
public float[] fromRGB(float[] rgbvalue) - Specified by:
fromRGBin classColorSpace
-
toCIEXYZ
public float[] toCIEXYZ(float[] colorvalue) - Specified by:
toCIEXYZin classColorSpace
-
toRGB
public float[] toRGB(float[] colorvalue) - Specified by:
toRGBin classColorSpace
-
equals
-
hashCode
-
toString
-