Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
locallaplaciancl.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2016 johannes hanika.
4 Copyright (C) 2019 Aurélien PIERRE.
5 Copyright (C) 2020 Pascal Obry.
6 Copyright (C) 2021 Chris Elston.
7 Copyright (C) 2022 Martin Bařinka.
8
9 darktable is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 darktable is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with darktable. If not, see <http://www.gnu.org/licenses/>.
21*/
22#pragma once
23#ifdef HAVE_OPENCL
24typedef struct dt_local_laplacian_cl_global_t
25{
26 int kernel_pad_input;
27 int kernel_gauss_expand;
28 int kernel_gauss_reduce;
29 int kernel_laplacian_assemble;
30 int kernel_process_curve;
31 int kernel_write_back;
32}
33dt_local_laplacian_cl_global_t;
34
35typedef struct dt_local_laplacian_cl_t
36{
37 int devid;
38 dt_local_laplacian_cl_global_t *global;
39
40 int width, height;
41 int num_levels;
42 float sigma, highlights, shadows, clarity;
43 int blocksize, blockwd, blockht;
44 int max_supp;
45 size_t bwidth, bheight;
46
47 // pyramid of padded monochrome input buffer
48 cl_mem *dev_padded;
49 // pyramid of padded output buffer, monochrome, too:
50 cl_mem *dev_output;
51 // one pyramid of padded monochrome buffers for every value
52 // of gamma (curve parameter) that we process:
53 cl_mem **dev_processed;
54}
55dt_local_laplacian_cl_t;
56
57dt_local_laplacian_cl_global_t *dt_local_laplacian_init_cl_global();
58dt_local_laplacian_cl_t *dt_local_laplacian_init_cl(
59 const int devid,
60 const int width, // width of input image
61 const int height, // height of input image
62 const float sigma, // user param: separate shadows/mid-tones/highlights
63 const float shadows, // user param: lift shadows
64 const float highlights, // user param: compress highlights
65 const float clarity); // user param: increase clarity/local contrast
66void dt_local_laplacian_free_cl(dt_local_laplacian_cl_t *g);
67cl_int dt_local_laplacian_cl(dt_local_laplacian_cl_t *g, cl_mem input, cl_mem output);
68#endif
69// clang-format off
70// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
71// vim: shiftwidth=2 expandtab tabstop=2 cindent
72// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
73// clang-format on
74
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
const float g
Definition colorspaces_inline_conversions.h:925