is new.
java.lang.Objectjava.awt.image.AffineTransformOp
This class uses an affine transform to perform a linear mapping from 2D coordinates in the source image or Raster to 2D coordinates in the destination image or Raster. The type of interpolation that is used is specified through a constructor, either by a RenderingHints object or by one of the integer interpolation types defined in this class.
If a RenderingHints object is specified in the constructor, the interpolation hint and the rendering quality hint are used to set the interpolation type for this operation. The color rendering hint and the dithering hint can be used when color conversion is required.
Note that the following constraints have to be met:
| Field Summary | |
|---|---|
static int
|
TYPE_BICUBIC
Bicubic interpolation type.
|
| static int |
TYPE_BILINEAR
Bilinear interpolation type. |
| static int |
TYPE_NEAREST_NEIGHBOR
Nearest-neighbor interpolation type. |
| Constructor Summary | |
|---|---|
|
AffineTransformOp
(
AffineTransform
xform, int interpolationType) Constructs an AffineTransformOp given an affine transform and the interpolation type. |
|
|
AffineTransformOp
(
AffineTransform
xform,
RenderingHints
hints) Constructs an AffineTransformOp given an affine transform. |
|
| Method Summary | |
|---|---|
| BufferedImage |
createCompatibleDestImage
(
BufferedImage
src,
ColorModel
destCM) Creates a zeroed destination image with the correct size and number of bands. |
| WritableRaster |
createCompatibleDestRaster
(
Raster
src) Creates a zeroed destination Raster with the correct size and number of bands. |
| BufferedImage |
filter
(
BufferedImage
src,
BufferedImage
dst) Transforms the source BufferedImage and stores the results in the destination BufferedImage. |
| WritableRaster |
filter
(
Raster
src,
WritableRaster
dst) Transforms the source Raster and stores the results in the destination Raster. |
| Rectangle2D |
getBounds2D
(
BufferedImage
src) Returns the bounding box of the transformed destination. |
| Rectangle2D |
getBounds2D
(
Raster
src) Returns the bounding box of the transformed destination. |
| int |
getInterpolationType
() Returns the interpolation type used by this op. |
| Point2D |
getPoint2D
(
Point2D
srcPt,
Point2D
dstPt) Returns the location of the corresponding destination point given a point in the source. |
| RenderingHints |
getRenderingHints
() Returns the rendering hints used by this transform operation. |
| AffineTransform |
getTransform
() Returns the affine transform used by this transform operation. |
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| Field Detail |
|---|
public static final int TYPE_NEAREST_NEIGHBOR
public static final int TYPE_BILINEAR
TYPE_BICUBIC
public static final int
TYPE_BICUBIC
Bicubic interpolation type.
See Also:
Constant Field Values
| Constructor Detail |
|---|
public AffineTransformOp(AffineTransform xform,
RenderingHints hints)
public AffineTransformOp(AffineTransform xform,
int interpolationType)
,
TYPE_BICUBIC
.| Method Detail |
|---|
public final int getInterpolationType()
,
TYPE_BICUBIC
public final BufferedImage filter(BufferedImage src,
BufferedImage dst)
The coordinates of the rectangle returned by getBounds2D(BufferedImage) are not necessarily the same as the coordinates of the BufferedImage returned by this method. If the upper-left corner coordinates of the rectangle are negative then this part of the rectangle is not drawn. If the upper-left corner coordinates of the rectangle are positive then the filtered image is drawn at that position in the destination BufferedImage.
An IllegalArgumentException is thrown if the source is the same as the destination.
public final WritableRaster filter(Raster src,
WritableRaster dst)
If the destination Raster is null, a new Raster is created. An IllegalArgumentException may be thrown if the source is the same as the destination or if the number of bands in the source is not equal to the number of bands in the destination.
The coordinates of the rectangle returned by getBounds2D(Raster) are not necessarily the same as the coordinates of the WritableRaster returned by this method. If the upper-left corner coordinates of rectangle are negative then this part of the rectangle is not drawn. If the coordinates of the rectangle are positive then the filtered image is drawn at that position in the destination Raster.
public final Rectangle2D getBounds2D(BufferedImage src)
public final Rectangle2D getBounds2D(Raster src)
public BufferedImage createCompatibleDestImage(BufferedImage src,
ColorModel destCM)
If destCM is null, an appropriate ColorModel is used; this ColorModel may have an alpha channel even if the source ColorModel is opaque.
public WritableRaster createCompatibleDestRaster(Raster src)
public final Point2D getPoint2D(Point2D srcPt,
Point2D dstPt)
public final AffineTransform getTransform()
public final RenderingHints getRenderingHints()