JIGL
v1.6

jigl.image
Class ColorImage

java.lang.Object
  |
  +--jigl.image.ColorImage
All Implemented Interfaces:
Image
Direct Known Subclasses:
InterpolatedColorImage

public class ColorImage
extends Object
implements Image

A color image is a set of three GrayImage planes.


Field Summary
static int CMY
          CMY Color Model
protected  int colorModel
          Current Color Model; Default is RGB
static int HLS
          HLS Color Model
static int HSV
          HSV Color Model
protected  GrayImage[] planes
          Set of 3 GrayImages
static int RGB
          RGB Color Model
protected  int X
          Cartesian width
protected  int Y
          Cartesian height
static int YIQ
          YIQ Color Model
 
Constructor Summary
ColorImage()
          Creates an empty two dimensional ColorImage with a height and width of zero
ColorImage(ColorImage img)
          Creates a two dimensional ColorImage from img.
ColorImage(Image img)
          Creates a two dimensional GrayImage from the standard java.awt.Image
ColorImage(int x, int y)
          Creates a two dimensional ColorImage with a height and width of x and y repectively
 
Method Summary
 int[] absSum()
          Adds absolute value of all the values together
 ColorImage add(ColorImage im)
          Adds another ColorImage to this image
 ColorImage add(ColorImage im, ROI sourceROI, ROI destROI)
          Adds a Region of Interest (sourceROI) in another ColorImage to a Region of Interest (destROI) of this image
 ColorImage add(int[] v)
          Adds triplet to all the pixels in this image
 ColorImage add(int[] v, ROI roi)
          Adds triplet to all the pixels in a Region of Interest
 ColorImage add(int planeIndex, int v)
          Adds a value to all the pixels in a plane of this image
 ColorImage add(int val0, int val1, int val2)
          Adds triplet to all the pixels in this image
 void add(int x, int y, int[] value)
          Adds a triplet to a single pixel
 void add(int x, int y, int[] value, ROI roi)
          Adds a triplet to a single pixel in a Region of Interest
 void add(int x, int y, int val0, int val1, int val2)
          Adds a triplet to a single pixel
 void add(int x, int y, int val0, int val1, int val2, ROI roi)
          Adds a triplet to a single pixel in a Region of Interest
 ColorImage add(int val0, int val1, int val2, ROI roi)
          Adds triplet to all the pixels in this image in a Region of Interest
 ColorImage add(int planeIndex, int v, ROI roi)
          Adds a value to all the pixels in a plane in a Region of Interest
 ColorImage 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
 ColorImage 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)
 void clear()
          Clears the image to zero
 void clear(int v)
          Clears the image to a 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
 ColorImage diff(ColorImage im)
          Subtracts a ColorImage from this image and returns the absolute value.
 ColorImage divide(ColorImage im)
          Divides this image by a ColorImage and returns a new ColorImage.
 ColorImage divide(ColorImage im, ROI sourceROI, ROI destROI)
          Divides a Region of Interest (sourceROI) in this image by a Region of Interest (destROI) from another ColorImage
 ColorImage divide(int[] v)
          Divides all the pixels of this image by a triplet
 ColorImage divide(int[] v, ROI roi)
          Divides all the pixels in a Region of Interest by a triplet
 ColorImage divide(int planeIndex, int v)
          Divides all the pixels in a plane of this image by a value
 ColorImage divide(int val0, int val1, int val2)
          Divides all the pixels of this image by a triplet
 void divide(int x, int y, int[] value)
          Divides a single pixel by a triplet
 void divide(int x, int y, int[] value, ROI roi)
          Divides a single pixel by a triplet in a Region of Interest
 void divide(int x, int y, int val0, int val1, int val2)
          Divides a single pixel by a triplet
 void divide(int x, int y, int val0, int val1, int val2, ROI roi)
          Divides a single pixel by a triplet in a Region of Interest
 ColorImage divide(int val0, int val1, int val2, ROI roi)
          Divides all the pixels in a Region of Interest by a triplet
 ColorImage divide(int planeIndex, int v, ROI roi)
          Divides all the pixels in a plane in a Region of Interest by a value
 int[] get(int x, int y)
          Returns the pixel value at the given x, y value as a triplet
 int[] get(int x, int y, ROI roi)
          Returns the pixel value at the given x, y value as a triplet in a Region of Interest
 int getColorModel()
          Returns the color model.
 ImageProducer getJavaImage()
          Turns this image into a Java Image (java.awt.Image).
 void InitFromImage(Image img, int x, int y, int w, int h)
          initializes plane data from a Java image.
 int max()
          Finds the maximum value of all the planes of this image
 int max(int planeIndex)
          Finds the maximum value of a single plane of this image
 int max(int planeIndex, ROI roi)
          Finds the maximum value of a single plane in a Region of Interest
 int max(ROI roi)
          Finds the maximum value of all the planes in a Region of Interest
 int min()
          Finds the minimum value of all the planes of this image
 int min(int planeIndex)
          Finds the minimum value of a single plane of this image
 int min(int planeIndex, ROI roi)
          Finds the minimum value of a single plane in a Region of Interest
 int min(ROI roi)
          Finds the minimum value of all the planes in a Region of Interest
 ColorImage multiply(ColorImage im)
          Multiplies a ColorImage by this image and returns a new ColorImage.
 ColorImage multiply(ColorImage im, ROI sourceROI, ROI destROI)
          Multiplies a Region of Interest (sourceROI) from another ColorImage by a Region of Interest (destROI) of this image
 ColorImage multiply(int[] v)
          Multiplies a triplet by all the pixels of this image
 ColorImage multiply(int[] v, ROI roi)
          Multiplies a triplet by all the pixels in a Region of Interest
 ColorImage multiply(int planeIndex, int v)
          Multiplies all the pixels in a plane of this image by a value
 ColorImage multiply(int val0, int val1, int val2)
          Multiplies a triplet by all the pixels of this image
 void multiply(int x, int y, int[] value)
          Multiplies a triplet with a single pixel
 void multiply(int x, int y, int[] value, ROI roi)
          Multiplies a triplet with a single pixel in a Region of Interest
 void multiply(int x, int y, int val0, int val1, int val2)
          Multiplies a triplet with a single pixel
 void multiply(int x, int y, int val0, int val1, int val2, ROI roi)
          Multiplies a triplet with a single pixel in a Region of Interest
 ColorImage multiply(int val0, int val1, int val2, ROI roi)
          Multiplies a triplet by all the pixels of this image in a Region of Interest
 ColorImage multiply(int planeIndex, int v, ROI roi)
          Multiplies all the pixels in a plane in a Region of Interest by a value
 GrayImage plane(int planeIndex)
          Returns the plane of this image.
 void set(int x, int y, int[] v)
          Sets the pixel value at x, y to a value as a triplet
 void set(int x, int y, int[] v, ROI roi)
          Sets the pixel value at the given x, y value as a triplet in a Region of Interest
 void setColorModel(int cm)
          sets the color model.
 void setPlane(int planeIndex, GrayImage pl)
          Set the plane to a GrayImage pl
 long[] sqrSum()
          Adds the square of all the values together
 ColorImage subtract(ColorImage im)
          Subtracts a ColorImage from this image
 ColorImage subtract(ColorImage im, ROI sourceROI, ROI destROI)
          Subtracts a Region of Interest (sourceROI) from another ColorImage from a Region of Interest (destROI) of this image
 ColorImage subtract(int[] v)
          Subtracts a triplet from all the pixels of this image
 ColorImage subtract(int[] v, ROI roi)
          Subtracts a triplet from all the pixels in a Region of Interest
 ColorImage subtract(int planeIndex, int v)
          Subtracts a value from all the pixels in a plane of this image
 ColorImage subtract(int val0, int val1, int val2)
          Subtracts a triplet from all the pixels of this image
 void subtract(int x, int y, int[] value)
          Subtracts a triplet from a single pixel
 void subtract(int x, int y, int[] value, ROI roi)
          Subtracts a triplet from a single pixel in a Region of Interest
 void subtract(int x, int y, int val0, int val1, int val2)
          Subtracts a triplet from a single pixel
 void subtract(int x, int y, int val0, int val1, int val2, ROI roi)
          Subtracts a triplet from a single pixel in a Region of Interest
 ColorImage subtract(int val0, int val1, int val2, ROI roi)
          Subtracts a triplet from all the pixels in a Region of Interest
 ColorImage subtract(int planeIndex, int v, ROI roi)
          Subtracts a value from all the pixels in a Region of Interest
 String toString()
          Prints the 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

planes

protected GrayImage[] planes
Set of 3 GrayImages


X

protected int X
Cartesian width


Y

protected int Y
Cartesian height


RGB

public static final int RGB
RGB Color Model

See Also:
Constant Field Values

CMY

public static final int CMY
CMY Color Model

See Also:
Constant Field Values

YIQ

public static final int YIQ
YIQ Color Model

See Also:
Constant Field Values

HSV

public static final int HSV
HSV Color Model

See Also:
Constant Field Values

HLS

public static final int HLS
HLS Color Model

See Also:
Constant Field Values

colorModel

protected int colorModel
Current Color Model; Default is RGB

Constructor Detail

ColorImage

public ColorImage()
Creates an empty two dimensional ColorImage with a height and width of zero


ColorImage

public ColorImage(int x,
                  int y)
Creates a two dimensional ColorImage with a height and width of x and y repectively


ColorImage

public ColorImage(ColorImage img)
Creates a two dimensional ColorImage from img.


ColorImage

public ColorImage(Image img)
Creates a two dimensional GrayImage from the standard java.awt.Image

Method Detail

copy

public Image copy()
Makes a deep copy of this image

Specified by:
copy in interface Image
Returns:
a deep copy of ColorImage

X

public final int X()
Returns the width (maximum X value)

Specified by:
X in interface Image

Y

public final int Y()
Returns the height (maximum Y value)

Specified by:
Y in interface Image

getColorModel

public final int getColorModel()
Returns the color model.
CMY = 1
YIQ = 2
HSV = 3
HLS = 4
default = RGB


setColorModel

public final void setColorModel(int cm)
sets the color model.

Parameters:
cm - ColorModel
CMY = 1
YIQ = 2
HSV = 3
HLS = 4
default = RGB

plane

public final GrayImage plane(int planeIndex)
Returns the plane of this image.

If this were an RGB image, plane(0) would return the red plane.

Parameters:
planeIndex - the plane of this image
Returns:
a shallow copy

setPlane

public void setPlane(int planeIndex,
                     GrayImage pl)
Set the plane to a GrayImage pl

Parameters:
planeIndex - the plane of this image
pl - GrayImage to set the plane to

InitFromImage

public void InitFromImage(Image img,
                          int x,
                          int y,
                          int w,
                          int h)
initializes plane data from a Java image. Used by the java image constructor.


get

public final int[] get(int x,
                       int y)
Returns the pixel value at the given x, y value as a triplet

Parameters:
x - the X coordinate
y - the Y coordinate
Returns:
three element array of integers

set

public final void set(int x,
                      int y,
                      int[] v)
Sets the pixel value at x, y to a value as a triplet

Parameters:
x - the X coordinate
y - the Y coordinate
v - array of three integers holding the values for the set

addbuffer

public ColorImage 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

Parameters:
w - width of buffered image
h - height of buffered image
color - array of 3 integers that is the default color to buffer with
Returns:
a deep copy of ColorImage

addbuffer

public ColorImage 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

Parameters:
w - width of buffered image
h - height of buffered image
xoff - x offset of this image in the buffered image
yoff - y offset of this image in the buffered image
color - array of 3 integers that is the default color to buffer with
Returns:
a deep copy of ColorImage

add

public final void add(int x,
                      int y,
                      int[] value)
Adds a triplet to a single pixel

Parameters:
x - X-coordinate
y - Y-coordinate
value - triplet to add to the pixel

add

public final void add(int x,
                      int y,
                      int val0,
                      int val1,
                      int val2)
Adds a triplet to a single pixel

Parameters:
x - X-coordinate
y - Y-coordinate
val0 - value to add to the pixel in the first plane
val1 - value to add to the pixel in the second plane
val2 - value to add to the pixel in the third plane

subtract

public final void subtract(int x,
                           int y,
                           int[] value)
Subtracts a triplet from a single pixel

Parameters:
x - X-coordinate
y - Y-coordinate
value - triplet to subtract from the pixel

subtract

public final void subtract(int x,
                           int y,
                           int val0,
                           int val1,
                           int val2)
Subtracts a triplet from a single pixel

Parameters:
x - X-coordinate
y - Y-coordinate
val0 - value to subtract from the pixel in the first plane
val1 - value to subtract from the pixel in the second plane
val2 - value to subtract from the pixel in the third plane

multiply

public final void multiply(int x,
                           int y,
                           int[] value)
Multiplies a triplet with a single pixel

Parameters:
x - X-coordinate
y - Y-coordinate
value - triplet to multiply the pixel by

multiply

public final void multiply(int x,
                           int y,
                           int val0,
                           int val1,
                           int val2)
Multiplies a triplet with a single pixel

Parameters:
x - X-coordinate
y - Y-coordinate
val0 - value to multiply the pixel by in the first plane
val1 - value to multiply the pixel by in the second plane
val2 - value to multiply the pixel by in the third plane

divide

public final void divide(int x,
                         int y,
                         int[] value)
Divides a single pixel by a triplet

Parameters:
x - X-coordinate
y - Y-coordinate
value - triplet to add to the pixel

divide

public final void divide(int x,
                         int y,
                         int val0,
                         int val1,
                         int val2)
Divides a single pixel by a triplet

Parameters:
x - X-coordinate
val0 - value to divide by the pixel in the first plane
val1 - value to divide by the pixel in the second plane
val2 - value to divide by the pixel in the third plane

min

public final int min()
Finds the minimum value of all the planes of this image

Returns:
an integer containing the minimum value

min

public final int min(int planeIndex)
Finds the minimum value of a single plane of this image

Parameters:
planeIndex - the plane
Returns:
an integer containing the minimum value

max

public final int max()
Finds the maximum value of all the planes of this image

Returns:
an integer containing the maximum value

max

public final int max(int planeIndex)
Finds the maximum value of a single plane of this image

Parameters:
planeIndex - the plane
Returns:
an integer containing the maximum value

add

public final ColorImage add(int val0,
                            int val1,
                            int val2)
Adds triplet to all the pixels in this image

Parameters:
val0 - value to add to the pixel in the first plane
val1 - value to add to the pixel in the second plane
val2 - value to add to the pixel in the third plane
Returns:
this

add

public final ColorImage add(int[] v)
Adds triplet to all the pixels in this image

Parameters:
v - triplet to be added to the pixels
Returns:
this

add

public final ColorImage add(int planeIndex,
                            int v)
Adds a value to all the pixels in a plane of this image

Parameters:
planeIndex - the plane
v - value to be added to the pixels
Returns:
this

subtract

public final ColorImage subtract(int val0,
                                 int val1,
                                 int val2)
Subtracts a triplet from all the pixels of this image

Parameters:
val0 - value to subtract from the pixel in the first plane
val1 - value to subtract from the pixel in the second plane
val2 - value to subtract from the pixel in the third plane
Returns:
this

subtract

public final ColorImage subtract(int[] v)
Subtracts a triplet from all the pixels of this image

Parameters:
v - triplet to be subtracted from the pixels
Returns:
this

subtract

public final ColorImage subtract(int planeIndex,
                                 int v)
Subtracts a value from all the pixels in a plane of this image

Parameters:
planeIndex - the plane
v - value to be added to the pixels
Returns:
this

multiply

public final ColorImage multiply(int[] v)
Multiplies a triplet by all the pixels of this image

Parameters:
v - triplet to be multiplied by
Returns:
this

multiply

public final ColorImage multiply(int val0,
                                 int val1,
                                 int val2)
Multiplies a triplet by all the pixels of this image

Parameters:
val0 - value to multiply the pixel by in the first plane
val1 - value to multiply the pixel by in the second plane
val2 - value to multiply the pixel by in the third plane
Returns:
this

multiply

public final ColorImage multiply(int planeIndex,
                                 int v)
Multiplies all the pixels in a plane of this image by a value

Parameters:
planeIndex - the plane
v - value to be added to the pixels
Returns:
this

divide

public final ColorImage divide(int[] v)
Divides all the pixels of this image by a triplet

Parameters:
v - triplet to be divided by
Returns:
this

divide

public final ColorImage divide(int val0,
                               int val1,
                               int val2)
Divides all the pixels of this image by a triplet

Parameters:
val0 - value to divide by the pixel in the first plane
val1 - value to divide by the pixel in the second plane
val2 - value to divide by the pixel in the third plane
Returns:
this

divide

public final ColorImage divide(int planeIndex,
                               int v)
Divides all the pixels in a plane of this image by a value

Parameters:
planeIndex - the plane
v - value to be added to the pixels
Returns:
this

addSum

public final int[] addSum()
Adds all the values together


absSum

public final int[] absSum()
Adds absolute value of all the values together


sqrSum

public final long[] sqrSum()
Adds the square of all the values together


add

public final ColorImage add(ColorImage im)
Adds another ColorImage to this image

Parameters:
im - the ColorImage to add
Returns:
this

subtract

public final ColorImage subtract(ColorImage im)
Subtracts a ColorImage from this image

Parameters:
im - the ColorImage to subtract
Returns:
this

diff

public final ColorImage diff(ColorImage im)
Subtracts a ColorImage from this image and returns the absolute value. Assumes the two images having the same size.

Parameters:
im - the RealColorImage to diff
Returns:
this

multiply

public final ColorImage multiply(ColorImage im)
Multiplies a ColorImage by this image and returns a new ColorImage.

Parameters:
im - the ColorImage to multiply
Returns:
this

divide

public final ColorImage divide(ColorImage im)
Divides this image by a ColorImage and returns a new ColorImage.

Parameters:
im - the ColorImage to divide
Returns:
this

toString

public final String toString()
Prints the image in integer format.
-Example of output on an image with width 100 and height 120:
100 : 120
10 87 32 65 32 65 40 59 43 12 43 ...
100 : 120
10 20 32 12 32 56 40 45 42 39 43 ...
100 : 120
10 20 32 12 54 56 73 59 42 23 43 ...

Specified by:
toString in interface Image
Overrides:
toString in class Object

getJavaImage

public final ImageProducer getJavaImage()
Turns this image into a Java Image (java.awt.Image). The ColorImage is assumed to be RGB.

Specified by:
getJavaImage in interface Image
See Also:
ImageProducer

byteSize

public void byteSize()
Scales the range of this image to byte (0..255)


clip

public final void clip(int min,
                       int max)
Clips the range of this image to an arbitrary min/max

Parameters:
min - minimum value
max - maximum value

clear

public final void clear()
Clears the image to zero


clear

public final void clear(int v)
Clears the image to a value

Parameters:
v - value to clear to

copy

public Image copy(ROI roi)
Makes a deep copy of a Region of Interest

Specified by:
copy in interface Image
Parameters:
roi - Region of Interest
Returns:
a deep copy of ColorImage

get

public final int[] get(int x,
                       int y,
                       ROI roi)
Returns the pixel value at the given x, y value as a triplet in a Region of Interest

Parameters:
x - the X coordinate
y - the Y coordinate
roi - Region of Interest
Returns:
three element array of integers

set

public final void set(int x,
                      int y,
                      int[] v,
                      ROI roi)
Sets the pixel value at the given x, y value as a triplet in a Region of Interest

Parameters:
x - the X coordinate
y - the Y coordinate
v - array of three integers holding the values for the set
roi - Region of Interest

add

public final void add(int x,
                      int y,
                      int val0,
                      int val1,
                      int val2,
                      ROI roi)
Adds a triplet to a single pixel in a Region of Interest

Parameters:
x - X-coordinate
y - Y-coordinate
val0 - value to add to the pixel in the first plane
val1 - value to add to the pixel in the second plane
val2 - value to add to the pixel in the third plane
roi - Region of Interest

add

public final void add(int x,
                      int y,
                      int[] value,
                      ROI roi)
Adds a triplet to a single pixel in a Region of Interest

Parameters:
x - X-coordinate
y - Y-coordinate
value - triplet to subtract from the pixel
roi - Region of Interest

subtract

public final void subtract(int x,
                           int y,
                           int val0,
                           int val1,
                           int val2,
                           ROI roi)
Subtracts a triplet from a single pixel in a Region of Interest

Parameters:
x - X-coordinate
y - Y-coordinate
val0 - value to subtract from the pixel in the first plane
val1 - value to subtract from the pixel in the second plane
val2 - value to subtract from the pixel in the third plane
roi - Region of Interest

subtract

public final void subtract(int x,
                           int y,
                           int[] value,
                           ROI roi)
Subtracts a triplet from a single pixel in a Region of Interest

Parameters:
x - X-coordinate
y - Y-coordinate
value - triplet to subtract from to the pixel
roi - Region of Interest

multiply

public final void multiply(int x,
                           int y,
                           int val0,
                           int val1,
                           int val2,
                           ROI roi)
Multiplies a triplet with a single pixel in a Region of Interest

Parameters:
x - X-coordinate
y - Y-coordinate
val0 - value to multiply the pixel by in the first plane
val1 - value to multiply the pixel by in the second plane
val2 - value to multiply the pixel by in the third plane
roi - Region of Interest

multiply

public final void multiply(int x,
                           int y,
                           int[] value,
                           ROI roi)
Multiplies a triplet with a single pixel in a Region of Interest

Parameters:
x - X-coordinate
y - Y-coordinate
value - triplet to multiply by the pixel
roi - Region of Interest

divide

public final void divide(int x,
                         int y,
                         int[] value,
                         ROI roi)
Divides a single pixel by a triplet in a Region of Interest

Parameters:
x - X-coordinate
y - Y-coordinate
value - triplet to add to the pixel
roi - Region of Interest

divide

public final void divide(int x,
                         int y,
                         int val0,
                         int val1,
                         int val2,
                         ROI roi)
Divides a single pixel by a triplet in a Region of Interest

Parameters:
x - X-coordinate
val0 - value to divide by the pixel in the first plane
val1 - value to divide by the pixel in the second plane
val2 - value to divide by the pixel in the third plane
roi - Region of Interest

min

public final int min(ROI roi)
Finds the minimum value of all the planes in a Region of Interest

Parameters:
roi - Region of Interest
Returns:
an integer containing the minimum value

min

public final int min(int planeIndex,
                     ROI roi)
Finds the minimum value of a single plane in a Region of Interest

Parameters:
planeIndex - the plane
roi - Region of Interest
Returns:
an integer containing the minimum value

max

public final int max(ROI roi)
Finds the maximum value of all the planes in a Region of Interest

Parameters:
roi - Region of Interest
Returns:
an integer containing the maximum value

max

public final int max(int planeIndex,
                     ROI roi)
Finds the maximum value of a single plane in a Region of Interest

Parameters:
planeIndex - the plane
roi - Region of Interest
Returns:
an integer containing the maximum value

add

public final ColorImage add(int[] v,
                            ROI roi)
Adds triplet to all the pixels in a Region of Interest

Parameters:
v - triplet to be added to the pixels
roi - Region of Interest
Returns:
this

add

public final ColorImage add(int val0,
                            int val1,
                            int val2,
                            ROI roi)
Adds triplet to all the pixels in this image in a Region of Interest

Parameters:
val0 - value to add to the pixel in the first plane
val1 - value to add to the pixel in the second plane
val2 - value to add to the pixel in the third plane
roi - Region of Interest
Returns:
this

add

public final ColorImage add(int planeIndex,
                            int v,
                            ROI roi)
Adds a value to all the pixels in a plane in a Region of Interest

Parameters:
planeIndex - the plane
v - value to be added to the pixels
roi - Region of Interest
Returns:
this

subtract

public final ColorImage subtract(int[] v,
                                 ROI roi)
Subtracts a triplet from all the pixels in a Region of Interest

Parameters:
v - triplet to be subtracted from the pixels
roi - Region of Interest
Returns:
this

subtract

public final ColorImage subtract(int val0,
                                 int val1,
                                 int val2,
                                 ROI roi)
Subtracts a triplet from all the pixels in a Region of Interest

Parameters:
val0 - value to subtract from the pixel in the first plane
val1 - value to subtract from the pixel in the second plane
val2 - value to subtract from the pixel in the third plane
roi - Region of Interest
Returns:
this

subtract

public final ColorImage subtract(int planeIndex,
                                 int v,
                                 ROI roi)
Subtracts a value from all the pixels in a Region of Interest

Parameters:
planeIndex - the plane
v - value to be added to the pixels
roi - Region of Interest
Returns:
this

multiply

public final ColorImage multiply(int[] v,
                                 ROI roi)
Multiplies a triplet by all the pixels in a Region of Interest

Parameters:
v - triplet to be multiplied by
roi - Region of Interest
Returns:
this

multiply

public final ColorImage multiply(int val0,
                                 int val1,
                                 int val2,
                                 ROI roi)
Multiplies a triplet by all the pixels of this image in a Region of Interest

Parameters:
val0 - value to multiply the pixel by in the first plane
val1 - value to multiply the pixel by in the second plane
val2 - value to multiply the pixel by in the third plane
roi - Region of Interest
Returns:
this

multiply

public final ColorImage multiply(int planeIndex,
                                 int v,
                                 ROI roi)
Multiplies all the pixels in a plane in a Region of Interest by a value

Parameters:
planeIndex - the plane
v - value to be added to the pixels
roi - Region of Interest
Returns:
this

divide

public final ColorImage divide(int[] v,
                               ROI roi)
Divides all the pixels in a Region of Interest by a triplet

Parameters:
v - triplet to be divided by
roi - Region of Interest
Returns:
this

divide

public final ColorImage divide(int val0,
                               int val1,
                               int val2,
                               ROI roi)
Divides all the pixels in a Region of Interest by a triplet

Parameters:
val0 - value to divide by the pixel in the first plane
val1 - value to divide by the pixel in the second plane
val2 - value to divide by the pixel in the third plane
roi - Region of Interest
Returns:
this

divide

public final ColorImage divide(int planeIndex,
                               int v,
                               ROI roi)
Divides all the pixels in a plane in a Region of Interest by a value

Parameters:
planeIndex - the plane index
v - value to be added to the pixels
roi - Region of Interest
Returns:
this

add

public final ColorImage add(ColorImage im,
                            ROI sourceROI,
                            ROI destROI)
Adds a Region of Interest (sourceROI) in another ColorImage to a Region of Interest (destROI) of this image

Parameters:
im - the ColorImage to add
sourceROI - Region of Interest for the Source Image
destROI - Region of Interest for the Destination Image
Returns:
this

subtract

public final ColorImage subtract(ColorImage im,
                                 ROI sourceROI,
                                 ROI destROI)
Subtracts a Region of Interest (sourceROI) from another ColorImage from a Region of Interest (destROI) of this image

Parameters:
im - the ColorImage to subtract
sourceROI - Region of Interest for the Source Image
destROI - Region of Interest for the Destination Image
Returns:
this

multiply

public final ColorImage multiply(ColorImage im,
                                 ROI sourceROI,
                                 ROI destROI)
Multiplies a Region of Interest (sourceROI) from another ColorImage by a Region of Interest (destROI) of this image

Parameters:
im - the ColorImage to multiply
sourceROI - Region of Interest for the Source Image
destROI - Region of Interest for the Destination Image
Returns:
this

divide

public final ColorImage divide(ColorImage im,
                               ROI sourceROI,
                               ROI destROI)
Divides a Region of Interest (sourceROI) in this image by a Region of Interest (destROI) from another ColorImage

Parameters:
im - the ColorImage to divide
sourceROI - Region of Interest for the Source Image
destROI - Region of Interest for the Destination Image
Returns:
this

toString

public final String toString(ROI roi)
Prints a Region of Interest in integer format.
-Example of output on an image with width 100 and height 120:
100 : 120
10 87 32 65 32 65 40 59 43 12 43 ...
100 : 120
10 20 32 12 32 56 40 45 42 39 43 ...
100 : 120
10 20 32 12 54 56 73 59 42 23 43 ...

Parameters:
roi - Region of Interest

byteSize

public void byteSize(ROI roi)
Scales the range of a Region of Interest of this image to byte (0..255)

Parameters:
roi - Region of Interest of image.

clip

public final void clip(int min,
                       int max,
                       ROI roi)
Clips the range of this image to an arbitrary min/max in a Region of Interest

Parameters:
min - minimum value
max - maximum value
roi - Region of Interest+

JIGL
v1.6

Submit a bug or feature
Revised in May 2002 by Weiming Liu