Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.image.AffineTransformOp

java.lang.Object
    |
    +----java.awt.image.AffineTransformOp
Subclasses:
BilinearAffineTransformOp, NearestNeighborAffineTransformOp

public abstract class AffineTransformOp
extends Object
implements BufferedImageOp, RasterOp
This abstract 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 subclasses define what kind of interpolation will be done when the image is transformed. These subclasses include: BilinearAffineTransformOp and NearestNeighborAffineTransformOp. This class of objects can be passed into a BufferedImageFilter to operate on a BufferedImage within the Image Producer/ Consumer model.

Note that the following constraints have to be met:

  • Source and Destination must be different.
  • For Rasters, the number of Channels in the Source must be equal to the number of Channels in the Destination.

    See Also:
    AffineTransform, BilinearAffineTransformOp, NearestNeighborAffineTransformOp, BufferedImageFilter

    Constructor Summary
     AffineTransformOp(AffineTransform xform)
    Constructs an AffineTransformOp given an affine transform.
     

    Method Summary
    BufferedImage  createCompatibleDestImage(BufferedImage src, ColorModel destCM)
    Creates an empty destination image with the correct size and number of components.
    WritableRaster  createCompatibleDestRaster(Raster src)
    Creates an empty destination Raster with the correct size and number of channels.
    BufferedImage  filter(BufferedImage src, BufferedImage dest)
    Abstract method to transform the BufferedImage.
    WritableRaster  filter(Raster src, WritableRaster dest)
    Abstract method to transform the Raster.
    Rectangle2D  getDestBounds(BufferedImage src)
    Returns the bounding box of the transformed destination.
    Rectangle2D  getDestBounds(Raster src)
    Returns the bounding box of the transformed destination.
    Point2D  getDestPoint(Point2D srcPt, Point2D dstPt)
    Returns the location of the destination point given a point in the source image.
    AffineTransform  getTransform()
    Returns the current transform.
     
    Methods inherited from class java.lang.Object
     clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    AffineTransformOp

    protected AffineTransformOp(AffineTransform xform)
    Constructs an AffineTransformOp given an affine transform.
    Method Detail

    filter

    public abstract BufferedImage filter(BufferedImage src,
                                         BufferedImage dest)
    Abstract method to transform the BufferedImage. 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 will be created with the source ColorModel. The IllegalArgumentException may be thrown if the source is the same as the destination.
    Implements:
    filter in interface BufferedImageOp

    filter

    public abstract WritableRaster filter(Raster src,
                                          WritableRaster dest)
    Abstract method to transform the Raster. This operation will perform the transform channel by channel. If the destination Raster is null, a new Raster will be created. The IllegalArgumentException may be thrown if the source is the same as the destination or if the number of channels in the source is not equal to the number of channels in the destination.
    Implements:
    filter in interface BufferedImageOp

    getDestBounds

    public Rectangle2D getDestBounds(BufferedImage src)
    Returns the bounding box of the transformed destination.
    Implements:
    getDestBounds in interface BufferedImageOp

    getDestBounds

    public Rectangle2D getDestBounds(Raster src)
    Returns the bounding box of the transformed destination.
    Implements:
    getDestBounds in interface BufferedImageOp

    createCompatibleDestImage

    public BufferedImage createCompatibleDestImage(BufferedImage src,
                                                   ColorModel destCM)
    Creates an empty destination image with the correct size and number of components. A RasterFormatException may be thrown if the transformed width or height is less than or equal to 0.
    Implements:
    createCompatibleDestImage in interface BufferedImageOp
    Parameters:
    src - Source image for the filter operation
    destCM - ColorModel of the destination. If null, the ColorModel of the source will be used.

    createCompatibleDestRaster

    public WritableRaster createCompatibleDestRaster(Raster src)
    Creates an empty destination Raster with the correct size and number of channels.
    Implements:
    createCompatibleDestRaster in interface RasterOp

    getDestPoint

    public Point2D getDestPoint(Point2D srcPt,
                                Point2D dstPt)
    Returns the location of the destination point given a point in the source image. If dstPt is non-null, it will be used to hold the return value.
    Implements:
    getDestPoint in interface BufferedImageOp

    getTransform

    public AffineTransform getTransform()
    Returns the current transform.

    Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
    PREV | NEXT SHOW LISTS | HIDE LISTS

    Submit a bug or feature
    Submit comments/suggestions about new javadoc look.
    Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
    Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.