public class PixelPicture
extends java.lang.Object
Constructor | Description |
---|---|
PixelPicture(java.lang.String filename) |
Creates a NewPic by loading the given file or URL.
|
PixelPicture(Pixel[][] bmp) |
Creates a picture given a bitmap.
|
PixelPicture(PixelPicture other) |
Copies a NewPic.
|
Modifier and Type | Method | 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() |
|
int |
getWidth() |
|
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)
p0
- first image to comparep1
- second image to comparepublic void print()
public void save(java.lang.String filename)