jaitools.media.jai.vectorbinarize
Class VectorBinarizeDescriptor

java.lang.Object
  extended by javax.media.jai.OperationDescriptorImpl
      extended by 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);
 

Since:
1.1
Version:
$Id: VectorBinarizeDescriptor.java 1383 2011-02-10 11:22:29Z michael.bedward $
Author:
Michael Bedward, Andrea Aime
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()
           
 
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
 

Constructor Detail

VectorBinarizeDescriptor

public VectorBinarizeDescriptor()
Method Detail

validateParameters

protected boolean validateParameters(String modeName,
                                     ParameterBlock pb,
                                     StringBuffer msg)
Overrides:
validateParameters in class javax.media.jai.OperationDescriptorImpl


Copyright © 2009-2011. All Rights Reserved.