Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
nlmeans_core.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2020 Ralf Brown.
4 Copyright (C) 2022 Martin Bařinka.
5 Copyright (C) 2025 Aurélien PIERRE.
6
7 darktable is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 darktable is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with darktable. If not, see <http://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include "iop/iop_api.h"
23#include "develop/develop.h"
24
26{
27 float scattering; // scattering factor for patches (default 0 = densest possible)
28 float scale; // image scaling, affects scattering
29 float luma; // blend amount, L channel in Lab (set to 1.00 for RGB)
30 float chroma; // blend amount, a/b channels (set to 1.00 for RBG)
31 float center_weight; // weighting of central pixel in patch (<0 for no special handling; used by denoise[non-local])
32 float sharpness; // relative weight of central pixel (preserves detail), ignored if center_weight >= 0
33 int patch_radius; // radius of patches which are compared, 1..4
34 int search_radius; // radius around a pixel in which to compare patches (default = 7)
35 int decimate; // set to 1 to search only half the patches in the neighborhood (default = 0)
36 const float* const norm; // array of four per-channel weight factors
38 int kernel_init; // CL: initialization (runs once)
39 int kernel_dist; // CL: compute channel-normed squared pixel differences (runs for each patch)
40 int kernel_horiz; // CL: horizontal sum (runs for each patch)
41 int kernel_vert; // CL: vertical sum (runs for each patch)
42 int kernel_accu; // CL: add to output pixel (runs for each patch)
43};
45
46void nlmeans_denoise(const float *const inbuf, float *const outbuf,
47 const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out,
48 const dt_nlmeans_param_t *const params);
49
50void nlmeans_denoise_sse2(const float *const inbuf, float *const outbuf,
51 const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out,
52 const dt_nlmeans_param_t *const params);
53
54#ifdef HAVE_OPENCL
55int nlmeans_denoise_cl(const dt_nlmeans_param_t *const params, const int devid,
56 cl_mem dev_in, cl_mem dev_out, const dt_iop_roi_t *const roi_in);
57int nlmeans_denoiseprofile_cl(const dt_nlmeans_param_t *const params, const int devid,
58 cl_mem dev_in, cl_mem dev_out, const dt_iop_roi_t *const roi_in);
59#endif /* HAVE_OPENCL */
60// clang-format off
61// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
62// vim: shiftwidth=2 expandtab tabstop=2 cindent
63// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
64// clang-format on
void nlmeans_denoise_sse2(const float *const inbuf, float *const outbuf, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const dt_nlmeans_param_t *const params)
void nlmeans_denoise(const float *const inbuf, float *const outbuf, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const dt_nlmeans_param_t *const params)
Definition nlmeans_core.c:398
dt_dev_pixelpipe_type_t
Definition pixelpipe.h:36
Definition imageop.h:67
Definition nlmeans_core.h:26
int decimate
Definition nlmeans_core.h:35
float center_weight
Definition nlmeans_core.h:31
int kernel_vert
Definition nlmeans_core.h:41
const float *const norm
Definition nlmeans_core.h:36
float scale
Definition nlmeans_core.h:28
int kernel_horiz
Definition nlmeans_core.h:40
int kernel_init
Definition nlmeans_core.h:38
float scattering
Definition nlmeans_core.h:27
int patch_radius
Definition nlmeans_core.h:33
float sharpness
Definition nlmeans_core.h:32
int search_radius
Definition nlmeans_core.h:34
dt_dev_pixelpipe_type_t pipetype
Definition nlmeans_core.h:37
int kernel_dist
Definition nlmeans_core.h:39
float chroma
Definition nlmeans_core.h:30
int kernel_accu
Definition nlmeans_core.h:42
float luma
Definition nlmeans_core.h:29