java.awt.image
public class LookupOp extends Object implements BufferedImageOp, RasterOp
Constructor and Description |
---|
LookupOp(LookupTable lookup,
RenderingHints hints)
Construct a new LookupOp using the given LookupTable.
|
Modifier and Type | Method and Description |
---|---|
BufferedImage |
createCompatibleDestImage(BufferedImage src,
ColorModel dstCM)
Returns a new
BufferedImage that can be used by this
BufferedImageOp as the destination image when filtering
the specified source image. |
WritableRaster |
createCompatibleDestRaster(Raster src)
Returns a raster that can be used by this
RasterOp as the
destination raster when operating on the specified source raster. |
BufferedImage |
filter(BufferedImage src,
BufferedImage dst)
Converts the source image using the lookup table specified in the
constructor.
|
WritableRaster |
filter(Raster src,
WritableRaster dest)
Filter a raster through a lookup table.
|
Rectangle2D |
getBounds2D(BufferedImage src)
Returns the bounds of the destination image on the basis of this
BufferedImageOp being applied to the specified source image. |
Rectangle2D |
getBounds2D(Raster src)
Returns the bounds of the destination raster on the basis of this
RasterOp being applied to the specified source raster. |
Point2D |
getPoint2D(Point2D src,
Point2D dst)
Returns the corresponding destination point for a given source point.
|
RenderingHints |
getRenderingHints()
Returns the rendering hints for this operation.
|
LookupTable |
getTable()
Return the LookupTable for this op.
|
public LookupOp(LookupTable lookup, RenderingHints hints)
lookup
- LookupTable to use.hints
- Rendering hints (can be null).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.ArrayIndexOutOfBoundsException
- if a pixel in the source is not
contained in the LookupTable.public final Rectangle2D getBounds2D(BufferedImage src)
BufferedImageOp
BufferedImageOp
being applied to the specified source image.getBounds2D
in interface BufferedImageOp
src
- the source image.public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM)
BufferedImageOp
BufferedImage
that can be used by this
BufferedImageOp
as the destination image when filtering
the specified source image.createCompatibleDestImage
in interface BufferedImageOp
src
- the source image.dstCM
- the color model for the destination image.public final Point2D getPoint2D(Point2D src, Point2D dst)
getPoint2D
in interface BufferedImageOp
getPoint2D
in interface RasterOp
src
- The source point.dst
- The destination point.public final LookupTable getTable()
public final RenderingHints getRenderingHints()
BufferedImageOp
getRenderingHints
in interface BufferedImageOp
getRenderingHints
in interface RasterOp
public final WritableRaster filter(Raster src, WritableRaster dest)
filter
in interface RasterOp
src
- The source raster.dest
- The destination raster.IllegalArgumentException
- if lookup table has more than one
component but not the same as src and dest.ArrayIndexOutOfBoundsException
- if a pixel in the source is not
contained in the LookupTable.public final Rectangle2D getBounds2D(Raster src)
RasterOp
RasterOp
being applied to the specified source raster.getBounds2D
in interface RasterOp
src
- the source raster.public WritableRaster createCompatibleDestRaster(Raster src)
RasterOp
RasterOp
as the
destination raster when operating on the specified source raster.createCompatibleDestRaster
in interface RasterOp
src
- the source raster.