Class Mask

java.lang.Object
   |
   +----framework.ModuleData
           |
           +----Mask

class Mask
extends ModuleData
implements Data
The Mask data structure contains convolution mask that can be used for filtering images.

See Also:
ConvolutionModule

Variable Index

 o mask
mask is an integer array that holds the mask that is used for convolution.
 o x
Horizontal size of mask
 o y
Vertical size of mask

Constructor Index

 o Mask()

Method Index

 o display(String, String)
Display the Mask in a dialog window.
 o getLoadTags()
Define the valid extensions that files of this data type may use when loading data from disk.
 o getSaveTags()
Define the valid extensions that files of this data type may use when saving data to disk.
 o getX()
 o getY()
 o load(String)
Load the Mask Data from disk.
 o main(String[])
 o makeMask(int, int)
The method makeMask can be used to initialise the mask array and the x and y variables
 o save(String)
Save the Mask to disk.
 o setX(int)
 o setY(int)
 o toString()

Variables

 o x
 private int x
Horizontal size of mask

 o y
 private int y
Vertical size of mask

 o mask
 byte mask[]
mask is an integer array that holds the mask that is used for convolution. The size of mask is defined by the vertical and horizontal sizes x and y.

See Also:
x, y

Constructors

 o Mask
 Mask()

Methods

 o makeMask
 public void makeMask(int x,
                      int y)
The method makeMask can be used to initialise the mask array and the x and y variables

See Also:
mask, x, y
 o getX
 public int getX()
 o setX
 public void setX(int x)
 o getY
 public int getY()
 o setY
 public void setY(int y)
 o getLoadTags
 protected String[] getLoadTags()
Define the valid extensions that files of this data type may use when loading data from disk.

Overrides:
getLoadTags in class ModuleData
 o getSaveTags
 protected String[] getSaveTags()
Define the valid extensions that files of this data type may use when saving data to disk.

Overrides:
getSaveTags in class ModuleData
 o load
 public void load(String filename) throws FileNotFoundException, IOException
Load the Mask Data from disk. This method uses the StreamTokenizor, in this case end of lines are ignored. The first two integers in the file are considered to be the horizontal (x) and vertical (y) size of the mask. The rest of the integers is the mask itself (x * y bytes).

Overrides:
load in class ModuleData
See Also:
x, y, mask
 o save
 public void save(String filename) throws FileNotFoundException, IOException
Save the Mask to disk. Both the load and the save function for Mask Data are in the LCMModule library so that library is loaded when this data type is used. The save function is called via the intermediate C function nativeSave.

Overrides:
save in class ModuleData
See Also:
nativeSave
 o display
 public DataVisualisation display(String title,
                                  String filename)
Display the Mask in a dialog window.

Overrides:
display in class ModuleData
 o toString
 public String toString()
Overrides:
toString in class Object
 o main
 public static void main(String args[])