![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Drawlayer configuration read/write helpers (private include unit). More...
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| static void | _ensure_gui_conf_defaults (void) |
| Ensure all drawlayer GUI config keys exist with sane defaults. | |
| static dt_iop_drawlayer_brush_shape_t | _conf_brush_shape (void) |
| Read and clamp configured brush shape. | |
| static dt_iop_drawlayer_brush_mode_t | _conf_brush_mode (void) |
| Read and clamp configured brush blend mode. | |
| static float | _conf_size (void) |
| Read and clamp configured brush size (px). | |
| static float | _conf_opacity (void) |
| Read and clamp configured stroke opacity (%). | |
| static float | _conf_flow (void) |
| Read and clamp configured flow (%). | |
| static float | _conf_sprinkles (void) |
| Read and clamp configured sprinkles amount (%). | |
| static float | _conf_sprinkle_size (void) |
| Read and clamp configured sprinkle feature size (px). | |
| static float | _conf_sprinkle_coarseness (void) |
| Read and clamp configured sprinkle octave mix (%). | |
| static float | _conf_distance (void) |
| Read and clamp configured distance/sampling parameter (%). | |
| static float | _conf_smoothing (void) |
| Read and clamp configured smoothing parameter (%). | |
| static float | _conf_softness (void) |
| Read configured softness in [0,1]. | |
| static float | _conf_hardness (void) |
| Derive hardness as complementary value of softness. | |
| static float | _conf_hdr_exposure (void) |
| Read and clamp HDR picker exposure compensation (EV). | |
| static drawlayer_pick_source_t | _conf_pick_source (void) |
| Read and clamp color picker source selector. | |
| static drawlayer_mapping_profile_t | _conf_mapping_profile (const char *key) |
| Read and clamp one mapping-profile enum key. | |
| static void | _conf_display_color (float rgb[3]) |
| Read configured display RGB brush color. | |
| 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 | _color_history_valid_key (const int index, char *key, const size_t key_size) |
| Build config key for one color-history validity entry. | |
| static void | _load_color_history (dt_iop_drawlayer_gui_data_t *g) |
| Load persisted color-history stack from config into widgets state. | |
| static void | _store_color_history (const dt_iop_drawlayer_gui_data_t *g) |
| Persist current widget color-history stack into config. | |
| 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. | |
| 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. | |
| static void | _sync_color_picker_from_conf (dt_iop_module_t *self) |
| Refresh picker widgets from persisted config color. | |
| 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. | |
Drawlayer configuration read/write helpers (private include unit).
| #define DRAWLAYER_CONF_ACCEL_PROFILE DRAWLAYER_CONF_BASE "acceleration_profile" |
| #define DRAWLAYER_CONF_BASE "plugins/drawlayer/" |
| #define DRAWLAYER_CONF_BRUSH_MODE DRAWLAYER_CONF_BASE "brush_mode" |
| #define DRAWLAYER_CONF_BRUSH_SHAPE DRAWLAYER_CONF_BASE "brush_shape" |
| #define DRAWLAYER_CONF_COLOR_B DRAWLAYER_CONF_BASE "color_b" |
| #define DRAWLAYER_CONF_COLOR_G DRAWLAYER_CONF_BASE "color_g" |
| #define DRAWLAYER_CONF_COLOR_R DRAWLAYER_CONF_BASE "color_r" |
| #define DRAWLAYER_CONF_DISTANCE DRAWLAYER_CONF_BASE "distance" |
| #define DRAWLAYER_CONF_FLOW DRAWLAYER_CONF_BASE "flow" |
| #define DRAWLAYER_CONF_HDR_EV DRAWLAYER_CONF_BASE "hdr_exposure" |
| #define DRAWLAYER_CONF_MAP_ACCEL_FLOW DRAWLAYER_CONF_BASE "map_acceleration_flow" |
| #define DRAWLAYER_CONF_MAP_ACCEL_OPACITY DRAWLAYER_CONF_BASE "map_acceleration_opacity" |
| #define DRAWLAYER_CONF_MAP_ACCEL_SIZE DRAWLAYER_CONF_BASE "map_acceleration_size" |
| #define DRAWLAYER_CONF_MAP_ACCEL_SOFTNESS DRAWLAYER_CONF_BASE "map_acceleration_hardness" |
| #define DRAWLAYER_CONF_MAP_PRESSURE_FLOW DRAWLAYER_CONF_BASE "map_pressure_flow" |
| #define DRAWLAYER_CONF_MAP_PRESSURE_OPACITY DRAWLAYER_CONF_BASE "map_pressure_opacity" |
| #define DRAWLAYER_CONF_MAP_PRESSURE_SIZE DRAWLAYER_CONF_BASE "map_pressure_size" |
| #define DRAWLAYER_CONF_MAP_PRESSURE_SOFTNESS DRAWLAYER_CONF_BASE "map_pressure_softness" |
| #define DRAWLAYER_CONF_MAP_TILT_FLOW DRAWLAYER_CONF_BASE "map_tilt_flow" |
| #define DRAWLAYER_CONF_MAP_TILT_OPACITY DRAWLAYER_CONF_BASE "map_tilt_opacity" |
| #define DRAWLAYER_CONF_MAP_TILT_SIZE DRAWLAYER_CONF_BASE "map_tilt_size" |
| #define DRAWLAYER_CONF_MAP_TILT_SOFTNESS DRAWLAYER_CONF_BASE "map_tilt_softness" |
| #define DRAWLAYER_CONF_OPACITY DRAWLAYER_CONF_BASE "opacity" |
| #define DRAWLAYER_CONF_PICK_SOURCE DRAWLAYER_CONF_BASE "pick_source" |
| #define DRAWLAYER_CONF_PRESSURE_PROFILE DRAWLAYER_CONF_BASE "pressure_profile" |
| #define DRAWLAYER_CONF_SIZE DRAWLAYER_CONF_BASE "size" |
| #define DRAWLAYER_CONF_SMOOTHING DRAWLAYER_CONF_BASE "smoothing" |
| #define DRAWLAYER_CONF_SOFTNESS DRAWLAYER_CONF_BASE "softness" |
| #define DRAWLAYER_CONF_SPRINKLE_COARSENESS DRAWLAYER_CONF_BASE "sprinkle_coarseness" |
| #define DRAWLAYER_CONF_SPRINKLE_SIZE DRAWLAYER_CONF_BASE "sprinkle_size" |
| #define DRAWLAYER_CONF_SPRINKLES DRAWLAYER_CONF_BASE "sprinkles" |
| #define DRAWLAYER_CONF_TILT_PROFILE DRAWLAYER_CONF_BASE "tilt_profile" |
|
static |
Apply display-space brush color to conf, widgets and redraw.
References _clamp01(), _remember_display_color(), DRAWLAYER_CONF_COLOR_B, DRAWLAYER_CONF_COLOR_G, DRAWLAYER_CONF_COLOR_R, dt_conf_set_float(), dt_control_queue_redraw_center(), dt_drawlayer_ui_cursor_clear(), dt_drawlayer_widgets_set_display_color(), g, and dt_iop_module_t::gui_data.
Referenced by _color_picker_set_from_position(), _color_swatch_button_press(), and color_picker_apply().
|
static |
Build config key for one color-history channel entry.
References DRAWLAYER_CONF_BASE, and key.
Referenced by _load_color_history(), and _store_color_history().
|
static |
Build config key for one color-history validity entry.
References DRAWLAYER_CONF_BASE, and key.
Referenced by _load_color_history(), and _store_color_history().
|
static |
Read and clamp configured brush blend mode.
References DRAWLAYER_CONF_BRUSH_MODE, dt_conf_get_int(), DT_DRAWLAYER_BRUSH_MODE_PAINT, and DT_DRAWLAYER_BRUSH_MODE_SMUDGE.
Referenced by _fill_input_brush_settings(), _sync_mode_sensitive_widgets(), gui_post_expose(), and gui_update().
|
static |
Read and clamp configured brush shape.
References DRAWLAYER_CONF_BRUSH_SHAPE, dt_conf_get_int(), DT_DRAWLAYER_BRUSH_SHAPE_LINEAR, and DT_DRAWLAYER_BRUSH_SHAPE_SIGMOIDAL.
Referenced by _ensure_cursor_stamp_surface(), _fill_input_brush_settings(), _sync_brush_profile_preview_widget(), _sync_mode_sensitive_widgets(), and dt_drawlayer_current_live_padding().
|
static |
Read configured display RGB brush color.
References _clamp01(), DRAWLAYER_CONF_COLOR_B, DRAWLAYER_CONF_COLOR_G, DRAWLAYER_CONF_COLOR_R, dt_conf_get_float(), and rgb.
Referenced by _ensure_cursor_stamp_surface(), _get_brush_colors(), and _sync_color_picker_from_conf().
|
static |
Read and clamp configured distance/sampling parameter (%).
References DRAWLAYER_CONF_DISTANCE, and dt_conf_get_float().
Referenced by _fill_input_brush_settings(), and gui_update().
|
static |
Read and clamp configured flow (%).
References DRAWLAYER_CONF_FLOW, and dt_conf_get_float().
Referenced by _compute_hud_brush_state(), _fill_input_brush_settings(), and gui_update().
|
static |
Derive hardness as complementary value of softness.
References _conf_softness().
Referenced by _compute_hud_brush_state(), _fill_input_brush_settings(), _sync_brush_profile_preview_widget(), dt_drawlayer_current_live_padding(), and gui_update().
|
static |
Read and clamp HDR picker exposure compensation (EV).
References DRAWLAYER_CONF_HDR_EV, and dt_conf_get_float().
Referenced by _get_brush_colors(), and gui_update().
|
static |
Read and clamp one mapping-profile enum key.
References DRAWLAYER_PROFILE_INV_QUADRATIC, DRAWLAYER_PROFILE_LINEAR, dt_conf_get_int(), and key.
Referenced by _compute_hud_brush_state(), _fill_input_brush_settings(), and gui_update().
|
static |
Read and clamp configured stroke opacity (%).
References DRAWLAYER_CONF_OPACITY, and dt_conf_get_float().
Referenced by _compute_hud_brush_state(), _fill_input_brush_settings(), _sync_brush_profile_preview_widget(), and gui_update().
|
static |
Read and clamp color picker source selector.
References DRAWLAYER_CONF_PICK_SOURCE, DRAWLAYER_PICK_SOURCE_INPUT, DRAWLAYER_PICK_SOURCE_OUTPUT, and dt_conf_get_int().
Referenced by color_picker_apply(), and gui_update().
|
static |
Read and clamp configured brush size (px).
References DRAWLAYER_CONF_SIZE, and dt_conf_get_float().
Referenced by _compute_hud_brush_state(), _fill_input_brush_settings(), dt_drawlayer_build_process_patch_from_base(), dt_drawlayer_current_live_padding(), gui_update(), and scrolled().
|
static |
Read and clamp configured smoothing parameter (%).
References DRAWLAYER_CONF_SMOOTHING, and dt_conf_get_float().
Referenced by _fill_input_brush_settings(), and gui_update().
|
static |
Read configured softness in [0,1].
References _clamp01(), DRAWLAYER_CONF_SOFTNESS, and dt_conf_get_float().
Referenced by _conf_hardness().
|
static |
Read and clamp configured sprinkle octave mix (%).
References DRAWLAYER_CONF_SPRINKLE_COARSENESS, and dt_conf_get_float().
Referenced by _fill_input_brush_settings(), _sync_brush_profile_preview_widget(), and gui_update().
|
static |
Read and clamp configured sprinkle feature size (px).
References DRAWLAYER_CONF_SPRINKLE_SIZE, and dt_conf_get_float().
Referenced by _fill_input_brush_settings(), _sync_brush_profile_preview_widget(), and gui_update().
|
static |
Read and clamp configured sprinkles amount (%).
References DRAWLAYER_CONF_SPRINKLES, and dt_conf_get_float().
Referenced by _fill_input_brush_settings(), _sync_brush_profile_preview_widget(), and gui_update().
Ensure all drawlayer GUI config keys exist with sane defaults.
References DRAWLAYER_CONF_ACCEL_PROFILE, DRAWLAYER_CONF_BASE, DRAWLAYER_CONF_BRUSH_MODE, DRAWLAYER_CONF_BRUSH_SHAPE, DRAWLAYER_CONF_COLOR_B, DRAWLAYER_CONF_COLOR_G, DRAWLAYER_CONF_COLOR_R, DRAWLAYER_CONF_DISTANCE, DRAWLAYER_CONF_FLOW, DRAWLAYER_CONF_HDR_EV, DRAWLAYER_CONF_MAP_ACCEL_FLOW, DRAWLAYER_CONF_MAP_ACCEL_OPACITY, DRAWLAYER_CONF_MAP_ACCEL_SIZE, DRAWLAYER_CONF_MAP_ACCEL_SOFTNESS, DRAWLAYER_CONF_MAP_PRESSURE_FLOW, DRAWLAYER_CONF_MAP_PRESSURE_OPACITY, DRAWLAYER_CONF_MAP_PRESSURE_SIZE, DRAWLAYER_CONF_MAP_PRESSURE_SOFTNESS, DRAWLAYER_CONF_MAP_TILT_FLOW, DRAWLAYER_CONF_MAP_TILT_OPACITY, DRAWLAYER_CONF_MAP_TILT_SIZE, DRAWLAYER_CONF_MAP_TILT_SOFTNESS, DRAWLAYER_CONF_OPACITY, DRAWLAYER_CONF_PICK_SOURCE, DRAWLAYER_CONF_PRESSURE_PROFILE, DRAWLAYER_CONF_SIZE, DRAWLAYER_CONF_SMOOTHING, DRAWLAYER_CONF_SOFTNESS, DRAWLAYER_CONF_SPRINKLE_COARSENESS, DRAWLAYER_CONF_SPRINKLE_SIZE, DRAWLAYER_CONF_SPRINKLES, DRAWLAYER_CONF_TILT_PROFILE, DRAWLAYER_PICK_SOURCE_INPUT, DRAWLAYER_PROFILE_LINEAR, dt_conf_get_bool(), dt_conf_key_exists(), dt_conf_set_bool(), dt_conf_set_float(), dt_conf_set_int(), DT_DRAWLAYER_BRUSH_MODE_PAINT, DT_DRAWLAYER_BRUSH_SHAPE_LINEAR, and FALSE.
Referenced by gui_init().
|
static |
Load persisted color-history stack from config into widgets state.
References _clamp01(), _color_history_key(), _color_history_valid_key(), dt_conf_get_bool(), dt_conf_get_float(), dt_conf_key_exists(), DT_DRAWLAYER_COLOR_HISTORY_COUNT, dt_drawlayer_widgets_set_color_history(), FALSE, g, i, and key.
Referenced by gui_init().
|
static |
Push current display color to history and trigger swatch redraw.
References _store_color_history(), dt_drawlayer_widgets_push_color_history(), g, and dt_iop_module_t::gui_data.
Referenced by _apply_display_brush_color(), and _color_picker_button_release().
|
static |
Persist current widget color-history stack into config.
References _color_history_key(), _color_history_valid_key(), dt_conf_set_bool(), dt_conf_set_float(), DT_DRAWLAYER_COLOR_HISTORY_COUNT, dt_drawlayer_widgets_get_color_history(), FALSE, g, i, and key.
Referenced by _remember_display_color().
|
static |
Refresh picker widgets from persisted config color.
References _conf_display_color(), dt_drawlayer_widgets_set_display_color(), g, and dt_iop_module_t::gui_data.
Referenced by gui_update().
|
static |
Sync active GUI widget values back into persistent config keys.
References darktable, DRAWLAYER_CONF_ACCEL_PROFILE, DRAWLAYER_CONF_BRUSH_MODE, DRAWLAYER_CONF_BRUSH_SHAPE, DRAWLAYER_CONF_DISTANCE, DRAWLAYER_CONF_FLOW, DRAWLAYER_CONF_HDR_EV, DRAWLAYER_CONF_MAP_ACCEL_FLOW, DRAWLAYER_CONF_MAP_ACCEL_OPACITY, DRAWLAYER_CONF_MAP_ACCEL_SIZE, DRAWLAYER_CONF_MAP_ACCEL_SOFTNESS, DRAWLAYER_CONF_MAP_PRESSURE_FLOW, DRAWLAYER_CONF_MAP_PRESSURE_OPACITY, DRAWLAYER_CONF_MAP_PRESSURE_SIZE, DRAWLAYER_CONF_MAP_PRESSURE_SOFTNESS, DRAWLAYER_CONF_MAP_TILT_FLOW, DRAWLAYER_CONF_MAP_TILT_OPACITY, DRAWLAYER_CONF_MAP_TILT_SIZE, DRAWLAYER_CONF_MAP_TILT_SOFTNESS, DRAWLAYER_CONF_OPACITY, DRAWLAYER_CONF_PICK_SOURCE, DRAWLAYER_CONF_PRESSURE_PROFILE, DRAWLAYER_CONF_SIZE, DRAWLAYER_CONF_SMOOTHING, DRAWLAYER_CONF_SOFTNESS, DRAWLAYER_CONF_SPRINKLE_COARSENESS, DRAWLAYER_CONF_SPRINKLE_SIZE, DRAWLAYER_CONF_SPRINKLES, DRAWLAYER_CONF_TILT_PROFILE, dt_bauhaus_combobox_get(), dt_bauhaus_slider_get(), dt_conf_set_bool(), dt_conf_set_float(), dt_conf_set_int(), dt_drawlayer_widgets_get_brush_profile_selection(), g, darktable_t::gui, dt_iop_module_t::gui_data, dt_gui_gtk_t::reset, and void().
Referenced by _brush_profile_button_press(), and _widget_changed().