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
A
PixelOperator 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcomputePixel(int x, int y, Sample[] sourceSamples, WritableSample[] targetSamples) Computes the target samples from the given source samples.final voidcomputeTileStack(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 voidsetInvalid(WritableSample[] targetSamples) Methods inherited from class org.esa.snap.core.gpf.pointop.PointOperator
checkRasterSize, configureSourceSamples, configureTargetProduct, configureTargetSamples, createTargetProduct, dispose, initialize, prepareInputsMethods 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
-
Constructor Details
-
PixelOperator
public PixelOperator()
-
-
Method Details
-
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
configureSourceSamplesandconfigureTargetSamplesmethods. 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 OperatorExceptionDescription copied from class:OperatorCalled 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:
computeTileStackin 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
-