Interface DigitalPicture

All Known Implementing Classes:
Picture, SimplePicture

public interface DigitalPicture

Interface to describe a digital picture. A digital picture can have a associated file name and a title. It has pixels associated with it and you can get and set the pixels. You can get an Image or a BufferedImage from a picture. You can load it from a file name or image. You can show a picture. You can create a new image for it.
Copyright Georgia Institute of Technology 2004

Author:
Barb Ericson ericson@cc.gatech.edu

Method Summary
 int getBasicPixel(int x, int y)
          Returns the pixel value of a pixel in the DigitalPicture, given its coordinates.
 java.awt.image.BufferedImage getBufferedImage()
          Method to get a BufferedImage from the DigitalPicture
 java.lang.String getFileName()
          Method to get the file name associated with the DigitalPicture
 int getHeight()
          Method to get the height of the DigitalPicture in pixels
 java.awt.Image getImage()
          Method to get an Image from the DigitalPicture
 Pixel getPixel(int x, int y)
          Returns a Pixel object representing a pixel in the DigitalPicture given its coordinates
 java.lang.String getTitle()
          Method to get the title of the DigitalPicture
 int getWidth()
          Method to get the width of the DigitalPicture in pixels
 void load(java.awt.Image image)
          Method to load the passed image into the DigitalPicture
 boolean load(java.lang.String fileName)
          Method to load the contents of the passed filename into the DigitalPicture without throwing errors
 void setBasicPixel(int x, int y, int rgb)
          Sets the value of a pixel in the DigitalPicture.
 void setTitle(java.lang.String title)
          Method to set the title for the DigitalPicture
 void show()
          Method to show the picture in a picture frame
 

Method Detail

getFileName

java.lang.String getFileName()
Method to get the file name associated with the DigitalPicture

Returns:
the file name associated with the DigitalPicture

getTitle

java.lang.String getTitle()
Method to get the title of the DigitalPicture

Returns:
the title of the DigitalPicture

setTitle

void setTitle(java.lang.String title)
Method to set the title for the DigitalPicture

Parameters:
title - the title to use for the DigitalPicture

getWidth

int getWidth()
Method to get the width of the DigitalPicture in pixels

Returns:
the width of the DigitalPicture in pixels

getHeight

int getHeight()
Method to get the height of the DigitalPicture in pixels

Returns:
the height of the DigitalPicture in pixels

getImage

java.awt.Image getImage()
Method to get an Image from the DigitalPicture

Returns:
the Image object

getBufferedImage

java.awt.image.BufferedImage getBufferedImage()
Method to get a BufferedImage from the DigitalPicture

Returns:
the BufferedImage object

getBasicPixel

int getBasicPixel(int x,
                  int y)
Returns the pixel value of a pixel in the DigitalPicture, given its coordinates.

Parameters:
x - the x coordinate of the pixel
y - the y coordinate of the pixel
Returns:
the pixel value as an integer

setBasicPixel

void setBasicPixel(int x,
                   int y,
                   int rgb)
Sets the value of a pixel in the DigitalPicture.

Parameters:
x - the x coordinate of the pixel
y - the y coordinate of the pixel
rgb - the new rgb value of the pixel

getPixel

Pixel getPixel(int x,
               int y)
Returns a Pixel object representing a pixel in the DigitalPicture given its coordinates

Parameters:
x - the x coordinates of the pixel
y - the y coordinates of the pixel
Returns:
a Pixel object representing the requested pixel

load

void load(java.awt.Image image)
Method to load the passed image into the DigitalPicture

Parameters:
image - the image to use

load

boolean load(java.lang.String fileName)
Method to load the contents of the passed filename into the DigitalPicture without throwing errors

Parameters:
fileName - the name of the file of the picture to load
Returns:
true if success else false

show

void show()
Method to show the picture in a picture frame