Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
iop/drawlayer/module.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <math.h>
6
11#define DRAWLAYER_WORKER_RING_CAPACITY 65536
12#define DRAWLAYER_COMPARE_ANALYTIC_TIMINGS 1
13
23
39
47
53
55
57{
58 /* Keep serialized params as the first field so the pipe runtime can mirror the
59 * module params while also carrying per-piece cache/process state. */
61
62 /* Non-display pipelines still need the same authoritative base-layer cache as
63 * the GUI, just without GUI-only transformed-preview state. Reuse the normal
64 * process-state container so both paths speak the same cache model. */
71
72static inline float _clamp01(const float value)
73{
74 return fminf(fmaxf(value, 0.0f), 1.0f);
75}
76
77static inline float _mapping_profile_value(const drawlayer_mapping_profile_t profile, const float x)
78{
79 const float v = _clamp01(x);
80 switch(profile)
81 {
83 return 1.f + v * v;
85 return 1.f + sqrtf(v);
87 return 1.0f / (1.f + v);
89 return 1.0f / (1.f + sqrtf(v));
91 return 1.0f / (1.f + v * v);
93 default:
94 return 1.f + v;
95 }
96}
static const dt_aligned_pixel_simd_t value
Definition darktable.h:577
static float _mapping_profile_value(const drawlayer_mapping_profile_t profile, const float x)
Definition iop/drawlayer/module.h:77
static float _clamp01(const float value)
Definition iop/drawlayer/module.h:72
drawlayer_input_map_flag_t
Definition iop/drawlayer/module.h:25
@ DRAWLAYER_INPUT_MAP_ACCEL_SIZE
Definition iop/drawlayer/module.h:34
@ DRAWLAYER_INPUT_MAP_ACCEL_FLOW
Definition iop/drawlayer/module.h:36
@ DRAWLAYER_INPUT_MAP_PRESSURE_SOFTNESS
Definition iop/drawlayer/module.h:29
@ DRAWLAYER_INPUT_MAP_TILT_SOFTNESS
Definition iop/drawlayer/module.h:33
@ DRAWLAYER_INPUT_MAP_TILT_OPACITY
Definition iop/drawlayer/module.h:31
@ DRAWLAYER_INPUT_MAP_PRESSURE_OPACITY
Definition iop/drawlayer/module.h:27
@ DRAWLAYER_INPUT_MAP_TILT_FLOW
Definition iop/drawlayer/module.h:32
@ DRAWLAYER_INPUT_MAP_ACCEL_OPACITY
Definition iop/drawlayer/module.h:35
@ DRAWLAYER_INPUT_MAP_TILT_SIZE
Definition iop/drawlayer/module.h:30
@ DRAWLAYER_INPUT_MAP_PRESSURE_FLOW
Definition iop/drawlayer/module.h:28
@ DRAWLAYER_INPUT_MAP_ACCEL_SOFTNESS
Definition iop/drawlayer/module.h:37
@ DRAWLAYER_INPUT_MAP_PRESSURE_SIZE
Definition iop/drawlayer/module.h:26
dt_drawlayer_cache_patch_t drawlayer_patch_t
Definition iop/drawlayer/module.h:54
drawlayer_mapping_profile_t
Definition iop/drawlayer/module.h:15
@ DRAWLAYER_PROFILE_INV_QUADRATIC
Definition iop/drawlayer/module.h:21
@ DRAWLAYER_PROFILE_INV_SQRT
Definition iop/drawlayer/module.h:20
@ DRAWLAYER_PROFILE_QUADRATIC
Definition iop/drawlayer/module.h:17
@ DRAWLAYER_PROFILE_LINEAR
Definition iop/drawlayer/module.h:16
@ DRAWLAYER_PROFILE_INV_LINEAR
Definition iop/drawlayer/module.h:19
@ DRAWLAYER_PROFILE_SQRT
Definition iop/drawlayer/module.h:18
drawlayer_preview_bg_mode_t
Definition iop/drawlayer/module.h:41
@ DRAWLAYER_PREVIEW_BG_WHITE
Definition iop/drawlayer/module.h:43
@ DRAWLAYER_PREVIEW_BG_IMAGE
Definition iop/drawlayer/module.h:42
@ DRAWLAYER_PREVIEW_BG_BLACK
Definition iop/drawlayer/module.h:45
@ DRAWLAYER_PREVIEW_BG_GREY
Definition iop/drawlayer/module.h:44
drawlayer_pick_source_t
Definition iop/drawlayer/module.h:49
@ DRAWLAYER_PICK_SOURCE_INPUT
Definition iop/drawlayer/module.h:50
@ DRAWLAYER_PICK_SOURCE_OUTPUT
Definition iop/drawlayer/module.h:51
static const float x
Definition iop_profile.h:235
const float v
Definition iop_profile.h:221
Private runtime state/helpers shared by drawlayer module entrypoints.
Generic float RGBA patch stored either in malloc memory or pixel cache.
Definition iop/drawlayer/cache.h:37
Definition runtime.h:34
Definition runtime.h:211
Definition iop/drawlayer/module.h:57
dt_drawlayer_process_state_t * runtime_process
Definition iop/drawlayer/module.h:68
dt_drawlayer_process_state_t process
Definition iop/drawlayer/module.h:65
dt_drawlayer_runtime_manager_t headless_manager
Definition iop/drawlayer/module.h:66
dt_iop_drawlayer_params_t params
Definition iop/drawlayer/module.h:60
dt_drawlayer_runtime_manager_t * runtime_manager
Definition iop/drawlayer/module.h:67
gboolean runtime_display_pipe
Definition iop/drawlayer/module.h:69
Definition src/iop/drawlayer/common.h:14