| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectnet.sourceforge.jiu.ops.Operationnet.sourceforge.jiu.ops.ImageToImageOperationnet.sourceforge.jiu.color.reduction.ReduceToBilevelThresholdpublic class ReduceToBilevelThresholdextends ImageToImageOperationGrayIntegerImage to a
BilevelImage by setting all values below
a certain threshold value to black and everything else to white.
setThreshold(int), this operation
uses a default value of (IntegerImage.getMaxSample(int) + 1) / 2.
GrayIntegerImage image = ...; ReduceToBilevelThreshold red = new ReduceToBilevelThreshold(); red.setInputImage(image); red.setThreshold(image.getMaxSample(0) / 3); red.process(); BilevelImage reducedImage= (BilevelImage)red.getOutputImage();
Field Summary | |
private Integer | |
Fields inherited from class net.sourceforge.jiu.ops.ImageToImageOperation | |
canInAndOutBeEqual, inputImage, outputImage | |
Fields inherited from class net.sourceforge.jiu.ops.Operation | |
abort, progressListeners | |
Method Summary | |
Integer |
|
void |
|
private void |
|
void |
|
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, process, removeProgressListener, setAbort, setProgress, setProgress | |
public Integer getThreshold()
Returns the current threshold value, ornullif none was specified and the operation's process method was not run yet.
- Returns:
- threshold value
public void process()
throws MissingParameterException,
WrongParameterExceptionThis method does the actual work of the operation. It must be called after all parameters have been given to the operation object.
- Throws:
WrongParameterException- if at least one of the input parameters was not initialized appropriately (values out of the valid interval, etc.)MissingParameterException- if any mandatory parameter was not given to the operation
public void setThreshold(int newThreshold)
Sets a new threshold value.
- Parameters:
newThreshold- the new threshold value to be used for this operation