Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
gaussian.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2012, 2017 Ulrich Pegelow.
4 Copyright (C) 2014, 2016 Tobias Ellinghaus.
5 Copyright (C) 2015-2016 Roman Lebedev.
6 Copyright (C) 2020 Aurélien PIERRE.
7 Copyright (C) 2020 Pascal Obry.
8 Copyright (C) 2021 Ralf Brown.
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#ifndef DT_PIXEL_GAUSSIAN_H
26#define DT_PIXEL_GAUSSIAN_H
27
28#include "common/opencl.h"
29#include <assert.h>
30#include <math.h>
31
33{
34 DT_IOP_GAUSSIAN_ZERO = 0, // $DESCRIPTION: "order 0"
35 DT_IOP_GAUSSIAN_ONE = 1, // $DESCRIPTION: "order 1"
36 DT_IOP_GAUSSIAN_TWO = 2 // $DESCRIPTION: "order 2"
38
39
40typedef struct dt_gaussian_t
41{
43 float sigma;
44 int order;
45 float *max;
46 float *min;
47 float *buf;
49
50dt_gaussian_t *dt_gaussian_init(const int width, const int height, const int channels, const float *max,
51 const float *min, const float sigma, const int order);
52
53size_t dt_gaussian_memory_use(const int width, const int height, const int channels);
54#ifdef HAVE_OPENCL
55size_t dt_gaussian_memory_use_cl(const int width, const int height, const int channels);
56#endif
57
58size_t dt_gaussian_singlebuffer_size(const int width, const int height, const int channels);
59
60void dt_gaussian_blur(dt_gaussian_t *g, const float *const in, float *const out);
61
62void dt_gaussian_blur_4c(dt_gaussian_t *g, const float *const in, float *const out);
63
65
66
67#ifdef HAVE_OPENCL
73
74
89
91
93
94dt_gaussian_cl_t *dt_gaussian_init_cl(const int devid, const int width, const int height, const int channels,
95 const float *max, const float *min, const float sigma, const int order);
96
97cl_int dt_gaussian_blur_cl(dt_gaussian_cl_t *g, cl_mem dev_in, cl_mem dev_out);
98
100#endif
101
102#endif // DT_PIXEL_GAUSSIAN_H
103
104// clang-format off
105// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
106// vim: shiftwidth=2 expandtab tabstop=2 cindent
107// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
108// clang-format on
109
static const float const float const float min
const float max
const dt_colormatrix_t dt_aligned_pixel_t out
void dt_gaussian_free(dt_gaussian_t *g)
Definition gaussian.c:335
void dt_gaussian_free_cl(dt_gaussian_cl_t *g)
Definition gaussian.c:365
size_t dt_gaussian_memory_use_cl(const int width, const int height, const int channels)
Definition gaussian.c:105
void dt_gaussian_blur(dt_gaussian_t *g, const float *const in, float *const out)
Definition gaussian.c:176
void dt_gaussian_free_cl_global(void)
Definition gaussian.c:586
size_t dt_gaussian_singlebuffer_size(const int width, const int height, const int channels)
Definition gaussian.c:113
cl_int dt_gaussian_blur_cl(dt_gaussian_cl_t *g, cl_mem dev_in, cl_mem dev_out)
Definition gaussian.c:453
dt_gaussian_order_t
Definition gaussian.h:33
@ DT_IOP_GAUSSIAN_TWO
Definition gaussian.h:36
@ DT_IOP_GAUSSIAN_ONE
Definition gaussian.h:35
@ DT_IOP_GAUSSIAN_ZERO
Definition gaussian.h:34
void dt_gaussian_blur_4c(dt_gaussian_t *g, const float *const in, float *const out)
Definition gaussian.c:330
dt_gaussian_cl_t * dt_gaussian_init_cl(const int devid, const int width, const int height, const int channels, const float *max, const float *min, const float sigma, const int order)
Definition gaussian.c:376
dt_gaussian_t * dt_gaussian_init(const int width, const int height, const int channels, const float *max, const float *min, const float sigma, const int order)
Definition gaussian.c:127
size_t dt_gaussian_memory_use(const int width, const int height, const int channels)
Definition gaussian.c:97
void dt_gaussian_init_cl_global(void)
Definition gaussian.c:353
uint32_t width
Definition mipmap_cache.c:0
uint32_t height
Definition mipmap_cache.c:1
const float sigma
cl_mem dev_temp1
Definition gaussian.h:86
dt_gaussian_cl_global_t * global
Definition gaussian.h:77
cl_mem dev_temp2
Definition gaussian.h:87
float * buf
Definition gaussian.h:47
float * min
Definition gaussian.h:46
float * max
Definition gaussian.h:45
float sigma
Definition gaussian.h:43