1 /*
2     This file is part of darktable,
3     copyright (c) 2012 johannes hanika.
4 
5     darktable is free software: you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation, either version 3 of the License, or
8     (at your option) any later version.
9 
10     darktable 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 General Public License for more details.
14 
15     You should have received a copy of the GNU General Public License
16     along with darktable.  If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #pragma once
20 
21 #include <stddef.h> // for size_t
22 
23 typedef struct dt_bilateral_t
24 {
25   size_t size_x, size_y, size_z;
26   int width, height;
27   float sigma_s, sigma_r;
28   float *buf;
29 } dt_bilateral_t;
30 
31 size_t dt_bilateral_memory_use(const int width,      // width of input image
32                                const int height,     // height of input image
33                                const float sigma_s,  // spatial sigma (blur pixel coords)
34                                const float sigma_r); // range sigma (blur luma values)
35 
36 size_t dt_bilateral_memory_use2(const int width,      // width of input image
37                                 const int height,     // height of input image
38                                 const float sigma_s,  // spatial sigma (blur pixel coords)
39                                 const float sigma_r); // range sigma (blur luma values)
40 
41 size_t dt_bilateral_singlebuffer_size(const int width,      // width of input image
42                                       const int height,     // height of input image
43                                       const float sigma_s,  // spatial sigma (blur pixel coords)
44                                       const float sigma_r); // range sigma (blur luma values)
45 
46 size_t dt_bilateral_singlebuffer_size2(const int width,      // width of input image
47                                        const int height,     // height of input image
48                                        const float sigma_s,  // spatial sigma (blur pixel coords)
49                                        const float sigma_r); // range sigma (blur luma values)
50 
51 dt_bilateral_t *dt_bilateral_init(const int width,      // width of input image
52                                   const int height,     // height of input image
53                                   const float sigma_s,  // spatial sigma (blur pixel coords)
54                                   const float sigma_r, int v); // range sigma (blur luma values)
55 
56 void dt_bilateral_splat(dt_bilateral_t *b, const float *const in, int ilskip, int olskip, int v);
57 
58 void dt_bilateral_blur(dt_bilateral_t *b);
59 
60 void dt_bilateral_slice(const dt_bilateral_t *const b, const float *const in, float *out,
61     const int ilskip, const int lskip, const int olskip, const float detail);
62 
63 void dt_bilateral_slice_to_output(const dt_bilateral_t *const b, const float *const in, float *out,
64                                   const float detail);
65 
66 void dt_bilateral_free(dt_bilateral_t *b);
67 
68 // modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
69 // vim: shiftwidth=2 expandtab tabstop=2 cindent
70 // kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
71