|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.pearsoneduc.ip.op.StandardGreyOp | +--com.pearsoneduc.ip.op.NeighbourhoodOp
Adds support for neighbourhood operations to StandardGreyOp.
This class supplies instance variables to represent neighbourhood dimensions and provides support for processing at the borders of an image. No actual processing is carried out. Subclasses must override the filter() method inherited from StandardGreyOp in order to do anything useful.
Four possible strategies are supported for border processing:
Copying of data is supported by the protected
Field Summary | |
protected int |
borderStrategy
Strategy to use when dealing with image borders. |
static int |
CIRCULAR_INDEXING
Indicates that invalid coordinates wrap around the image. |
static int |
COPY_BORDER_PIXELS
Indicates that border pixels are to be copied from source image. |
protected int |
height
Height of neighbourhood. |
static int |
NO_BORDER_OP
Indicates that no processing of borders is to be done. |
static int |
REFLECTED_INDEXING
Indicates that invalid coordinates are reflected into the image. |
protected int |
size
Number of pixels in neighbourhood. |
protected int |
width
Width of neighbourhood. |
Constructor Summary | |
NeighbourhoodOp(int w,
int h,
int strategy)
Constructs a NeighbourhoodOp with the given dimensions and border processing strategy. |
Method Summary | |
static int |
circIndex(int i,
int n)
Wraps an invalid coordinate around to the other side of an image. |
protected void |
copyBorders(java.awt.image.Raster src,
java.awt.image.WritableRaster dest)
Copies border pixels that cannot normally be processed by a neighbourhood operation from one raster to another. |
int |
getBorderStrategy()
|
int |
getHeight()
|
int |
getNumPixels()
|
int |
getWidth()
|
static int |
refIndex(int i,
int n)
Reflects an invalid coordinate back into an image. |
Methods inherited from class com.pearsoneduc.ip.op.StandardGreyOp |
checkImage,
createCompatibleDestImage,
filter,
getBounds2D,
getPoint2D,
getRenderingHints |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int NO_BORDER_OP
public static final int COPY_BORDER_PIXELS
public static final int REFLECTED_INDEXING
public static final int CIRCULAR_INDEXING
protected int width
protected int height
protected int size
protected int borderStrategy
Constructor Detail |
public NeighbourhoodOp(int w, int h, int strategy)
w
- width of neighbourhoodh
- height of neighbourhoodstrategy
- border processing strategyMethod Detail |
public int getWidth()
public int getHeight()
public int getNumPixels()
public int getBorderStrategy()
public static final int refIndex(int i, int n)
i
- coordinate, possibly out of boundsn
- appropriate dimension of image (width or height)public static final int circIndex(int i, int n)
i
- coordinate, possibly out of bounds.n
- appropriate dimension of image (width or height)protected void copyBorders(java.awt.image.Raster src, java.awt.image.WritableRaster dest)
src
- source of pixel datadest
- destination for pixel data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |