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 johannes hanika.
4 Copyright (C) 2012-2014, 2016 Tobias Ellinghaus.
5 Copyright (C) 2012, 2014 Ulrich Pegelow.
6 Copyright (C) 2016 Roman Lebedev.
7 Copyright (C) 2019 Marcus Rückert.
8 Copyright (C) 2020 Pascal Obry.
9 Copyright (C) 2022 Martin Bařinka.
10
11 darktable is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
15
16 darktable is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with darktable. If not, see <http://www.gnu.org/licenses/>.
23*/
24
25#pragma once
26
27#ifdef HAVE_OPENCL
28#ifdef HAVE_CONFIG_H
29#include "config.h"
30#endif
31
32#include <CL/cl.h> // for cl_mem, _cl_mem
33#include <stddef.h> // for size_t
34
35typedef struct dt_bilateral_cl_global_t
36{
37 int kernel_zero, kernel_splat, kernel_blur_line, kernel_blur_line_z, kernel_slice, kernel_slice2;
38} dt_bilateral_cl_global_t;
39
40typedef struct dt_bilateral_cl_t
41{
42 dt_bilateral_cl_global_t *global;
43 int devid;
44 size_t size_x, size_y, size_z;
45 int width, height;
46 size_t blocksizex, blocksizey;
47 float sigma_s, sigma_r;
48 cl_mem dev_grid;
49 cl_mem dev_grid_tmp;
50} dt_bilateral_cl_t;
51
52dt_bilateral_cl_global_t *dt_bilateral_init_cl_global();
53
54void dt_bilateral_free_cl(dt_bilateral_cl_t *b);
55
56dt_bilateral_cl_t *dt_bilateral_init_cl(const int devid,
57 const int width, // width of input image
58 const int height, // height of input image
59 const float sigma_s, // spatial sigma (blur pixel coords)
60 const float sigma_r); // range sigma (blur luma values)
61
62cl_int dt_bilateral_splat_cl(dt_bilateral_cl_t *b, cl_mem in);
63
64cl_int dt_bilateral_blur_cl(dt_bilateral_cl_t *b);
65
66cl_int dt_bilateral_slice_to_output_cl(dt_bilateral_cl_t *b, cl_mem in, cl_mem out, const float detail);
67
68cl_int dt_bilateral_slice_cl(dt_bilateral_cl_t *b, cl_mem in, cl_mem out, const float detail);
69
70void dt_bilateral_free_cl_global(dt_bilateral_cl_global_t *b);
71
72#endif // HAVE_OPENCL
73
74// clang-format off
75// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
76// vim: shiftwidth=2 expandtab tabstop=2 cindent
77// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
78// clang-format on
79
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
const float b
Definition colorspaces_inline_conversions.h:1326
static const dt_colormatrix_t dt_aligned_pixel_t out
Definition colorspaces_inline_conversions.h:184