Class PixelOperator


  • public abstract class PixelOperator
    extends PointOperator
    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 Detail

      • PixelOperator

        public PixelOperator()
    • 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 and configureTargetSamples 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 class Operator
        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 in targetRasters).
        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)