Class Add
- All Implemented Interfaces:
Serializable,Operation
Create a new coverage as the sum of two source coverages by doing pixel by pixel addition: result[0][0] =
source0[0][0] + source1[0][0] ... ... result[i][j] = source0[i][j] + source1[i][j] ... ... result[n-1][m-1] =
source0[n-1][m-1] + source1[n-1][m-1]
Make sure coverages have same envelope and same resolution before using this operation.
Name: "Add"
JAI operator: "Add"
Parameters:
| Name | Class | Default value | Minimum value | Maximum value |
|---|---|---|---|---|
"Source0" |
GridCoverage2D |
N/A | N/A | N/A |
"Source1" |
GridCoverage2D |
N/A | N/A | N/A |
-
Nested Class Summary
Nested classes/interfaces inherited from class OperationJAI
OperationJAI.Parameters -
Field Summary
Fields inherited from class BaseMathOperationJAI
LOGGER, SOURCES, SOURCES_NAMEFields 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.getName()Returns the name of the processing operation.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 BaseMathOperationJAI
extractSourcesMethods inherited from class OperationJAI
createRenderedImage, deriveCategory, deriveGridCoverage, deriveName, deriveSampleDimension, deriveUnit, doOperation, equals, getJAI, getOperationDescriptor, getQuantitative, handleROINoDataInternal, handleROINoDataProperties, hashCode, prepareParameters, resampleToCommonGeometryMethods inherited from class Operation2D
extractSources, getFactoryMethods inherited from class AbstractOperation
getDescription, getDocURL, getNumSources, getParameters, getVendor, getVersion, toString
-
Constructor Details
-
Add
public Add()Constructs a default"Add"operation.
-
-
Method Details
-
getName
Description copied from class:AbstractOperationReturns the name of the processing operation. The default implementation returns the AbstractOperation.descriptor code name.- Specified by:
getNamein interfaceOperation- Overrides:
getNamein classAbstractOperation- Returns:
- The name of the processing operation.
-
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.
-