Class Rescale
- All Implemented Interfaces:
Serializable,Operation
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class OperationJAI
OperationJAI.Parameters -
Field Summary
Fields inherited from class OperationJAI
operation, RENDERED_MODEFields inherited from class Operation2D
PRIMARY_SOURCE_INDEX, SOURCE_0Fields inherited from class AbstractOperation
descriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected NumberRange<? extends Number>deriveRange(NumberRange<? extends Number>[] ranges, OperationJAI.Parameters parameters) Returns the expected range of values for the resulting image.getProperties(RenderedImage data, CoordinateReferenceSystem crs, InternationalString name, MathTransform gridToCRS, GridCoverage2D[] sources, OperationJAI.Parameters parameters) Prepares the properties to be given to the coverage created by thederiveGridCoveragemethod.protected voidhandleJAIEXTParams(ParameterBlockImageN parameters, ParameterValueGroup parameters2) Extension point for adding to the ImageNParameterBlockImageNobject the parameters defined in theParameterValueGroup, which can be read by the JAI-EXT operations.Methods inherited from class OperationJAI
createRenderedImage, deriveCategory, deriveGridCoverage, deriveName, deriveSampleDimension, deriveUnit, doOperation, equals, extractSources, getJAI, getOperationDescriptor, getQuantitative, handleROINoDataInternal, handleROINoDataProperties, hashCode, prepareParameters, resampleToCommonGeometryMethods inherited from class Operation2D
extractSources, getFactoryMethods inherited from class AbstractOperation
getDescription, getDocURL, getName, getNumSources, getParameters, getVendor, getVersion, toString
-
Constructor Details
-
Rescale
public Rescale()Constructs a default"Rescale"operation.
-
-
Method Details
-
deriveRange
protected NumberRange<? extends Number> deriveRange(NumberRange<? extends Number>[] ranges, OperationJAI.Parameters parameters) Returns the expected range of values for the resulting image.- Overrides:
deriveRangein classOperationJAI- Parameters:
ranges- The range of values from every sources. For unary operations 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
nullif unknow.
-
handleJAIEXTParams
Description copied from class:OperationJAIExtension point for adding to the ImageNParameterBlockImageNobject the parameters defined in theParameterValueGroup, which can be read by the JAI-EXT operations.Notice that if you are using JAI, the new parameters will not be accepted by the
ParameterBlockImageNinstance.- Overrides:
handleJAIEXTParamsin classOperationJAI- Parameters:
parameters-ParameterBlockImageNinstance used by the current JAI-EXT/JAI operationparameters2-ParameterValueGroupinstance containing input operation parameters
-
getProperties
protected Map<String,?> getProperties(RenderedImage data, CoordinateReferenceSystem crs, InternationalString name, MathTransform gridToCRS, GridCoverage2D[] sources, OperationJAI.Parameters parameters) Description copied from class:OperationJAIPrepares the properties to be given to the coverage created by thederiveGridCoveragemethod. The default implementation returnsnull.- Overrides:
getPropertiesin classOperationJAI- Parameters:
data- TheRenderedImagecreated by this operation.crs- The coordinate reference system assigned to the coverage thisOperationJAIwill produce.name- The name assigned to the coverage thisOperationJAIwill produce.gridToCRS- The transform from grid tocrsto be assigned to the coverage thisOperationJAIwill produce.sources- The sources to be assigned to the coverage thisOperationJAIwill produce.parameters- The parameters that were used by thisOperationJAI.- Returns:
- a
Mapwith the properties generated by thisOperationJAIor null if we haven't any.
-