org.esa.beam.framework.gpf.pointop
Class PixelOperator

java.lang.Object
  extended by org.esa.beam.framework.gpf.Operator
      extended by org.esa.beam.framework.gpf.pointop.PointOperator
          extended by org.esa.beam.framework.gpf.pointop.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
Author:
Norman Fomferra

Constructor Summary
PixelOperator()
           
 
Method Summary
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, com.bc.ceres.core.ProgressMonitor pm)
          Called by the framework in order to compute the stack of tiles for the given target bands.
 
Methods inherited from class org.esa.beam.framework.gpf.pointop.PointOperator
checkRasterSize, configureSourceSamples, configureTargetProduct, configureTargetSamples, createTargetProduct, initialize, prepareInputs
 
Methods inherited from class org.esa.beam.framework.gpf.Operator
checkForCancellation, computeTile, deactivateComputeTileMethod, dispose, finalize, getId, getLogger, getParameter, getSourceProduct, getSourceProduct, getSourceProductId, getSourceProducts, getSourceTile, getSourceTile, getSpi, getTargetProduct, getTargetProperty, setLogger, setParameter, setRequiresAllBands, setSourceProduct, setSourceProduct, setSourceProducts, setSpi, setTargetProduct, stopTileComputationObservation, update
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 SampleConfigurer 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,
                                   com.bc.ceres.core.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 cancelation requests.
Throws:
OperatorException - if an error occurs during computation of the target rasters.


Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.