wvRecon(3) USC Math Department
Back to wvlib wavelet function index
wvRecon(3)

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

sourcepointer into extended array of data values
indexbase index of filter application
clientDatadata registered with this filter
value1_returnHolds the first value of the upsampled pair
value2_returnHolds the second value of the upsampled pair

Outputs

value1_returnReturns the first value of the upsampled pair
value2_returnReturns 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)

Back to wvlib wavelet function index Last Updated: 18 August 2003