efros_freeman  0.1
common.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2016 Lara Raad <lara.raad@cmla.ens-cachan.fr>,
3  Bruno Galerne <bruno.galerne@parisdescartes.fr>
4 
5  Quilting is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Affero General Public License as
7  published by the Free Software Foundation, either version 3 of the
8  License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 /**
20 * @file common.h
21 * @brief this header file contains all definitions.
22 *
23 * @author Lara Raad
24 *
25 * @date 24/05/2012
26 */
27 
28 #ifndef COMMON_H_
29 #define COMMON_H_
30 
31 #include <fftw3.h>
32 
33 typedef struct image
34 {
35  float *img;
36  size_t h,w,c;
37 } Image;
38 
39 typedef struct image_d
40 {
41  double *img;
42  size_t h,w,c;
43 } Image_D;
44 
45 typedef struct image_ld
46 {
47  long double *img;
48  size_t h,w,c;
49 } Image_LD;
50 
51 typedef struct image_ui
52 {
53  unsigned long *img;
54  size_t h,w,c;
55 } Image_UI;
56 
57 typedef struct corner
58 {
59  int x,y;
60 } Corner;
61 
62 typedef int bool;
63 
64 Image initialize(Image src_img, int block_sz, int overlap_sz, int blocks_row,
65  int blocks_col, Corner *patch_src);
66 void initialize_image(Image *im, int rows, int cols, int channels);
67 void initialize_image_D(Image_D *im, int rows, int cols, int channels);
68 void initialize_image_LD(Image_LD *im, int rows, int cols, int channels);
69 void initialize_image_UI(Image_UI *im, int rows, int cols, int channels);
70 void create_position_map(Image position_map);
71 int crop_image(Image *im_crop, Image *im, int M, int N, int C);
72 int update_synth_map(Image * synth_map, Image * position_map,
73  Corner * leftTopCorner_src, Corner * leftTopCorner_output,
74  int patch_sz, Image boundary_mask);
75 char* remove_ext_filename(char *filename);
76 int im_fft(float *img, fftwl_complex *fft_im, int h, int w);
77 
78 #endif