![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/darktable.h"#include "bauhaus/bauhaus.h"#include "common/debug.h"#include "common/file_location.h"#include "common/history.h"#include "common/iop_order.h"#include "common/mipmap_cache.h"#include "control/conf.h"#include "control/control.h"#include "develop/develop.h"#include "develop/dev_history.h"#include "develop/pixelpipe_cache.h"#include "develop/pixelpipe_hb.h"#include "gui/gtk.h"#include "gui/draw.h"#include "libs/lib.h"#include "libs/lib_api.h"
Include dependency graph for snapshots.c:Go to the source code of this file.
Data Structures | |
| struct | dt_lib_snapshot_t |
| struct | dt_lib_snapshots_t |
Macros | |
| #define | DT_LIB_SNAPSHOTS_COUNT 4 |
| #define | SNAP_LOG(...) dt_print(DT_DEBUG_DEV, __VA_ARGS__) |
| #define | HANDLE_SIZE DT_PIXEL_APPLY_DPI_DPP(36) |
Typedefs | |
| typedef struct dt_lib_snapshot_t | dt_lib_snapshot_t |
| typedef struct dt_lib_snapshots_t | dt_lib_snapshots_t |
Functions | |
| static void | _lib_snapshots_add_button_clicked_callback (GtkWidget *widget, gpointer user_data) |
| static void | _lib_snapshots_toggled_callback (GtkToggleButton *widget, gpointer user_data) |
| static void | _lib_snapshot_clear_state (dt_lib_snapshot_t *snap) |
| static int | _lib_snapshot_capture_state (dt_lib_snapshot_t *snapshot, dt_develop_t *source) |
| Freeze the current darkroom develop state into one snapshot-local develop context. | |
| static int | _lib_snapshots_refresh_pipe_image (dt_lib_module_t *self, dt_lib_snapshot_t *snap) |
| Recompute the selected snapshot image from a dedicated preview pipe at one history fence. | |
| const char * | name (struct dt_lib_module_t *self) |
| const char ** | views (dt_lib_module_t *self) |
| uint32_t | container (dt_lib_module_t *self) |
| int | position () |
| static void | _draw_sym (cairo_t *cr, float x, float y, gboolean vertical, gboolean inverted) |
| void | gui_post_expose (dt_lib_module_t *self, cairo_t *cri, int32_t width, int32_t height, int32_t pointerx, int32_t pointery) |
| int | button_released (struct dt_lib_module_t *self, double x, double y, int which, uint32_t state) |
| int | button_pressed (struct dt_lib_module_t *self, double x, double y, double pressure, int which, int type, uint32_t state) |
| int | mouse_moved (dt_lib_module_t *self, double x, double y, double pressure, int which) |
| void | gui_reset (dt_lib_module_t *self) |
| void | gui_init (dt_lib_module_t *self) |
| void | gui_cleanup (dt_lib_module_t *self) |
Variables | |
| static int | _lib_snapshot_rotation_cnt = 0 |
| #define DT_LIB_SNAPSHOTS_COUNT 4 |
Definition at line 61 of file snapshots.c.
| #define HANDLE_SIZE DT_PIXEL_APPLY_DPI_DPP(36) |
Definition at line 63 of file snapshots.c.
| #define SNAP_LOG | ( | ... | ) | dt_print(DT_DEBUG_DEV, __VA_ARGS__) |
Definition at line 62 of file snapshots.c.
| typedef struct dt_lib_snapshot_t dt_lib_snapshot_t |
| typedef struct dt_lib_snapshots_t dt_lib_snapshots_t |
|
static |
Definition at line 400 of file snapshots.c.
References darktable_t::bauhaus, darktable, dt_draw_set_color_overlay(), DT_PIXEL_APPLY_DPI, FALSE, inv, dt_bauhaus_t::pango_font_desc, and x.
Referenced by gui_post_expose().
|
static |
Freeze the current darkroom develop state into one snapshot-local develop context.
This deep-copies the in-memory history stack and module order from the live darkroom context, so each snapshot remains stable even if the user later edits darktable.develop or rewrites history in the database.
| snapshot | destination snapshot slot. |
| source | live darkroom develop context. |
Definition at line 137 of file snapshots.c.
References _lib_snapshot_clear_state(), dt_lib_snapshot_t::develop, dt_dev_cleanup(), dt_dev_create_module_instance(), dt_dev_get_history_end_ext(), dt_dev_get_module_instance(), dt_dev_history_compute_hash(), dt_dev_history_free_history(), dt_dev_init(), dt_dev_load_image(), dt_dev_set_history_end_ext(), dt_dev_set_history_hash(), dt_free, dt_free_gpointer(), dt_history_duplicate(), dt_iop_get_module_by_op_priority(), dt_ioppr_iop_order_copy_deep(), dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, FALSE, dt_develop_t::history, dt_lib_snapshot_t::history_end, dt_develop_t::history_mutex, dt_image_t::id, dt_develop_t::image_storage, dt_lib_snapshot_t::imgid, dt_develop_t::iop, dt_develop_t::iop_order_list, IS_NULL_PTR, dt_dev_history_item_t::multi_name, dt_dev_history_item_t::multi_priority, dt_dev_history_item_t::op_name, and SNAP_LOG.
Referenced by _lib_snapshots_add_button_clicked_callback().
|
static |
Definition at line 112 of file snapshots.c.
References dt_lib_snapshot_t::develop, dt_dev_cleanup(), dt_free, dt_lib_snapshot_t::history_end, dt_lib_snapshot_t::imgid, IS_NULL_PTR, dt_lib_snapshot_t::sample_scale, and UNKNOWN_IMAGE.
Referenced by _lib_snapshot_capture_state(), _lib_snapshots_add_button_clicked_callback(), gui_cleanup(), and gui_reset().
|
static |
Definition at line 792 of file snapshots.c.
References _lib_snapshot_capture_state(), _lib_snapshot_clear_state(), dt_lib_snapshot_t::button, d, darktable, dt_lib_module_t::data, darktable_t::develop, dt_dev_get_history_end_ext(), dt_free, dt_history_item_get_name(), dt_develop_t::history, IS_NULL_PTR, k, name, dt_develop_t::roi, dt_develop_t::x, dt_develop_t::y, dt_lib_snapshot_t::zoom_x, and dt_lib_snapshot_t::zoom_y.
Referenced by gui_init().
|
static |
Recompute the selected snapshot image from a dedicated preview pipe at one history fence.
We intentionally process a preview-style full-image buffer and keep it in a cairo surface. This lets ROI pan/zoom updates reuse the same pixels through the darkroom transform only, so interactive navigation does not trigger expensive snapshot recomputations.
| self | snapshots lib module. |
| snap | selected snapshot metadata. |
Definition at line 222 of file snapshots.c.
References dt_dev_pixelpipe_t::backbuf, dt_mipmap_buffer_t::buf, cleanup(), d, darktable, dt_lib_module_t::data, darktable_t::develop, dt_lib_snapshot_t::develop, dt_dev_pixelpipe_t::devid, dt_control_change_cursor_by_name_and_flush(), dt_control_commit_cursor(), dt_dev_backbuf_get_hash(), dt_dev_get_zoom_level(), dt_dev_pixelpipe_cache_peek(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cleanup(), dt_dev_pixelpipe_create_nodes(), dt_dev_pixelpipe_get_roi_out(), dt_dev_pixelpipe_init_preview(), dt_dev_pixelpipe_process(), dt_dev_pixelpipe_propagate_formats(), dt_dev_pixelpipe_set_icc(), dt_dev_pixelpipe_set_input(), dt_dev_pixelpipe_synch_all, DT_MIPMAP_BLOCKING, dt_mipmap_cache_get, dt_mipmap_cache_release, DT_MIPMAP_FULL, dt_pixel_cache_entry_get_size(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, darktable_t::gui, dt_develop_t::gui_attached, dt_mipmap_buffer_t::height, dt_iop_roi_t::height, dt_backbuf_t::height, dt_dev_pixelpipe_t::icc_filename, dt_dev_pixelpipe_t::icc_intent, dt_dev_pixelpipe_t::icc_type, dt_image_t::id, dt_dev_pixelpipe_t::iheight, dt_develop_t::image_storage, IS_NULL_PTR, dt_mipmap_buffer_t::iscale, dt_dev_pixelpipe_t::iwidth, darktable_t::mipmap_cache, darktable_t::pixelpipe_cache, dt_gui_gtk_t::ppd, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processed_height, dt_dev_pixelpipe_t::processed_width, dt_lib_snapshot_t::sample_scale, dt_iop_roi_t::scale, SNAP_LOG, TRUE, dt_mipmap_buffer_t::width, dt_iop_roi_t::width, dt_backbuf_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _lib_snapshots_toggled_callback(), and gui_post_expose().
|
static |
Definition at line 855 of file snapshots.c.
References _lib_snapshots_refresh_pipe_image(), d, dt_lib_module_t::data, dt_lib_snapshot_t::develop, dt_control_queue_redraw_center(), FALSE, IS_NULL_PTR, and k.
Referenced by gui_init().
| int button_pressed | ( | struct dt_lib_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which, | ||
| int | type, | ||
| uint32_t | state | ||
| ) |
Definition at line 598 of file snapshots.c.
References _lib_snapshot_rotation_cnt, d, dt_lib_module_t::data, dt_control_queue_redraw_center(), TRUE, and x.
| int button_released | ( | struct dt_lib_module_t * | self, |
| double | x, | ||
| double | y, | ||
| int | which, | ||
| uint32_t | state | ||
| ) |
Definition at line 580 of file snapshots.c.
References d, dt_lib_module_t::data, FALSE, mouse_moved(), and x.
| uint32_t container | ( | dt_lib_module_t * | self | ) |
Definition at line 389 of file snapshots.c.
References DT_UI_CONTAINER_PANEL_LEFT_CENTER.
| void gui_cleanup | ( | dt_lib_module_t * | self | ) |
Definition at line 776 of file snapshots.c.
References _lib_snapshot_clear_state(), d, dt_lib_module_t::data, dt_free, IS_NULL_PTR, and k.
| void gui_init | ( | dt_lib_module_t * | self | ) |
Definition at line 703 of file snapshots.c.
References _lib_snapshots_add_button_clicked_callback(), _lib_snapshots_toggled_callback(), d, dt_lib_module_t::data, dt_action_button_new(), dt_concat_path_file(), dt_free, DT_GUI_BOX_SPACING, dt_loc_get_tmp_dir(), DT_UI_RESIZE_DYNAMIC, dt_ui_scroll_wrap(), FALSE, k, PATH_MAX, TRUE, UNKNOWN_IMAGE, and dt_lib_module_t::widget.
| void gui_post_expose | ( | dt_lib_module_t * | self, |
| cairo_t * | cri, | ||
| int32_t | width, | ||
| int32_t | height, | ||
| int32_t | pointerx, | ||
| int32_t | pointery | ||
| ) |
Definition at line 425 of file snapshots.c.
References _draw_sym(), _lib_snapshots_refresh_pipe_image(), d, dt_view_manager_t::darkroom, darktable, dt_lib_module_t::data, darktable_t::develop, dt_control_queue_cursor_by_name(), dt_dev_get_image_box_in_widget(), dt_dev_get_zoom_level(), dt_draw_set_color_overlay(), DT_PIXEL_APPLY_DPI, dtgtk_cairo_paint_refresh(), FALSE, darktable_t::gui, HANDLE_SIZE, height, dt_lib_snapshot_t::imgid, IS_NULL_PTR, dt_gui_gtk_t::ppd, dt_view_manager_t::proxy, dt_develop_t::roi, dt_lib_snapshot_t::sample_scale, dt_view_manager_t::set_default_cursor, size, TRUE, view(), dt_view_manager_t::view, darktable_t::view_manager, width, x, dt_develop_t::x, and dt_develop_t::y.
| void gui_reset | ( | dt_lib_module_t * | self | ) |
Definition at line 680 of file snapshots.c.
References _lib_snapshot_clear_state(), d, dt_lib_module_t::data, dt_control_queue_redraw_center(), FALSE, k, and UNKNOWN_IMAGE.
| int mouse_moved | ( | dt_lib_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 645 of file snapshots.c.
References d, dt_lib_module_t::data, dt_control_queue_redraw_center(), DT_GUI_MOUSE_EFFECT_RADIUS, FALSE, HANDLE_SIZE, and x.
Referenced by button_released().
| const char * name | ( | struct dt_lib_module_t * | self | ) |
Definition at line 378 of file snapshots.c.
| int position | ( | ) |
Definition at line 394 of file snapshots.c.
| const char ** views | ( | dt_lib_module_t * | self | ) |
Definition at line 383 of file snapshots.c.
References v.
|
static |
Definition at line 596 of file snapshots.c.
Referenced by button_pressed().