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)
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
static const float x
const float v
Private runtime state/helpers shared by drawlayer module entrypoints.
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