|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.image.ColorConvertOp
public class ColorConvertOp
ColorConvertOp is a filter for converting images or rasters between colorspaces, either through a sequence of colorspaces or just from source to destination. Color conversion is done on the color components without alpha. Thus if a BufferedImage has alpha premultiplied, this is divided out before color conversion, and premultiplication applied if the destination requires it. Color rendering and dithering hints may be applied if specified. This is likely platform-dependent.
Constructor Summary | |
---|---|
ColorConvertOp(ColorSpace srcCspace,
ColorSpace dstCspace,
RenderingHints hints)
Convert from a source colorspace to a destination colorspace. |
|
ColorConvertOp(ColorSpace cspace,
RenderingHints hints)
Convert a BufferedImage through a ColorSpace. |
|
ColorConvertOp(ICC_Profile[] profiles,
RenderingHints hints)
Convert from a source colorspace to a destinatino colorspace. |
|
ColorConvertOp(RenderingHints hints)
Convert from source color space to destination color space. |
Method Summary | |
---|---|
BufferedImage |
createCompatibleDestImage(BufferedImage src,
ColorModel dstCM)
Creates an empty BufferedImage with the size equal to the source and the correct number of bands for the conversion defined in this Op. |
WritableRaster |
createCompatibleDestRaster(Raster src)
Creates a new WritableRaster with the size equal to the source and the correct number of bands. |
BufferedImage |
filter(BufferedImage src,
BufferedImage dst)
Converts the source image using the conversion path specified in the constructor. |
WritableRaster |
filter(Raster src,
WritableRaster dest)
Converts the source raster using the conversion path specified in the constructor. |
Rectangle2D |
getBounds2D(BufferedImage src)
Returns the corresponding destination boundary of a source boundary. |
Rectangle2D |
getBounds2D(Raster src)
Returns the corresponding destination boundary of a source boundary. |
ICC_Profile[] |
getICC_Profiles()
Returns the array of ICC_Profiles used to create this Op, or null if the Op was created using ColorSpace arguments. |
Point2D |
getPoint2D(Point2D src,
Point2D dst)
Returns the corresponding destination point for a source point. |
RenderingHints |
getRenderingHints()
Returns the rendering hints for this op. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorConvertOp(ColorSpace cspace, RenderingHints hints)
cspace
- The target color space.hints
- Rendering hints to use in conversion, if any (may be null)
NullPointerException
- if the ColorSpace is null.public ColorConvertOp(ColorSpace srcCspace, ColorSpace dstCspace, RenderingHints hints)
srcCspace
- The source ColorSpace.dstCspace
- The destination ColorSpace.hints
- Rendering hints to use in conversion, if any (may be null).
NullPointerException
- if any ColorSpace is null.public ColorConvertOp(ICC_Profile[] profiles, RenderingHints hints)
profiles
- An array of ICC_Profile's to convert through.hints
- Rendering hints to use in conversion, if any (may be null).
NullPointerException
- if the profile array is null.
IllegalArgumentException
- if the array is not a well-defined
conversion.public ColorConvertOp(RenderingHints hints)
hints
- Rendering hints to use in conversion, if any (may be null).Method Detail |
---|
public final BufferedImage filter(BufferedImage src, BufferedImage dst)
filter
in interface BufferedImageOp
src
- The source image.dst
- The destination image.
IllegalArgumentException
- if the rasters and/or color spaces are
incompatible.public final WritableRaster filter(Raster src, WritableRaster dest)
filter
in interface RasterOp
src
- The source raster.dest
- The destination raster.
IllegalArgumentException
- if the rasters and/or color spaces are
incompatible.public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM)
createCompatibleDestImage
in interface BufferedImageOp
src
- The source image.dstCM
- A color model for the destination image (may be null).
IllegalArgumentException
- if an appropriate colormodel cannot be
chosen with the information given.public WritableRaster createCompatibleDestRaster(Raster src)
createCompatibleDestRaster
in interface RasterOp
src
- The source Raster.
IllegalArgumentException
- if there isn't enough colorspace
information to create a compatible Raster.public final ICC_Profile[] getICC_Profiles()
public final RenderingHints getRenderingHints()
getRenderingHints
in interface BufferedImageOp
getRenderingHints
in interface RasterOp
public final Point2D getPoint2D(Point2D src, Point2D dst)
getPoint2D
in interface BufferedImageOp
getPoint2D
in interface RasterOp
src
- The source point.dst
- The transformed destination point.
public final Rectangle2D getBounds2D(BufferedImage src)
getBounds2D
in interface BufferedImageOp
src
- The source boundary.
public final Rectangle2D getBounds2D(Raster src)
getBounds2D
in interface RasterOp
src
- The source boundary.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |