|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJSci.Demos.wavelet.PixelArray
public final class PixelArray
This is a simple implementation of the PixelGrabber class to allow for easier image processing. Basically, it reads a graphic file and allows you to get integer arrays from it for convenient processing. The name of the class comes from the fact that the image is stored as an internal int[][] array. This might seem inefficient since the JDK stores images as an int[] array and that we must go back and forth between the two formats. It is indeed slower, but as far as image processing is concerned, it is much simpler to work with an int[][] array. Moreover, if the processing is moderatly involved, it won't make much difference.
Field Summary |
---|
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PixelArray(double[][] D)
|
|
PixelArray(int[][] I)
|
|
PixelArray(java.lang.String filename)
Constructor |
|
PixelArray(java.net.URL url)
Constructor |
Method Summary | |
---|---|
PixelArray[][] |
blueFWT(Multiresolution m)
Fast Wavelet Transform This method assumes a dyadic multiresolution. |
static java.awt.Image |
buildImage(int[][] a)
|
java.lang.Object |
clone()
|
int |
getAlpha(int x,
int y)
|
int[][] |
getAlphaArray(int x,
int y)
|
int[][] |
getArray(int x,
int y)
|
int |
getBlue(int x,
int y)
|
int[][] |
getBlueArray()
|
int |
getGreen(int x,
int y)
|
int[][] |
getGreenArray()
|
int |
getHeight()
|
int |
getRed(int x,
int y)
|
int[][] |
getRedArray()
|
int |
getWidth()
|
PixelArray[][] |
greenFWT(Multiresolution m)
Fast Wavelet Transform This method assumes a dyadic multiresolution. |
boolean |
imageUpdate(java.awt.Image img1,
int parm2,
int parm3,
int parm4,
int parm5,
int parm6)
Part of the interface ImageObserver |
void |
invert()
|
void |
makeBlue()
|
void |
makeGrayFromBlue()
|
void |
makeGrayFromGreen()
|
void |
makeGrayFromRed()
|
void |
makeGreen()
|
void |
makeRed()
|
java.awt.Image |
rebuildImage()
Get the image back |
PixelArray[][] |
redFWT(Multiresolution m)
Fast Wavelet Transform This method assumes a dyadic multiresolution. |
static int |
RGBtoInt(int r,
int g,
int b,
int a)
|
void |
setAlphaArray(int[][] I)
|
void |
setArray(int[][] s)
Allow to change the array representing the image |
void |
setBlueArray(int[][] I)
|
void |
setGreenArray(int[][] I)
|
void |
setPixel(int x,
int y,
int r,
int g,
int b,
int a)
|
void |
setRedArray(int[][] I)
|
void |
waitForImage(java.awt.Image img)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PixelArray(java.lang.String filename)
filename
- file containing the image
java.lang.IllegalArgumentException
- if the file
can't be open. Either the format is wrong or the
file cannot be found.public PixelArray(java.net.URL url)
filename
- file containing the image
java.lang.IllegalArgumentException
- if the file
can't be open. Either the format is wrong or the
file cannot be found.public PixelArray(int[][] I)
public PixelArray(double[][] D)
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public int getWidth()
public int getHeight()
public void setRedArray(int[][] I)
public void setGreenArray(int[][] I)
public void setBlueArray(int[][] I)
public void setAlphaArray(int[][] I)
public boolean imageUpdate(java.awt.Image img1, int parm2, int parm3, int parm4, int parm5, int parm6)
imageUpdate
in interface java.awt.image.ImageObserver
public void waitForImage(java.awt.Image img)
public static int RGBtoInt(int r, int g, int b, int a)
public void invert()
public void makeGrayFromRed()
public void makeGrayFromGreen()
public void makeGrayFromBlue()
public void makeRed()
public void makeGreen()
public void makeBlue()
public void setPixel(int x, int y, int r, int g, int b, int a)
public void setArray(int[][] s)
java.lang.IllegalArgumentException
- if array doesn't make a matrixpublic int getRed(int x, int y)
public int getGreen(int x, int y)
public int getBlue(int x, int y)
public int getAlpha(int x, int y)
public int[][] getRedArray()
public int[][] getGreenArray()
public int[][] getBlueArray()
public int[][] getAlphaArray(int x, int y)
public int[][] getArray(int x, int y)
public PixelArray[][] redFWT(Multiresolution m)
public PixelArray[][] greenFWT(Multiresolution m)
public PixelArray[][] blueFWT(Multiresolution m)
public java.awt.Image rebuildImage()
public static java.awt.Image buildImage(int[][] a)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |