Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
runtime.h
Go to the documentation of this file.
1#pragma once
2
4#include "common/dtpthread.h"
7
8#ifdef HAVE_OPENCL
9#include "common/opencl.h"
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
99
101{
159
170
177
203
211
218
224
226
234
256
258
269
279
294
300
305
311
327
333
342
353 gboolean write_lock,
354 gboolean acquire);
358 gboolean active,
359 gboolean waiting,
360 guint queued);
363 const dt_drawlayer_runtime_host_t *host);
365 dt_drawlayer_process_state_t *headless_process,
367 dt_drawlayer_process_state_t *gui_process,
368 gboolean display_pipe,
369 dt_drawlayer_runtime_manager_t **runtime_manager,
370 dt_drawlayer_process_state_t **runtime_process,
371 gboolean *runtime_display_pipe);
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
Shared coordinate transforms and geometry computations for drawlayer.
void dt_drawlayer_runtime_manager_cleanup(dt_drawlayer_runtime_manager_t *state)
Definition runtime.c:84
dt_drawlayer_runtime_raw_input_kind_t
Definition runtime.h:205
@ DT_DRAWLAYER_RUNTIME_RAW_INPUT_NONE
Definition runtime.h:206
@ DT_DRAWLAYER_RUNTIME_RAW_INPUT_STROKE_BEGIN
Definition runtime.h:208
@ DT_DRAWLAYER_RUNTIME_RAW_INPUT_STROKE_END
Definition runtime.h:209
@ DT_DRAWLAYER_RUNTIME_RAW_INPUT_SAMPLE
Definition runtime.h:207
void dt_drawlayer_runtime_manager_note_sidecar_io(dt_drawlayer_runtime_manager_t *state, gboolean active)
Definition runtime.c:124
void dt_drawlayer_runtime_manager_init(dt_drawlayer_runtime_manager_t *state)
Definition runtime.c:76
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:686
dt_drawlayer_runtime_source_kind_t
Definition runtime.h:307
@ DT_DRAWLAYER_SOURCE_BASE_PATCH
Definition runtime.h:309
@ DT_DRAWLAYER_SOURCE_NONE
Definition runtime.h:308
void dt_drawlayer_process_state_reset_stroke(dt_drawlayer_process_state_t *state)
Definition runtime.c:944
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:912
void dt_drawlayer_runtime_manager_note_thread(dt_drawlayer_runtime_manager_t *state, dt_drawlayer_runtime_actor_t actor, gboolean active, gboolean waiting, guint queued)
Definition runtime.c:135
void dt_drawlayer_process_state_init(dt_drawlayer_process_state_t *state)
Definition runtime.c:926
dt_drawlayer_runtime_actor_t
Definition runtime.h:161
@ DT_DRAWLAYER_RUNTIME_ACTOR_GUI
Definition runtime.h:163
@ DT_DRAWLAYER_RUNTIME_ACTOR_RASTER_BACKEND
Definition runtime.h:166
@ DT_DRAWLAYER_RUNTIME_ACTOR_PIPELINE_CPU
Definition runtime.h:164
@ DT_DRAWLAYER_RUNTIME_ACTOR_COUNT
Definition runtime.h:168
@ DT_DRAWLAYER_RUNTIME_ACTOR_TIFF_IO
Definition runtime.h:167
@ DT_DRAWLAYER_RUNTIME_ACTOR_NONE
Definition runtime.h:162
@ DT_DRAWLAYER_RUNTIME_ACTOR_PIPELINE_CL
Definition runtime.h:165
void dt_drawlayer_ui_cursor_clear(dt_drawlayer_ui_state_t *state)
Definition runtime.c:985
void dt_drawlayer_process_state_cleanup(dt_drawlayer_process_state_t *state)
Definition runtime.c:934
struct dt_drawlayer_runtime_action_request_t dt_drawlayer_runtime_action_request_t
Definition runtime.h:257
dt_drawlayer_runtime_commit_mode_t
Definition runtime.h:213
@ DT_DRAWLAYER_RUNTIME_COMMIT_HISTORY
Definition runtime.h:216
@ DT_DRAWLAYER_RUNTIME_COMMIT_QUIET
Definition runtime.h:215
@ DT_DRAWLAYER_RUNTIME_COMMIT_NONE
Definition runtime.h:214
void dt_drawlayer_process_state_invalidate(dt_drawlayer_process_state_t *state)
Definition runtime.c:951
dt_drawlayer_runtime_buffer_t
Definition runtime.h:172
@ DT_DRAWLAYER_RUNTIME_BUFFER_COUNT
Definition runtime.h:175
@ DT_DRAWLAYER_RUNTIME_BUFFER_BASE_PATCH
Definition runtime.h:173
@ DT_DRAWLAYER_RUNTIME_BUFFER_STROKE_MASK
Definition runtime.h:174
dt_drawlayer_runtime_event_t
Definition runtime.h:179
@ DT_DRAWLAYER_RUNTIME_EVENT_SIDECAR_LOAD_END
Definition runtime.h:197
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_FOCUS_GAIN
Definition runtime.h:181
@ DT_DRAWLAYER_RUNTIME_EVENT_SIDECAR_LOAD_BEGIN
Definition runtime.h:196
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_RESYNC
Definition runtime.h:188
@ DT_DRAWLAYER_RUNTIME_EVENT_PROCESS_CPU_AFTER
Definition runtime.h:193
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_SCROLL
Definition runtime.h:185
@ DT_DRAWLAYER_RUNTIME_EVENT_PROCESS_CL_BEFORE
Definition runtime.h:194
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_PIPE_FINISHED
Definition runtime.h:189
@ DT_DRAWLAYER_RUNTIME_EVENT_PROCESS_CL_AFTER
Definition runtime.h:195
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_CHANGE_IMAGE
Definition runtime.h:187
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_RAW_INPUT
Definition runtime.h:191
@ DT_DRAWLAYER_RUNTIME_EVENT_PROCESS_CPU_BEFORE
Definition runtime.h:192
@ DT_DRAWLAYER_RUNTIME_EVENT_SIDECAR_SAVE_END
Definition runtime.h:199
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_MOUSE_LEAVE
Definition runtime.h:184
@ DT_DRAWLAYER_RUNTIME_EVENT_COMMIT_BEGIN
Definition runtime.h:200
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_STROKE_ABORT
Definition runtime.h:190
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_MOUSE_ENTER
Definition runtime.h:183
@ DT_DRAWLAYER_RUNTIME_EVENT_COMMIT_END
Definition runtime.h:201
@ DT_DRAWLAYER_RUNTIME_EVENT_NONE
Definition runtime.h:180
@ DT_DRAWLAYER_RUNTIME_EVENT_SIDECAR_SAVE_BEGIN
Definition runtime.h:198
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_FOCUS_LOSS
Definition runtime.h:182
@ DT_DRAWLAYER_RUNTIME_EVENT_GUI_SYNC_TEMP_BUFFERS
Definition runtime.h:186
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:95
struct _GtkWidget GtkWidget
Definition splash.h:29
const float uint32_t state[4]
#define DRAWLAYER_NAME_SIZE
unsigned __int64 uint64_t
Definition strptime.c:75
Generic float RGBA patch stored either in malloc memory or pixel cache.
GtkWidget * map_tilt_size
Definition runtime.h:147
GtkWidget * map_tilt_softness
Definition runtime.h:150
GtkWidget * map_pressure_flow
Definition runtime.h:145
GtkWidget * map_accel_flow
Definition runtime.h:153
GtkWidget * layer_fill_row
Definition runtime.h:110
GtkWidget * image_colorpicker_source
Definition runtime.h:117
GtkWidget * sprinkle_coarseness
Definition runtime.h:125
GtkWidget * softness
Definition runtime.h:126
GtkWidget * sprinkles
Definition runtime.h:123
GtkWidget * opacity
Definition runtime.h:121
GtkWidget * brush_mode
Definition runtime.h:112
GtkWidget * preview_bg_black
Definition runtime.h:133
GtkWidget * map_pressure_opacity
Definition runtime.h:144
GtkWidget * create_background
Definition runtime.h:138
GtkWidget * smoothing
Definition runtime.h:120
GtkWidget * preview_bg_white
Definition runtime.h:131
GtkWidget * distance
Definition runtime.h:119
GtkWidget * rename_layer
Definition runtime.h:136
GtkWidget * layer_fill_title
Definition runtime.h:109
GtkWidget * create_layer
Definition runtime.h:135
GtkWidget * tilt_profile
Definition runtime.h:156
GtkWidget * map_accel_softness
Definition runtime.h:154
GtkWidget * hdr_exposure
Definition runtime.h:127
GtkWidget * fill_white
Definition runtime.h:140
GtkWidget * layer_action_row
Definition runtime.h:108
GtkWidget * layer_status
Definition runtime.h:128
GtkWidget * color_swatch
Definition runtime.h:115
GtkWidget * preview_bg_image
Definition runtime.h:130
GtkWidget * notebook
Definition runtime.h:102
GtkWidget * brush_tab
Definition runtime.h:103
GtkWidget * color_row
Definition runtime.h:114
GtkWidget * accel_profile
Definition runtime.h:157
GtkWidget * preview_bg_grey
Definition runtime.h:132
GtkWidget * map_tilt_flow
Definition runtime.h:149
GtkWidget * fill_transparent
Definition runtime.h:142
GtkWidget * fill_black
Definition runtime.h:141
GtkWidget * delete_layer
Definition runtime.h:134
GtkWidget * layer_tab
Definition runtime.h:104
GtkWidget * pressure_profile
Definition runtime.h:155
GtkWidget * preview_title
Definition runtime.h:106
GtkWidget * map_accel_opacity
Definition runtime.h:152
GtkWidget * map_tilt_opacity
Definition runtime.h:148
GtkWidget * map_accel_size
Definition runtime.h:151
GtkWidget * preview_box
Definition runtime.h:107
GtkWidget * map_pressure_softness
Definition runtime.h:146
GtkWidget * sprinkle_size
Definition runtime.h:124
GtkWidget * brush_shape
Definition runtime.h:111
GtkWidget * map_pressure_size
Definition runtime.h:143
GtkWidget * save_layer
Definition runtime.h:139
GtkWidget * image_colorpicker
Definition runtime.h:116
GtkWidget * layer_select
Definition runtime.h:129
GtkWidget * attach_layer
Definition runtime.h:137
GtkWidget * input_tab
Definition runtime.h:105
Integer axis-aligned rectangle in buffer coordinates.
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:303
const dt_drawlayer_paint_raw_input_t * raw_input
Definition runtime.h:298
dt_drawlayer_runtime_request_t runtime
Definition runtime.h:297
gboolean(* perform_action)(void *user_data, const dt_drawlayer_runtime_action_request_t *action, dt_drawlayer_runtime_result_t *result)
Definition runtime.h:265
void(* collect_inputs)(void *user_data, dt_drawlayer_runtime_inputs_t *inputs, dt_drawlayer_worker_snapshot_t *worker_snapshot)
Definition runtime.h:262
const dt_drawlayer_stroke_state_t * stroke
Definition runtime.h:239
const dt_drawlayer_session_state_t * session
Definition runtime.h:237
const char * selected_layer_name
Definition runtime.h:249
const dt_drawlayer_worker_snapshot_t * worker
Definition runtime.h:240
const dt_drawlayer_cache_patch_t * base_patch
Definition runtime.h:241
const dt_drawlayer_process_state_t * process
Definition runtime.h:238
dt_drawlayer_runtime_private_t * priv
Definition runtime.h:232
dt_drawlayer_runtime_source_t * source
Definition runtime.h:331
dt_drawlayer_process_state_t * process
Definition runtime.h:330
const dt_iop_drawlayer_params_t * runtime_params
Definition runtime.h:285
dt_iop_module_t * self
Definition runtime.h:282
const dt_iop_roi_t * roi_in
Definition runtime.h:290
dt_iop_drawlayer_gui_data_t * gui
Definition runtime.h:286
const dt_dev_pixelpipe_t * pipe
Definition runtime.h:283
dt_drawlayer_process_state_t * process_state
Definition runtime.h:288
const dt_iop_roi_t * roi_out
Definition runtime.h:291
dt_dev_pixelpipe_iop_t * piece
Definition runtime.h:284
dt_drawlayer_runtime_manager_t * manager
Definition runtime.h:287
dt_drawlayer_runtime_buffer_t tracked_buffer
Definition runtime.h:323
dt_drawlayer_runtime_source_kind_t kind
Definition runtime.h:314
dt_pixel_cache_entry_t * cache_entry
Definition runtime.h:317
dt_drawlayer_process_view_t process_view
Definition runtime.h:315
dt_drawlayer_runtime_actor_t tracked_actor
Definition runtime.h:324
const dt_drawlayer_runtime_inputs_t * inputs
Definition runtime.h:338
dt_drawlayer_runtime_event_t event
Definition runtime.h:336
dt_drawlayer_runtime_release_t release
Definition runtime.h:340
dt_drawlayer_runtime_raw_input_kind_t raw_input_kind
Definition runtime.h:337
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:87
float brush_display_color[3]
Definition runtime.h:95
dt_drawlayer_widgets_t * widgets
Definition runtime.h:86
float brush_pipeline_color[3]
Definition runtime.h:96
gboolean brush_color_valid
Definition runtime.h:97
Runtime state for drawlayer custom color widgets.
Definition widgets.c:51
Drawlayer worker global state shared with drawlayer module.
Definition worker.c:77
dt_drawlayer_controls_t controls
Definition runtime.h:277
dt_drawlayer_process_state_t process
Definition runtime.h:273
dt_drawlayer_session_state_t session
Definition runtime.h:272
dt_drawlayer_stroke_state_t stroke
Definition runtime.h:274
dt_drawlayer_runtime_manager_t manager
Definition runtime.h:275
dt_drawlayer_ui_state_t ui
Definition runtime.h:276
Region of interest passed through the pixelpipe.
Definition imageop.h:72
Public color-picker/history widget API for drawlayer GUI.
Background stroke worker API for drawlayer realtime painting.