Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
conf.c File Reference

Drawlayer configuration read/write helpers (private include unit). More...

+ Include dependency graph for iop/drawlayer/conf.c:

Go to the source code of this file.

Functions

void dt_drawlayer_conf_ensure_defaults (void)
 Ensure all drawlayer GUI config keys exist with sane defaults.
 
dt_iop_drawlayer_brush_shape_t dt_drawlayer_conf_brush_shape (void)
 Read and clamp configured brush shape.
 
dt_iop_drawlayer_brush_mode_t dt_drawlayer_conf_brush_mode (void)
 Read and clamp configured brush blend mode.
 
float dt_drawlayer_conf_size (void)
 Read and clamp configured brush size (px).
 
float dt_drawlayer_conf_opacity (void)
 Read and clamp configured stroke opacity (%).
 
float dt_drawlayer_conf_flow (void)
 Read and clamp configured flow (%).
 
float dt_drawlayer_conf_sprinkles (void)
 Read and clamp configured sprinkles amount (%).
 
float dt_drawlayer_conf_sprinkle_size (void)
 Read and clamp configured sprinkle feature size (px).
 
float dt_drawlayer_conf_sprinkle_coarseness (void)
 Read and clamp configured sprinkle octave mix (%).
 
float dt_drawlayer_conf_distance (void)
 Read and clamp configured distance/sampling parameter (%).
 
float dt_drawlayer_conf_smoothing (void)
 Read and clamp configured smoothing parameter (%).
 
static float _conf_softness (void)
 Read configured softness in [0,1].
 
float dt_drawlayer_conf_hardness (void)
 Derive hardness as complementary value of softness.
 
float dt_drawlayer_conf_hdr_exposure (void)
 Read and clamp HDR picker exposure compensation (EV).
 
drawlayer_pick_source_t dt_drawlayer_conf_pick_source (void)
 Read and clamp color picker source selector.
 
drawlayer_mapping_profile_t dt_drawlayer_conf_mapping_profile (const char *key)
 Read and clamp one mapping-profile enum key.
 
void dt_drawlayer_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.
 
void dt_drawlayer_conf_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.
 
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_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.
 
void dt_drawlayer_conf_sync_color_picker (dt_iop_module_t *self)
 Refresh picker widgets from persisted config color.
 
void dt_drawlayer_mapping_rows (dt_iop_drawlayer_gui_data_t *g, dt_drawlayer_mapping_row_t rows[DT_DRAWLAYER_MAPPING_ROWS])
 
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.
 

Detailed Description

Drawlayer configuration read/write helpers (private include unit).

Definition in file iop/drawlayer/conf.c.

Function Documentation

◆ _color_history_key()

static void _color_history_key ( const int  index,
const char  channel,
char *  key,
const size_t  key_size 
)
static

Build config key for one color-history channel entry.

Definition at line 204 of file iop/drawlayer/conf.c.

References DRAWLAYER_CONF_BASE, and key.

Referenced by _store_color_history(), and dt_drawlayer_conf_load_color_history().

◆ _color_history_valid_key()

static void _color_history_valid_key ( const int  index,
char *  key,
const size_t  key_size 
)
static

Build config key for one color-history validity entry.

Definition at line 210 of file iop/drawlayer/conf.c.

References DRAWLAYER_CONF_BASE, and key.

Referenced by _store_color_history(), and dt_drawlayer_conf_load_color_history().

◆ _conf_softness()

static float _conf_softness ( void  )
static

Read configured softness in [0,1].

Definition at line 164 of file iop/drawlayer/conf.c.

References _clamp01(), DRAWLAYER_CONF_SOFTNESS, and dt_conf_get_float().

Referenced by dt_drawlayer_conf_hardness().

◆ _store_color_history()

static void _store_color_history ( const dt_iop_drawlayer_gui_data_t *  g)
static

◆ dt_drawlayer_conf_apply_display_brush_color()

◆ dt_drawlayer_conf_brush_mode()

◆ dt_drawlayer_conf_brush_shape()

◆ dt_drawlayer_conf_display_color()

void dt_drawlayer_conf_display_color ( float  rgb[3])

◆ dt_drawlayer_conf_distance()

float dt_drawlayer_conf_distance ( void  )

Read and clamp configured distance/sampling parameter (%).

Definition at line 152 of file iop/drawlayer/conf.c.

References DRAWLAYER_CONF_DISTANCE, and dt_conf_get_float().

Referenced by _fill_input_brush_settings(), _refresh_brush_settings_cache(), and gui_update().

◆ dt_drawlayer_conf_ensure_defaults()

◆ dt_drawlayer_conf_flow()

float dt_drawlayer_conf_flow ( void  )

Read and clamp configured flow (%).

Definition at line 128 of file iop/drawlayer/conf.c.

References DRAWLAYER_CONF_FLOW, and dt_conf_get_float().

Referenced by _compute_hud_brush_state(), _fill_input_brush_settings(), _refresh_brush_settings_cache(), and gui_update().

◆ dt_drawlayer_conf_hardness()

float dt_drawlayer_conf_hardness ( void  )

Derive hardness as complementary value of softness.

Definition at line 170 of file iop/drawlayer/conf.c.

References _conf_softness().

Referenced by _compute_hud_brush_state(), _fill_input_brush_settings(), _refresh_brush_settings_cache(), _sync_brush_profile_preview_widget(), and gui_update().

◆ dt_drawlayer_conf_hdr_exposure()

float dt_drawlayer_conf_hdr_exposure ( void  )

Read and clamp HDR picker exposure compensation (EV).

Definition at line 176 of file iop/drawlayer/conf.c.

References DRAWLAYER_CONF_HDR_EV, and dt_conf_get_float().

Referenced by _brush_pipeline_color_from_display(), _working_rgb_to_display_rgb(), and gui_update().

◆ dt_drawlayer_conf_load_color_history()

void dt_drawlayer_conf_load_color_history ( dt_iop_drawlayer_gui_data_t *  g)

◆ dt_drawlayer_conf_mapping_profile()

drawlayer_mapping_profile_t dt_drawlayer_conf_mapping_profile ( const char *  key)

◆ dt_drawlayer_conf_opacity()

float dt_drawlayer_conf_opacity ( void  )

◆ dt_drawlayer_conf_pick_source()

drawlayer_pick_source_t dt_drawlayer_conf_pick_source ( void  )

Read and clamp color picker source selector.

Definition at line 182 of file iop/drawlayer/conf.c.

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().

◆ dt_drawlayer_conf_remember_display_color()

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.

Definition at line 264 of file iop/drawlayer/conf.c.

References _store_color_history(), dt_drawlayer_widgets_push_color_history(), dt_iop_gui_data(), g, and IS_NULL_PTR.

Referenced by _color_picker_button_release(), and dt_drawlayer_conf_apply_display_brush_color().

◆ dt_drawlayer_conf_size()

float dt_drawlayer_conf_size ( void  )

◆ dt_drawlayer_conf_smoothing()

float dt_drawlayer_conf_smoothing ( void  )

Read and clamp configured smoothing parameter (%).

Definition at line 158 of file iop/drawlayer/conf.c.

References DRAWLAYER_CONF_SMOOTHING, and dt_conf_get_float().

Referenced by _fill_input_brush_settings(), _refresh_brush_settings_cache(), and gui_update().

◆ dt_drawlayer_conf_sprinkle_coarseness()

float dt_drawlayer_conf_sprinkle_coarseness ( void  )

Read and clamp configured sprinkle octave mix (%).

Definition at line 146 of file iop/drawlayer/conf.c.

References DRAWLAYER_CONF_SPRINKLE_COARSENESS, and dt_conf_get_float().

Referenced by _fill_input_brush_settings(), _refresh_brush_settings_cache(), _sync_brush_profile_preview_widget(), and gui_update().

◆ dt_drawlayer_conf_sprinkle_size()

float dt_drawlayer_conf_sprinkle_size ( void  )

Read and clamp configured sprinkle feature size (px).

Definition at line 140 of file iop/drawlayer/conf.c.

References DRAWLAYER_CONF_SPRINKLE_SIZE, and dt_conf_get_float().

Referenced by _fill_input_brush_settings(), _refresh_brush_settings_cache(), _sync_brush_profile_preview_widget(), and gui_update().

◆ dt_drawlayer_conf_sprinkles()

float dt_drawlayer_conf_sprinkles ( void  )

Read and clamp configured sprinkles amount (%).

Definition at line 134 of file iop/drawlayer/conf.c.

References DRAWLAYER_CONF_SPRINKLES, and dt_conf_get_float().

Referenced by _fill_input_brush_settings(), _refresh_brush_settings_cache(), _sync_brush_profile_preview_widget(), and gui_update().

◆ dt_drawlayer_conf_sync_color_picker()

void dt_drawlayer_conf_sync_color_picker ( dt_iop_module_t *  self)

Refresh picker widgets from persisted config color.

Definition at line 297 of file iop/drawlayer/conf.c.

References dt_drawlayer_conf_display_color(), dt_drawlayer_sync_cached_brush_colors(), dt_drawlayer_widgets_set_display_color(), dt_iop_gui_data(), g, and IS_NULL_PTR.

Referenced by gui_update().

◆ dt_drawlayer_conf_sync_params_from_gui()

◆ dt_drawlayer_mapping_rows()