Java Doc for Interpolation.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » media » jai » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » Java Advanced Imaging » javax.media.jai 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.media.jai.Interpolation

All known Subclasses:   javax.media.jai.InterpolationBilinear,  javax.media.jai.InterpolationTable,  javax.media.jai.InterpolationNearest,  com.sun.media.jai.util.InterpAverage,
Interpolation
abstract public class Interpolation extends Object implements Serializable(Code)
An object encapsulating a particular algorithm for image interpolation (resampling). An Interpolation captures the notion of performing sampling on a regular grid of pixels using a local neighborhood. It is intended to be used by operations that resample their sources, including affine mapping and warping.

Resampling is the action of computing a pixel value at a possibly non-integral position of an image. The image defines pixel values at integer lattice points, and it is up to the resampler to produce a reasonable value for positions not falling on the lattice. A number of techniques are used in practice, the most common being nearest-neighbor, which simply takes the value of the closest lattice point; bilinear, which interpolates linearly between the four closest lattice points; and bicubic, which applies a piecewise polynomial function to a 4x4 neighborhood of nearby points. The area over which a resampling function needs to be computed is referred to as its support; thus the standard resampling functions have supports of 1, 4, and 16 pixels respectively. Mathematically, the ideal resampling function for a band-limited image (one containing no energy above a given frequency) is the sinc function, equal to sin(x)/x. This has practical limitations, in particular its infinite support, which lead to the use of the standard approximations described above.

Other interpolation functions may be required to solve problems other than the resampling of band-limited image data. When shrinking an image, it is common to use a function that combines area averaging with resampling in order to remove undesirable high frequencies as part of the interpolation process. Other application areas may use interpolating functions that operate under other assumptions about image data, such as taking the maximum value of a 2x2 neighborhood. The interpolation class provides a framework in which a variety of interpolation schemes may be expressed.

Many interpolations are separable, that is, they may be equivalently rewritten as a horizontal interpolation followed by a vertical one (or vice versa). In practice, some precision may be lost by the rounding and truncation that takes place between the passes. The Interpolation class assumes separability and implements all vertical interpolation methods in terms of corresponding horizontal methods, and defines isSeparable() to return true. A subclass may override these methods to provide distinct implementations of horizontal and vertical interpolation. Some subclasses may implement the two-dimensional interpolation methods directly, yielding more precise results, while others may implement these using a two-pass approach.

A minimal Interpolation subclass must call the Interpolation constructor (super()) and then set at least the following fields.

 leftPadding
 rightPadding
 topPadding
 bottomPadding
 width
 height
 subsampleBitsH
 subsampleBitsV
 

It must also implement at least the following methods.

 int interpolateH(int[] samples, int xfrac)
 float interpolateH(float[] samples, float xfrac)
 double interpolateH(double[] samples, float xfrac)
 
All other methods are defined in terms of these methods for ease of implementation of new Interpolation subclasses.

Since interpolation is generally performed for every pixel of a destination image, efficiency is important. In particular, passing source samples by means of arrays is likely to be unacceptably slow. Accordingly, methods are provided for the common cases of 2x1, 1x2, 4x1, 1x4, 2x2, and 4x4 input grids. These methods are defined in the superclass to package their arguments into arrays and forward the call to the array versions, in order to simplify implementation. They should be called only on Interpolation objects with the correct width and height. In other words, an implementor of an Interpolation subclass may implement "interpolateH(int s0, int s1, int xfrac)" assuming that the interpolation width is in fact equal to 2, and does not need to enforce this constraint.

The fractional position of interpolation (xfrac, yfrac) is always between 0.0 and 1.0 (not including 1.0). For integral image data, the fraction is represented as a scaled integer between 0 and 2n - 1, where n is a small integer. The value of n in the horizontal and vertical directions may be obtained by calling getSubsampleBitsH() and getSubsampleBitsV(). In general, code that makes use of an externally-provided Interpolation object must query that object to determine its desired positional precision.

For float and double images, a float between 0.0F and 1.0F (not including 1.0F) is used as a positional specifier in the interest of greater accuracy.

It is important to understand that the subsampleBits precision is used only to indicate the scaling implicit in the fractional locations (xfrac, yfrac) for integral image data types. For example, for subsampleBitsH=8, xfrac must lie between 0 and 255 inclusive. An implementation is not required to actually quantize its interpolation coefficients to match the specified subsampling precision.

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. Point s00 is the interpolation kernel key position.

 
 s__    s_0    s_1    s_2                              
 s0_    s00    s01    s02                              
 .             < yfrac                      
 s1_    s10    s11    s12                              
 s2_    s20    s21    s22                              
 ^                                           
 xfrac                                        
 
 

The subclasses of Interpolation include InterpolationNearest, InterpolationBilinear, InterpolationBicubic, and InterpolationBicubic2 (a variant defined by a different polynomial function). These subclasses are marked 'final,' so users may identify them by name (using 'instanceof') and write specialized code for them. This may also allow inlining to occur on some virtual machines. These classes do provide correct, if less than optimal code for performing their interpolations, so it is possible to use any Interpolation object in a generic manner. The Sun-provided InterpolationBilinear and InterpolationBicubic classes provide a more optimal implementation while using the same semantics.

The InterpolationTable class is a subclass of Interpolation that divides the set of subsample positions into a fixed number of "bins" and stores a kernel for each bin. InterpolationBicubic and InterpolationBicubic2 are implemented in terms of InterpolationTable since a direct implementation is very expensive.
See Also:   InterpolationNearest
See Also:   InterpolationBilinear
See Also:   InterpolationBicubic
See Also:   InterpolationBicubic2
See Also:   InterpolationTable



Field Summary
final public static  intINTERP_BICUBIC
     A constant specifying interpolation by the InterpolationBicubic class.
final public static  intINTERP_BICUBIC_2
     A constant specifying interpolation by the InterpolationBicubic2 class.
final public static  intINTERP_BILINEAR
     A constant specifying interpolation by the InterpolationBilinear class.
final public static  intINTERP_NEAREST
     A constant specifying interpolation by the InterpolationNearest class.
protected  intbottomPadding
     The number of pixels lying below the interpolation kernel key position.
protected  intheight
     The height of the interpolation kernel in pixels.
protected  intleftPadding
     The number of pixels lying to the left of the interpolation kernel key position.
protected  intrightPadding
     The number of pixels lying to the right of the interpolation kernel key position.
protected  intsubsampleBitsH
     The numbers of bits used for the horizontal subsample position.
protected  intsubsampleBitsV
     The number of bits used for the vertical subsample position.
protected  inttopPadding
     The number of pixels lying above the interpolation kernel key position.
protected  intwidth
     The width of the interpolation kernel in pixels.

Constructor Summary
protected  Interpolation()
     Constructs an Interpolation object with no fields set.
public  Interpolation(int width, int height, int leftPadding, int rightPadding, int topPadding, int bottomPadding, int subsampleBitsH, int subsampleBitsV)
     Construct interpolation object with all parameters set.

Method Summary
public  intgetBottomPadding()
     Returns the number of samples required below the key element.
public  intgetHeight()
     Returns the number of samples required for vertical resampling.
public static synchronized  InterpolationgetInstance(int type)
     Creates an interpolation of one of the standard types.
public  intgetLeftPadding()
     Returns the number of samples required to the left of the key element.
public  intgetRightPadding()
     Returns the number of samples required to the right of the key element.
public  intgetSubsampleBitsH()
     Returns the number of bits used to index subsample positions in the horizontal direction.
public  intgetSubsampleBitsV()
     Returns the number of bits used to index subsample positions in the vertical direction.
public  intgetTopPadding()
     Returns the number of samples required above the key element.
public  intgetWidth()
     Returns the number of samples required for horizontal resampling.
public  intinterpolate(int[][] samples, int xfrac, int yfrac)
     Performs interpolation on a 2-dimensional array of integral samples. By default, this is implemented using a two-pass approach.
Parameters:
  samples - a two-dimensional array of ints.
Parameters:
  xfrac - the X subsample position, multiplied by 2(subsampleBitsH).
Parameters:
  yfrac - the Y subsample position, multiplied by 2(subsampleBitsV).
public  intinterpolate(int s00, int s01, int s10, int s11, int xfrac, int yfrac)
     Performs interpolation on a 2x2 grid of integral samples. Subclasses may implement this method to provide a speed improvement over the array method.
public  intinterpolate(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. Subclasses may implement this method to provide a speed improvement over the array method.
public  floatinterpolate(float[][] samples, float xfrac, float yfrac)
     Performs interpolation on a 2-dimensional array of floating-point samples.
public  floatinterpolate(float s00, float s01, float s10, float s11, float xfrac, float yfrac)
     Performs interpolation on a 2x2 grid of floating-point samples. Subclasses may implement this method to provide a speed improvement over the array method.
public  floatinterpolate(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. Subclasses may implement this method to provide a speed improvement over the array method.
public  doubleinterpolate(double[][] samples, float xfrac, float yfrac)
     Performs interpolation on a 2-dimensional array of double samples.
public  doubleinterpolate(double s00, double s01, double s10, double s11, float xfrac, float yfrac)
     Performs interpolation on a 2x2 grid of double samples. Subclasses may implement this method to provide a speed improvement over the array method.
public  doubleinterpolate(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 leftPadding == topPadding == 1. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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).
abstract public  intinterpolateH(int[] samples, int xfrac)
     Performs horizontal interpolation on a 1-dimensional array of integral samples.

An implementation is not required to actually quantize its interpolation coefficients to match the specified subsampling precision. However, the supplied value of xfrac (or yfrac) must match the precision of its corresponding subsampleBits.

public  intinterpolateH(int s0, int s1, int xfrac)
     Performs horizontal interpolation on a pair of integral samples. Subclasses may implement this method to provide a speed improvement over the array method.
public  intinterpolateH(int s_, int s0, int s1, int s2, int xfrac)
     Performs horizontal interpolation on a quadruple of integral samples. Subclasses may implement this method to provide a speed improvement over the array method.
abstract public  floatinterpolateH(float[] samples, float xfrac)
     Performs horizontal interpolation on a 1-dimensional array of floating-point samples representing a row of samples. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
Parameters:
  samples - an array of floats.
Parameters:
  xfrac - the X subsample position, in the range [0.0F, 1.0F).
public  floatinterpolateH(float s0, float s1, float xfrac)
     Performs horizontal interpolation on a pair of floating-point samples.
public  floatinterpolateH(float s_, float s0, float s1, float s2, float xfrac)
     Performs horizontal interpolation on a quadruple of floating-point samples.
abstract public  doubleinterpolateH(double[] samples, float xfrac)
     Performs horizontal interpolation on a 1-dimensional array of double samples representing a row of samples. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
Parameters:
  samples - an array of doubles.
Parameters:
  xfrac - the X subsample position, in the range [0.0F, 1.0F).
public  doubleinterpolateH(double s0, double s1, float xfrac)
     Performs horizontal interpolation on a pair of double samples.
public  doubleinterpolateH(double s_, double s0, double s1, double s2, float xfrac)
     Performs horizontal interpolation on a quadruple of double samples.
public  intinterpolateV(int[] samples, int yfrac)
     Performs vertical interpolation on a 1-dimensional array of integral samples.

By default, vertical interpolation is defined to be the same as horizontal interpolation.

public  intinterpolateV(int s0, int s1, int yfrac)
     Performs vertical interpolation on a pair of integral samples. Subclasses may implement this method to provide a speed improvement over the array method.
public  intinterpolateV(int s_, int s0, int s1, int s2, int yfrac)
     Performs vertical interpolation on a quadruple of integral samples. Subclasses may implement this method to provide a speed improvement over the array method.
public  floatinterpolateV(float[] samples, float yfrac)
     Performs vertical interpolation on a 1-dimensional array of floating-point samples representing a column of samples. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.

By default, vertical interpolation is identical to horizontal interpolation.

public  floatinterpolateV(float s0, float s1, float yfrac)
     Performs vertical interpolation on a pair of floating-point samples.
public  floatinterpolateV(float s_, float s0, float s1, float s2, float yfrac)
     Performs vertical interpolation on a quadruple of floating-point samples.
public  doubleinterpolateV(double[] samples, float yfrac)
     Performs vertical interpolation on a 1-dimensional array of double samples representing a column of samples. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.

By default, vertical interpolation is identical to horizontal interpolation.

public  doubleinterpolateV(double s0, double s1, float yfrac)
     Performs vertical interpolation on a pair of double samples.
public  doubleinterpolateV(double s_, double s0, double s1, double s2, float yfrac)
     Performs vertical interpolation on a quadruple of double samples.
public  booleanisSeparable()
     Returns true if the interpolation can be performed in a separable manner, that is, by performing a separate pass in each dimension.

Field Detail
INTERP_BICUBIC
final public static int INTERP_BICUBIC(Code)
A constant specifying interpolation by the InterpolationBicubic class.



INTERP_BICUBIC_2
final public static int INTERP_BICUBIC_2(Code)
A constant specifying interpolation by the InterpolationBicubic2 class.



INTERP_BILINEAR
final public static int INTERP_BILINEAR(Code)
A constant specifying interpolation by the InterpolationBilinear class.



INTERP_NEAREST
final public static int INTERP_NEAREST(Code)
A constant specifying interpolation by the InterpolationNearest class.



bottomPadding
protected int bottomPadding(Code)
The number of pixels lying below the interpolation kernel key position.



height
protected int height(Code)
The height of the interpolation kernel in pixels.



leftPadding
protected int leftPadding(Code)
The number of pixels lying to the left of the interpolation kernel key position.



rightPadding
protected int rightPadding(Code)
The number of pixels lying to the right of the interpolation kernel key position.



subsampleBitsH
protected int subsampleBitsH(Code)
The numbers of bits used for the horizontal subsample position. This value determines how integer fractional positons are to be interpreted.



subsampleBitsV
protected int subsampleBitsV(Code)
The number of bits used for the vertical subsample position. This value determines how integer fractional positons are to be interpreted.



topPadding
protected int topPadding(Code)
The number of pixels lying above the interpolation kernel key position.



width
protected int width(Code)
The width of the interpolation kernel in pixels.




Constructor Detail
Interpolation
protected Interpolation()(Code)
Constructs an Interpolation object with no fields set. This constructor is only invoked by subclasses which will subsequently set all fields themselves.



Interpolation
public Interpolation(int width, int height, int leftPadding, int rightPadding, int topPadding, int bottomPadding, int subsampleBitsH, int subsampleBitsV)(Code)
Construct interpolation object with all parameters set. Subclasses must supply all parameters.




Method Detail
getBottomPadding
public int getBottomPadding()(Code)
Returns the number of samples required below the key element.



getHeight
public int getHeight()(Code)
Returns the number of samples required for vertical resampling.



getInstance
public static synchronized Interpolation getInstance(int type)(Code)
Creates an interpolation of one of the standard types. This is intended strictly as a convenience method. The resulting static object is cached for later reuse.
Parameters:
  type - one of:INTERP_NEAREST,INTERP_BILINEAR,INTERP_BICUBIC, orINTERP_BICUBIC_2 an appropriate Interpolation object.
throws:
  IllegalArgumentException - if an unrecognized type is supplied.



getLeftPadding
public int getLeftPadding()(Code)
Returns the number of samples required to the left of the key element.



getRightPadding
public int getRightPadding()(Code)
Returns the number of samples required to the right of the key element.



getSubsampleBitsH
public int getSubsampleBitsH()(Code)
Returns the number of bits used to index subsample positions in the horizontal direction. All integral 'xfrac' parameters should range between 0 and 2(getSubsampleBitsH()) - 1.

In general, the caller is responsible for determining the number of subsample bits of any Interpolation object it receives and setting up its position variables accordingly. Some Interpolation objects allow the number of bits to be set at construction time.




getSubsampleBitsV
public int getSubsampleBitsV()(Code)
Returns the number of bits used to index subsample positions in the vertical direction. All integral 'yfrac' parameters should range between 0 and 2(getSubsampleBitsV()) - 1.



getTopPadding
public int getTopPadding()(Code)
Returns the number of samples required above the key element.



getWidth
public int getWidth()(Code)
Returns the number of samples required for horizontal resampling.



interpolate
public int interpolate(int[][] samples, int xfrac, int yfrac)(Code)
Performs interpolation on a 2-dimensional array of integral samples. By default, this is implemented using a two-pass approach.
Parameters:
  samples - a two-dimensional array of ints.
Parameters:
  xfrac - the X subsample position, multiplied by 2(subsampleBitsH).
Parameters:
  yfrac - the Y subsample position, multiplied by 2(subsampleBitsV). the interpolated value as an int.
See Also:   Interpolation.interpolateH(int[],int)



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. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == height == 2 and leftPadding == topPadding == 0.
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(subsampleBitsH).
Parameters:
  yfrac - the Y subsample position, multiplied by 2(subsampleBitsV). the interpolated value as an int.
See Also:   Interpolation.interpolateH(int[],int)



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. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == height == 4 and leftPadding == topPadding == 1.
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 2(subsampleBitsH).
Parameters:
  yfrac - the Y subsample position, multiplied by 2(subsampleBitsV). the interpolated value as an int.
See Also:   Interpolation.interpolateH(int[],int)



interpolate
public float interpolate(float[][] samples, float xfrac, float yfrac)(Code)
Performs interpolation on a 2-dimensional array of floating-point samples. By default, this is implemented using a two-pass approach. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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
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. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == height == 2 and leftPadding == topPadding == 0. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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
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. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == height == 4 and leftPadding == topPadding == 1. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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.



interpolate
public double interpolate(double[][] samples, float xfrac, float yfrac)(Code)
Performs interpolation on a 2-dimensional array of double samples. By default, this is implemented using a two-pass approach. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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
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. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == height == 2 and leftPadding == topPadding == 0. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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
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 leftPadding == topPadding == 1. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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.



interpolateH
abstract public int interpolateH(int[] samples, int xfrac)(Code)
Performs horizontal interpolation on a 1-dimensional array of integral samples.

An implementation is not required to actually quantize its interpolation coefficients to match the specified subsampling precision. However, the supplied value of xfrac (or yfrac) must match the precision of its corresponding subsampleBits. For example, with a subsampleBitsH value of 8, xfrac must lie between 0 and 255.
Parameters:
  samples - an array of ints.
Parameters:
  xfrac - the subsample position, multiplied by 2(subsampleBitsH). the interpolated value as an int.




interpolateH
public int interpolateH(int s0, int s1, int xfrac)(Code)
Performs horizontal interpolation on a pair of integral samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == 2 and leftPadding == 0.
Parameters:
  s0 - the central sample.
Parameters:
  s1 - the sample to the right of the central sample.
Parameters:
  xfrac - the subsample position, ranging from zero to2(subsampleBitsH) - 1. the interpolated value as an int.
See Also:   Interpolation.interpolateH(int[],int)



interpolateH
public int interpolateH(int s_, int s0, int s1, int s2, int xfrac)(Code)
Performs horizontal interpolation on a quadruple of integral samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == 4 and leftPadding == 1.
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 2(subsampleBitsH). the interpolated value as an int.
See Also:   Interpolation.interpolateH(int[],int)



interpolateH
abstract public float interpolateH(float[] samples, float xfrac)(Code)
Performs horizontal interpolation on a 1-dimensional array of floating-point samples representing a row of samples. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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
public float interpolateH(float s0, float s1, float xfrac)(Code)
Performs horizontal interpolation on a pair of floating-point samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == 2 and leftPadding == 0. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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
public float interpolateH(float s_, float s0, float s1, float s2, float xfrac)(Code)
Performs horizontal interpolation on a quadruple of floating-point samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == 4 and leftPadding == 1. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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, in the range [0.0F, 1.0F). the interpolated value as a float.



interpolateH
abstract public double interpolateH(double[] samples, float xfrac)(Code)
Performs horizontal interpolation on a 1-dimensional array of double samples representing a row of samples. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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
public double interpolateH(double s0, double s1, float xfrac)(Code)
Performs horizontal interpolation on a pair of double samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == 2 and leftPadding == 0. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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
public double interpolateH(double s_, double s0, double s1, double s2, float xfrac)(Code)
Performs horizontal interpolation on a quadruple of double samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if width == 4 and leftPadding == 1. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.
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, in the range [0.0F, 1.0F). the interpolated value as a double.



interpolateV
public int interpolateV(int[] samples, int yfrac)(Code)
Performs vertical interpolation on a 1-dimensional array of integral samples.

By default, vertical interpolation is defined to be the same as horizontal interpolation. Subclasses may choose to implement them differently.
Parameters:
  samples - an array of ints.
Parameters:
  yfrac - the Y subsample position, multiplied by 2(subsampleBitsV). the interpolated value as an int.
See Also:   Interpolation.interpolateH(int[],int)




interpolateV
public int interpolateV(int s0, int s1, int yfrac)(Code)
Performs vertical interpolation on a pair of integral samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if height == 2 and topPadding == 0.

By default, vertical interpolation is identical to horizontal interpolation. Subclasses may choose to implement them differently.
Parameters:
  s0 - the central sample.
Parameters:
  s1 - the sample below the central sample.
Parameters:
  yfrac - the Y subsample position, multiplied by 2(subsampleBitsV). the interpolated value as an int.
See Also:   Interpolation.interpolateH(int[],int)




interpolateV
public int interpolateV(int s_, int s0, int s1, int s2, int yfrac)(Code)
Performs vertical interpolation on a quadruple of integral samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if height == 4 and topPadding == 1.

By default, vertical interpolation is identical to horizontal interpolation. Subclasses may choose to implement them differently.
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 2(subsampleBitsV). the interpolated value as an int.
See Also:   Interpolation.interpolateH(int[],int)




interpolateV
public float interpolateV(float[] samples, float yfrac)(Code)
Performs vertical interpolation on a 1-dimensional array of floating-point samples representing a column of samples. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.

By default, vertical interpolation is identical to horizontal interpolation. Subclasses may choose to implement them differently.
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
public float interpolateV(float s0, float s1, float yfrac)(Code)
Performs vertical interpolation on a pair of floating-point samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if height == 2 and topPadding == 0. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.

By default, vertical interpolation is identical to horizontal interpolation. Subclasses may choose to implement them differently.
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
public float interpolateV(float s_, float s0, float s1, float s2, float yfrac)(Code)
Performs vertical interpolation on a quadruple of floating-point samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if height == 4 and topPadding == 1. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.

By default, vertical interpolation is identical to horizontal interpolation. Subclasses may choose to implement them differently.
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.




interpolateV
public double interpolateV(double[] samples, float yfrac)(Code)
Performs vertical interpolation on a 1-dimensional array of double samples representing a column of samples. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.

By default, vertical interpolation is identical to horizontal interpolation. Subclasses may choose to implement them differently.
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
public double interpolateV(double s0, double s1, float yfrac)(Code)
Performs vertical interpolation on a pair of double samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if height == 2 and topPadding == 0. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.

By default, vertical interpolation is identical to horizontal interpolation. Subclasses may choose to implement them differently.
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
public double interpolateV(double s_, double s0, double s1, double s2, float yfrac)(Code)
Performs vertical interpolation on a quadruple of double samples. Subclasses may implement this method to provide a speed improvement over the array method. This base class method merely calls the array method. It should only be called if height == 4 and topPadding == 1. The setting of subsampleBits need not have any effect on the interpolation accuracy of an implementation of this method.

By default, vertical interpolation is identical to horizontal interpolation. Subclasses may choose to implement them differently.
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.




isSeparable
public boolean isSeparable()(Code)
Returns true if the interpolation can be performed in a separable manner, that is, by performing a separate pass in each dimension. It is the caller's responsibility to deal with issues of precision. By default, true is returned.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.