javax.media.jai.operator
Class BinarizeDescriptor
java.lang.Object
|
+--javax.media.jai.OperationDescriptorImpl
|
+--javax.media.jai.operator.BinarizeDescriptor
- All Implemented Interfaces:
- OperationDescriptor, RegistryElementDescriptor, Serializable
- public class BinarizeDescriptor
- extends OperationDescriptorImpl
An OperationDescriptor
describing the "Binarize" operation.
The "Binarize" operation takes one rendered or renderable single-banded
source image and a threshold value and applies a thresholding operation to
the produce a bilevel image.
By default the destination image bounds are equal to those of the
source image. The SampleModel
of the destination image is
an instance of MultiPixelPackedSampleModel
.
The pseudocode for "Binarize" is as follows:
dst(x, y) = src(x, y) >= threshold ? 1 : 0;
Resource List
Name | Value |
GlobalName | Binarize |
LocalName | Binarize |
Vendor | com.sun.media.jai |
Description | Thresholds an image into a bilevel image. | |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/BinarizeDescriptor.html |
Version | 1.1 |
arg0Desc | The threshold value. |
Parameter List
Name | Class Type |
Default Value |
threshold | java.lang.Double |
NO_PARAMETER_DEFAULT |
- Since:
- JAI 1.1
- See Also:
OperationDescriptor
, Serialized Form
Methods inherited from class javax.media.jai.OperationDescriptorImpl |
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getInvalidRegion, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamMaxValue, getParamMinValue, getParamNames, getPropertyGenerators, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isImmediate, isModeSupported, isRenderableSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateArguments, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BinarizeDescriptor
public BinarizeDescriptor()
- Constructor.
validateSources
protected boolean validateSources(String modeName,
ParameterBlock args,
StringBuffer msg)
- Validates the input source.
In addition to the standard checks performed by the
superclass method, this method checks that the source image
is single-banded.
- Overrides:
validateSources
in class OperationDescriptorImpl
- Following copied from class:
javax.media.jai.OperationDescriptorImpl
- Parameters:
modeName
- the operation mode nameargs
- a ParameterBlock
that has the sourcesmsg
- A string that may contain error messages.- Throws:
IllegalArgumentException
- if any of the input parameters are null
.- See Also:
OperationDescriptorImpl.validateArguments(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
create
public static RenderedOp create(RenderedImage source0,
Double threshold,
RenderingHints hints)
- Binarize an image from a threshold value.
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
- Parameters:
source0
- RenderedImage
source 0.threshold
- Argment must be of type java.lang.Double.hints
- The RenderingHints
to use.
May be null
.- Returns:
- The
RenderedOp
destination. - Throws:
IllegalArgumentException
- if source0
is null
.IllegalArgumentException
- if threshold
is null
.- See Also:
JAI
,
ParameterBlockJAI
,
RenderedOp
createRenderable
public static RenderableOp createRenderable(RenderableImage source0,
Double threshold,
RenderingHints hints)
- Binarize an image from a threshold value.
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.createRenderable(String,ParameterBlock,RenderingHints)
.
- Parameters:
source0
- RenderableImage
source 0.threshold
- Argment must be of type java.lang.Double.hints
- The RenderingHints
to use.
May be null
.- Returns:
- The
RenderableOp
destination. - Throws:
IllegalArgumentException
- if source0
is null
.IllegalArgumentException
- if threshold
is null
.- See Also:
JAI
,
ParameterBlockJAI
,
RenderableOp