Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
dev_pixelpipe.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#pragma once
19
20#include <inttypes.h>
21#include <stdint.h>
22#include <glib.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28
30// Force a full rebuild of the pipe, needed when module order is changed.
31// Resync the full history, which may be expensive.
32// Pixelpipe cache will need to be flushed too when this is called,
33// for raster masks to work properly.
34#define dt_dev_pixelpipe_rebuild_all(dev) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_rebuild_all_real, (dev))
35
37// Invalidate the main image preview in darkroom, resync only the last history item(s)
38// with pipeline nodes.
39// This is the most common usecase when interacting with modules and masks.
40#define dt_dev_pixelpipe_update_history_main(dev) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_history_main_real, (dev))
41
43// Invalidate the thumbnail preview in darkroom, resync only the last history item.
44#define dt_dev_pixelpipe_update_history_preview(dev) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_history_preview_real, (dev))
45
47// Invalidate the main image and the thumbnail in darkroom, resync only the last history item.
48#define dt_dev_pixelpipe_update_history_all(dev) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_history_all_real, (dev))
49
51// Invalidate the main image preview in darkroom.
52// This doesn't resync history at all, only update the coordinates of the region of interest (ROI).
53#define dt_dev_pixelpipe_update_zoom_main(dev) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_zoom_main_real, (dev))
54
56// Invalidate the preview in darkroom.
57// This doesn't resync history at all, only update the coordinates of the region of interest (ROI).
58#define dt_dev_pixelpipe_update_zoom_preview(dev) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_update_zoom_preview_real, (dev))
59
61// Invalidate the main image and the thumbnail in darkroom.
62// Resync the whole history with the pipeline nodes, which may be expensive.
63#define dt_dev_pixelpipe_resync_history_all(dev) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_resync_history_all_real, (dev))
64
66// Invalidate the main image in darkroom.
67// Resync the whole history with the pipeline nodes, which may be expensive.
68#define dt_dev_pixelpipe_resync_history_main(dev) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_resync_history_main_real, (dev))
69
71// Invalidate the thumbnail in darkroom.
72// Resync the whole history with the pipeline nodes, which may be expensive.
73#define dt_dev_pixelpipe_resync_history_preview(dev) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_pixelpipe_resync_history_preview_real, (dev))
74
75// Flush caches of dev pipes and force a full recompute
77
78// Queue a pipeline ROI change and reprocess the main image pipeline.
80
81// returns the dimensions of a virtual image of size (width_in, height_in) image after processing
82// all modules of the pipe. This chains calls to module's modify_roi_out() methods in pipeline order.
83// Doesn't actually compute pixels.
84// NOTE: pipe must be a real or virtual pipe with nodes; NULL pipes are not supported anymore.
85void dt_dev_pixelpipe_get_roi_out(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev, const int width_in,
86 const int height_in, int *width, int *height);
87
88// Compute and save into each piece->roi_out/in the proper module-wise ROI to achieve
89// the desired sizes from roi_out, from end to start. This chains calls to module's modify_roi_in() methods
90// in pipeline reverse order.
91// Doesn't actually compute pixels.
92// NOTE: pipe must be a real or virtual pipe with nodes; NULL pipes are not supported anymore.
93void dt_dev_pixelpipe_get_roi_in(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev, const struct dt_iop_roi_t roi_out);
94
95// Check if current_module is performing operations that dev->gui_module (active GUI module)
96// wants disabled. Use that to disable some features of current_module.
97// This is used mostly with distortion operations when the active GUI module
98// needs a full-ROI/undistorted input for its own editing mode,
99// like moving the framing on the full image.
100// WARNING: this doesn't check WHAT particular operations are performed and
101// and what operations should be cancelled (nor if they should all be cancelled).
102// So far, all the code uses that to prevent distortions on module output, masks and roi_out changes (cropping).
103// Meaning ANY of these operations will disable ALL of these operations.
105 struct dt_iop_module_t *current_module);
106
107// wrapper for cleanup_nodes, create_nodes, synch_all and synch_top, decides upon changed event which one to
108// take on. also locks dev->history_mutex.
109void dt_dev_pixelpipe_change(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev);
111
112// Get the global hash of a pipe node (piece), or a fallback if none.
114 const struct dt_dev_pixelpipe_iop_t *piece,
115 const struct dt_iop_roi_t, const int pos);
116
132 const struct dt_iop_module_t *module);
133
148 const struct dt_dev_pixelpipe_iop_t *piece);
149
150// Compute the sequential hash over the pipeline for each module.
151// Need to run after dt_dev_pixelpipe_get_roi_in() has updated processed ROI in/out
152void dt_pixelpipe_get_global_hash(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev);
153
154// Return TRUE if the current backbuffer for the current pipe is in sync with current dev history stack.
156
157// Return TRUE if the current pipeline (topology and node parameters) is in sync with current dev history stack.
158gboolean dt_dev_pixelpipe_is_pipeline_valid(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev);
159
160
161#ifdef __cplusplus
162}
163#endif
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
const char flag
Definition common/image.h:218
void dt_dev_pixelpipe_reset_all(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:185
void dt_dev_pixelpipe_update_history_main_real(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:144
uint64_t dt_dev_pixelpipe_node_hash(struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const struct dt_iop_roi_t, const int pos)
void dt_dev_pixelpipe_update_zoom_main_real(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:173
void dt_pixelpipe_get_global_hash(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev)
Definition dev_pixelpipe.c:543
void dt_dev_pixelpipe_get_roi_out(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev, const int width_in, const int height_in, int *width, int *height)
Definition dev_pixelpipe.c:226
void dt_dev_pixelpipe_rebuild_all_real(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:115
void dt_dev_pixelpipe_update_history_preview_real(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:150
void dt_dev_pixelpipe_resync_history_main_real(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:123
void dt_dev_pixelpipe_resync_history_preview_real(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:129
void dt_dev_pixelpipe_change_zoom_main(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:192
void dt_dev_pixelpipe_change(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev)
Definition dev_pixelpipe.c:725
const struct dt_dev_pixelpipe_iop_t * dt_dev_pixelpipe_get_module_piece(const struct dt_dev_pixelpipe_t *pipe, const struct dt_iop_module_t *module)
Return the enabled piece owned by module in pipe.
void dt_dev_pixelpipe_get_roi_in(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev, const struct dt_iop_roi_t roi_out)
Definition dev_pixelpipe.c:259
void dt_dev_pixelpipe_update_zoom_preview_real(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:165
const struct dt_dev_pixelpipe_iop_t * dt_dev_pixelpipe_get_prev_enabled_piece(const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece)
Return the closest enabled piece located immediately before piece in pipe.
gboolean dt_dev_pixelpipe_is_pipeline_valid(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev)
Definition dev_pixelpipe.c:825
void dt_dev_pixelpipe_sync_virtual(struct dt_develop_t *dev, dt_dev_pixelpipe_change_t flag)
Definition dev_pixelpipe.c:812
void dt_dev_pixelpipe_update_history_all_real(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:158
gboolean dt_dev_pixelpipe_activemodule_disables_currentmodule(struct dt_develop_t *dev, struct dt_iop_module_t *current_module)
Definition dev_pixelpipe.c:212
gboolean dt_dev_pixelpipe_is_backbufer_valid(struct dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev)
Definition dev_pixelpipe.c:817
void dt_dev_pixelpipe_resync_history_all_real(struct dt_develop_t *dev)
Definition dev_pixelpipe.c:137
dt_dev_pixelpipe_change_t
Definition pixelpipe_hb.h:163
unsigned __int64 uint64_t
Definition strptime.c:74
Definition pixelpipe_hb.h:95
dt_iop_roi_t roi_out
Definition pixelpipe_hb.h:130
Definition pixelpipe_hb.h:216
Definition develop.h:155
Definition imageop.h:216
Definition imageop.h:67