29#define DRAWLAYER_CONF_BASE "plugins/drawlayer/"
30#define DRAWLAYER_CONF_BRUSH_SHAPE DRAWLAYER_CONF_BASE "brush_shape"
31#define DRAWLAYER_CONF_BRUSH_MODE DRAWLAYER_CONF_BASE "brush_mode"
32#define DRAWLAYER_CONF_COLOR_R DRAWLAYER_CONF_BASE "color_r"
33#define DRAWLAYER_CONF_COLOR_G DRAWLAYER_CONF_BASE "color_g"
34#define DRAWLAYER_CONF_COLOR_B DRAWLAYER_CONF_BASE "color_b"
35#define DRAWLAYER_CONF_SOFTNESS DRAWLAYER_CONF_BASE "softness"
36#define DRAWLAYER_CONF_OPACITY DRAWLAYER_CONF_BASE "opacity"
37#define DRAWLAYER_CONF_FLOW DRAWLAYER_CONF_BASE "flow"
38#define DRAWLAYER_CONF_SPRINKLES DRAWLAYER_CONF_BASE "sprinkles"
39#define DRAWLAYER_CONF_SPRINKLE_SIZE DRAWLAYER_CONF_BASE "sprinkle_size"
40#define DRAWLAYER_CONF_SPRINKLE_COARSENESS DRAWLAYER_CONF_BASE "sprinkle_coarseness"
41#define DRAWLAYER_CONF_DISTANCE DRAWLAYER_CONF_BASE "distance"
42#define DRAWLAYER_CONF_SMOOTHING DRAWLAYER_CONF_BASE "smoothing"
43#define DRAWLAYER_CONF_SIZE DRAWLAYER_CONF_BASE "size"
44#define DRAWLAYER_CONF_PICK_SOURCE DRAWLAYER_CONF_BASE "pick_source"
45#define DRAWLAYER_CONF_HDR_EV DRAWLAYER_CONF_BASE "hdr_exposure"
46#define DRAWLAYER_CONF_MAP_PRESSURE_SIZE DRAWLAYER_CONF_BASE "map_pressure_size"
47#define DRAWLAYER_CONF_MAP_PRESSURE_OPACITY DRAWLAYER_CONF_BASE "map_pressure_opacity"
48#define DRAWLAYER_CONF_MAP_PRESSURE_FLOW DRAWLAYER_CONF_BASE "map_pressure_flow"
49#define DRAWLAYER_CONF_MAP_PRESSURE_SOFTNESS DRAWLAYER_CONF_BASE "map_pressure_softness"
50#define DRAWLAYER_CONF_MAP_TILT_SIZE DRAWLAYER_CONF_BASE "map_tilt_size"
51#define DRAWLAYER_CONF_MAP_TILT_OPACITY DRAWLAYER_CONF_BASE "map_tilt_opacity"
52#define DRAWLAYER_CONF_MAP_TILT_FLOW DRAWLAYER_CONF_BASE "map_tilt_flow"
53#define DRAWLAYER_CONF_MAP_TILT_SOFTNESS DRAWLAYER_CONF_BASE "map_tilt_softness"
54#define DRAWLAYER_CONF_MAP_ACCEL_SIZE DRAWLAYER_CONF_BASE "map_acceleration_size"
55#define DRAWLAYER_CONF_MAP_ACCEL_OPACITY DRAWLAYER_CONF_BASE "map_acceleration_opacity"
56#define DRAWLAYER_CONF_MAP_ACCEL_FLOW DRAWLAYER_CONF_BASE "map_acceleration_flow"
57#define DRAWLAYER_CONF_MAP_ACCEL_SOFTNESS DRAWLAYER_CONF_BASE "map_acceleration_hardness"
58#define DRAWLAYER_CONF_PRESSURE_PROFILE DRAWLAYER_CONF_BASE "pressure_profile"
59#define DRAWLAYER_CONF_TILT_PROFILE DRAWLAYER_CONF_BASE "tilt_profile"
60#define DRAWLAYER_CONF_ACCEL_PROFILE DRAWLAYER_CONF_BASE "acceleration_profile"
239 if(!
g || !
g->ui.widgets)
return;
244 char key[128] = { 0 };
263 if(!
g || !
g->ui.widgets)
return;
269 char key[128] = { 0 };
288 if(!
g || !
g->ui.widgets || !display_rgb)
return;
292 if(
g->controls.color_swatch) gtk_widget_queue_draw(
g->controls.color_swatch);
299 if(!self || !
g || !
g->ui.widgets || !display_rgb)
return;
310 if(
g->controls.color) gtk_widget_queue_draw(
g->controls.color);
311 if(
g->controls.color_swatch) gtk_widget_queue_draw(
g->controls.color_swatch);
319 if(!
g || !
g->ui.widgets)
return;
321 float display_rgb[3] = { 0.0f };
325 if(
g->controls.color_swatch) gtk_widget_queue_draw(
g->controls.color_swatch);
332 (
void)record_history;
346 if(
g->controls.image_colorpicker_source)
#define FALSE
Definition ashift_lsd.c:158
float dt_bauhaus_slider_get(GtkWidget *widget)
Definition bauhaus.c:2769
int dt_bauhaus_combobox_get(GtkWidget *widget)
Definition bauhaus.c:1771
dt_drawlayer_brush_mode_t
Pixel blending behavior used while stamping a dab.
Definition brush.h:49
@ DT_DRAWLAYER_BRUSH_MODE_PAINT
Definition brush.h:50
@ DT_DRAWLAYER_BRUSH_MODE_SMUDGE
Definition brush.h:53
dt_drawlayer_brush_shape_t
Supported analytic fall-off profiles for brush alpha.
Definition brush.h:40
@ DT_DRAWLAYER_BRUSH_SHAPE_SIGMOIDAL
Definition brush.h:44
@ DT_DRAWLAYER_BRUSH_SHAPE_LINEAR
Definition brush.h:41
const float i
Definition colorspaces_inline_conversions.h:669
const float g
Definition colorspaces_inline_conversions.h:925
static dt_aligned_pixel_t rgb
Definition colorspaces_inline_conversions.h:530
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
void dt_conf_set_bool(const char *name, int val)
Definition control/conf.c:158
int dt_conf_get_bool(const char *name)
Definition control/conf.c:364
int dt_conf_key_exists(const char *key)
Definition control/conf.c:556
void dt_conf_set_float(const char *name, float val)
Definition control/conf.c:148
float dt_conf_get_float(const char *name)
Definition control/conf.c:325
void dt_conf_set_int(const char *name, int val)
Definition control/conf.c:130
int dt_conf_get_int(const char *name)
Definition control/conf.c:241
void dt_control_queue_redraw_center()
request redraw of center window. This redraws the center view within a gdk critical section to preven...
Definition control.c:630
darktable_t darktable
Definition darktable.c:178
static float _clamp01(const float value)
Definition drawlayer.c:244
drawlayer_mapping_profile_t
Definition drawlayer.c:104
@ DRAWLAYER_PROFILE_INV_QUADRATIC
Definition drawlayer.c:110
@ DRAWLAYER_PROFILE_LINEAR
Definition drawlayer.c:105
drawlayer_pick_source_t
Definition drawlayer.c:138
@ DRAWLAYER_PICK_SOURCE_INPUT
Definition drawlayer.c:139
@ DRAWLAYER_PICK_SOURCE_OUTPUT
Definition drawlayer.c:140
static float _conf_smoothing(void)
Read and clamp configured smoothing parameter (%).
Definition iop/drawlayer/conf.c:179
#define DRAWLAYER_CONF_BRUSH_MODE
Definition iop/drawlayer/conf.c:31
#define DRAWLAYER_CONF_MAP_TILT_SIZE
Definition iop/drawlayer/conf.c:50
static void _ensure_gui_conf_defaults(void)
Ensure all drawlayer GUI config keys exist with sane defaults.
Definition iop/drawlayer/conf.c:63
#define DRAWLAYER_CONF_COLOR_R
Definition iop/drawlayer/conf.c:32
static float _conf_sprinkle_coarseness(void)
Read and clamp configured sprinkle octave mix (%).
Definition iop/drawlayer/conf.c:167
static drawlayer_mapping_profile_t _conf_mapping_profile(const char *key)
Read and clamp one mapping-profile enum key.
Definition iop/drawlayer/conf.c:210
static float _conf_hardness(void)
Derive hardness as complementary value of softness.
Definition iop/drawlayer/conf.c:191
#define DRAWLAYER_CONF_PICK_SOURCE
Definition iop/drawlayer/conf.c:44
#define DRAWLAYER_CONF_OPACITY
Definition iop/drawlayer/conf.c:36
#define DRAWLAYER_CONF_DISTANCE
Definition iop/drawlayer/conf.c:41
static float _conf_flow(void)
Read and clamp configured flow (%).
Definition iop/drawlayer/conf.c:149
static float _conf_softness(void)
Read configured softness in [0,1].
Definition iop/drawlayer/conf.c:185
static float _conf_size(void)
Read and clamp configured brush size (px).
Definition iop/drawlayer/conf.c:137
static void _conf_display_color(float rgb[3])
Read configured display RGB brush color.
Definition iop/drawlayer/conf.c:217
#define DRAWLAYER_CONF_MAP_PRESSURE_SIZE
Definition iop/drawlayer/conf.c:46
static float _conf_sprinkles(void)
Read and clamp configured sprinkles amount (%).
Definition iop/drawlayer/conf.c:155
#define DRAWLAYER_CONF_ACCEL_PROFILE
Definition iop/drawlayer/conf.c:60
#define DRAWLAYER_CONF_SPRINKLES
Definition iop/drawlayer/conf.c:38
static void _remember_display_color(dt_iop_module_t *self, const float display_rgb[3])
Push current display color to history and trigger swatch redraw.
Definition iop/drawlayer/conf.c:285
#define DRAWLAYER_CONF_SMOOTHING
Definition iop/drawlayer/conf.c:42
static float _conf_opacity(void)
Read and clamp configured stroke opacity (%).
Definition iop/drawlayer/conf.c:143
#define DRAWLAYER_CONF_MAP_PRESSURE_SOFTNESS
Definition iop/drawlayer/conf.c:49
#define DRAWLAYER_CONF_PRESSURE_PROFILE
Definition iop/drawlayer/conf.c:58
#define DRAWLAYER_CONF_MAP_TILT_FLOW
Definition iop/drawlayer/conf.c:52
static float _conf_distance(void)
Read and clamp configured distance/sampling parameter (%).
Definition iop/drawlayer/conf.c:173
#define DRAWLAYER_CONF_MAP_ACCEL_FLOW
Definition iop/drawlayer/conf.c:56
static drawlayer_pick_source_t _conf_pick_source(void)
Read and clamp color picker source selector.
Definition iop/drawlayer/conf.c:203
#define DRAWLAYER_CONF_BASE
Definition iop/drawlayer/conf.c:29
#define DRAWLAYER_CONF_MAP_ACCEL_SIZE
Definition iop/drawlayer/conf.c:54
#define DRAWLAYER_CONF_SPRINKLE_SIZE
Definition iop/drawlayer/conf.c:39
#define DRAWLAYER_CONF_MAP_PRESSURE_OPACITY
Definition iop/drawlayer/conf.c:47
#define DRAWLAYER_CONF_SIZE
Definition iop/drawlayer/conf.c:43
static void _color_history_key(const int index, const char channel, char *key, const size_t key_size)
Build config key for one color-history channel entry.
Definition iop/drawlayer/conf.c:225
static void _sync_color_picker_from_conf(dt_iop_module_t *self)
Refresh picker widgets from persisted config color.
Definition iop/drawlayer/conf.c:316
#define DRAWLAYER_CONF_FLOW
Definition iop/drawlayer/conf.c:37
#define DRAWLAYER_CONF_MAP_TILT_SOFTNESS
Definition iop/drawlayer/conf.c:53
static void _color_history_valid_key(const int index, char *key, const size_t key_size)
Build config key for one color-history validity entry.
Definition iop/drawlayer/conf.c:231
#define DRAWLAYER_CONF_TILT_PROFILE
Definition iop/drawlayer/conf.c:59
#define DRAWLAYER_CONF_MAP_ACCEL_OPACITY
Definition iop/drawlayer/conf.c:55
static void _load_color_history(dt_iop_drawlayer_gui_data_t *g)
Load persisted color-history stack from config into widgets state.
Definition iop/drawlayer/conf.c:237
#define DRAWLAYER_CONF_HDR_EV
Definition iop/drawlayer/conf.c:45
static dt_iop_drawlayer_brush_shape_t _conf_brush_shape(void)
Read and clamp configured brush shape.
Definition iop/drawlayer/conf.c:123
static void _sync_params_from_gui(dt_iop_module_t *self, const gboolean record_history)
Sync active GUI widget values back into persistent config keys.
Definition iop/drawlayer/conf.c:329
#define DRAWLAYER_CONF_MAP_PRESSURE_FLOW
Definition iop/drawlayer/conf.c:48
#define DRAWLAYER_CONF_COLOR_G
Definition iop/drawlayer/conf.c:33
static float _conf_hdr_exposure(void)
Read and clamp HDR picker exposure compensation (EV).
Definition iop/drawlayer/conf.c:197
#define DRAWLAYER_CONF_COLOR_B
Definition iop/drawlayer/conf.c:34
#define DRAWLAYER_CONF_MAP_TILT_OPACITY
Definition iop/drawlayer/conf.c:51
#define DRAWLAYER_CONF_MAP_ACCEL_SOFTNESS
Definition iop/drawlayer/conf.c:57
static float _conf_sprinkle_size(void)
Read and clamp configured sprinkle feature size (px).
Definition iop/drawlayer/conf.c:161
static dt_iop_drawlayer_brush_mode_t _conf_brush_mode(void)
Read and clamp configured brush blend mode.
Definition iop/drawlayer/conf.c:130
static void _apply_display_brush_color(dt_iop_module_t *self, const float display_rgb[3], const gboolean remember)
Apply display-space brush color to conf, widgets and redraw.
Definition iop/drawlayer/conf.c:296
#define DRAWLAYER_CONF_SOFTNESS
Definition iop/drawlayer/conf.c:35
#define DRAWLAYER_CONF_SPRINKLE_COARSENESS
Definition iop/drawlayer/conf.c:40
#define DRAWLAYER_CONF_BRUSH_SHAPE
Definition iop/drawlayer/conf.c:30
static void _store_color_history(const dt_iop_drawlayer_gui_data_t *g)
Persist current widget color-history stack into config.
Definition iop/drawlayer/conf.c:261
void dt_drawlayer_ui_cursor_clear(dt_drawlayer_ui_state_t *state)
Definition runtime.c:1148
struct dt_gui_gtk_t * gui
Definition darktable.h:702
int32_t reset
Definition gtk.h:143
dt_iop_gui_data_t * gui_data
Definition imageop.h:277