javax.media.jai.operator
Class MinFilterDescriptor

java.lang.Object
  extended byjavax.media.jai.OperationDescriptorImpl
      extended byjavax.media.jai.operator.MinFilterDescriptor
All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class MinFilterDescriptor
extends OperationDescriptorImpl

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.

Resource List
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.

Parameter List
Name Class Type Default Value
maskShape javax.media.jai.operator.MinFilterShape MIN_MASK_SQUARE
maskSize java.lang.Integer 3

Since:
JAI 1.1
See Also:
OperationDescriptor, MinFilterShape, Serialized Form

Field 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
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 javax.media.jai.OperationDescriptorImpl
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getInvalidRegion, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamNames, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isImmediate, isModeSupported, isRenderableSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateArguments, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_MASK_SQUARE

public static final MinFilterShape MIN_MASK_SQUARE
Square shaped mask.


MIN_MASK_PLUS

public static final MinFilterShape MIN_MASK_PLUS
Plus shaped mask.


MIN_MASK_X

public static final MinFilterShape MIN_MASK_X
X shaped mask.


MIN_MASK_SQUARE_SEPARABLE

public static final MinFilterShape MIN_MASK_SQUARE_SEPARABLE
Separable square mask.

Constructor Detail

MinFilterDescriptor

public MinFilterDescriptor()
Constructor for the MinFilterDescriptor.

Method Detail

getParamMinValue

public Number getParamMinValue(int index)
Returns the minimum legal value of a specified numeric parameter for this operation.

Specified by:
getParamMinValue in interface OperationDescriptor
Overrides:
getParamMinValue in class OperationDescriptorImpl
Parameters:
index - The index of the parameter to be queried.
Returns:
A Number representing the minimum legal value, or null if the specified parameter is not numeric.
See Also:
ParameterListDescriptor.getParamValueRange(java.lang.String), ParameterListDescriptor.getEnumeratedParameterValues(java.lang.String), ParameterListDescriptor.isParameterValueValid(java.lang.String, java.lang.Object)

getParamMaxValue

public Number getParamMaxValue(int index)
Returns the maximum legal value of a specified numeric parameter for this operation.

Specified by:
getParamMaxValue in interface OperationDescriptor
Overrides:
getParamMaxValue in class OperationDescriptorImpl
Parameters:
index - The index of the parameter to be queried.
Returns:
A Number representing the maximum legal value, or null if the specified parameter is not numeric.
See Also:
ParameterListDescriptor.getParamValueRange(java.lang.String), ParameterListDescriptor.getEnumeratedParameterValues(java.lang.String), ParameterListDescriptor.isParameterValueValid(java.lang.String, java.lang.Object)

getPropertyGenerators

public PropertyGenerator[] getPropertyGenerators()
Returns an array of PropertyGenerators implementing property inheritance for the "MinFilter" operation.

Specified by:
getPropertyGenerators in interface OperationDescriptor
Overrides:
getPropertyGenerators in class OperationDescriptorImpl
Returns:
An array of property generators.
See Also:
OperationDescriptorImpl.getPropertyGenerators(java.lang.String)

create

public static RenderedOp create(RenderedImage source0,
                                MinFilterShape maskShape,
                                Integer maskSize,
                                RenderingHints hints)
Performs min filtering on an image.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
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.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp