public abstract class AbstractBufferedImageOp
extends java.lang.Object
implements java.awt.image.BufferedImageOp
AbstractBufferedImageOp
provides a basic implementation to
implement the BufferedImageOp
interface. Basically this
abstract class deals with all the intricacies of make the images compatible
with operations on each other.
The most easy use of this class is to simply implement an appropriate
constructor and doFilter(BufferedImage, BufferedImage)
method. Other
methods need not be overwritten unless special needs arise. See the method's
documentations for more information.
Modifier and Type | Method and Description |
---|---|
java.awt.image.BufferedImage |
createCompatibleDestImage(java.awt.image.BufferedImage src,
java.awt.image.ColorModel destCM)
Creates a zeroed destination image with the correct size and number of
bands.
|
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dst)
Performs the operation on a BufferedImage.
|
java.awt.geom.Rectangle2D |
getBounds2D(java.awt.image.BufferedImage src)
Returns the bounding box of the filtered destination image.
|
java.awt.geom.Point2D |
getPoint2D(java.awt.geom.Point2D srcPt,
java.awt.geom.Point2D dstPt)
Returns the location of the destination point given a
point in the source image.
|
java.awt.RenderingHints |
getRenderingHints()
Returns a copy of the rendering hints for this BufferedImageOp.
|
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
doFilter(BufferedImage, BufferedImage)
to do the actual
filtering operation.
If the color models for the two images do not match, a color conversion into the destination color model will be performed. If the destination image is null, a BufferedImage with an appropriate ColorModel will be created.
Note: The dest image might be clipped if it is not big enough to take the complete resized image.
Note: Extensions to this class should not need to overwrite this method.
filter
in interface java.awt.image.BufferedImageOp
src
- The src image to be operated upon.dst
- The dest image into which to place the modified image. This
may be null
in which case a new image with the
correct size will be created.null
) or dest
into which the resized src image has been drawn.java.lang.IllegalArgumentException
- if the dest image is the same as the
src image.java.lang.NullPointerException
- if the src image is null
.public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage src)
The IllegalArgumentException may be thrown if the source image is incompatible with the types of images allowed by the class implementing this filter.
getBounds2D
in interface java.awt.image.BufferedImageOp
public java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage src, java.awt.image.ColorModel destCM)
getBounds2D(BufferedImage)
to decide on the
size of the new image. So this method needs only be overwritten by
extending class, which need more specialized operations than just to
create a new image with the correct size and color model.
The IllegalArgumentException may be thrown if the source image is incompatible with the types of images allowed by the class implementing this filter.
createCompatibleDestImage
in interface java.awt.image.BufferedImageOp
src
- Source image for the filter operation.destCM
- ColorModel of the destination. If null, the
ColorModel of the source will be used.public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)
getPoint2D
in interface java.awt.image.BufferedImageOp
public final java.awt.RenderingHints getRenderingHints()
getRenderingHints
in interface java.awt.image.BufferedImageOp
null
if none are
defined."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"