org.jaitools.media.jai.vectorbinarize
Class VectorBinarizeDescriptor

java.lang.Object
  extended by javax.media.jai.OperationDescriptorImpl
      extended by org.jaitools.media.jai.vectorbinarize.VectorBinarizeDescriptor
All Implemented Interfaces:
Serializable, javax.media.jai.OperationDescriptor, javax.media.jai.RegistryElementDescriptor

public class VectorBinarizeDescriptor
extends javax.media.jai.OperationDescriptorImpl

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 = WKTReader.read("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();
 il.setSampleModel(sm);
 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

Since:
1.1
Version:
$Id$
Author:
Michael Bedward., Andrea Aime, GeoSolutions.
See Also:
Serialized Form

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

Constructor Detail

VectorBinarizeDescriptor

public VectorBinarizeDescriptor()
Creates a new instance.

Method Detail

validateParameters

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

Overrides:
validateParameters in class javax.media.jai.OperationDescriptorImpl
Parameters:
modeName - the rendering mode
pb - the parameter block
msg - a StringBuffer to receive error messages
Returns:
true if parameters are valid; false otherwise


Copyright © 2009-2013. All Rights Reserved.