Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
bilateral.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2012-2013 johannes hanika.
4 Copyright (C) 2012 Moritz Lipp.
5 Copyright (C) 2012-2014, 2016 Tobias Ellinghaus.
6 Copyright (C) 2012, 2014, 2016 Ulrich Pegelow.
7 Copyright (C) 2015-2016 Roman Lebedev.
8 Copyright (C) 2019 Aurélien PIERRE.
9 Copyright (C) 2020 Pascal Obry.
10 Copyright (C) 2020 Ralf Brown.
11 Copyright (C) 2022 Martin Bařinka.
12
13 darktable is free software: you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 darktable is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with darktable. If not, see <http://www.gnu.org/licenses/>.
25*/
26
27#ifndef DT_PIXEL_BILATERAL_H
28#define DT_PIXEL_BILATERAL_H
29
30#include <stddef.h> // for size_t
31
32typedef struct dt_bilateral_t
33{
36 int numslices, sliceheight, slicerows; //height--in input image, rows--in grid
38 float *buf __attribute__((aligned(64)));
40
41size_t dt_bilateral_memory_use(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
46size_t dt_bilateral_memory_use2(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
51size_t dt_bilateral_singlebuffer_size(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
56size_t dt_bilateral_singlebuffer_size2(const int width, // width of input image
57 const int height, // height of input image
58 const float sigma_s, // spatial sigma (blur pixel coords)
59 const float sigma_r); // range sigma (blur luma values)
60
61void dt_bilateral_grid_size(dt_bilateral_t *b, const int width, const int height, const float L_range,
62 float sigma_s, const float sigma_r);
63
64dt_bilateral_t *dt_bilateral_init(const int width, // width of input image
65 const int height, // height of input image
66 const float sigma_s, // spatial sigma (blur pixel coords)
67 const float sigma_r); // range sigma (blur luma values)
68
69void dt_bilateral_splat(const dt_bilateral_t *b, const float *const in);
70
72
73void dt_bilateral_slice(const dt_bilateral_t *const b, const float *const in, float *out, const float detail);
74
75void dt_bilateral_slice_to_output(const dt_bilateral_t *const b, const float *const in, float *out,
76 const float detail);
77
79
80#endif // DT_PIXEL_BILATERAL_H
81
82// clang-format off
83// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
84// vim: shiftwidth=2 expandtab tabstop=2 cindent
85// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
86// clang-format on
87
int width
Definition bilateral.h:1
void dt_bilateral_free(dt_bilateral_t *b)
Definition bilateral.c:432
void dt_bilateral_slice(const dt_bilateral_t *const b, const float *const in, float *out, const float detail)
Definition bilateral.c:356
size_t dt_bilateral_memory_use2(const int width, const int height, const float sigma_s, const float sigma_r)
Definition bilateralcl.c:72
void dt_bilateral_splat(const dt_bilateral_t *b, const float *const in)
Definition bilateral.c:183
float sigma_s
Definition bilateral.h:3
void dt_bilateral_grid_size(dt_bilateral_t *b, const int width, const int height, const float L_range, float sigma_s, const float sigma_r)
Definition bilateral.c:51
size_t dt_bilateral_singlebuffer_size2(const int width, const int height, const float sigma_s, const float sigma_r)
Definition bilateralcl.c:82
size_t dt_bilateral_memory_use(const int width, const int height, const float sigma_s, const float sigma_r)
Definition bilateral.c:80
dt_bilateral_t * dt_bilateral_init(const int width, const int height, const float sigma_s, const float sigma_r)
Definition bilateral.c:157
size_t dt_bilateral_singlebuffer_size(const int width, const int height, const float sigma_s, const float sigma_r)
Definition bilateral.c:108
void dt_bilateral_slice_to_output(const dt_bilateral_t *const b, const float *const in, float *out, const float detail)
Definition bilateral.c:396
int height
Definition bilateral.h:1
float sigma_r
Definition bilateral.h:3
void dt_bilateral_blur(const dt_bilateral_t *b)
Definition bilateral.c:341
const dt_colormatrix_t dt_aligned_pixel_t out
float dt_aligned_pixel_simd_t __attribute__((vector_size(16), aligned(16)))
Apply one channel's tone curve to each of the three colour channels, or pass the channel through unto...
Definition simd.h:55
size_t size_y
Definition bilateral.h:34
size_t size_z
Definition bilateral.h:34
float *buf __attribute__((aligned(64)))
size_t size_x
Definition bilateral.h:34