JIGL
v1.6

jigl.image
Class InterpolatedColorImage

java.lang.Object
  |
  +--jigl.image.ColorImage
        |
        +--jigl.image.InterpolatedColorImage
All Implemented Interfaces:
Image, InterpolatedImage

public class InterpolatedColorImage
extends ColorImage
implements InterpolatedImage

InterpolatedColorImage is a ColorImage that can be accessed at other than integral locations. Supports nearest neighbor, bilinear, and bicubic interpolation.


Field Summary
static int CUBIC
          Bicubic constant
protected  int interpolationMethod
          The interpolation method that will be used.
static int LINEAR
          Linear Interpolation constant
static int NEIGHBOR
          Nearest neighbor constant
 
Fields inherited from class jigl.image.ColorImage
CMY, colorModel, HLS, HSV, planes, RGB, X, Y, YIQ
 
Constructor Summary
InterpolatedColorImage()
          Creates an empty color image.
InterpolatedColorImage(ColorImage img)
          Creates a color image that is a shallow copy of img.
InterpolatedColorImage(InterpolatedColorImage img)
          Creates a color image that is a shallow copy of img.
InterpolatedColorImage(int x, int y)
          Creates a color image of dimension x,y.
 
Method Summary
 void accum(double x, double y, int[] value)
          Adds the triplet to the surrounding area.
 void accum(double x, int[] value)
          Adds the triplet to the surrounding area.
 Image copy()
          deep copy
 int getInterpolationMethod()
          the current interpolation method
 int[] interp(double x)
          Returns the interpolated triplet at (x,0).
 int[] interp(double x, double y)
          Returns the interpolated triplet at (x,y)
 void setInterpolationMethod(int m)
          Set the interpolation method
 void setPlane(int p, GrayImage pl)
          Sets the p plane to image pl: a shallow copy
 void splat(double x, double y, int[] value)
          Spread the triplet in the surrounding area.
 void splat(double x, int[] value)
          Spread the triplet in the surrounding area.
 
Methods inherited from class jigl.image.ColorImage
absSum, add, add, add, add, add, add, add, add, add, add, add, add, addbuffer, addbuffer, addSum, byteSize, byteSize, clear, clear, clip, clip, copy, diff, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, divide, get, get, getColorModel, getJavaImage, InitFromImage, max, max, max, max, min, min, min, min, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, plane, set, set, setColorModel, sqrSum, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtract, toString, toString, X, Y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jigl.image.Image
copy, getJavaImage, toString, X, Y
 

Field Detail

NEIGHBOR

public static final int NEIGHBOR
Nearest neighbor constant

See Also:
Constant Field Values

LINEAR

public static final int LINEAR
Linear Interpolation constant

See Also:
Constant Field Values

CUBIC

public static final int CUBIC
Bicubic constant

See Also:
Constant Field Values

interpolationMethod

protected int interpolationMethod
The interpolation method that will be used. Default= NEIGHBOR

Constructor Detail

InterpolatedColorImage

public InterpolatedColorImage()
Creates an empty color image.


InterpolatedColorImage

public InterpolatedColorImage(int x,
                              int y)
Creates a color image of dimension x,y.


InterpolatedColorImage

public InterpolatedColorImage(ColorImage img)
Creates a color image that is a shallow copy of img.


InterpolatedColorImage

public InterpolatedColorImage(InterpolatedColorImage img)
Creates a color image that is a shallow copy of img.

Method Detail

copy

public Image copy()
deep copy

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

setPlane

public void setPlane(int p,
                     GrayImage pl)
Sets the p plane to image pl: a shallow copy

Overrides:
setPlane in class ColorImage
Parameters:
p - the plane of this image
pl - GrayImage to set the plane to

getInterpolationMethod

public int getInterpolationMethod()
the current interpolation method

Specified by:
getInterpolationMethod in interface InterpolatedImage

setInterpolationMethod

public void setInterpolationMethod(int m)
Set the interpolation method

There are three possibilities: Nearest Neighbor, Linear or Cubic.

Specified by:
setInterpolationMethod in interface InterpolatedImage

interp

public int[] interp(double x)
Returns the interpolated triplet at (x,0).


interp

public int[] interp(double x,
                    double y)
Returns the interpolated triplet at (x,y)


accum

public void accum(double x,
                  int[] value)
Adds the triplet to the surrounding area.


accum

public void accum(double x,
                  double y,
                  int[] value)
Adds the triplet to the surrounding area.


splat

public void splat(double x,
                  int[] value)
Spread the triplet in the surrounding area.


splat

public void splat(double x,
                  double y,
                  int[] value)
Spread the triplet in the surrounding area.


JIGL
v1.6

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