org.geotools.coverage.processing.operation
Class Rescale

Object
  extended by AbstractOperation
      extended by Operation2D
          extended by OperationJAI
              extended by Rescale
All Implemented Interfaces:
Serializable, Operation

public class Rescale
extends OperationJAI

Maps the sample values of a coverage from one range to another range. The rescaling is done by multiplying each sample value by one of a set of constants and then adding another constant to the result of the multiplication. The destination sample values are defined by the pseudocode:

dst[x][y][b] = src[x][y][b]*constant + offset;

Name: "Rescale"
JAI operator: "Rescale"
Parameters:

Name Class Default value Minimum value Maximum value
"Source" GridCoverage2D N/A N/A N/A
"constants" double[] 1.0 N/A N/A
"offsets" double[] 0.0 N/A N/A

Since:
2.2
Author:
Martin Desruisseaux (IRD)
See Also:
Operations.rescale(org.opengis.coverage.Coverage, double[], double[]), RescaleDescriptor, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class OperationJAI
OperationJAI.Parameters
 
Field Summary
 
Fields inherited from class OperationJAI
operation, RENDERED_MODE
 
Fields inherited from class Operation2D
PRIMARY_SOURCE_INDEX, SOURCE_0
 
Fields inherited from class AbstractOperation
descriptor
 
Constructor Summary
Rescale()
          Constructs a default "Rescale" operation.
 
Method Summary
protected  NumberRange deriveRange(NumberRange[] ranges, OperationJAI.Parameters parameters)
          Returns the expected range of values for the resulting image.
 
Methods inherited from class OperationJAI
createRenderedImage, deriveCategory, deriveGridCoverage, deriveName, deriveSampleDimension, deriveUnit, doOperation, equals, getJAI, getOperationDescriptor, getProperties, getQuantitative, prepareParameters, resampleToCommonGeometry
 
Methods inherited from class Operation2D
computeOnGeophysicsValues, extractSources, getFactory
 
Methods inherited from class AbstractOperation
getDescription, getDocURL, getName, getNumSources, getParameters, getVendor, getVersion, hashCode, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rescale

public Rescale()
Constructs a default "Rescale" operation.

Method Detail

deriveRange

protected NumberRange deriveRange(NumberRange[] ranges,
                                  OperationJAI.Parameters parameters)
Returns the expected range of values for the resulting image.

Overrides:
deriveRange in class OperationJAI
Parameters:
ranges - The range of values from every sources. For unary operations like "GradientMagnitude", this array has a length of 1. For binary operations like "add" and "multiply", this array has a length of 2.
parameters - Parameters, rendering hints and coordinate reference system to use.
Returns:
The range of values to use in the destination image, or null if unknow.


Copyright © 1996-2014 Geotools. All Rights Reserved.