public class VectorBinarizeDescriptor
extends javax.media.jai.OperationDescriptorImpl
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 |
Constructor and Description |
---|
VectorBinarizeDescriptor()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
validateParameters(String modeName,
ParameterBlock pb,
StringBuffer msg)
Validates supplied parameters.
|
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
public VectorBinarizeDescriptor()
protected boolean validateParameters(String modeName, ParameterBlock pb, StringBuffer msg)
validateParameters
in class javax.media.jai.OperationDescriptorImpl
modeName
- the rendering modepb
- the parameter blockmsg
- a StringBuffer
to receive error messagestrue
if parameters are valid; false
otherwiseCopyright © 2006–2016 GeoSolutions. All rights reserved.