| javax.media.jai.ColorSpaceJAI javax.media.jai.IHSColorSpace
IHSColorSpace | final public class IHSColorSpace extends ColorSpaceJAI (Code) | | 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:
- I = (R+G+B)/3
- S = 1-min(R, G, B)/I
- H = G > B ? h : 2*
PI - h, where
h = cos-1{[(R-G)+(R-B)]/2[(R-G)2+
(R-G)(G-B)]1/2}
where the R, G, B values have been normalized to the range [0.0, 1.0].
Refer to Practical Algorithms for Image Analysis, Seul, et. al.,
(Cambridge, 2000), pages 50-55, for more information.
The inverse transformation (IHS-to-RGB) is defined as:
When H is in [2PI/3, 4PI/3] , R
should be the smallest. Then, there exists
R = (1-S)I
and - G = (c1 + c2)/2
- B = (c1 - c2)/2
where c1 = 3I-R and c2 = sqrt(3)(R-I)tg(H)
when H is in [4PI/3, 2PI] ,
G = (1-S)I
and - B = (c1 + c2)/2
- R = (c1 - c2)/2
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 - R = (c1 + c2)/2
- G = (c1 - c2)/2
where c1 = 3I-B and c2 = sqrt(3)(B-I)tg(H-4PI/3)
Methods defined in the superclasses are not commented extensively.
See Also: ColorSpaceJAI since: JAI 1.1 |
Constructor Summary | |
protected | IHSColorSpace() Constructs an instance of this class with type
ColorSpace.TYPE_HSV , 3 components, and preferred
intermediary space sRGB. |
Method Summary | |
public float[] | fromCIEXYZ(float[] colorValue) Converts a single color value from CIEXYZ to IHS. | public WritableRaster | fromCIEXYZ(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize) Converts a Raster of colors represented as pixels
from CIEXYZ to IHS. | public float[] | fromRGB(float[] rgbValue) Converts a single color value from sRGB to IHS. | public WritableRaster | fromRGB(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize) Converts a Raster of colors represented as pixels
from sRGB to IHS. | public static IHSColorSpace | getInstance() Retrieves the unique instance of this class the construction of
which is deferred until the first invocation of this method. | public float[] | toCIEXYZ(float[] colorValue) Converts a single color value from IHS to CIEXYZ. | public WritableRaster | toCIEXYZ(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize) Converts a Raster of colors represented as pixels
from IHS to CIEXYZ. | public float[] | toRGB(float[] colorValue) Converts a single color value from IHS to sRGB. | public WritableRaster | toRGB(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize) Converts a Raster of colors represented as pixels
from IHS to sRGB. |
IHSColorSpace | protected IHSColorSpace()(Code) | | Constructs an instance of this class with type
ColorSpace.TYPE_HSV , 3 components, and preferred
intermediary space sRGB.
|
fromCIEXYZ | public float[] fromCIEXYZ(float[] colorValue)(Code) | | Converts a single color value from CIEXYZ to IHS.
|
fromCIEXYZ | public WritableRaster fromCIEXYZ(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code) | | Converts a Raster of colors represented as pixels
from CIEXYZ to IHS.
|
fromRGB | public float[] fromRGB(float[] rgbValue)(Code) | | Converts a single color value from sRGB to IHS.
|
fromRGB | public WritableRaster fromRGB(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code) | | Converts a Raster of colors represented as pixels
from sRGB to IHS.
|
getInstance | public static IHSColorSpace getInstance()(Code) | | Retrieves the unique instance of this class the construction of
which is deferred until the first invocation of this method.
|
toCIEXYZ | public float[] toCIEXYZ(float[] colorValue)(Code) | | Converts a single color value from IHS to CIEXYZ.
|
toCIEXYZ | public WritableRaster toCIEXYZ(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code) | | Converts a Raster of colors represented as pixels
from IHS to CIEXYZ.
|
toRGB | public float[] toRGB(float[] colorValue)(Code) | | Converts a single color value from IHS to sRGB.
|
toRGB | public WritableRaster toRGB(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code) | | Converts a Raster of colors represented as pixels
from IHS to sRGB.
|
Methods inherited from javax.media.jai.ColorSpaceJAI | public static WritableRaster CIEXYZToRGB(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code)(Java Doc) static void CIEXYZToRGBByte(UnpackedImageData src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code)(Java Doc) static void RGB2XYZ(float[] RGB, float[] XYZ)(Code)(Java Doc) public static WritableRaster RGBToCIEXYZ(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code)(Java Doc) static void XYZ2RGB(float[] XYZ, float[] RGB)(Code)(Java Doc) protected static void checkParameters(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code)(Java Doc) static void convertToSigned(double[] buf, int dataType)(Code)(Java Doc) abstract public WritableRaster fromCIEXYZ(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code)(Java Doc) abstract public WritableRaster fromRGB(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code)(Java Doc) public boolean isRGBPreferredIntermediary()(Code)(Java Doc) abstract public WritableRaster toCIEXYZ(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code)(Java Doc) abstract public WritableRaster toRGB(Raster src, int[] srcComponentSize, WritableRaster dest, int[] destComponentSize)(Code)(Java Doc)
|
|
|