comparison Meerwald/wang_common.c @ 20:bd669312f068

suppress warnings, fix link errors
author Peter Meerwald-Stadler <pmeerw@pmeerw.net>
date Sat, 28 Jan 2023 23:54:58 +0100
parents f83ef905a63d
children
comparison
equal deleted inserted replaced
19:0fffb6f03ebf 20:bd669312f068
1 #include "dwt_util.h" 1 #include "dwt_util.h"
2 #include "wang_common.h" 2 #include "wang_common.h"
3
4 Subband_data *subbands;
5 int n_subbands;
3 6
4 void init_subbands(Image_tree tree) { 7 void init_subbands(Image_tree tree) {
5 int levels = 0; 8 int levels = 0;
6 int i; 9 int i;
7 Image_tree p = tree; 10 Image_tree p = tree;
22 i = 0; 25 i = 0;
23 while (p->coarse != NULL) { 26 while (p->coarse != NULL) {
24 subbands[i++] = alloc_subband(HORIZONTAL, p->horizontal); 27 subbands[i++] = alloc_subband(HORIZONTAL, p->horizontal);
25 subbands[i++] = alloc_subband(VERTICAL, p->vertical); 28 subbands[i++] = alloc_subband(VERTICAL, p->vertical);
26 subbands[i++] = alloc_subband(DIAGONAL, p->diagonal); 29 subbands[i++] = alloc_subband(DIAGONAL, p->diagonal);
27 30
28 p = p->coarse; 31 p = p->coarse;
29 } 32 }
30 33
31 } 34 }
32 35
42 p->width = tree->image->width; 45 p->width = tree->image->width;
43 p->height = tree->image->height; 46 p->height = tree->image->height;
44 p->size = p->height * p->width; 47 p->size = p->height * p->width;
45 p->image = tree->image; 48 p->image = tree->image;
46 p->type = type; 49 p->type = type;
47 50
48 p->selected = malloc(p->height * sizeof(char *)); 51 p->selected = malloc(p->height * sizeof(char *));
49 p->selected[0] = calloc(p->size, sizeof(char)); 52 p->selected[0] = calloc(p->size, sizeof(char));
50 for (i = 1; i < p->height; i++) 53 for (i = 1; i < p->height; i++)
51 p->selected[i] = &(p->selected[0][i * p->width]); 54 p->selected[i] = &(p->selected[0][i * p->width]);
52 55
53 return p; 56 return p;
54 } 57 }
55 58
56 void set_subband_beta(Subband_data subband, double beta) { 59 void set_subband_beta(Subband_data subband, double beta) {

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