public abstract class PixelOperator extends PointOperator
PixelOperator
may serve as a handy base class for an operator that computes any number of target samples
from any number of source samples.Constructor and Description |
---|
PixelOperator() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
computePixel(int x,
int y,
Sample[] sourceSamples,
WritableSample[] targetSamples)
Computes the target samples from the given source samples.
|
void |
computeTileStack(Map<Band,Tile> targetTileStack,
Rectangle targetRectangle,
ProgressMonitor pm)
Called by the framework in order to compute the stack of tiles for the given target bands.
|
protected void |
setInvalid(WritableSample[] targetSamples) |
checkRasterSize, configureSourceSamples, configureTargetProduct, configureTargetSamples, createTargetProduct, dispose, initialize, prepareInputs
canComputeTile, canComputeTileStack, checkForCancellation, computeTile, 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 computePixel(int x, int y, Sample[] sourceSamples, WritableSample[] targetSamples)
The number of source/target samples is the maximum defined sample index plus one. Source/target samples are defined
by using the respective sample configurer in the
configureSourceSamples
and
configureTargetSamples
methods.
Attempts to read from source samples or write to target 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).targetSamples
- The target samples (= target pixel).public final void computeTileStack(Map<Band,Tile> targetTileStack, Rectangle targetRectangle, ProgressMonitor pm) throws OperatorException
Operator
The default implementation throws a runtime exception with the message "not implemented".
This method shall never be called directly.
computeTileStack
in class Operator
targetTileStack
- The current tiles to be computed for each target band.targetRectangle
- The area in pixel coordinates to be computed (same for all rasters in targetRasters
).pm
- A progress monitor which should be used to determine computation cancellation requests.OperatorException
- If an error occurs during computation of the target rasters.protected void setInvalid(WritableSample[] targetSamples)
Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.