| java.lang.Object javax.media.jai.Interpolation javax.media.jai.InterpolationBilinear
InterpolationBilinear | final public class InterpolationBilinear extends Interpolation (Code) | | 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.
|
Constructor Summary | |
public | InterpolationBilinear(int subsampleBits) Constructs an InterpolationBilinear with a given subsample
precision, in bits. | public | InterpolationBilinear() Constructs an InterpolationBilinear with the default subsample
precision 0f 8 bits. |
Method Summary | |
final public int | interpolate(int[][] samples, int xfrac, int yfrac) Performs interpolation on a two-dimensional array of integral samples.
Parameters: samples - a two-dimensional array of ints. Parameters: xfrac - the X subsample position, multiplied by 2^(subsampleBits). Parameters: yfrac - the Y subsample position, multiplied by 2^(subsampleBits). | final public int | interpolate(int s00, int s01, int s10, int s11, int xfrac, int yfrac) Performs interpolation on a 2x2 grid of integral samples.
Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and to the right of the central sample. Parameters: xfrac - the X subsample position, multiplied by 2^(subsampleBits). Parameters: yfrac - the Y subsample position, multiplied by 2^(subsampleBits). | final public 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. | final public float | interpolate(float[][] samples, float xfrac, float yfrac) Performs interpolation on a two-dimensional array of
floating-point samples.
Parameters: samples - an array of floats. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). | final public float | interpolate(float s00, float s01, float s10, float s11, float xfrac, float yfrac) Performs interpolation on a 2x2 grid of floating-point samples.
Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and to the right of the central sample. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). | final public 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. | final public double | interpolate(double[][] samples, float xfrac, float yfrac) Performs interpolation on a two-dimensional array of
double samples.
Parameters: samples - an array of doubles. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). | final public double | interpolate(double s00, double s01, double s10, double s11, float xfrac, float yfrac) Performs interpolation on a 2x2 grid of double samples.
Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and to the right of the central sample. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). | final public 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. | final public int | interpolateH(int[] samples, int xfrac) Performs horizontal interpolation on a one-dimensional array of integral samples.
Parameters: samples - an array of ints. Parameters: xfrac - the subsample position, multiplied by 2^(subsampleBits). | final public int | interpolateH(int s0, int s1, int xfrac) Performs horizontal interpolation on a pair of integral samples.
This method may be used instead of the array version for speed.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the subsample position, multiplied by 2^(subsampleBits). | final public int | interpolateH(int s_, int s0, int s1, int s2, int xfrac) Performs horizontal interpolation on a quadruple of integral samples.
The outlying samples are ignored. | final public float | interpolateH(float[] samples, float xfrac) Performs horizontal interpolation on a one-dimensional array of
floating-point samples.
Parameters: samples - an array of floats. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). | final public float | interpolateH(float s0, float s1, float xfrac) Performs horizontal interpolation on a horizontal pair of floating-point
samples. | final public float | interpolateH(float s_, float s0, float s1, float s2, float frac) Performs horizontal interpolation on a horizontal quad of floating-point
samples. | final public double | interpolateH(double[] samples, float xfrac) Performs horizontal interpolation on a one-dimensional array of
double samples.
Parameters: samples - an array of doubles. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). | final public double | interpolateH(double s0, double s1, float xfrac) Performs horizontal interpolation on a horizontal pair of double
samples. | final public double | interpolateH(double s_, double s0, double s1, double s2, float xfrac) Performs interpolation on a horizontal quad of double
samples. | final public int | interpolateV(int[] samples, int yfrac) Performs vertical interpolation on a one-dimensional array of integral samples.
Parameters: samples - an array of ints. Parameters: yfrac - the Y subsample position, multiplied by 2^(subsampleBits). | final public int | interpolateV(int s0, int s1, int yfrac) Performs vertical interpolation on a pair of integral samples.
This method may be used instead of the array version for speed.
Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: yfrac - the Y subsample position, multiplied by 2^(subsampleBits). | final public int | interpolateV(int s_, int s0, int s1, int s2, int yfrac) Performs vertical interpolation on a quadruple of integral samples.
The outlying samples are ignored. | final public float | interpolateV(float[] samples, float yfrac) Performs vertical interpolation on a one-dimensional array of
floating-point samples.
Parameters: samples - an array of floats. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). | final public float | interpolateV(float s0, float s1, float yfrac) Performs vertical interpolation on a vertical pair of floating-point
samples. | final public float | interpolateV(float s_, float s0, float s1, float s2, float frac) Performs vertical interpolation on a horizontal quad of floating-point
samples. | final public double | interpolateV(double[] samples, float yfrac) Performs vertical interpolation on a one-dimensional array of
double samples.
Parameters: samples - an array of doubles. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). | final public double | interpolateV(double s0, double s1, float yfrac) Performs vertical interpolation on a vertical pair of double
samples. | final public double | interpolateV(double s_, double s0, double s1, double s2, float yfrac) Performs vertical interpolation on a vertical quad of double
samples. |
DEFAULT_SUBSAMPLE_BITS | final static int DEFAULT_SUBSAMPLE_BITS(Code) | | |
InterpolationBilinear | public InterpolationBilinear(int subsampleBits)(Code) | | Constructs an InterpolationBilinear with a given subsample
precision, in bits. This precision is applied to both axes.
Parameters: subsampleBits - the subsample precision. |
InterpolationBilinear | public InterpolationBilinear()(Code) | | Constructs an InterpolationBilinear with the default subsample
precision 0f 8 bits.
|
interpolate | final public int interpolate(int[][] samples, int xfrac, int yfrac)(Code) | | Performs interpolation on a two-dimensional array of integral samples.
Parameters: samples - a two-dimensional array of ints. Parameters: xfrac - the X subsample position, multiplied by 2^(subsampleBits). Parameters: yfrac - the Y subsample position, multiplied by 2^(subsampleBits). the interpolated value as an int. |
interpolate | final public int interpolate(int s00, int s01, int s10, int s11, int xfrac, int yfrac)(Code) | | Performs interpolation on a 2x2 grid of integral samples.
Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and to the right of the central sample. Parameters: xfrac - the X subsample position, multiplied by 2^(subsampleBits). Parameters: yfrac - the Y subsample position, multiplied by 2^(subsampleBits). the interpolated value as an int. |
interpolate | final public 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)(Code) | | Performs interpolation on a 4x4 grid of integral samples.
The outlying samples are ignored.
|
interpolate | final public float interpolate(float[][] samples, float xfrac, float yfrac)(Code) | | Performs interpolation on a two-dimensional array of
floating-point samples.
Parameters: samples - an array of floats. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a float. |
interpolate | final public float interpolate(float s00, float s01, float s10, float s11, float xfrac, float yfrac)(Code) | | Performs interpolation on a 2x2 grid of floating-point samples.
Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and to the right of the central sample. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a float. |
interpolate | final public 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)(Code) | | Performs interpolation on a 4x4 grid. The outlying samples
are ignored.
|
interpolate | final public double interpolate(double[][] samples, float xfrac, float yfrac)(Code) | | Performs interpolation on a two-dimensional array of
double samples.
Parameters: samples - an array of doubles. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a double. |
interpolate | final public double interpolate(double s00, double s01, double s10, double s11, float xfrac, float yfrac)(Code) | | Performs interpolation on a 2x2 grid of double samples.
Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and to the right of the central sample. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a double. |
interpolate | final public 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)(Code) | | Performs interpolation on a 4x4 grid. The outlying samples
are ignored.
|
interpolateH | final public int interpolateH(int[] samples, int xfrac)(Code) | | Performs horizontal interpolation on a one-dimensional array of integral samples.
Parameters: samples - an array of ints. Parameters: xfrac - the subsample position, multiplied by 2^(subsampleBits). the interpolated value as an int. |
interpolateH | final public int interpolateH(int s0, int s1, int xfrac)(Code) | | Performs horizontal interpolation on a pair of integral samples.
This method may be used instead of the array version for speed.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the subsample position, multiplied by 2^(subsampleBits). the interpolated value as an int. |
interpolateH | final public int interpolateH(int s_, int s0, int s1, int s2, int xfrac)(Code) | | Performs horizontal interpolation on a quadruple of integral samples.
The outlying samples are ignored.
|
interpolateH | final public float interpolateH(float[] samples, float xfrac)(Code) | | Performs horizontal interpolation on a one-dimensional array of
floating-point samples.
Parameters: samples - an array of floats. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). the interpolated value as a float. |
interpolateH | final public float interpolateH(float s0, float s1, float xfrac)(Code) | | Performs horizontal interpolation on a horizontal pair of floating-point
samples. This method may be used instead of the array version
for speed.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the subsample position, in the range [0.0F, 1.0F). the interpolated value as a float. |
interpolateH | final public float interpolateH(float s_, float s0, float s1, float s2, float frac)(Code) | | Performs horizontal interpolation on a horizontal quad of floating-point
samples. The outlying samples are ignored.
|
interpolateH | final public double interpolateH(double[] samples, float xfrac)(Code) | | Performs horizontal interpolation on a one-dimensional array of
double samples.
Parameters: samples - an array of doubles. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). the interpolated value as a double. |
interpolateH | final public double interpolateH(double s0, double s1, float xfrac)(Code) | | Performs horizontal interpolation on a horizontal pair of double
samples. This method may be used instead of the array version
for speed.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the subsample position, in the range [0.0F, 1.0F). the interpolated value as a double. |
interpolateH | final public double interpolateH(double s_, double s0, double s1, double s2, float xfrac)(Code) | | Performs interpolation on a horizontal quad of double
samples. The outlying samples are ignored.
|
interpolateV | final public int interpolateV(int[] samples, int yfrac)(Code) | | Performs vertical interpolation on a one-dimensional array of integral samples.
Parameters: samples - an array of ints. Parameters: yfrac - the Y subsample position, multiplied by 2^(subsampleBits). the interpolated value as an int. |
interpolateV | final public int interpolateV(int s0, int s1, int yfrac)(Code) | | Performs vertical interpolation on a pair of integral samples.
This method may be used instead of the array version for speed.
Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: yfrac - the Y subsample position, multiplied by 2^(subsampleBits). the interpolated value as an int. |
interpolateV | final public int interpolateV(int s_, int s0, int s1, int s2, int yfrac)(Code) | | Performs vertical interpolation on a quadruple of integral samples.
The outlying samples are ignored.
|
interpolateV | final public float interpolateV(float[] samples, float yfrac)(Code) | | Performs vertical interpolation on a one-dimensional array of
floating-point samples.
Parameters: samples - an array of floats. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a float. |
interpolateV | final public float interpolateV(float s0, float s1, float yfrac)(Code) | | Performs vertical interpolation on a vertical pair of floating-point
samples. This method may be used instead of the array version
for speed.
Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a float. |
interpolateV | final public float interpolateV(float s_, float s0, float s1, float s2, float frac)(Code) | | Performs vertical interpolation on a horizontal quad of floating-point
samples. The outlying samples are ignored.
|
interpolateV | final public double interpolateV(double[] samples, float yfrac)(Code) | | Performs vertical interpolation on a one-dimensional array of
double samples.
Parameters: samples - an array of doubles. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a double. |
interpolateV | final public double interpolateV(double s0, double s1, float yfrac)(Code) | | Performs vertical interpolation on a vertical pair of double
samples. This method may be used instead of the array version
for speed.
Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a double. |
interpolateV | final public double interpolateV(double s_, double s0, double s1, double s2, float yfrac)(Code) | | Performs vertical interpolation on a vertical quad of double
samples. The outlying samples are ignored.
|
Methods inherited from javax.media.jai.Interpolation | public int getBottomPadding()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public static synchronized Interpolation getInstance(int type)(Code)(Java Doc) public int getLeftPadding()(Code)(Java Doc) public int getRightPadding()(Code)(Java Doc) public int getSubsampleBitsH()(Code)(Java Doc) public int getSubsampleBitsV()(Code)(Java Doc) public int getTopPadding()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public int interpolate(int[][] samples, int xfrac, int yfrac)(Code)(Java Doc) public int interpolate(int s00, int s01, int s10, int s11, int xfrac, int yfrac)(Code)(Java Doc) public 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)(Code)(Java Doc) public float interpolate(float[][] samples, float xfrac, float yfrac)(Code)(Java Doc) public float interpolate(float s00, float s01, float s10, float s11, float xfrac, float yfrac)(Code)(Java Doc) public 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)(Code)(Java Doc) public double interpolate(double[][] samples, float xfrac, float yfrac)(Code)(Java Doc) public double interpolate(double s00, double s01, double s10, double s11, float xfrac, float yfrac)(Code)(Java Doc) public 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)(Code)(Java Doc) abstract public int interpolateH(int[] samples, int xfrac)(Code)(Java Doc) public int interpolateH(int s0, int s1, int xfrac)(Code)(Java Doc) public int interpolateH(int s_, int s0, int s1, int s2, int xfrac)(Code)(Java Doc) abstract public float interpolateH(float[] samples, float xfrac)(Code)(Java Doc) public float interpolateH(float s0, float s1, float xfrac)(Code)(Java Doc) public float interpolateH(float s_, float s0, float s1, float s2, float xfrac)(Code)(Java Doc) abstract public double interpolateH(double[] samples, float xfrac)(Code)(Java Doc) public double interpolateH(double s0, double s1, float xfrac)(Code)(Java Doc) public double interpolateH(double s_, double s0, double s1, double s2, float xfrac)(Code)(Java Doc) public int interpolateV(int[] samples, int yfrac)(Code)(Java Doc) public int interpolateV(int s0, int s1, int yfrac)(Code)(Java Doc) public int interpolateV(int s_, int s0, int s1, int s2, int yfrac)(Code)(Java Doc) public float interpolateV(float[] samples, float yfrac)(Code)(Java Doc) public float interpolateV(float s0, float s1, float yfrac)(Code)(Java Doc) public float interpolateV(float s_, float s0, float s1, float s2, float yfrac)(Code)(Java Doc) public double interpolateV(double[] samples, float yfrac)(Code)(Java Doc) public double interpolateV(double s0, double s1, float yfrac)(Code)(Java Doc) public double interpolateV(double s_, double s0, double s1, double s2, float yfrac)(Code)(Java Doc) public boolean isSeparable()(Code)(Java Doc)
|
|
|