public class PixelPicture
extends java.lang.Object
Constructor and Description |
---|
PixelPicture(Pixel[][] bmp)
Creates a picture given a bitmap.
|
PixelPicture(PixelPicture other)
Copies a NewPic.
|
PixelPicture(java.lang.String filename)
Creates a NewPic by loading the given file or URL.
|
Modifier and Type | Method and Description |
---|---|
static int |
diff(PixelPicture p0,
PixelPicture p1)
Compute the difference between two images.
|
Pixel[][] |
getBitmap()
Gets a bitmap (i.e., matrix of pixels) of the image.
|
int |
getHeight()
Get the height of the image.
|
int |
getWidth()
Get the width of the image.
|
void |
print()
Print all of the pixels in the image to the console.
|
void |
save(java.lang.String filename) |
javax.swing.ImageIcon |
toImageIcon()
Creates an ImageIcon, suitable for display by Swing components.
|
public PixelPicture(PixelPicture other)
other
- NewPic the other NewPic to copypublic PixelPicture(java.lang.String filename)
filename
- the location of the image file to readpublic PixelPicture(Pixel[][] bmp)
bmp
- The bitmappublic int getWidth()
public int getHeight()
public Pixel[][] getBitmap()
public javax.swing.ImageIcon toImageIcon()
public static int diff(PixelPicture p0, PixelPicture p1)
public void print()
public void save(java.lang.String filename)