|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.Interpolation | +--javax.media.jai.InterpolationBilinear
A class representing bilinear interpolation. The class is marked 'final' so it may be either automatically or manually inlined.
Bilinear interpolation requires a neighborhood extending one pixel to the right and below the central sample. If the fractional subsample position is given by (xfrac, yfrac), the resampled pixel value will be:
(1 - yfrac) * [(1 - xfrac)*s00 + xfrac*s01] + yfrac * [(1 - xfrac)*s10 + xfrac*s11]
A neighborhood extending one sample to the right of, and one sample below the central sample is required to perform bilinear interpolation. This implementation maintains equal subsampleBits in x and y.
The diagrams below illustrate the pixels involved in one-dimensional bilinear interpolation. Point s0 is the interpolation kernel key position. xfrac and yfrac, indicated by the dots, represent the point of interpolation between two pixels. This value lies between 0.0 and 1.0 exclusive for floating point and 0 and 2subsampleBits exclusive for integer interpolations.
Horizontal Vertical s0 . s1 s0 ^ .< yfrac xfrac s1
The diagram below illustrates the pixels involved in two-dimensional bilinear interpolation.
s00 s01 . < yfrac s10 s11 ^ xfrac
The class is marked 'final' so that it may be more easily inlined.
Fields inherited from class javax.media.jai.Interpolation |
bottomPadding,
height,
INTERP_BICUBIC,
INTERP_BICUBIC_2,
INTERP_BILINEAR,
INTERP_NEAREST,
leftPadding,
rightPadding,
subsampleBitsH,
subsampleBitsV,
topPadding,
width |
Constructor Summary | |
InterpolationBilinear()
Constructs an InterpolationBilinear with the default subsample precision 0f 8 bits. |
|
InterpolationBilinear(int subsampleBits)
Constructs an InterpolationBilinear with a given subsample precision, in bits. |
Method Summary | |
double |
interpolate(double[][] samples,
float xfrac,
float yfrac)
Performs interpolation on a two-dimensional array of double samples. |
double |
interpolate(double s__,
double s_0,
double s_1,
double s_2,
double s0_,
double s00,
double s01,
double s02,
double s1_,
double s10,
double s11,
double s12,
double s2_,
double s20,
double s21,
double s22,
float xfrac,
float yfrac)
Performs interpolation on a 4x4 grid. |
double |
interpolate(double s00,
double s01,
double s10,
double s11,
float xfrac,
float yfrac)
Performs interpolation on a 2x2 grid of double samples. |
float |
interpolate(float[][] samples,
float xfrac,
float yfrac)
Performs interpolation on a two-dimensional array of floating-point samples. |
float |
interpolate(float s00,
float s01,
float s10,
float s11,
float xfrac,
float yfrac)
Performs interpolation on a 2x2 grid of floating-point samples. |
float |
interpolate(float s__,
float s_0,
float s_1,
float s_2,
float s0_,
float s00,
float s01,
float s02,
float s1_,
float s10,
float s11,
float s12,
float s2_,
float s20,
float s21,
float s22,
float xfrac,
float yfrac)
Performs interpolation on a 4x4 grid. |
int |
interpolate(int[][] samples,
int xfrac,
int yfrac)
Performs interpolation on a two-dimensional array of integral samples. |
int |
interpolate(int s00,
int s01,
int s10,
int s11,
int xfrac,
int yfrac)
Performs interpolation on a 2x2 grid of integral samples. |
int |
interpolate(int s__,
int s_0,
int s_1,
int s_2,
int s0_,
int s00,
int s01,
int s02,
int s1_,
int s10,
int s11,
int s12,
int s2_,
int s20,
int s21,
int s22,
int xfrac,
int yfrac)
Performs interpolation on a 4x4 grid of integral samples. |
double |
interpolateH(double[] samples,
float xfrac)
Performs horizontal interpolation on a one-dimensional array of double samples. |
double |
interpolateH(double s_,
double s0,
double s1,
double s2,
float xfrac)
Performs interpolation on a horizontal quad of double samples. |
double |
interpolateH(double s0,
double s1,
float xfrac)
Performs horizontal interpolation on a horizontal pair of double samples. |
float |
interpolateH(float[] samples,
float xfrac)
Performs horizontal interpolation on a one-dimensional array of floating-point samples. |
float |
interpolateH(float s0,
float s1,
float xfrac)
Performs horizontal interpolation on a horizontal pair of floating-point samples. |
float |
interpolateH(float s_,
float s0,
float s1,
float s2,
float frac)
Performs horizontal interpolation on a horizontal quad of floating-point samples. |
int |
interpolateH(int[] samples,
int xfrac)
Performs horizontal interpolation on a one-dimensional array of integral samples. |
int |
interpolateH(int s0,
int s1,
int xfrac)
Performs horizontal interpolation on a pair of integral samples. |
int |
interpolateH(int s_,
int s0,
int s1,
int s2,
int xfrac)
Performs horizontal interpolation on a quadruple of integral samples. |
double |
interpolateV(double[] samples,
float yfrac)
Performs vertical interpolation on a one-dimensional array of double samples. |
double |
interpolateV(double s_,
double s0,
double s1,
double s2,
float yfrac)
Performs vertical interpolation on a vertical quad of double samples. |
double |
interpolateV(double s0,
double s1,
float yfrac)
Performs vertical interpolation on a vertical pair of double samples. |
float |
interpolateV(float[] samples,
float yfrac)
Performs vertical interpolation on a one-dimensional array of floating-point samples. |
float |
interpolateV(float s0,
float s1,
float yfrac)
Performs vertical interpolation on a vertical pair of floating-point samples. |
float |
interpolateV(float s_,
float s0,
float s1,
float s2,
float frac)
Performs vertical interpolation on a horizontal quad of floating-point samples. |
int |
interpolateV(int[] samples,
int yfrac)
Performs vertical interpolation on a one-dimensional array of integral samples. |
int |
interpolateV(int s0,
int s1,
int yfrac)
Performs vertical interpolation on a pair of integral samples. |
int |
interpolateV(int s_,
int s0,
int s1,
int s2,
int yfrac)
Performs vertical interpolation on a quadruple of integral samples. |
Methods inherited from class javax.media.jai.Interpolation |
getBottomPadding,
getHeight,
getInstance,
getLeftPadding,
getRightPadding,
getSubsampleBitsH,
getSubsampleBitsV,
getTopPadding,
getWidth,
isSeparable |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public InterpolationBilinear(int subsampleBits)
subsampleBits
- the subsample precision.public InterpolationBilinear()
Method Detail |
public final int interpolateH(int[] samples, int xfrac)
samples
- an array of ints.xfrac
- the subsample position, multiplied by 2^(subsampleBits).public final int interpolateV(int[] samples, int yfrac)
samples
- an array of ints.yfrac
- the Y subsample position, multiplied by 2^(subsampleBits).public final int interpolate(int[][] samples, int xfrac, int yfrac)
samples
- a two-dimensional array of ints.xfrac
- the X subsample position, multiplied by 2^(subsampleBits).yfrac
- the Y subsample position, multiplied by 2^(subsampleBits).public final int interpolateH(int s0, int s1, int xfrac)
s0
- the central sample.s1
- the sample to the right of the central sample.xfrac
- the subsample position, multiplied by 2^(subsampleBits).public final int interpolateV(int s0, int s1, int yfrac)
s0
- the central sample.s1
- the sample below the central sample.yfrac
- the Y subsample position, multiplied by 2^(subsampleBits).public final int interpolateH(int s_, int s0, int s1, int s2, int xfrac)
s_
- the sample to the left of the central sample.s0
- the central sample.s1
- the sample to the right of the central sample.s2
- the sample to the right of s1.xfrac
- the subsample position, multiplied by 2(subsampleBitsH).Interpolation.interpolateH(int[], int)
public final int interpolateV(int s_, int s0, int s1, int s2, int yfrac)
s_
- the sample above the central sample.s0
- the central sample.s1
- the sample below the central sample.s2
- the sample below s1.yfrac
- the Y subsample position, multiplied by 2(subsampleBitsV).Interpolation.interpolateH(int[], int)
public final int interpolate(int s00, int s01, int s10, int s11, int xfrac, int yfrac)
s00
- the central sample.s01
- the sample to the right of the central sample.s10
- the sample below the central sample.s11
- the sample below and to the right of the central sample.xfrac
- the X subsample position, multiplied by 2^(subsampleBits).yfrac
- the Y subsample position, multiplied by 2^(subsampleBits).public final int interpolate(int s__, int s_0, int s_1, int s_2, int s0_, int s00, int s01, int s02, int s1_, int s10, int s11, int s12, int s2_, int s20, int s21, int s22, int xfrac, int yfrac)
s__
- the sample above and to the left of the central sample.s_0
- the sample above the central sample.s_1
- the sample above and one to the right of the central sample.s_2
- the sample above and two to the right of the central sample.s0_
- the sample to the left of the central sample.s00
- the central sample.s01
- the sample to the right of the central sample.s02
- the sample two to the right of the central sample.s1_
- the sample below and one to the left of the central sample.s10
- the sample below the central sample.s11
- the sample below and one to the right of the central sample.s12
- the sample below and two to the right of the central sample.s2_
- the sample two below and one to the left of the central sample.s20
- the sample two below the central sample.s21
- the sample two below and one to the right of the central sample.s22
- the sample two below and two to the right of the central sample.xfrac
- the X subsample position, multiplied by 2(subsampleBitsH).yfrac
- the Y subsample position, multiplied by 2(subsampleBitsV).Interpolation.interpolateH(int[], int)
public final float interpolateH(float[] samples, float xfrac)
samples
- an array of floats.xfrac
- the X subsample position, in the range [0.0F, 1.0F).public final float interpolateV(float[] samples, float yfrac)
samples
- an array of floats.yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final float interpolate(float[][] samples, float xfrac, float yfrac)
samples
- an array of floats.xfrac
- the X subsample position, in the range [0.0F, 1.0F).yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final float interpolateH(float s0, float s1, float xfrac)
s0
- the central sample.s1
- the sample to the right of the central sample.xfrac
- the subsample position, in the range [0.0F, 1.0F).public final float interpolateV(float s0, float s1, float yfrac)
s0
- the central sample.s1
- the sample below the central sample.yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final float interpolateH(float s_, float s0, float s1, float s2, float frac)
s_
- the sample to the left of the central sample.s0
- the central sample.s1
- the sample to the right of the central sample.s2
- the sample to the right of s1.xfrac
- the subsample position, in the range [0.0F, 1.0F).public final float interpolateV(float s_, float s0, float s1, float s2, float frac)
s_
- the sample above the central sample.s0
- the central sample.s1
- the sample below the central sample.s2
- the sample below s1.yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final float interpolate(float s00, float s01, float s10, float s11, float xfrac, float yfrac)
s00
- the central sample.s01
- the sample to the right of the central sample.s10
- the sample below the central sample.s11
- the sample below and to the right of the central sample.xfrac
- the X subsample position, in the range [0.0F, 1.0F).yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final float interpolate(float s__, float s_0, float s_1, float s_2, float s0_, float s00, float s01, float s02, float s1_, float s10, float s11, float s12, float s2_, float s20, float s21, float s22, float xfrac, float yfrac)
s__
- the sample above and to the left of the central sample.s_0
- the sample above the central sample.s_1
- the sample above and one to the right of the central sample.s_2
- the sample above and two to the right of the central sample.s0_
- the sample to the left of the central sample.s00
- the central sample.s01
- the sample to the right of the central sample.s02
- the sample two to the right of the central sample.s1_
- the sample below and one to the left of the central sample.s10
- the sample below the central sample.s11
- the sample below and one to the right of the central sample.s12
- the sample below and two to the right of the central sample.s2_
- the sample two below and one to the left of the central sample.s20
- the sample two below the central sample.s21
- the sample two below and one to the right of the central sample.s22
- the sample two below and two to the right of the central sample.xfrac
- the X subsample position, in the range [0.0F, 1.0F).yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final double interpolateH(double[] samples, float xfrac)
samples
- an array of doubles.xfrac
- the X subsample position, in the range [0.0F, 1.0F).public final double interpolateV(double[] samples, float yfrac)
samples
- an array of doubles.yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final double interpolate(double[][] samples, float xfrac, float yfrac)
samples
- an array of doubles.xfrac
- the X subsample position, in the range [0.0F, 1.0F).yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final double interpolateH(double s0, double s1, float xfrac)
s0
- the central sample.s1
- the sample to the right of the central sample.xfrac
- the subsample position, in the range [0.0F, 1.0F).public final double interpolateV(double s0, double s1, float yfrac)
s0
- the central sample.s1
- the sample below the central sample.yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final double interpolateH(double s_, double s0, double s1, double s2, float xfrac)
s_
- the sample to the left of the central sample.s0
- the central sample.s1
- the sample to the right of the central sample.s2
- the sample to the right of s1.xfrac
- the subsample position, in the range [0.0F, 1.0F).public final double interpolateV(double s_, double s0, double s1, double s2, float yfrac)
s_
- the sample above the central sample.s0
- the central sample.s1
- the sample below the central sample.s2
- the sample below s1.yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final double interpolate(double s00, double s01, double s10, double s11, float xfrac, float yfrac)
s00
- the central sample.s01
- the sample to the right of the central sample.s10
- the sample below the central sample.s11
- the sample below and to the right of the central sample.xfrac
- the X subsample position, in the range [0.0F, 1.0F).yfrac
- the Y subsample position, in the range [0.0F, 1.0F).public final double interpolate(double s__, double s_0, double s_1, double s_2, double s0_, double s00, double s01, double s02, double s1_, double s10, double s11, double s12, double s2_, double s20, double s21, double s22, float xfrac, float yfrac)
s__
- the sample above and to the left of the central sample.s_0
- the sample above the central sample.s_1
- the sample above and one to the right of the central sample.s_2
- the sample above and two to the right of the central sample.s0_
- the sample to the left of the central sample.s00
- the central sample.s01
- the sample to the right of the central sample.s02
- the sample two to the right of the central sample.s1_
- the sample below and one to the left of the central sample.s10
- the sample below the central sample.s11
- the sample below and one to the right of the central sample.s12
- the sample below and two to the right of the central sample.s2_
- the sample two below and one to the left of the central sample.s20
- the sample two below the central sample.s21
- the sample two below and one to the right of the central sample.s22
- the sample two below and two to the right of the central sample.xfrac
- the X subsample position, in the range [0.0F, 1.0F).yfrac
- the Y subsample position, in the range [0.0F, 1.0F).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |