|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.image.ColorConvertOp
This class performs a pixel-by-pixel color conversion of the data in the source image. The resulting color values are scaled to the precision of the destination image. Color conversion can be specified via an array of ColorSpace objects or an array of ICC_Profile objects.
If the source is a BufferedImage with premultiplied alpha, the color components are divided by the alpha component before color conversion. If the destination is a BufferedImage with premultiplied alpha, the color components are multiplied by the alpha component after conversion. Rasters are treated as having no alpha channel, i.e. all bands are color bands.
If a RenderingHints object is specified in the constructor, the color rendering hint and the dithering hint may be used to control color conversion.
Note that Source and Destination may be the same object.
RenderingHints.KEY_COLOR_RENDERING
,
RenderingHints.KEY_DITHERING
Constructor Summary | |
ColorConvertOp(ColorSpace srcCspace,
ColorSpace dstCspace,
RenderingHints hints)
Constructs a new ColorConvertOp from two ColorSpace objects. |
|
ColorConvertOp(ColorSpace cspace,
RenderingHints hints)
Constructs a new ColorConvertOp from a ColorSpace object. |
|
ColorConvertOp(ICC_Profile[] profiles,
RenderingHints hints)
Constructs a new ColorConvertOp from an array of ICC_Profiles. |
|
ColorConvertOp(RenderingHints hints)
Constructs a new ColorConvertOp which will convert from a source color space to a destination color space. |
Method Summary | |
BufferedImage |
createCompatibleDestImage(BufferedImage src,
ColorModel destCM)
Creates a zeroed destination image with the correct size and number of bands, given this source. |
WritableRaster |
createCompatibleDestRaster(Raster src)
Creates a zeroed destination Raster with the correct size and number of bands, given this source. |
BufferedImage |
filter(BufferedImage src,
BufferedImage dest)
ColorConverts the source BufferedImage. |
WritableRaster |
filter(Raster src,
WritableRaster dest)
ColorConverts the image data in the source Raster. |
Rectangle2D |
getBounds2D(BufferedImage src)
Returns the bounding box of the destination, given this source. |
Rectangle2D |
getBounds2D(Raster src)
Returns the bounding box of the destination, given this source. |
ICC_Profile[] |
getICC_Profiles()
Returns the array of ICC_Profiles used to construct this ColorConvertOp. |
Point2D |
getPoint2D(Point2D srcPt,
Point2D dstPt)
Returns the location of the destination point given a point in the source. |
RenderingHints |
getRenderingHints()
Returns the rendering hints used by this op. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ColorConvertOp(RenderingHints hints)
public ColorConvertOp(ColorSpace cspace, RenderingHints hints)
public ColorConvertOp(ColorSpace srcCspace, ColorSpace dstCspace, RenderingHints hints)
public ColorConvertOp(ICC_Profile[] profiles, RenderingHints hints)
For BufferedImages, if the ColorSpace of the source BufferedImage does not match the requirements of the first profile in the array, the first conversion is to an appropriate ColorSpace. If the requirements of the last profile in the array are not met by the ColorSpace of the destination BufferedImage, the last conversion is to the destination's ColorSpace.
For Rasters, the number of bands in the source Raster must match the requirements of the first profile in the array, and the number of bands in the destination Raster must match the requirements of the last profile in the array. The array must have at least two elements or calling the filter method for Rasters will throw an IllegalArgumentException.
Method Detail |
public final ICC_Profile[] getICC_Profiles()
public final BufferedImage filter(BufferedImage src, BufferedImage dest)
public final WritableRaster filter(Raster src, WritableRaster dest)
public final Rectangle2D getBounds2D(BufferedImage src)
public final Rectangle2D getBounds2D(Raster src)
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM)
src
- Source image for the filter operation.destCM
- ColorModel of the destination. If null, an
appropriate ColorModel will be used.public WritableRaster createCompatibleDestRaster(Raster src)
public final Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
public final RenderingHints getRenderingHints()
|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |