wavelet.h

来自「wavlet compression on c++ only cods」· C头文件 代码 · 共 67 行

H
67
字号
// Copyright (c) 1999 Stephen T. Welstead. All rights reserved.
// File wavelet.h  Header file for wavelet class

#ifndef WAVELET_H
#define WAVELET_H

// Pure virtual wavelet class
// Descendants implement specific wavelet filters

class twavelet  {
    public:
    int no_of_coeffs;
    double *coeff;
    twavelet (double *the_coeff,int the_no_of_coeffs){
       coeff = the_coeff;
       no_of_coeffs = the_no_of_coeffs;
       };
    virtual void transform (float *data_vector,int n);
    virtual void inverse_transform (float *data_vector,int n);
    virtual int filter (float *data_vector,int n);
    virtual int transpose_filter (float *data_vector,int n);
    };

class tHaar_wavelet: public twavelet {
    public:
    tHaar_wavelet(void);
    virtual void transform (float *data_vector,int n);
    virtual void inverse_transform (float *data_vector,int n);
    };

/* Coefficients for Daubechies-4 wavelet: */
#define D4_0 0.4829629131445341
#define D4_1 0.8365163037378079
#define D4_2 0.2241438680420134
#define D4_3 -0.1294095225512604

/* Coefficients for Daubechies-6 wavelet: */
#define D6_0 0.332670552950
#define D6_1 0.806891509311
#define D6_2 0.459877502118
#define D6_3 -0.135011020010
#define D6_4 -0.085441273882
#define D6_5 0.035226291882

class tDaub4_wavelet: public twavelet {
    public:
    tDaub4_wavelet(void);
    };

class tDaub6_wavelet: public twavelet {
    public:
    tDaub6_wavelet(void);
    };

class twavelet_2d_array {
    public:
    twavelet *wavelet;
    float **values,lowpass_value,transform_max,transform_min,inverse_max,inverse_min;
    int rows,cols;
    twavelet_2d_array (float **the_values,twavelet *the_wavelet,
	 int the_rows,int the_cols);
    virtual void transform ();
    virtual void decimate (float percent);
    virtual void inverse_transform ();
    };

#endif

⌨️ 快捷键说明

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