org.jaitools.jiffle.runtime
Interface JiffleRuntime

All Known Subinterfaces:
JiffleDirectRuntime, JiffleIndirectRuntime
All Known Implementing Classes:
AbstractDirectRuntime, AbstractIndirectRuntime, AbstractJiffleRuntime

public interface JiffleRuntime

The root interface for Jiffle runtime classes.

Since:
0.1
Version:
$Id: JiffleRuntime.java 1653 2011-06-16 10:23:02Z michael.bedward $
Author:
Michael Bedward

Method Summary
 java.lang.String[] getDestinationVarNames()
          Gets the variable names associated with destination images.
 double getHeight()
          Gets the height of the processing area.
 double getMaxX()
          Gets the max X ordinate of the processing area.
 double getMaxY()
          Gets the max Y ordinate of the processing area.
 double getMinX()
          Gets the min X ordinate of the processing area.
 double getMinY()
          Gets the min Y ordinate of the processing area.
 long getNumPixels()
          Gets the total number of pixels in the processing area.
 java.lang.String[] getSourceVarNames()
          Gets the variable names associated with source images.
 java.lang.Double getVar(java.lang.String varName)
          Returns the value of a variable that was declared in the script's init block.
 java.lang.String[] getVarNames()
          Returns the names of image scope variables that can be used with the getVar(String) and setVar(String, Double) methods.
 double getWidth()
          Gets the width of the processing area.
 double getXRes()
          Gets the pixel width (resolution in X direction) in world units.
 double getYRes()
          Gets the pixel height (resolution in Y direction) in world units.
 boolean isWorldSet()
          Checks whether the world bounds and pixel dimensions have been set.
 void setDefaultTransform(CoordinateTransform tr)
          Sets a coordinate transform to be used by any source and destination images submitted to the runtime object without their own transforms.
 void setImageParams(java.util.Map<java.lang.String,Jiffle.ImageRole> imageParams)
          Supplies the runtime object with the names and roles if image variables used in the script.
 void setVar(java.lang.String varName, java.lang.Double value)
          Sets the value of a variable that was declared in the script's init block, overriding the default value in the script if present.
 void setWorldByNumPixels(java.awt.geom.Rectangle2D bounds, int numX, int numY)
          Sets the world (processing area) bounds and the number of pixels in the X and Y directions.
 void setWorldByResolution(java.awt.geom.Rectangle2D bounds, double xres, double yres)
          Sets the world (processing area) bounds and resolution (pixel dimensions).
 

Method Detail

setWorldByResolution

void setWorldByResolution(java.awt.geom.Rectangle2D bounds,
                          double xres,
                          double yres)
Sets the world (processing area) bounds and resolution (pixel dimensions).

Parameters:
bounds - outer bounds of the processing area
xres - pixel width in world units
yres - pixel height in world units
Throws:
java.lang.IllegalArgumentException - if bounds is null or empty

setWorldByNumPixels

void setWorldByNumPixels(java.awt.geom.Rectangle2D bounds,
                         int numX,
                         int numY)
Sets the world (processing area) bounds and the number of pixels in the X and Y directions.

Parameters:
bounds - outer bounds of the processing area
numX - number of pixels in the X direction
numY - number of pixels in the Y direction
Throws:
java.lang.IllegalArgumentException - if bounds is null or empty

setDefaultTransform

void setDefaultTransform(CoordinateTransform tr)
                         throws JiffleException
Sets a coordinate transform to be used by any source and destination images submitted to the runtime object without their own transforms. This includes any images submitted prior to calling this method. If tr is null the system default transform (IdentityCoordinateTransform) will be used.

Parameters:
tr - the coordinate transform to use as the default; or null for the system default
Throws:
JiffleException - if the world bounds and resolution have not been set previously

getMinX

double getMinX()
Gets the min X ordinate of the processing area.

Returns:
min X ordinate in world units

getMaxX

double getMaxX()
Gets the max X ordinate of the processing area.

Returns:
max X ordinate in world units

getMinY

double getMinY()
Gets the min Y ordinate of the processing area.

Returns:
min Y ordinate in world units

getMaxY

double getMaxY()
Gets the max Y ordinate of the processing area.

Returns:
max Y ordinate in world units

getWidth

double getWidth()
Gets the width of the processing area.

Returns:
the width in world units

getHeight

double getHeight()
Gets the height of the processing area.

Returns:
the height in world units

getXRes

double getXRes()
Gets the pixel width (resolution in X direction) in world units.

Returns:
pixel width

getYRes

double getYRes()
Gets the pixel height (resolution in Y direction) in world units.

Returns:
pixel height

getNumPixels

long getNumPixels()
Gets the total number of pixels in the processing area.

Returns:
number of pixels
Throws:
java.lang.IllegalStateException - if the processing area has not been set

isWorldSet

boolean isWorldSet()
Checks whether the world bounds and pixel dimensions have been set.

Returns:
true if set; false otherwise

getVarNames

java.lang.String[] getVarNames()
Returns the names of image scope variables that can be used with the getVar(String) and setVar(String, Double) methods.

Returns:
array of variable names; may be empty but not null

getVar

java.lang.Double getVar(java.lang.String varName)
Returns the value of a variable that was declared in the script's init block.

Parameters:
varName - variable name
Returns:
the values or null if the variable name is not found

setVar

void setVar(java.lang.String varName,
            java.lang.Double value)
            throws JiffleRuntimeException
Sets the value of a variable that was declared in the script's init block, overriding the default value in the script if present. Setting value to null results in the default script value being used.

Parameters:
varName - variable name
value - the new value
Throws:
JiffleRuntimeException - if the variable name is not found

setImageParams

void setImageParams(java.util.Map<java.lang.String,Jiffle.ImageRole> imageParams)
Supplies the runtime object with the names and roles if image variables used in the script. Although this is a public method it is not intended for general use. It is called by the jaitools.jiffle.Jiffle instance that is creating the runtime object so that clients can use the getSourceVarNames() and getDestinationVarNames() methods.

Parameters:
imageParams - a Map of variable names (key) and roles (value)

getSourceVarNames

java.lang.String[] getSourceVarNames()
Gets the variable names associated with source images.

Returns:
an array of names; may be empty but not null

getDestinationVarNames

java.lang.String[] getDestinationVarNames()
Gets the variable names associated with destination images.

Returns:
an array of names; may be empty but not null


Copyright © 2011. All Rights Reserved.