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#pragma once
47
48#include <cairo.h>
49#include <glib.h>
50#include <inttypes.h>
51#include <stddef.h>
52#include <stdint.h>
53
54#include "common/debug.h"
55#include "common/darktable.h"
56#include "common/dtpthread.h"
57#include "common/image.h"
58#include "control/settings.h"
59#include "develop/imageop.h"
60#include "develop/dev_history.h"
62
63
64struct dt_iop_module_t;
67struct dt_lib_module_t;
69
76
86
92
99
108
114
141
147
155
156struct dt_dev_pixelpipe_t;
157
158typedef struct dt_develop_t
159{
160 // != 0 if the gui should be notified of changes in hist stack and modules should be
161 // gui_init'ed.
162 int32_t gui_attached;
163
164 int exit; // set to 1 to close background darkroom pipeline threads
165 struct dt_iop_module_t *gui_module; // this module claims gui expose/event callbacks.
166
177
178 // The roi structure is used in darkroom GUI only.
179 // It defines the output size of the image backbuffer fitting
180 // into the darkroom center widget. This is critically used for all
181 // GUI <-> RAW pixel coordinates conversions. It should be recomputed
182 // ASAP when widget size changes.
183 struct {
184 // width = orig_width - 2 * border_size,
185 // height = orig_height - 2 * border_size,
186 // converted to raster pixels through the GUI ppd factor.
187 // This is the surface actually covered by an image backbuffer (ROI)
188 // and it is set by `dt_dev_configure()`.
189 int32_t width, height;
190
191 // User-defined scaling factor, related to GUI zoom.
192 // Applies on top of natural scale
193 float scaling;
194
195 // Relative coordinates of the center of the ROI, expressed with
196 // regard to the complete image.
197 float x, y;
198
199 // darkroom border size: ISO 12646 borders or user-defined borders
200 int32_t border_size;
201
202 // Those are the darkroom main widget size in GUI coordinates, aka max
203 // paintable area. This size is allocated by Gtk from the window size
204 // minus all panels. It is NOT the size of the backbuffer/ROI.
205 int32_t orig_width, orig_height;
206
207 // Dimensions of the preview backbuffer, depending on the
208 // darkroom main widget size and DPI factor.
209 // These are computed early, before we have the actual buffer.
210 // Use them everywhere in GUI.
211 // They respect the final image aspect ratio and fit within
212 // the width x height bounding box.
213 int32_t preview_width, preview_height;
214
215 // Dimension of the main image backbuffer
216 // They are at lower than or equal to (width, height),
217 // the bounding box defined by the widget where main image fits.
218 // Since the ROI may clip the zoomed-in image, they don't respect
219 // the final image aspect ratio
220 int32_t main_width, main_height;
221
222 // natural scaling = MIN(dev->width / dev->roi.processed_width, dev->height / dev->roi.processed_height)
223 // aka ensure that image fits into widget minus margins/borders.
225
226 // Dimensions of the full-resolution RAW image
227 // being worked on.
228 int32_t raw_width, raw_height;
229
230 // Dimensions of the final processed image if we processed it full-resolution.
231 // This is used to get the final aspect ratio of an image,
232 // taking all cropping and distortions into account.
233 int32_t processed_width, processed_height;
234
235 // Conveniency state to check if all widget sizes are inited
236 gboolean gui_inited;
237
238 // Conveniency state to check if input (raw image) sizes are inited
239 gboolean raw_inited;
240
241 // Conveniency state to check if all output (backbuffer) sizes are inited
243
245
246 // image processing pipeline with caching
248 // Virtual preview-like pipeline used for geometry/ROI computations on the GUI thread.
249 // It mirrors preview_pipe history/nodes but never processes pixels.
250 // It is meant for fast access from the GUI mainthread without waiting for threads to return.
252
253 // image under consideration, which
254 // is copied each time an image is changed. this means we have some information
255 // always cached (might be out of sync, so stars are not reliable), but for the iops
256 // it's quite a convenience to access trivial stuff which is constant anyways without
257 // calling into the cache explicitly. this should never be accessed directly, but
258 // by the iop through the copy their respective pixelpipe holds, for thread-safety.
260
261 // Protect read & write to dev->history and dev->forms
262 // and other related stuff like history_end, hashes, etc.
264
265 // We don't always apply the full history to modules,
266 // this is the cursor where we stop the list.
267 // Note: history_end = number of history items,
268 // since we consider the 0th element to be the RAW image
269 // (no IOP, no history entry, no item on the GList).
270 // So the index of the history
271 // entry matching history_end is history_end - 1,
272 int32_t history_end;
273
274 // history stack
276
277 // Set to 1 while a dt_dev_write_history() background job is queued or running for this
278 // dev, 0 otherwise. Lets dt_dev_write_history() skip queuing a redundant full history+masks
279 // rewrite when one is already in flight -- the pending job reads dev->history live when it
280 // runs, so it always picks up whatever was last committed. See dev_history.c.
282
283 // operations pipeline
286 // iop's to be deleted
288
289 // iop order
292
293 // Undo tracking for history changes. This is managed by dt_dev_undo_start_record()
294 // / dt_dev_undo_end_record() and stores "before" snapshots until the outermost
295 // change completes.
300
301 // Out-of-history transient param channel. Lets the focused module (e.g. drawlayer realtime stroke,
302 // ashift/crop edit mode) push a thread-safe snapshot of its in-progress params to the pipeline for
303 // rendering, WITHOUT writing permanent history (so undo is not polluted and the database is not
304 // touched per frame). The pipe reads these from its own thread under the mutex and feeds them to
305 // commit_params(), so the transient state reaches the cache through the normal piece->global_hash
306 // mechanism. Only one module (the focused gui_module) is ever active. See dev_transient API in
307 // dev_history.{c,h}.
308 struct
309 {
310 struct dt_iop_module_t *module; // owning module, NULL when inactive
311 void *params; // malloc'd copy of the module's transient params
312 int32_t params_size;
313 void *blend_params; // malloc'd copy of transient blend params, or NULL
314 int32_t blend_size;
315 uint64_t serial; // bumped on every publish, for change detection
317 dt_pthread_mutex_t transient_params_mutex;
318
319 // profiles info
321
322 // histogram for display.
325
326 // list of forms iop can use for masks or whatever
328
329 // integrity hash of forms
331 // forms have been added or removed or changed and need to be committed to history
334 // all forms to be linked here for cleanup:
336
337 // Mutex lock protecting masks, shapes, etc.
338 // aka dev->forms and dev->all_forms
340
341 dt_backbuf_t raw_histogram; // preview raw-stage histogram, currently sampled from initialscale output
342 dt_backbuf_t output_histogram; // backbuf to prepare the display-agnostic output histogram (in the middle of colorout)
343 dt_backbuf_t display_histogram; // backbuf to prepare the display-referred output histogram (at the far end of the pipe)
344
345 // Track history changes from C.
346 // This is updated when history is changed, read or written.
347 dt_atomic_uint64 history_hash;
348
349 // Darkroom pipelines are running fulltime in background until leaving darkroom.
350 // Set that to TRUE once they get shutdown.
352
386 struct
387 {
388 struct dt_iop_module_t *module;
391 int kind;
393 gboolean enabled;
396
405 gboolean (*refresh_global_picker)(struct dt_lib_module_t *self);
406
412
416
417 /* proxy for communication between plugins and develop/darkroom */
418 struct
419 {
420 // snapshots plugin hooks
421 struct
422 {
423 // this flag is set by snapshot plugin to signal that expose of darkroom
424 // should store cairo surface as snapshot to disk using filename.
425 gboolean request;
426 const gchar *filename;
428
429 // masks plugin hooks
430 struct
431 {
432 struct dt_lib_module_t *module;
433 /* treview list refresh */
435 void (*list_remove)(struct dt_lib_module_t *self, int formid, int parentid);
437 /* selected forms change */
438 void (*selection_change)(struct dt_lib_module_t *self, struct dt_iop_module_t *module, const int selectid, const int throw_event);
440
441 // what is the ID of the module currently doing pipeline chromatic adaptation ?
442 // this is to prevent multiple modules/instances from doing white balance globally.
443 // only used to display warnings in GUI of modules that should probably not be doing white balance
445
446 // is the WB module using D65 illuminant and not doing full chromatic adaptation ?
447 gboolean wb_is_D65;
449
451
452 // for the overexposure indicator
453 struct
454 {
455 GtkWidget *floating_window, *button; // yes, having gtk stuff in here is ugly. live with it.
456
457 gboolean enabled;
459 float lower;
460 float upper;
463
464 // for the raw overexposure indicator
465 struct
466 {
467 GtkWidget *floating_window, *button; // yes, having gtk stuff in here is ugly. live with it.
468
469 gboolean enabled;
474
475 struct
476 {
477 GtkWidget *floating_window, *button; // 10 years later, still ugly
478
482
483 // ISO 12646-compliant colour assessment conditions
484 struct
485 {
486 GtkWidget *button; // yes, ugliness is the norm. what did you expect ?
487 gboolean enabled;
489
490 // the display profile related things (softproof, gamut check, profiles ...)
491 struct
492 {
495
496 // progress bar
497 struct
498 {
499 int total, completed;
501
502 gboolean darkroom_skip_mouse_events; // skip mouse events for masks
503 gboolean mask_lock;
504
506
509
511{
513}
514
515static inline void dt_dev_set_history_hash(dt_develop_t *dev, const uint64_t history_hash)
516{
517 dt_atomic_set_uint64(&dev->history_hash, history_hash);
518}
519
520#ifdef __cplusplus
521extern "C" {
522#endif
523
524void dt_dev_init(dt_develop_t *dev, int32_t gui_attached);
527
534
535// Optionally prefetch `DT_MIPMAP_FULL`, then refresh dev->image_storage from the image cache.
536// Returns a status code to differentiate missing source image data from DB/cache failures.
538
539// Start background pipeline threads. They run fulltime until we close darkroom,
540// so no need to recall that
542
543dt_dev_image_storage_t dt_dev_load_image(dt_develop_t *dev, const int32_t imgid);
545int dt_dev_is_current_image(dt_develop_t *dev, int32_t imgid);
546
547void dt_dev_get_processed_size(const dt_develop_t *dev, int *procw, int *proch);
548
549float dt_dev_get_zoom_scale(const dt_develop_t *dev, gboolean preview);
550
551// Set all the params of a backbuffer at once
552void dt_dev_set_backbuf(dt_backbuf_t *backbuf, const int width, const int height, const size_t bpp,
553 const int64_t hash, const int64_t history_hash);
554
567void dt_dev_coordinates_widget_to_image_norm(dt_develop_t *dev, float *points, size_t num_points);
581void dt_dev_coordinates_widget_delta_to_image_delta(dt_develop_t *dev, float *points, size_t num_points);
582void dt_dev_coordinates_image_norm_to_widget(dt_develop_t *dev, float *points, size_t num_points);
583void dt_dev_coordinates_image_norm_to_image_abs(dt_develop_t *dev, float *points, size_t num_points);
584void dt_dev_coordinates_image_abs_to_image_norm(dt_develop_t *dev, float *points, size_t num_points);
585void dt_dev_coordinates_raw_abs_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points);
586void dt_dev_coordinates_raw_norm_to_raw_abs(dt_develop_t *dev, float *points, size_t num_points);
587void dt_dev_coordinates_image_norm_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points);
588void dt_dev_coordinates_raw_norm_to_image_norm(dt_develop_t *dev, float *points, size_t num_points);
589void dt_dev_coordinates_image_norm_to_preview_abs(dt_develop_t *dev, float *points, size_t num_points);
590void dt_dev_coordinates_preview_abs_to_image_norm(dt_develop_t *dev, float *points, size_t num_points);
591void dt_dev_coordinates_image_abs_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points);
592
604void dt_dev_retrieve_full_pos(dt_develop_t *dev, const int px, const int py, float *mouse_x, float *mouse_y);
605
606void dt_dev_configure_real(dt_develop_t *dev, int wd, int ht);
607#define dt_dev_configure(dev, wd, ht) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_configure_real, (dev), (wd), (ht))
608
618void dt_dev_check_zoom_pos_bounds(dt_develop_t *dev, float *dev_x, float *dev_y, float *box_w, float *box_h);
619
620/*
621 * modulegroups helpers
622 */
627
629void dt_dev_snapshot_request(dt_develop_t *dev, const char *filename);
630
631/*
632 * masks plugin hooks
633 */
636void dt_dev_masks_list_remove(dt_develop_t *dev, int formid, int parentid);
637void dt_dev_masks_selection_change(dt_develop_t *dev, struct dt_iop_module_t *module, const int selectid, const int throw_event);
638
641
642/*
643 * multi instances
644 */
651
653gchar *dt_dev_get_multi_name(const struct dt_iop_module_t *module);
655gchar *dt_dev_get_masks_group_name(const struct dt_iop_module_t *module);
656gchar *dt_history_item_get_name(const struct dt_iop_module_t *module);
657gchar *dt_history_item_get_name_html(const struct dt_iop_module_t *module);
658
660gchar *dt_history_item_get_label(const struct dt_iop_module_t *module);
661
662
663/*
664 * distort functions
665 */
667int dt_dev_coordinates_raw_abs_to_image_abs(dt_develop_t *dev, float *points, size_t points_count);
669int dt_dev_coordinates_image_abs_to_raw_abs(dt_develop_t *dev, float *points, size_t points_count);
671int dt_dev_distort_transform_plus(const struct dt_dev_pixelpipe_t *pipe, const double iop_order, const int transf_direction,
672 float *points, size_t points_count);
675 const int transf_direction, float *points, size_t points_count);
677int dt_dev_distort_backtransform_plus(const struct dt_dev_pixelpipe_t *pipe, const double iop_order, const int transf_direction,
678 float *points, size_t points_count);
679
682 struct dt_iop_module_t *module);
683
684/*
685 * history undo support helpers for darkroom
686 */
687
688/* all history change must be enclosed into a start / end call */
691
692// Getter and setter for global mask lock (GUI)
693// Can be overriden by key accels
694
696void dt_masks_set_lock_mode(dt_develop_t *dev, gboolean mode);
697
698// Count all the mask forms used x history entries, up to a certain threshold.
699// Stop counting when the threshold is reached, for performance.
700guint dt_dev_mask_history_overload(GList *dev_history, guint threshold);
701
702// Write the `darktable|changed` tag on the current picture upon history modification
703void dt_dev_append_changed_tag(const int32_t imgid);
704
705// This needs to run after `dt_dev_pixelpipe_get_roi_out()` so `pipe->processed_width`
706// and `pipe->processed_height` are defined.
707// Natural scale is the rescaling factor such that the full-res pipeline output
708// (real or virtual) fits within darkroom widget area (minus borders/margins)
710
711// Get the final size of the main thumbnail that fits within darkroom central widget
712// Needs to be recomputed when module parameters change (for modules changing ROI)
713// or when the widget is resized.
715
728 const struct dt_iop_roi_t *roi);
729
738
749
762float dt_dev_get_widget_zoom_scale(const dt_develop_t *dev, float scaling);
763
770void dt_dev_get_widget_center(const dt_develop_t *dev, float *point);
771
785void dt_dev_get_image_box_in_widget(const dt_develop_t *dev, int32_t width, int32_t height, float *box);
786
798
799// Get the current pipeline zoom factor in image-space units ( scaling * natural_scale ).
800float dt_dev_get_zoom_level(const dt_develop_t *dev);
801
802// Reset darkroom ROI scaling and position
804
819 const dt_dev_roi_space_t from, const dt_dev_roi_space_t to);
820
831gboolean dt_dev_clip_roi(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height);
832
842gboolean dt_dev_rescale_roi(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height);
843
853gboolean dt_dev_rescale_roi_to_input(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height);
854
862
870// Update the mouse bounding box size according to current zoom level, dpp and DPI.
872
873#ifdef __cplusplus
874}
875#endif
876
877// clang-format off
878// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
879// vim: shiftwidth=2 expandtab tabstop=2 cindent
880// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
881// 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:66
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
static const float scaling
const float threshold
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
void dt_dev_signal_modules_moved(dt_develop_t *dev)
Definition develop.c:1672
void dt_dev_masks_list_change(dt_develop_t *dev)
Definition develop.c:1240
void dt_dev_coordinates_image_abs_to_image_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1128
float dt_dev_get_natural_scale(dt_develop_t *dev)
Definition develop.c:1768
void dt_dev_get_processed_size(const dt_develop_t *dev, int *procw, int *proch)
Definition develop.c:1032
static uint64_t dt_dev_get_history_hash(const dt_develop_t *dev)
Definition develop.h:510
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:1713
dt_dev_overexposed_colorscheme_t
Definition develop.h:71
@ DT_DEV_OVEREXPOSED_PURPLEGREEN
Definition develop.h:74
@ DT_DEV_OVEREXPOSED_REDBLUE
Definition develop.h:73
@ DT_DEV_OVEREXPOSED_BLACKWHITE
Definition develop.h:72
void dt_dev_coordinates_preview_abs_to_image_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1212
int dt_dev_get_thumbnail_size(dt_develop_t *dev)
Definition develop.c:356
int dt_dev_coordinates_raw_abs_to_image_abs(dt_develop_t *dev, float *points, size_t points_count)
Definition develop.c:1589
void dt_dev_coordinates_raw_norm_to_raw_abs(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1162
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:1794
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:1788
void dt_dev_cleanup(dt_develop_t *dev)
Definition develop.c:225
void dt_dev_module_remove(dt_develop_t *dev, struct dt_iop_module_t *module)
Definition develop.c:1342
dt_dev_overlay_colors_t
Definition develop.h:78
@ DT_DEV_OVERLAY_CYAN
Definition develop.h:83
@ DT_DEV_OVERLAY_YELLOW
Definition develop.h:82
@ DT_DEV_OVERLAY_RED
Definition develop.h:80
@ DT_DEV_OVERLAY_GREEN
Definition develop.h:81
@ DT_DEV_OVERLAY_GRAY
Definition develop.h:79
@ DT_DEV_OVERLAY_MAGENTA
Definition develop.h:84
dt_dev_pixelpipe_display_mask_t
Definition develop.h:116
@ DT_DEV_PIXELPIPE_DISPLAY_a
Definition develop.h:122
@ DT_DEV_PIXELPIPE_DISPLAY_OUTPUT
Definition develop.h:120
@ DT_DEV_PIXELPIPE_DISPLAY_G
Definition develop.h:125
@ DT_DEV_PIXELPIPE_DISPLAY_L
Definition develop.h:121
@ DT_DEV_PIXELPIPE_DISPLAY_CHANNEL
Definition develop.h:119
@ DT_DEV_PIXELPIPE_DISPLAY_ANY
Definition develop.h:138
@ DT_DEV_PIXELPIPE_DISPLAY_LCH_h
Definition develop.h:129
@ DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_hz
Definition develop.h:135
@ DT_DEV_PIXELPIPE_DISPLAY_HSL_H
Definition develop.h:130
@ DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU_MONO
Definition develop.h:137
@ DT_DEV_PIXELPIPE_DISPLAY_HSL_S
Definition develop.h:131
@ DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_Cz
Definition develop.h:134
@ DT_DEV_PIXELPIPE_DISPLAY_LCH_C
Definition develop.h:128
@ DT_DEV_PIXELPIPE_DISPLAY_b
Definition develop.h:123
@ DT_DEV_PIXELPIPE_DISPLAY_STICKY
Definition develop.h:139
@ DT_DEV_PIXELPIPE_DISPLAY_MASK
Definition develop.h:118
@ DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_Jz
Definition develop.h:133
@ DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU
Definition develop.h:136
@ DT_DEV_PIXELPIPE_DISPLAY_NONE
Definition develop.h:117
@ DT_DEV_PIXELPIPE_DISPLAY_HSL_l
Definition develop.h:132
@ DT_DEV_PIXELPIPE_DISPLAY_GRAY
Definition develop.h:127
@ DT_DEV_PIXELPIPE_DISPLAY_B
Definition develop.h:126
@ DT_DEV_PIXELPIPE_DISPLAY_R
Definition develop.h:124
void dt_dev_modulegroups_switch_tab(dt_develop_t *dev, struct dt_iop_module_t *module)
Definition develop.c:1234
dt_dev_transform_direction_t
Definition develop.h:101
@ DT_DEV_TRANSFORM_DIR_BACK_EXCL
Definition develop.h:106
@ DT_DEV_TRANSFORM_DIR_BACK_INCL
Definition develop.h:105
@ DT_DEV_TRANSFORM_DIR_FORW_INCL
Definition develop.h:103
@ DT_DEV_TRANSFORM_DIR_ALL
Definition develop.h:102
@ DT_DEV_TRANSFORM_DIR_FORW_EXCL
Definition develop.h:104
float dt_dev_get_overlay_scale(dt_develop_t *dev)
Get the overlay scale factor in GUI logical coordinates.
Definition develop.c:1783
void dt_dev_append_changed_tag(const int32_t imgid)
Definition develop.c:1736
dt_dev_image_storage_t dt_dev_load_image(dt_develop_t *dev, const int32_t imgid)
Definition develop.c:940
void dt_dev_coordinates_image_norm_to_preview_abs(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1197
float dt_dev_get_zoom_level(const dt_develop_t *dev)
Definition develop.c:1816
void dt_dev_coordinates_image_norm_to_widget(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1084
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:1255
void dt_dev_init(dt_develop_t *dev, int32_t gui_attached)
Definition develop.c:128
int dt_dev_is_current_image(dt_develop_t *dev, int32_t imgid)
Definition develop.c:1229
void dt_dev_undo_start_record(dt_develop_t *dev)
Definition develop.c:1678
dt_dev_rawoverexposed_mode_t
Definition develop.h:87
@ DT_DEV_RAWOVEREXPOSED_MODE_FALSECOLOR
Definition develop.h:90
@ DT_DEV_RAWOVEREXPOSED_MODE_MARK_CFA
Definition develop.h:88
@ DT_DEV_RAWOVEREXPOSED_MODE_MARK_SOLID
Definition develop.h:89
void dt_dev_snapshot_request(dt_develop_t *dev, const char *filename)
Definition develop.c:1262
gboolean dt_masks_get_lock_mode(dt_develop_t *dev)
Definition develop.c:1701
dt_dev_roi_space_t
Definition develop.h:110
@ DT_DEV_ROI_GUI_LOGICAL
Definition develop.h:112
@ DT_DEV_ROI_PIPELINE
Definition develop.h:111
gchar * dt_history_item_get_label(const struct dt_iop_module_t *module)
Definition develop.c:1511
void dt_dev_coordinates_raw_norm_to_image_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1184
gchar * dt_history_item_get_name_html(const struct dt_iop_module_t *module)
Definition develop.c:1573
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:997
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:1915
dt_develop_detail_mask_t
Definition develop.h:143
@ DT_DEV_DETAIL_MASK_ENABLED
Definition develop.h:145
@ DT_DEV_DETAIL_MASK_NONE
Definition develop.h:144
dt_clipping_preview_mode_t
Definition develop.h:149
@ DT_CLIPPING_PREVIEW_ANYRGB
Definition develop.h:151
@ DT_CLIPPING_PREVIEW_GAMUT
Definition develop.h:150
@ DT_CLIPPING_PREVIEW_SATURATION
Definition develop.h:153
@ DT_CLIPPING_PREVIEW_LUMINANCE
Definition develop.h:152
void dt_dev_reset_roi(dt_develop_t *dev)
Definition develop.c:1822
struct dt_iop_module_t * dt_dev_module_duplicate(dt_develop_t *dev, struct dt_iop_module_t *base)
Definition develop.c:1270
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:1957
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:1905
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:1177
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:975
void dt_dev_masks_update_hash(dt_develop_t *dev)
Definition develop.c:1745
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:1852
static void dt_dev_set_history_hash(dt_develop_t *dev, const uint64_t history_hash)
Definition develop.h:515
dt_dev_rawoverexposed_colorscheme_t
Definition develop.h:93
@ DT_DEV_RAWOVEREXPOSED_RED
Definition develop.h:94
@ DT_DEV_RAWOVEREXPOSED_BLUE
Definition develop.h:96
@ DT_DEV_RAWOVEREXPOSED_BLACK
Definition develop.h:97
@ DT_DEV_RAWOVEREXPOSED_GREEN
Definition develop.h:95
int dt_dev_coordinates_image_abs_to_raw_abs(dt_develop_t *dev, float *points, size_t points_count)
Definition develop.c:1594
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:1801
void dt_dev_undo_end_record(dt_develop_t *dev)
Definition develop.c:1689
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:1895
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:1039
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:1830
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:1777
dt_dev_image_storage_t dt_dev_ensure_image_storage(dt_develop_t *dev, const int32_t imgid)
Definition develop.c:900
dt_dev_image_storage_t
Definition develop.h:529
@ DT_DEV_IMAGE_STORAGE_DB_NOT_READ
Definition develop.h:532
@ DT_DEV_IMAGE_STORAGE_OK
Definition develop.h:530
@ DT_DEV_IMAGE_STORAGE_MIPMAP_NOT_FOUND
Definition develop.h:531
void dt_dev_modules_update_multishow(dt_develop_t *dev)
Definition develop.c:1443
void dt_dev_coordinates_image_norm_to_image_abs(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1113
guint dt_dev_mask_history_overload(GList *dev_history, guint threshold)
gchar * dt_dev_get_masks_group_name(const struct dt_iop_module_t *module)
Definition develop.c:1543
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:1056
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:1940
void dt_dev_masks_list_update(dt_develop_t *dev)
Definition develop.c:1245
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:1535
void dt_dev_masks_list_remove(dt_develop_t *dev, int formid, int parentid)
Definition develop.c:1250
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:933
void dt_dev_coordinates_raw_abs_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1145
void dt_dev_coordinates_image_abs_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points)
Definition develop.c:1191
gchar * dt_history_item_get_name(const struct dt_iop_module_t *module)
Definition develop.c:1557
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:1657
void dt_dev_start_all_pipelines(dt_develop_t *dev)
Definition develop.c:864
int bpp
float dt_aligned_pixel_t[4]
struct _GtkWidget GtkWidget
Definition splash.h:29
unsigned __int64 uint64_t
Definition strptime.c:75
void(* list_update)(struct dt_lib_module_t *self)
Definition develop.h:436
int32_t height
Definition develop.h:189
int32_t gui_attached
Definition develop.h:162
struct dt_develop_t::@21 color_picker
Authoritative darkroom color-picker state.
cairo_surface_t * image_surface
Definition develop.h:505
GList * iop_order_list
Definition develop.h:291
int undo_history_before_end
Definition develop.h:298
dt_image_t image_storage
Definition develop.h:259
int picker_cst
Definition develop.h:392
int32_t orig_height
Definition develop.h:205
struct dt_colorpicker_sample_t * primary_sample
Definition develop.h:397
int iop_order_version
Definition develop.h:290
struct dt_develop_t::@22::@30 masks
GList * undo_history_before_snapshot
Definition develop.h:297
struct dt_develop_t::@19 roi
gboolean output_inited
Definition develop.h:242
dt_dev_rawoverexposed_colorscheme_t colorscheme
Definition develop.h:471
int32_t border_size
Definition develop.h:200
dt_backbuf_t display_histogram
Definition develop.h:343
uint32_t * histogram_pre_levels
Definition develop.h:323
GList * iop
Definition develop.h:285
gboolean request
Definition develop.h:425
struct dt_develop_t::@23 overexposed
gboolean update_pending
Definition develop.h:394
int32_t raw_height
Definition develop.h:228
dt_backbuf_t output_histogram
Definition develop.h:342
int32_t preview_height
Definition develop.h:213
int32_t history_end
Definition develop.h:272
uint64_t wait_output_hash
Definition develop.h:409
GList * undo_history_before_iop_order_list
Definition develop.h:299
GtkWidget * widget
Definition develop.h:390
gboolean wb_is_D65
Definition develop.h:447
gboolean(* refresh_global_picker)(struct dt_lib_module_t *self)
Definition develop.h:405
struct dt_iop_module_t * pending_module
Definition develop.h:413
gboolean restrict_histogram
Definition develop.h:402
struct dt_develop_t::@22 proxy
int statistic
Definition develop.h:403
void(* list_remove)(struct dt_lib_module_t *self, int formid, int parentid)
Definition develop.h:435
int completed
Definition develop.h:499
struct dt_iop_module_t * gui_module
Definition develop.h:165
dt_pthread_rwlock_t history_mutex
Definition develop.h:263
GSList * samples
Definition develop.h:398
gboolean live_samples_enabled
Definition develop.h:401
dt_clipping_preview_mode_t mode
Definition develop.h:461
gboolean gui_inited
Definition develop.h:236
struct dt_develop_t::@25 display
float brightness
Definition develop.h:479
dt_atomic_uint64 history_hash
Definition develop.h:347
struct dt_lib_module_t *void(* list_change)(struct dt_lib_module_t *self)
Definition develop.h:434
gboolean forms_changed
Definition develop.h:332
uint64_t serial
Definition develop.h:315
GtkWidget * floating_window
Definition develop.h:455
float lower
Definition develop.h:459
struct dt_dev_pixelpipe_t * preview_pipe
Definition develop.h:247
dt_dev_pixelpipe_cache_wait_t output_wait
Definition develop.h:411
struct dt_develop_t::@20 transient_params
gboolean pipelines_started
Definition develop.h:351
GList * history
Definition develop.h:275
struct dt_develop_t::@28 progress
struct dt_dev_pixelpipe_t * virtual_pipe
Definition develop.h:251
dt_atomic_int mask_preview_settings_revision
Revision of the global mask-preview appearance.
Definition develop.h:176
GList * allprofile_info
Definition develop.h:320
gboolean darkroom_skip_mouse_events
Definition develop.h:502
struct dt_iop_module_t *void * params
Definition develop.h:310
GList * alliop
Definition develop.h:287
dt_aligned_pixel_t wb_coeffs
Definition develop.h:448
struct dt_iop_module_t *struct dt_iop_color_picker_t * picker
Definition develop.h:389
dt_dev_overexposed_colorscheme_t colorscheme
Definition develop.h:458
struct dt_develop_t::@27 profile
GList * allforms
Definition develop.h:335
dt_backbuf_t raw_histogram
Definition develop.h:341
struct dt_develop_t::@26 iso_12646
float scaling
Definition develop.h:193
struct dt_masks_form_gui_t * form_gui
Definition develop.h:333
GtkWidget * button
Definition develop.h:455
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:438
struct dt_colorpicker_sample_t * selected_sample
Definition develop.h:399
uint32_t * histogram_pre_tonecurve
Definition develop.h:323
uint64_t wait_input_hash
Definition develop.h:408
guint refresh_idle_source
Definition develop.h:395
uint32_t histogram_pre_levels_max
Definition develop.h:324
int32_t processed_height
Definition develop.h:233
struct dt_dev_pixelpipe_t * pending_pipe
Definition develop.h:414
struct dt_lib_module_t * histogram_module
Definition develop.h:404
GtkWidget * gamut_button
Definition develop.h:493
struct dt_iop_module_t * chroma_adaptation
Definition develop.h:444
gboolean mask_lock
Definition develop.h:503
gboolean enabled
Definition develop.h:393
dt_atomic_int history_write_pending
Definition develop.h:281
dt_pthread_mutex_t transient_params_mutex
Definition develop.h:317
int32_t iop_instance
Definition develop.h:284
dt_pthread_rwlock_t masks_mutex
Definition develop.h:339
uint64_t forms_hash
Definition develop.h:330
dt_dev_rawoverexposed_mode_t mode
Definition develop.h:470
struct dt_develop_t::@22::@29 snapshot
const gchar * filename
Definition develop.h:426
uint32_t histogram_pre_tonecurve_max
Definition develop.h:324
float threshold
Definition develop.h:472
uint64_t piece_hash
Definition develop.h:407
int32_t blend_size
Definition develop.h:314
gboolean raw_inited
Definition develop.h:239
struct dt_dev_pixelpipe_t * pipe
Definition develop.h:247
float upper
Definition develop.h:460
GtkWidget * softproof_button
Definition develop.h:493
gboolean display_samples
Definition develop.h:400
dt_dev_pixelpipe_cache_wait_t input_wait
Definition develop.h:410
GList * forms
Definition develop.h:327
struct dt_develop_t::@24 rawoverexposed
int undo_history_depth
Definition develop.h:296
void * blend_params
Definition develop.h:313
gboolean loading_cache
Definition develop.h:507
int32_t params_size
Definition develop.h:312
int32_t main_height
Definition develop.h:220
float natural_scale
Definition develop.h:224
struct dt_develop_t * dev
Definition imageop.h:296
Region of interest passed through the pixelpipe.
Definition imageop.h:72