|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.media.jai.OperationDescriptorImpl
org.jaitools.media.jai.vectorbinarize.VectorBinarizeDescriptor
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 = 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 |
| 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 |
|---|
public VectorBinarizeDescriptor()
| Method Detail |
|---|
protected boolean validateParameters(String modeName,
ParameterBlock pb,
StringBuffer msg)
validateParameters in class javax.media.jai.OperationDescriptorImplmodeName - the rendering modepb - the parameter blockmsg - a StringBuffer to receive error messages
true if parameters are valid; false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||