|
JIGL v1.6 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jigl.image.GrayImage
GrayImage is implemented by a 2 dimension array of shorts.
| Field Summary | |
protected short[][] |
data
Two dimensional integer array to store image content. |
protected int |
X
Cartesian width |
protected int |
Y
Cartesian height |
| Constructor Summary | |
GrayImage()
Creates an empty GrayImage with a height and width of zero |
|
GrayImage(GrayImage img)
Creates a two dimensional GrayImage from GrayImage img |
|
GrayImage(Image img)
Creates an two dimensional GrayImage from the standard java.awt.Image |
|
GrayImage(int x,
int y)
Creates a two dimensional GrayImage with a width and height of x and y repectively |
|
GrayImage(int x,
int y,
short[] data)
Creates a two dimensional GrayImage with a height and width of x and y repectively |
|
GrayImage(short[][] data)
Creates a two dimensional GrayImage from a two dimensional array |
|
| Method Summary | |
int |
absSum()
Adds absolute value of all the values together |
GrayImage |
add(GrayImage im)
Adds another GrayImage to this image |
GrayImage |
add(GrayImage im,
ROI sourceROI,
ROI destROI)
Adds a Region of Interest (sourceROI) in another GrayImage to a Region of Interest (destROI) of this image |
GrayImage |
add(int v)
Adds a value to all the pixels in this image |
void |
add(int x,
int y,
int value)
Adds a value to a single pixel |
void |
add(int x,
int y,
int value,
ROI roi)
Adds a value to a single pixel in a Region of Interest |
GrayImage |
add(int v,
ROI roi)
Adds a value to all the pixels in a Region of Interest |
GrayImage |
addbuffer(int w,
int h,
int color)
Makes a copy of this image with a buffer so the resulting image has a width w and height h |
GrayImage |
addbuffer(int w,
int h,
int xoff,
int yoff,
int color)
Makes a copy of this image with a buffer so the resulting image has a width w and height h |
int |
addSum()
Adds all the values together |
void |
byteSize()
Scales the range of this image to byte (0..255) |
void |
byteSize(ROI roi)
Scales the range of a region of interest of this image to byte (0..255) |
GrayImage |
clear()
Clears the image to zero |
GrayImage |
clear(int val)
Clears to constant value |
void |
clip(int min,
int max)
Clips the range of this image to an arbitrary min/max |
void |
clip(int min,
int max,
ROI roi)
Clips the range of this image to an arbitrary min/max in a Region of Interest |
Image |
copy()
Makes a deep copy of this image |
Image |
copy(ROI roi)
Makes a deep copy of a Region of Interest |
GrayImage |
diff(GrayImage im)
Subtracts the second image from the first and returns the absolute value. |
GrayImage |
divide(GrayImage im)
Divides this image by a GrayImage |
GrayImage |
divide(GrayImage im,
ROI sourceROI,
ROI destROI)
Divides by a Region of Interest (sourceROI) in this image by a Region of Interest (destROI) of another GrayImage |
GrayImage |
divide(int v)
Divides all the pixels in this image by a value |
void |
divide(int x,
int y,
int value)
Divides a single pixel by a value |
void |
divide(int x,
int y,
int value,
ROI roi)
Divides a single pixel by a value in a Region of Interest |
GrayImage |
divide(int v,
ROI roi)
Divides all the pixels by a value in a Region of Interest |
int |
get(int x,
int y)
Returns the pixel value at the given x, y value |
short[][] |
getData()
Return a deep copy of data. |
ImageProducer |
getJavaImage()
Turns this image into a Java Image (java.awt.Image). |
private void |
InitFromImage(Image img,
int x,
int y,
int w,
int h)
|
static void |
main(String[] args)
|
int |
max()
Finds the maximum value of this image |
int |
max(ROI roi)
Finds the maximum value in a Region of Interest |
void |
median(int size)
Performs median filter on this image |
void |
median(int size,
ROI roi)
Performs median filter in a Region of Interest |
int |
min()
Finds the minimum value of this image |
int |
min(ROI roi)
Finds the minimum value in a Region of Interest |
GrayImage |
multiply(GrayImage im)
Multiplies a GrayImage by this image |
GrayImage |
multiply(GrayImage im,
ROI sourceROI,
ROI destROI)
Multiplies a Region of Interest (sourceROI) of another GrayImage by a Region of Interest (destROI) of this image |
GrayImage |
multiply(int v)
Multiplies all the pixels in this image by a value |
void |
multiply(int x,
int y,
int value)
Mutiplies a single pixel by a value |
void |
multiply(int x,
int y,
int value,
ROI roi)
Mutiplies a single pixel by a value in a Region of Interest |
GrayImage |
multiply(int v,
ROI roi)
Multiplies all the pixels in a Region of Interest by a value |
void |
set(int x,
int y,
int value)
Sets the pixel value at x, y to a given value |
void |
set(int x,
int y,
int value,
ROI roi)
Sets the pixel value at x, y to a given value in a Region of Interest |
private double[] |
sort(double[] vals,
int size)
|
long |
sqrSum()
Adds the square of all the values together |
GrayImage |
subtract(GrayImage im)
Subtracts a GrayImage from this image |
GrayImage |
subtract(GrayImage im,
ROI sourceROI,
ROI destROI)
Subtracts a Region of Interest (sourceROI) in another GrayImage from a Region of Interest (destROI) of this image |
GrayImage |
subtract(int v)
Subtracts a value from all the pixels in this image |
void |
subtract(int x,
int y,
int value)
Subtracts a value from a single pixel |
void |
subtract(int x,
int y,
int value,
ROI roi)
Subtracts a value from a single pixel in a Region of Interest |
GrayImage |
subtract(int v,
ROI roi)
Subtracts a value from all the pixels in a Region of Interest |
String |
toString()
Prints this image in integer format. |
String |
toString(ROI roi)
Prints a Region of Interest in integer format. |
int |
X()
Returns the width (maximum X value) |
int |
Y()
Returns the height (maximum Y value) |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected short[][] data
protected int X
protected int Y
| Constructor Detail |
public GrayImage()
public GrayImage(int x,
int y)
public GrayImage(int x,
int y,
short[] data)
x - width of imagey - height of imagepublic GrayImage(short[][] data)
public GrayImage(GrayImage img)
public GrayImage(Image img)
| Method Detail |
public Image copy()
copy in interface Imagepublic short[][] getData()
public GrayImage addbuffer(int w,
int h,
int color)
w - width of buffered imageh - height of buffered imagecolor - default color to buffer with
public GrayImage addbuffer(int w,
int h,
int xoff,
int yoff,
int color)
w - width of buffered imageh - height of buffered imagexoff - x offset of this image in the buffered imageyoff - y offset of this image in the buffered imagecolor - default color to buffer with
private void InitFromImage(Image img,
int x,
int y,
int w,
int h)
public final int X()
X in interface Imagepublic final int Y()
Y in interface Image
public final int get(int x,
int y)
x - the X coordinatey - the Y coordinate
public final void set(int x,
int y,
int value)
x - the X coordinatey - the Y coordinatevalue - the value to set the pixel topublic final GrayImage clear()
public final GrayImage clear(int val)
val - the value to "clear" the image to
public final void add(int x,
int y,
int value)
x - X-coordinatey - Y-coordinatevalue - the value to add to the pixel
public final void subtract(int x,
int y,
int value)
x - X-coordinatey - Y-coordinatevalue - the value to subtract from the pixel
public final void multiply(int x,
int y,
int value)
x - X-coordinatey - Y-coordinatevalue - - the value to mutiply to the pixel
public final void divide(int x,
int y,
int value)
x - X-coordinatey - Y-coordinatevalue - - the value to mutiply to the pixelpublic final int min()
public final int max()
public final GrayImage add(int v)
v - value to be added to the pixels
public final GrayImage subtract(int v)
v - value to be added to the pixels
public final GrayImage multiply(int v)
v - value to be added to the pixels
public final GrayImage divide(int v)
v - value to be added to the pixels
public final int addSum()
public final int absSum()
public final long sqrSum()
public final GrayImage add(GrayImage im)
im - the GrayImage to add
public final GrayImage subtract(GrayImage im)
im - the GrayImage to subtract
public final GrayImage diff(GrayImage im)
public final GrayImage multiply(GrayImage im)
im - the GrayImage to multiply
public final GrayImage divide(GrayImage im)
im - the GrayImage to divide
public String toString()
toString in interface ImagetoString in class Objectpublic ImageProducer getJavaImage()
getJavaImage in interface ImageImageProducerpublic void byteSize()
public void clip(int min,
int max)
min - minimum valuemax - maximum value
private double[] sort(double[] vals,
int size)
public void median(int size)
size - the size of the median filterpublic Image copy(ROI roi)
copy in interface Imageroi - Region of Interest
public final void set(int x,
int y,
int value,
ROI roi)
x - the X coordinatey - the Y coordinatevalue - the value to set the pixel toroi - Region of Interest
public final void add(int x,
int y,
int value,
ROI roi)
x - X-coordinatey - Y-coordinatevalue - the value to add to the pixelroi - Region of Interest
public final void subtract(int x,
int y,
int value,
ROI roi)
x - X-coordinatey - Y-coordinatevalue - the value to subtract from the pixelroi - Region of Interest
public final void multiply(int x,
int y,
int value,
ROI roi)
x - X-coordinatey - Y-coordinatevalue - - the value to mutiply to the pixelroi - Region of Interest
public final void divide(int x,
int y,
int value,
ROI roi)
x - X-coordinatey - Y-coordinatevalue - - the value to mutiply to the pixelroi - Region of Interestpublic final int min(ROI roi)
roi - Region of Interest
public final int max(ROI roi)
roi - Region of Interest
public final GrayImage add(int v,
ROI roi)
v - value to be added to the pixelsroi - Region of Interest
public final GrayImage subtract(int v,
ROI roi)
v - value to be added to the pixelsroi - Region of Interest
public final GrayImage multiply(int v,
ROI roi)
v - value to be added to the pixelsroi - Region of Interest
public final GrayImage divide(int v,
ROI roi)
v - value to be added to the pixelsroi - Region of Interest
public final GrayImage add(GrayImage im,
ROI sourceROI,
ROI destROI)
im - the GrayImage to addsourceROI - Region of Interest for the Source ImagedestROI - Region of Interest for the Destination Image
public final GrayImage subtract(GrayImage im,
ROI sourceROI,
ROI destROI)
im - the GrayImage to subtractsourceROI - Region of Interest for the Source ImagedestROI - Region of Interest for the Destination Image
public final GrayImage multiply(GrayImage im,
ROI sourceROI,
ROI destROI)
im - the GrayImage to multiplysourceROI - Region of Interest for the Source ImagedestROI - Region of Interest for the Destination Image
public final GrayImage divide(GrayImage im,
ROI sourceROI,
ROI destROI)
im - the GrayImage to dividesourceROI - Region of Interest for the Source ImagedestROI - Region of Interest for the Destination Image
public String toString(ROI roi)
roi - Region of Interest
public void clip(int min,
int max,
ROI roi)
min - minimum valuemax - maximum valueroi - Region of Interestpublic void byteSize(ROI roi)
public void median(int size,
ROI roi)
size - the size of the median filterroi - Region of Interestpublic static void main(String[] args)
|
JIGL v1.6 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||