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
-
height
-
-
pixels
- This array contains the all pixels of the picture stored in a single
dimension byte array good for 256 pixels per pixel.
-
width
-
-
Grey()
-
-
canLoad()
- Indicates whether the data objects of this type can be loaded from
disk.
-
canSave()
- Indicates whether the data objects of this type can be saved to
disk.
-
display(String, String)
- All Data classes can have a display method that displays the data in a
dialog window.
-
displayAlienData(String, String, Data)
- Displays Data from another Data class using this Grey object.
-
getHeight()
- The width of the Grey picture.
-
getLoadTags()
- No extensions have to be defined since no load method is implemented.
-
getPixels()
- Get the pixel array.
-
getSaveTags()
- No extensions have to be defined since no save method is implemented.
-
getWidth()
- Get the height of the Grey picture.
-
grey2image()
-
-
makePixels(int, int)
- The method makePixels can be used to allocate memory for the pixels
array of the Grey picture.
-
toString()
- Print part of the Grey data to see if the Grey data object contains
data or not.
height
private int height
width
private int width
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.
Grey
Grey()
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
getPixels
public byte[] getPixels()
- Get the pixel array.
getWidth
public int getWidth()
- Get the height of the Grey picture.
getHeight
public int getHeight()
- The width of the Grey picture.
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
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
getLoadTags
protected String[] getLoadTags()
- No extensions have to be defined since no load method is implemented.
- Overrides:
- getLoadTags in class ModuleData
getSaveTags
protected String[] getSaveTags()
- No extensions have to be defined since no save method is implemented.
- Overrides:
- getSaveTags in class ModuleData
grey2image
public Image grey2image()
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
displayAlienData
public DataVisualisation displayAlienData(String title,
String filename,
Data data)
- Displays Data from another Data class using this Grey object.
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