java.awt.color
Class ICC_ColorSpace

java.lang.Object
  extended by java.awt.color.ColorSpace
      extended by java.awt.color.ICC_ColorSpace
All Implemented Interfaces:
Serializable

public class ICC_ColorSpace
extends ColorSpace

ICC_ColorSpace - an implementation of ColorSpace While an ICC_Profile class abstracts the data in an ICC profile file an ICC_ColorSpace performs the color space conversions defined by an ICC_Profile instance. Typically, an ICC_Profile will either be created using getInstance, either from the built-in colorspaces, or from an ICC profile file. Then a ICC_Colorspace will be used to perform transforms from the device colorspace to and from the profile color space. The PCS used by ColorSpace is CIE XYZ relative a D50 white point. (Profiles using a CIE Lab PCS will have their input and output converted to D50 CIE XYZ accordingly. Note that a valid profile may not contain transforms in both directions, in which case the output may be undefined. All built-in colorspaces have bidirectional transforms, but developers using an ICC profile file may want to check the profile class using the ICC_Profile.getProfileClass() method. Input class profiles are guaranteed to have transforms to the PCS, output class profiles are guaranteed to have transforms from the PCS to device space.

Since:
1.2
See Also:
Serialized Form

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
ICC_ColorSpace(ICC_Profile profile)
          Constructs a new ICC_ColorSpace from an ICC_Profile object.
 
Method Summary
 float[] fromCIEXYZ(float[] colorvalue)
          Transforms a color value assumed to be in the CS_CIEXYZ conversion color space into this ColorSpace.
 float[] fromRGB(float[] rgbvalue)
          Transforms a color value assumed to be in the default CS_sRGB color space into this ColorSpace.
 float getMaxValue(int idx)
          Returns the maximum normalized color component value for the specified component.
 float getMinValue(int idx)
          Returns the minimum normalized color component value for the specified component.
 ICC_Profile getProfile()
          Return the profile
 boolean isCS_sRGB()
           
 float[] toCIEXYZ(float[] colorvalue)
          Transforms a color value assumed to be in this ColorSpace into the CS_CIEXYZ conversion color space.
 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.awt.color.ColorSpace
getInstance, getName, getNumComponents, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICC_ColorSpace

public ICC_ColorSpace(ICC_Profile profile)
Constructs a new ICC_ColorSpace from an ICC_Profile object.

Throws:
IllegalArgumentException - If profile is inappropriate for representing a ColorSpace.
Method Detail

getProfile

public ICC_Profile getProfile()
Return the profile


toRGB

public float[] toRGB(float[] colorvalue)
Transforms a color value assumed to be in this ColorSpace into a value in the default CS_sRGB color space.

Specified by:
toRGB in class ColorSpace
Throws:
ArrayIndexOutOfBoundsException - If array length is not at least the number of components in this ColorSpace.

fromRGB

public float[] fromRGB(float[] rgbvalue)
Transforms a color value assumed to be in the default CS_sRGB color space into this ColorSpace.

Specified by:
fromRGB in class ColorSpace
Throws:
ArrayIndexOutOfBoundsException - If array length is not at least 3.

toCIEXYZ

public float[] toCIEXYZ(float[] colorvalue)
Transforms a color value assumed to be in this ColorSpace into the CS_CIEXYZ conversion color space.

Specified by:
toCIEXYZ in class ColorSpace
Throws:
ArrayIndexOutOfBoundsException - If array length is not at least the number of components in this ColorSpace.

fromCIEXYZ

public float[] fromCIEXYZ(float[] colorvalue)
Transforms a color value assumed to be in the CS_CIEXYZ conversion color space into this ColorSpace.

Specified by:
fromCIEXYZ in class ColorSpace
Throws:
ArrayIndexOutOfBoundsException - If array length is not at least 3.

isCS_sRGB

public boolean isCS_sRGB()
Overrides:
isCS_sRGB in class ColorSpace

getMinValue

public float getMinValue(int idx)
Returns the minimum normalized color component value for the specified component.

Overrides:
getMinValue in class ColorSpace
Throws:
IllegalArgumentException - If component is less than 0 or greater than numComponents - 1.
Since:
1.4

getMaxValue

public float getMaxValue(int idx)
Returns the maximum normalized color component value for the specified component.

Overrides:
getMaxValue in class ColorSpace
Throws:
IllegalArgumentException - If component is less than 0 or greater than numComponents - 1.
Since:
1.4