jaitools.jiffle.runtime
Class AbstractDirectRuntime

java.lang.Object
  extended by jaitools.jiffle.runtime.AbstractJiffleRuntime
      extended by jaitools.jiffle.runtime.AbstractDirectRuntime
All Implemented Interfaces:
JiffleDirectRuntime, JiffleRuntime

public abstract class AbstractDirectRuntime
extends AbstractJiffleRuntime
implements JiffleDirectRuntime

The default abstract base class for runtime classes that implement direct evaluation.

Since:
1.1
Version:
$Id: AbstractDirectRuntime.java 1505 2011-03-05 11:37:43Z michael.bedward $
Author:
Michael Bedward

Field Summary
protected  int _height
          Processing bounds height
protected  int _maxx
          Processing bounds max X ordinate
protected  int _maxy
          Processing bounds max Y ordinate
protected  int _minx
          Processing bounds min X ordinate
protected  int _miny
          Processing bounds min Y ordinate
protected  int _width
          Processing bounds width
protected  Map images
          Maps image variable names (String) to images (RenderedImage).
protected  Map readers
          Maps source image variable names (String) to image iterators (RandomIter).
protected  Map writers
          Maps destination image variable names (String to image iterators (WritableRandomIter).
 
Fields inherited from class jaitools.jiffle.runtime.AbstractJiffleRuntime
_FN, _outsideValue, _outsideValueSet, _stk
 
Constructor Summary
AbstractDirectRuntime()
          Creates a new instance.
 
Method Summary
 void evaluateAll(JiffleProgressListener pl)
          Evaluates the script for all locations in the destination image(s).
 double readFromImage(String imageName, int x, int y, int band)
          Gets a value from a source image as a double.
 void setBounds(int minx, int miny, int width, int height)
          Set the bounds of the processing area.
 void setDestinationImage(String imageName, WritableRenderedImage image)
          Associates a name, as used in the Jiffle script, with a destination image.
 void setSourceImage(String imageName, RenderedImage image)
          Associates a name, as used in the Jiffle script, with a source image.
 void writeToImage(String imageName, int x, int y, int band, double value)
          Writes a value to a destination image.
 
Methods inherited from class jaitools.jiffle.runtime.AbstractJiffleRuntime
getVar, initImageScopeVars, initOptionVars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jaitools.jiffle.runtime.JiffleDirectRuntime
evaluate
 
Methods inherited from interface jaitools.jiffle.runtime.JiffleRuntime
getVar
 

Field Detail

images

protected Map images
Maps image variable names (String) to images (RenderedImage).


readers

protected Map readers
Maps source image variable names (String) to image iterators (RandomIter).


writers

protected Map writers
Maps destination image variable names (String to image iterators (WritableRandomIter).


_minx

protected int _minx
Processing bounds min X ordinate


_miny

protected int _miny
Processing bounds min Y ordinate


_maxx

protected int _maxx
Processing bounds max X ordinate


_maxy

protected int _maxy
Processing bounds max Y ordinate


_width

protected int _width
Processing bounds width


_height

protected int _height
Processing bounds height

Constructor Detail

AbstractDirectRuntime

public AbstractDirectRuntime()
Creates a new instance.

Method Detail

setDestinationImage

public void setDestinationImage(String imageName,
                                WritableRenderedImage image)
Associates a name, as used in the Jiffle script, with a destination image.

Specified by:
setDestinationImage in interface JiffleDirectRuntime
Parameters:
imageName - image name as used in the Jiffle script
image - writable image

setBounds

public void setBounds(int minx,
                      int miny,
                      int width,
                      int height)
Set the bounds of the processing area. Usually this will be the bounds of the destination image(s).

Specified by:
setBounds in interface JiffleRuntime
Parameters:
minx - min X pixel ordinate
miny - min Y pixel ordinate
width - width of processing area
height - height of processing area

setSourceImage

public void setSourceImage(String imageName,
                           RenderedImage image)
Associates a name, as used in the Jiffle script, with a source image.

Specified by:
setSourceImage in interface JiffleDirectRuntime
Parameters:
imageName - image name as used in the Jiffle script
image - writable image

evaluateAll

public void evaluateAll(JiffleProgressListener pl)
Evaluates the script for all locations in the destination image(s).

Specified by:
evaluateAll in interface JiffleDirectRuntime
Parameters:
pl - an optional progress listener (may be null

readFromImage

public double readFromImage(String imageName,
                            int x,
                            int y,
                            int band)
Gets a value from a source image as a double.

Specified by:
readFromImage in interface JiffleDirectRuntime
Parameters:
imageName - the source image
x - source X ordinate
y - source Y ordinate
band - source band
Returns:
image value

writeToImage

public void writeToImage(String imageName,
                         int x,
                         int y,
                         int band,
                         double value)
Writes a value to a destination image.

Specified by:
writeToImage in interface JiffleDirectRuntime
x - destination X ordinate
y - destination Y ordinate
band - destination band
value - the value to write


Copyright © 2009-2011. All Rights Reserved.