Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
snapshots.c File Reference
#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
 

Macro Definition Documentation

◆ DT_LIB_SNAPSHOTS_COUNT

#define DT_LIB_SNAPSHOTS_COUNT   4

Definition at line 61 of file snapshots.c.

◆ HANDLE_SIZE

#define HANDLE_SIZE   DT_PIXEL_APPLY_DPI_DPP(36)

Definition at line 63 of file snapshots.c.

◆ SNAP_LOG

#define SNAP_LOG (   ...)    dt_print(DT_DEBUG_DEV, __VA_ARGS__)

Definition at line 62 of file snapshots.c.

Typedef Documentation

◆ dt_lib_snapshot_t

◆ dt_lib_snapshots_t

Function Documentation

◆ _draw_sym()

static void _draw_sym ( cairo_t *  cr,
float  x,
float  y,
gboolean  vertical,
gboolean  inverted 
)
static

◆ _lib_snapshot_capture_state()

static int _lib_snapshot_capture_state ( dt_lib_snapshot_t snapshot,
dt_develop_t source 
)
static

◆ _lib_snapshot_clear_state()

◆ _lib_snapshots_add_button_clicked_callback()

◆ _lib_snapshots_refresh_pipe_image()

static int _lib_snapshots_refresh_pipe_image ( dt_lib_module_t self,
dt_lib_snapshot_t snap 
)
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.

Parameters
selfsnapshots lib module.
snapselected snapshot metadata.
Returns
int 0 on success, 1 on failure.

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().

◆ _lib_snapshots_toggled_callback()

static void _lib_snapshots_toggled_callback ( GtkToggleButton *  widget,
gpointer  user_data 
)
static

◆ button_pressed()

int button_pressed ( struct dt_lib_module_t self,
double  x,
double  y,
double  pressure,
int  which,
int  type,
uint32_t  state 
)

◆ button_released()

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.

◆ container()

uint32_t container ( dt_lib_module_t self)

Definition at line 389 of file snapshots.c.

References DT_UI_CONTAINER_PANEL_LEFT_CENTER.

◆ gui_cleanup()

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.

◆ gui_init()

◆ gui_post_expose()

◆ gui_reset()

◆ mouse_moved()

int mouse_moved ( dt_lib_module_t self,
double  x,
double  y,
double  pressure,
int  which 
)

◆ name()

const char * name ( struct dt_lib_module_t self)

Definition at line 378 of file snapshots.c.

◆ position()

int position ( )

Definition at line 394 of file snapshots.c.

◆ views()

const char ** views ( dt_lib_module_t self)

Definition at line 383 of file snapshots.c.

References v.

Variable Documentation

◆ _lib_snapshot_rotation_cnt

int _lib_snapshot_rotation_cnt = 0
static

Definition at line 596 of file snapshots.c.

Referenced by button_pressed().