![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/imageop_gui.h"#include "darktable.h"#include "widgets/widget_settings.h"#include "common/conf.h"#include "common/sentry.h"#include "common/telemetry.h"#include "develop/imageop.h"#include "widgets/bauhaus.h"#include "common/collection.h"#include "database/collection_query.h"#include "database/database.h"#include "database/history_repository.h"#include "database/preset_repository.h"#include "metadata/exif.h"#include "history/history.h"#include "common/imagebuf.h"#include "imageio/imageio_rawspeed.h"#include "pixel/interpolation.h"#include "common/module.h"#include "common/opencl.h"#include "common/usermanual_url.h"#include "control/control.h"#include "control/signal.h"#include "develop/blend.h"#include "develop/blend_gui.h"#include "develop/develop.h"#include "develop/dev_history.h"#include "pixel/format.h"#include "develop/masks.h"#include "develop/tiling.h"#include "widgets/gdkkeys.h"#include "gui/presets.h"#include "widgets/button.h"#include "widgets/expander.h"#include "gui/color_picker_proxy.h"#include "gui/application.h"#include "develop/gui_throttle.h"#include "common/hash.h"#include "common/module_versioning.h"#include <assert.h>#include <gmodule.h>#include <math.h>#include <complex.h>#include <stdlib.h>#include "widgets/container.h"#include "widgets/label.h"#include "widgets/popup.h"#include "widgets/widget_style.h"#include <string.h>#include <strings.h>#include <time.h>#include "widgets/togglebutton.h"#include "iop/iop_api.h"
Include dependency graph for imageop.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_gui_simple_callback_t |
Macros | |
| #define | INCLUDE_API_FROM_MODULE_STATIC_DEFAULTS |
| #define | INCLUDE_API_FROM_MODULE_LOAD_BY_SO |
Typedefs | |
| typedef struct dt_iop_gui_simple_callback_t | dt_iop_gui_simple_callback_t |
| #define INCLUDE_API_FROM_MODULE_LOAD_BY_SO |
| #define INCLUDE_API_FROM_MODULE_STATIC_DEFAULTS |
| typedef struct dt_iop_gui_simple_callback_t dt_iop_gui_simple_callback_t |
Definition at line 1392 of file imageop.c.
References dt_hash().
Referenced by dt_iop_compute_blendop_hash().
Definition at line 1031 of file imageop.c.
References _init_presets(), dt_free, dt_gui_get_global(), dt_iop_cleanup_module(), dt_iop_colorspace_is_rgb(), dt_iop_gui_cleanup_blending(), dt_iop_gui_cleanup_module(), dt_iop_gui_init(), dt_iop_gui_init_blending(), dt_iop_load_module_by_so(), FALSE, IOP_CS_LAB, IOP_FLAGS_NO_MASKS, IOP_FLAGS_SUPPORTS_BLENDING, and TRUE.
Referenced by dt_iop_load_modules_so().
|
static |
Definition at line 874 of file imageop.c.
References _resolve_presets_blend_colorspace(), dt_develop_blend_legacy_params(), dt_develop_blend_version(), dt_exif_xmp_encode(), dt_free, dt_gui_presets_autogen_enabled(), dt_history_repository_find_version_for_params(), dt_iop_cleanup_module(), dt_iop_load_module_by_so(), dt_module_preset_free(), dt_preset_repository_list_for_upgrade(), dt_preset_repository_set_blend_params(), dt_preset_repository_set_module_version(), dt_preset_repository_update_module_params(), IS_NULL_PTR, name, dt_iop_module_so_t::op, and preset.
Referenced by _init_module_so().
|
static |
Definition at line 396 of file imageop.c.
References dt_dev_get_global(), dt_iop_gui_set_expanded(), dt_iop_request_focus(), IS_NULL_PTR, and TRUE.
|
static |
Bind one statically-linked IOP module into its dt_iop_module_so_t.
IOP modules are compiled into lib_ansel, not dlopen'd: the set of them is fixed at build time, and both develop/iop_order.c's order tables and develop/geometry's roster are written against that same fixed set, so a module discovered on disk could never be anything but a disagreement with them – which is exactly what dt_ioppr_check_so_iop_order() used to abort startup over. See doc/static-iop.md.
This replaces the g_module_symbol() sweep. Two halves, and they cannot be merged: entry->fill_so() runs in the MODULE's translation unit, where the plain API names resolve to that module's own asm-labelled symbols, and stores NULL for every entry point it does not define; the DEFAULT fallbacks are applied here instead, because default_<fn> is static to this file.
| module | Zeroed module descriptor to fill. |
| entry | Registry entry naming the module and its generated binder. |
Definition at line 454 of file imageop.c.
References default_get_f(), default_get_introspection(), default_get_introspection_linear(), default_get_p(), DT_INTROSPECTION_VERSION, dt_opencl_is_inited(), dt_iop_module_static_entry_t::fill_so, IS_NULL_PTR, dt_iop_module_so_t::op, and dt_iop_module_static_entry_t::op.
Referenced by dt_iop_load_modules_so().
|
static |
|
static |
|
static |
Is this pipeline node safe to dispatch module code on?
The mirror of the validation dt_iop_cleanup_pipe() already performs, and for the same reason it gives: a pipe can be walked while holding a node whose backing storage is no longer trustworthy, and "calling the descriptor callback with that same instance would only move the use-after-free into the module cleanup code". Commit is the other door into module code, and it was unguarded – it memcpy'd into piece->blendop_data before reading anything, so a stale node corrupted memory before any callback could object.
Every check here is an invariant the pipeline establishes itself, never a guess:
Definition at line 1514 of file imageop.c.
References dt_dev_pixelpipe_iop_t::blendop_data, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, DT_DEBUG_ALWAYS, dt_print(), FALSE, IS_NULL_PTR, dt_iop_module_t::op, and TRUE.
Referenced by dt_iop_commit_params().
| gboolean _iop_validate_params | ( | dt_introspection_field_t * | field, |
| gpointer | params, | ||
| gboolean | report | ||
| ) |
Definition at line 1271 of file imageop.c.
References _iop_validate_params(), dt_introspection_field_t::Array, dt_introspection_field_t::Char, dt_introspection_type_array_t::count, DT_INTROSPECTION_TYPE_ARRAY, DT_INTROSPECTION_TYPE_BOOL, DT_INTROSPECTION_TYPE_CHAR, DT_INTROSPECTION_TYPE_ENUM, DT_INTROSPECTION_TYPE_FLOAT, DT_INTROSPECTION_TYPE_FLOATCOMPLEX, DT_INTROSPECTION_TYPE_INT, DT_INTROSPECTION_TYPE_INT8, DT_INTROSPECTION_TYPE_OPAQUE, DT_INTROSPECTION_TYPE_STRUCT, DT_INTROSPECTION_TYPE_UINT, DT_INTROSPECTION_TYPE_UNION, DT_INTROSPECTION_TYPE_USHORT, dt_introspection_type_struct_t::entries, dt_introspection_type_union_t::entries, dt_introspection_field_t::Enum, FALSE, dt_introspection_type_array_t::field, dt_introspection_type_struct_t::fields, dt_introspection_type_union_t::fields, dt_introspection_field_t::Float, dt_introspection_field_t::FloatComplex, dt_introspection_field_t::header, i, dt_introspection_field_t::Int, dt_introspection_field_t::Int8, dt_introspection_type_float_t::Max, dt_introspection_type_float_complex_t::Max, dt_introspection_type_char_t::Max, dt_introspection_type_int8_t::Max, dt_introspection_type_ushort_t::Max, dt_introspection_type_int_t::Max, dt_introspection_type_uint_t::Max, dt_introspection_type_float_t::Min, dt_introspection_type_float_complex_t::Min, dt_introspection_type_char_t::Min, dt_introspection_type_int8_t::Min, dt_introspection_type_ushort_t::Min, dt_introspection_type_int_t::Min, dt_introspection_type_uint_t::Min, dt_introspection_type_header_t::name, dt_introspection_type_header_t::offset, p, dt_introspection_type_header_t::size, dt_introspection_field_t::Struct, TRUE, dt_introspection_type_header_t::type, dt_introspection_type_array_t::type, dt_introspection_type_header_t::type_name, dt_introspection_field_t::UInt, dt_introspection_field_t::Union, dt_introspection_field_t::UShort, and dt_introspection_type_enum_t::values.
Referenced by _iop_validate_params(), and dt_iop_commit_params().
|
static |
Definition at line 760 of file imageop.c.
References dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), FALSE, dt_develop_t::history, dt_develop_t::history_mutex, and IS_NULL_PTR.
Referenced by dt_iop_module_is_in_pipeline().
|
static |
Definition at line 832 of file imageop.c.
References dt_develop_blend_params_t::blend_cst, DEVELOP_BLEND_CS_NONE, dt_develop_blend_resolve_default_colorspace(), dt_develop_blend_version(), dt_free, dt_iop_cleanup_module(), dt_iop_load_module_by_so(), dt_module_preset_free(), dt_preset_repository_list_for_upgrade(), dt_preset_repository_set_blend_params(), IOP_FLAGS_SUPPORTS_BLENDING, IS_NULL_PTR, dt_iop_module_so_t::op, and preset.
Referenced by _init_presets().
|
static |
Definition at line 251 of file imageop.c.
References dt_iop_module_t::default_params, dt_free, and dt_iop_module_t::params.
|
static |
Definition at line 239 of file imageop.c.
References dt_dev_pixelpipe_iop_t::data, and dt_free_align.
|
static |
Definition at line 222 of file imageop.c.
References dt_dev_pixelpipe_iop_t::data, and dt_iop_module_t::params_size.
|
static |
Definition at line 170 of file imageop.c.
References IOP_GROUP_TECHNICAL.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 303 of file imageop.c.
Referenced by _iop_load_module_static().
|
static |
Definition at line 295 of file imageop.c.
Referenced by _iop_load_module_static().
|
static |
Definition at line 291 of file imageop.c.
Referenced by _iop_load_module_static().
Definition at line 299 of file imageop.c.
Referenced by _iop_load_module_static().
|
static |
Definition at line 246 of file imageop.c.
References IOP_GUI_FREE.
|
static |
Definition at line 208 of file imageop.c.
References dt_iop_module_t::default_params, dt_iop_module_t::params, and dt_iop_module_t::params_size.
|
static |
Definition at line 231 of file imageop.c.
References dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, dt_calloc_align(), and dt_iop_module_t::params_size.
| int default_iop_focus | ( | dt_gui_module_t * | m, |
| gboolean | toggle | ||
| ) |
Definition at line 415 of file imageop.c.
References dt_gui_refocus_center(), dt_iop_gui_set_expanded(), dt_iop_request_focus(), FALSE, and TRUE.
|
static |
Definition at line 281 of file imageop.c.
References dt_iop_roi_t::height, i, dt_iop_module_t::process_plain, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, and dt_iop_roi_t::width.
|
static |
| float dt_dev_get_module_scale | ( | const dt_dev_pixelpipe_t *const | pipe, |
| const dt_iop_roi_t *const | roi_in | ||
| ) |
Definition at line 134 of file imageop.c.
References dt_dev_pixelpipe_t::iscale, and dt_iop_roi_t::scale.
Referenced by _harmonic_reconstruct_cl(), _harmonic_reconstruct_host(), get_scales(), process(), process(), process(), process(), process_cl(), process_harmonic(), process_laplacian(), process_laplacian_bayer_cl(), process_laplacian_passthrough_cl(), process_laplacian_xtrans_cl(), and tiling_callback().
| uint32_t dt_dev_get_roi_filters | ( | const dt_dev_pixelpipe_iop_t *const | piece, |
| const dt_iop_roi_t *const | roi_in | ||
| ) |
Definition at line 139 of file imageop.c.
References dt_dev_pixelpipe_iop_t::dsc_in, dt_rawspeed_crop_dcraw_filters(), dt_iop_buffer_dsc_t::filters, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _harmonic_reconstruct_host(), process(), process(), process_cl(), process_default_cl(), process_harmonic(), process_harmonic_cl(), process_laplacian(), process_laplacian_bayer_cl(), and process_rcd_cl().
| gboolean dt_iop_check_modules_equal | ( | dt_iop_module_t * | mod_1, |
| dt_iop_module_t * | mod_2 | ||
| ) |
Definition at line 1382 of file imageop.c.
References dt_iop_module_t::instance, dt_iop_module_t::iop_order, and dt_iop_module_t::multi_priority.
Referenced by dt_dev_add_history_item_ext().
| void dt_iop_cleanup_module | ( | dt_iop_module_t * | module | ) |
calls module->cleanup and closes the dl connection.
Definition at line 1113 of file imageop.c.
References dt_iop_module_t::blend_params, dt_develop_t::color_picker, dt_iop_module_t::common_fields, dt_iop_module_t::default_blendop_params, dt_control_signal_disconnect_all(), dt_control_signal_get_global(), dt_dev_get_global(), dt_free, dt_develop_t::enabled, FALSE, dt_iop_module_t::histogram, IS_NULL_PTR, dt_iop_module_t::masks, dt_gui_module_t::name, dt_develop_t::picker, dt_iop_module_t::raster_mask, dt_iop_module_t::source, dt_develop_t::update_pending, dt_iop_module_t::users, dt_gui_module_t::view, and dt_develop_t::widget.
Referenced by _dt_styles_tmp_module_free(), _dt_styles_tmp_module_from_style_item(), _init_module_so(), _init_presets(), _resolve_presets_blend_colorspace(), _studio_dev_teardown(), dt_dev_cleanup(), dt_develop_blend_legacy_params_from_so(), and leave().
| void dt_iop_cleanup_pipe | ( | struct dt_iop_module_t * | module, |
| struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Release module-owned resources for one pixelpipe node.
The instance callback is an immutable copy of the callback stored in the loaded shared-object descriptor. Pixelpipes can retain removed module instances until their next topology rebuild, so validate both the descriptor lifetime and that callback identity before calling through the instance. A mismatch means the instance storage is no longer trustworthy; calling the descriptor callback with that same instance would only move the use-after-free into the module cleanup code.
Definition at line 641 of file imageop.c.
References dt_dev_pixelpipe_iop_t::blendop_data, darktable, DT_DEBUG_ALWAYS, dt_free_align, dt_print(), FALSE, darktable_t::iop, IS_NULL_PTR, dt_iop_module_so_t::op, dt_iop_module_t::op, and TRUE.
Referenced by dt_dev_pixelpipe_cleanup_nodes().
| void dt_iop_commit_blend_params | ( | dt_iop_module_t * | module, |
| const dt_develop_blend_params_t * | blendop_params | ||
| ) |
Definition at line 1234 of file imageop.c.
References dt_iop_module_t::blend_params, dt_iop_module_t::dev, DT_DEBUG_MASKS, dt_develop_blend_resolve_default_colorspace(), dt_iop_set_mask_mode(), dt_print(), dt_develop_t::iop, m, 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 dt_iop_module_t::users.
Referenced by _gui_reset_callback(), _history_to_module(), dt_dev_copy_module_contents(), dt_dev_history_item_update_from_params(), dt_gui_presets_apply_preset(), dt_iop_gui_duplicate(), and dt_iop_load_default_params().
| void dt_iop_commit_params | ( | dt_iop_module_t * | module, |
| dt_iop_params_t * | params, | ||
| struct dt_develop_blend_params_t * | blendop_params, | ||
| struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Copy params into the pipeline piece, so the next render uses them.
commits params and updates piece hash.
| module | the module whose commit_params() callback is invoked. |
| params | the parameter block to commit; copied, not retained. |
| piece | the pipeline piece to configure. Must already be initialised for this pipe. |
Definition at line 1565 of file imageop.c.
References _iop_piece_is_committable(), _iop_validate_params(), dt_dev_pixelpipe_iop_t::blendop_data, dt_dev_pixelpipe_iop_t::blendop_hash, dt_dev_pixelpipe_iop_t::cache_output_on_ram, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, dt_iop_module_t::dev, dt_conf_get_bool(), dt_conf_key_exists(), dt_conf_key_not_empty(), dt_conf_set_bool(), DT_DEBUG_ALWAYS, DT_DEBUG_PARAMS, dt_free, dt_get_debug_flags(), dt_hash(), dt_iop_compute_module_hash(), dt_pixelpipe_get_pipe_name(), dt_print(), dt_dev_pixelpipe_iop_t::enabled, dt_develop_t::forms, dt_dev_pixelpipe_iop_t::global_hash, dt_dev_pixelpipe_iop_t::global_mask_hash, dt_dev_pixelpipe_iop_t::hash, IOP_FLAGS_ALLOW_TILING, IS_NULL_PTR, dt_iop_module_t::multi_name, dt_iop_module_t::op, dt_dev_pixelpipe_iop_t::process_cl_ready, dt_dev_pixelpipe_iop_t::process_tiling_ready, dt_iop_module_t::so, TRUE, and dt_dev_pixelpipe_t::type.
Referenced by _commit_piece_contract(), _sync_focused_in_place(), and dt_dev_pixelpipe_sync_no_history().
| void dt_iop_compute_blendop_hash | ( | dt_iop_module_t * | module, |
| uint64_t | hash, | ||
| GList * | masks | ||
| ) |
Definition at line 1407 of file imageop.c.
References _hash_raster_masks(), dt_iop_module_t::blend_params, dt_hash(), dt_masks_get_from_id_ext(), dt_masks_group_get_hash_ext(), IOP_FLAGS_SUPPORTS_BLENDING, IS_NULL_PTR, dt_develop_blend_params_t::mask_id, dt_iop_module_t::raster_mask, dt_iop_module_t::source, and dt_iop_module_t::users.
Referenced by dt_iop_compute_module_hash().
| void dt_iop_compute_module_hash | ( | dt_iop_module_t * | module, |
| GList * | masks | ||
| ) |
Uniform way of getting the full state hash of user-defined parameters, including masks and blending. Writes the value in module->hash, also writes the module->blendop_hash for masking and blending.
WARNING: doesn't take into account parameters dynamically set at runtime.
WARNING: if computing module hash in HISTORY order, there is no guaranty that previous modules in PIPELINEÂ are also previous modules in HISTORY, so their blendops & masks may not be inited yet, meaning the blendop_hash we compute here will be garbage. In particular, (legacy) history compression algo can mess with history order, such that history entries of raster mask providers can end up after history entries of raster mask consumers. Our current history compression does a pipeline snapshot in pipeline order, for user-changed modules. (Raster masks providers and consumers will all be user-changed modules).
IFÂ COMPUTINGÂ HASHESÂ FORÂ PIPEÂ CACHEÂ INVALIDATION, that means we need to redo blendop/module hash recomputation at commit_params time, when pushing history to pipeline (but mandatorily in pipeline order).
IF COMPUTINGÂ HASHES FOR HISTORY CONSISTENCY (auto-saving when needed), since all we care is user params, it doesn't matter.
Definition at line 1461 of file imageop.c.
References dt_iop_module_t::blendop_hash, dt_hash(), dt_iop_compute_blendop_hash(), dt_iop_module_t::enabled, dt_iop_module_t::iop_order, dt_iop_module_t::multi_priority, dt_iop_module_t::op, dt_iop_module_t::params, and dt_iop_module_t::params_size.
Referenced by _dt_dev_modules_reload_defaults(), _history_to_module(), _process_history_db_entry(), commit_params(), dt_dev_history_item_update_from_params(), dt_iop_commit_params(), and dt_iop_load_default_params().
| void dt_iop_default_init | ( | dt_iop_module_t * | module | ) |
allocate and load default settings from introspection.
Definition at line 308 of file imageop.c.
References dt_iop_module_t::default_params, dt_free, DT_INTROSPECTION_TYPE_ARRAY, DT_INTROSPECTION_TYPE_BOOL, DT_INTROSPECTION_TYPE_CHAR, DT_INTROSPECTION_TYPE_ENUM, DT_INTROSPECTION_TYPE_FLOAT, DT_INTROSPECTION_TYPE_INT, DT_INTROSPECTION_TYPE_NONE, DT_INTROSPECTION_TYPE_OPAQUE, DT_INTROSPECTION_TYPE_STRUCT, DT_INTROSPECTION_TYPE_UINT, DT_INTROSPECTION_TYPE_USHORT, i, IS_NULL_PTR, p, and dt_iop_module_t::params.
| gboolean dt_iop_get_cache_bypass | ( | dt_iop_module_t * | module | ) |
Set bypass to TRUE if the pipeline cache should be bypassed temporarily for this module and the next, for example doing interactive GUI operations.
Pipeline cache consistency is ensured by hashing the internal module params and comparing that hash with the previously-known one from the cache line. If something outside the module is making the cache temporarily invalid, this is the way to go. The previous module's output may be fetched from cache if available, which is faster than simply disabling cache at all.
This is designed for mask previews, which have a special handling, in pipeline, where modules between the mask preview requesting module and the gamma.c module are bypassed, so the alpha channel is passed-through to be rendered by gamma.c without processing intermediate modules. This doesn't work if cache is enabled.
The pixelpipe code will propagate the bypass state to downstream pipe->pieces, so all modules coming later than this one in the pipeline will also have their cache disabled. That's how mask preview can work, because the pipeline is called in a recursive way, starting from the end.
Only one module from dev->iop list (modules tied to GUI) is allowed to bypass the cache at a time, other modules will lose their bypass flag if set.
Definition at line 1664 of file imageop.c.
Referenced by _suppressed_by_focus(), and dt_dev_pixelpipe_activemodule_disables_currentmodule().
| dt_iop_module_t * dt_iop_get_colorout_module | ( | void | ) |
get module by name and colorout, works only with a dev mode
Definition at line 1692 of file imageop.c.
References dt_dev_get_global(), and dt_iop_get_module_from_list().
| const gchar * dt_iop_get_localized_aliases | ( | const gchar * | op | ) |
Definition at line 1779 of file imageop.c.
References darktable, darktable_t::iop, and IS_NULL_PTR.
| const gchar * dt_iop_get_localized_name | ( | const gchar * | op | ) |
returns the localized plugin name for a given op name. must not be freed.
Definition at line 1757 of file imageop.c.
References darktable, darktable_t::iop, and IS_NULL_PTR.
Referenced by _history_operation_name(), _prepend_item(), and dt_add_hist().
| dt_iop_module_t * dt_iop_get_module | ( | const char * | op | ) |
Definition at line 1714 of file imageop.c.
References dt_dev_get_global(), and dt_iop_get_module_from_list().
| dt_iop_module_t * dt_iop_get_module_by_instance_name | ( | GList * | modules, |
| const char * | operation, | ||
| const char * | multi_name | ||
| ) |
returns module with op + multi_name or NULL if not found on the list, if IS_NULL_PTR(multi_name) do not check for it
Definition at line 1857 of file imageop.c.
References IS_NULL_PTR, m, dt_iop_module_t::multi_name, and dt_iop_module_t::op.
Referenced by _hm_dest_module_from_id(), _hm_module_from_id(), and dt_ioppr_update_for_entries().
| dt_iop_module_t * dt_iop_get_module_by_op_priority | ( | GList * | modules, |
| const char * | operation, | ||
| const int | multi_priority | ||
| ) |
returns module with op + multi_priority or NULL if not found on the list, if multi_priority == -1 do not check for it
Definition at line 1839 of file imageop.c.
References m, dt_iop_module_t::multi_priority, and dt_iop_module_t::op.
Referenced by _dt_styles_tmp_module_from_style_item(), _history_merge_resolve_dest_instance(), _hm_dest_module_from_id(), _hm_module_from_id(), _refresh_global_histogram_backbuf_for_hash(), _refresh_preview_histograms(), dt_dev_create_module_instance(), dt_dev_snapshot_capture(), dt_history_merge(), and dt_ioppr_resync_iop_list().
| int dt_iop_get_module_flags | ( | const char * | op | ) |
get module flags, works in dev and lt mode
Definition at line 1719 of file imageop.c.
References darktable, and darktable_t::iop.
Referenced by dt_gui_hist_dialog_new().
| dt_iop_module_t * dt_iop_get_module_from_list | ( | GList * | iop_list, |
| const char * | op | ||
| ) |
Definition at line 1697 of file imageop.c.
References dt_iop_module_t::op.
Referenced by _create_deleted_modules(), _process_history_db_entry(), dt_iop_get_colorout_module(), dt_iop_get_module(), and reload_defaults().
| gboolean dt_iop_gui_commit_iop_order_change | ( | struct dt_develop_t * | dev, |
| dt_iop_module_t * | module, | ||
| gboolean | enable, | ||
| gboolean | write_history, | ||
| const char * | reason | ||
| ) |
Commit the GUI-side consequences of an IOP-order change.
Order changes may come from drag-and-drop, context-menu move commands or preset application. The low-level order code only mutates dt_develop_t::iop and the serialized order list; this function updates module headers, rebuilds the pipes, stores the history item when requested and broadcasts the GUI change signal.
| dev | Develop instance owning the reordered modules. |
| module | Module to record in history, or NULL for whole-pipeline changes. |
| enable | History enable state passed to dt_dev_add_history_item. |
| write_history | TRUE to record a history item, FALSE to skip it. |
| reason | Debug string used in IOP-order checks. |
dev was NULL. Definition at line 693 of file imageop.c.
References dt_dev_add_history_item, dt_dev_pixelpipe_rebuild_all, dt_dev_signal_modules_moved(), dt_ioppr_check_iop_order(), enable(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _ioporder_apply_preset(), dt_iop_gui_move_module_after(), dt_iop_gui_move_module_before(), gui_reset(), and set_params().
| gboolean dt_iop_gui_move_module_after | ( | dt_iop_module_t * | module, |
| dt_iop_module_t * | module_prev, | ||
| const char * | reason | ||
| ) |
Move a module after another one and commit the GUI-side effects.
This is the GUI boundary for module reordering: dt_ioppr_move_iop_after only mutates the pipeline list and order list, while this function is responsible for updating visible headers, rebuilding the pipes, recording the history step and notifying GUI listeners.
| module | Module being moved. |
| module_prev | Module that should end up immediately before module. |
| reason | Debug string used in IOP-order checks. |
Definition at line 714 of file imageop.c.
References dt_iop_module_t::dev, dt_iop_gui_commit_iop_order_change(), dt_ioppr_move_iop_after(), FALSE, and TRUE.
Referenced by _ioporder_drag_data_received(), and _modulegroups_drag_data_received().
| gboolean dt_iop_gui_move_module_before | ( | dt_iop_module_t * | module, |
| dt_iop_module_t * | module_next, | ||
| const char * | reason | ||
| ) |
Move a module before another one and commit the GUI-side effects.
This is the GUI boundary for module reordering: dt_ioppr_move_iop_before only mutates the pipeline list and order list, while this function is responsible for updating visible headers, rebuilding the pipes, recording the history step and notifying GUI listeners.
| module | Module being moved. |
| module_next | Module that should end up immediately after module. |
| reason | Debug string used in IOP-order checks. |
Definition at line 707 of file imageop.c.
References dt_iop_module_t::dev, dt_iop_gui_commit_iop_order_change(), dt_ioppr_move_iop_before(), FALSE, and TRUE.
Referenced by _ioporder_drag_data_received(), and _modulegroups_drag_data_received().
| void dt_iop_gui_reset | ( | dt_iop_module_t * | module | ) |
reset the ui to its defaults
Definition at line 1646 of file imageop.c.
References dt_gui_freeze_begin, dt_gui_freeze_end, and dt_iop_is_hidden().
Referenced by _gui_reset_callback().
| void dt_iop_init_pipe | ( | struct dt_iop_module_t * | module, |
| struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Build one pixelpipe node's module-owned storage.
Establishes what _iop_piece_is_committable() later relies on. init_pipe is OPTIONAL in the module API, so a module that allocates nothing is legitimate and leaves data NULL with data_size 0; what is never legitimate is claiming a size without the storage, which is how a failed allocation would otherwise reach 61 modules that dereference piece->data unchecked.
Definition at line 604 of file imageop.c.
References dt_dev_pixelpipe_iop_t::blendop_data, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, dt_calloc_align(), DT_DEBUG_ALWAYS, dt_print(), dt_dev_pixelpipe_iop_t::enabled, IS_NULL_PTR, and dt_iop_module_t::op.
Referenced by dt_dev_pixelpipe_create_nodes().
| gboolean dt_iop_is_first_instance | ( | GList * | modules, |
| dt_iop_module_t * | module | ||
| ) |
returns true if module is the first instance of this operation in the pipe
Definition at line 1875 of file imageop.c.
References m, dt_iop_module_t::op, and TRUE.
Referenced by declare_cat_on_pipe().
| gboolean dt_iop_is_hidden | ( | dt_iop_module_t * | module | ) |
Definition at line 736 of file imageop.c.
References dt_iop_so_is_hidden(), and dt_iop_module_t::so.
Referenced by _get_user_mod_list(), _gui_delete_callback(), _ioporder_module_is_graph_visible(), _is_module_in_tab(), _modulegroups_reorder_target(), _modulegroups_sync_section_label_margins(), _studio_dev_teardown(), _update_iop_visibility(), dt_dev_history_gui_update(), dt_iop_gui_cleanup_module(), dt_iop_gui_duplicate(), dt_iop_gui_init(), dt_iop_gui_module_is_visible(), dt_iop_gui_reset(), dt_iop_gui_update(), dt_iop_is_visible(), dt_iop_module_is_in_pipeline(), enter(), and leave().
| gboolean dt_iop_is_raster_mask_used | ( | dt_iop_module_t * | module, |
| int | id | ||
| ) |
iterates over the users hash table and checks if a specific mask is being used
Definition at line 1825 of file imageop.c.
References FALSE, key, dt_iop_module_t::raster_mask, dt_iop_module_t::source, TRUE, dt_iop_module_t::users, and value.
Referenced by dt_dev_pixelpipe_process(), dt_develop_blend_process(), dt_develop_blend_process_cl(), and process().
| void dt_iop_load_default_params | ( | dt_iop_module_t * | module | ) |
loads default settings from database.
Definition at line 145 of file imageop.c.
References dt_iop_module_t::default_blendop_params, dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_develop_blend_default_module_blend_colorspace(), dt_develop_blend_init_blend_parameters(), dt_iop_commit_blend_params(), dt_iop_compute_module_hash(), dt_iop_gui_blending_reload_defaults(), dt_develop_t::forms, dt_iop_module_t::params, and dt_iop_module_t::params_size.
Referenced by _dt_dev_modules_reload_defaults(), and dt_iop_reload_defaults().
| int dt_iop_load_module | ( | dt_iop_module_t * | module, |
| dt_iop_module_so_t * | module_so, | ||
| dt_develop_t * | dev | ||
| ) |
Definition at line 1102 of file imageop.c.
References dt_free, and dt_iop_load_module_by_so().
Referenced by _create_deleted_modules(), _dt_styles_tmp_module_from_style_item(), _find_so_for_history_entry(), dt_dev_create_module_instance(), and dt_dev_module_duplicate().
| int dt_iop_load_module_by_so | ( | dt_iop_module_t * | module, |
| dt_iop_module_so_t * | so, | ||
| struct dt_develop_t * | dev | ||
| ) |
load a module for a given .so
Definition at line 510 of file imageop.c.
References dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_develop_t::gui_attached, IS_NULL_PTR, k, dt_iop_module_so_t::op, dt_iop_module_t::op, dt_iop_module_t::params, and dt_iop_module_t::params_size.
Referenced by _init_module_so(), _init_presets(), _resolve_presets_blend_colorspace(), dt_dev_load_modules(), dt_develop_blend_legacy_params_from_so(), and dt_iop_load_module().
loads and inits every module in dt_iop_static_modules.
Definition at line 1073 of file imageop.c.
References _init_module_so(), _iop_load_module_static(), darktable, dt_database_begin_transaction_batch(), dt_database_end_transaction_batch(), dt_free, dt_iop_static_modules, dt_iop_static_modules_count, darktable_t::iop, and k.
Referenced by dt_init().
| gboolean dt_iop_module_has_raster_mask | ( | const dt_iop_module_t * | module | ) |
returns TRUE if module consumes a raster mask
Definition at line 1194 of file imageop.c.
References FALSE, IS_NULL_PTR, dt_iop_module_t::raster_mask, dt_iop_module_t::sink, and dt_iop_module_t::source.
| gboolean dt_iop_module_instance_exists | ( | dt_iop_module_t * | iop | ) |
Whether this instance conceptually exists yet.
An extra instance is created by a history item, so one whose item sits past the current history end is only a disabled pipeline node referenced by an entry the user has not reached: it exists in dev->iop but not, as far as anything the user can act on is concerned. A base instance (multi_priority 0) always exists.
Definition at line 741 of file imageop.c.
References dt_iop_module_t::dev, dt_dev_get_history_end_ext(), dt_dev_history_get_last_item_by_module(), dt_pthread_rwlock_rdlock(), dt_pthread_rwlock_unlock(), FALSE, dt_develop_t::history, dt_develop_t::history_mutex, IS_NULL_PTR, dt_iop_module_t::multi_priority, and TRUE.
Referenced by _update_iop_visibility(), and dt_iop_module_is_in_pipeline().
| gboolean dt_iop_module_is_in_pipeline | ( | dt_iop_module_t * | iop | ) |
Whether the module is part of the pipeline the user sees – the rule the "Pipeline" tab of the module groups panel lists modules by, so that a list of pipeline modules built anywhere else agrees with what that tab shows. Includes disabled modules that carry history.
Definition at line 778 of file imageop.c.
References _module_carries_history(), dt_iop_is_hidden(), dt_iop_module_instance_exists(), dt_iop_module_t::enabled, FALSE, and IS_NULL_PTR.
Referenced by _is_module_in_tab(), and _modchooser_run().
| gboolean dt_iop_module_needs_mask_history | ( | const dt_iop_module_t * | module | ) |
returns TRUE if module needs masks committed to history
Definition at line 1228 of file imageop.c.
References dt_iop_module_needs_mask_history_ext().
Referenced by _hm_collect_labels_from_history_map(), _hm_report_dest_label(), _hm_report_update_arrows(), _hm_report_update_dest_labels(), _hm_show_merge_report_popup(), and dt_dev_add_history_item_ext().
| gboolean dt_iop_module_needs_mask_history_ext | ( | const dt_iop_module_t * | module, |
| gboolean * | raster, | ||
| gboolean * | drawn, | ||
| gboolean * | parametric | ||
| ) |
returns TRUE if module needs masks committed to history plus each flag is set accordingly
Definition at line 1205 of file imageop.c.
References dt_iop_module_t::blend_params, dt_develop_blend_get_mask_usage(), FALSE, and IS_NULL_PTR.
Referenced by dt_dev_history_item_from_source_history_item(), and dt_iop_module_needs_mask_history().
| gboolean dt_iop_module_supports_drawn_mask | ( | dt_iop_module_t * | iop | ) |
Whether the module can carry a drawn mask, i.e. whether offering it one means anything. Supports blending, and is not one of the modules that opt out of masks specifically.
Definition at line 785 of file imageop.c.
References dt_iop_module_t::blend_params, FALSE, flags, IOP_FLAGS_NO_MASKS, IOP_FLAGS_SUPPORTS_BLENDING, and IS_NULL_PTR.
Referenced by _modchooser_run(), _modules_owning_group(), _show_masks_on_owning_module(), _tree_select_module_group(), _tree_store_add_forms(), and dt_iop_gui_blend_set_drawn_mask_group().
| void dt_iop_nap | ( | int32_t | usec | ) |
allow plugins to relinquish CPU and go to sleep for some time
Definition at line 1653 of file imageop.c.
Referenced by dt_dev_darkroom_pipeline(), dt_opencl_reserve_device_for_pipe(), leave(), and nlmeans_denoise_cl().
| void dt_iop_reload_defaults | ( | dt_iop_module_t * | module | ) |
reloads certain gui/param defaults when the image was switched.
Definition at line 792 of file imageop.c.
References dt_iop_module_t::dev, DT_DEBUG_PARAMS, dt_gui_widget_freeze, dt_iop_gui_update_header(), dt_iop_load_default_params(), dt_print(), dt_iop_module_t::gui, dt_iop_module_gui_t::header, and dt_iop_module_t::op.
Referenced by _gui_reset_callback(), _insert_default_modules(), dt_dev_init_default_history(), and dt_iop_gui_duplicate().
| void dt_iop_set_cache_bypass | ( | dt_iop_module_t * | module, |
| gboolean | state | ||
| ) |
Definition at line 1669 of file imageop.c.
References dt_iop_module_t::bypass_cache, dt_iop_module_t::dev, FALSE, dt_develop_t::iop, and state.
Referenced by _blendop_blendif_channel_display_toggled(), _blendop_blendif_channel_mask_view(), _blendop_blendif_channel_mask_view_toggle(), _blendop_blendif_leave_delayed(), _blendop_blendif_showmask_clicked(), _blendop_blendif_update_tab(), _color_picker_reset(), _display_mask_indicator_callback(), _enter_edit_mode(), _enter_edit_mode(), _event_commit_clicked(), _event_commit_clicked(), _visualize_callback(), commit_params(), dt_iop_gui_blending_lose_focus(), dt_iop_gui_update_blendif(), dt_iop_gui_update_blending(), gui_cleanup(), gui_focus(), gui_reset(), init(), mask_callback(), process(), rt_sync_bypass_cache(), run_profile_callback(), run_validation_callback(), show_luminance_mask_callback(), and show_mask_callback().
| void dt_iop_set_cache_bypass_variant | ( | dt_iop_module_t * | module, |
| int | variant | ||
| ) |
Set the opaque per-module hash disambiguator described on dt_iop_module_t.bypass_cache_variant. Call alongside dt_iop_set_cache_bypass() whenever a module can be bypassing the cache for more than one mutually-independent GUI reason at once, so toggling one of them still changes the pipeline hash even while bypass_cache itself stays TRUE.
Definition at line 1686 of file imageop.c.
Referenced by rt_sync_bypass_cache().
| void dt_iop_set_darktable_iop_table | ( | ) |
Definition at line 1732 of file imageop.c.
References darktable, dt_collection_query_set_iop_names(), dt_free, i, darktable_t::iop, IS_NULL_PTR, dt_iop_name_row_t::name, and dt_iop_name_row_t::operation.
Referenced by dt_init().
| const char ** dt_iop_set_description | ( | dt_iop_module_t * | module, |
| const char * | main_text, | ||
| const char * | purpose, | ||
| const char * | input, | ||
| const char * | process, | ||
| const char * | output | ||
| ) |
| void dt_iop_set_mask_mode | ( | dt_iop_module_t * | module, |
| int | mask_mode | ||
| ) |
make sure the raster mask is advertised if available
Definition at line 1174 of file imageop.c.
References dt_iop_module_t::blend_params, dt_develop_blend_get_mask_usage(), dt_history_item_get_name(), FALSE, key, dt_iop_module_t::masks, dt_iop_module_t::raster_mask, dt_iop_module_t::source, and void().
Referenced by _blendop_masks_mode_callback(), dt_iop_commit_blend_params(), and dt_iop_gui_blend_set_drawn_mask_group().
| gboolean dt_iop_so_is_hidden | ( | dt_iop_module_so_t * | module | ) |
checks if iop do have an ui
Definition at line 721 of file imageop.c.
References FALSE, IOP_FLAGS_HIDDEN, IS_NULL_PTR, dt_iop_module_so_t::op, and TRUE.
Referenced by dt_iop_is_hidden().
tears down the module descriptors built by dt_iop_load_modules_so().
Definition at line 1163 of file imageop.c.
References darktable, dt_free, and darktable_t::iop.
Referenced by dt_cleanup().
| void dt_iop_update_multi_priority | ( | dt_iop_module_t * | module, |
| int | new_priority | ||
| ) |
set multi_priority and update raster mask links
Definition at line 1801 of file imageop.c.
References dt_dev_history_item_t::blend_params, dt_iop_module_t::blend_params, dt_iop_module_t::dev, dt_develop_t::history, key, dt_iop_module_t::raster_mask, dt_develop_blend_params_t::raster_mask_instance, dt_iop_module_t::source, dt_iop_module_t::users, and value.
Referenced by _create_deleted_modules(), _gui_delete_callback(), _history_to_module(), _process_history_db_entry(), _rebuild_multi_priority(), and dt_dev_module_duplicate().