it.geosolutions.jaiext.warp
Class WarpDescriptor

java.lang.Object
  extended by javax.media.jai.OperationDescriptorImpl
      extended by it.geosolutions.jaiext.warp.WarpDescriptor
All Implemented Interfaces:
Serializable, javax.media.jai.OperationDescriptor, javax.media.jai.RegistryElementDescriptor

public class WarpDescriptor
extends javax.media.jai.OperationDescriptorImpl

An OperationDescriptor describing the "Warp" operation.

The "Warp" operation performs (possibly filtered) general warping on an image.

The destination bounds may be specified by an ImageLayout hint provided via a RenderingHints supplied to the operation. If no bounds are so specified, then the destination bounds will be set to the minimum bounding rectangle of the forward mapped source bounds calculated using Warp.mapSourceRect(Rectangle) or, failing that, Warp.mapSourcePoint(Point2D) applied to the vertices of the source bounds. If forward mapping by both methods is not viable, then an approximate affine mapping will be created and used to determine the destination bounds by forward mapping the source bounds. If this approach also fails, then the destination bounds will be set to the source bounds.

"Warp" defines a PropertyGenerator that performs an identical transformation on the "ROI" property of the source image, which can be retrieved by calling the getProperty method with "ROI" as the property name.

The parameter, "backgroundValues", is defined to fill the background with the user-specified background values. These background values will be translated into background colors by the ColorModel when the image is displayed. With the default value, {0.0}, of this parameter, the background pixels are filled with 0s. If the provided values are out of the data range of the destination image, they will be clamped into the proper range. If the interpolation object implements "InterpolationNoData", then backgroundValues can be taken from the interpolation object.

It should be noted that this operation automatically adds a value of Boolean.TRUE for the JAI.KEY_REPLACE_INDEX_COLOR_MODEL to the given configuration so that the operation is performed on the pixel values instead of being performed on the indices into the color map if the source(s) have an IndexColorModel. This addition will take place only if a value for the JAI.KEY_REPLACE_INDEX_COLOR_MODEL has not already been provided by the user. Note that the configuration Map is cloned before the new hint is added to it. The operation can be smart about the value of the JAI.KEY_REPLACE_INDEX_COLOR_MODEL RenderingHints, i.e. while the default value for the JAI.KEY_REPLACE_INDEX_COLOR_MODEL is Boolean.TRUE, in some cases the operator could set the default.

An optional ROI object can be passed to the descriptor. Also NoData can be defined with a Range object; NoData Range is taken from the interpolation object if it implements the "InterpolationNoData" interface, else it is taken from the input parameter.

Resource List
Name Value
GlobalName WarpNoData
LocalName WarpNoData
Vendor it.geosolutions.jaiext.roiaware
Description Warps an image according to a specified Warp object, handling NoData and ROI.
DocURL Not defined
Version 1.0
arg0Desc The Warp object.
arg1Desc The interpolation method.
arg2Desc ROI object used.
arg3Desc Background Values.
arg4Desc NoData Range used.

Parameter List
Name Class Type Default Value
warp javax.media.jai.Warp NO_PARAMETER_DEFAULT
interpolation javax.media.jai.Interpolation null
roi javax.media.jai.ROI null
background double[] {0.0}
nodata it.geosolutions.jaiext.range.Range null

See Also:
Interpolation, Warp, OperationDescriptor, Serialized Form

Field Summary
 
Fields inherited from class javax.media.jai.OperationDescriptorImpl
sourceNames, supportedModes
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
WarpDescriptor()
          Constructor.
 
Method Summary
static javax.media.jai.RenderedOp create(RenderedImage source0, javax.media.jai.Warp warp, javax.media.jai.Interpolation interpolation, double[] backgroundValues, javax.media.jai.ROI sourceROI, Range noData, RenderingHints hints)
          Warps an image according to a specified Warp object.
static javax.media.jai.RenderedOp create(RenderedImage source0, javax.media.jai.Warp warp, javax.media.jai.Interpolation interpolation, double[] backgroundValues, javax.media.jai.ROI sourceROI, RenderingHints hints)
          Warps an image according to a specified Warp object.
 javax.media.jai.PropertyGenerator[] getPropertyGenerators()
          Returns an array of PropertyGenerators implementing property inheritance for the "Warp" operation.
static boolean register()
          Registers this descriptor if it is not already registered.
 
Methods inherited from class javax.media.jai.OperationDescriptorImpl
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getInvalidRegion, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamMaxValue, getParamMinValue, getParamNames, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isImmediate, isModeSupported, isRenderableSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateArguments, validateParameters, 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

WarpDescriptor

public WarpDescriptor()
Constructor.

Method Detail

register

public static final boolean register()
Registers this descriptor if it is not already registered.

Returns:
true in case the operation succeds, false otherwise.

getPropertyGenerators

public javax.media.jai.PropertyGenerator[] getPropertyGenerators()
Returns an array of PropertyGenerators implementing property inheritance for the "Warp" operation.

Specified by:
getPropertyGenerators in interface javax.media.jai.OperationDescriptor
Overrides:
getPropertyGenerators in class javax.media.jai.OperationDescriptorImpl
Returns:
An array of property generators.

create

public static javax.media.jai.RenderedOp create(RenderedImage source0,
                                                javax.media.jai.Warp warp,
                                                javax.media.jai.Interpolation interpolation,
                                                double[] backgroundValues,
                                                javax.media.jai.ROI sourceROI,
                                                RenderingHints hints)
Warps an image according to a specified Warp object.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
source0 - RenderedImage source 0.
warp - The warp object.
interpolation - The interpolation method. May be null.
backgroundValues - The user-specified background values. May be null.
sourceROI - ROI object used in calculations. May be null.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
IllegalArgumentException - if warp is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp

create

public static javax.media.jai.RenderedOp create(RenderedImage source0,
                                                javax.media.jai.Warp warp,
                                                javax.media.jai.Interpolation interpolation,
                                                double[] backgroundValues,
                                                javax.media.jai.ROI sourceROI,
                                                Range noData,
                                                RenderingHints hints)
Warps an image according to a specified Warp object. NoData Range can be added

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
source0 - RenderedImage source 0.
warp - The warp object.
interpolation - The interpolation method. May be null.
backgroundValues - The user-specified background values. May be null.
sourceROI - ROI object used in calculations. May be null.
noData - NoData Range used in calculations. May be null.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
IllegalArgumentException - if warp is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp


Copyright © 2006–2014 GeoSolutions. All rights reserved.