Class VectorBinarizeDescriptor

  extended by
      extended by
All Implemented Interfaces:

public class VectorBinarizeDescriptor

Describes the "VectorBinarize" operation which creates a binary image based on pixel inclusion in a polygonal Geometry object. No source image is used. The reference polygon must be one of the following JTS classes: Polygon, MultiPolygon or PreparedGeometry.

Pixels are tested for inclusion using either their corner coordinates (equivalent to standard JAI pixel indexing) or center coordinates (0.5 added to each ordinate) depending on the "coordtype" parameter.

Example of use:

 // Using a JTS polygon object as the reference geometry
 Polygon triangle ="POLYGON((100 100, 4900 4900, 4900 100, 100 100))"); 
 ParameterBlockJAI pb = new ParameterBlockJAI("VectorBinarize");
 pb.setParameter("minx", 0);
 pb.setParameter("miny", 0);
 pb.setParameter("width", 5000);
 pb.setParameter("height", 5000);
 pb.setParameter("geometry", triangle);
 // specify that we want to use center coordinates of pixels
 pb.setParameter("coordtype", PixelCoordType.CENTER);
 RenderedOp dest = JAI.create("VectorBinarize", pb);
By default, the destination image is type BYTE, with a MultiPixelPackedSampleModel and JAI's default tile size. If an alternative image type is desired this can be specified via rendering hints as in this example:

 SampleModel sm = ...
 ImageLayout il = new ImageLayout();
 RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, il);
 RenderedOp dest = JAI.create("VectorBinarize", pb, hints);
Summary of parameters:
Name Class Default Description
minx int 0 Min image X ordinate
miny int 0 Min image Y ordinate
width int No default Image width
height int No default Image height
geometry Geometry or PreparedGeometry No default The reference polygonal geometry
antiAliasing Boolean VectorBinarizeOpImage.DEFAULT_ANTIALIASING Whether to use anti-aliasing when rendering (pixellating) the reference geometry

Michael Bedward., Andrea Aime, GeoSolutions.
See Also:
Serialized Form

Field Summary
Fields inherited from class
resources, sourceNames, supportedModes
Fields inherited from interface
Constructor Summary
          Creates a new instance.
Method Summary
protected  boolean validateParameters(String modeName, ParameterBlock pb, StringBuffer msg)
          Validates supplied parameters.
Methods inherited from class
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

Constructor Detail


public VectorBinarizeDescriptor()
Creates a new instance.

Method Detail


protected boolean validateParameters(String modeName,
                                     ParameterBlock pb,
                                     StringBuffer msg)
Validates supplied parameters.

validateParameters in class
modeName - the rendering mode
pb - the parameter block
msg - a StringBuffer to receive error messages
true if parameters are valid; false otherwise

Copyright © 2009-2013. All Rights Reserved.