|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.ops.Operation
net.sourceforge.jiu.ops.ImageToImageOperation
net.sourceforge.jiu.filters.AreaFilterOperation
public abstract class AreaFilterOperation
Base class for operations that convert images to images and determine an output sample by doing calculations on the input sample at the same position plus some neighboring samples.
Override computeSample(int[], int)
and the operation will work.
Constructor Summary | |
---|---|
AreaFilterOperation()
|
Method Summary | |
---|---|
void |
checkAreaHeight(int height)
Checks if the argument is a valid area height value. |
void |
checkAreaWidth(int width)
Checks if the argument is a valid area width value. |
abstract int |
computeSample(int[] samples,
int numSamples)
Determine the resulting sample for an array with the source sample and zero or more of its neighbors. |
int |
getAreaHeight()
Returns the current area height. |
int |
getAreaWidth()
Returns the current area width. |
void |
process()
This method does the actual work of the operation. |
void |
setArea(int width,
int height)
Sets the area of the window to be used to determine each pixel's mean to the argument width and height. |
void |
setAreaHeight(int height)
Sets the height of the area of the window to be used to determine each pixel's mean to the argument value. |
void |
setAreaWidth(int width)
Sets the width of the area of the window to be used to determine each pixel's mean to the argument value. |
Methods inherited from class net.sourceforge.jiu.ops.ImageToImageOperation |
---|
canInputAndOutputBeEqual, ensureImagesHaveSameResolution, ensureInputImageIsAvailable, ensureOutputImageResolution, getInputImage, getOutputImage, setCanInputAndOutputBeEqual, setInputImage, setOutputImage |
Methods inherited from class net.sourceforge.jiu.ops.Operation |
---|
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AreaFilterOperation()
Method Detail |
---|
public void checkAreaHeight(int height)
IllegalArgumentException
- if the argument is not validpublic void checkAreaWidth(int width)
IllegalArgumentException
- if the argument is not validpublic abstract int computeSample(int[] samples, int numSamples)
numSamples
samples, which will be stored
starting at offset 0
.
Normally, numSamples
is equal to getAreaWidth()
times getAreaHeight()
.
Near the border of the image you may get less samples.
Example: the top left sample of an image has only three neighbors (east, south-east and south),
so you will only get four samples (three neighbors and the sample itself).
samples
- the array holding the sample(s)numSamples
- number of samples in the array
public int getAreaHeight()
setAreaHeight(int)
public int getAreaWidth()
setAreaWidth(int)
public void process() throws MissingParameterException, WrongParameterException
Operation
process
in class Operation
MissingParameterException
- if any mandatory parameter was not given to the operation
WrongParameterException
- if at least one of the input parameters was
not initialized appropriately (values out of the valid interval, etc.)public void setArea(int width, int height)
width
- width of window, must be 1 or largerheight
- height of window, must be 1 or largersetAreaHeight(int)
,
setAreaWidth(int)
public void setAreaHeight(int height)
height
- height of window, must be odd and 1 or largergetAreaHeight()
,
setArea(int, int)
,
setAreaWidth(int)
public void setAreaWidth(int width)
width
- width of window, must be odd and 1 or largergetAreaWidth()
,
setArea(int, int)
,
setAreaHeight(int)
|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |