javax.media.jai.operator
Class MatchCDFDescriptor

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

public class MatchCDFDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "MatchCDF" operation.

The "MatchCDF" operation performs a piecewise linear mapping of the pixel values of an image such that the Cumulative Distribution Function (CDF) of the destination image matches as closely as possible a specified Cumulative Distribution Function. The desired CDF is described by an array of the form

float CDF[numBands][numBins[b]]
where
numBins[b]
denotes the number of bins in the histogram of the source image for band b. Each element in the array
CDF[b]
must be non-negative, the array must represent a non- decreasing sequence, and the last element of the array must be 1.0F. The source image must have a Histogram object available via its getProperty() method.

Resource List
Name Value
GlobalName MatchCDF
LocalName MatchCDF
Vendor com.sun.media.jai
Description Matches pixel values to a supplied CDF.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/MatchCDFDescriptor.html
Version 1.0
arg0Desc The desired Cumulative Distribution Function.

Parameter List
Name Class Type Default Value
CDF float[][] CDF for histogram equalization

See Also:
DataBuffer, ImageLayout, OperationDescriptor, Serialized Form

Field Summary
 
Fields inherited from class javax.media.jai.OperationDescriptorImpl
sourceNames
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
MatchCDFDescriptor()
          Constructor.
 
Method Summary
static RenderedOp create(RenderedImage source0, float[][] CDF, RenderingHints hints)
          Matches pixel values to a supplied CDF.
static RenderableOp createRenderable(RenderableImage source0, float[][] CDF, RenderingHints hints)
          Matches pixel values to a supplied CDF.
 boolean validateArguments(String modeName, ParameterBlock args, StringBuffer msg)
          Validates the input sources and parameter.
 
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, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchCDFDescriptor

public MatchCDFDescriptor()
Constructor.

Method Detail

validateArguments

public boolean validateArguments(String modeName,
                                 ParameterBlock args,
                                 StringBuffer msg)
Validates the input sources and parameter.

In addition to the standard checks performed by the superclass method, this method checks that the source image contains a "histogram" property and that the "CDF" array is appropriate for it.

Specified by:
validateArguments in interface OperationDescriptor
Overrides:
validateArguments in class OperationDescriptorImpl
Parameters:
modeName - the operation mode name
args - Input arguments, including source(s) and/or parameter(s).
msg - A string that may contain error messages.
See Also:
OperationDescriptorImpl.validateSources(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer), OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)

create

public static RenderedOp create(RenderedImage source0,
                                float[][] CDF,
                                RenderingHints hints)
Matches pixel values to a supplied CDF.

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

Parameters:
source0 - RenderedImage source 0.
CDF - The desired Cumulative Distribution Function. 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

createRenderable

public static RenderableOp createRenderable(RenderableImage source0,
                                            float[][] CDF,
                                            RenderingHints hints)
Matches pixel values to a supplied CDF.

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

Parameters:
source0 - RenderableImage source 0.
CDF - The desired Cumulative Distribution Function. May be null.
hints - The RenderingHints to use. May be null.
Returns:
The RenderableOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderableOp