1-dimensional sub-pixel interpolation kernel


This is a fictitious function which does not actually exist. Instead, this description constitutes a template so that you may implement a function with this interface for yourself (and give it any name you wish). A pointer to such a function may be passed via the " finterp" parameter of the astResample <X > functions (q.v.) in order to supply a 1-dimensional interpolation kernel to the algorithm which performs sub-pixel interpolation during resampling of gridded data (you must also set the " interp" parameter of astResample <X > to the value AST__UKERN1). This allows you to use your own interpolation kernel in addition to those which are pre-defined.

The function calculates the value of a 1-dimensional sub-pixel interpolation kernel. This determines how the weight given to neighbouring pixels in calculating an interpolated value depends on the pixel s offset from the interpolation point. In more than one dimension, the weight assigned to a pixel is formed by evaluating this 1-dimensional kernel using the offset along each dimension in turn. The product of the returned values is then used as the pixel weight.


void astUkern1( double offset, const double params[], int flags, double value )


This will be the offset of the pixel from the interpolation point, measured in pixels. This value may be positive or negative, but for most practical interpolation schemes its sign should be ignored.
This will be a pointer to the same array as was given via the " params" parameter of astResample <X >. You may use this to pass any additional parameter values required by your kernel, but note that " params[0]" will already have been used to specify the number of neighbouring pixels which contribute to the interpolated value.
This will be the same value as was given via the " flags" parameter of astResample <X >. You may test this value to provide additional control over the operation of your function. Note that the special flag values AST__URESAMP1, 2, 3 & 4 are reserved for you to use for your own purposes and will not clash with other pre-defined flag values (see astResample <X >).
Pointer to a double to receive the calculated kernel value, which may be positive or negative.