Class Picture

java.lang.Object
  extended by SimplePicture
      extended by Picture
All Implemented Interfaces:
DigitalPicture

public class Picture
extends SimplePicture

A class that represents a picture. This class inherits from SimplePicture and allows the student to add functionality to the Picture class.

Author:
Barbara Ericson ericson@cc.gatech.edu

Constructor Summary
Picture()
          Constructor that takes no arguments
Picture(BufferedImage image)
          Constructor that takes a buffered image
Picture(int height, int width)
          Constructor that takes the width and height
Picture(Picture copyPicture)
          Constructor that takes a picture and creates a copy of that picture
Picture(String fileName)
          Constructor that takes a file name and creates the picture
 
Method Summary
 void copy(Picture fromPic, int startRow, int startCol)
          copy from the passed fromPic to the specified startRow and startCol in the current picture
 void createCollage()
          Method to create a collage of several pictures
 void edgeDetection(int edgeDist)
          Method to show large changes in color
static void main(String[] args)
           
 void mirrorTemple()
          Mirror just part of a picture of a temple
 void mirrorVertical()
          Method that mirrors the picture around a vertical mirror in the center of the picture from left to right
 String toString()
          Method to return a string with information about this picture.
 void zeroBlue()
          Method to set the blue to 0
 
Methods inherited from class SimplePicture
addMessage, copyPicture, createGraphics, drawString, explore, getBasicPixel, getBufferedImage, getExtension, getFileName, getGraphics, getHeight, getImage, getMediaPath, getPictureFrame, getPictureWithHeight, getPictureWithWidth, getPixel, getPixels, getPixels2D, getTitle, getTransformEnclosingRect, getTranslationEnclosingRect, getWidth, hide, load, load, loadImage, loadOrFail, loadPictureAndShowIt, repaint, scale, setAllPixelsToAColor, setBasicPixel, setFileName, setPictureFrame, setTitle, setVisible, show, write, writeOrFail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Picture

public Picture()
Constructor that takes no arguments


Picture

public Picture(BufferedImage image)
Constructor that takes a buffered image

Parameters:
image - the buffered image to use

Picture

public Picture(int height,
               int width)
Constructor that takes the width and height

Parameters:
height - the height of the desired picture
width - the width of the desired picture

Picture

public Picture(Picture copyPicture)
Constructor that takes a picture and creates a copy of that picture

Parameters:
copyPicture - the picture to copy

Picture

public Picture(String fileName)
Constructor that takes a file name and creates the picture

Parameters:
fileName - the name of the file to create the picture from
Method Detail

copy

public void copy(Picture fromPic,
                 int startRow,
                 int startCol)
copy from the passed fromPic to the specified startRow and startCol in the current picture

Parameters:
fromPic - the picture to copy from
startRow - the start row to copy to
startCol - the start col to copy to

createCollage

public void createCollage()
Method to create a collage of several pictures


edgeDetection

public void edgeDetection(int edgeDist)
Method to show large changes in color

Parameters:
edgeDist - the distance for finding edges

main

public static void main(String[] args)

mirrorTemple

public void mirrorTemple()
Mirror just part of a picture of a temple


mirrorVertical

public void mirrorVertical()
Method that mirrors the picture around a vertical mirror in the center of the picture from left to right


toString

public String toString()
Method to return a string with information about this picture.

Overrides:
toString in class SimplePicture
Returns:
a string with information about the picture such as fileName, height and width.

zeroBlue

public void zeroBlue()
Method to set the blue to 0