|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.media.jai.OperationDescriptorImpl
jaitools.media.jai.contour.ContourDescriptor
public class ContourDescriptor
Describes the "Contour" operation in which contour lines are interpolated
from values in a source image band. The desired contour values can be
specified either by supplying a Collection of values via the
"levels" parameter, or a single value via the "interval" parameter. In the
interval case, the resulting contour values will be integer multiples of
the interval. If both parameters are supplied the "levels" parameter takes
preference.
Contours are returned as a destination image property in the form of
a Collection of LineString objects.
The source image value associated with each contour can be retrieved
with the Geometry.getUserData() method.
Source image pixels are passed through to the destination image unchanged.
Three boolean parameters control the form of the generated contours:
true (the default) colinear vertices are removed
to reduce contour memory requirements.
true (the default) contour lines are merged into
LineStrings across image tile boundaries; if false mergine
is skipped for faster processing.
true contours are smoothed using Bezier interpolation
before being returned; if false (the default) no smoothing is done.
This option will probably have little effect on the form of contours unless
the source image resolution is coarse.
RenderedImage src = ...
ParameterBlockJAI pb = new ParameterBlockJAI("Contour");
pb.setSource("source0", src);
// For contours at specific levels set the levels parameter
List<Double> levels = Arrays.asList(new double[]{1.0, 5.0, 10.0, 20.0, 50.0, 100.0});
pb.setParameter("levels", levels);
// Alternatively, set a constant interval between contours
pb.setParameter("interval", 10.0);
RenderedOp dest = JAI.create("Contour", pb);
Collection<LineString> contours = (Collection<LineString>)
dest.getProperty(ContourDescriptor.CONTOUR_PROPERTY_NAME);
for (LineString contour : contours) {
// get this contour's value
Double contourValue = (Double) contour.getUserData();
...
}
The interpolation algorithm used is that of Paul Bourke: originally published
in Byte magazine (1987) as the CONREC contouring subroutine written in
FORTRAN. The implementation here was adapted from Paul Bourke's C code for the
algorithm available at:
http://local.wasp.uwa.edu.au/~pbourke/papers/conrec/
Summary of parameters:
| Name | Class | Default | Description |
|---|---|---|---|
| roi | ROI | null | An optional ROI defining the area to contour. |
| band | Integer | 0 | Source image band to process. |
| levels | Collection | null | The values for which to generate contours. |
| interval | Number | null | The interval between contour values. This parameter is ignored if the levels parameter has been supplied. With interval contouring the minimum and maximum contour values will be integer multiples of the interval parameter value. |
| nodata | Collection | The set: {Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.MAX_VALUE} |
Values to be treated as NO_DATA. A value can be either a Number or a
Range (mixtures of both are permitted).
|
| strictNodata | Boolean | Boolean.TRUE | If true, any NODATA values in the 2x2 cell moving window used by the contouring algorithm will cause that part of the image to be skipped. If false, a single NODATA value will be permitted in the window. This probably only makes a noticeable difference with small images. |
| simplify | Boolean | Boolean.TRUE | Whether to simplify contour lines by removing collinear vertices. |
| smooth | Boolean | Boolean.FALSE | Whether to smooth contour lines using Bezier interpolation. This probably only makes a noticeable difference with small images. |
| Field Summary | |
|---|---|
static String |
CONTOUR_PROPERTY_NAME
|
| Fields inherited from class javax.media.jai.OperationDescriptorImpl |
|---|
resources, sourceNames, supportedModes |
| Fields inherited from interface javax.media.jai.OperationDescriptor |
|---|
NO_PARAMETER_DEFAULT |
| Constructor Summary | |
|---|---|
ContourDescriptor()
|
|
| Method Summary | |
|---|---|
protected boolean |
validateParameters(String modeName,
ParameterBlock pb,
StringBuffer msg)
|
| 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, validateRenderableArguments, validateRenderableSources, validateSources, validateSources |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CONTOUR_PROPERTY_NAME
| Constructor Detail |
|---|
public ContourDescriptor()
| Method Detail |
|---|
protected boolean validateParameters(String modeName,
ParameterBlock pb,
StringBuffer msg)
validateParameters in class javax.media.jai.OperationDescriptorImpl
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||