Package org.esa.snap.core.gpf.pointop
Class PixelOperator
- java.lang.Object
-
- org.esa.snap.core.gpf.Operator
-
- org.esa.snap.core.gpf.pointop.PointOperator
-
- org.esa.snap.core.gpf.pointop.PixelOperator
-
public abstract class PixelOperator extends PointOperator
APixelOperator
may serve as a handy base class for an operator that computes any number of target samples from any number of source samples.- Since:
- BEAM 4.9, revised in SNAP 2.0
-
-
Constructor Summary
Constructors Constructor Description PixelOperator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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)
-
Methods inherited from class org.esa.snap.core.gpf.pointop.PointOperator
checkRasterSize, configureSourceSamples, configureTargetProduct, configureTargetSamples, createTargetProduct, dispose, initialize, prepareInputs
-
Methods inherited from class org.esa.snap.core.gpf.Operator
canComputeTile, canComputeTileStack, checkForCancellation, computeTile, 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
-
-
-
-
Method Detail
-
computePixel
protected abstract void computePixel(int x, int y, Sample[] sourceSamples, WritableSample[] targetSamples)
Computes the target samples from the given source samples.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
andconfigureTargetSamples
methods. Attempts to read from source samples or write to target samples at undefined sample indices will cause undefined behaviour.- Parameters:
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).
-
computeTileStack
public final void computeTileStack(Map<Band,Tile> targetTileStack, Rectangle targetRectangle, ProgressMonitor pm) throws OperatorException
Description copied from class:Operator
Called by the framework in order to compute the stack of tiles for the given target bands.The default implementation throws a runtime exception with the message "not implemented".
This method shall never be called directly.
- Overrides:
computeTileStack
in classOperator
- Parameters:
targetTileStack
- The current tiles to be computed for each target band.targetRectangle
- The area in pixel coordinates to be computed (same for all rasters intargetRasters
).pm
- A progress monitor which should be used to determine computation cancellation requests.- Throws:
OperatorException
- If an error occurs during computation of the target rasters.
-
setInvalid
protected void setInvalid(WritableSample[] targetSamples)
-
-