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#ifndef DT_IOP_DRAWLAYER_MODULE_H
2#define DT_IOP_DRAWLAYER_MODULE_H
3
5
6#include <math.h>
7
12#define DRAWLAYER_WORKER_RING_CAPACITY 65536
13#define DRAWLAYER_COMPARE_ANALYTIC_TIMINGS 1
14
24
40
48
54
56
58{
59 /* Keep serialized params as the first field so the pipe runtime can mirror the
60 * module params while also carrying per-piece cache/process state. */
62
63 /* Non-display pipelines still need the same authoritative base-layer cache as
64 * the GUI, just without GUI-only transformed-preview state. Reuse the normal
65 * process-state container so both paths speak the same cache model. */
72
73static inline float _clamp01(const float value)
74{
75 return fminf(fmaxf(value, 0.0f), 1.0f);
76}
77
78static inline float _mapping_profile_value(const drawlayer_mapping_profile_t profile, const float x)
79{
80 const float v = _clamp01(x);
81 switch(profile)
82 {
84 return 1.f + v * v;
86 return 1.f + sqrtf(v);
88 return 1.0f / (1.f + v);
90 return 1.0f / (1.f + sqrtf(v));
92 return 1.0f / (1.f + v * v);
94 default:
95 return 1.f + v;
96 }
97}
98#endif // DT_IOP_DRAWLAYER_MODULE_H
static const float x
const float v
static float _mapping_profile_value(const drawlayer_mapping_profile_t profile, const float x)
static float _clamp01(const float value)
drawlayer_input_map_flag_t
@ DRAWLAYER_INPUT_MAP_ACCEL_SIZE
@ DRAWLAYER_INPUT_MAP_ACCEL_FLOW
@ DRAWLAYER_INPUT_MAP_PRESSURE_SOFTNESS
@ DRAWLAYER_INPUT_MAP_TILT_SOFTNESS
@ DRAWLAYER_INPUT_MAP_TILT_OPACITY
@ DRAWLAYER_INPUT_MAP_PRESSURE_OPACITY
@ DRAWLAYER_INPUT_MAP_TILT_FLOW
@ DRAWLAYER_INPUT_MAP_ACCEL_OPACITY
@ DRAWLAYER_INPUT_MAP_TILT_SIZE
@ DRAWLAYER_INPUT_MAP_PRESSURE_FLOW
@ DRAWLAYER_INPUT_MAP_ACCEL_SOFTNESS
@ DRAWLAYER_INPUT_MAP_PRESSURE_SIZE
dt_drawlayer_cache_patch_t drawlayer_patch_t
drawlayer_mapping_profile_t
@ DRAWLAYER_PROFILE_INV_QUADRATIC
@ DRAWLAYER_PROFILE_INV_SQRT
@ DRAWLAYER_PROFILE_QUADRATIC
@ DRAWLAYER_PROFILE_LINEAR
@ DRAWLAYER_PROFILE_INV_LINEAR
@ DRAWLAYER_PROFILE_SQRT
drawlayer_preview_bg_mode_t
@ DRAWLAYER_PREVIEW_BG_WHITE
@ DRAWLAYER_PREVIEW_BG_IMAGE
@ DRAWLAYER_PREVIEW_BG_BLACK
@ DRAWLAYER_PREVIEW_BG_GREY
drawlayer_pick_source_t
@ DRAWLAYER_PICK_SOURCE_INPUT
@ DRAWLAYER_PICK_SOURCE_OUTPUT
Private runtime state/helpers shared by drawlayer module entrypoints.
static const dt_aligned_pixel_simd_t value
Definition simd.h:144
Generic float RGBA patch stored either in malloc memory or pixel cache.
dt_drawlayer_process_state_t * runtime_process
dt_drawlayer_process_state_t process
dt_drawlayer_runtime_manager_t headless_manager
dt_iop_drawlayer_params_t params
dt_drawlayer_runtime_manager_t * runtime_manager