Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
iop/drawlayer/conf.h
Go to the documentation of this file.
1/*
2 This file is part of the Ansel project.
3 Copyright (C) 2026 Aurélien PIERRE.
4
5 Ansel is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ansel is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ansel. If not, see <http://www.gnu.org/licenses/>.
17*/
18
27#ifndef DT_IOP_DRAWLAYER_CONF_H
28#define DT_IOP_DRAWLAYER_CONF_H
29
30#include "iop/drawlayer/brush.h" // dt_iop_drawlayer_brush_shape_t, ..._brush_mode_t
31#include "iop/drawlayer/common.h" // dt_iop_drawlayer_params_t, dt_iop_drawlayer_gui_data_t
32#include "iop/drawlayer/module.h" // drawlayer_pick_source_t, drawlayer_mapping_profile_t
33#include "develop/imageop.h" // dt_iop_module_t
34
35/* The configuration keys themselves. They are the module's published vocabulary for its
36 * brush: the GUI writes them, these accessors read them, and the tests name them. */
37#define DRAWLAYER_CONF_BASE "plugins/drawlayer/"
38#define DRAWLAYER_CONF_BRUSH_SHAPE DRAWLAYER_CONF_BASE "brush_shape"
39#define DRAWLAYER_CONF_BRUSH_MODE DRAWLAYER_CONF_BASE "brush_mode"
40#define DRAWLAYER_CONF_COLOR_R DRAWLAYER_CONF_BASE "color_r"
41#define DRAWLAYER_CONF_COLOR_G DRAWLAYER_CONF_BASE "color_g"
42#define DRAWLAYER_CONF_COLOR_B DRAWLAYER_CONF_BASE "color_b"
43#define DRAWLAYER_CONF_SOFTNESS DRAWLAYER_CONF_BASE "softness"
44#define DRAWLAYER_CONF_OPACITY DRAWLAYER_CONF_BASE "opacity"
45#define DRAWLAYER_CONF_FLOW DRAWLAYER_CONF_BASE "flow"
46#define DRAWLAYER_CONF_SPRINKLES DRAWLAYER_CONF_BASE "sprinkles"
47#define DRAWLAYER_CONF_SPRINKLE_SIZE DRAWLAYER_CONF_BASE "sprinkle_size"
48#define DRAWLAYER_CONF_SPRINKLE_COARSENESS DRAWLAYER_CONF_BASE "sprinkle_coarseness"
49#define DRAWLAYER_CONF_DISTANCE DRAWLAYER_CONF_BASE "distance"
50#define DRAWLAYER_CONF_SMOOTHING DRAWLAYER_CONF_BASE "smoothing"
51#define DRAWLAYER_CONF_SIZE DRAWLAYER_CONF_BASE "size"
52#define DRAWLAYER_CONF_PICK_SOURCE DRAWLAYER_CONF_BASE "pick_source"
53#define DRAWLAYER_CONF_HDR_EV DRAWLAYER_CONF_BASE "hdr_exposure"
54#define DRAWLAYER_CONF_MAP_PRESSURE_SIZE DRAWLAYER_CONF_BASE "map_pressure_size"
55#define DRAWLAYER_CONF_MAP_PRESSURE_OPACITY DRAWLAYER_CONF_BASE "map_pressure_opacity"
56#define DRAWLAYER_CONF_MAP_PRESSURE_FLOW DRAWLAYER_CONF_BASE "map_pressure_flow"
57#define DRAWLAYER_CONF_MAP_PRESSURE_SOFTNESS DRAWLAYER_CONF_BASE "map_pressure_softness"
58#define DRAWLAYER_CONF_MAP_TILT_SIZE DRAWLAYER_CONF_BASE "map_tilt_size"
59#define DRAWLAYER_CONF_MAP_TILT_OPACITY DRAWLAYER_CONF_BASE "map_tilt_opacity"
60#define DRAWLAYER_CONF_MAP_TILT_FLOW DRAWLAYER_CONF_BASE "map_tilt_flow"
61#define DRAWLAYER_CONF_MAP_TILT_SOFTNESS DRAWLAYER_CONF_BASE "map_tilt_softness"
62#define DRAWLAYER_CONF_MAP_ACCEL_SIZE DRAWLAYER_CONF_BASE "map_acceleration_size"
63#define DRAWLAYER_CONF_MAP_ACCEL_OPACITY DRAWLAYER_CONF_BASE "map_acceleration_opacity"
64#define DRAWLAYER_CONF_MAP_ACCEL_FLOW DRAWLAYER_CONF_BASE "map_acceleration_flow"
65#define DRAWLAYER_CONF_MAP_ACCEL_SOFTNESS DRAWLAYER_CONF_BASE "map_acceleration_hardness"
66#define DRAWLAYER_CONF_PRESSURE_PROFILE DRAWLAYER_CONF_BASE "pressure_profile"
67#define DRAWLAYER_CONF_TILT_PROFILE DRAWLAYER_CONF_BASE "tilt_profile"
68#define DRAWLAYER_CONF_ACCEL_PROFILE DRAWLAYER_CONF_BASE "acceleration_profile"
69
72
75
78
80float dt_drawlayer_conf_size(void);
81
84
86float dt_drawlayer_conf_flow(void);
87
90
93
96
99
102
105
108
111
114
117
120
122void dt_drawlayer_conf_remember_display_color(dt_iop_module_t *self, const float display_rgb[3]);
123
125void dt_drawlayer_conf_apply_display_brush_color(dt_iop_module_t *self, const float display_rgb[3], const gboolean remember);
126
129
131void dt_drawlayer_conf_sync_params_from_gui(dt_iop_module_t *self, const gboolean record_history);
132
133#endif
Dab-level brush rasterization API for drawlayer.
dt_drawlayer_brush_mode_t
Pixel blending behavior used while stamping a dab.
Definition brush.h:49
dt_drawlayer_brush_shape_t
Supported analytic fall-off profiles for brush alpha.
Definition brush.h:40
static dt_aligned_pixel_t rgb
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 (%).
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.
dt_iop_drawlayer_brush_mode_t dt_drawlayer_conf_brush_mode(void)
Read and clamp configured brush blend mode.
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 (%).
float dt_drawlayer_conf_sprinkle_size(void)
Read and clamp configured sprinkle feature size (px).
Private drawlayer module types and lightweight shared helpers.
drawlayer_mapping_profile_t
drawlayer_pick_source_t
char * key
Shared drawlayer runtime helpers used across module/runtime files.