wavelet.h

来自「this is source code for image compressio」· C头文件 代码 · 共 45 行

H
45
字号
/*---------------------------------------------------------------------------*/
// Image Compression Toolbox v1.2
// written by
// Satish Kumar S
// satishkumr@lycos.com
//
// Copyright 1999 Satish Kumar S
//
// Permission is granted to use this software for research purposes as
// long as this notice stays attached to this software.
/*---------------------------------------------------------------------------*/
#ifndef _WAVELET_H
#define _WAVELET_H

class Filter
{
public:
    double *coeffs;         // filter coefficients.
    int size;               // length of the filter.
    int startIndex;         // the starting index of the coefficients.

    Filter(int size, int startIndex, double *coeffs = NULL);
};

class Wavelet
{
    Filter *anaLow, *anaHigh;       // low and high pass filters for analysis.
    Filter *synLow, *synHigh;       // low and high pass filters for synthesis.

private:
    void PeriodicExtension(double *output, int size, int npad);
    void SymmetricExtension(double *output, int size, int left_ext, int right_ext, 
        int symmetry, int npad);
    void TransformStep(double *data, int datasize, int npad, Filter *lpf, 
        Filter *hpf, double *dest);
    void InverseStep(double *data, int datasize, int npad, Filter *lpf, 
        Filter *hpf, double *dest);

public:
    Wavelet(Filter *anaLow, Filter *synLow = NULL);
    int Transform(Image &image, int nsteps);
    int Inverse(Image &image, int nsteps);
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?