|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.color.ColorSpace | +--javax.media.jai.ColorSpaceJAI | +--javax.media.jai.IHSColorSpace
Singleton class representing the IHS (Intensity, Hue, Saturation) color space (also known as HSI or HIS).
The RGB-to-IHS transformation is defined by the equations:
PI
- h, where When H
is in [2PI/3, 4PI/3]
, R
should be the smallest. Then, there exists
R = (1-S)I
and
where c1 = 3I-R
and c2 = sqrt(3)(R-I)tg(H)
when H
is in [4PI/3, 2PI]
,
G = (1-S)I
and
where c1 = 3I-G and c2 = sqrt(3)(G-I)tg(H-2PI/3)
when H
is in [0, 2PI/3]
,
B = (1-S)I
and
where c1 = 3I-B
and c2 = sqrt(3)(B-I)tg(H-4PI/3)
Methods defined in the superclasses are not commented extensively.
ColorSpaceJAI
, Serialized FormFields 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 | |
protected |
IHSColorSpace()
Constructs an instance of this class with type
ColorSpace.TYPE_HSV , 3 components, and preferred
intermediary space sRGB. |
Method Summary | |
float[] |
fromCIEXYZ(float[] colorValue)
Converts a single color value from CIEXYZ to IHS. |
WritableRaster |
fromCIEXYZ(Raster src,
int[] srcComponentSize,
WritableRaster dest,
int[] destComponentSize)
Converts a Raster of colors represented as pixels
from CIEXYZ to IHS. |
float[] |
fromRGB(float[] rgbValue)
Converts a single color value from sRGB to IHS. |
WritableRaster |
fromRGB(Raster src,
int[] srcComponentSize,
WritableRaster dest,
int[] destComponentSize)
Converts a Raster of colors represented as pixels
from sRGB to IHS. |
static IHSColorSpace |
getInstance()
Retrieves the unique instance of this class the construction of which is deferred until the first invocation of this method. |
float[] |
toCIEXYZ(float[] colorValue)
Converts a single color value from IHS to CIEXYZ. |
WritableRaster |
toCIEXYZ(Raster src,
int[] srcComponentSize,
WritableRaster dest,
int[] destComponentSize)
Converts a Raster of colors represented as pixels
from IHS to CIEXYZ. |
float[] |
toRGB(float[] colorValue)
Converts a single color value from IHS to sRGB. |
WritableRaster |
toRGB(Raster src,
int[] srcComponentSize,
WritableRaster dest,
int[] destComponentSize)
Converts a Raster of colors represented as pixels
from IHS to sRGB. |
Methods inherited from class javax.media.jai.ColorSpaceJAI |
checkParameters,
CIEXYZToRGB,
convertToSigned,
isRGBPreferredIntermediary,
RGBToCIEXYZ |
Methods inherited from class java.awt.color.ColorSpace |
getInstance,
getName,
getNumComponents,
getType,
isCS_sRGB |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
protected IHSColorSpace()
type
ColorSpace.TYPE_HSV
, 3 components, and preferred
intermediary space sRGB.Method Detail |
public static IHSColorSpace getInstance()
public float[] fromCIEXYZ(float[] colorValue)
public float[] fromRGB(float[] rgbValue)
public float[] toCIEXYZ(float[] colorValue)
public float[] toRGB(float[] colorValue)
public WritableRaster fromCIEXYZ(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)
Raster
of colors represented as pixels
from CIEXYZ to IHS.src
- the source Raster
to be converted.srcComponentSize
- array that specifies the number of significant
bits per source color component; ignored for floating point data.
If null
defaults to the value returned by
src.getSampleModel().getSampleSize()
.dest
- the destination WritableRaster
,
or null
.destComponentSize
- array that specifies the number of significant
bits per destination color component; ignored for floating point
data. If null
defaults to the value returned by
dest.getSampleModel().getSampleSize()
, or the sample
size of the newly created destination WritableRaster if dest is
null.dest
color converted from src
or a new, WritableRaster
containing the converted
pixels if dest
is null
.src
is
null
, the number of source or destination
bands does not equal the number of components of the
respective color space, or either component size array
is non-null and has length not equal to the number of
bands in the respective Raster
.public WritableRaster fromRGB(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)
Raster
of colors represented as pixels
from sRGB to IHS.src
- the source Raster
to be converted.srcComponentSize
- array that specifies the number of significant
bits per source color component; ignored for floating point data.
If null
defaults to the value returned by
src.getSampleModel().getSampleSize()
.dest
- the destination WritableRaster
,
or null
.destComponentSize
- array that specifies the number of significant
bits per destination color component; ignored for floating point
data. If null
defaults to the value returned by
dest.getSampleModel().getSampleSize()
, or the sample
size of the newly created destination WritableRaster if dest is
null.dest
color converted from src
or a new, WritableRaster
containing the converted
pixels if dest
is null
.src
is
null
, the number of source or destination
bands does not equal the number of components of the
respective color space, or either component size array
is non-null and has length not equal to the number of
bands in the respective Raster
.public WritableRaster toCIEXYZ(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)
Raster
of colors represented as pixels
from IHS to CIEXYZ.src
- the source Raster
to be converted.srcComponentSize
- array that specifies the number of significant
bits per source color component; ignored for floating point data.
If null
defaults to the value returned by
src.getSampleModel().getSampleSize()
.dest
- the destination WritableRaster
,
or null
.destComponentSize
- array that specifies the number of significant
bits per destination color component; ignored for floating point
data. If null
defaults to the value returned by
dest.getSampleModel().getSampleSize()
, or the sample
size of the newly created destination WritableRaster if dest is
null.dest
color converted from src
or a new, WritableRaster
containing the converted
pixels if dest
is null
.src
is
null
, the number of source or destination
bands does not equal the number of components of the
respective color space, or either component size array
is non-null and has length not equal to the number of
bands in the respective Raster
.public WritableRaster toRGB(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)
Raster
of colors represented as pixels
from IHS to sRGB.src
- the source Raster
to be converted.srcComponentSize
- array that specifies the number of significant
bits per source color component; ignored for floating point data.
If null
defaults to the value returned by
src.getSampleModel().getSampleSize()
.dest
- the destination WritableRaster
,
or null
.destComponentSize
- array that specifies the number of significant
bits per destination color component; ignored for floating point
data. If null
defaults to the value returned by
dest.getSampleModel().getSampleSize()
, or the sample
size of the newly created destination WritableRaster if dest is
null.dest
color converted from src
or a new, WritableRaster
containing the converted
pixels if dest
is null
.src
is
null
, the number of source or destination
bands does not equal the number of components of the
respective color space, or either component size array
is non-null and has length not equal to the number of
bands in the respective Raster
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |