Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
runtime.h
Go to the documentation of this file.
1#ifndef DT_IOP_DRAWLAYER_RUNTIME_H
2#define DT_IOP_DRAWLAYER_RUNTIME_H
3
4#include "iop/drawlayer/cache.h" // dt_drawlayer_cache_patch_t, held by value below
8
9#ifdef HAVE_OPENCL
10#endif
11
12#include <stdint.h>
13
32
34{
39
40 /* `stroke_mask`: authoritative full-resolution stroke alpha mask aligned
41 * with `base_patch`. This stores accumulated stroke coverage in base/source
42 * coordinates and is used to pre-render brushes using flow to cap opacity. */
44 gboolean cache_valid;
45 gboolean cache_dirty;
47
48 int32_t cache_imgid;
53
54 /* Realtime partial-composite tracking (OpenCL display path).
55 *
56 * The drawlayer output cacheline is reused in place during a realtime stroke,
57 * so `last_composite_dev_out` keeps holding the previous frame's full
58 * composite. The node's global_hash is NOT stable across the stroke (the
59 * heartbeat bumps stroke_commit_hash every frame to force a re-render), so the
60 * identity gate keys on the stable base-patch layer hash
61 * (`_drawlayer_params_cache_hash`, which excludes the volatile stroke hash)
62 * plus the output buffer pointer and display geometry. When all match, only the
63 * painted sub-rect needs to be re-resampled and re-blended; the rest of the
64 * buffer is already correct. These fields record what the last full composite
65 * produced so the next frame can validate that fast path. */
71
83
110
128
130{
185
196
203
229
237
244
250
252
259
281
295
305
320
326
331
337
352
358
367
378 gboolean write_lock,
379 gboolean acquire);
382 const dt_drawlayer_runtime_host_t *host);
384 dt_drawlayer_process_state_t *headless_process,
386 dt_drawlayer_process_state_t *gui_process,
387 gboolean display_pipe,
388 dt_drawlayer_runtime_manager_t **runtime_manager,
389 dt_drawlayer_process_state_t **runtime_process,
390 gboolean *runtime_display_pipe);
392#define DT_DRAWLAYER_MAPPING_ROWS 3
394#define DT_DRAWLAYER_MAPPING_TARGETS 4
395
402
409
423
424#endif // DT_IOP_DRAWLAYER_RUNTIME_H
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
Shared coordinate transforms and geometry computations for drawlayer.
Patch/cache helpers for drawlayer process and preview buffers.
void dt_drawlayer_runtime_manager_cleanup(dt_drawlayer_runtime_manager_t *state)
Definition runtime.c:85
dt_drawlayer_runtime_raw_input_kind_t
Definition runtime.h:231
@ DT_DRAWLAYER_RUNTIME_RAW_INPUT_NONE
Definition runtime.h:232
@ DT_DRAWLAYER_RUNTIME_RAW_INPUT_STROKE_BEGIN
Definition runtime.h:234
@ DT_DRAWLAYER_RUNTIME_RAW_INPUT_STROKE_END
Definition runtime.h:235
@ DT_DRAWLAYER_RUNTIME_RAW_INPUT_SAMPLE
Definition runtime.h:233
void dt_drawlayer_mapping_rows(dt_iop_drawlayer_gui_data_t *g, dt_drawlayer_mapping_row_t rows[3])
Pair every tablet-mapping widget with the configuration key it mirrors.
#define DT_DRAWLAYER_MAPPING_ROWS
How many input axes the tablet mapping offers (pressure, tilt, acceleration).
Definition runtime.h:392
void dt_drawlayer_runtime_manager_init(dt_drawlayer_runtime_manager_t *state)
Definition runtime.c:77
dt_drawlayer_runtime_result_t dt_drawlayer_runtime_manager_update(dt_drawlayer_runtime_manager_t *state, const dt_drawlayer_runtime_update_request_t *request, const dt_drawlayer_runtime_host_t *host)
Definition runtime.c:659
dt_drawlayer_runtime_source_kind_t
Definition runtime.h:333
@ DT_DRAWLAYER_SOURCE_BASE_PATCH
Definition runtime.h:335
@ DT_DRAWLAYER_SOURCE_NONE
Definition runtime.h:334
void dt_drawlayer_process_state_reset_stroke(dt_drawlayer_process_state_t *state)
Definition runtime.c:917
void dt_drawlayer_runtime_manager_bind_piece(dt_drawlayer_runtime_manager_t *headless_manager, dt_drawlayer_process_state_t *headless_process, dt_drawlayer_runtime_manager_t *gui_manager, dt_drawlayer_process_state_t *gui_process, gboolean display_pipe, dt_drawlayer_runtime_manager_t **runtime_manager, dt_drawlayer_process_state_t **runtime_process, gboolean *runtime_display_pipe)
Definition runtime.c:885
void dt_drawlayer_process_state_init(dt_drawlayer_process_state_t *state)
Definition runtime.c:899
dt_drawlayer_runtime_actor_t
Definition runtime.h:187
@ DT_DRAWLAYER_RUNTIME_ACTOR_GUI
Definition runtime.h:189
@ DT_DRAWLAYER_RUNTIME_ACTOR_RASTER_BACKEND
Definition runtime.h:192
@ DT_DRAWLAYER_RUNTIME_ACTOR_PIPELINE_CPU
Definition runtime.h:190
@ DT_DRAWLAYER_RUNTIME_ACTOR_COUNT
Definition runtime.h:194
@ DT_DRAWLAYER_RUNTIME_ACTOR_TIFF_IO
Definition runtime.h:193
@ DT_DRAWLAYER_RUNTIME_ACTOR_NONE
Definition runtime.h:188
@ DT_DRAWLAYER_RUNTIME_ACTOR_PIPELINE_CL
Definition runtime.h:191
void dt_drawlayer_ui_cursor_clear(dt_drawlayer_ui_state_t *state)
Definition runtime.c:958
void dt_drawlayer_process_state_cleanup(dt_drawlayer_process_state_t *state)
Definition runtime.c:907
dt_drawlayer_runtime_commit_mode_t
Definition runtime.h:239
@ DT_DRAWLAYER_RUNTIME_COMMIT_HISTORY
Definition runtime.h:242
@ DT_DRAWLAYER_RUNTIME_COMMIT_QUIET
Definition runtime.h:241
@ DT_DRAWLAYER_RUNTIME_COMMIT_NONE
Definition runtime.h:240
void dt_drawlayer_process_state_invalidate(dt_drawlayer_process_state_t *state)
Definition runtime.c:924
dt_drawlayer_runtime_buffer_t
Definition runtime.h:198
@ DT_DRAWLAYER_RUNTIME_BUFFER_COUNT
Definition runtime.h:201
@ DT_DRAWLAYER_RUNTIME_BUFFER_BASE_PATCH
Definition runtime.h:199
@ DT_DRAWLAYER_RUNTIME_BUFFER_STROKE_MASK
Definition runtime.h:200
dt_drawlayer_runtime_event_t
Definition runtime.h:205
@ DT_DRAWLAYER_RUNTIME_EVENT_SIDECAR_LOAD_END
Definition runtime.h:223
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_FOCUS_GAIN
Definition runtime.h:207
@ DT_DRAWLAYER_RUNTIME_EVENT_SIDECAR_LOAD_BEGIN
Definition runtime.h:222
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_RESYNC
Definition runtime.h:214
@ DT_DRAWLAYER_RUNTIME_EVENT_PROCESS_CPU_AFTER
Definition runtime.h:219
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_SCROLL
Definition runtime.h:211
@ DT_DRAWLAYER_RUNTIME_EVENT_PROCESS_CL_BEFORE
Definition runtime.h:220
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_PIPE_FINISHED
Definition runtime.h:215
@ DT_DRAWLAYER_RUNTIME_EVENT_PROCESS_CL_AFTER
Definition runtime.h:221
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_CHANGE_IMAGE
Definition runtime.h:213
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_RAW_INPUT
Definition runtime.h:217
@ DT_DRAWLAYER_RUNTIME_EVENT_PROCESS_CPU_BEFORE
Definition runtime.h:218
@ DT_DRAWLAYER_RUNTIME_EVENT_SIDECAR_SAVE_END
Definition runtime.h:225
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_MOUSE_LEAVE
Definition runtime.h:210
@ DT_DRAWLAYER_RUNTIME_EVENT_COMMIT_BEGIN
Definition runtime.h:226
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_STROKE_ABORT
Definition runtime.h:216
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_MOUSE_ENTER
Definition runtime.h:209
@ DT_DRAWLAYER_RUNTIME_EVENT_COMMIT_END
Definition runtime.h:227
@ DT_DRAWLAYER_RUNTIME_EVENT_NONE
Definition runtime.h:206
@ DT_DRAWLAYER_RUNTIME_EVENT_SIDECAR_SAVE_BEGIN
Definition runtime.h:224
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_FOCUS_LOSS
Definition runtime.h:208
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_SYNC_TEMP_BUFFERS
Definition runtime.h:212
void dt_drawlayer_runtime_manager_note_buffer_lock(dt_drawlayer_runtime_manager_t *state, dt_drawlayer_runtime_buffer_t buffer, dt_drawlayer_runtime_actor_t actor, gboolean write_lock, gboolean acquire)
Definition runtime.c:96
#define DT_DRAWLAYER_MAPPING_TARGETS
How many brush properties each axis can drive (size, opacity, flow, hardness).
Definition runtime.h:394
#define DRAWLAYER_NAME_SIZE
const float uint32_t state[4]
unsigned __int64 uint64_t
Definition strptime.c:75
The brush as the input path needs it, resolved from conf once per change.
Definition runtime.h:93
Generic float RGBA patch stored either in malloc memory or pixel cache.
GtkWidget * map_tilt_size
Definition runtime.h:173
GtkWidget * map_tilt_softness
Definition runtime.h:176
GtkWidget * map_pressure_flow
Definition runtime.h:171
GtkWidget * map_accel_flow
Definition runtime.h:179
GtkWidget * layer_fill_row
Definition runtime.h:139
GtkWidget * image_colorpicker_source
Definition runtime.h:146
GtkWidget * sprinkle_coarseness
Definition runtime.h:154
GtkWidget * softness
Definition runtime.h:155
GtkWidget * sprinkles
Definition runtime.h:152
GtkWidget * opacity
Definition runtime.h:150
GtkWidget * brush_mode
Definition runtime.h:141
GtkWidget * preview_bg_black
Definition runtime.h:162
GtkWidget * map_pressure_opacity
Definition runtime.h:170
GtkWidget * create_background
Definition runtime.h:167
GtkWidget * smoothing
Definition runtime.h:149
GtkWidget * preview_bg_white
Definition runtime.h:160
GtkWidget * distance
Definition runtime.h:148
GtkWidget * rename_layer
Definition runtime.h:165
GtkWidget * layer_fill_title
Definition runtime.h:138
GtkWidget * create_layer
Definition runtime.h:164
GtkWidget * tilt_profile
Definition runtime.h:182
GtkWidget * map_accel_softness
Definition runtime.h:180
GtkWidget * hdr_exposure
Definition runtime.h:156
GtkWidget * layer_action_row
Definition runtime.h:137
GtkWidget * layer_status
Definition runtime.h:157
GtkWidget * color_swatch
Definition runtime.h:144
GtkWidget * preview_bg_image
Definition runtime.h:159
GtkWidget * notebook
Definition runtime.h:131
GtkWidget * brush_tab
Definition runtime.h:132
GtkWidget * color_row
Definition runtime.h:143
GtkWidget * accel_profile
Definition runtime.h:183
GtkWidget * preview_bg_grey
Definition runtime.h:161
GtkWidget * map_tilt_flow
Definition runtime.h:175
GtkWidget * delete_layer
Definition runtime.h:163
GtkWidget * layer_tab
Definition runtime.h:133
GtkWidget * pressure_profile
Definition runtime.h:181
GtkWidget * preview_title
Definition runtime.h:135
GtkWidget * map_accel_opacity
Definition runtime.h:178
GtkWidget * map_tilt_opacity
Definition runtime.h:174
GtkWidget * map_accel_size
Definition runtime.h:177
GtkWidget * preview_box
Definition runtime.h:136
GtkWidget * map_pressure_softness
Definition runtime.h:172
GtkWidget * sprinkle_size
Definition runtime.h:153
GtkWidget * brush_shape
Definition runtime.h:140
GtkWidget * map_pressure_size
Definition runtime.h:169
GtkWidget * save_layer
Definition runtime.h:168
GtkWidget * image_colorpicker
Definition runtime.h:145
GtkWidget * layer_select
Definition runtime.h:158
GtkWidget * attach_layer
Definition runtime.h:166
GtkWidget * input_tab
Definition runtime.h:134
Integer axis-aligned rectangle in buffer coordinates.
One cell of the tablet-mapping grid: a widget slot and the conf key it mirrors.
Definition runtime.h:398
One input axis: the four properties it can drive, and its response curve.
Definition runtime.h:405
dt_drawlayer_mapping_cell_t targets[4]
Definition runtime.h:406
dt_drawlayer_mapping_cell_t profile
Definition runtime.h:407
One raw pointer event queued to stroke processing.
uint64_t last_composite_layer_hash
Definition runtime.h:67
dt_drawlayer_cache_patch_t base_patch
Definition runtime.h:38
char cache_layer_name[DRAWLAYER_NAME_SIZE]
Definition runtime.h:49
dt_drawlayer_cache_patch_t stroke_mask
Definition runtime.h:43
dt_iop_roi_t last_composite_target_roi
Definition runtime.h:68
dt_drawlayer_damaged_rect_t cache_dirty_rect
Definition runtime.h:46
const dt_drawlayer_cache_patch_t * patch
Definition runtime.h:329
const dt_drawlayer_paint_raw_input_t * raw_input
Definition runtime.h:324
dt_drawlayer_runtime_request_t runtime
Definition runtime.h:323
What the runtime manager is given to reach its caller's state.
Definition runtime.h:292
const dt_drawlayer_stroke_state_t * stroke
Definition runtime.h:264
const dt_drawlayer_session_state_t * session
Definition runtime.h:262
const char * selected_layer_name
Definition runtime.h:274
const dt_drawlayer_worker_snapshot_t * worker
Definition runtime.h:265
const dt_drawlayer_cache_patch_t * base_patch
Definition runtime.h:266
const dt_drawlayer_process_state_t * process
Definition runtime.h:263
dt_drawlayer_runtime_private_t * priv
Definition runtime.h:257
dt_drawlayer_runtime_source_t * source
Definition runtime.h:356
dt_drawlayer_process_state_t * process
Definition runtime.h:355
const dt_iop_drawlayer_params_t * runtime_params
Definition runtime.h:311
dt_iop_module_t * self
Definition runtime.h:308
const dt_iop_roi_t * roi_in
Definition runtime.h:316
dt_iop_drawlayer_gui_data_t * gui
Definition runtime.h:312
const dt_dev_pixelpipe_t * pipe
Definition runtime.h:309
dt_drawlayer_process_state_t * process_state
Definition runtime.h:314
const dt_iop_roi_t * roi_out
Definition runtime.h:317
dt_dev_pixelpipe_iop_t * piece
Definition runtime.h:310
dt_drawlayer_runtime_manager_t * manager
Definition runtime.h:313
dt_drawlayer_runtime_buffer_t tracked_buffer
Definition runtime.h:348
dt_drawlayer_runtime_source_kind_t kind
Definition runtime.h:340
dt_pixel_cache_entry_t * cache_entry
Definition runtime.h:343
dt_drawlayer_process_view_t process_view
Definition runtime.h:341
dt_drawlayer_runtime_actor_t tracked_actor
Definition runtime.h:349
const dt_drawlayer_runtime_inputs_t * inputs
Definition runtime.h:363
dt_drawlayer_runtime_event_t event
Definition runtime.h:361
dt_drawlayer_runtime_release_t release
Definition runtime.h:365
dt_drawlayer_runtime_raw_input_kind_t raw_input_kind
Definition runtime.h:362
drawlayer_view_patch_t live_patch
Definition runtime.h:27
dt_drawlayer_damaged_rect_t preview_rect
Definition runtime.h:26
dt_drawlayer_damaged_rect_t live_view_rect
Definition runtime.h:24
dt_drawlayer_worker_t * worker
Definition runtime.h:74
cairo_surface_t * cursor_surface
Definition runtime.h:114
float brush_display_color[3]
Definition runtime.h:122
dt_drawlayer_widgets_t * widgets
Definition runtime.h:113
float brush_pipeline_color[3]
Definition runtime.h:123
gboolean brush_settings_valid
Definition runtime.h:126
dt_drawlayer_brush_settings_t brush_settings
Definition runtime.h:125
gboolean brush_color_valid
Definition runtime.h:124
Runtime state for drawlayer custom color widgets.
Definition widgets.c:53
Drawlayer worker global state shared with drawlayer module.
Definition worker.c:94
dt_drawlayer_controls_t controls
Definition runtime.h:303
dt_drawlayer_process_state_t process
Definition runtime.h:299
dt_drawlayer_session_state_t session
Definition runtime.h:298
dt_drawlayer_stroke_state_t stroke
Definition runtime.h:300
dt_drawlayer_runtime_manager_t manager
Definition runtime.h:301
dt_drawlayer_ui_state_t ui
Definition runtime.h:302
Region of interest passed through the pixelpipe.
Definition format.h:49
Public color-picker/history widget API for drawlayer GUI.
Background stroke worker API for drawlayer realtime painting.