comparison Meerwald/wm_dugad_e.c @ 3:acb6967ee76d

update to 0.5
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Tue, 14 Aug 2007 21:11:21 +0200
parents be303a3f5ea8
children f83ef905a63d
comparison
equal deleted inserted replaced
2:b92f06d9a967 3:acb6967ee76d
45 int n; 45 int n;
46 46
47 double alpha = 0.0; 47 double alpha = 0.0;
48 double t1 = 0.0; 48 double t1 = 0.0;
49 49
50 int levels = 0; 50 int level = 0;
51 int filter = 0; 51 int filter = 0;
52 int method = -1; 52 int method = -1;
53 char filter_name[MAXPATHLEN] = ""; 53 char filter_name[MAXPATHLEN] = "";
54 54
55 int verbose = 0; 55 int verbose = 0;
95 case 'h': 95 case 'h':
96 case '?': 96 case '?':
97 usage(); 97 usage();
98 break; 98 break;
99 case 'l': 99 case 'l':
100 levels = atoi(optarg); 100 level = atoi(optarg);
101 if (levels <= 0) { 101 if (level <= 0) {
102 fprintf(stderr, "%s: decomposition level %d out of range\n", levels); 102 fprintf(stderr, "%s: decomposition level %d out of range\n", level);
103 exit(1); 103 exit(1);
104 } 104 }
105 break; 105 break;
106 case 'o': 106 case 'o':
107 if ((out = fopen(optarg, "wb")) == NULL) { 107 if ((out = fopen(optarg, "wb")) == NULL) {
153 if (sig) { 153 if (sig) {
154 char line[32]; 154 char line[32];
155 fgets(line, sizeof(line), sig); 155 fgets(line, sizeof(line), sig);
156 if (strspn(line, "DGSG") >= 4) { 156 if (strspn(line, "DGSG") >= 4) {
157 fscanf(sig, "%d\n", &n); 157 fscanf(sig, "%d\n", &n);
158 if (levels == 0) 158 if (level == 0)
159 fscanf(sig, "%d\n", &levels); 159 fscanf(sig, "%d\n", &level);
160 else 160 else
161 fscanf(sig, "%*d\n"); 161 fscanf(sig, "%*d\n");
162 if (alpha == 0.0) 162 if (alpha == 0.0)
163 fscanf(sig, "%lf\n", &alpha); 163 fscanf(sig, "%lf\n", &alpha);
164 else 164 else
204 pgm_readpgmrow(in, image[row], cols, maxval, format); 204 pgm_readpgmrow(in, image[row], cols, maxval, format);
205 205
206 fclose(in); 206 fclose(in);
207 207
208 // wavelet transform 208 // wavelet transform
209 init_dwt(cols, rows, filter_name, filter, 3, method); 209 init_dwt(cols, rows, filter_name, filter, level, method);
210 #ifdef POLLEN_STUFF 210 #ifdef POLLEN_STUFF
211 #include "pollen_stuff.xxx" 211 #include "pollen_stuff.c"
212 #endif 212 #endif
213 #ifdef PARAM_STUFF 213 #ifdef PARAM_STUFF
214 #include "param_stuff.xxx" 214 #include "param_stuff.c"
215 #endif 215 #endif
216 216
217 dwts = fdwt(image); 217 dwts = fdwt(image);
218 218
219 // embed watermark in all subbands of a decomposition level 219 // embed watermark in all subbands of a decomposition level

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.