Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
bilateralcl.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2012-2020 darktable developers.
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#ifdef HAVE_OPENCL
22#ifdef HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#include <CL/cl.h> // for cl_mem, _cl_mem
27#include <stddef.h> // for size_t
28
29typedef struct dt_bilateral_cl_global_t
30{
31 int kernel_zero, kernel_splat, kernel_blur_line, kernel_blur_line_z, kernel_slice, kernel_slice2;
32} dt_bilateral_cl_global_t;
33
34typedef struct dt_bilateral_cl_t
35{
36 dt_bilateral_cl_global_t *global;
37 int devid;
38 size_t size_x, size_y, size_z;
39 int width, height;
40 size_t blocksizex, blocksizey;
41 float sigma_s, sigma_r;
42 cl_mem dev_grid;
43 cl_mem dev_grid_tmp;
44} dt_bilateral_cl_t;
45
46dt_bilateral_cl_global_t *dt_bilateral_init_cl_global();
47
48void dt_bilateral_free_cl(dt_bilateral_cl_t *b);
49
50dt_bilateral_cl_t *dt_bilateral_init_cl(const int devid,
51 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); // range sigma (blur luma values)
55
56cl_int dt_bilateral_splat_cl(dt_bilateral_cl_t *b, cl_mem in);
57
58cl_int dt_bilateral_blur_cl(dt_bilateral_cl_t *b);
59
60cl_int dt_bilateral_slice_to_output_cl(dt_bilateral_cl_t *b, cl_mem in, cl_mem out, const float detail);
61
62cl_int dt_bilateral_slice_cl(dt_bilateral_cl_t *b, cl_mem in, cl_mem out, const float detail);
63
64void dt_bilateral_free_cl_global(dt_bilateral_cl_global_t *b);
65
66#endif // HAVE_OPENCL
67
68// clang-format off
69// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
70// vim: shiftwidth=2 expandtab tabstop=2 cindent
71// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
72// clang-format on
73
int width
Definition bilateral.h:1
size_t size_x
Definition bilateral.h:0
size_t size_y
Definition bilateral.h:0
float sigma_s
Definition bilateral.h:3
size_t size_z
Definition bilateral.h:0
int height
Definition bilateral.h:1
float sigma_r
Definition bilateral.h:3