![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Go to the source code of this file.
Data Structures | |
struct | dt_dev_history_item_t |
Macros | |
#define | DT_IOP_PARAMS_T |
#define | dt_dev_add_history_item(dev, module, enable) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_add_history_item_real, (dev), (module), (enable)) |
Typedefs | |
typedef void | dt_iop_params_t |
typedef struct dt_dev_history_item_t | dt_dev_history_item_t |
Functions | |
void | dt_dev_history_free_history (struct dt_develop_t *dev) |
void | dt_dev_free_history_item (gpointer data) |
gboolean | dt_dev_add_history_item_ext (struct dt_develop_t *dev, struct dt_iop_module_t *module, gboolean enable, gboolean force_new_item, gboolean no_image, gboolean include_masks) |
Append a new history item on dev->history, at dev->history_end position. If history items exist after dev->history_end, they will be removed under certain conditions. | |
void | dt_dev_add_history_item_real (struct dt_develop_t *dev, struct dt_iop_module_t *module, gboolean enable) |
void | dt_dev_write_history_ext (struct dt_develop_t *dev, const int32_t imgid) |
void | dt_dev_write_history (struct dt_develop_t *dev) |
void | dt_dev_read_history_ext (struct dt_develop_t *dev, const int32_t imgid, gboolean no_image) |
void | dt_dev_pop_history_items_ext (struct dt_develop_t *dev) |
void | dt_dev_pop_history_items (struct dt_develop_t *dev) |
void | dt_dev_reload_history_items (struct dt_develop_t *dev) |
void | dt_dev_invalidate_history_module (GList *list, struct dt_iop_module_t *module) |
uint64_t | dt_dev_history_get_hash (struct dt_develop_t *dev) |
Get the integrity checksum of the whole history stack. | |
int | dt_dev_history_auto_save (struct dt_develop_t *dev) |
Write history to DB and XMP only if the integrety hash has changed since first reading history, or since prior saving point. Callback function meant to be used with g_timeout, or standalone. | |
int32_t | dt_dev_get_history_end (struct dt_develop_t *dev) |
void | dt_dev_set_history_end (struct dt_develop_t *dev, const uint32_t index) |
gboolean | dt_history_module_skip_copy (const int flags) |
int | dt_history_merge_module_into_history (struct dt_develop_t *dev_dest, struct dt_develop_t *dev_src, struct dt_iop_module_t *mod_src, GList **_modules_used) |
int | dt_history_copy_and_paste_on_image (int32_t imgid, int32_t dest_imgid, GList *ops, gboolean copy_iop_order, const gboolean copy_full) |
void | dt_dev_history_compress (struct dt_develop_t *dev) |
Compress an history from a loaded pipeline, aka simply take a snapshot of all modules parameters. This assumes the history end is properly set, which always happens after calling _pop_history_item. | |
The common/history.h
defines methods to handle histories from/to database. They work out of any GUI or development stack, so they don't care about modules .so. This file defines binders between that and the GUI/dev objects.
#define dt_dev_add_history_item | ( | dev, | |
module, | |||
enable | |||
) | DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_DEV, dt_dev_add_history_item_real, (dev), (module), (enable)) |
#define DT_IOP_PARAMS_T |
typedef struct dt_dev_history_item_t dt_dev_history_item_t |
typedef void dt_iop_params_t |
gboolean dt_dev_add_history_item_ext | ( | struct dt_develop_t * | dev, |
struct dt_iop_module_t * | module, | ||
gboolean | enable, | ||
gboolean | force_new_item, | ||
gboolean | no_image, | ||
gboolean | include_masks | ||
) |
Append a new history item on dev->history, at dev->history_end position. If history items exist after dev->history_end, they will be removed under certain conditions.
dev | |
module | |
enable | |
force_new_item | |
no_image | |
include_masks |
References _get_last_history_item_for_module(), _remove_history_leaks(), dt_dev_history_item_t::blend_params, dt_iop_module_t::blend_params, DT_DEBUG_HISTORY, dt_dev_set_history_end(), dt_iop_check_modules_equal(), dt_iop_compute_module_hash(), dt_masks_dup_forms_deep(), dt_masks_free_form(), dt_print(), dt_dev_history_item_t::enabled, dt_iop_module_t::enabled, FALSE, dt_dev_history_item_t::forms, dt_develop_t::forms, dt_develop_t::forms_changed, dt_dev_history_item_t::hash, dt_develop_t::history, dt_dev_history_item_t::iop_order, dt_dev_history_item_t::multi_name, dt_iop_module_t::multi_name, dt_dev_history_item_t::multi_priority, dt_dev_history_item_t::num, dt_iop_module_t::op, dt_dev_history_item_t::op_name, dt_dev_history_item_t::params, dt_iop_module_t::params, dt_iop_module_t::params_size, and void().
Referenced by _insert_default_modules(), dt_dev_add_history_item_real(), dt_dev_history_compress(), and dt_history_merge_module_into_history().
void dt_dev_add_history_item_real | ( | struct dt_develop_t * | dev, |
struct dt_iop_module_t * | module, | ||
gboolean | enable | ||
) |
References AUTO_SAVE_TIMEOUT, dt_develop_t::auto_save_timeout, dt_develop_blend_params_t::blend_mode, dt_iop_module_t::blend_params, darktable, DEVELOP_MASK_RASTER, dt_atomic_set_int(), dt_dev_add_history_item_ext(), dt_dev_get_history_end(), dt_dev_history_auto_save(), dt_dev_invalidate_all, dt_dev_masks_list_update(), dt_dev_pixelpipe_resync_all(), dt_dev_refresh_ui_images, dt_dev_undo_end_record(), dt_dev_undo_start_record(), dt_iop_gui_set_enable_button(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, dt_dev_history_item_t::forms, darktable_t::gui, dt_develop_t::gui_attached, dt_develop_t::history, dt_develop_t::history_mutex, dt_develop_t::pipe, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::shutdown, and TRUE.
void dt_dev_free_history_item | ( | gpointer | data | ) |
Free a single GList *link containing a dt_dev_history_item_t
References dt_dev_history_item_t::blend_params, dt_masks_free_form(), dt_dev_history_item_t::forms, dt_dev_history_item_t::params, and void().
Referenced by _history_undo_data_free(), _pop_undo(), _remove_history_leaks(), dt_dev_cleanup(), dt_dev_history_free_history(), and dt_dev_module_remove().
int32_t dt_dev_get_history_end | ( | struct dt_develop_t * | dev | ) |
References dt_develop_t::history, and dt_develop_t::history_end.
Referenced by _gui_delete_callback(), _lib_history_change_callback(), _lib_snapshots_add_button_clicked_callback(), _remove_history_leaks(), dt_dev_add_history_item_real(), dt_dev_history_get_hash(), dt_dev_module_remove(), dt_dev_pixelpipe_synch_all_real(), dt_dev_pixelpipe_synch_top(), dt_dev_pop_history_items_ext(), dt_dev_undo_start_record(), dt_dev_write_history_ext(), dt_masks_cleanup_unused(), dt_masks_read_masks_history(), and dt_styles_apply_to_image().
int dt_dev_history_auto_save | ( | struct dt_develop_t * | dev | ) |
Write history to DB and XMP only if the integrety hash has changed since first reading history, or since prior saving point. Callback function meant to be used with g_timeout, or standalone.
dev |
References dt_develop_t::auto_save_timeout, dt_times_t::clock, dt_control_save_xmp(), dt_dev_history_get_hash(), dt_dev_write_history_ext(), dt_get_times(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_show_times(), dt_toast_log(), dt_develop_t::history_hash, dt_develop_t::history_mutex, dt_image_t::id, and dt_develop_t::image_storage.
Referenced by _export_button_clicked(), dt_dev_add_history_item_real(), and leave().
void dt_dev_history_compress | ( | struct dt_develop_t * | dev | ) |
Compress an history from a loaded pipeline, aka simply take a snapshot of all modules parameters. This assumes the history end is properly set, which always happens after calling _pop_history_item.
dev |
References _module_leaves_no_history(), dt_dev_add_history_item_ext(), dt_dev_history_free_history(), dt_dev_reload_history_items(), dt_dev_write_history(), dt_dev_write_history_ext(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, dt_develop_t::history_mutex, dt_image_t::id, dt_develop_t::image_storage, dt_develop_t::iop, and TRUE.
Referenced by _lib_history_truncate().
void dt_dev_history_free_history | ( | struct dt_develop_t * | dev | ) |
Free the whole GList of dt_dev_history_item_t
attached to dev->history
References dt_dev_free_history_item(), and dt_develop_t::history.
Referenced by dt_dev_history_compress(), dt_dev_reload_history_items(), and leave().
uint64_t dt_dev_history_get_hash | ( | struct dt_develop_t * | dev | ) |
Get the integrity checksum of the whole history stack.
dev |
References DT_DEBUG_HISTORY, dt_dev_get_history_end(), dt_hash(), dt_print(), dt_dev_history_item_t::hash, and dt_develop_t::history.
Referenced by dt_dev_history_auto_save(), and dt_dev_read_history_ext().
void dt_dev_invalidate_history_module | ( | GList * | list, |
struct dt_iop_module_t * | module | ||
) |
Referenced by _history_invalidate_cb().
void dt_dev_pop_history_items | ( | struct dt_develop_t * | dev | ) |
References darktable, dt_dev_pop_history_items_ext(), dt_iop_gui_update(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), darktable_t::gui, dt_develop_t::history_mutex, dt_develop_t::iop, and dt_gui_gtk_t::reset.
Referenced by _lib_history_button_clicked_callback(), dt_dev_reload_history_items(), and enter().
void dt_dev_pop_history_items_ext | ( | struct dt_develop_t * | dev | ) |
References _dt_dev_modules_reload_defaults(), _history_to_module(), DT_DEBUG_HISTORY, dt_dev_get_history_end(), dt_ioppr_check_duplicate_iop_order(), dt_ioppr_check_iop_order(), dt_ioppr_resync_modules_order(), dt_masks_replace_current_forms(), dt_print(), dt_dev_history_item_t::forms, dt_dev_history_item_t::hash, dt_develop_t::history, and dt_develop_t::iop.
Referenced by _apply_style_before_export(), _history_copy_and_paste_on_image_merge(), dt_dev_pop_history_items(), dt_history_merge_module_into_history(), and dt_styles_apply_to_image().
void dt_dev_read_history_ext | ( | struct dt_develop_t * | dev, |
const int32_t | imgid, | ||
gboolean | no_image | ||
) |
References _history_to_module(), _init_default_history(), _process_history_db_entry(), darktable, darktable_t::db, darktable_t::develop, dt_database_get(), DT_DEBUG_HISTORY, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_dev_history_get_hash(), dt_dev_masks_list_change(), dt_dev_masks_update_hash(), dt_dev_set_history_end(), dt_dev_write_history_ext(), dt_image_cache_get(), dt_image_cache_read_release(), DT_IMAGE_CACHE_SAFE, dt_image_cache_write_release(), dt_ioppr_check_iop_order(), dt_ioppr_resync_iop_list(), dt_ioppr_resync_modules_order(), dt_ioppr_set_default_iop_order(), dt_masks_read_masks_history(), dt_print(), dt_dev_history_item_t::enabled, FALSE, dt_dev_history_item_t::hash, dt_develop_t::history, dt_develop_t::history_hash, darktable_t::image_cache, dt_develop_t::image_storage, dt_develop_t::iop, legacy_params(), dt_dev_history_item_t::op_name, and UNKNOWN_IMAGE.
Referenced by _history_copy_and_paste_on_image_merge(), dt_dev_get_final_size(), dt_dev_load_image(), dt_dev_reload_history_items(), and dt_styles_apply_to_image().
void dt_dev_reload_history_items | ( | struct dt_develop_t * | dev | ) |
References dt_dev_history_free_history(), dt_dev_pop_history_items(), dt_dev_read_history_ext(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, dt_develop_t::history_mutex, dt_image_t::id, and dt_develop_t::image_storage.
Referenced by _pop_undo(), compress_history_callback(), delete_history_callback(), dt_dev_history_compress(), dt_ioppr_migrate_iop_order(), dt_lightroom_import(), dt_styles_apply_to_image(), load_xmp_callback(), paste_all_callback(), and paste_parts_callback().
void dt_dev_set_history_end | ( | struct dt_develop_t * | dev, |
const uint32_t | index | ||
) |
void dt_dev_write_history | ( | struct dt_develop_t * | dev | ) |
References dt_dev_write_history_ext(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_develop_t::history_mutex, dt_image_t::id, and dt_develop_t::image_storage.
Referenced by _darkroom_ui_apply_style_activate_callback(), _lib_history_create_style_button_clicked_callback(), _pop_undo(), compress_history_callback(), copy_callback(), copy_parts_callback(), delete_history_callback(), dt_dev_history_compress(), dt_ioppr_change_iop_order(), dt_multiple_styles_apply_to_list(), dt_styles_apply_to_list(), paste_all_callback(), and paste_parts_callback().
void dt_dev_write_history_ext | ( | struct dt_develop_t * | dev, |
const int32_t | imgid | ||
) |
References _cleanup_history(), _warn_about_history_overuse(), darktable, darktable_t::develop, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_DEBUG_HISTORY, dt_dev_append_changed_tag(), dt_dev_get_history_end(), dt_dev_write_history_end_ext(), dt_dev_write_history_item(), DT_HISTORY_HASH_CURRENT, dt_history_hash_write_from_history(), dt_image_cache_set_change_timestamp(), dt_ioppr_write_iop_order_list(), dt_mipmap_cache_remove(), dt_print(), DT_SIGNAL_IMAGE_INFO_CHANGED, dt_thumbtable_refresh_thumbnail, darktable_t::gui, dt_develop_t::history, dt_image_t::id, darktable_t::image_cache, dt_develop_t::image_storage, dt_develop_t::iop_order_list, darktable_t::mipmap_cache, darktable_t::signals, dt_ui_t::thumbtable_lighttable, TRUE, and dt_gui_gtk_t::ui.
Referenced by _history_copy_and_paste_on_image_merge(), dt_dev_history_auto_save(), dt_dev_history_compress(), dt_dev_read_history_ext(), dt_dev_write_history(), and dt_styles_apply_to_image().
int dt_history_copy_and_paste_on_image | ( | int32_t | imgid, |
int32_t | dest_imgid, | ||
GList * | ops, | ||
gboolean | copy_iop_order, | ||
const gboolean | copy_full | ||
) |
copy history from imgid and pasts on dest_imgid, merge or overwrite...
References _history_copy_and_paste_on_image_merge(), dt_undo_lt_history_t::after, dt_undo_lt_history_t::after_history_end, dt_undo_lt_history_t::before, dt_undo_lt_history_t::before_history_end, darktable, dt_control_log(), dt_control_save_xmp(), dt_history_snapshot_item_init(), dt_history_snapshot_undo_create(), dt_history_snapshot_undo_lt_history_data_free(), dt_history_snapshot_undo_pop(), dt_ioppr_get_iop_order_list(), dt_ioppr_write_iop_order_list(), dt_thumbtable_refresh_thumbnail, dt_undo_end_group(), DT_UNDO_LT_HISTORY, dt_undo_record(), dt_undo_start_group(), FALSE, darktable_t::gui, dt_undo_lt_history_t::imgid, dt_ui_t::thumbtable_lighttable, TRUE, dt_gui_gtk_t::ui, darktable_t::undo, and UNKNOWN_IMAGE.
Referenced by dt_control_duplicate_images_job_run(), dt_history_paste_on_list(), dt_history_paste_parts_on_list(), dt_image_copy_rename(), and dt_styles_apply_to_image().
int dt_history_merge_module_into_history | ( | struct dt_develop_t * | dev_dest, |
struct dt_develop_t * | dev_src, | ||
struct dt_iop_module_t * | mod_src, | ||
GList ** | _modules_used | ||
) |
adds to dev_dest module mod_src
References _fill_used_forms(), _search_history_by_op(), dt_develop_t::allforms, dt_iop_module_t::blend_params, DT_DEBUG_HISTORY, dt_dev_add_history_item_ext(), dt_dev_pop_history_items_ext(), dt_iop_get_module_by_op_priority(), dt_iop_load_module(), dt_ioppr_check_iop_order(), dt_ioppr_resync_modules_order(), dt_masks_dup_masks_form(), dt_masks_get_from_id_ext(), dt_print(), dt_sort_iop_by_order(), FALSE, dt_develop_t::forms, dt_develop_t::iop, IOP_FLAGS_ONE_INSTANCE, IOP_FLAGS_SUPPORTS_BLENDING, dt_iop_module_t::iop_order, dt_develop_blend_params_t::mask_id, dt_iop_module_t::multi_name, dt_iop_module_t::multi_priority, dt_iop_module_t::op, dt_iop_module_t::params, dt_iop_module_t::so, and TRUE.
Referenced by _history_copy_and_paste_on_image_merge(), and dt_styles_apply_style_item().
gboolean dt_history_module_skip_copy | ( | const int | flags | ) |
References flags, IOP_FLAGS_DEPRECATED, IOP_FLAGS_HIDDEN, and IOP_FLAGS_UNSAFE_COPY.
Referenced by _history_copy_and_paste_on_image_merge(), and dt_gui_hist_dialog_new().