Class Multiply
-
- All Implemented Interfaces:
Serializable,Operation
public class Multiply extends BaseMathOperationJAI
Create a new coverage as the multiplication of two source coverages by doing pixel by pixel multiplication: 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:
"Multiply"
JAI operator:"Multiply"
Parameters:Name Class Default value Minimum value Maximum value "Source0"GridCoverage2DN/A N/A N/A "Source1"GridCoverage2DN/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_NAME
-
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
Constructors Constructor Description Multiply()Constructs a default"MultiplyConst"operation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NumberRange<? extends Number>deriveRange(NumberRange<? extends Number>[] ranges, OperationJAI.Parameters parameters)Returns the expected range of values for the resulting image.protected voidextractSources(ParameterValueGroup parameters, Collection<GridCoverage2D> sources, String[] sourceNames)Extraction of the sources from the parameter called SOURCES.StringgetName()Returns the name of the processing operation.protected Map<String,?>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(ParameterBlockJAI parameters, ParameterValueGroup parameters2)Extension point for adding to the JAIParameterBlockJAIobject 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, getJAI, getOperationDescriptor, getQuantitative, handleROINoDataInternal, handleROINoDataProperties, hashCode, prepareParameters, resampleToCommonGeometry
-
Methods inherited from class Operation2D
extractSources, getFactory
-
Methods inherited from class AbstractOperation
getDescription, getDocURL, getNumSources, getParameters, getVendor, getVersion, toString
-
-
-
-
Method Detail
-
getName
public String 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
protected void handleJAIEXTParams(ParameterBlockJAI parameters, ParameterValueGroup parameters2)Description copied from class:OperationJAIExtension point for adding to the JAIParameterBlockJAIobject 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
ParameterBlockJAIinstance.- Overrides:
handleJAIEXTParamsin classOperationJAI- Parameters:
parameters-ParameterBlockJAIinstance used by the current JAI-EXT/JAI operationparameters2-ParameterValueGroupinstance containing input operation parameters
-
extractSources
protected void extractSources(ParameterValueGroup parameters, Collection<GridCoverage2D> sources, String[] sourceNames) throws ParameterNotFoundException, InvalidParameterValueException
Description copied from class:OperationJAIExtraction of the sources from the parameter called SOURCES. The sources are stored inside a List.- Overrides:
extractSourcesin classBaseMathOperationJAI- Throws:
ParameterNotFoundExceptionInvalidParameterValueException
-
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.
-
-