00001
00002
00003 #ifndef _WAVELET_TRANSFORM_H_
00004 #define _WAVELET_TRANSFORM_H_
00005
00006 #include "FloatImage.h"
00007
00008 typedef struct {
00009 int ncof, ioff, joff;
00010 float *cc, *cr;
00011 } wavefilt;
00012
00013 enum WAVELET_TYPE { HAAR = 0, DAUB_2 = 1, DAUB_3 = 2, DAUB_4 = 3, DAUB_5 = 4,
00014 DAUB_6 = 5, DAUB_7 = 6, DAUB_8 = 7, DAUB_9 = 8,
00015 BIOR_1_1 = 19, BIOR_1_3 = 20, BIOR_1_5 = 21, BIOR_2_2 = 22,
00016 BIOR_2_4 = 23, BIOR_2_6 = 24, BIOR_2_8 = 25, BIOR_3_1 = 26,
00017 BIOR_3_3 = 27, BIOR_3_5 = 28, BIOR_3_7 = 29, BIOR_3_9 = 30,
00018 BIOR_1_1_REC = 49, BIOR_1_3_REC = 50, BIOR_1_5_REC = 51, BIOR_2_2_REC = 52,
00019 BIOR_2_4_REC = 53, BIOR_2_6_REC = 54, BIOR_2_8_REC = 55, BIOR_3_1_REC = 56,
00020 BIOR_3_3_REC = 57, BIOR_3_5_REC = 58, BIOR_3_7_REC = 59, BIOR_3_9_REC = 60,
00021 WAVELET_UNKNOWN=100};
00022
00027 class WaveletTransform
00028 {
00029 private:
00030 FloatImage *image;
00031 int wavelet_type;
00032 void pwtset(int wavelet_type, wavefilt &wfilt);
00033 void pwt(float *a, int n, int isign);
00034 int width, height;
00035 wavefilt wfilt_dec;
00036 wavefilt wfilt_rec;
00037 int filt_size;
00038
00039 public:
00044 WaveletTransform(FloatImage &input, WAVELET_TYPE wave_type = HAAR) {
00045 image = &input;
00046 width = input.getWidth();
00047 height = input.getHeight();
00048 wavelet_type = wave_type;
00049 pwtset(wavelet_type, wfilt_dec);
00050 if (wavelet_type < 15)
00051 pwtset(wavelet_type, wfilt_rec);
00052 else
00053 pwtset(wavelet_type+30, wfilt_rec);
00054 }
00055
00057 void fwt(int levels);
00058
00060 void ifwt(int levels);
00061 };
00062
00063 void fwt(FloatImage &input, int levels, WAVELET_TYPE wave_type = HAAR);
00072 void ifwt(FloatImage &input, int levels, WAVELET_TYPE wave_type = HAAR);
00085 #endif
00086