it.geosolutions.jaiext.translate
Class TranslateDescriptor

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

public class TranslateDescriptor
extends javax.media.jai.OperationDescriptorImpl

An OperationDescriptor describing the "Translate" operation.

The "Translate" operation copies an image to a new location in the plane.

For each pixel (x, y) of the destination, the source value at the position (x - xTrans, y - yTrans) is constructed and written to the destination. Both xTrans and yTrans must be integral, else an exception is thrown. No ROI or No Data are considered, if these features are requested the it.geosolutions.jaiext.scale.ScaleDescriptor should be used.

It may be noted that the minX, minY, width and height hints as specified through the JAI.KEY_IMAGE_LAYOUT hint in the RenderingHints object are not honored, as this operator calculates the destination image bounds itself. The other ImageLayout hints, like tileWidth and tileHeight, however are honored.

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.

"Translate" 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.

Resource List
Name Value
GlobalName Translation
LocalName Translation
Vendor it.geosolutions.jaiext
Description Translate an Image on the X and Y axes.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/TranslateDescriptor.html
Version 1.0
arg0Desc The X translation value.
arg1Desc The Y translation value.

Parameter List
Name Class Type Default Value
xTrans java.lang.Float 0.0F
yTrans java.lang.Float 0.0F

See Also:
Interpolation, 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
TranslateDescriptor()
           
 
Method Summary
static javax.media.jai.RenderedOp create(RenderedImage source0, Float xTrans, Float yTrans, RenderingHints hints)
          Translate an image to a new location.
 javax.media.jai.PropertyGenerator[] getPropertyGenerators()
          Returns an array of PropertyGenerators implementing property inheritance for the "Translate" operation
 
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

TranslateDescriptor

public TranslateDescriptor()
Method Detail

getPropertyGenerators

public javax.media.jai.PropertyGenerator[] getPropertyGenerators()
Returns an array of PropertyGenerators implementing property inheritance for the "Translate" 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,
                                                Float xTrans,
                                                Float yTrans,
                                                RenderingHints hints)
Translate an image to a new location.

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

Parameters:
source0 - RenderedImage source 0.
xTrans - The displacement in X direction. May be null.
yTrans - The displacement in Y direction. May be null.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp


Copyright © 2006–2015 GeoSolutions. All rights reserved.