JIGL
v1.6

jigl.image
Class InterpolatedRealGrayImage

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

public class InterpolatedRealGrayImage
extends RealGrayImage
implements InterpolatedImage

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


Field Summary
static int CUBIC
           
protected  int interpolationMethod
           
static int LINEAR
           
static int NEIGHBOR
           
 
Fields inherited from class jigl.image.RealGrayImage
data, X, Y
 
Constructor Summary
InterpolatedRealGrayImage()
          Creates an empty InterpolatedRealGrayImage.
InterpolatedRealGrayImage(Image img)
          Create an InterpolatedGrayImage from a Java image.
InterpolatedRealGrayImage(InterpolatedRealGrayImage img)
          Deep copy
InterpolatedRealGrayImage(int x, int y)
          Create an InterpolatedGrayImage with width x and height y.
InterpolatedRealGrayImage(RealGrayImage img)
          Creates an InterpolatedRealGrayImage from a RealGrayImage.
 
Method Summary
 void accum(float x, float y, float value)
          Add value to the surrounding area of (x,y).
private static float CatMull(float t, float y0, float y1, float y2, float y3)
          cubic interpolation using the CatMull-Rom method
 Image copy()
          Deep copy
 int getInterpolationMethod()
          Returns the interpolation method used.
 float interp(float x, float y)
          Returns the interpolated value at (x,y).
 void setInterpolationMethod(int m)
          Sets the interpolation method to be used.
 void splat(float x, float y, float value)
          Spread value to the surrounding area of (x,y).
 
Methods inherited from class jigl.image.RealGrayImage
absSum, add, add, add, add, add, add, addbuffer, addbuffer, addSum, byteSize, byteSize, clear, clear, clip, clip, copy, diff, divide, divide, divide, divide, divide, divide, get, getData, getJavaImage, max, max, median, median, min, min, multiply, multiply, multiply, multiply, multiply, multiply, set, set, sqrSum, 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
See Also:
Constant Field Values

LINEAR

public static final int LINEAR
See Also:
Constant Field Values

CUBIC

public static final int CUBIC
See Also:
Constant Field Values

interpolationMethod

protected int interpolationMethod
Constructor Detail

InterpolatedRealGrayImage

public InterpolatedRealGrayImage()
Creates an empty InterpolatedRealGrayImage.


InterpolatedRealGrayImage

public InterpolatedRealGrayImage(RealGrayImage img)
Creates an InterpolatedRealGrayImage from a RealGrayImage.


InterpolatedRealGrayImage

public InterpolatedRealGrayImage(int x,
                                 int y)
Create an InterpolatedGrayImage with width x and height y.


InterpolatedRealGrayImage

public InterpolatedRealGrayImage(InterpolatedRealGrayImage img)
Deep copy


InterpolatedRealGrayImage

public InterpolatedRealGrayImage(Image img)
Create an InterpolatedGrayImage from a Java image.

Method Detail

copy

public Image copy()
Deep copy

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

getInterpolationMethod

public int getInterpolationMethod()
Returns the interpolation method used.

Specified by:
getInterpolationMethod in interface InterpolatedImage

setInterpolationMethod

public void setInterpolationMethod(int m)
Sets the interpolation method to be used. The edge cases of linear and cubic interpolation are treated differently to avoid ArrayIndexOutOfBoundsExceptions. Cubic uses linear interpolation when it is nest to the edge, and linear uses single-linear interpolation when it is right on the edge.

Specified by:
setInterpolationMethod in interface InterpolatedImage

interp

public float interp(float x,
                    float y)
Returns the interpolated value at (x,y).


accum

public void accum(float x,
                  float y,
                  float value)
Add value to the surrounding area of (x,y).


splat

public void splat(float x,
                  float y,
                  float value)
Spread value to the surrounding area of (x,y).


CatMull

private static float CatMull(float t,
                             float y0,
                             float y1,
                             float y2,
                             float y3)
cubic interpolation using the CatMull-Rom method


JIGL
v1.6

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