it.geosolutions.jaiext.rescale
Class RescaleDescriptor

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

public class RescaleDescriptor
extends javax.media.jai.OperationDescriptorImpl

An OperationDescriptor describing the "Rescale" operation.

The "Rescale" operation takes a rendered or renderable source image and changes the image dynamics by multiplying each pixel value by a constant and then adding another constant to the result of the multiplication. Each constant value is associated to a band. If the number of constants supplied is less than the number of bands of the destination, then the constant from entry 0 is applied to all the bands. Otherwise, a constant from a different entry is applied to each band. The optional presence of NoData or ROI is taken into account by replacing each value out of ROI or each NoData, with the supplied DestinationNoData value.

The destination pixel values are defined by the following pseudocode:

 dst = destination pixel array
 src = source pixel array
 
 dst[x][y][b] = src[x][y][b] * constant + offset;
 

The pixel arithmetic is performed using the data type of the destination image. By default, the destination will have the same data type as the source image unless an ImageLayout containing a SampleModel with a different data type is supplied as a rendering hint.

Resource List
Name Value
GlobalName Rescaling
LocalName Rescaling
Vendor it.geosolutions.jaiext
Description Operation which converts the image dynamic to a new dynamic.
DocURL Not Defined
Version 1.0
arg0Desc Scale factors used for rescaling values.
arg1Desc Offset factors used for rescaling values.
arg2Desc ROI object used.
arg3Desc No Data Range used.
arg4Desc Boolean checking if ROI RasterAccessor is used.
arg5Desc Destination No Data value.

Parameter List
Name Class Type Default Value
scale double[] {1.0}
offset double[] {0.0}
ROI javax.media.jai.ROI null
noData it.geosolutions.jaiext.range.Range null
useRoiAccessor Boolean false
destNoData Double 0.0d

See Also:
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
RescaleDescriptor()
          Constructor.
 
Method Summary
static javax.media.jai.RenderedOp create(RenderedImage source0, double[] scales, double[] offsets, javax.media.jai.ROI roi, Range rangeND, boolean useRoiAccessor, double destNoData, RenderingHints hints)
          Maps the pixels values of an image from one range to another range.
static javax.media.jai.RenderableOp createRenderable(RenderableImage source0, double[] scales, double[] offsets, javax.media.jai.ROI roi, Range rangeND, boolean useRoiAccessor, double destNoData, RenderingHints hints)
          Maps the pixels values of an image from one range to another range.
 javax.media.jai.PropertyGenerator[] getPropertyGenerators()
          Returns an array of PropertyGenerators implementing property inheritance for the "Rescale" operation
 boolean isRenderableSupported()
          Returns true since renderable operation is supported.
 
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, 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

RescaleDescriptor

public RescaleDescriptor()
Constructor.

Method Detail

isRenderableSupported

public boolean isRenderableSupported()
Returns true since renderable operation is supported.

Specified by:
isRenderableSupported in interface javax.media.jai.OperationDescriptor
Overrides:
isRenderableSupported in class javax.media.jai.OperationDescriptorImpl

getPropertyGenerators

public javax.media.jai.PropertyGenerator[] getPropertyGenerators()
Returns an array of PropertyGenerators implementing property inheritance for the "Rescale" 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,
                                                double[] scales,
                                                double[] offsets,
                                                javax.media.jai.ROI roi,
                                                Range rangeND,
                                                boolean useRoiAccessor,
                                                double destNoData,
                                                RenderingHints hints)
Maps the pixels values of an image from one range to another range.

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

Parameters:
source0 - RenderedImage source 0.
scales - The per-band scale factors to multiply by.
offsets - The per-band offsets to be added.
roi - Optional ROI used for computations.
noData - Optional No Data range used for computations.
useROIAccessor - Boolean indicating if ROI RasterAccessor must be used.
destinationNoData - Destination value for No Data.
hints - The RenderingHints to use.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.

createRenderable

public static javax.media.jai.RenderableOp createRenderable(RenderableImage source0,
                                                            double[] scales,
                                                            double[] offsets,
                                                            javax.media.jai.ROI roi,
                                                            Range rangeND,
                                                            boolean useRoiAccessor,
                                                            double destNoData,
                                                            RenderingHints hints)
Maps the pixels values of an image from one range to another range.

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

Parameters:
source0 - RenderedImage source 0.
scales - The per-band scale factors to multiply by.
offsets - The per-band offsets to be added.
roi - Optional ROI used for computations.
noData - Optional No Data range used for computations.
useROIAccessor - Boolean indicating if ROI RasterAccessor must be used.
destinationNoData - Destination value for No Data.
hints - The RenderingHints to use.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.


Copyright © 2006–2015 GeoSolutions. All rights reserved.