org.esa.beam.framework.dataop.barithm
Class RasterDataLoop

java.lang.Object
  extended by org.esa.beam.framework.dataop.barithm.RasterDataLoop

public class RasterDataLoop
extends Object

A utility class which is used to iterate over all pixels within a region of a data raster and to evaluate any number of Terms on each pixel.

Author:
Sabine Embacher, Marco Peters, Norman Fomferra

Nested Class Summary
static interface RasterDataLoop.Body
          Represents the body to be evaluated for each pixel within the raster.
 
Constructor Summary
RasterDataLoop(int offsetX, int offsetY, int regionWidth, int regionHeight, Term[] terms, com.bc.ceres.core.ProgressMonitor pm)
          Creates an instance of this class for the given region and terms.
RasterDataLoop(RasterDataEvalEnv rasterDataEvalEnv, Term[] terms, com.bc.ceres.core.ProgressMonitor pm)
          Creates an instance of this class for the given region and terms.
 
Method Summary
 void forEachPixel(RasterDataLoop.Body body)
          Evaluates the body by calling its eval() method.
 void forEachPixel(RasterDataLoop.Body body, String message)
          Evaluates the body by calling its eval() method.
 int getOffsetX()
           
 int getOffsetY()
           
 int getRegionHeight()
           
 int getRegionWidth()
           
 Term[] getTerms()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RasterDataLoop

public RasterDataLoop(int offsetX,
                      int offsetY,
                      int regionWidth,
                      int regionHeight,
                      Term[] terms,
                      com.bc.ceres.core.ProgressMonitor pm)
Creates an instance of this class for the given region and terms.

Parameters:
offsetX - the X-offset of the region.
offsetY - the Y-offset of the region.
regionWidth - the width of the region.
regionHeight - the height of the region.
terms - an array of terms.
pm - a monitor to inform the user about progress

RasterDataLoop

public RasterDataLoop(RasterDataEvalEnv rasterDataEvalEnv,
                      Term[] terms,
                      com.bc.ceres.core.ProgressMonitor pm)
Creates an instance of this class for the given region and terms.

Parameters:
rasterDataEvalEnv - the raster data evaluation environment passed to the term evaluation
terms - an array of terms.
pm - a monitor to inform the user about progress
Method Detail

getOffsetX

public int getOffsetX()

getOffsetY

public int getOffsetY()

getRegionWidth

public int getRegionWidth()

getRegionHeight

public int getRegionHeight()

getTerms

public Term[] getTerms()

forEachPixel

public void forEachPixel(RasterDataLoop.Body body)
                  throws IOException
Evaluates the body by calling its eval() method. This method just delegates to forEachPixel(body, null).

Parameters:
body - the object whose eval method is called.
Throws:
IOException - if the raster data could not be read.

forEachPixel

public void forEachPixel(RasterDataLoop.Body body,
                         String message)
                  throws IOException
Evaluates the body by calling its eval() method.

Parameters:
body - the object whose eval method is called.
message - the progress message
Throws:
IOException - if the raster data could not be read.


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