| java.lang.Object javax.media.jai.Interpolation javax.media.jai.InterpolationTable
All known Subclasses: javax.media.jai.InterpolationBicubic2, javax.media.jai.InterpolationBicubic,
InterpolationTable | public class InterpolationTable extends Interpolation (Code) | | A subclass of Interpolation that uses tables to store the
interpolation kernels. The set of subpixel positions is broken up
into a fixed number of "bins" and a distinct kernel is used for
each bin. The number of bins must be a power of two.
An InterpolationTable defines a separable interpolation, with a
set of kernels for each dimension. The number of bins may vary
between the two dimensions. Both the horizontal and vertical
interpolation kernels have a "key" element. This element is positioned
over the
which The kernels are stored in double precision,
floating- and fixed-point form. The fixed point representation has
a user-specified fractional precision. It is the user's
responsibility to specify an appropriate level of precision that
will not cause overflow when accumulating the results of a
convolution against a set of source pixels, using 32-bit integer
arithmetic.
|
Field Summary | |
protected double[] | dataHd The horizontal coefficient data in double format. | protected float[] | dataHf The horizontal coefficient data in floating-point format. | protected int[] | dataHi The horizontal coefficient data in fixed-point format. | protected double[] | dataVd The vertical coefficient data in double format. | protected float[] | dataVf The vertical coefficient data in floating-point format. | protected int[] | dataVi The vertical coefficient data in fixed-point format. | protected int | precisionBits The number of fractional bits used to describe filter coefficients. |
Constructor Summary | |
public | InterpolationTable(int keyX, int keyY, int width, int height, int subsampleBitsH, int subsampleBitsV, int precisionBits, int[] dataH, int[] dataV) Constructs an InterpolationTable with specified horizontal and
vertical extents (support), number of horizontal and vertical
bins, fixed-point fractional precision, and int kernel entries.
The kernel data values are organized as
2subsampleBits entries each
containing width ints.
dataH and dataV are required to contain width * 2subsampleBitsH
and height * 2subsampleBitsV entries respectively, otherwise
an IllegalArgumentException will be thrown.
If dataV is null, it is assumed to be a copy of dataH
and the keyY, height, and subsampleBitsV parameters
are ignored.
Parameters: keyX - The array offset of the horizontal resampling kernel center Parameters: keyY - The array offset of the vertical resampling kernel center Parameters: width - the width of a horizontal resampling kernel. Parameters: height - the height of a vertical resampling kernel. | public | InterpolationTable(int key, int width, int subsampleBits, int precisionBits, int[] data) Constructs an InterpolationTable with identical horizontal and
vertical resampling kernels.
Parameters: key - The array offset of the central sample to be used during resampling. Parameters: width - the width or height of a resampling kernel. Parameters: subsampleBits - the log (base 2) of the number ofsubsample positions. | public | InterpolationTable(int keyX, int keyY, int width, int height, int subsampleBitsH, int subsampleBitsV, int precisionBits, float[] dataH, float[] dataV) Constructs an InterpolationTable with specified horizontal and
vertical extents (support), number of horizontal and vertical
bins, fixed-point fractional precision, and float kernel entries.
The kernel data values are organized as 2subsampleBits entries each
containing width floats.
dataH and dataV are required to contain width * 2subsampleBitsH
and height * 2subsampleBitsV entries respectively, otherwise
an IllegalArgumentException will be thrown.
If dataV is null, it is assumed to be a copy of dataH
and the keyY, height, and subsampleBitsV parameters
are ignored.
Parameters: keyX - The array offset of the horizontal resampling kernel center Parameters: keyY - The array offset of the vertical resampling kernel center Parameters: width - the width of a horizontal resampling kernel. Parameters: height - the height of a vertical resampling kernel. | public | InterpolationTable(int key, int width, int subsampleBits, int precisionBits, float[] data) Constructs an InterpolationTable with identical horizontal and
vertical resampling kernels.
Parameters: key - The number of samples to the left or above thecentral sample to be used during resampling. Parameters: width - the width or height of a resampling kernel. Parameters: subsampleBits - the log (base 2) of the number ofsubsample positions. | public | InterpolationTable(int keyX, int keyY, int width, int height, int subsampleBitsH, int subsampleBitsV, int precisionBits, double[] dataH, double[] dataV) Constructs an InterpolationTable with specified horizontal and
vertical extents (support), number of horizontal and vertical
bins, fixed-point fractional precision, and double kernel entries.
The kernel data values are organized as 2subsampleBits entries each
containing width doubles.
dataH and dataV are required to contain width * 2subsampleBitsH
and height * 2subsampleBitsV entries respectively, otherwise
an IllegalArgumentException will be thrown.
If dataV is null, it is assumed to be a copy of dataH
and the keyY, height, and subsampleBitsV parameters
are ignored.
Parameters: keyX - The array offset of the horizontal resampling kernel center Parameters: keyY - The array offset of the vertical resampling kernel center Parameters: width - the width of a horizontal resampling kernel. Parameters: height - the height of a vertical resampling kernel. | public | InterpolationTable(int key, int width, int subsampleBits, int precisionBits, double[] data) Constructs an InterpolationTable with identical horizontal and
vertical resampling kernels.
Parameters: key - The number of samples to the left or above thecentral sample to be used during resampling. Parameters: width - the width or height of a resampling kernel. Parameters: subsampleBits - the log (base 2) of the number ofsubsample positions. |
Method Summary | |
public int[] | getHorizontalTableData() Returns the integer (fixed-point) horizontal table data. | public double[] | getHorizontalTableDataDouble() Returns the double horizontal table data. | public float[] | getHorizontalTableDataFloat() Returns the floating-point horizontal table data. | public int | getPrecisionBits() Returns the number of bits of fractional precision used to
store the fixed-point table entries. | public int[] | getVerticalTableData() Returns the integer (fixed-point) vertical table data. | public double[] | getVerticalTableDataDouble() Returns the double vertical table data. | public float[] | getVerticalTableDataFloat() Returns the floating-point vertical table data. | public int | interpolate(int s00, int s01, int s10, int s11, int xfrac, int yfrac) Performs interpolation on a 2x2 grid of integral samples.
It should only be called if width == height == 2 and
keyX == keyY == 0.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , or
yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where width and height
are the width and height of the horizontal and vertical resampling
kernels respectively.
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 2subsampleBitsH . Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . | 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.
It should only be called if width == height == 4 and
keyX == keyY == 1.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , or
yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where width and height
are the the width and height of the horizontal and vertical
resampling kernels respectively.
Parameters: s__ - the sample above and to the left of the central sample. Parameters: s_0 - the sample above the central sample. Parameters: s_1 - the sample above and one to the right of the central sample. Parameters: s_2 - the sample above and two to the right of the central sample. Parameters: s0_ - the sample to the left of the central sample. Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s02 - the sample two to the right of the central sample. Parameters: s1_ - the sample below and one to the left of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and one to the right of the central sample. Parameters: s12 - the sample below and two to the right of the central sample. Parameters: s2_ - the sample two below and one to the left of the central sample. Parameters: s20 - the sample two below the central sample. Parameters: s21 - the sample two below and one to the right of the central sample. Parameters: s22 - the sample two below and two to the right of the central sample. Parameters: xfrac - the X subsample position, multiplied by 2subsampleBitsH . Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . | 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.
It should only be called if width == height == 2 and
keyX == keyY == 0.
If either xfrac or yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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). | 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 of floating-point samples.
It should only be called if width == height == 4 and
keyX == keyY == 1.
If either xfrac or yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s__ - the sample above and to the left of the central sample. Parameters: s_0 - the sample above the central sample. Parameters: s_1 - the sample above and one to the right of the central sample. Parameters: s_2 - the sample above and two to the right of the central sample. Parameters: s0_ - the sample to the left of the central sample. Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s02 - the sample two to the right of the central sample. Parameters: s1_ - the sample below and one to the left of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and one to the right of the central sample. Parameters: s12 - the sample below and two to the right of the central sample. Parameters: s2_ - the sample two below and one to the left of the central sample. Parameters: s20 - the sample two below the central sample. Parameters: s21 - the sample two below and one to the right of the central sample. Parameters: s22 - the sample two below and two 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). | public double | interpolate(double s00, double s01, double s10, double s11, float xfrac, float yfrac) Performs interpolation on a 2x2 grid of double samples.
It should only be called if width == height == 2 and
keyX == keyY == 0.
If either xfrac or yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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). | 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 of double samples.
It should only be called if width == height == 4 and
keyX == keyY == 1.
If either xfrac or yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s__ - the sample above and to the left of the central sample. Parameters: s_0 - the sample above the central sample. Parameters: s_1 - the sample above and one to the right of the central sample. Parameters: s_2 - the sample above and two to the right of the central sample. Parameters: s0_ - the sample to the left of the central sample. Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s02 - the sample two to the right of the central sample. Parameters: s1_ - the sample below and one to the left of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and one to the right of the central sample. Parameters: s12 - the sample below and two to the right of the central sample. Parameters: s2_ - the sample two below and one to the left of the central sample. Parameters: s20 - the sample two below the central sample. Parameters: s21 - the sample two below and one to the right of the central sample. Parameters: s22 - the sample two below and two 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). | public int | interpolateF(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. | public int | interpolateH(int[] samples, int xfrac) Performs horizontal interpolation on a one-dimensional array of
integral samples.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , an
ArrayIndexOutOfBoundsException may occur, where width is the width
of the horizontal resampling kernel.
Parameters: samples - an array of ints. Parameters: xfrac - the subsample position, multiplied by 2subsampleBitsH . | 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.
It should only be called if width == 2.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , an
ArrayIndexOutOfBoundsException may occur, where width is the width
of the horizontal resampling kernel.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the subsample position, multiplied by 2subsampleBitsH . | public int | interpolateH(int s_, int s0, int s1, int s2, int xfrac) Performs horizontal interpolation on a quadruple of integral samples.
This method may be used instead of the array version for speed.
It should only be called if width == 4 and keyX == 1.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , an
ArrayIndexOutOfBoundsException may occur, where width is the width
of the horizontal resampling kernel.
Parameters: s_ - the sample to the left of the central sample. Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: s2 - the sample to the right of s1. Parameters: xfrac - the subsample position, multiplied by 2subsampleBitsH . | public float | interpolateH(float[] samples, float xfrac) Performs horizontal interpolation on a one-dimensional array of
floating-point samples representing a row of samples.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: samples - an array of floats. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). | public float | interpolateH(float s0, float s1, float xfrac) Performs horizontal interpolation on a pair of floating-point samples.
This method may be used instead of the array version for speed.
It should only be called if width == 2.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). | public float | interpolateH(float s_, float s0, float s1, float s2, float xfrac) Performs horizontal interpolation on a quadruple of floating-point
samples. | public double | interpolateH(double[] samples, float xfrac) Performs horizontal interpolation on a one-dimensional array of
double samples representing a row of samples.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: samples - an array of doubles. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). | public double | interpolateH(double s0, double s1, float xfrac) Performs horizontal interpolation on a pair of double samples.
This method may be used instead of the array version for speed.
It should only be called if width == 2.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). | public double | interpolateH(double s_, double s0, double s1, double s2, float xfrac) Performs horizontal interpolation on a quadruple of double
samples. | public int | interpolateV(int[] samples, int yfrac) Performs vertical interpolation on a one-dimensional array of
integral samples.
If yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where height is the
height of the vertical resampling kernel.
Parameters: samples - an array of ints. Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . | 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.
It should only be called if height == 2 and keyY == 0.
If yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where height is the
height of the vertical resampling kernel.
Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . | public int | interpolateV(int s_, int s0, int s1, int s2, int yfrac) Performs vertical interpolation on a quadruple of integral samples.
This method may be used instead of the array version for speed.
It should only be called if height == 4 and keyY == 1.
If yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where height is the
height of the vertical resampling kernel.
Parameters: s_ - the sample above the central sample. Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: s2 - the sample below s1. Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . | public float | interpolateV(float[] samples, float yfrac) Performs vertical interpolation on a one-dimensional array of
floating-point samples representing a column of samples.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: samples - an array of floats. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). | public float | interpolateV(float s0, float s1, float yfrac) Performs vertical interpolation on a pair of floating-point samples.
This method may be used instead of the array version for speed.
It should only be called if height == 2 and keyY == 0.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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). | public float | interpolateV(float s_, float s0, float s1, float s2, float yfrac) Performs vertical interpolation on a quadruple of floating-point
samples. | public double | interpolateV(double[] samples, float yfrac) Performs vertical interpolation on a one-dimensional array of
double samples representing a column of samples.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: samples - an array of doubles. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). | public double | interpolateV(double s0, double s1, float yfrac) Performs vertical interpolation on a pair of double samples.
This method may be used instead of the array version for speed.
It should only be called if height == 2 and keyY == 0.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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). | public double | interpolateV(double s_, double s0, double s1, double s2, float yfrac) Performs vertical interpolation on a quadruple of double
samples. |
dataHd | protected double[] dataHd(Code) | | The horizontal coefficient data in double format.
|
dataHf | protected float[] dataHf(Code) | | The horizontal coefficient data in floating-point format.
|
dataHi | protected int[] dataHi(Code) | | The horizontal coefficient data in fixed-point format.
|
dataVd | protected double[] dataVd(Code) | | The vertical coefficient data in double format.
|
dataVf | protected float[] dataVf(Code) | | The vertical coefficient data in floating-point format.
|
dataVi | protected int[] dataVi(Code) | | The vertical coefficient data in fixed-point format.
|
precisionBits | protected int precisionBits(Code) | | The number of fractional bits used to describe filter coefficients.
|
InterpolationTable | public InterpolationTable(int keyX, int keyY, int width, int height, int subsampleBitsH, int subsampleBitsV, int precisionBits, int[] dataH, int[] dataV)(Code) | | Constructs an InterpolationTable with specified horizontal and
vertical extents (support), number of horizontal and vertical
bins, fixed-point fractional precision, and int kernel entries.
The kernel data values are organized as
2subsampleBits entries each
containing width ints.
dataH and dataV are required to contain width * 2subsampleBitsH
and height * 2subsampleBitsV entries respectively, otherwise
an IllegalArgumentException will be thrown.
If dataV is null, it is assumed to be a copy of dataH
and the keyY, height, and subsampleBitsV parameters
are ignored.
Parameters: keyX - The array offset of the horizontal resampling kernel center Parameters: keyY - The array offset of the vertical resampling kernel center Parameters: width - the width of a horizontal resampling kernel. Parameters: height - the height of a vertical resampling kernel. Ignoredif dataV is null. Parameters: subsampleBitsH - the log (base 2) of the number of horizontalsubsample positions. Must be positive. Parameters: subsampleBitsV - the log (base 2) of the number of verticalsubsample positions. Must be positive. Ignored if dataV is null. Parameters: precisionBits - the number of bits of fractional precisionto be used when resampling integral sample values. Must be positive.The same value is used for both horizontal and verticalresampling. Parameters: dataH - the horizontal table entries, as an int array of2subsampleBitsH entries each of length width. The array is cloned internally. Parameters: dataV - the vertical table entries, as an int array of2subsampleBitsV entries each of length height, or null. The array is cloned internally.If null, the dataH table is used for vertical interpolationas well and the keyY, height, and subsampleBitsVparameters are ignored. throws: IllegalArgumentException - if the size of the data arraysare incorrect. |
InterpolationTable | public InterpolationTable(int key, int width, int subsampleBits, int precisionBits, int[] data)(Code) | | Constructs an InterpolationTable with identical horizontal and
vertical resampling kernels.
Parameters: key - The array offset of the central sample to be used during resampling. Parameters: width - the width or height of a resampling kernel. Parameters: subsampleBits - the log (base 2) of the number ofsubsample positions. Must be positive. Parameters: precisionBits - the number of bits of fractional precisionto be used when resampling integral sample values. Must be positive. Parameters: data - the kernel entries, as an int array ofwidth*2subsampleBits entries |
InterpolationTable | public InterpolationTable(int keyX, int keyY, int width, int height, int subsampleBitsH, int subsampleBitsV, int precisionBits, float[] dataH, float[] dataV)(Code) | | Constructs an InterpolationTable with specified horizontal and
vertical extents (support), number of horizontal and vertical
bins, fixed-point fractional precision, and float kernel entries.
The kernel data values are organized as 2subsampleBits entries each
containing width floats.
dataH and dataV are required to contain width * 2subsampleBitsH
and height * 2subsampleBitsV entries respectively, otherwise
an IllegalArgumentException will be thrown.
If dataV is null, it is assumed to be a copy of dataH
and the keyY, height, and subsampleBitsV parameters
are ignored.
Parameters: keyX - The array offset of the horizontal resampling kernel center Parameters: keyY - The array offset of the vertical resampling kernel center Parameters: width - the width of a horizontal resampling kernel. Parameters: height - the height of a vertical resampling kernel. Ignoredif dataV is null. Parameters: subsampleBitsH - the log (base 2) of the number of horizontalsubsample positions. Must be positive. Parameters: subsampleBitsV - the log (base 2) of the number of verticalsubsample positions. Must be positive. Ignored if dataV is null. Parameters: precisionBits - the number of bits of fractional precisionto be used when resampling integral sample values.The same value is used for both horizontal and verticalresampling. Must be positive. Parameters: dataH - the horizontal table entries, as a float array of2subsampleBitsH entries each of length width. Parameters: dataV - the vertical table entries, as a float array of2subsampleBitsV entries each of length height, or null.If null, the dataH table is used for vertical interpolationas well and the keyY, height, and subsampleBitsVparameters are ignored. throws: IllegalArgumentException - if the size of the data arraysare incorrect. |
InterpolationTable | public InterpolationTable(int key, int width, int subsampleBits, int precisionBits, float[] data)(Code) | | Constructs an InterpolationTable with identical horizontal and
vertical resampling kernels.
Parameters: key - The number of samples to the left or above thecentral sample to be used during resampling. Parameters: width - the width or height of a resampling kernel. Parameters: subsampleBits - the log (base 2) of the number ofsubsample positions. Must be positive. Parameters: precisionBits - the number of bits of fractional precisionto be used when resampling integral sample values. Must be positive. Parameters: data - the kernel entries, as a float array ofwidth*2subsampleBits entries |
InterpolationTable | public InterpolationTable(int keyX, int keyY, int width, int height, int subsampleBitsH, int subsampleBitsV, int precisionBits, double[] dataH, double[] dataV)(Code) | | Constructs an InterpolationTable with specified horizontal and
vertical extents (support), number of horizontal and vertical
bins, fixed-point fractional precision, and double kernel entries.
The kernel data values are organized as 2subsampleBits entries each
containing width doubles.
dataH and dataV are required to contain width * 2subsampleBitsH
and height * 2subsampleBitsV entries respectively, otherwise
an IllegalArgumentException will be thrown.
If dataV is null, it is assumed to be a copy of dataH
and the keyY, height, and subsampleBitsV parameters
are ignored.
Parameters: keyX - The array offset of the horizontal resampling kernel center Parameters: keyY - The array offset of the vertical resampling kernel center Parameters: width - the width of a horizontal resampling kernel. Parameters: height - the height of a vertical resampling kernel. Ignoredif dataV is null. Parameters: subsampleBitsH - the log (base 2) of the number of horizontalsubsample positions. Must be positive. Parameters: subsampleBitsV - the log (base 2) of the number of verticalsubsample positions. Must be positive. Ignored if dataV is null. Parameters: precisionBits - the number of bits of fractional precisionto be used when resampling integral sample values.The same value is used for both horizontal and verticalresampling. Must be positive. Parameters: dataH - the horizontal table entries, as a double array of2subsampleBitsH entries each of length width. Parameters: dataV - the vertical table entries, as a double array of2subsampleBitsV entries each of length height, or null.If null, the dataH table is used for vertical interpolationas well and the keyY, height, and subsampleBitsVparameters are ignored. |
InterpolationTable | public InterpolationTable(int key, int width, int subsampleBits, int precisionBits, double[] data)(Code) | | Constructs an InterpolationTable with identical horizontal and
vertical resampling kernels.
Parameters: key - The number of samples to the left or above thecentral sample to be used during resampling. Parameters: width - the width or height of a resampling kernel. Parameters: subsampleBits - the log (base 2) of the number ofsubsample positions. Must be positive. Parameters: precisionBits - the number of bits of fractional precisionto be used when resampling integral sample values. Must be positive. Parameters: data - the kernel entries, as a double array ofwidth*2subsampleBitsH entries |
getHorizontalTableData | public int[] getHorizontalTableData()(Code) | | Returns the integer (fixed-point) horizontal table data. The
output is an int array of length
getWidth() * 2getSubsampleBitsH() .
The following code, given an instance interp
of class InterpolationTable , will perform
interpolation of a set of getWidth() samples
at a given fractional position (bin) xfrac
between 0 and 2getSubsampleBitsH() - 1 :
int interpolateH(InterpolationTable interp, int[] samples, int xfrac) {
int[] dataH = interp.getHorizontalTableData();
int precisionBits = interp.getPrecisionBits();
int round = 1 << (precisionBits - 1);
int width = interp.getWidth();
int offset = width*xfrac;
int sum = 0;
for (int i = 0; i < width; i++) {
sum += dataH[offset + i]*samples[i];
}
return (sum + round) >> precisionBits;
}
In practice, the values dataH ,
precisionBits , etc., may be extracted once and
reused to interpolate multiple output pixels.
An array of int s. |
getHorizontalTableDataDouble | public double[] getHorizontalTableDataDouble()(Code) | | Returns the double horizontal table data. The output is a
double array of length
getWidth() * 2getSubsampleBitsH() .
The following code, given an instance interp
of class InterpolationTable , will perform
interpolation of a set of getWidth()
double samples at a given fractional position
xfrac between 0.0F and 1.0F :
double interpolateH(InterpolationTable interp,
double[] samples, float xfrac) {
double[] dataH = interp.getHorizontalTableDataDouble();
int width = interp.getWidth();
int numSubsamplesH = 1 << getSubsampleBitsH();
int ifrac = (int)(xfrac*numSubsamplesH);
int offset = width*ifrac;
double sum = 0.0;
for (int i = 0; i < width; i++) {
sum += dataH[offset + i]*samples[i];
}
return sum;
}
In practice, the values dataH ,
numSubsamplesH , etc., may be extracted once and
reused to interpolate multiple output pixels.
An array of double s. |
getHorizontalTableDataFloat | public float[] getHorizontalTableDataFloat()(Code) | | Returns the floating-point horizontal table data. The output is a
float array of length
getWidth() * 2getSubsampleBitsH() .
The following code, given an instance interp
of class InterpolationTable , will perform
interpolation of a set of getWidth()
floating-point samples at a given fractional position
xfrac between 0.0F and 1.0F :
float interpolateH(InterpolationTable interp,
float[] samples, float xfrac) {
float[] dataH = interp.getHorizontalTableDataFloat();
int width = interp.getWidth();
int numSubsamplesH = 1 << getSubsampleBitsH();
int ifrac = (int)(xfrac*numSubsamplesH);
int offset = width*ifrac;
float sum = 0.0F;
for (int i = 0; i < width; i++) {
sum += dataH[offset + i]*samples[i];
}
return sum;
}
In practice, the values dataH ,
numSubsamplesH , etc., may be extracted once and
reused to interpolate multiple output pixels.
An array of float s. |
getPrecisionBits | public int getPrecisionBits()(Code) | | Returns the number of bits of fractional precision used to
store the fixed-point table entries.
|
getVerticalTableData | public int[] getVerticalTableData()(Code) | | Returns the integer (fixed-point) vertical table data. The
output is an int array of length
getHeight() * 2getSubsampleBitsV() .
The following code, given an instance interp
of class InterpolationTable , will perform
interpolation of a set of getHeight() samples
at a given fractional position (bin) yfrac
between 0 and 2getSubsampleBitsV() - 1 :
int interpolateV(InterpolationTable interp, int[] samples, int yfrac) {
int[] dataV = interp.getVerticalTableData();
int precisionBits = interp.getPrecisionBits();
int round = 1 << (precisionBits - 1);
int height = interp.getHeight();
int offset = height*yfrac;
int sum = 0;
for (int i = 0; i < height; i++) {
sum += dataV[offset + i]*samples[i];
}
return (sum + round) >> precisionBits;
}
In practice, the values dataV ,
precisionBits , etc., may be extracted once and
reused to interpolate multiple output pixels.
An array of int s. |
getVerticalTableDataDouble | public double[] getVerticalTableDataDouble()(Code) | | Returns the double vertical table data. The output is a
double array of length
getHeight() * 2getSubsampleBitsV() ).
The following code, given an instance interp
of class InterpolationTable , will perform
interpolation of a set of getHeight()
double samples at a given fractional position
yfrac between 0.0F and 1.0F :
double interpolateV(InterpolationTable interp,
double[] samples, float yfrac) {
double[] dataV = interp.getVerticalTableDataDouble();
int height = interp.getHeight();
int numSubsamplesV = 1 << getSubsampleBitsV();
int ifrac = (int)(yfrac*numSubsamplesV);
int offset = height*ifrac;
double sum = 0.0;
for (int i = 0; i < height; i++) {
sum += dataV[offset + i]*samples[i];
}
return sum;
}
In practice, the values dataV ,
numSubsamplesV , etc., may be extracted once and
reused to interpolate multiple output pixels.
An array of double s. |
getVerticalTableDataFloat | public float[] getVerticalTableDataFloat()(Code) | | Returns the floating-point vertical table data. The output is a
float array of length
getWidth() * 2getSubsampleBitsV() .
The following code, given an instance interp
of class InterpolationTable , will perform
interpolation of a set of getHeight()
floating-point samples at a given fractional position
yfrac between 0.0F and 1.0F :
float interpolateV(InterpolationTable interp,
float[] samples, float yfrac) {
float[] dataV = interp.getVerticalTableDataFloat();
int height = interp.getHeight();
int numSubsamplesV = 1 << getSubsampleBitsV();
int ifrac = (int)(yfrac*numSubsamplesV);
int offset = height*ifrac;
float sum = 0.0F;
for (int i = 0; i < height; i++) {
sum += dataV[offset + i]*samples[i];
}
return sum;
}
In practice, the values dataV ,
numSubsamplesV , etc., may be extracted once and
reused to interpolate multiple output pixels.
An array of float s. |
interpolate | 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.
It should only be called if width == height == 2 and
keyX == keyY == 0.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , or
yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where width and height
are the width and height of the horizontal and vertical resampling
kernels respectively.
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 2subsampleBitsH . Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . the interpolated value as an int. throws: ArrayIndexOutOfBoundsException - if xfrac or yfrac are out of bounds. |
interpolate | 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.
It should only be called if width == height == 4 and
keyX == keyY == 1.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , or
yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where width and height
are the the width and height of the horizontal and vertical
resampling kernels respectively.
Parameters: s__ - the sample above and to the left of the central sample. Parameters: s_0 - the sample above the central sample. Parameters: s_1 - the sample above and one to the right of the central sample. Parameters: s_2 - the sample above and two to the right of the central sample. Parameters: s0_ - the sample to the left of the central sample. Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s02 - the sample two to the right of the central sample. Parameters: s1_ - the sample below and one to the left of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and one to the right of the central sample. Parameters: s12 - the sample below and two to the right of the central sample. Parameters: s2_ - the sample two below and one to the left of the central sample. Parameters: s20 - the sample two below the central sample. Parameters: s21 - the sample two below and one to the right of the central sample. Parameters: s22 - the sample two below and two to the right of the central sample. Parameters: xfrac - the X subsample position, multiplied by 2subsampleBitsH . Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . the interpolated value as an int. throws: ArrayIndexOutOfBoundsException - if xfrac or yfrac are out of bounds. |
interpolate | 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.
It should only be called if width == height == 2 and
keyX == keyY == 0.
If either xfrac or yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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. throws: ArrayIndexOutOfBoundsException - if xfrac or yfrac are out of bounds. |
interpolate | 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 of floating-point samples.
It should only be called if width == height == 4 and
keyX == keyY == 1.
If either xfrac or yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s__ - the sample above and to the left of the central sample. Parameters: s_0 - the sample above the central sample. Parameters: s_1 - the sample above and one to the right of the central sample. Parameters: s_2 - the sample above and two to the right of the central sample. Parameters: s0_ - the sample to the left of the central sample. Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s02 - the sample two to the right of the central sample. Parameters: s1_ - the sample below and one to the left of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and one to the right of the central sample. Parameters: s12 - the sample below and two to the right of the central sample. Parameters: s2_ - the sample two below and one to the left of the central sample. Parameters: s20 - the sample two below the central sample. Parameters: s21 - the sample two below and one to the right of the central sample. Parameters: s22 - the sample two below and two 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. throws: ArrayIndexOutOfBoundsException - if xfrac or yfrac are out of bounds. |
interpolate | 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.
It should only be called if width == height == 2 and
keyX == keyY == 0.
If either xfrac or yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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. throws: ArrayIndexOutOfBoundsException - if xfrac or yfrac are out of bounds. |
interpolate | 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 of double samples.
It should only be called if width == height == 4 and
keyX == keyY == 1.
If either xfrac or yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s__ - the sample above and to the left of the central sample. Parameters: s_0 - the sample above the central sample. Parameters: s_1 - the sample above and one to the right of the central sample. Parameters: s_2 - the sample above and two to the right of the central sample. Parameters: s0_ - the sample to the left of the central sample. Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s02 - the sample two to the right of the central sample. Parameters: s1_ - the sample below and one to the left of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and one to the right of the central sample. Parameters: s12 - the sample below and two to the right of the central sample. Parameters: s2_ - the sample two below and one to the left of the central sample. Parameters: s20 - the sample two below the central sample. Parameters: s21 - the sample two below and one to the right of the central sample. Parameters: s22 - the sample two below and two 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. throws: ArrayIndexOutOfBoundsException - if xfrac or yfrac are out of bounds. |
interpolateF | public int interpolateF(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. All
internal calculations are performed in floating-point.
It should only be called if width == height == 4 and
keyX == keyY == 1.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , or
yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where width and height
are the width and height of horizontal and vertical resampling
kernels respectively.
Parameters: s__ - the sample above and to the left of the central sample. Parameters: s_0 - the sample above the central sample. Parameters: s_1 - the sample above and one to the right of the central sample. Parameters: s_2 - the sample above and two to the right of the central sample. Parameters: s0_ - the sample to the left of the central sample. Parameters: s00 - the central sample. Parameters: s01 - the sample to the right of the central sample. Parameters: s02 - the sample two to the right of the central sample. Parameters: s1_ - the sample below and one to the left of the central sample. Parameters: s10 - the sample below the central sample. Parameters: s11 - the sample below and one to the right of the central sample. Parameters: s12 - the sample below and two to the right of the central sample. Parameters: s2_ - the sample two below and one to the left of the central sample. Parameters: s20 - the sample two below the central sample. Parameters: s21 - the sample two below and one to the right of the central sample. Parameters: s22 - the sample two below and two to the right of the central sample. Parameters: xfrac - the X subsample position, multiplied by 2subsampleBitsH . Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . the interpolated value as an int. throws: ArrayIndexOutOfBoundsException - if xfrac or yfrac are out of bounds. |
interpolateH | public int interpolateH(int[] samples, int xfrac)(Code) | | Performs horizontal interpolation on a one-dimensional array of
integral samples.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , an
ArrayIndexOutOfBoundsException may occur, where width is the width
of the horizontal resampling kernel.
Parameters: samples - an array of ints. Parameters: xfrac - the subsample position, multiplied by 2subsampleBitsH . the interpolated value as an int. throws: ArrayIndexOutOfBoundsException - if xfrac is out of bounds. |
interpolateH | 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.
It should only be called if width == 2.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , an
ArrayIndexOutOfBoundsException may occur, where width is the width
of the horizontal resampling kernel.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the subsample position, multiplied by 2subsampleBitsH . the interpolated value as an int. throws: ArrayIndexOutOfBoundsException - if xfrac is out of bounds. |
interpolateH | public int interpolateH(int s_, int s0, int s1, int s2, int xfrac)(Code) | | Performs horizontal interpolation on a quadruple of integral samples.
This method may be used instead of the array version for speed.
It should only be called if width == 4 and keyX == 1.
If xfrac does not lie between 0 and 2subsampleBitsH-1 , an
ArrayIndexOutOfBoundsException may occur, where width is the width
of the horizontal resampling kernel.
Parameters: s_ - the sample to the left of the central sample. Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: s2 - the sample to the right of s1. Parameters: xfrac - the subsample position, multiplied by 2subsampleBitsH . the interpolated value as an int. throws: ArrayIndexOutOfBoundsException - if xfrac is out of bounds. |
interpolateH | public float interpolateH(float[] samples, float xfrac)(Code) | | Performs horizontal interpolation on a one-dimensional array of
floating-point samples representing a row of samples.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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. throws: ArrayIndexOutOfBoundsException - if xfrac is out of bounds. |
interpolateH | public float interpolateH(float s0, float s1, float xfrac)(Code) | | Performs horizontal interpolation on a pair of floating-point samples.
This method may be used instead of the array version for speed.
It should only be called if width == 2.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). the interpolated value as a float. throws: ArrayIndexOutOfBoundsException - if xfrac is out of bounds. |
interpolateH | public float interpolateH(float s_, float s0, float s1, float s2, float xfrac)(Code) | | Performs horizontal interpolation on a quadruple of floating-point
samples. This method may be used instead of the array version for
speed. It should only be called if width == 4 and keyX == 1.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s_ - the sample to the left of the central sample. Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: s2 - the sample to the right of s1. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). the interpolated value as a float. throws: ArrayIndexOutOfBoundsException - if xfrac is out of bounds. |
interpolateH | public double interpolateH(double[] samples, float xfrac)(Code) | | Performs horizontal interpolation on a one-dimensional array of
double samples representing a row of samples.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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. throws: ArrayIndexOutOfBoundsException - if xfrac is out of bounds. |
interpolateH | public double interpolateH(double s0, double s1, float xfrac)(Code) | | Performs horizontal interpolation on a pair of double samples.
This method may be used instead of the array version for speed.
It should only be called if width == 2.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). the interpolated value as a double. throws: ArrayIndexOutOfBoundsException - if xfrac is out of bounds. |
interpolateH | public double interpolateH(double s_, double s0, double s1, double s2, float xfrac)(Code) | | Performs horizontal interpolation on a quadruple of double
samples. This method may be used instead of the array version for
speed. It should only be called if width == 4 and keyX == 1.
If xfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s_ - the sample to the left of the central sample. Parameters: s0 - the central sample. Parameters: s1 - the sample to the right of the central sample. Parameters: s2 - the sample to the right of s1. Parameters: xfrac - the X subsample position, in the range [0.0F, 1.0F). the interpolated value as a double. throws: ArrayIndexOutOfBoundsException - if xfrac is out of bounds. |
interpolateV | public int interpolateV(int[] samples, int yfrac)(Code) | | Performs vertical interpolation on a one-dimensional array of
integral samples.
If yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where height is the
height of the vertical resampling kernel.
Parameters: samples - an array of ints. Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . the interpolated value as an int. throws: ArrayIndexOutOfBoundsException - if yfrac is out of bounds. |
interpolateV | 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.
It should only be called if height == 2 and keyY == 0.
If yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where height is the
height of the vertical resampling kernel.
Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . the interpolated value as an int. throws: ArrayIndexOutOfBoundsException - if yfrac is out of bounds. |
interpolateV | public int interpolateV(int s_, int s0, int s1, int s2, int yfrac)(Code) | | Performs vertical interpolation on a quadruple of integral samples.
This method may be used instead of the array version for speed.
It should only be called if height == 4 and keyY == 1.
If yfrac does not lie between 0 and 2subsampleBitsV-1 , an
ArrayIndexOutOfBoundsException may occur, where height is the
height of the vertical resampling kernel.
Parameters: s_ - the sample above the central sample. Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: s2 - the sample below s1. Parameters: yfrac - the Y subsample position, multiplied by 2subsampleBitsV . the interpolated value as an int. throws: ArrayIndexOutOfBoundsException - if yfrac is out of bounds. |
interpolateV | public float interpolateV(float[] samples, float yfrac)(Code) | | Performs vertical interpolation on a one-dimensional array of
floating-point samples representing a column of samples.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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. throws: ArrayIndexOutOfBoundsException - if yfrac is out of bounds. |
interpolateV | public float interpolateV(float s0, float s1, float yfrac)(Code) | | Performs vertical interpolation on a pair of floating-point samples.
This method may be used instead of the array version for speed.
It should only be called if height == 2 and keyY == 0.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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. throws: ArrayIndexOutOfBoundsException - if yfrac is out of bounds. |
interpolateV | public float interpolateV(float s_, float s0, float s1, float s2, float yfrac)(Code) | | Performs vertical interpolation on a quadruple of floating-point
samples. This method may be used instead of the array version for
speed. It should only be called if height == 4 and keyY == 1.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s_ - the sample above the central sample. Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: s2 - the sample below s1. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a float. throws: ArrayIndexOutOfBoundsException - if yfrac is out of bounds. |
interpolateV | public double interpolateV(double[] samples, float yfrac)(Code) | | Performs vertical interpolation on a one-dimensional array of
double samples representing a column of samples.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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. throws: ArrayIndexOutOfBoundsException - if yfrac is out of bounds. |
interpolateV | public double interpolateV(double s0, double s1, float yfrac)(Code) | | Performs vertical interpolation on a pair of double samples.
This method may be used instead of the array version for speed.
It should only be called if height == 2 and keyY == 0.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
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. throws: ArrayIndexOutOfBoundsException - if yfrac is out of bounds. |
interpolateV | public double interpolateV(double s_, double s0, double s1, double s2, float yfrac)(Code) | | Performs vertical interpolation on a quadruple of double
samples. This method may be used instead of the array version for
speed. It should only be called if height == 4 and keyY == 1.
If yfrac does not lie between the range [0.0, 1.0F), an
ArrayIndexOutOfBoundsException may occur.
Parameters: s_ - the sample above the central sample. Parameters: s0 - the central sample. Parameters: s1 - the sample below the central sample. Parameters: s2 - the sample below s1. Parameters: yfrac - the Y subsample position, in the range [0.0F, 1.0F). the interpolated value as a double. throws: ArrayIndexOutOfBoundsException - if yfrac is out of bounds. |
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)
|
|
|