Class Grey

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

class Grey
extends ModuleData
implements Data
The Grey data structure contains a Black & White (grey scaled) picture. The pixels of this picture are stored in a single dimension byte array (pixels). Each pixel is represented by a 8 bits byte good for 256 shades of grey.

Version:
$Revision: 1.4 $
See Also:
Data, pixels

Variable Index

 o height
 o pixels
This array contains the all pixels of the picture stored in a single dimension byte array good for 256 pixels per pixel.
 o width

Constructor Index

 o Grey()

Method Index

 o canLoad()
Indicates whether the data objects of this type can be loaded from disk.
 o canSave()
Indicates whether the data objects of this type can be saved to disk.
 o display(String, String)
All Data classes can have a display method that displays the data in a dialog window.
 o displayAlienData(String, String, Data)
Displays Data from another Data class using this Grey object.
 o getHeight()
The width of the Grey picture.
 o getLoadTags()
No extensions have to be defined since no load method is implemented.
 o getPixels()
Get the pixel array.
 o getSaveTags()
No extensions have to be defined since no save method is implemented.
 o getWidth()
Get the height of the Grey picture.
 o grey2image()
 o makePixels(int, int)
The method makePixels can be used to allocate memory for the pixels array of the Grey picture.
 o toString()
Print part of the Grey data to see if the Grey data object contains data or not.

Variables

 o height
 private int height
 o width
 private int width
 o pixels
 public byte pixels[]
This array contains the all pixels of the picture stored in a single dimension byte array good for 256 pixels per pixel.

Constructors

 o Grey
 Grey()

Methods

 o makePixels
 public void makePixels(int width,
                        int height)
The method makePixels can be used to allocate memory for the pixels array of the Grey picture. The size of the pixels array is determined by the width and height parameters of this method.

See Also:
pixels
 o getPixels
 public byte[] getPixels()
Get the pixel array.

 o getWidth
 public int getWidth()
Get the height of the Grey picture.

 o getHeight
 public int getHeight()
The width of the Grey picture.

 o canLoad
 public boolean canLoad()
Indicates whether the data objects of this type can be loaded from disk. Load Grey picture is not implemented since this data format is just an intermediate data type. One can load Image data and convert that data to the Grey data type.

Overrides:
canLoad in class ModuleData
See Also:
load
 o canSave
 public boolean canSave()
Indicates whether the data objects of this type can be saved to disk. Save Grey picture is not implemented since this data format is just an intermediate data type. One can best convert the Grey data to Image and save the Image data.

Overrides:
canSave in class ModuleData
See Also:
save
 o getLoadTags
 protected String[] getLoadTags()
No extensions have to be defined since no load method is implemented.

Overrides:
getLoadTags in class ModuleData
 o getSaveTags
 protected String[] getSaveTags()
No extensions have to be defined since no save method is implemented.

Overrides:
getSaveTags in class ModuleData
 o grey2image
 public Image grey2image()
 o display
 public DataVisualisation display(String title,
                                  String filename)
All Data classes can have a display method that displays the data in a dialog window.

Overrides:
display in class ModuleData
 o displayAlienData
 public DataVisualisation displayAlienData(String title,
                                           String filename,
                                           Data data)
Displays Data from another Data class using this Grey object.

 o toString
 public String toString()
Print part of the Grey data to see if the Grey data object contains data or not. This method is mainly for debugging purposes.

Overrides:
toString in class Object