public class Photograph
extends java.lang.Object
| Constructor and Description |
|---|
Photograph(int width,
int height)
Create a blank photo of a specified size.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object p)
Standard equals method.
|
int |
getHt()
Access height of photo.
|
java.awt.image.BufferedImage |
getImage() |
Pixel |
getPixel(int x,
int y)
Access one of the Pixels in the photo.
|
int |
getWd()
Access width of photo.
|
void |
setPixel(int x,
int y,
Pixel p)
Set one of the Pixels in the photo.
|
public Photograph(int width,
int height)
width - width of photo to be createdheight - height of photo to be createdpublic java.awt.image.BufferedImage getImage()
public int getWd()
public int getHt()
public Pixel getPixel(int x, int y)
x - x-coordinate of desired pixely - y-coordinate of desired pixelpublic void setPixel(int x,
int y,
Pixel p)
x - x-coordinate of the desired pixely - y-coordinate of the desired pixelp - pixel to be placed at position (x, y) of the photograph. Note that the
origin (0, 0) is located at the upper left corner of the photo.public boolean equals(java.lang.Object p)
equals in class java.lang.Object