Name
- wvCreateRecon, wvDestroyRecon, WVreconFunc - wavelet reconstructor interface
Synopsis
-
WVrecon wvCreateRecon(WVreconFunc func, WVpointer clientData,
WVdimension length);
void wvDestroyRecon(WVrecon recon);
typedef void (*WVreconFunc)(const WVdata *source, WVdimension index,
WVpointer clientData, WVdata *value1_return, WVdata *value2_return);
Inputs
| source | pointer into extended array of data values |
| index | base index of filter application |
| clientData | data registered with this filter |
| value1_return | Holds the first value of the upsampled
pair |
| value2_return | Holds the second value of the upsampled
pair |
Outputs
| value1_return | Returns the first value of the upsampled
pair |
| value2_return | Returns the second value of the upsampled
pair |
Description
-
wvCreateRecon returns a reconstructor initialized with the values
passed.
clientData is the data to be passed to any calls to func, and
length is the length of the reconstructor, which is used to calculate
how far the data needs to be extended.
wvDestroyRecon frees the memory used by recon. It is the
application programmer's responsibility to free this memory (by calling
this function, or with wvDestroyWavelet).
WVreconFunc samples the data on some interval of the array.
Reconstructor functions are normally defined in pairs: a coarse
reconstructor and a detail reconstructor. The coarse reconstructor
is to be called first, so it usually just sets the return values
to some values. The detail reconstructor is called second, and
usually adds to (or subtracts from) the return values (see the
example below).
The library defines two pairs of reconstructors: wvBiorthCoarseR and
wvBiorthDetailR and wvHaarCoarseR and wvHaarDetailR.
The biorthogonal reconstructors take an array of coefficients as
clientData.
Example
-
#include <wv/wv.h>
#include <wv/wv_filter.h>
WVdata IntegerHaarCoarseR(const WVdata *source,
WVdimension index, WVpointer clientData,
WVdata *value1_return, WVdata *value2_return)
{
*value1_return = *value2_return = source[index] / 2;
}
WVdata IntegerHaarDetailR(const WVdata *source,
WVdimension index, WVpointer clientData,
WVdata *value1_return, WVdata *value2_return)
{
*value1_return += source[index] / 2;
*value2_return -= source[index] / 2;
}
.
.
.
{
WVrecon *myHaarCoarseR;
WVrecon *myHaarDetailR;
myHaarCoarseR = wvCreateRecon(IntegerHaarCoarseR,
NULL, 2);
myHaarDetailR = wvCreateRecon(IntegerHaarDetailR,
NULL, 2);
}
See Also
-
wvBuildBasis(3),
WVwavelet(3)
|