Class SubtractConst
- Object
-
- AbstractOperation
-
- Operation2D
-
- OperationJAI
-
- SubtractConst
-
- All Implemented Interfaces:
Serializable
,Operation
public class SubtractConst extends OperationJAI
Subtracts constants (one for each band) from every sample values of the source coverage. 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.Name:
"SubtractConst"
JAI operator:"SubtractConst"
Parameters:Name Class Default value Minimum value Maximum value "Source"
GridCoverage2D
N/A N/A N/A "constants"
double[]
N/A N/A N/A - Since:
- 2.2
- Author:
- Martin Desruisseaux (IRD)
- See Also:
Operations.subtract(org.geotools.api.coverage.Coverage, double[])
,SubtractConstDescriptor
, 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
Constructors Constructor Description SubtractConst()
Constructs a default"SubtractConst"
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.String
getName()
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 thederiveGridCoverage
method.protected void
handleJAIEXTParams(ParameterBlockJAI parameters, ParameterValueGroup parameters2)
Extension point for adding to the JAIParameterBlockJAI
object 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, 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:AbstractOperation
Returns the name of the processing operation. The default implementation returns the AbstractOperation.descriptor code name.- Specified by:
getName
in interfaceOperation
- Overrides:
getName
in 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:
deriveRange
in 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
null
if unknow.
-
handleJAIEXTParams
protected void handleJAIEXTParams(ParameterBlockJAI parameters, ParameterValueGroup parameters2)
Description copied from class:OperationJAI
Extension point for adding to the JAIParameterBlockJAI
object 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
ParameterBlockJAI
instance.- Overrides:
handleJAIEXTParams
in classOperationJAI
- Parameters:
parameters
-ParameterBlockJAI
instance used by the current JAI-EXT/JAI operationparameters2
-ParameterValueGroup
instance 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:OperationJAI
Prepares the properties to be given to the coverage created by thederiveGridCoverage
method. The default implementation returnsnull
.- Overrides:
getProperties
in classOperationJAI
- Parameters:
data
- TheRenderedImage
created by this operation.crs
- The coordinate reference system assigned to the coverage thisOperationJAI
will produce.name
- The name assigned to the coverage thisOperationJAI
will produce.gridToCRS
- The transform from grid tocrs
to be assigned to the coverage thisOperationJAI
will produce.sources
- The sources to be assigned to the coverage thisOperationJAI
will produce.parameters
- The parameters that were used by thisOperationJAI
.- Returns:
- a
Map
with the properties generated by thisOperationJAI
or null if we haven't any.
-
-