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