Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
dev_history.h File Reference
#include "common/history.h"
#include <glib.h>
+ Include dependency graph for dev_history.h:
+ This graph shows which files directly or indirectly include this file:

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.
 

Detailed Description

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.

Macro Definition Documentation

◆ dt_dev_add_history_item

#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))

◆ DT_IOP_PARAMS_T

#define DT_IOP_PARAMS_T

Typedef Documentation

◆ dt_dev_history_item_t

◆ dt_iop_params_t

Function Documentation

◆ dt_dev_add_history_item_ext()

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 
)

◆ dt_dev_add_history_item_real()

◆ dt_dev_free_history_item()

◆ dt_dev_get_history_end()

◆ dt_dev_history_auto_save()

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.

Parameters
dev
Returns
int

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

◆ dt_dev_history_compress()

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.

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

◆ dt_dev_history_free_history()

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

◆ dt_dev_history_get_hash()

uint64_t dt_dev_history_get_hash ( struct dt_develop_t dev)

Get the integrity checksum of the whole history stack.

Parameters
dev
Returns
uint64_t

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

◆ dt_dev_invalidate_history_module()

void dt_dev_invalidate_history_module ( GList *  list,
struct dt_iop_module_t module 
)
Todo:
: why is that needed ?

Referenced by _history_invalidate_cb().

◆ dt_dev_pop_history_items()

◆ dt_dev_pop_history_items_ext()

◆ dt_dev_read_history_ext()

◆ dt_dev_reload_history_items()

◆ dt_dev_set_history_end()

◆ dt_dev_write_history()

◆ dt_dev_write_history_ext()

◆ dt_history_copy_and_paste_on_image()

◆ dt_history_merge_module_into_history()

◆ dt_history_module_skip_copy()

gboolean dt_history_module_skip_copy ( const int  flags)