| java.lang.Object javax.media.jai.OperationDescriptorImpl javax.media.jai.operator.HistogramDescriptor
HistogramDescriptor | public class HistogramDescriptor extends OperationDescriptorImpl (Code) | | This OperationDescriptor defines the "Histogram"
operation.
A histogram of an image is represented by a list of "bins"
where each bin is the total number of pixel samples of the image
whose values lie within a given range. This data are encapulated
in the javax.media.jai.Histogram object, and may be
retrieved by calling the getProperty method on this
operator with "histogram" as the property name.
At a request for the histogram property, this operator scans
the specific region of the source image, generates the pixel count
data, and returns an instance of the Histogram class
where the data are stored. The source image's pixels are unchanged
by this operator.
The region-of-interest (ROI), within which the pixels are counted,
does not have to be a rectangle. It may be null , in
which case the entire image is scanned to accumulate the histogram.
The set of pixels scanned may be further reduced by specifying
the "xPeriod" and "yPeriod" parameters that represent the sampling
rate along the two axis. These variables may not be less than 1.
If they are not set, the default value of 1 is used so that every
pixel within the ROI is counted.
The three arguments, numBins , lowValue ,
and highValue , define the type of the histogram to be
generated. Please see the Histogram specification for
their detailed descriptions. The three arrays must either have an
array length of 1, in which case the same value is applied to all
bands of the source image, or an array length that equals to the
number of bands of the source image, in which case each value is
applied to its corresponding band. The numBins must
all be greater than 0, and each lowValue must be less
than its corresponding highValue . Note that the default
values of these three parameters are specific to the case wherein
the image data are of type byte . For other image data
types the values of these parameters should be supplied explicitely.
Resource List
Name | Value |
GlobalName | Histogram |
LocalName | Histogram |
Vendor | com.sun.media.jai |
Description | Generates a histogram based on the pixel values
within a specific region of an image. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/HistogramDescriptor.html |
Version | 1.1 |
arg0Desc | The region of the image to be scanned. |
arg1Desc | The horizontal sampling rate;
may not be less than 1. |
arg2Desc | The vertical sampling rate;
may not be less than 1. |
arg3Desc | The number of bins for each band. |
arg4Desc | The lowest inclusive pixel value to be
checked for each band. |
arg5Desc | The highest exclusive pixel value to be
checked for each band. |
Parameter List
Name | Class Type |
Default Value |
roi | javax.media.jai.ROI |
null |
xPeriod | java.lang.Integer |
1 |
yPeriod | java.lang.Integer |
1 |
numBins | int[] |
{256} |
lowValue | double[] |
{0.0} |
highValue | double[] |
{256.0} |
See Also: javax.media.jai.Histogram See Also: javax.media.jai.ROI See Also: javax.media.jai.OperationDescriptor |
Method Summary | |
public static RenderedOp | create(RenderedImage source0, ROI roi, Integer xPeriod, Integer yPeriod, int[] numBins, double[] lowValue, double[] highValue, RenderingHints hints) Generates a histogram based on the pixel values within a specific region of an image.
Creates a ParameterBlockJAI from all
supplied arguments except hints and invokes
JAI.create(StringParameterBlockRenderingHints) .
See Also: JAI See Also: ParameterBlockJAI See Also: RenderedOp Parameters: source0 - RenderedImage source 0. Parameters: roi - The region of the image to be scanned.May be null . Parameters: xPeriod - The horizontal sampling rate; may not be less than 1.May be null . Parameters: yPeriod - The vertical sampling rate; may not be less than 1.May be null . Parameters: numBins - The number of bins for each band.May be null . Parameters: lowValue - The lowest inclusive pixel value to be checked for each band.May be null . Parameters: highValue - The highest exclusive pixel value to be checked for each band.May be null . Parameters: hints - The RenderingHints to use.May be null . | public Number | getParamMinValue(int index) Returns the minimum legal value of a specified numeric parameter
for this operation. | protected boolean | validateParameters(ParameterBlock args, StringBuffer msg) Returns true if this operation is capable of handling
the input parameters. |
HistogramDescriptor | public HistogramDescriptor()(Code) | | Constructor.
|
create | public static RenderedOp create(RenderedImage source0, ROI roi, Integer xPeriod, Integer yPeriod, int[] numBins, double[] lowValue, double[] highValue, RenderingHints hints)(Code) | | Generates a histogram based on the pixel values within a specific region of an image.
Creates a ParameterBlockJAI from all
supplied arguments except hints and invokes
JAI.create(StringParameterBlockRenderingHints) .
See Also: JAI See Also: ParameterBlockJAI See Also: RenderedOp Parameters: source0 - RenderedImage source 0. Parameters: roi - The region of the image to be scanned.May be null . Parameters: xPeriod - The horizontal sampling rate; may not be less than 1.May be null . Parameters: yPeriod - The vertical sampling rate; may not be less than 1.May be null . Parameters: numBins - The number of bins for each band.May be null . Parameters: lowValue - The lowest inclusive pixel value to be checked for each band.May be null . Parameters: highValue - The highest exclusive pixel value to be checked for each band.May be null . Parameters: hints - The RenderingHints to use.May be null . The RenderedOp destination. throws: IllegalArgumentException - if source0 is null . |
getParamMinValue | public Number getParamMinValue(int index)(Code) | | Returns the minimum legal value of a specified numeric parameter
for this operation.
|
validateParameters | protected boolean validateParameters(ParameterBlock args, StringBuffer msg)(Code) | | Returns true if this operation is capable of handling
the input parameters.
In addition to the default validations done in the super class,
this method verifies that each element of numBins is
greater than 0, and each lowValue is less than its
corresponding highValue .
throws: IllegalArgumentException - If args is null . throws: IllegalArgumentException - If msg is null and the validation fails. |
Methods inherited from javax.media.jai.OperationDescriptorImpl | public boolean arePropertiesSupported()(Code)(Java Doc) protected static Class getDefaultSourceClass(String modeName)(Code)(Java Doc) public Class getDestClass(String modeName)(Code)(Java Doc) public Class getDestClass()(Code)(Java Doc) public Object getInvalidRegion(String modeName, ParameterBlock oldParamBlock, RenderingHints oldHints, ParameterBlock newParamBlock, RenderingHints newHints, OperationNode node)(Code)(Java Doc) public String getName()(Code)(Java Doc) public int getNumParameters()(Code)(Java Doc) public int getNumSources()(Code)(Java Doc) public Class[] getParamClasses()(Code)(Java Doc) public Object getParamDefaultValue(int index)(Code)(Java Doc) public Object[] getParamDefaults()(Code)(Java Doc) public Number getParamMaxValue(int index)(Code)(Java Doc) public Number getParamMinValue(int index)(Code)(Java Doc) public String[] getParamNames()(Code)(Java Doc) public ParameterListDescriptor getParameterListDescriptor(String modeName)(Code)(Java Doc) public PropertyGenerator[] getPropertyGenerators(String modeName)(Code)(Java Doc) public PropertyGenerator[] getPropertyGenerators()(Code)(Java Doc) public Class getRenderableDestClass()(Code)(Java Doc) public Class[] getRenderableSourceClasses()(Code)(Java Doc) public ResourceBundle getResourceBundle(Locale locale)(Code)(Java Doc) public String[][] getResources(Locale locale)(Code)(Java Doc) public Class[] getSourceClasses(String modeName)(Code)(Java Doc) public Class[] getSourceClasses()(Code)(Java Doc) public String[] getSourceNames()(Code)(Java Doc) public String[] getSupportedModes()(Code)(Java Doc) public boolean isImmediate()(Code)(Java Doc) public boolean isModeSupported(String modeName)(Code)(Java Doc) public boolean isRenderableSupported()(Code)(Java Doc) public boolean isRenderedSupported()(Code)(Java Doc) protected static Class[][] makeDefaultSourceClassList(String[] supportedModes, int numSources)(Code)(Java Doc) public boolean validateArguments(String modeName, ParameterBlock args, StringBuffer msg)(Code)(Java Doc) public boolean validateArguments(ParameterBlock args, StringBuffer msg)(Code)(Java Doc) protected boolean validateParameters(String modeName, ParameterBlock args, StringBuffer msg)(Code)(Java Doc) protected boolean validateParameters(ParameterBlock args, StringBuffer msg)(Code)(Java Doc) public boolean validateRenderableArguments(ParameterBlock args, StringBuffer msg)(Code)(Java Doc) protected boolean validateRenderableSources(ParameterBlock args, StringBuffer msg)(Code)(Java Doc) protected boolean validateSources(String modeName, ParameterBlock args, StringBuffer msg)(Code)(Java Doc) protected boolean validateSources(ParameterBlock args, StringBuffer msg)(Code)(Java Doc)
|
|
|