Package org.geotools.coverage.processing
Class BaseScaleOperationJAI
- Object
-
- AbstractOperation
-
- Operation2D
-
- OperationJAI
-
- BaseScaleOperationJAI
-
- All Implemented Interfaces:
Serializable
,Operation
- Direct Known Subclasses:
Affine
,FilteredSubsample
,Scale
,SubsampleAverage
,Warp
public abstract class BaseScaleOperationJAI extends OperationJAI
Base class for providing capabilities to scaleGridCoverage2D
objects using JAI scale operations.This class tries to handles all the problems related to scaling index-color images in order to avoid strange results in the smoothest possible way by performing color expansions under the hood as needed. It may also apply some optimizations in case we were dealing with non-geo view of coverage.
- Since:
- 2.5
- Author:
- Simone Giannecchini, GeoSolutions.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class OperationJAI
OperationJAI.Parameters
-
-
Field Summary
Fields Modifier and Type Field Description static String
AFFINE
static String
ROI
static String
SCALE
static String
TRANSLATE
static String
WARP
-
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 BaseScaleOperationJAI(String operation)
Constructor forBaseScaleOperationJAI
.BaseScaleOperationJAI(OperationDescriptor operation)
Constructor forBaseScaleOperationJAI
.BaseScaleOperationJAI(OperationDescriptor operation, ParameterDescriptorGroup descriptor)
Constructor forBaseScaleOperationJAI
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GridCoverage2D
deriveGridCoverage(GridCoverage2D[] sources, OperationJAI.Parameters parameters)
Applies a JAI operation to a grid coverage.-
Methods inherited from class OperationJAI
createRenderedImage, deriveCategory, deriveName, deriveRange, deriveSampleDimension, deriveUnit, doOperation, equals, extractSources, getJAI, getOperationDescriptor, getProperties, getQuantitative, handleJAIEXTParams, handleROINoDataInternal, handleROINoDataProperties, hashCode, prepareParameters, resampleToCommonGeometry
-
Methods inherited from class Operation2D
extractSources, getFactory
-
Methods inherited from class AbstractOperation
getDescription, getDocURL, getName, getNumSources, getParameters, getVendor, getVersion, toString
-
-
-
-
Field Detail
-
AFFINE
public static final String AFFINE
- See Also:
- Constant Field Values
-
SCALE
public static final String SCALE
- See Also:
- Constant Field Values
-
TRANSLATE
public static final String TRANSLATE
- See Also:
- Constant Field Values
-
WARP
public static final String WARP
- See Also:
- Constant Field Values
-
ROI
public static final String ROI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BaseScaleOperationJAI
public BaseScaleOperationJAI(String operation) throws OperationNotFoundException
Constructor forBaseScaleOperationJAI
.- Parameters:
operation
- name of theJAI
operation we wrap.- Throws:
OperationNotFoundException
-
BaseScaleOperationJAI
public BaseScaleOperationJAI(OperationDescriptor operation)
Constructor forBaseScaleOperationJAI
.- Parameters:
operation
-OperationDescriptor
of theJAI
operation we wrap.
-
BaseScaleOperationJAI
public BaseScaleOperationJAI(OperationDescriptor operation, ParameterDescriptorGroup descriptor)
Constructor forBaseScaleOperationJAI
.- Parameters:
operation
-OperationDescriptor
of theJAI
operation we wrap.
-
-
Method Detail
-
deriveGridCoverage
protected GridCoverage2D deriveGridCoverage(GridCoverage2D[] sources, OperationJAI.Parameters parameters)
Description copied from class:OperationJAI
Applies a JAI operation to a grid coverage. This method is invoked automatically byOperationJAI.doOperation(org.geotools.api.parameter.ParameterValueGroup, org.geotools.util.factory.Hints)
. The default implementation performs the following steps:- Gets the sample dimensions for the target images by
invoking the
deriveSampleDimension(...)
method. - Applied the JAI operation using
OperationJAI.createRenderedImage(javax.media.jai.ParameterBlockJAI, java.awt.RenderingHints)
. - Wraps the result in a
GridCoverage2D
object.
- Overrides:
deriveGridCoverage
in classOperationJAI
- Parameters:
sources
- The source coverages.parameters
- Parameters, rendering hints and coordinate reference system to use.- Returns:
- The result as a grid coverage.
- See Also:
OperationJAI.doOperation(org.geotools.api.parameter.ParameterValueGroup, org.geotools.util.factory.Hints)
,OperationJAI.deriveSampleDimension(org.geotools.coverage.GridSampleDimension[][], org.geotools.coverage.processing.OperationJAI.Parameters)
,JAI.createNS(java.lang.String, java.awt.image.renderable.ParameterBlock, java.awt.RenderingHints)
- Gets the sample dimensions for the target images by
invoking the
-
-