Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDigitalPicture.java
More file actions
Latest commit
executable file
·33 lines (32 loc) · 1.71 KB
/
Copy pathDigitalPicture.java
File metadata and controls
executable file
·33 lines (32 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
importjava.awt.Image;
importjava.awt.image.BufferedImage;
/**
* Interface to describe a digital picture. A digital picture can have an
* associated file name. It can have a title. It has pixels
* associated with it and you can get and set the pixels. You
* can get an Image from a picture or a BufferedImage. You can load
* it from a file name or image. You can show a picture. You can
* explore a picture. You can create a new image for it.
*
* @author Barb Ericson ericson@cc.gatech.edu
*/
publicinterfaceDigitalPicture
{
publicStringgetFileName(); // get the file name that the picture came from
publicStringgetTitle(); // get the title of the picture
publicvoidsetTitle(Stringtitle); // set the title of the picture
publicintgetWidth(); // get the width of the picture in pixels
publicintgetHeight(); // get the height of the picture in pixels
publicImagegetImage(); // get the image from the picture
publicBufferedImagegetBufferedImage(); // get the buffered image
publicintgetBasicPixel(intx, inty); // get the pixel information as an int
publicvoidsetBasicPixel(intx, inty, intrgb); // set the pixel information
publicPixelgetPixel(intx, inty); // get the pixel information as an object
publicPixel[] getPixels(); // get all pixels in row-major order
publicPixel[][] getPixels2D(); // get 2-D array of pixels in row-major order
publicvoidload(Imageimage); // load the image into the picture
publicbooleanload(StringfileName); // load the picture from a file
publicvoidshow(); // show the picture
publicvoidexplore(); // explore the picture
publicbooleanwrite(StringfileName); // write out a file
}