com.pearsoneduc.ip.op
Class StandardGreyOp
java.lang.Object
|
+--com.pearsoneduc.ip.op.StandardGreyOp
- Direct Known Subclasses:
- BinaryMorphologicalOp, ButterworthLowPassOp, CannyEdgeOp, GreyCloseOp, GreyDilateOp, GreyErodeOp, GreyMapOp, GreyOpenOp, NeighbourhoodOp, RegionLabelOp, SobelEdgeOp
- public class StandardGreyOp
- extends java.lang.Object
- implements java.awt.image.BufferedImageOp
Implements a BufferedImageOp for standard operations on 8-bit
greyscale images. Subclasses should override the
filter() method
to carry out processing.
- Version:
- 1.1 [1999/07/23]
- Author:
- Nick Efford
Method Summary |
void |
checkImage(java.awt.image.BufferedImage src)
Tests that source image is suitable for processing. |
java.awt.image.BufferedImage |
createCompatibleDestImage(java.awt.image.BufferedImage src,
java.awt.image.ColorModel destModel)
Creates a zeroed destination image with the same dimensions
and number of bands as the source image. |
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dest)
Performs an operation on an image. |
java.awt.geom.Rectangle2D |
getBounds2D(java.awt.image.BufferedImage src)
Determines bounding box of the destination image. |
java.awt.geom.Point2D |
getPoint2D(java.awt.geom.Point2D srcPoint,
java.awt.geom.Point2D destPoint)
Given a point in the source image, determines the corresponding
point in the destination image. |
java.awt.RenderingHints |
getRenderingHints()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
StandardGreyOp
public StandardGreyOp()
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dest)
- Performs an operation on an image. Here, the operation is a
simple copy of source to destination. Subclasses must override
this method to produce more interesting behaviour.
- Specified by:
- filter in interface java.awt.image.BufferedImageOp
- Parameters:
src
- source imagedest
- destination image, or null- Returns:
- destination image.
createCompatibleDestImage
public java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage src,
java.awt.image.ColorModel destModel)
- Creates a zeroed destination image with the same dimensions
and number of bands as the source image.
- Specified by:
- createCompatibleDestImage in interface java.awt.image.BufferedImageOp
- Parameters:
src
- source imagedestModel
- ColorModel of the destination image
(if null, ColorModel of the source image will be used)
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage src)
- Determines bounding box of the destination image. Here, it is
assumed that this is identical to that of the source image.
- Specified by:
- getBounds2D in interface java.awt.image.BufferedImageOp
- Parameters:
src
- source image- Returns:
- bounding box of the destination image.
getPoint2D
public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D srcPoint,
java.awt.geom.Point2D destPoint)
- Given a point in the source image, determines the corresponding
point in the destination image. Here, it is assumed that this
will be the same as the point in the source image.
- Specified by:
- getPoint2D in interface java.awt.image.BufferedImageOp
- Parameters:
srcPoint
- a point from the source imagedestPoint
- a point in the destination image, or null- Returns:
- point in the destination image.
getRenderingHints
public java.awt.RenderingHints getRenderingHints()
- Specified by:
- getRenderingHints in interface java.awt.image.BufferedImageOp
- Returns:
- rendering hints for this operation.
checkImage
public void checkImage(java.awt.image.BufferedImage src)
- Tests that source image is suitable for processing.
- Parameters:
src
- source image- Throws:
- ImagingOpException - if the source image is not an
8-bit greyscale image.