![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/darktable.h"#include "common/iop_order.h"#include "common/styles.h"#include "common/debug.h"#include "develop/imageop.h"#include "develop/pixelpipe.h"#include <stdio.h>#include <stdlib.h>#include <string.h>
Include dependency graph for iop_order.c:Macros | |
| #define | DT_IOP_ORDER_VERSION 5 |
| #define | DT_IOP_ORDER_INFO (darktable.unmuted & DT_DEBUG_IOPORDER) |
Functions | |
| static void | _ioppr_reset_iop_order (GList *iop_order_list) |
| Reset iop_order values to a sequential order for a list. | |
| static dt_iop_order_entry_t * | dt_ioppr_get_iop_order_entry (GList *iop_order_list, const char *op_name, const int multi_priority) |
| Return the first order entry matching operation/instance. | |
| static gboolean | dt_ioppr_write_iop_order (const dt_iop_order_t kind, GList *iop_order_list, const int32_t imgid) |
| Persist an order list for a given image with a specific kind. | |
| static void | dt_ioppr_resync_iop_list (dt_develop_t *dev) |
| Resynchronize dev->iop list order against dev->iop_order_list. | |
| static void | dt_ioppr_update_for_entries (dt_develop_t *dev, GList *entry_list, gboolean append) |
Update dev->iop_order_list to include entries from entry_list. | |
| static void | dt_ioppr_check_duplicate_iop_order (GList **_iop_list, GList *history_list) |
| Detect and resolve duplicate iop_order values. | |
| static void | dt_ioppr_migrate_iop_order (struct dt_develop_t *dev, const int32_t imgid) |
| Apply a new order list by reloading history and rebuilding UI/pipelines. | |
| static GList * | dt_ioppr_extract_multi_instances_list (GList *iop_order_list) |
| Extract all order entries that have multiple instances. | |
| static GList * | dt_ioppr_merge_multi_instance_iop_order_list (GList *iop_order_list, GList *multi_instance_list) |
| Merge multiple-instance entries into an order list. | |
| const char * | dt_iop_order_string (const dt_iop_order_t order) |
| Return the human-readable name for an IOP order enum value. | |
| static void * | _dup_iop_order_entry (const void *src, gpointer data) |
| Deep-copy callback for dt_iop_order_entry_t. | |
| static int | _count_entries_operation (GList *e_list, const char *operation) |
| Count order-list entries matching an operation name. | |
| static GList * | _insert_before (GList *iop_order_list, const char *module, const char *new_module) |
| Insert a missing module entry before another module in an order list. | |
| dt_iop_order_t | dt_ioppr_get_iop_order_version (const int32_t imgid) |
| Fetch the IOP order version stored for an image. | |
| GList * | dt_ioppr_get_iop_order_rules () |
| Return the list of ordering rules (prev/next constraints). | |
| GList * | dt_ioppr_get_iop_order_link (GList *iop_order_list, const char *op_name, const int multi_priority) |
| Find a list link matching an operation and instance. | |
| int | dt_ioppr_get_iop_order (GList *iop_order_list, const char *op_name, const int multi_priority) |
| Return the iop_order for a given operation/instance pair. | |
| gint | dt_sort_iop_list_by_order (gconstpointer a, gconstpointer b) |
| gint | dt_sort_iop_list_by_order_f (gconstpointer a, gconstpointer b) |
| Compare two list nodes holding modules by iop_order. | |
| dt_iop_order_t | dt_ioppr_get_iop_order_list_kind (GList *iop_order_list) |
| Determine the kind of an order list by inspecting its content. | |
| gboolean | dt_ioppr_has_multiple_instances (GList *iop_order_list) |
| Detect whether multiple instances are grouped for a non-custom order. | |
| gboolean | dt_ioppr_write_iop_order_list (GList *iop_order_list, const int32_t imgid) |
| Persist an order list to the DB for a given image. | |
| GList * | _table_to_list (const dt_iop_order_entry_t entries[]) |
| Build an order list from a static entry table. | |
| GList * | dt_ioppr_get_iop_order_list_version (dt_iop_order_t version) |
| Return the built-in order list for a given version. | |
| gboolean | dt_ioppr_has_iop_order_list (int32_t imgid) |
| Check whether the image has an explicit order list stored in DB. | |
| GList * | dt_ioppr_get_iop_order_list (int32_t imgid, gboolean sorted) |
| Load the order list for an image from the DB. | |
| void | dt_ioppr_resync_pipeline (dt_develop_t *dev, const int32_t imgid, const char *msg, gboolean check_duplicates) |
| Resynchronize pipeline order and related structures. | |
| void | dt_ioppr_resync_modules_order (dt_develop_t *dev) |
| Update dev->iop module order values from dev->iop_order_list. | |
| void | dt_ioppr_rebuild_iop_order_from_modules (struct dt_develop_t *dev, GList *ordered_modules) |
| Rebuild dev->iop_order_list from a list of ordered modules. | |
| void | dt_ioppr_set_default_iop_order (dt_develop_t *dev, const int32_t imgid) |
| Set dev->iop_order_list to the default order for a given image. | |
| void | dt_ioppr_change_iop_order (struct dt_develop_t *dev, const int32_t imgid, GList *new_iop_list) |
| Replace the current order list with a new one and persist it. | |
| GList * | dt_ioppr_merge_module_multi_instance_iop_order_list (GList *iop_order_list, const char *operation, GList *multi_instance_list) |
| Merge an operation's multiple instances into the order list. | |
| static void | _count_iop_module (GList *iop, const char *operation, int *max_multi_priority, int *count, int *max_multi_priority_enabled, int *count_enabled) |
| Count module instances and track their highest priorities. | |
| static gboolean | _operation_already_handled (GList *e_list, const char *operation) |
| Check if an operation was already handled earlier in the list. | |
| int | _get_multi_priority (dt_develop_t *dev, const char *operation, const int n, const gboolean only_disabled) |
| Return the multi_priority of the n-th instance of an operation. | |
| void | dt_ioppr_update_for_style_items (dt_develop_t *dev, GList *st_items, gboolean append) |
| Update dev->iop_order_list with modules referenced by style items. | |
| void | dt_ioppr_update_for_modules (dt_develop_t *dev, GList *modules, gboolean append) |
| Update dev->iop_order_list with modules from a module list. | |
| static dt_dev_history_item_t * | _ioppr_search_history_by_module (GList *history_list, dt_iop_module_t *mod) |
| Find a history item referencing a given module instance. | |
| int | dt_ioppr_check_so_iop_order (GList *iop_list, GList *iop_order_list) |
| Check whether any module .so is missing an iop_order entry. | |
| GList * | dt_ioppr_iop_order_copy_deep (GList *iop_order_list) |
| Deep-copy an order list. | |
| gint | dt_sort_iop_by_order (gconstpointer a, gconstpointer b) |
| Compare two module instances by iop_order for sorting. | |
| gboolean | dt_ioppr_check_can_move_before_iop (GList *iop_list, dt_iop_module_t *module, dt_iop_module_t *module_next) |
| Validate whether module can be moved before module_next. | |
| gboolean | dt_ioppr_check_can_move_after_iop (GList *iop_list, dt_iop_module_t *module, dt_iop_module_t *module_prev) |
| Validate whether module can be moved after module_prev. | |
| gboolean | dt_ioppr_move_iop_before (struct dt_develop_t *dev, dt_iop_module_t *module, dt_iop_module_t *module_next) |
| Move a module instance before another module in the pipe. | |
| gboolean | dt_ioppr_move_iop_after (struct dt_develop_t *dev, dt_iop_module_t *module, dt_iop_module_t *module_prev) |
| Move a module instance after another module in the pipe. | |
| static GList * | _get_fence_modules_list (GList *iop_list) |
| Build a list of "fence" modules that should not be crossed. | |
| static void | _ioppr_check_rules (GList *iop_list, const int32_t imgid, const char *msg) |
| Validate pipeline order against fence and rule constraints. | |
| void | dt_ioppr_insert_module_instance (struct dt_develop_t *dev, dt_iop_module_t *module) |
| Ensure a module instance has an entry in dev->iop_order_list. | |
| int | dt_ioppr_check_iop_order (dt_develop_t *dev, const int32_t imgid, const char *msg) |
| Debug helper to validate the current order for a develop context. | |
| void * | dt_ioppr_serialize_iop_order_list (GList *iop_order_list, size_t *size) |
| Serialize an order list into a binary blob (used for presets). | |
| char * | dt_ioppr_serialize_text_iop_order_list (GList *iop_order_list) |
| Serialize an order list to a text representation. | |
| static gboolean | _ioppr_sanity_check_iop_order (GList *list) |
| Basic sanity check for an order list. | |
| GList * | dt_ioppr_deserialize_text_iop_order_list (const char *buf) |
| Deserialize an order list from a text representation. | |
| GList * | dt_ioppr_deserialize_iop_order_list (const char *buf, size_t size) |
| Deserialize an order list from a binary blob. | |
Variables | |
| const char * | iop_order_string [] |
| const dt_iop_order_entry_t | legacy_order [] |
| const dt_iop_order_entry_t | v30_order [] |
| const dt_iop_order_entry_t | v30_jpg_order [] |
| #define DT_IOP_ORDER_INFO (darktable.unmuted & DT_DEBUG_IOPORDER) |
| #define DT_IOP_ORDER_VERSION 5 |
|
static |
Count order-list entries matching an operation name.
| e_list | Entry list. |
| operation | Operation name to match. |
References dt_iop_order_entry_t::operation.
Referenced by dt_ioppr_extract_multi_instances_list(), dt_ioppr_merge_module_multi_instance_iop_order_list(), and dt_ioppr_update_for_entries().
|
static |
Count module instances and track their highest priorities.
| iop | Module list. |
| operation | Operation name to count. |
| max_multi_priority | Output: maximum multi_priority among all instances. |
| count | Output: total number of instances. |
| max_multi_priority_enabled | Output: maximum multi_priority among enabled instances. |
| count_enabled | Output: number of enabled instances. |
Referenced by dt_ioppr_update_for_entries().
Deep-copy callback for dt_iop_order_entry_t.
| src | Source entry. |
| data | Unused. |
Referenced by dt_ioppr_extract_multi_instances_list(), and dt_ioppr_iop_order_copy_deep().
|
static |
Build a list of "fence" modules that should not be crossed.
Fences are modules that enforce local ordering constraints (e.g. RAW preprocessing chain).
| iop_list | Module list. |
References IOP_FLAGS_FENCE.
Referenced by _ioppr_check_rules().
| int _get_multi_priority | ( | dt_develop_t * | dev, |
| const char * | operation, | ||
| const int | n, | ||
| const gboolean | only_disabled | ||
| ) |
Return the multi_priority of the n-th instance of an operation.
| dev | Develop context. |
| operation | Operation name. |
| n | Instance index (1-based). |
| only_disabled | If TRUE, only consider disabled instances. |
References FALSE, dt_develop_t::iop, and n.
Referenced by dt_ioppr_update_for_entries().
|
static |
Insert a missing module entry before another module in an order list.
This is used to migrate older/custom lists when new modules appear in built-in orders.
| iop_order_list | Order list to update. |
| module | Existing module name to insert before. |
| new_module | New module name to insert if missing. |
References FALSE, dt_iop_order_entry_t::instance, dt_iop_order_entry_t::iop_order, dt_iop_order_entry_t::o, dt_iop_order_entry_t::operation, and TRUE.
Referenced by dt_ioppr_get_iop_order_list().
|
static |
Validate pipeline order against fence and rule constraints.
Emits debug messages when violations are detected.
| iop_list | Module list. |
| imgid | Image id (for diagnostics). |
| msg | Optional debug label. |
References _get_fence_modules_list(), darktable, dt_iop_module_t::iop_order, darktable_t::iop_order_rules, dt_iop_module_t::multi_name, and dt_iop_module_t::op.
Referenced by dt_ioppr_check_iop_order().
|
static |
Reset iop_order values to a sequential order for a list.
Ensures the list has monotonically increasing iop_order values.
| iop_order_list | Order list to normalize. |
References dt_iop_order_entry_t::iop_order, and dt_iop_order_entry_t::o.
Referenced by dt_ioppr_deserialize_iop_order_list(), dt_ioppr_deserialize_text_iop_order_list(), dt_ioppr_get_iop_order_list(), dt_ioppr_resync_modules_order(), dt_ioppr_set_default_iop_order(), and dt_ioppr_update_for_entries().
|
static |
Basic sanity check for an order list.
Ensures all entries are valid and ordering values are non-zero.
| list | Order list. |
References dt_iop_order_entry_t::operation, and TRUE.
Referenced by dt_ioppr_deserialize_text_iop_order_list().
|
static |
Find a history item referencing a given module instance.
| history_list | History list. |
| mod | Module instance. |
Referenced by dt_ioppr_check_duplicate_iop_order().
|
static |
Check if an operation was already handled earlier in the list.
| e_list | Current list node. |
| operation | Operation name to search. |
Referenced by dt_ioppr_update_for_entries().
| GList * _table_to_list | ( | const dt_iop_order_entry_t | entries[] | ) |
Build an order list from a static entry table.
| entries | Zero-terminated array of dt_iop_order_entry_t. |
References dt_iop_order_entry_t::instance, dt_iop_order_entry_t::iop_order_f, dt_iop_order_entry_t::o, and dt_iop_order_entry_t::operation.
Referenced by dt_ioppr_get_iop_order_list(), and dt_ioppr_get_iop_order_list_version().
| const char * dt_iop_order_string | ( | const dt_iop_order_t | order | ) |
Return the human-readable name for an IOP order enum value.
This is mostly used for debug strings, logs, and UI messages.
| order | IOP order enum value. |
References DT_IOP_ORDER_LAST, and iop_order_string.
Referenced by _gui_styles_dialog_run(), get_query_string(), list_view(), and update().
| void dt_ioppr_change_iop_order | ( | struct dt_develop_t * | dev, |
| const int32_t | imgid, | ||
| GList * | new_iop_list | ||
| ) |
Replace the current order list with a new one and persist it.
| dev | Develop context. |
| imgid | Image id. |
| new_iop_list | New order list (ownership remains with caller). |
References darktable, darktable_t::develop, dt_dev_write_history(), dt_free_gpointer(), DT_IOP_ORDER_CUSTOM, dt_ioppr_extract_multi_instances_list(), dt_ioppr_iop_order_copy_deep(), dt_ioppr_merge_multi_instance_iop_order_list(), dt_ioppr_migrate_iop_order(), dt_ioppr_write_iop_order(), and dt_develop_t::iop_order_list.
Referenced by gui_reset(), and set_params().
| gboolean dt_ioppr_check_can_move_after_iop | ( | GList * | iop_list, |
| struct dt_iop_module_t * | module, | ||
| struct dt_iop_module_t * | module_prev | ||
| ) |
Validate whether module can be moved after module_prev.
| iop_list | Current module list. |
| module | Module to move. |
| module_prev | Target module that should precede. |
References dt_ioppr_check_can_move_before_iop(), FALSE, dt_iop_module_t::iop_order, dt_iop_module_t::multi_name, dt_iop_module_t::op, dt_iop_module_t::raster_mask, dt_iop_module_t::sink, and dt_iop_module_t::source.
Referenced by _dev_module_update_multishow(), and _on_drag_motion().
| gboolean dt_ioppr_check_can_move_before_iop | ( | GList * | iop_list, |
| struct dt_iop_module_t * | module, | ||
| struct dt_iop_module_t * | module_next | ||
| ) |
Validate whether module can be moved before module_next.
| iop_list | Current module list. |
| module | Module to move. |
| module_next | Target module that should follow. |
References darktable, FALSE, IOP_FLAGS_FENCE, dt_iop_module_t::iop_order, darktable_t::iop_order_rules, dt_iop_module_t::multi_name, dt_iop_module_t::op, dt_iop_module_t::raster_mask, dt_iop_module_t::sink, dt_iop_module_t::source, and TRUE.
Referenced by _dev_module_update_multishow(), _on_drag_motion(), and dt_ioppr_check_can_move_after_iop().
|
static |
Detect and resolve duplicate iop_order values.
Walks the module list, reorders or removes disabled duplicates not present in history to keep a consistent ordering.
| _iop_list | Pointer to module list to mutate. |
| history_list | History list used to preserve required instances. |
References _ioppr_search_history_by_module(), dt_ioppr_check_duplicate_iop_order(), dt_iop_module_t::enabled, dt_iop_module_t::iop_order, dt_iop_module_t::multi_name, and dt_iop_module_t::op.
Referenced by dt_ioppr_check_duplicate_iop_order(), and dt_ioppr_resync_pipeline().
| int dt_ioppr_check_iop_order | ( | struct dt_develop_t * | dev, |
| const int32_t | imgid, | ||
| const char * | msg | ||
| ) |
Debug helper to validate the current order for a develop context.
Logs inconsistencies and optionally reports the state with msg.
| dev | Develop context. |
| imgid | Image id (for diagnostics). |
| msg | Optional debug message. |
References _ioppr_check_rules(), DT_DEBUG_PARAMS, dt_print(), dt_develop_t::history, dt_develop_t::iop, dt_iop_module_t::iop_order, dt_iop_module_t::multi_name, dt_iop_module_t::multi_priority, and dt_iop_module_t::op.
Referenced by _apply_style_before_export(), _gui_movedown_callback(), _gui_moveup_callback(), _on_drag_data_received(), dt_dev_modules_update_multishow(), and dt_ioppr_resync_pipeline().
| int dt_ioppr_check_so_iop_order | ( | GList * | iop_list, |
| GList * | iop_order_list | ||
| ) |
Check whether any module .so is missing an iop_order entry.
| iop_list | List of module .so entries. |
| iop_order_list | Current order list. |
References dt_ioppr_get_iop_order_entry().
Referenced by dt_init().
| GList * dt_ioppr_deserialize_iop_order_list | ( | const char * | buf, |
| size_t | size | ||
| ) |
Deserialize an order list from a binary blob.
| buf | Serialized buffer. |
| size | Buffer size in bytes. |
References _ioppr_reset_iop_order(), dt_free, dt_free_gpointer(), error(), dt_iop_order_entry_t::instance, dt_iop_order_entry_t::iop_order, dt_iop_order_entry_t::o, dt_iop_order_entry_t::operation, and size.
Referenced by _dev_auto_apply_presets(), set_params(), and update().
| GList * dt_ioppr_deserialize_text_iop_order_list | ( | const char * | buf | ) |
Deserialize an order list from a text representation.
| buf | NUL-terminated string. |
References _ioppr_reset_iop_order(), _ioppr_sanity_check_iop_order(), dt_free_gpointer(), dt_util_str_to_glist(), error(), dt_iop_order_entry_t::instance, dt_iop_order_entry_t::iop_order, dt_iop_order_entry_t::o, and dt_iop_order_entry_t::operation.
Referenced by dt_exif_xmp_read(), dt_ioppr_get_iop_order_list(), dt_styles_module_order_list(), and dt_styles_style_text_handler().
|
static |
Extract all order entries that have multiple instances.
| iop_order_list | Order list to scan. |
References _count_entries_operation(), and _dup_iop_order_entry().
Referenced by dt_ioppr_change_iop_order().
| int dt_ioppr_get_iop_order | ( | GList * | iop_order_list, |
| const char * | op_name, | ||
| const int | multi_priority | ||
| ) |
Return the iop_order for a given operation/instance pair.
| iop_order_list | Order list to search. |
| op_name | Operation name. |
| multi_priority | Instance priority. |
References dt_ioppr_get_iop_order_entry().
Referenced by _process_history_db_entry(), _show_hide_colorspace(), default_input_format(), default_output_format(), default_tiling_callback(), dt_ioppr_get_pipe_current_profile_info(), dt_ioppr_resync_modules_order(), dt_ioppr_update_for_modules(), dt_ioppr_update_for_style_items(), and sanity_check().
|
static |
Return the first order entry matching operation/instance.
| iop_order_list | Order list. |
| op_name | Operation name. |
| multi_priority | Instance priority (or -1 for any). |
References dt_ioppr_get_iop_order_link().
Referenced by dt_ioppr_check_so_iop_order(), and dt_ioppr_get_iop_order().
| GList * dt_ioppr_get_iop_order_link | ( | GList * | iop_order_list, |
| const char * | op_name, | ||
| const int | multi_priority | ||
| ) |
Find a list link matching an operation and instance.
| iop_order_list | Order list to search. |
| op_name | Operation name. |
| multi_priority | Instance priority. |
References dt_iop_order_entry_t::instance, and dt_iop_order_entry_t::operation.
Referenced by dt_exif_xmp_read(), dt_ioppr_get_iop_order_entry(), dt_ioppr_merge_module_multi_instance_iop_order_list(), dt_ioppr_move_iop_after(), and dt_ioppr_move_iop_before().
| GList * dt_ioppr_get_iop_order_list | ( | int32_t | imgid, |
| gboolean | sorted | ||
| ) |
Load the order list for an image from the DB.
If no list is found, returns NULL.
| imgid | Image id. |
| sorted | If TRUE, entries are sorted by iop_order; otherwise the stored order is kept. |
References _insert_before(), _ioppr_reset_iop_order(), _table_to_list(), darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, DT_IOP_ORDER_CUSTOM, DT_IOP_ORDER_LEGACY, DT_IOP_ORDER_V30, DT_IOP_ORDER_V30_JPG, dt_ioppr_deserialize_text_iop_order_list(), dt_sort_iop_list_by_order(), legacy_order, v30_jpg_order, and v30_order.
Referenced by _dt_style_update_iop_order(), _exif_xmp_read_data(), _exif_xmp_read_data_export(), dt_init(), dt_ioppr_set_default_iop_order(), and dt_styles_create_from_image().
| dt_iop_order_t dt_ioppr_get_iop_order_list_kind | ( | GList * | iop_order_list | ) |
Determine the kind of an order list by inspecting its content.
Compares the list ordering to the known built-in lists to decide whether this is a built-in version or a custom order.
| iop_order_list | List of dt_iop_order_entry_t. |
References DT_IOP_ORDER_CUSTOM, DT_IOP_ORDER_LEGACY, DT_IOP_ORDER_V30, DT_IOP_ORDER_V30_JPG, FALSE, legacy_order, TRUE, v30_jpg_order, and v30_order.
Referenced by _upgrade_library_schema_step(), dt_ioppr_write_iop_order_list(), and update().
| GList * dt_ioppr_get_iop_order_list_version | ( | dt_iop_order_t | version | ) |
Return the built-in order list for a given version.
| version | Built-in order version. |
References _table_to_list(), DT_IOP_ORDER_LEGACY, DT_IOP_ORDER_V30, DT_IOP_ORDER_V30_JPG, legacy_order, v30_jpg_order, and v30_order.
Referenced by _dev_auto_apply_presets(), _upgrade_data_schema_step(), _upgrade_library_schema_step(), dt_exif_xmp_read(), gui_reset(), and init_presets().
| GList * dt_ioppr_get_iop_order_rules | ( | ) |
Return the list of ordering rules (prev/next constraints).
References i, dt_iop_order_rule_t::op_next, and dt_iop_order_rule_t::op_prev.
Referenced by dt_init().
| dt_iop_order_t dt_ioppr_get_iop_order_version | ( | const int32_t | imgid | ) |
Fetch the IOP order version stored for an image.
If the image has no stored order, this falls back to the default (currently DT_IOP_ORDER_V30).
| imgid | Image id. |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and DT_IOP_ORDER_V30.
Referenced by _exif_xmp_read_data(), _exif_xmp_read_data_export(), and _gui_styles_dialog_run().
| gboolean dt_ioppr_has_iop_order_list | ( | int32_t | imgid | ) |
Check whether the image has an explicit order list stored in DB.
| imgid | Image id. |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and FALSE.
Referenced by _dev_auto_apply_presets().
| gboolean dt_ioppr_has_multiple_instances | ( | GList * | iop_order_list | ) |
Detect whether multiple instances are grouped for a non-custom order.
Used to decide if a list follows the built-in ordering conventions.
| iop_order_list | Order list to inspect. |
Referenced by _exif_xmp_read_data(), _exif_xmp_read_data_export(), and dt_ioppr_write_iop_order().
| void dt_ioppr_insert_module_instance | ( | struct dt_develop_t * | dev, |
| struct dt_iop_module_t * | module | ||
| ) |
Ensure a module instance has an entry in dev->iop_order_list.
Inserts a new entry if missing, keeping list consistency for subsequent reordering or serialization.
| dev | Develop context. |
| module | Module instance to insert. |
References dt_iop_order_entry_t::instance, dt_iop_order_entry_t::iop_order, dt_develop_t::iop_order_list, dt_iop_order_entry_t::o, and dt_iop_order_entry_t::operation.
Referenced by dt_dev_module_duplicate().
| GList * dt_ioppr_iop_order_copy_deep | ( | GList * | iop_order_list | ) |
Deep-copy an order list.
| iop_order_list | Source list. |
References _dup_iop_order_entry().
Referenced by _hm_backup_dest(), _pop_undo(), dt_dev_history_undo_end_record_locked(), dt_dev_history_undo_start_record_locked(), dt_dev_pixelpipe_create_nodes(), dt_ioppr_change_iop_order(), and dt_ioppr_merge_multi_instance_iop_order_list().
| GList * dt_ioppr_merge_module_multi_instance_iop_order_list | ( | GList * | iop_order_list, |
| const char * | operation, | ||
| GList * | multi_instance_list | ||
| ) |
Merge an operation's multiple instances into the order list.
Updates instance numbers in-place and inserts additional entries as needed.
| iop_order_list | Base order list. |
| operation | Operation name. |
| multi_instance_list | List of instances for that operation. |
References _count_entries_operation(), dt_free, dt_ioppr_get_iop_order_link(), g_list_shorter_than(), and dt_iop_order_entry_t::instance.
Referenced by dt_ioppr_merge_multi_instance_iop_order_list().
|
static |
Merge multiple-instance entries into an order list.
Groups all instances of the same operation together, then merges them back into the main list while preserving relative ordering.
| iop_order_list | Base order list to update. |
| multi_instance_list | List of entries containing multiple instances. |
References dt_ioppr_iop_order_copy_deep(), dt_ioppr_merge_module_multi_instance_iop_order_list(), and dt_iop_order_entry_t::operation.
Referenced by dt_ioppr_change_iop_order().
|
static |
Apply a new order list by reloading history and rebuilding UI/pipelines.
| dev | Develop context. |
| imgid | Image id. |
References dt_dev_history_gui_update(), dt_dev_history_notify_change(), dt_dev_history_pixelpipe_update(), dt_dev_reload_history_items(), dt_ioppr_set_default_iop_order(), dt_image_t::id, dt_develop_t::image_storage, and TRUE.
Referenced by dt_ioppr_change_iop_order().
| gboolean dt_ioppr_move_iop_after | ( | struct dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| struct dt_iop_module_t * | module_prev | ||
| ) |
Move a module instance after another module in the pipe.
Updates module ordering and related lists.
| dev | Develop context. |
| module | Module to move. |
| module_prev | Module that should precede after move. |
References dt_ioppr_get_iop_order_link(), dt_ioppr_resync_modules_order(), FALSE, dt_develop_t::iop_order_list, dt_iop_module_t::multi_priority, dt_iop_module_t::op, and TRUE.
Referenced by _gui_moveup_callback(), _on_drag_data_received(), and dt_dev_module_duplicate().
| gboolean dt_ioppr_move_iop_before | ( | struct dt_develop_t * | dev, |
| struct dt_iop_module_t * | module, | ||
| struct dt_iop_module_t * | module_next | ||
| ) |
Move a module instance before another module in the pipe.
Updates module ordering and related lists.
| dev | Develop context. |
| module | Module to move. |
| module_next | Module that should follow after move. |
References dt_ioppr_get_iop_order_link(), dt_ioppr_resync_modules_order(), FALSE, dt_develop_t::iop_order_list, dt_iop_module_t::multi_priority, dt_iop_module_t::op, and TRUE.
Referenced by _gui_movedown_callback(), and _on_drag_data_received().
| void dt_ioppr_rebuild_iop_order_from_modules | ( | struct dt_develop_t * | dev, |
| GList * | ordered_modules | ||
| ) |
Rebuild dev->iop_order_list from a list of ordered modules.
| dev | Develop context. |
| ordered_modules | Modules in the desired pipeline order. |
References dt_free_gpointer(), dt_ioppr_resync_modules_order(), dt_iop_order_entry_t::instance, dt_iop_order_entry_t::iop_order, dt_develop_t::iop_order_list, dt_iop_module_t::multi_name, dt_iop_module_t::multi_priority, dt_iop_order_entry_t::name, dt_iop_order_entry_t::o, dt_iop_module_t::op, and dt_iop_order_entry_t::operation.
Referenced by _hm_report_apply_visible_order(), and _hm_topo_apply_solution().
|
static |
Resynchronize dev->iop list order against dev->iop_order_list.
This updates each module's iop_order and then sorts the module list.
| dev | Develop context. |
References dt_iop_get_module_by_op_priority(), dt_develop_t::iop, and dt_develop_t::iop_order_list.
Referenced by dt_ioppr_resync_pipeline().
| void dt_ioppr_resync_modules_order | ( | struct dt_develop_t * | dev | ) |
Update dev->iop module order values from dev->iop_order_list.
This writes iop_order fields on modules to match the stored list.
| dev | Develop context. |
References _ioppr_reset_iop_order(), dt_ioppr_get_iop_order(), dt_sort_iop_by_order(), dt_develop_t::iop, dt_iop_module_t::iop_order, dt_develop_t::iop_order_list, dt_iop_module_t::multi_priority, and dt_iop_module_t::op.
Referenced by dt_imageio_export_with_flags(), dt_ioppr_move_iop_after(), dt_ioppr_move_iop_before(), dt_ioppr_rebuild_iop_order_from_modules(), dt_ioppr_resync_pipeline(), and dt_ioppr_set_default_iop_order().
| void dt_ioppr_resync_pipeline | ( | struct dt_develop_t * | dev, |
| const int32_t | imgid, | ||
| const char * | msg, | ||
| gboolean | check_duplicates | ||
| ) |
Resynchronize pipeline order and related structures.
Rebuilds ordering for modules/history and optionally checks for duplicate iop_order values.
| dev | Develop context. |
| imgid | Image id (for diagnostics). |
| msg | Optional debug message. |
| check_duplicates | Whether to validate duplicate iop_order entries. |
References dt_ioppr_check_duplicate_iop_order(), dt_ioppr_check_iop_order(), dt_ioppr_resync_iop_list(), dt_ioppr_resync_modules_order(), dt_develop_t::history, and dt_develop_t::iop.
Referenced by _styles_init_source_dev(), _styles_sync_pipeline_from_items(), dt_dev_pop_history_items_ext(), dt_dev_read_history_ext(), dt_dev_replace_history_on_image(), dt_history_merge(), and dt_styles_apply_style_item().
| void * dt_ioppr_serialize_iop_order_list | ( | GList * | iop_order_list, |
| size_t * | size | ||
| ) |
Serialize an order list into a binary blob (used for presets).
| iop_order_list | Order list to serialize. |
| size | Output size of the serialized blob. |
References size.
Referenced by get_params(), and init_presets().
| char * dt_ioppr_serialize_text_iop_order_list | ( | GList * | iop_order_list | ) |
Serialize an order list to a text representation.
| iop_order_list | Order list to serialize. |
Referenced by _dt_style_update_iop_order(), _exif_xmp_read_data(), _exif_xmp_read_data_export(), _upgrade_library_schema_step(), dt_ioppr_write_iop_order(), dt_styles_create_style_header(), dt_styles_save_to_file(), and update().
| void dt_ioppr_set_default_iop_order | ( | struct dt_develop_t * | dev, |
| const int32_t | imgid | ||
| ) |
Set dev->iop_order_list to the default order for a given image.
Uses the image type/workflow to pick an appropriate built-in list.
| dev | Develop context. |
| imgid | Image id. |
References _ioppr_reset_iop_order(), dt_free_gpointer(), dt_ioppr_get_iop_order_list(), dt_ioppr_resync_modules_order(), FALSE, and dt_develop_t::iop_order_list.
Referenced by _dev_auto_apply_presets(), _styles_init_source_dev(), dt_dev_read_history_ext(), and dt_ioppr_migrate_iop_order().
|
static |
Update dev->iop_order_list to include entries from entry_list.
Used by update paths for modules and style items.
| dev | Develop context. |
| entry_list | List of dt_iop_order_entry_t. |
| append | Whether to append missing entries at the end. |
References _count_entries_operation(), _count_iop_module(), _get_multi_priority(), _ioppr_reset_iop_order(), _operation_already_handled(), dt_iop_get_module_by_instance_name(), FALSE, dt_iop_order_entry_t::instance, dt_develop_t::iop, dt_develop_t::iop_order_list, MAX, n, dt_iop_order_entry_t::operation, and TRUE.
Referenced by dt_ioppr_update_for_modules(), and dt_ioppr_update_for_style_items().
| void dt_ioppr_update_for_modules | ( | struct dt_develop_t * | dev, |
| GList * | modules, | ||
| gboolean | append | ||
| ) |
Update dev->iop_order_list with modules from a module list.
| dev | Develop context. |
| modules | List of module instances. |
| append | Whether to append new entries at the end (TRUE) or merge into list order (FALSE). |
References dt_free_gpointer(), dt_ioppr_get_iop_order(), dt_ioppr_update_for_entries(), dt_iop_order_entry_t::instance, dt_iop_module_t::iop_order, dt_develop_t::iop_order_list, dt_iop_module_t::multi_priority, n, and dt_iop_module_t::op.
| void dt_ioppr_update_for_style_items | ( | struct dt_develop_t * | dev, |
| GList * | st_items, | ||
| gboolean | append | ||
| ) |
Update dev->iop_order_list with modules referenced by style items.
| dev | Develop context. |
| st_items | Style items list. |
| append | Whether to append new entries at the end (TRUE) or merge into list order (FALSE). |
References dt_ioppr_get_iop_order(), dt_ioppr_update_for_entries(), dt_style_item_t::iop_order, dt_develop_t::iop_order_list, dt_style_item_t::multi_priority, n, and dt_style_item_t::operation.
Referenced by _apply_style_before_export(), and _styles_sync_pipeline_from_items().
|
static |
Persist an order list for a given image with a specific kind.
Handles both built-in orders (stores version only) and custom orders (stores serialized list in DB).
| kind | Order kind to store. |
| iop_order_list | Order list to serialize if needed. |
| imgid | Image id. |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_free, DT_IOP_ORDER_CUSTOM, dt_ioppr_has_multiple_instances(), dt_ioppr_serialize_text_iop_order_list(), FALSE, kind, and TRUE.
Referenced by dt_ioppr_change_iop_order(), and dt_ioppr_write_iop_order_list().
| gboolean dt_ioppr_write_iop_order_list | ( | GList * | iop_order_list, |
| const int32_t | imgid | ||
| ) |
Persist an order list to the DB for a given image.
| iop_order_list | Order list to store. |
| imgid | Image id. |
References dt_ioppr_get_iop_order_list_kind(), dt_ioppr_write_iop_order(), and kind.
Referenced by _dev_auto_apply_presets(), dt_dev_write_history_ext(), and dt_exif_xmp_read().
| gint dt_sort_iop_by_order | ( | gconstpointer | a, |
| gconstpointer | b | ||
| ) |
Compare two module instances by iop_order for sorting.
| a | First module pointer. |
| b | Second module pointer. |
Referenced by _check_deleted_instances(), _create_deleted_modules(), dt_dev_history_refresh_nodes_ext(), dt_dev_load_modules(), dt_dev_module_duplicate(), and dt_ioppr_resync_modules_order().
| gint dt_sort_iop_list_by_order | ( | gconstpointer | a, |
| gconstpointer | b | ||
| ) |
Referenced by dt_ioppr_get_iop_order_list().
| gint dt_sort_iop_list_by_order_f | ( | gconstpointer | a, |
| gconstpointer | b | ||
| ) |
Compare two list nodes holding modules by iop_order.
| a | GList node containing a module. |
| b | GList node containing a module. |
Referenced by _upgrade_library_schema_step(), and dt_exif_xmp_read().
| const char* iop_order_string[] |
Note : we do not use finite-math-only and fast-math because divisions by zero are not manually avoided in the code fp-contract=fast enables hardware-accelerated Fused Multiply-Add the rest is loop reorganization and vectorization optimization
Referenced by dt_iop_order_string().
| const dt_iop_order_entry_t legacy_order[] |
| const dt_iop_order_entry_t v30_jpg_order[] |
| const dt_iop_order_entry_t v30_order[] |