visual.statik.sampled
Class IdentityOp

java.lang.Object
  extended by visual.statik.sampled.IdentityOp
All Implemented Interfaces:
java.awt.image.BufferedImageOp
Direct Known Subclasses:
GrayExceptOp

public class IdentityOp
extends java.lang.Object
implements java.awt.image.BufferedImageOp

A BufferedImageOp that returns (a copy of) the source image unchanged. This class is unlikely to be used directly. However, it is convenient to extend this class when implementing other operations. In such cases, it is often only necessary to override the filter() method.

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Constructor Summary
IdentityOp()
           
 
Method Summary
 java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage src, java.awt.image.ColorModel dstCM)
          Creates a zeroed destination image with the correct size and number of bands (required by BufferedImageOp)
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
          In general, performs a single-input/single-output operation on a BufferedImage (required by BufferedImageOp).
 java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage src)
          Returns the bounding box of the filtered destination image (required by BufferedImageOp)
 java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)
          Returns the location of the corresponding destination point given a point in the source image (required by BufferedImageOp).
 java.awt.RenderingHints getRenderingHints()
          Return the rendering hints for this operation (required by BufferedImageOp).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityOp

public IdentityOp()
Method Detail

createCompatibleDestImage

public java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage src,
                                                              java.awt.image.ColorModel dstCM)
Creates a zeroed destination image with the correct size and number of bands (required by BufferedImageOp)

Specified by:
createCompatibleDestImage in interface java.awt.image.BufferedImageOp
Parameters:
src - The source image
dstCM - The ColorModel to be used in the created image

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src,
                                           java.awt.image.BufferedImage dst)
In general, performs a single-input/single-output operation on a BufferedImage (required by BufferedImageOp). If the destination image is null, a BufferedImage with an appropriate ColorModel is created. In this case, this method simply "returns" a (copy of) the source.

Specified by:
filter in interface java.awt.image.BufferedImageOp
Parameters:
src - The source image
dst - An empty image in which to srote the result (or null)

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage src)
Returns the bounding box of the filtered destination image (required by BufferedImageOp)

Specified by:
getBounds2D in interface java.awt.image.BufferedImageOp
Parameters:
src - The source image

getPoint2D

public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D srcPt,
                                        java.awt.geom.Point2D dstPt)
Returns the location of the corresponding destination point given a point in the source image (required by BufferedImageOp). If dstPt is specified, it is used to hold the return value.

Specified by:
getPoint2D in interface java.awt.image.BufferedImageOp
Parameters:
srcPt - The point in the source image
dstPt - The point in the destination image

getRenderingHints

public java.awt.RenderingHints getRenderingHints()
Return the rendering hints for this operation (required by BufferedImageOp). In this case, this method always returns null.

Specified by:
getRenderingHints in interface java.awt.image.BufferedImageOp


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers