|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AbstractDigitalPicture
This interface provisions for the basic methods that are needed when dealing with a digital picture. A digital picture can be created in three ways: from a file name, from another image, or from a width and height specification. A digital picture has accessor and mutator methods for its pixels. A digital picture can be displayed graphically. A digital picture has an associated string which serves as the picture's title. A digital picture has a rectangular grid of pixels.
Method Summary | |
---|---|
int |
getBasicPixel(int x,
int y)
Returns the colour information about the specified pixel, as encoded in an int value. |
java.awt.image.BufferedImage |
getBufferedImage()
Returns the BufferedImage from the picture |
java.lang.String |
getFileName()
Get the name of the file associated with this digital picture, if one exists. |
int |
getHeight()
Returns the height of this picture in pixels. |
java.awt.Image |
getImage()
Returns the Image from the picture |
Pixel |
getPixel(int x,
int y)
Returns the Pixel object at the specified (x,y) coordinate. |
java.lang.String |
getTitle()
Get the string that encapsulates the title that is associated with this digital picture. |
int |
getWidth()
Returns the width of this picture in pixels. |
void |
load(java.awt.Image image)
|
void |
load(java.lang.String fileName)
Reads the image from the passed filename and construct a corresponding digital picture. |
void |
setBasicPixel(int x,
int y,
int rgb)
Sets the colour of the specified pixel, as encoded in the passed int value. |
void |
setTitle(java.lang.String title)
Set the string that encapsulates the title that is associated with this digital picture. |
void |
show()
Invokes functionality to show this picture on the graphical display. |
Method Detail |
---|
java.lang.String getFileName()
java.lang.String getTitle()
void setTitle(java.lang.String title)
int getWidth()
int getHeight()
java.awt.Image getImage()
java.awt.image.BufferedImage getBufferedImage()
int getBasicPixel(int x, int y)
x
- the x position of the pixely
- the y position of the pixel
void setBasicPixel(int x, int y, int rgb)
x
- the x position of the pixely
- the y position of the pixelPixel getPixel(int x, int y)
x
- the x position of the pixely
- the y position of the pixel
void load(java.awt.Image image)
void load(java.lang.String fileName) throws java.lang.Exception
fileName
- as described above
java.lang.Exception
- if the contents of the passed filename cannot be understood
as a image.void show()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |