javax.media.jai
Class InterpolationBicubic2

java.lang.Object
  |
  +--javax.media.jai.Interpolation
        |
        +--javax.media.jai.InterpolationTable
              |
              +--javax.media.jai.InterpolationBicubic2
All Implemented Interfaces:
Serializable

public final class InterpolationBicubic2
extends InterpolationTable

A class representing bicubic interpolation using a different polynomial than InterpolationBicubic.

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                                        , otherwise
 
with '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.

See Also:
Serialized Form

Fields inherited from class javax.media.jai.InterpolationTable
dataHd, dataHf, dataHi, dataVd, dataVf, dataVi, precisionBits
 
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
InterpolationBicubic2(int subsampleBits)
          Constructs an InterpolationBicubic2 with a given subsample precision, in bits.
 
Methods inherited from class javax.media.jai.InterpolationTable
getHorizontalTableData, getHorizontalTableDataDouble, getHorizontalTableDataFloat, getPrecisionBits, getVerticalTableData, getVerticalTableDataDouble, getVerticalTableDataFloat, interpolate, interpolate, interpolate, interpolate, interpolate, interpolate, interpolateF, interpolateH, interpolateH, interpolateH, interpolateH, interpolateH, interpolateH, interpolateH, interpolateH, interpolateH, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV
 
Methods inherited from class javax.media.jai.Interpolation
getBottomPadding, getHeight, getInstance, getLeftPadding, getRightPadding, getSubsampleBitsH, getSubsampleBitsV, getTopPadding, getWidth, interpolate, interpolate, interpolate, isSeparable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterpolationBicubic2

public InterpolationBicubic2(int subsampleBits)
Constructs an InterpolationBicubic2 with a given subsample precision, in bits. This precision is applied to both axes.

This implementation creates an InterpolationTable whose integer coefficients have eight bits of precision to the right of the binary point.

Parameters:
subsampleBits - the subsample precision.