223 char key[128] = { 0 };
248 char key[128] = { 0 };
271 if(
g->controls.color_swatch) gtk_widget_queue_draw(
g->controls.color_swatch);
291 if(
g->controls.color) gtk_widget_queue_draw(
g->controls.color);
292 if(
g->controls.color_swatch) gtk_widget_queue_draw(
g->controls.color_swatch);
302 float display_rgb[3] = { 0.0f };
307 if(
g->controls.color_swatch) gtk_widget_queue_draw(
g->controls.color_swatch);
343 (
void)record_history;
359 if(
g->controls.image_colorpicker_source)
371 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(*mapping[
r].targets[c].widget)));
372 if(*mapping[
r].profile.widget)
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
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
static dt_aligned_pixel_t rgb
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)
Does key have a value?
void dt_conf_set_float(const char *name, float val)
float dt_conf_get_float(const char *name)
Float for name, clamped to its declared bounds.
void dt_conf_set_int(const char *name, int val)
int dt_conf_get_int(const char *name)
Integer for name, clamped to the bounds declared in the XML.
void dt_control_queue_redraw_center()
Request a redraw of the centre view.
struct dt_gui_gtk_t * dt_gui_get_global(void)
void dt_drawlayer_invalidate_brush_settings_cache(dt_iop_drawlayer_gui_data_t *g)
void dt_drawlayer_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 dt_iop_gui_data_t * dt_iop_gui_data(const struct dt_iop_module_t *m)
The module's GUI data blob, NULL-safe for headless callers: IOP process() implementations read it for...
static float _clamp01(const float v)
Clamp scalar to [0,1].
void dt_drawlayer_conf_remember_display_color(dt_iop_module_t *self, const float display_rgb[3])
Push current display color to history and trigger swatch redraw.
void dt_drawlayer_conf_sync_params_from_gui(dt_iop_module_t *self, const gboolean record_history)
Sync active GUI widget values back into persistent config keys.
float dt_drawlayer_conf_hardness(void)
Derive hardness as complementary value of softness.
drawlayer_pick_source_t dt_drawlayer_conf_pick_source(void)
Read and clamp color picker source selector.
float dt_drawlayer_conf_sprinkle_coarseness(void)
Read and clamp configured sprinkle octave mix (%).
static float _conf_softness(void)
Read configured softness in [0,1].
float dt_drawlayer_conf_smoothing(void)
Read and clamp configured smoothing parameter (%).
drawlayer_mapping_profile_t dt_drawlayer_conf_mapping_profile(const char *key)
Read and clamp one mapping-profile enum key.
void dt_drawlayer_conf_ensure_defaults(void)
Ensure all drawlayer GUI config keys exist with sane defaults.
void dt_drawlayer_conf_display_color(float rgb[3])
Read configured display RGB brush color.
float dt_drawlayer_conf_hdr_exposure(void)
Read and clamp HDR picker exposure compensation (EV).
dt_iop_drawlayer_brush_shape_t dt_drawlayer_conf_brush_shape(void)
Read and clamp configured brush shape.
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.
dt_iop_drawlayer_brush_mode_t dt_drawlayer_conf_brush_mode(void)
Read and clamp configured brush blend mode.
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.
float dt_drawlayer_conf_sprinkles(void)
Read and clamp configured sprinkles amount (%).
void dt_drawlayer_conf_load_color_history(dt_iop_drawlayer_gui_data_t *g)
Load persisted color-history stack from config into widgets state.
void dt_drawlayer_conf_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.
float dt_drawlayer_conf_opacity(void)
Read and clamp configured stroke opacity (%).
float dt_drawlayer_conf_size(void)
Read and clamp configured brush size (px).
void dt_drawlayer_conf_sync_color_picker(dt_iop_module_t *self)
Refresh picker widgets from persisted config color.
float dt_drawlayer_conf_flow(void)
Read and clamp configured flow (%).
float dt_drawlayer_conf_distance(void)
Read and clamp configured distance/sampling parameter (%).
void dt_drawlayer_mapping_rows(dt_iop_drawlayer_gui_data_t *g, dt_drawlayer_mapping_row_t rows[DT_DRAWLAYER_MAPPING_ROWS])
float dt_drawlayer_conf_sprinkle_size(void)
Read and clamp configured sprinkle feature size (px).
static void _store_color_history(const dt_iop_drawlayer_gui_data_t *g)
Persist current widget color-history stack into config.
The brush settings the drawlayer module keeps in the application configuration.
#define DRAWLAYER_CONF_BRUSH_MODE
#define DRAWLAYER_CONF_MAP_TILT_SIZE
#define DRAWLAYER_CONF_COLOR_R
#define DRAWLAYER_CONF_PICK_SOURCE
#define DRAWLAYER_CONF_OPACITY
#define DRAWLAYER_CONF_DISTANCE
#define DRAWLAYER_CONF_MAP_PRESSURE_SIZE
#define DRAWLAYER_CONF_ACCEL_PROFILE
#define DRAWLAYER_CONF_SPRINKLES
#define DRAWLAYER_CONF_SMOOTHING
#define DRAWLAYER_CONF_MAP_PRESSURE_SOFTNESS
#define DRAWLAYER_CONF_PRESSURE_PROFILE
#define DRAWLAYER_CONF_MAP_TILT_FLOW
#define DRAWLAYER_CONF_MAP_ACCEL_FLOW
#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
#define DRAWLAYER_CONF_FLOW
#define DRAWLAYER_CONF_MAP_TILT_SOFTNESS
#define DRAWLAYER_CONF_TILT_PROFILE
#define DRAWLAYER_CONF_MAP_ACCEL_OPACITY
#define DRAWLAYER_CONF_HDR_EV
#define DRAWLAYER_CONF_MAP_PRESSURE_FLOW
#define DRAWLAYER_CONF_COLOR_G
#define DRAWLAYER_CONF_COLOR_B
#define DRAWLAYER_CONF_MAP_TILT_OPACITY
#define DRAWLAYER_CONF_MAP_ACCEL_SOFTNESS
#define DRAWLAYER_CONF_SOFTNESS
#define DRAWLAYER_CONF_SPRINKLE_COARSENESS
#define DRAWLAYER_CONF_BRUSH_SHAPE
drawlayer_mapping_profile_t
@ DRAWLAYER_PROFILE_INV_QUADRATIC
@ DRAWLAYER_PROFILE_LINEAR
@ DRAWLAYER_PICK_SOURCE_INPUT
@ DRAWLAYER_PICK_SOURCE_OUTPUT
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
Asking the interface to repaint itself.
void dt_drawlayer_ui_cursor_clear(dt_drawlayer_ui_state_t *state)
Private runtime state/helpers shared by drawlayer module entrypoints.
#define DT_DRAWLAYER_MAPPING_ROWS
How many input axes the tablet mapping offers (pressure, tilt, acceleration).
#define DT_DRAWLAYER_MAPPING_TARGETS
How many brush properties each axis can drive (size, opacity, flow, hardness).
One input axis: the four properties it can drive, and its response curve.