Ansel 0.0
A darktable fork - bloat + design vision
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
locallaplacian.h
Go to the documentation of this file.
1#pragma once
2/*
3 This file is part of darktable,
4 Copyright (C) 2016-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 "develop/imageop.h"
21
22// struct bundling all the auxiliary buffers
23// required to fill the boundary of a full res pipeline
24// with the coarse but complete roi preview pipeline
26{
27 int mode; // 0-regular, 1-preview/collect, 2-full/read
28 float *pad0; // padded preview buffer, grey levels (allocated via dt_alloc_align)
29 int wd; // preview width
30 int ht; // preview height
31 int pwd; // padded preview width
32 int pht; // padded preview height
33 const dt_iop_roi_t *roi; // roi of current view (pointing to pixelpipe roi)
34 const dt_iop_roi_t *buf; // dimensions of full buffer
35 float *output[30]; // output pyramid of preview pass (allocated via dt_alloc_align)
36 int num_levels; // number of levels in preview output pyramid
37}
39
40#if 0
41// WARNING: CRITICAL: why is this not used anywhere ?
42static void local_laplacian_boundary_free(local_laplacian_boundary_t *b)
43{
44 dt_free_align(b->pad0);
45 for(int l=0;l<b->num_levels;l++) dt_free_align(b->output[l]);
46 memset(b, 0, sizeof(*b));
47}
48#endif
49
51 const float *const input, // input buffer in some Labx or yuvx format
52 float *const out, // output buffer with colour
53 const int wd, // width and
54 const int ht, // height of the input buffer
55 const float sigma, // user param: separate shadows/mid-tones/highlights
56 const float shadows, // user param: lift shadows
57 const float highlights, // user param: compress highlights
58 const float clarity, // user param: increase clarity/local contrast
59 const int use_sse2, // switch on sse optimised version, if available
60 // the following is just needed for clipped roi with boundary conditions from coarse buffer (can be 0)
62
64 const float *const input, // input buffer in some Labx or yuvx format
65 float *const out, // output buffer with colour
66 const int wd, // width and
67 const int ht, // height of the input buffer
68 const float sigma, // user param: separate shadows/mid-tones/highlights
69 const float shadows, // user param: lift shadows
70 const float highlights, // user param: compress highlights
71 const float clarity, // user param: increase clarity/local contrast
72 local_laplacian_boundary_t *b) // can be 0
73{
74 local_laplacian_internal(input, out, wd, ht, sigma, shadows, highlights, clarity, 0, b);
75}
76
77size_t local_laplacian_memory_use(const int width, // width of input image
78 const int height); // height of input image
79
80
81size_t local_laplacian_singlebuffer_size(const int width, // width of input image
82 const int height); // height of input image
83
84
85#if defined(__SSE2__)
86void local_laplacian_sse2(
87 const float *const input, // input buffer in some Labx or yuvx format
88 float *const out, // output buffer with colour
89 const int wd, // width and
90 const int ht, // height of the input buffer
91 const float sigma, // user param: separate shadows/mid-tones/highlights
92 const float shadows, // user param: lift shadows
93 const float highlights, // user param: compress highlights
94 const float clarity, // user param: increase clarity/local contrast
95 local_laplacian_boundary_t *b) // can be 0
96{
97 local_laplacian_internal(input, out, wd, ht, sigma, shadows, highlights, clarity, 1, b);
98}
99#endif
100// clang-format off
101// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
102// vim: shiftwidth=2 expandtab tabstop=2 cindent
103// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
104// clang-format on
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
#define dt_free_align(A)
Definition darktable.h:334
size_t local_laplacian_memory_use(const int width, const int height)
Definition locallaplacian.c:781
void local_laplacian_internal(const float *const input, float *const out, const int wd, const int ht, const float sigma, const float shadows, const float highlights, const float clarity, const int use_sse2, local_laplacian_boundary_t *b)
Definition locallaplacian.c:564
void local_laplacian(const float *const input, float *const out, const int wd, const int ht, const float sigma, const float shadows, const float highlights, const float clarity, local_laplacian_boundary_t *b)
Definition locallaplacian.h:63
size_t local_laplacian_singlebuffer_size(const int width, const int height)
Definition locallaplacian.c:797
Definition imageop.h:32
Definition locallaplacian.h:26
int mode
Definition locallaplacian.h:27
int num_levels
Definition locallaplacian.h:36
int wd
Definition locallaplacian.h:29
float * output[30]
Definition locallaplacian.h:35
int ht
Definition locallaplacian.h:30
float * pad0
Definition locallaplacian.h:28
const dt_iop_roi_t * roi
Definition locallaplacian.h:33
int pwd
Definition locallaplacian.h:31
const dt_iop_roi_t * buf
Definition locallaplacian.h:34
int pht
Definition locallaplacian.h:32