public abstract class SampleOperator extends PointOperator
SampleOperator
may serve as a handy base class for an operator that computes a single target sample from
any number of source samples.Constructor and Description |
---|
SampleOperator() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
computeSample(int x,
int y,
Sample[] sourceSamples,
WritableSample targetSample)
Computes a single target sample from the given source samples.
|
void |
computeTile(Band targetBand,
Tile targetTile,
ProgressMonitor pm)
Overridden to call the
computeSample method for every
pixel in the given tile's rectangle. |
checkRasterSize, configureSourceSamples, configureTargetProduct, configureTargetSamples, createTargetProduct, dispose, initialize, prepareInputs
canComputeTile, canComputeTileStack, checkForCancellation, computeTileStack, deactivateComputeTileMethod, doExecute, ensureSceneGeoCoding, ensureSingleRasterSize, ensureSingleRasterSize, execute, finalize, getId, getLogger, getParameter, getParameter, getProductManager, getSourceProduct, getSourceProduct, getSourceProductId, getSourceProducts, getSourceTile, getSourceTile, getSpi, getTargetProduct, getTargetProperty, setLogger, setParameter, setParameterDefaultValues, setRequiresAllBands, setSourceProduct, setSourceProduct, setSourceProducts, setSpi, setTargetProduct, stopTileComputationObservation, update
protected abstract void computeSample(int x, int y, Sample[] sourceSamples, WritableSample targetSample)
The number of source samples is the maximum defined source sample index plus one. Source samples are defined
by using the sample configurer in the
configureSourceSamples
method.
Attempts to read from source samples at undefined sample indices will
cause undefined behaviour.
x
- The current pixel's X coordinate.y
- The current pixel's Y coordinate.sourceSamples
- The source samples (= source pixel).targetSample
- The single target sample.public final void computeTile(Band targetBand, Tile targetTile, ProgressMonitor pm) throws OperatorException
computeSample
method for every
pixel in the given tile's rectangle.computeTile
in class Operator
targetBand
- The target band.targetTile
- The current tile associated with the target band to be computed.pm
- A progress monitor which should be used to determine computation cancellation requests.OperatorException
- If an error occurs during computation of the target rasterCopyright © 2014–2017 European Space Agency (ESA). All rights reserved.