public class AffineTransformOp extends Object implements BufferedImageOp, RasterOp
| Modifier and Type | Field and Description |
|---|---|
static int |
TYPE_BICUBIC |
static int |
TYPE_BILINEAR |
static int |
TYPE_NEAREST_NEIGHBOR |
| Constructor and Description |
|---|
AffineTransformOp(AffineTransform xform,
int interpolationType)
Construct AffineTransformOp with the given xform and interpolationType.
|
AffineTransformOp(AffineTransform xform,
RenderingHints hints)
Construct AffineTransformOp with the given xform and rendering hints.
|
| Modifier and Type | Method and Description |
|---|---|
BufferedImage |
createCompatibleDestImage(BufferedImage src,
ColorModel destCM)
Creates a new BufferedImage with the size equal to that of the
transformed image and the correct number of bands.
|
WritableRaster |
createCompatibleDestRaster(Raster src)
Creates a new WritableRaster with the size equal to the transformed
source raster and correct number of bands .
|
BufferedImage |
filter(BufferedImage src,
BufferedImage dst)
Transforms source image using transform specified at the constructor.
|
WritableRaster |
filter(Raster src,
WritableRaster dst)
Transforms source raster using transform specified at the constructor.
|
Rectangle2D |
getBounds2D(BufferedImage src)
Transforms source image using transform specified at the constructor and
returns bounds of the transformed image.
|
Rectangle2D |
getBounds2D(Raster src)
Returns bounds of the transformed raster.
|
int |
getInterpolationType()
Returns interpolation type used during transformations.
|
Point2D |
getPoint2D(Point2D srcPt,
Point2D dstPt)
Returns location of the transformed source point.
|
RenderingHints |
getRenderingHints()
Returns rendering hints that are used during transformation.
|
AffineTransform |
getTransform()
Returns transform used in transformation between source and destination
image.
|
public static final int TYPE_NEAREST_NEIGHBOR
public static final int TYPE_BILINEAR
public static final int TYPE_BICUBIC
public AffineTransformOp(AffineTransform xform, int interpolationType)
xform - AffineTransform that will applied to the source imageinterpolationType - type of interpolation usedImagingOpException - if the transform matrix is noninvertiblepublic AffineTransformOp(AffineTransform xform, RenderingHints hints)
xform - AffineTransform that will applied to the source imagehints - rendering hints that will be used during transformationImagingOpException - if the transform matrix is noninvertiblepublic BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM)
createCompatibleDestImage in interface BufferedImageOpsrc - the source image.destCM - color model for the destination image (can be null).public WritableRaster createCompatibleDestRaster(Raster src)
createCompatibleDestRaster in interface RasterOpsrc - the source raster.RasterFormatException - if resulting width or height of raster is 0.public final BufferedImage filter(BufferedImage src, BufferedImage dst)
filter in interface BufferedImageOpsrc - source imagedst - destination imageIllegalArgumentException - if the source and destination image are
the samepublic final WritableRaster filter(Raster src, WritableRaster dst)
filter in interface RasterOpsrc - source rasterdst - destination rasterIllegalArgumentException - if the source and destination are not
compatiblepublic final Rectangle2D getBounds2D(BufferedImage src)
getBounds2D in interface BufferedImageOpsrc - image to be transformedpublic final Rectangle2D getBounds2D(Raster src)
getBounds2D in interface RasterOpsrc - raster to be transformedpublic final int getInterpolationType()
public final Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
getPoint2D in interface BufferedImageOpgetPoint2D in interface RasterOpsrcPt - point to be transformeddstPt - destination pointpublic final RenderingHints getRenderingHints()
getRenderingHints in interface BufferedImageOpgetRenderingHints in interface RasterOppublic final AffineTransform getTransform()