|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.OperationDescriptorImpl | +--javax.media.jai.operator.MinFilterDescriptor
An OperationDescriptor
describing the "MinFilter" operation.
The "MinFilter" operation is a non-linear filter which is useful for removing isolated lines or pixels while preserving the overall appearance of an image. The filter is implemented by moving a mask over the image. For each position of the mask, the center pixel is replaced by the min of the pixel values covered by the mask.
There are several shapes possible for the mask. The MinFilter operation supports three shapes, as follows:
Square Mask:
x x x x x x x x x
Plus Mask:
x x x x x
X Mask:
x x x x x
Example:
SeekableStream s = new FileSeekableStream(new File(imagefilename); ParameterBlock pb = new ParameterBlock(); pb.add(s); RenderedImage src = (RenderedImage)JAI.create("stream", pb); pb = new ParameterBlock(); pb.addSource(src); pb.add(MaxFilterDescriptor.MIN_MASK_PLUS); // mask Type pb.add(new Integer(5)); // mask size RenderedImage dst = (RenderedImage)JAI.create("minfilter", pb);
A RenderingHints can also be added to the above.
It should be noted that this operation automatically adds a
value of Boolean.TRUE
for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
to the given
configuration
so that the operation is performed
on the pixel values instead of being performed on the indices into
the color map if the source(s) have an IndexColorModel
.
This addition will take place only if a value for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
has not already been
provided by the user. Note that the configuration
Map
is cloned before the new hint is added to it. The operation can be
smart about the value of the JAI.KEY_REPLACE_INDEX_COLOR_MODEL
RenderingHints
, i.e. while the default value for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
is
Boolean.TRUE
, in some cases the operator could set the
default.
Name | Value |
---|---|
GlobalName | MinFilter |
LocallName | MinFilter |
Vendor | com.sun.media.jai |
Description | Performs min filtering on an image. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jaiapi/javax.media.jai.operator.MinFilterDescriptor.html |
Version | 1.0 |
arg0Desc | The shape of the mask to be used for Min Filtering. |
arg1Desc | The size (width/height) of the mask to be used in Min Filtering. |
Name | Class Type | Default Value |
---|---|---|
maskShape | javax.media.jai.operator.MinFilterShape | MIN_MASK_SQUARE |
maskSize | java.lang.Integer | 3 |
OperationDescriptor
,
MinFilterShape
, Serialized FormField Summary | |
static MinFilterShape |
MIN_MASK_PLUS
Plus shaped mask. |
static MinFilterShape |
MIN_MASK_SQUARE
Square shaped mask. |
static MinFilterShape |
MIN_MASK_SQUARE_SEPARABLE
Separable square mask. |
static MinFilterShape |
MIN_MASK_X
X shaped mask. |
Fields inherited from class javax.media.jai.OperationDescriptorImpl |
resources, sourceNames, supportedModes |
Fields inherited from interface javax.media.jai.OperationDescriptor |
NO_PARAMETER_DEFAULT |
Constructor Summary | |
MinFilterDescriptor()
Constructor for the MinFilterDescriptor. |
Method Summary | |
static RenderedOp |
create(RenderedImage source0,
MinFilterShape maskShape,
Integer maskSize,
RenderingHints hints)
Performs min filtering on an image. |
Number |
getParamMaxValue(int index)
Returns the maximum legal value of a specified numeric parameter for this operation. |
Number |
getParamMinValue(int index)
Returns the minimum legal value of a specified numeric parameter for this operation. |
PropertyGenerator[] |
getPropertyGenerators()
Returns an array of PropertyGenerators implementing
property inheritance for the "MinFilter" operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final MinFilterShape MIN_MASK_SQUARE
public static final MinFilterShape MIN_MASK_PLUS
public static final MinFilterShape MIN_MASK_X
public static final MinFilterShape MIN_MASK_SQUARE_SEPARABLE
Constructor Detail |
public MinFilterDescriptor()
Method Detail |
public Number getParamMinValue(int index)
getParamMinValue
in class OperationDescriptorImpl
javax.media.jai.OperationDescriptorImpl
index
- The index of the parameter to be queried.Number
representing the minimum legal value,
or null
if the specified parameter is not
numeric.IllegalArgumentException
- if this operation has no parameters.ArrayIndexOutOfBoundsException
- if there is no parameter
corresponding to the specified index
.ParameterListDescriptor.getParamValueRange(java.lang.String)
,
ParameterListDescriptor.getEnumeratedParameterValues(java.lang.String)
,
ParameterListDescriptor.isParameterValueValid(java.lang.String, java.lang.Object)
public Number getParamMaxValue(int index)
getParamMaxValue
in class OperationDescriptorImpl
javax.media.jai.OperationDescriptorImpl
index
- The index of the parameter to be queried.Number
representing the maximum legal value,
or null
if the specified parameter is not
numeric.IllegalArgumentException
- if this operation has no parameters.ArrayIndexOutOfBoundsException
- if there is no parameter
corresponding to the specified index
.ParameterListDescriptor.getParamValueRange(java.lang.String)
,
ParameterListDescriptor.getEnumeratedParameterValues(java.lang.String)
,
ParameterListDescriptor.isParameterValueValid(java.lang.String, java.lang.Object)
public PropertyGenerator[] getPropertyGenerators()
PropertyGenerators
implementing
property inheritance for the "MinFilter" operation.getPropertyGenerators
in class OperationDescriptorImpl
public static RenderedOp create(RenderedImage source0, MinFilterShape maskShape, Integer maskSize, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.maskShape
- The shape of the mask to be used for Min Filtering.
May be null
.maskSize
- The size (width/height) of the mask to be used in Min Filtering.
May be null
.hints
- The RenderingHints
to use.
May be null
.RenderedOp
destination.IllegalArgumentException
- if source0
is null
.JAI
,
ParameterBlockJAI
,
RenderedOp
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |