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"
244 char key[128] = { 0 };
269 char key[128] = { 0 };
292 if(
g->controls.color_swatch) gtk_widget_queue_draw(
g->controls.color_swatch);
311 if(
g->controls.color) gtk_widget_queue_draw(
g->controls.color);
312 if(
g->controls.color_swatch) gtk_widget_queue_draw(
g->controls.color_swatch);
322 float display_rgb[3] = { 0.0f };
327 if(
g->controls.color_swatch) gtk_widget_queue_draw(
g->controls.color_swatch);
334 (
void)record_history;
348 if(
g->controls.image_colorpicker_source)
float dt_bauhaus_slider_get(GtkWidget *widget)
int dt_bauhaus_combobox_get(GtkWidget *widget)
dt_drawlayer_brush_mode_t
Pixel blending behavior used while stamping a dab.
@ DT_DRAWLAYER_BRUSH_MODE_PAINT
@ DT_DRAWLAYER_BRUSH_MODE_SMUDGE
dt_drawlayer_brush_shape_t
Supported analytic fall-off profiles for brush alpha.
@ DT_DRAWLAYER_BRUSH_SHAPE_SIGMOIDAL
@ DT_DRAWLAYER_BRUSH_SHAPE_LINEAR
static dt_aligned_pixel_t rgb
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
void dt_conf_set_bool(const char *name, int val)
int dt_conf_get_bool(const char *name)
int dt_conf_key_exists(const char *key)
void dt_conf_set_float(const char *name, float val)
float dt_conf_get_float(const char *name)
void dt_conf_set_int(const char *name, int val)
int dt_conf_get_int(const char *name)
void dt_control_queue_redraw_center()
request redraw of center window. This redraws the center view within a gdk critical section to preven...
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static void _sync_cached_brush_colors(dt_iop_module_t *self, const float display_rgb[3])
Cache brush colors in GUI state so stroke input snapshots don't re-transform per event.
static float _clamp01(const float v)
Clamp scalar to [0,1].
static float _conf_smoothing(void)
Read and clamp configured smoothing parameter (%).
#define DRAWLAYER_CONF_BRUSH_MODE
#define DRAWLAYER_CONF_MAP_TILT_SIZE
static void _ensure_gui_conf_defaults(void)
Ensure all drawlayer GUI config keys exist with sane defaults.
#define DRAWLAYER_CONF_COLOR_R
static float _conf_sprinkle_coarseness(void)
Read and clamp configured sprinkle octave mix (%).
static drawlayer_mapping_profile_t _conf_mapping_profile(const char *key)
Read and clamp one mapping-profile enum key.
static float _conf_hardness(void)
Derive hardness as complementary value of softness.
#define DRAWLAYER_CONF_PICK_SOURCE
#define DRAWLAYER_CONF_OPACITY
#define DRAWLAYER_CONF_DISTANCE
static float _conf_flow(void)
Read and clamp configured flow (%).
static float _conf_softness(void)
Read configured softness in [0,1].
static float _conf_size(void)
Read and clamp configured brush size (px).
static void _conf_display_color(float rgb[3])
Read configured display RGB brush color.
#define DRAWLAYER_CONF_MAP_PRESSURE_SIZE
static float _conf_sprinkles(void)
Read and clamp configured sprinkles amount (%).
#define DRAWLAYER_CONF_ACCEL_PROFILE
#define DRAWLAYER_CONF_SPRINKLES
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.
#define DRAWLAYER_CONF_SMOOTHING
static float _conf_opacity(void)
Read and clamp configured stroke opacity (%).
#define DRAWLAYER_CONF_MAP_PRESSURE_SOFTNESS
#define DRAWLAYER_CONF_PRESSURE_PROFILE
#define DRAWLAYER_CONF_MAP_TILT_FLOW
static float _conf_distance(void)
Read and clamp configured distance/sampling parameter (%).
#define DRAWLAYER_CONF_MAP_ACCEL_FLOW
static drawlayer_pick_source_t _conf_pick_source(void)
Read and clamp color picker source selector.
#define DRAWLAYER_CONF_BASE
#define DRAWLAYER_CONF_MAP_ACCEL_SIZE
#define DRAWLAYER_CONF_SPRINKLE_SIZE
#define DRAWLAYER_CONF_MAP_PRESSURE_OPACITY
#define DRAWLAYER_CONF_SIZE
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.
static void _sync_color_picker_from_conf(dt_iop_module_t *self)
Refresh picker widgets from persisted config color.
#define DRAWLAYER_CONF_FLOW
#define DRAWLAYER_CONF_MAP_TILT_SOFTNESS
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.
#define DRAWLAYER_CONF_TILT_PROFILE
#define DRAWLAYER_CONF_MAP_ACCEL_OPACITY
static void _load_color_history(dt_iop_drawlayer_gui_data_t *g)
Load persisted color-history stack from config into widgets state.
#define DRAWLAYER_CONF_HDR_EV
static dt_iop_drawlayer_brush_shape_t _conf_brush_shape(void)
Read and clamp configured brush shape.
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.
#define DRAWLAYER_CONF_MAP_PRESSURE_FLOW
#define DRAWLAYER_CONF_COLOR_G
static float _conf_hdr_exposure(void)
Read and clamp HDR picker exposure compensation (EV).
#define DRAWLAYER_CONF_COLOR_B
#define DRAWLAYER_CONF_MAP_TILT_OPACITY
#define DRAWLAYER_CONF_MAP_ACCEL_SOFTNESS
static float _conf_sprinkle_size(void)
Read and clamp configured sprinkle feature size (px).
static dt_iop_drawlayer_brush_mode_t _conf_brush_mode(void)
Read and clamp configured brush blend mode.
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.
#define DRAWLAYER_CONF_SOFTNESS
#define DRAWLAYER_CONF_SPRINKLE_COARSENESS
#define DRAWLAYER_CONF_BRUSH_SHAPE
static void _store_color_history(const dt_iop_drawlayer_gui_data_t *g)
Persist current widget color-history stack into config.
drawlayer_mapping_profile_t
@ DRAWLAYER_PROFILE_INV_QUADRATIC
@ DRAWLAYER_PROFILE_LINEAR
@ DRAWLAYER_PICK_SOURCE_INPUT
@ DRAWLAYER_PICK_SOURCE_OUTPUT
void dt_drawlayer_ui_cursor_clear(dt_drawlayer_ui_state_t *state)
struct dt_gui_gtk_t * gui
dt_iop_gui_data_t * gui_data