jaitools.jiffle.runtime
Class AbstractIndirectRuntime

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

public abstract class AbstractIndirectRuntime
extends AbstractJiffleRuntime
implements JiffleIndirectRuntime

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

Since:
1.1
Version:
$Id: AbstractIndirectRuntime.java 1383 2011-02-10 11:22:29Z michael.bedward $
Author:
Michael Bedward

Field Summary
protected  int _height
          Processing bounds height
protected  int _minx
          Processing bounds min X ordinate
protected  int _miny
          Processing bounds min Y ordinate
protected  int _width
          Processing bounds width
 
Fields inherited from class jaitools.jiffle.runtime.AbstractJiffleRuntime
_FN, _outsideValue, _outsideValueSet, _stk
 
Constructor Summary
AbstractIndirectRuntime()
           
 
Method Summary
protected abstract  void initImageScopeVars()
          Initializes image-scope variables.
 double readFromImage(String srcImageName, 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)
          Specifies the variable in the Jiffle script which refers to the destination image.
 void setSourceImage(String imageName, RenderedImage image)
          Associates a variable name in the Jiffle script with a source image.
 
Methods inherited from class jaitools.jiffle.runtime.AbstractJiffleRuntime
getVar, 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.JiffleIndirectRuntime
evaluate
 
Methods inherited from interface jaitools.jiffle.runtime.JiffleRuntime
getVar
 

Field Detail

_minx

protected int _minx
Processing bounds min X ordinate


_miny

protected int _miny
Processing bounds min Y ordinate


_width

protected int _width
Processing bounds width


_height

protected int _height
Processing bounds height

Constructor Detail

AbstractIndirectRuntime

public AbstractIndirectRuntime()
Method Detail

setDestinationImage

public void setDestinationImage(String imageName)
Description copied from interface: JiffleIndirectRuntime
Specifies the variable in the Jiffle script which refers to the destination image.

Specified by:
setDestinationImage in interface JiffleIndirectRuntime
Parameters:
imageName - variable name as used in the Jiffle script

setSourceImage

public void setSourceImage(String imageName,
                           RenderedImage image)
Description copied from interface: JiffleIndirectRuntime
Associates a variable name in the Jiffle script with a source image.

Specified by:
setSourceImage in interface JiffleIndirectRuntime
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)
Description copied from interface: JiffleRuntime
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

readFromImage

public double readFromImage(String srcImageName,
                            int x,
                            int y,
                            int band)
Description copied from interface: JiffleIndirectRuntime
Gets a value from a source image as a double.

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

initImageScopeVars

protected abstract void initImageScopeVars()
Initializes image-scope variables. These are fields in the runtime class. They are initialized in a separate method rather than the constructor because they may depend on expressions involving values that are not known until the processing area is set (e.g. Jiffle's width() function).

Specified by:
initImageScopeVars in class AbstractJiffleRuntime


Copyright © 2009-2011. All Rights Reserved.