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#pragma once
20
21#include "iop/iop_api.h"
22#include "iop/drawlayer/paint.h"
23
44
47 dt_drawlayer_worker_t **worker,
48 gboolean *painting,
49 gboolean *finish_commit_pending,
50 guint *stroke_sample_count,
51 uint32_t *current_stroke_batch);
85
Stroke-level path sampling and runtime-state API for drawlayer.
One raw pointer event queued to stroke processing.
Definition iop/drawlayer/paint.h:49
Mutable stroke runtime state owned by worker/backend code.
Definition iop/drawlayer/paint.h:100
Definition worker.h:39
dt_drawlayer_worker_state_t backend_state
Definition worker.h:40
guint backend_queue_count
Definition worker.h:41
gboolean commit_pending
Definition worker.h:42
Drawlayer worker global state shared with drawlayer module.
Definition worker.c:77
Definition imageop.h:246
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:1566
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:1556
dt_drawlayer_paint_stroke_t * dt_drawlayer_worker_stroke(dt_drawlayer_worker_t *worker)
Read-only access to preserved stroke runtime (valid only while worker is idle).
Definition worker.c:1636
dt_drawlayer_worker_state_t
Definition worker.h:31
@ DT_DRAWLAYER_WORKER_STATE_STOPPED
Definition worker.h:32
@ DT_DRAWLAYER_WORKER_STATE_IDLE
Definition worker.h:33
@ DT_DRAWLAYER_WORKER_STATE_BUSY
Definition worker.h:34
@ DT_DRAWLAYER_WORKER_STATE_PAUSED
Definition worker.h:36
@ DT_DRAWLAYER_WORKER_STATE_PAUSING
Definition worker.h:35
void dt_drawlayer_worker_cleanup(dt_drawlayer_worker_t **worker)
Stop worker and release all resources.
Definition worker.c:1539
void dt_drawlayer_worker_reset_backend_path(dt_drawlayer_worker_t *worker)
Reset worker-owned backend damage accumulator.
Definition worker.c:1603
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:1661
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:1531
void dt_drawlayer_worker_flush_pending(dt_drawlayer_worker_t *worker)
Flush pending events and force commit transition.
Definition worker.c:1592
gboolean dt_drawlayer_worker_active(const dt_drawlayer_worker_t *worker)
Query whether realtime/backend worker still has pending activity.
Definition worker.c:1545
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:355
void dt_drawlayer_worker_request_commit(dt_drawlayer_worker_t *worker)
Request asynchronous commit once queues become idle.
Definition worker.c:1582
gboolean dt_drawlayer_worker_any_active(const dt_drawlayer_worker_t *worker)
Query whether any worker still has pending activity.
Definition worker.c:1551
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:1654
void dt_drawlayer_worker_reset_live_publish(dt_drawlayer_worker_t *worker)
Reset worker-owned transient live-publish state.
Definition worker.c:1611
guint dt_drawlayer_worker_pending_dab_count(const dt_drawlayer_worker_t *worker)
Return the number of interpolated-but-not-yet-rasterized dabs in the current stroke batch.
Definition worker.c:1641
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:1630
void dt_drawlayer_worker_seal_for_commit(dt_drawlayer_worker_t *worker)
Seal current stroke for synchronous commit.
Definition worker.c:1598
void dt_drawlayer_worker_reset_stroke(dt_drawlayer_worker_t *worker)
Clear preserved stroke runtime/history after a completed commit.
Definition worker.c:1620
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:1561