Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
worker.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
19#ifndef DT_IOP_DRAWLAYER_WORKER_H
20#define DT_IOP_DRAWLAYER_WORKER_H
21
22#include "iop/iop_api.h"
23#include "iop/drawlayer/common.h" // dt_iop_drawlayer_params_t
24#include "iop/drawlayer/paint.h" // dt_drawlayer_patch_t
25#include "develop/imageop.h" // dt_iop_module_t
26
47
50 dt_drawlayer_worker_t **worker,
51 gboolean *painting,
52 gboolean *finish_commit_pending,
53 guint *stroke_sample_count,
54 uint32_t *current_stroke_batch);
73
76
79
82
97
100 const dt_drawlayer_paint_raw_input_t *input);
103 const dt_drawlayer_paint_raw_input_t *input);
104#endif // DT_IOP_DRAWLAYER_WORKER_H
Stroke-level path sampling and runtime-state API for drawlayer.
static const dt_iop_drawlayer_params_t * params
Definition layers.h:80
Shared drawlayer runtime helpers used across module/runtime files.
One raw pointer event queued to stroke processing.
dt_drawlayer_worker_state_t backend_state
Definition worker.h:43
Drawlayer worker global state shared with drawlayer module.
Definition worker.c:94
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.
Definition worker.c:1737
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.
Definition worker.c:1415
gboolean dt_drawlayer_worker_ensure_running(dt_iop_module_t *self, dt_drawlayer_worker_t *worker)
Ensure realtime/backend worker threads are started.
Definition worker.c:1727
dt_drawlayer_worker_state_t
Definition worker.h:34
@ DT_DRAWLAYER_WORKER_STATE_STOPPED
Definition worker.h:35
@ DT_DRAWLAYER_WORKER_STATE_IDLE
Definition worker.h:36
@ DT_DRAWLAYER_WORKER_STATE_BUSY
Definition worker.h:37
@ DT_DRAWLAYER_WORKER_STATE_PAUSED
Definition worker.h:39
@ DT_DRAWLAYER_WORKER_STATE_PAUSING
Definition worker.h:38
void dt_drawlayer_worker_cleanup(dt_drawlayer_worker_t **worker)
Stop worker and release all resources.
Definition worker.c:1710
void dt_drawlayer_worker_reset_backend_path(dt_drawlayer_worker_t *worker)
Reset worker-owned backend damage accumulator.
Definition worker.c:1784
void dt_drawlayer_worker_resume(dt_iop_module_t *self, dt_drawlayer_worker_t *worker)
Resume worker processing and wake the sleeping thread.
Definition worker.c:1615
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.
Definition worker.c:1770
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.
Definition worker.c:1824
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.
Definition worker.c:1702
gboolean dt_drawlayer_worker_active(const dt_drawlayer_worker_t *worker)
Query whether realtime/backend worker still has pending activity.
Definition worker.c:1716
void dt_drawlayer_worker_pause(dt_iop_module_t *self, dt_drawlayer_worker_t *worker)
Pause worker processing once the current callback returns.
Definition worker.c:1600
void dt_drawlayer_worker_publish_backend_stroke_damage(dt_iop_module_t *self)
Publish accumulated backend stroke damage into drawlayer process/runtime state.
Definition worker.c:389
void dt_drawlayer_worker_request_commit(dt_drawlayer_worker_t *worker)
Request asynchronous commit once queues become idle.
Definition worker.c:1753
gboolean dt_drawlayer_worker_any_active(const dt_drawlayer_worker_t *worker)
Query whether any worker still has pending activity.
Definition worker.c:1722
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).
Definition worker.c:1817
void dt_drawlayer_worker_reset_live_publish(dt_drawlayer_worker_t *worker)
Reset worker-owned transient live-publish state.
Definition worker.c:1792
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).
Definition worker.c:1811
void dt_drawlayer_worker_cancel_async_commit(dt_drawlayer_worker_t *worker)
Cancel the deferred commit request state, if any.
Definition worker.c:1560
void dt_drawlayer_worker_seal_for_commit(dt_drawlayer_worker_t *worker)
Seal current stroke for synchronous commit.
Definition worker.c:1779
void dt_drawlayer_worker_reset_stroke(dt_drawlayer_worker_t *worker)
Clear preserved stroke runtime/history after a completed commit.
Definition worker.c:1801
void dt_drawlayer_worker_stop(dt_iop_module_t *self, dt_drawlayer_worker_t *worker)
Stop realtime and full-resolution worker threads.
Definition worker.c:1732