Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
develop.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2009-2014 johannes hanika.
4 Copyright (C) 2010 Bruce Guenter.
5 Copyright (C) 2010-2011 Henrik Andersson.
6 Copyright (C) 2011 Robert Bieber.
7 Copyright (C) 2011 Rostyslav Pidgornyi.
8 Copyright (C) 2012-2014, 2020-2021 Aldric Renaudin.
9 Copyright (C) 2012, 2016, 2019-2021 Pascal Obry.
10 Copyright (C) 2012 Richard Wonka.
11 Copyright (C) 2012-2016, 2019 Tobias Ellinghaus.
12 Copyright (C) 2012, 2014, 2016-2017, 2019 Ulrich Pegelow.
13 Copyright (C) 2014-2015 Pedro Côrte-Real.
14 Copyright (C) 2014-2016, 2020 Roman Lebedev.
15 Copyright (C) 2016 Alexander V. Smal.
16 Copyright (C) 2017-2019 Edgardo Hoszowski.
17 Copyright (C) 2017, 2019, 2021 luzpaz.
18 Copyright (C) 2019-2020, 2022-2026 Aurélien PIERRE.
19 Copyright (C) 2020-2021 Chris Elston.
20 Copyright (C) 2020 Dan Torop.
21 Copyright (C) 2020-2021 Diederik Ter Rahe.
22 Copyright (C) 2020 GrahamByrnes.
23 Copyright (C) 2020-2022 Hanno Schwalm.
24 Copyright (C) 2020 Harold le Clément de Saint-Marcq.
25 Copyright (C) 2020-2021 Ralf Brown.
26 Copyright (C) 2021 Sakari Kapanen.
27 Copyright (C) 2022 Martin Bařinka.
28 Copyright (C) 2023, 2025 Alynx Zhou.
29 Copyright (C) 2023 Luca Zulberti.
30 Copyright (C) 2025-2026 Guillaume Stutin.
31
32 darktable is free software: you can redistribute it and/or modify
33 it under the terms of the GNU General Public License as published by
34 the Free Software Foundation, either version 3 of the License, or
35 (at your option) any later version.
36
37 darktable is distributed in the hope that it will be useful,
38 but WITHOUT ANY WARRANTY; without even the implied warranty of
39 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 GNU General Public License for more details.
41
42 You should have received a copy of the GNU General Public License
43 along with darktable. If not, see <http://www.gnu.org/licenses/>.
44*/
45
46#ifndef DT_DEVELOP_DEVELOP_H
47#define DT_DEVELOP_DEVELOP_H
48
49#include <cairo.h>
50#include <glib.h>
51#include <inttypes.h>
52#include <stddef.h>
53#include <stdint.h>
54
55#include "system/atomic.h"
56#include "common/debug.h"
57#include "common/logging.h"
58#include "system/dtpthread.h"
59#include "common/image.h"
60#include "develop/imageop.h"
65#include "develop/dev_history.h"
67
68
69struct dt_iop_module_t;
72struct dt_lib_module_t;
74
81
91
97
104
113
119
146
152
160
161struct dt_dev_pixelpipe_t;
162
163typedef struct dt_develop_t
164{
165 // != 0 if the gui should be notified of changes in hist stack and modules should be
166 // gui_init'ed.
167 int32_t gui_attached;
168
169 int exit; // set to 1 to close background darkroom pipeline threads
170 struct dt_iop_module_t *gui_module; // this module claims gui expose/event callbacks.
171
182
192
202
211
212
213 // image processing pipeline with caching
215 // Virtual preview-like pipeline used for geometry/ROI computations on the GUI thread.
216 // It mirrors preview_pipe history/nodes but never processes pixels.
217 // It is meant for fast access from the GUI mainthread without waiting for threads to return.
218
219 // image under consideration, which
220 // is copied each time an image is changed. this means we have some information
221 // always cached (might be out of sync, so stars are not reliable), but for the iops
222 // it's quite a convenience to access trivial stuff which is constant anyways without
223 // calling into the cache explicitly. this should never be accessed directly, but
224 // by the iop through the copy their respective pixelpipe holds, for thread-safety.
226
227 /* Protect read & write to dev->history and dev->forms
228 * and other related stuff like history_end, hashes, etc.
229 *
230 * The fields below deliberately carry NO GUARDED_BY. It cannot work for a lock that is a
231 * struct member in C: clang never rebinds the member name to the accessed object, so the
232 * requirement stays an unresolved identifier that no REQUIRES can satisfy, and every
233 * access warns forever. Measured, not assumed -- see external/ThreadSafetyAnalysis.h.
234 *
235 * What DOES check is REQUIRES/REQUIRES_SHARED on the functions themselves, against the
236 * ACQUIRE/RELEASE annotations on the dt_pthread_rwlock_t wrappers: a function that runs
237 * with the lock already held by its caller declares it, and clang then verifies the lock
238 * is actually held on every path that reaches it, and released on every path out. That
239 * catches the unbalanced and unheld-on-some-path cases, which is most of what goes wrong
240 * here. It does not catch a stray dev->history read in a function that declares nothing --
241 * that gap is the price of the C limitation above, not an oversight.
242 *
243 * Put those contracts on the DEFINITION, not the declaration: dev_history.h only
244 * forward-declares dt_develop_t, and an attribute naming dev->history_mutex needs the
245 * complete type; completing it there would mean including this header, which includes
246 * dev_history.h back. The cycle is not worth the annotation. */
247 dt_pthread_rwlock_t history_mutex;
248
249 // We don't always apply the full history to modules,
250 // this is the cursor where we stop the list.
251 // Note: history_end = number of history items,
252 // since we consider the 0th element to be the RAW image
253 // (no IOP, no history entry, no item on the GList).
254 // So the index of the history
255 // entry matching history_end is history_end - 1,
256 int32_t history_end;
257
258 // history stack
259 GList *history;
260
261 // Set to 1 while a dt_dev_write_history() background job is queued or running for this
262 // dev, 0 otherwise. Lets dt_dev_write_history() skip queuing a redundant full history+masks
263 // rewrite when one is already in flight -- the pending job reads dev->history live when it
264 // runs, so it always picks up whatever was last committed. See dev_history.c.
266
267 // operations pipeline
269 GList *iop;
270 // iop's to be deleted
271 GList *alliop;
272
273 // iop order
276
277 // Undo tracking for history changes. This is managed by dt_dev_undo_start_record()
278 // / dt_dev_undo_end_record() and stores "before" snapshots until the outermost
279 // change completes.
284
285 // Out-of-history transient param channel. Lets the focused module (e.g. drawlayer realtime stroke,
286 // ashift/crop edit mode) push a thread-safe snapshot of its in-progress params to the pipeline for
287 // rendering, WITHOUT writing permanent history (so undo is not polluted and the database is not
288 // touched per frame). The pipe reads these from its own thread under the mutex and feeds them to
289 // commit_params(), so the transient state reaches the cache through the normal piece->global_hash
290 // mechanism. Only one module (the focused gui_module) is ever active. See dev_transient API in
291 // dev_history.{c,h}.
292 struct
293 {
294 struct dt_iop_module_t *module; // owning module, NULL when inactive
295 void *params; // malloc'd copy of the module's transient params
296 int32_t params_size;
297 void *blend_params; // malloc'd copy of transient blend params, or NULL
298 int32_t blend_size;
299 uint64_t serial; // bumped on every publish, for change detection
301 dt_pthread_mutex_t transient_params_mutex;
302
303 // list of forms iop can use for masks or whatever
304 GList *forms;
305
306 // integrity hash of forms
308 // forms have been added or removed or changed and need to be committed to history
311 // all forms to be linked here for cleanup:
312 GList *allforms;
313
314 // Mutex lock protecting masks, shapes, etc.
315 // aka dev->forms and dev->all_forms
316 dt_pthread_rwlock_t masks_mutex;
317
318 dt_backbuf_t raw_histogram; // preview raw-stage histogram, currently sampled from initialscale output
319 dt_backbuf_t output_histogram; // backbuf to prepare the display-agnostic output histogram (in the middle of colorout)
320 dt_backbuf_t display_histogram; // backbuf to prepare the display-referred output histogram (at the far end of the pipe)
321
322 // Track history changes from C.
323 // This is updated when history is changed, read or written.
324 dt_atomic_uint64 history_hash;
325
326 // Darkroom pipelines are running fulltime in background until leaving darkroom.
327 // Set that to TRUE once they get shutdown.
329
363 struct
364 {
365 struct dt_iop_module_t *module;
368 int kind;
370 gboolean enabled;
373
375 GSList *samples;
382 gboolean (*refresh_global_picker)(struct dt_lib_module_t *self);
383
389
393
394 /* proxy for communication between plugins and develop/darkroom */
395 struct
396 {
397 // snapshots plugin hooks
398 struct
399 {
400 // this flag is set by snapshot plugin to signal that expose of darkroom
401 // should store cairo surface as snapshot to disk using filename.
402 gboolean request;
403 const gchar *filename;
405
406 // masks plugin hooks
407 struct
408 {
409 struct dt_lib_module_t *module;
410 /* treview list refresh */
412 void (*list_remove)(struct dt_lib_module_t *self, int formid, int parentid);
414 /* selected forms change */
415 void (*selection_change)(struct dt_lib_module_t *self, struct dt_iop_module_t *module, const int selectid, const int throw_event);
416 /* is the shape manager's window on screen? The darkroom draws the mask overlays while the
417 user is looking at it, the way it used to while its panel section was expanded. */
418 gboolean (*is_visible)(struct dt_lib_module_t *self);
420
421 // what is the ID of the module currently doing pipeline chromatic adaptation ?
422 // this is to prevent multiple modules/instances from doing white balance globally.
423 // only used to display warnings in GUI of modules that should probably not be doing white balance
425
426 // is the WB module using D65 illuminant and not doing full chromatic adaptation ?
427 gboolean wb_is_D65;
429
431
432 // for the overexposure indicator
433 struct
434 {
435 GtkWidget *floating_window, *button; // yes, having gtk stuff in here is ugly. live with it.
436
437 gboolean enabled;
439 float lower;
440 float upper;
443
444 // for the raw overexposure indicator
445 struct
446 {
447 GtkWidget *floating_window, *button; // yes, having gtk stuff in here is ugly. live with it.
448
449 gboolean enabled;
454
455 struct
456 {
457 GtkWidget *floating_window, *button; // 10 years later, still ugly
458
462
463 // ISO 12646-compliant colour assessment conditions
464 struct
465 {
466 GtkWidget *button; // yes, ugliness is the norm. what did you expect ?
467 gboolean enabled;
469
470 // the display profile related things (softproof, gamut check, profiles ...)
471 struct
472 {
475
476 // progress bar
477 struct
478 {
479 int total, completed;
481
482 gboolean darkroom_skip_mouse_events; // skip mouse events for masks
483 gboolean mask_lock;
484
485 cairo_surface_t *image_surface;
486
487 /* Composed geometry, GUI thread only: where the GUI gets sizes and coordinates from.
488 * Appended at the end of this struct deliberately -- IOP plugins are compiled against this
489 * layout, so a field inserted anywhere else silently shifts what they read. See
490 * develop/geometry/geometry.h and doc/geometry-service.md. NULL on non-gui devs. */
493
498
499static inline void dt_dev_set_history_hash(dt_develop_t *dev, const uint64_t history_hash)
500{
501 dt_atomic_set_uint64(&dev->history_hash, history_hash);
502}
503
504#ifdef __cplusplus
505extern "C" {
506#endif
507
508void dt_dev_init(dt_develop_t *dev, int32_t gui_attached);
511
518
519// Optionally prefetch `DT_MIPMAP_FULL`, then refresh dev->image_storage from the image cache.
520// Returns a status code to differentiate missing source image data from DB/cache failures.
522
523// Start background pipeline threads. They run fulltime until we close darkroom,
524// so no need to recall that
526
529int dt_dev_is_current_image(dt_develop_t *dev, int32_t imgid);
530
531void dt_dev_get_processed_size(const dt_develop_t *dev, int *procw, int *proch);
532
533float dt_dev_get_zoom_scale(const dt_develop_t *dev, gboolean preview);
534
535// Set all the params of a backbuffer at once
536void dt_dev_set_backbuf(dt_backbuf_t *backbuf, const int width, const int height, const size_t bpp,
537 const int64_t hash, const int64_t history_hash);
538
551void dt_dev_coordinates_widget_to_image_norm(dt_develop_t *dev, float *points, size_t num_points);
565void dt_dev_coordinates_widget_delta_to_image_delta(dt_develop_t *dev, float *points, size_t num_points);
566void dt_dev_coordinates_image_norm_to_widget(dt_develop_t *dev, float *points, size_t num_points);
567void dt_dev_coordinates_image_norm_to_image_abs(dt_develop_t *dev, float *points, size_t num_points);
568void dt_dev_coordinates_image_abs_to_image_norm(dt_develop_t *dev, float *points, size_t num_points);
569void dt_dev_coordinates_raw_abs_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points);
570void dt_dev_coordinates_raw_norm_to_raw_abs(dt_develop_t *dev, float *points, size_t num_points);
571void dt_dev_coordinates_image_norm_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points);
572void dt_dev_coordinates_raw_norm_to_image_norm(dt_develop_t *dev, float *points, size_t num_points);
573void dt_dev_coordinates_image_norm_to_preview_abs(dt_develop_t *dev, float *points, size_t num_points);
574void dt_dev_coordinates_preview_abs_to_image_norm(dt_develop_t *dev, float *points, size_t num_points);
575void dt_dev_coordinates_image_abs_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points);
576
588void dt_dev_retrieve_full_pos(dt_develop_t *dev, const int px, const int py, float *mouse_x, float *mouse_y);
589
590void dt_dev_configure_real(dt_develop_t *dev, int wd, int ht);
591#define dt_dev_configure(dev, wd, ht) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_configure_real, (dev), (wd), (ht))
592
602void dt_dev_check_zoom_pos_bounds(dt_develop_t *dev, float *dev_x, float *dev_y, float *box_w, float *box_h);
603
607
608/*
609 * modulegroups helpers
610 */
615
617void dt_dev_snapshot_request(dt_develop_t *dev, const char *filename);
618
619/*
620 * masks plugin hooks
621 */
624void dt_dev_masks_list_remove(dt_develop_t *dev, int formid, int parentid);
625void dt_dev_masks_selection_change(dt_develop_t *dev, struct dt_iop_module_t *module, const int selectid, const int throw_event);
626/* FALSE when no shape manager is registered, which is also the answer when its window is closed */
628
631
632/*
633 * multi instances
634 */
641
643gchar *dt_dev_get_multi_name(const struct dt_iop_module_t *module);
645gchar *dt_history_item_get_name(const struct dt_iop_module_t *module);
646gchar *dt_history_item_get_name_html(const struct dt_iop_module_t *module);
647
649gchar *dt_history_item_get_label(const struct dt_iop_module_t *module);
650
651
652/*
653 * distort functions
654 */
656int dt_dev_coordinates_raw_abs_to_image_abs(dt_develop_t *dev, float *points, size_t points_count);
658int dt_dev_coordinates_image_abs_to_raw_abs(dt_develop_t *dev, float *points, size_t points_count);
660int dt_dev_distort_transform_plus(const struct dt_dev_pixelpipe_t *pipe, const double iop_order, const int transf_direction,
661 float *points, size_t points_count);
664 const int transf_direction, float *points, size_t points_count);
666int dt_dev_distort_backtransform_plus(const struct dt_dev_pixelpipe_t *pipe, const double iop_order, const int transf_direction,
667 float *points, size_t points_count);
668
676 const int transf_direction, float *points, size_t points_count);
678 const int transf_direction, float *points, size_t points_count);
679
688gboolean dt_dev_module_geometry_gui(struct dt_develop_t *dev, struct dt_iop_module_t *module,
690
695gboolean dt_dev_processed_size_gui(struct dt_develop_t *dev, int *width, int *height);
696
699 struct dt_iop_module_t *module);
700
701/*
702 * history undo support helpers for darkroom
703 */
704
705/* all history change must be enclosed into a start / end call */
708
709// Getter and setter for global mask lock (GUI)
710// Can be overriden by key accels
711
713void dt_masks_set_lock_mode(dt_develop_t *dev, gboolean mode);
714
715// Count all the mask forms used x history entries, up to a certain threshold.
716// Stop counting when the threshold is reached, for performance.
717guint dt_dev_mask_history_overload(GList *dev_history, guint threshold);
718
719// Write the `darktable|changed` tag on the current picture upon history modification
720void dt_dev_append_changed_tag(const int32_t imgid);
721
722// This needs to run after `dt_dev_pixelpipe_get_roi_out()` so `pipe->processed_width`
723// and `pipe->processed_height` are defined.
724// Natural scale is the rescaling factor such that the full-res pipeline output
725// (real or virtual) fits within darkroom widget area (minus borders/margins)
727
728// Get the final size of the main thumbnail that fits within darkroom central widget
729// Needs to be recomputed when module parameters change (for modules changing ROI)
730// or when the widget is resized.
732
745 const struct dt_iop_roi_t *roi);
746
755
766
779float dt_dev_get_widget_zoom_scale(const dt_develop_t *dev, float scaling);
780
787void dt_dev_get_widget_center(const dt_develop_t *dev, float *point);
788
802void dt_dev_get_image_box_in_widget(const dt_develop_t *dev, int32_t width, int32_t height, float *box);
803
815
816// Get the current pipeline zoom factor in image-space units ( scaling * natural_scale ).
817float dt_dev_get_zoom_level(const dt_develop_t *dev);
818
819// Reset darkroom ROI scaling and position
821
836 const dt_dev_roi_space_t from, const dt_dev_roi_space_t to);
837
848gboolean dt_dev_clip_roi(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height);
849
859gboolean dt_dev_rescale_roi(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height);
860
870gboolean dt_dev_rescale_roi_to_input(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height);
871
879
887// Update the mouse bounding box size according to current zoom level, dpp and DPI.
889
895struct dt_develop_t *dt_dev_get_global(void);
896
900void dt_dev_set_global(struct dt_develop_t *dev);
901
902#ifdef __cplusplus
903}
904#endif
905
906#endif // DT_DEVELOP_DEVELOP_H
907
908// clang-format off
909// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
910// vim: shiftwidth=2 expandtab tabstop=2 cindent
911// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
912// clang-format on
uint64_t dt_atomic_get_uint64(const dt_atomic_uint64 *var)
void dt_atomic_set_uint64(dt_atomic_uint64 *var, uint64_t value)
atomic_int dt_atomic_int
Definition atomic.h:68
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
static const float scaling
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
const float threshold
const dt_colormatrix_t dt_aligned_pixel_t out
Call tracing for functions you do not want to edit every caller of.
void dt_dev_signal_modules_moved(dt_develop_t *dev)
Definition develop.c:1848
void dt_dev_masks_list_change(dt_develop_t *dev)
Definition develop.c:1340
void dt_dev_coordinates_image_abs_to_image_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1219
float dt_dev_get_natural_scale(dt_develop_t *dev)
Definition develop.c:1944
void dt_dev_get_processed_size(const dt_develop_t *dev, int *procw, int *proch)
Definition develop.c:1109
static uint64_t dt_dev_get_history_hash(const dt_develop_t *dev)
Definition develop.h:494
int dt_dev_distort_transform_plus(const struct dt_dev_pixelpipe_t *pipe, const double iop_order, const int transf_direction, float *points, size_t points_count)
void dt_masks_set_lock_mode(dt_develop_t *dev, gboolean mode)
Definition develop.c:1889
dt_dev_overexposed_colorscheme_t
Definition develop.h:76
@ DT_DEV_OVEREXPOSED_PURPLEGREEN
Definition develop.h:79
@ DT_DEV_OVEREXPOSED_REDBLUE
Definition develop.h:78
@ DT_DEV_OVEREXPOSED_BLACKWHITE
Definition develop.h:77
void dt_dev_coordinates_preview_abs_to_image_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1306
int dt_dev_get_thumbnail_size(dt_develop_t *dev)
Definition develop.c:353
int dt_dev_coordinates_raw_abs_to_image_abs(dt_develop_t *dev, float *points, size_t points_count)
Definition develop.c:1765
void dt_dev_coordinates_raw_norm_to_raw_abs(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1255
struct dt_develop_t * dt_dev_get_global(void)
Definition darktable.c:528
void dt_dev_get_widget_center(const dt_develop_t *dev, float *point)
Get the center of the darkroom widget in logical coordinates.
Definition develop.c:1970
float dt_dev_get_widget_zoom_scale(const dt_develop_t *dev, float scaling)
Convert a darkroom scaling factor to GUI logical zoom.
Definition develop.c:1964
void dt_dev_cleanup(dt_develop_t *dev)
Definition develop.c:237
void dt_dev_module_remove(dt_develop_t *dev, struct dt_iop_module_t *module)
Definition develop.c:1442
dt_dev_overlay_colors_t
Definition develop.h:83
@ DT_DEV_OVERLAY_CYAN
Definition develop.h:88
@ DT_DEV_OVERLAY_YELLOW
Definition develop.h:87
@ DT_DEV_OVERLAY_RED
Definition develop.h:85
@ DT_DEV_OVERLAY_GREEN
Definition develop.h:86
@ DT_DEV_OVERLAY_GRAY
Definition develop.h:84
@ DT_DEV_OVERLAY_MAGENTA
Definition develop.h:89
dt_dev_pixelpipe_display_mask_t
Definition develop.h:121
@ DT_DEV_PIXELPIPE_DISPLAY_a
Definition develop.h:127
@ DT_DEV_PIXELPIPE_DISPLAY_OUTPUT
Definition develop.h:125
@ DT_DEV_PIXELPIPE_DISPLAY_G
Definition develop.h:130
@ DT_DEV_PIXELPIPE_DISPLAY_L
Definition develop.h:126
@ DT_DEV_PIXELPIPE_DISPLAY_CHANNEL
Definition develop.h:124
@ DT_DEV_PIXELPIPE_DISPLAY_ANY
Definition develop.h:143
@ DT_DEV_PIXELPIPE_DISPLAY_LCH_h
Definition develop.h:134
@ DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_hz
Definition develop.h:140
@ DT_DEV_PIXELPIPE_DISPLAY_HSL_H
Definition develop.h:135
@ DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU_MONO
Definition develop.h:142
@ DT_DEV_PIXELPIPE_DISPLAY_HSL_S
Definition develop.h:136
@ DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_Cz
Definition develop.h:139
@ DT_DEV_PIXELPIPE_DISPLAY_LCH_C
Definition develop.h:133
@ DT_DEV_PIXELPIPE_DISPLAY_b
Definition develop.h:128
@ DT_DEV_PIXELPIPE_DISPLAY_STICKY
Definition develop.h:144
@ DT_DEV_PIXELPIPE_DISPLAY_MASK
Definition develop.h:123
@ DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_Jz
Definition develop.h:138
@ DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU
Definition develop.h:141
@ DT_DEV_PIXELPIPE_DISPLAY_NONE
Definition develop.h:122
@ DT_DEV_PIXELPIPE_DISPLAY_HSL_l
Definition develop.h:137
@ DT_DEV_PIXELPIPE_DISPLAY_GRAY
Definition develop.h:132
@ DT_DEV_PIXELPIPE_DISPLAY_B
Definition develop.h:131
@ DT_DEV_PIXELPIPE_DISPLAY_R
Definition develop.h:129
void dt_dev_modulegroups_switch_tab(dt_develop_t *dev, struct dt_iop_module_t *module)
Definition develop.c:1328
dt_dev_transform_direction_t
Definition develop.h:106
@ DT_DEV_TRANSFORM_DIR_BACK_EXCL
Definition develop.h:111
@ DT_DEV_TRANSFORM_DIR_BACK_INCL
Definition develop.h:110
@ DT_DEV_TRANSFORM_DIR_FORW_INCL
Definition develop.h:108
@ DT_DEV_TRANSFORM_DIR_ALL
Definition develop.h:107
@ DT_DEV_TRANSFORM_DIR_FORW_EXCL
Definition develop.h:109
float dt_dev_get_overlay_scale(dt_develop_t *dev)
Get the overlay scale factor in GUI logical coordinates.
Definition develop.c:1959
void dt_dev_append_changed_tag(const int32_t imgid)
Definition develop.c:1912
dt_dev_image_storage_t dt_dev_load_image(dt_develop_t *dev, const int32_t imgid)
Definition develop.c:1000
int dt_dev_distort_backtransform_gui(struct dt_develop_t *dev, const double iop_order, const int transf_direction, float *points, size_t points_count)
The inverse of dt_dev_distort_transform_gui(), same rules.
Definition develop.c:1699
gboolean dt_dev_masks_manager_is_visible(dt_develop_t *dev)
Definition develop.c:1334
int dt_dev_distort_transform_gui(struct dt_develop_t *dev, const double iop_order, const int transf_direction, float *points, size_t points_count)
GUI-side bounded transform folds. Ask the geometry service, fall back to the pixel-less pipe....
Definition develop.c:1691
void dt_dev_coordinates_image_norm_to_preview_abs(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1291
float dt_dev_get_zoom_level(const dt_develop_t *dev)
Definition develop.c:1992
void dt_dev_coordinates_image_norm_to_widget(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1173
void dt_dev_masks_selection_change(dt_develop_t *dev, struct dt_iop_module_t *module, const int selectid, const int throw_event)
Definition develop.c:1355
void dt_dev_init(dt_develop_t *dev, int32_t gui_attached)
Definition develop.c:143
int dt_dev_is_current_image(dt_develop_t *dev, int32_t imgid)
Definition develop.c:1323
void dt_dev_undo_start_record(dt_develop_t *dev)
Definition develop.c:1854
gboolean dt_dev_clamp_viewport_center(dt_develop_t *dev)
Clamp the viewport centre against the box currently visible at this zoom.
Definition develop.c:1065
dt_dev_rawoverexposed_mode_t
Definition develop.h:92
@ DT_DEV_RAWOVEREXPOSED_MODE_FALSECOLOR
Definition develop.h:95
@ DT_DEV_RAWOVEREXPOSED_MODE_MARK_CFA
Definition develop.h:93
@ DT_DEV_RAWOVEREXPOSED_MODE_MARK_SOLID
Definition develop.h:94
gboolean dt_dev_module_geometry_gui(struct dt_develop_t *dev, struct dt_iop_module_t *module, dt_iop_roi_t *in, dt_iop_roi_t *out)
One module's own input and output rectangles at full resolution, from the geometry service.
Definition develop.c:1751
void dt_dev_snapshot_request(dt_develop_t *dev, const char *filename)
Definition develop.c:1362
gboolean dt_masks_get_lock_mode(dt_develop_t *dev)
Definition develop.c:1877
dt_dev_roi_space_t
Definition develop.h:115
@ DT_DEV_ROI_GUI_LOGICAL
Definition develop.h:117
@ DT_DEV_ROI_PIPELINE
Definition develop.h:116
gchar * dt_history_item_get_label(const struct dt_iop_module_t *module)
Definition develop.c:1613
void dt_dev_coordinates_raw_norm_to_image_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1278
gchar * dt_history_item_get_name_html(const struct dt_iop_module_t *module)
Definition develop.c:1661
void dt_dev_check_zoom_pos_bounds(dt_develop_t *dev, float *dev_x, float *dev_y, float *box_w, float *box_h)
Ensure that the current ROI position is within allowed bounds .
Definition develop.c:1074
gboolean dt_dev_check_zoom_scale_bounds(dt_develop_t *dev)
Ensure that the current zoom level is within allowed bounds (for scrolling).
Definition develop.c:2091
dt_develop_detail_mask_t
Definition develop.h:148
@ DT_DEV_DETAIL_MASK_ENABLED
Definition develop.h:150
@ DT_DEV_DETAIL_MASK_NONE
Definition develop.h:149
dt_clipping_preview_mode_t
Definition develop.h:154
@ DT_CLIPPING_PREVIEW_ANYRGB
Definition develop.h:156
@ DT_CLIPPING_PREVIEW_GAMUT
Definition develop.h:155
@ DT_CLIPPING_PREVIEW_SATURATION
Definition develop.h:158
@ DT_CLIPPING_PREVIEW_LUMINANCE
Definition develop.h:157
void dt_dev_reset_roi(dt_develop_t *dev)
Definition develop.c:1998
void dt_dev_set_global(struct dt_develop_t *dev)
Definition darktable.c:543
struct dt_iop_module_t * dt_dev_module_duplicate(dt_develop_t *dev, struct dt_iop_module_t *base)
Definition develop.c:1370
GList * dt_dev_load_modules(dt_develop_t *dev)
Definition develop.c:98
void dt_dev_set_backbuf(dt_backbuf_t *backbuf, const int width, const int height, const size_t bpp, const int64_t hash, const int64_t history_hash)
Definition develop.c:2134
gboolean dt_dev_rescale_roi_to_input(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height)
Scale the ROI to fit the input size within given width/height, centered.
Definition develop.c:2081
gboolean dt_dev_pixelpipe_has_preview_output(const dt_develop_t *dev, const struct dt_dev_pixelpipe_t *pipe, const struct dt_iop_roi_t *roi)
Tell whether a GUI-attached pipe currently targets the darkroom preview-sized output.
void dt_dev_coordinates_image_norm_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1271
gboolean dt_dev_pipelines_share_preview_output(dt_develop_t *dev)
Tell whether the darkroom main and preview pipes currently target the same GUI output.
Definition develop.c:504
void dt_dev_configure_real(dt_develop_t *dev, int wd, int ht)
Definition develop.c:1035
void dt_dev_masks_update_hash(dt_develop_t *dev)
Definition develop.c:1921
gboolean dt_dev_clip_roi(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height)
Clip the view to the ROI. WARNING: this must be done before any translation.
Definition develop.c:2028
static void dt_dev_set_history_hash(dt_develop_t *dev, const uint64_t history_hash)
Definition develop.h:499
dt_dev_rawoverexposed_colorscheme_t
Definition develop.h:98
@ DT_DEV_RAWOVEREXPOSED_RED
Definition develop.h:99
@ DT_DEV_RAWOVEREXPOSED_BLUE
Definition develop.h:101
@ DT_DEV_RAWOVEREXPOSED_BLACK
Definition develop.h:102
@ DT_DEV_RAWOVEREXPOSED_GREEN
Definition develop.h:100
int dt_dev_coordinates_image_abs_to_raw_abs(dt_develop_t *dev, float *points, size_t points_count)
Definition develop.c:1770
void dt_dev_get_image_box_in_widget(const dt_develop_t *dev, int32_t width, int32_t height, float *box)
Get the displayed image rectangle in darkroom widget coordinates.
Definition develop.c:1977
void dt_dev_undo_end_record(dt_develop_t *dev)
Definition develop.c:1865
gboolean dt_dev_rescale_roi(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height)
Scale the ROI to fit within given width/height, centered.
Definition develop.c:2071
void dt_dev_coordinates_widget_delta_to_image_delta(dt_develop_t *dev, float *points, size_t num_points)
Convert a widget-space distance to processed-image pixels.
Definition develop.c:1127
void dt_dev_convert_roi(const dt_develop_t *dev, const dt_iop_roi_t *roi_in, dt_iop_roi_t *roi_out, const dt_dev_roi_space_t from, const dt_dev_roi_space_t to)
Convert a full ROI object between pipeline raster coordinates and GUI logical coordinates.
Definition develop.c:2006
float dt_dev_get_fit_scale(dt_develop_t *dev)
Get the scale factor that maps preview-buffer pixels to GUI coordinates.
Definition develop.c:1953
dt_dev_image_storage_t dt_dev_ensure_image_storage(dt_develop_t *dev, const int32_t imgid)
Definition develop.c:956
dt_dev_image_storage_t
Definition develop.h:513
@ DT_DEV_IMAGE_STORAGE_DB_NOT_READ
Definition develop.h:516
@ DT_DEV_IMAGE_STORAGE_OK
Definition develop.h:514
@ DT_DEV_IMAGE_STORAGE_MIPMAP_NOT_FOUND
Definition develop.h:515
void dt_dev_modules_update_multishow(dt_develop_t *dev)
Definition develop.c:1545
void dt_dev_coordinates_image_norm_to_image_abs(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1203
guint dt_dev_mask_history_overload(GList *dev_history, guint threshold)
void dt_dev_coordinates_widget_to_image_norm(dt_develop_t *dev, float *points, size_t num_points)
Coordinate conversion helpers between widget, normalized image, and absolute image spaces.
Definition develop.c:1144
void dt_dev_update_mouse_effect_radius(dt_develop_t *dev)
Convert absolute output-image coordinates to input image space by calling dt_dev_coordinates_image_ab...
Definition develop.c:2117
void dt_dev_masks_list_update(dt_develop_t *dev)
Definition develop.c:1345
gboolean dt_dev_processed_size_gui(struct dt_develop_t *dev, int *width, int *height)
The developed image's full-resolution size for a GUI caller: the geometry service,...
Definition develop.c:1730
int dt_dev_distort_backtransform_plus(const struct dt_dev_pixelpipe_t *pipe, const double iop_order, const int transf_direction, float *points, size_t points_count)
gchar * dt_dev_get_multi_name(const struct dt_iop_module_t *module)
Definition develop.c:1637
void dt_dev_masks_list_remove(dt_develop_t *dev, int formid, int parentid)
Definition develop.c:1350
int dt_dev_distort_transform_locked(const struct dt_dev_pixelpipe_t *pipe, const double iop_order, const int transf_direction, float *points, size_t points_count)
float dt_dev_get_zoom_scale(const dt_develop_t *dev, gboolean preview)
Definition develop.c:989
void dt_dev_coordinates_raw_abs_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1237
void dt_dev_coordinates_image_abs_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1285
gchar * dt_history_item_get_name(const struct dt_iop_module_t *module)
Definition develop.c:1645
void dt_dev_retrieve_full_pos(dt_develop_t *dev, const int px, const int py, float *mouse_x, float *mouse_y)
Get a point position from widget space to preview buffer space [0..1].
struct dt_dev_pixelpipe_iop_t * dt_dev_distort_get_iop_pipe(struct dt_dev_pixelpipe_t *pipe, struct dt_iop_module_t *module)
Definition develop.c:1833
void dt_dev_start_all_pipelines(dt_develop_t *dev)
Definition develop.c:908
GtkWidget * preview
what the selected row actually captures
int bpp
uint32_t width
Definition mipmap_cache.c:0
uint32_t height
Definition mipmap_cache.c:1
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
Definition simd.h:53
unsigned __int64 uint64_t
Definition strptime.c:75
What the pipeline last published: which cacheline, and what shape its pixels are in.
Single-writer seqlock around the record.
void(* list_update)(struct dt_lib_module_t *self)
Definition develop.h:413
int32_t gui_attached
Definition develop.h:167
cairo_surface_t * image_surface
Definition develop.h:485
GList * iop_order_list
Definition develop.h:275
int undo_history_before_end
Definition develop.h:282
dt_image_t image_storage
Definition develop.h:225
int picker_cst
Definition develop.h:369
struct dt_colorpicker_sample_t * primary_sample
Definition develop.h:374
int iop_order_version
Definition develop.h:274
GList * undo_history_before_snapshot
Definition develop.h:281
dt_dev_rawoverexposed_colorscheme_t colorscheme
Definition develop.h:451
dt_backbuf_t display_histogram
Definition develop.h:320
GList * iop
Definition develop.h:269
gboolean request
Definition develop.h:402
gboolean update_pending
Definition develop.h:371
dt_backbuf_t output_histogram
Definition develop.h:319
dt_dev_geometry_store_t geometry
Objective geometry of the image being worked on: the raw dimensions and the full-resolution processed...
Definition develop.h:191
struct dt_develop_t::@12 transient_params
int32_t history_end
Definition develop.h:256
uint64_t wait_output_hash
Definition develop.h:386
GList * undo_history_before_iop_order_list
Definition develop.h:283
GtkWidget * widget
Definition develop.h:367
gboolean wb_is_D65
Definition develop.h:427
gboolean(* refresh_global_picker)(struct dt_lib_module_t *self)
Definition develop.h:382
struct dt_develop_t::@13 color_picker
Authoritative darkroom color-picker state.
struct dt_develop_t::@17 display
struct dt_develop_t::@20 progress
struct dt_iop_module_t * pending_module
Definition develop.h:390
gboolean restrict_histogram
Definition develop.h:379
int statistic
Definition develop.h:380
void(* list_remove)(struct dt_lib_module_t *self, int formid, int parentid)
Definition develop.h:412
int completed
Definition develop.h:479
struct dt_iop_module_t * gui_module
Definition develop.h:170
dt_pthread_rwlock_t history_mutex
Definition develop.h:247
GSList * samples
Definition develop.h:375
gboolean live_samples_enabled
Definition develop.h:378
dt_clipping_preview_mode_t mode
Definition develop.h:441
float brightness
Definition develop.h:459
dt_atomic_uint64 history_hash
Definition develop.h:324
struct dt_lib_module_t *void(* list_change)(struct dt_lib_module_t *self)
Definition develop.h:411
gboolean forms_changed
Definition develop.h:309
uint64_t serial
Definition develop.h:299
GtkWidget * floating_window
Definition develop.h:435
float lower
Definition develop.h:439
struct dt_dev_pixelpipe_t * preview_pipe
Definition develop.h:214
dt_dev_pixelpipe_cache_wait_t output_wait
Definition develop.h:388
struct dt_develop_t::@15 overexposed
gboolean pipelines_started
Definition develop.h:328
GList * history
Definition develop.h:259
struct dt_develop_t::@14::@21 snapshot
dt_dev_roi_request_store_t roi_request
What the darkroom pipes plan their ROI from: the viewport and the geometry, combined and derived once...
Definition develop.h:210
dt_atomic_int mask_preview_settings_revision
Revision of the global mask-preview appearance.
Definition develop.h:181
gboolean darkroom_skip_mouse_events
Definition develop.h:482
struct dt_iop_module_t *void * params
Definition develop.h:294
GList * alliop
Definition develop.h:271
struct dt_develop_t::@19 profile
dt_aligned_pixel_t wb_coeffs
Definition develop.h:428
struct dt_iop_module_t *struct dt_iop_color_picker_t * picker
Definition develop.h:366
dt_dev_overexposed_colorscheme_t colorscheme
Definition develop.h:438
GList * allforms
Definition develop.h:312
dt_backbuf_t raw_histogram
Definition develop.h:318
struct dt_masks_form_gui_t * form_gui
Definition develop.h:310
GtkWidget * button
Definition develop.h:435
void(* selection_change)(struct dt_lib_module_t *self, struct dt_iop_module_t *module, const int selectid, const int throw_event)
Definition develop.h:415
struct dt_colorpicker_sample_t * selected_sample
Definition develop.h:376
uint64_t wait_input_hash
Definition develop.h:385
gboolean(* is_visible)(struct dt_lib_module_t *self)
Definition develop.h:418
guint refresh_idle_source
Definition develop.h:372
struct dt_dev_pixelpipe_t * pending_pipe
Definition develop.h:391
struct dt_lib_module_t * histogram_module
Definition develop.h:381
GtkWidget * gamut_button
Definition develop.h:473
struct dt_iop_module_t * chroma_adaptation
Definition develop.h:424
gboolean mask_lock
Definition develop.h:483
gboolean enabled
Definition develop.h:370
dt_atomic_int history_write_pending
Definition develop.h:265
dt_pthread_mutex_t transient_params_mutex
Definition develop.h:301
int32_t iop_instance
Definition develop.h:268
dt_pthread_rwlock_t masks_mutex
Definition develop.h:316
struct dt_develop_t::@14::@22 masks
uint64_t forms_hash
Definition develop.h:307
dt_dev_rawoverexposed_mode_t mode
Definition develop.h:450
struct dt_develop_t::@18 iso_12646
const gchar * filename
Definition develop.h:403
struct dt_develop_t::@14 proxy
struct dt_develop_t::@16 rawoverexposed
float threshold
Definition develop.h:452
uint64_t piece_hash
Definition develop.h:384
int32_t blend_size
Definition develop.h:298
struct dt_dev_pixelpipe_t * pipe
Definition develop.h:214
float upper
Definition develop.h:440
struct dt_geometry_chain_t * geometry_chain
Definition develop.h:491
GtkWidget * softproof_button
Definition develop.h:473
dt_dev_viewport_t * viewport
The darkroom view's window onto the image: widget allocation, borders, zoom, pan.
Definition develop.h:201
gboolean display_samples
Definition develop.h:377
dt_dev_pixelpipe_cache_wait_t input_wait
Definition develop.h:387
GList * forms
Definition develop.h:304
int undo_history_depth
Definition develop.h:280
void * blend_params
Definition develop.h:297
int32_t params_size
Definition develop.h:296
dt_develop_t * dev
Definition geometry.c:87
struct dt_develop_t * dev
Definition imageop.h:311
Region of interest passed through the pixelpipe.
Definition format.h:49
One consumer's outstanding request, owned by that consumer, not by the queue.