19#ifndef DT_IOP_DRAWLAYER_WORKER_H
20#define DT_IOP_DRAWLAYER_WORKER_H
52 gboolean *finish_commit_pending,
53 guint *stroke_sample_count,
54 uint32_t *current_stroke_batch);
Stroke-level path sampling and runtime-state API for drawlayer.
static const dt_iop_drawlayer_params_t * params
Shared drawlayer runtime helpers used across module/runtime files.
dt_drawlayer_worker_state_t backend_state
guint backend_queue_count
Drawlayer worker global state shared with drawlayer module.
void dt_drawlayer_worker_get_snapshot(const dt_drawlayer_worker_t *worker, dt_drawlayer_worker_snapshot_t *snapshot)
Return a thread-safe worker snapshot for runtime scheduling.
gboolean dt_drawlayer_worker_wait_idle(dt_iop_module_t *self, dt_drawlayer_worker_t *worker)
Wait until the worker queue is drained and the thread is not busy.
gboolean dt_drawlayer_worker_ensure_running(dt_iop_module_t *self, dt_drawlayer_worker_t *worker)
Ensure realtime/backend worker threads are started.
dt_drawlayer_worker_state_t
@ DT_DRAWLAYER_WORKER_STATE_STOPPED
@ DT_DRAWLAYER_WORKER_STATE_IDLE
@ DT_DRAWLAYER_WORKER_STATE_BUSY
@ DT_DRAWLAYER_WORKER_STATE_PAUSED
@ DT_DRAWLAYER_WORKER_STATE_PAUSING
void dt_drawlayer_worker_cleanup(dt_drawlayer_worker_t **worker)
Stop worker and release all resources.
void dt_drawlayer_worker_reset_backend_path(dt_drawlayer_worker_t *worker)
Reset worker-owned backend damage accumulator.
void dt_drawlayer_worker_resume(dt_iop_module_t *self, dt_drawlayer_worker_t *worker)
Resume worker processing and wake the sleeping thread.
void dt_drawlayer_worker_snapshot_params(dt_drawlayer_worker_t *worker, const dt_iop_drawlayer_params_t *params)
Flush pending events and force commit transition.
gboolean dt_drawlayer_worker_enqueue_stroke_end(dt_drawlayer_worker_t *worker, const dt_drawlayer_paint_raw_input_t *input)
Enqueue stroke-end marker carrying final raw input sample.
void dt_drawlayer_worker_init(dt_iop_module_t *self, dt_drawlayer_worker_t **worker, gboolean *painting, gboolean *finish_commit_pending, guint *stroke_sample_count, uint32_t *current_stroke_batch)
Initialize worker and bind external state mirrors.
gboolean dt_drawlayer_worker_active(const dt_drawlayer_worker_t *worker)
Query whether realtime/backend worker still has pending activity.
void dt_drawlayer_worker_pause(dt_iop_module_t *self, dt_drawlayer_worker_t *worker)
Pause worker processing once the current callback returns.
void dt_drawlayer_worker_publish_backend_stroke_damage(dt_iop_module_t *self)
Publish accumulated backend stroke damage into drawlayer process/runtime state.
void dt_drawlayer_worker_request_commit(dt_drawlayer_worker_t *worker)
Request asynchronous commit once queues become idle.
gboolean dt_drawlayer_worker_any_active(const dt_drawlayer_worker_t *worker)
Query whether any worker still has pending activity.
gboolean dt_drawlayer_worker_enqueue_input(dt_drawlayer_worker_t *worker, const dt_drawlayer_paint_raw_input_t *input)
Enqueue one raw input event (FIFO, no coalescing).
void dt_drawlayer_worker_reset_live_publish(dt_drawlayer_worker_t *worker)
Reset worker-owned transient live-publish state.
GArray * dt_drawlayer_worker_raw_inputs(dt_drawlayer_worker_t *worker)
Read-only access to preserved raw input queue for current stroke (valid only while worker is idle).
void dt_drawlayer_worker_cancel_async_commit(dt_drawlayer_worker_t *worker)
Cancel the deferred commit request state, if any.
void dt_drawlayer_worker_seal_for_commit(dt_drawlayer_worker_t *worker)
Seal current stroke for synchronous commit.
void dt_drawlayer_worker_reset_stroke(dt_drawlayer_worker_t *worker)
Clear preserved stroke runtime/history after a completed commit.
void dt_drawlayer_worker_stop(dt_iop_module_t *self, dt_drawlayer_worker_t *worker)
Stop realtime and full-resolution worker threads.