InterpolationBicubic2 is a subclass of Interpolation that performs interpolation using the piecewise cubic polynomial:
r(x) = (a + 2)|x|^3 - (a + 3)|x|^2 + 1 , 0 <= |x| < 1 r(x) = a|x|^3 - 5a|x|^2 + 8a|x| - 4a , 1 <= |x| < 2 r(x) = 0 , otherwisewith 'a' set to -1.0. This definition is also sometimes known as "cubic convolution", using the parameter 'a' recommended by Keys. This interpolator may produce somewhat sharper results than InterpolationBicubic, but that result is image dependent. (Reference: Digital Image Warping, George Wolberg, 1990, pp 129-131, IEEE Computer Society Press, ISBN 0-8186-8944-7)
A neighborhood extending one sample to the left of and above the central sample, and two samples to the right of and below the central sample is required to perform bicubic interpolation.
This implementation creates an InterpolationTable
whose integer coefficients have eight bits of precision to the right of the binary point.
The diagrams below illustrate the pixels involved in one-dimensional 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 s_ s0 . s1 s2 s_ ^ xfrac s0 .< yfrac s1 s2
The diagram below illustrates the pixels involved in two-dimensional interpolation.
s__ s_0 s_1 s_2 s0_ s00 s01 s02 . < yfrac s1_ s10 s11 s12 s2_ s20 s21 s22 ^ xfrac
The class is marked 'final' so that it may be more easily inlined.
|
|
|
|
|
|
|
|