|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jm.jigl.GrayImage
GrayImage is a 2-d array of shorts
jigl.image.GrayImage
Field Summary | |
protected short[][] |
data
Two dimensional integer array |
protected int |
X
Cartesian width |
protected int |
Y
Cartesian height |
Constructor Summary | |
GrayImage()
Creates an empty two dimensional GrayImage with a height and width of zero |
|
GrayImage(GrayImage img)
Creates a two dimensional GrayImage (shallow copy) from GrayImage img |
|
GrayImage(java.awt.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 height and width of x and y repectively |
|
GrayImage(int x,
int y,
short[] dat)
Creates a two dimensional GrayImage with a height and width of x and y repectively |
|
GrayImage(short[][] dat)
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 sourceImage,
ROI destImage)
Adds a Region of Interest in another GrayImage to a Region of Interest 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 r)
Adds a value to a single pixel in a Region of Interest |
GrayImage |
add(int v,
ROI r)
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 x and height y |
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 x and height y |
int |
addSum()
Adds all the values together |
void |
byteSize()
Scales the range 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 r)
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 r)
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 sourceImage,
ROI destImage)
Divides by a Region of Interest in this image by a Region of Interest 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 r)
Divides a single pixel by a value in a Region of Interest |
GrayImage |
divide(int v,
ROI r)
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 |
java.awt.image.ImageProducer |
getJavaImage()
Turns this image into a Java Image (java.awt.Image). |
static void |
main(java.lang.String[] args)
Method declaration |
int |
max()
Finds the maximum value of this image |
int |
max(ROI r)
Finds the maximum value in a Region of Interest |
void |
median(int size)
Performs median filter on this image |
void |
median(int size,
ROI r)
Performs median filter in a Region of Interest |
int |
min()
Finds the minimum value of this image |
int |
min(ROI r)
Finds the minimum value in a Region of Interest |
GrayImage |
multiply(GrayImage im)
Multiplies a GrayImage by this image |
GrayImage |
multiply(GrayImage im,
ROI sourceImage,
ROI destImage)
Multiplies a Region of Interest of another GrayImage by a Region of Interest 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 r)
Mutiplies a single pixel by a value in a Region of Interest |
GrayImage |
multiply(int v,
ROI r)
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 r)
Sets the pixel value at x, y to a given value in a Region of Interest |
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 sourceImage,
ROI destImage)
Subtracts a Region of Interest in another GrayImage from a Region of Interest 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 r)
Subtracts a value from a single pixel in a Region of Interest |
GrayImage |
subtract(int v,
ROI r)
Subtracts a value from all the pixels in a Region of Interest |
java.lang.String |
toString()
Prints this image in integer format. |
java.lang.String |
toString(ROI r)
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[] dat)
x
- width of imagey
- height of imagedat
- one dimensional array of short. The array is length x*y.public GrayImage(short[][] dat)
dat
- two dimensional array of shortpublic GrayImage(GrayImage img)
public GrayImage(java.awt.Image img)
Method Detail |
public Image copy()
copy
in interface Image
public GrayImage addbuffer(int w, int h, int color)
public GrayImage addbuffer(int w, int h, int xoff, int yoff, int color)
public final int X()
X
in interface Image
public final int Y()
Y
in interface Image
public final int get(int x, int y)
x
- the X coordinanty
- the Y coordinantpublic final void set(int x, int y, int value)
x
- the X coordinanty
- the Y coordinantvalue
- the value to set the pixel topublic final GrayImage clear()
public final GrayImage clear(int val)
val
- the value to "clear" the image topublic final void add(int x, int y, int value)
x
- X-coordinanty
- Y-coordinantvalue
- the value to add to the pixelpublic final void subtract(int x, int y, int value)
x
- X-coordinanty
- Y-coordinantvalue
- the value to subtract from the pixelpublic final void multiply(int x, int y, int value)
x
- X-coordinanty
- Y-coordinantvalue
- - the value to mutiply to the pixelpublic final void divide(int x, int y, int value)
x
- X-coordinanty
- Y-coordinantvalue
- - 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 java.lang.String toString()
toString
in interface Image
toString
in class java.lang.Object
public java.awt.image.ImageProducer getJavaImage()
getJavaImage
in interface Image
java.awt.ImageProducer
public void byteSize()
public void clip(int min, int max)
min
- minimum valuemax
- maximum valuepublic void median(int size)
size
- the size of the median filterpublic Image copy(ROI r)
copy
in interface Image
r
- Region of Interest
public final void set(int x, int y, int value, ROI r)
x
- the X coordinanty
- the Y coordinantvalue
- the value to set the pixel tor
- Region of Interestpublic final void add(int x, int y, int value, ROI r)
x
- X-coordinanty
- Y-coordinantvalue
- the value to add to the pixelr
- Region of Interestpublic final void subtract(int x, int y, int value, ROI r)
x
- X-coordinanty
- Y-coordinantvalue
- the value to subtract from the pixelr
- Region of Interestpublic final void multiply(int x, int y, int value, ROI r)
x
- X-coordinanty
- Y-coordinantvalue
- - the value to mutiply to the pixelr
- Region of Interestpublic final void divide(int x, int y, int value, ROI r)
x
- X-coordinanty
- Y-coordinantvalue
- - the value to mutiply to the pixelr
- Region of Interestpublic final int min(ROI r)
r
- Region of Interest
public final int max(ROI r)
r
- Region of Interest
public final GrayImage add(int v, ROI r)
v
- value to be added to the pixelsr
- Region of Interest
public final GrayImage subtract(int v, ROI r)
v
- value to be added to the pixelsr
- Region of Interest
public final GrayImage multiply(int v, ROI r)
v
- value to be added to the pixelsr
- Region of Interest
public final GrayImage divide(int v, ROI r)
v
- value to be added to the pixelsr
- Region of Interest
public final GrayImage add(GrayImage im, ROI sourceImage, ROI destImage)
im
- the GrayImage to addsourceImage
- Region of Interest for the Source ImagedestImage
- Region of Interest for the Destination Image
public final GrayImage subtract(GrayImage im, ROI sourceImage, ROI destImage)
im
- the GrayImage to subtractsourceImage
- Region of Interest for the Source ImagedestImage
- Region of Interest for the Destination Image
public final GrayImage multiply(GrayImage im, ROI sourceImage, ROI destImage)
im
- the GrayImage to multiplysourceImage
- Region of Interest for the Source ImagedestImage
- Region of Interest for the Destination Image
public final GrayImage divide(GrayImage im, ROI sourceImage, ROI destImage)
im
- the GrayImage to dividesourceImage
- Region of Interest for the Source ImagedestImage
- Region of Interest for the Destination Image
public java.lang.String toString(ROI r)
r
- Region of Interest
public void clip(int min, int max, ROI r)
min
- minimum valuemax
- maximum valuer
- Region of Interestpublic void median(int size, ROI r)
size
- the size of the median filterr
- Region of Interestpublic static void main(java.lang.String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |