![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "gui/color_picker_proxy.h"#include "bauhaus/bauhaus.h"#include "common/color_picker.h"#include "control/signal.h"#include "control/control.h"#include "develop/dev_pixelpipe.h"#include "develop/pixelpipe_cache.h"#include "gui/gtk.h"#include "libs/colorpicker.h"#include "libs/lib.h"#include <inttypes.h>#include <math.h>#include <string.h>
Include dependency graph for color_picker_proxy.c:Go to the source code of this file.
Typedefs | |
| typedef enum dt_pixelpipe_picker_source_t | dt_pixelpipe_picker_source_t |
| typedef enum dt_color_picker_resample_status_t | dt_color_picker_resample_status_t |
Enumerations | |
| enum | dt_pixelpipe_picker_source_t { PIXELPIPE_PICKER_INPUT = 0 , PIXELPIPE_PICKER_OUTPUT = 1 } |
| enum | dt_color_picker_resample_status_t { DT_COLOR_PICKER_RESAMPLE_CONSUMED = 0 , DT_COLOR_PICKER_RESAMPLE_RETRY = 1 , DT_COLOR_PICKER_RESAMPLE_EMITTED = 2 } |
| typedef enum dt_pixelpipe_picker_source_t dt_pixelpipe_picker_source_t |
| Enumerator | |
|---|---|
| DT_COLOR_PICKER_RESAMPLE_CONSUMED | |
| DT_COLOR_PICKER_RESAMPLE_RETRY | |
| DT_COLOR_PICKER_RESAMPLE_EMITTED | |
Definition at line 154 of file color_picker_proxy.c.
| Enumerator | |
|---|---|
| PIXELPIPE_PICKER_INPUT | |
| PIXELPIPE_PICKER_OUTPUT | |
Definition at line 148 of file color_picker_proxy.c.
|
static |
Definition at line 796 of file color_picker_proxy.c.
References _color_picker_callback_button_press().
Referenced by _color_picker_new().
|
static |
Definition at line 697 of file color_picker_proxy.c.
References _color_picker_reset(), _picker_initialize_geometry_raw(), _picker_raw_box_to_image_norm(), _picker_raw_point_to_image_norm(), dt_iop_color_picker_t::colorpick, darktable, darktable_t::develop, dt_bauhaus_widget_set_quad_active(), DT_COLOR_PICKER_AREA, DT_COLOR_PICKER_POINT, DT_COLOR_PICKER_POINT_AREA, dt_control_queue_redraw_center(), DT_DEBUG_DEV, dt_dev_pixelpipe_cache_wait_cleanup(), dt_iop_color_picker_request_update(), dt_iop_request_focus(), dt_key_modifier_state(), dt_lib_colorpicker_set_box_area(), dt_lib_colorpicker_set_point(), DT_LIB_COLORPICKER_SIZE_BOX, dt_modifier_is(), dt_print(), DT_REQUEST_COLORPICK_OFF, dt_unreachable_codepath, DTGTK_IS_TOGGLEBUTTON, FALSE, darktable_t::gui, IOP_CS_NONE, IS_NULL_PTR, kind, dt_iop_color_picker_t::kind, darktable_t::lib, dt_iop_color_picker_t::pick_box, dt_iop_color_picker_t::pick_pos, dt_iop_color_picker_t::picker_cst, dt_gui_gtk_t::reset, state, and TRUE.
Referenced by _color_picker_callback(), and _color_picker_new().
|
static |
Definition at line 917 of file color_picker_proxy.c.
References _color_picker_callback(), _color_picker_callback_button_press(), _color_picker_widget_destroy(), _init_picker(), dt_develop_t::color_picker, darktable, darktable_t::develop, dt_bauhaus_widget_set_quad_active(), dt_bauhaus_widget_set_quad_paint(), dt_bauhaus_widget_set_quad_toggle(), dtgtk_cairo_paint_colorpicker(), dtgtk_togglebutton_new(), dt_develop_t::enabled, FALSE, darktable_t::gui, IS_NULL_PTR, kind, dt_develop_t::kind, dt_develop_t::picker, dt_develop_t::picker_cst, dt_iop_color_picker_t::picker_cst, dt_gui_gtk_t::reset, TRUE, and dt_develop_t::widget.
Referenced by dt_color_picker_new(), and dt_color_picker_new_with_cst().
|
static |
Definition at line 624 of file color_picker_proxy.c.
References dt_iop_color_picker_t::colorpick, darktable, dt_bauhaus_widget_set_quad_active(), dt_iop_set_cache_bypass(), DTGTK_IS_TOGGLEBUTTON, FALSE, darktable_t::gui, and dt_gui_gtk_t::reset.
Referenced by _color_picker_callback_button_press(), _init_picker(), and dt_iop_color_picker_reset().
|
static |
Definition at line 641 of file color_picker_proxy.c.
References dt_develop_t::color_picker, darktable, darktable_t::develop, IS_NULL_PTR, dt_develop_t::picker, void(), and dt_develop_t::widget.
Referenced by _color_picker_new().
|
static |
Definition at line 674 of file color_picker_proxy.c.
References _color_picker_reset(), dt_iop_color_picker_t::colorpick, FALSE, dt_iop_color_picker_t::geometry_is_raw, kind, dt_iop_color_picker_t::kind, dt_iop_color_picker_t::pick_box, dt_iop_color_picker_t::pick_pos, dt_iop_color_picker_t::picker_cst, and dt_iop_color_picker_t::update_pending.
Referenced by _color_picker_new().
|
static |
Definition at line 878 of file color_picker_proxy.c.
References _queue_refresh_active_picker(), dt_develop_t::color_picker, darktable, darktable_t::develop, DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, IS_NULL_PTR, TRUE, void(), dt_develop_t::wait_input_hash, and dt_develop_t::wait_output_hash.
Referenced by dt_iop_color_picker_cleanup(), and dt_iop_color_picker_init().
|
static |
Definition at line 869 of file color_picker_proxy.c.
References _queue_refresh_active_picker(), _track_active_picker_hashes(), darktable, darktable_t::develop, and void().
Referenced by dt_iop_color_picker_cleanup(), and dt_iop_color_picker_init().
|
static |
Definition at line 180 of file color_picker_proxy.c.
References dt_dev_pixelpipe_iop_t::buf_out, dt_dev_distort_transform_plus(), dt_dev_pixelpipe_get_module_piece(), DT_DEV_TRANSFORM_DIR_FORW_EXCL, dt_iop_roi_t::height, dt_iop_module_t::iop_order, IS_NULL_PTR, dt_develop_t::preview_pipe, dt_develop_t::processed_height, dt_develop_t::processed_width, dt_develop_t::roi, and dt_iop_roi_t::width.
Referenced by _picker_initialize_geometry_raw().
|
static |
Definition at line 222 of file color_picker_proxy.c.
References _picker_get_module_bounds_image_norm(), dt_dev_coordinates_image_norm_to_raw_norm(), dt_iop_color_picker_t::geometry_is_raw, height, IS_NULL_PTR, dt_iop_color_picker_t::pick_box, dt_iop_color_picker_t::pick_pos, dt_develop_t::processed_height, dt_develop_t::processed_width, dt_develop_t::roi, TRUE, and width.
Referenced by _color_picker_callback_button_press().
|
inlinestatic |
Definition at line 173 of file color_picker_proxy.c.
References dt_dev_coordinates_raw_norm_to_image_norm().
Referenced by _color_picker_callback_button_press(), and _picker_sample_box().
|
inlinestatic |
Definition at line 165 of file color_picker_proxy.c.
References dt_dev_coordinates_raw_norm_to_image_norm().
Referenced by _color_picker_callback_button_press(), and _picker_sample_box().
|
static |
Definition at line 270 of file color_picker_proxy.c.
References _picker_raw_box_to_image_norm(), _picker_raw_point_to_image_norm(), dt_colorpicker_sample_t::box, dt_develop_t::color_picker, darktable, darktable_t::develop, dt_dev_coordinates_image_norm_to_image_abs(), dt_dev_distort_backtransform_plus(), DT_DEV_TRANSFORM_DIR_FORW_EXCL, DT_DEV_TRANSFORM_DIR_FORW_INCL, DT_LIB_COLORPICKER_SIZE_BOX, DT_LIB_COLORPICKER_SIZE_POINT, dt_iop_roi_t::height, dt_iop_module_t::iop_order, IS_NULL_PTR, MAX, MIN, PIXELPIPE_PICKER_INPUT, dt_colorpicker_sample_t::point, dt_develop_t::preview_pipe, dt_develop_t::primary_sample, dt_iop_roi_t::scale, dt_colorpicker_sample_t::size, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _sample_picker_buffer().
|
static |
Definition at line 563 of file color_picker_proxy.c.
References _refresh_active_picker_idle(), dt_develop_t::color_picker, IS_NULL_PTR, and dt_develop_t::refresh_idle_source.
Referenced by _iop_color_picker_cacheline_ready_callback(), _iop_color_picker_history_resync_callback(), _restart_picker_cache_wait(), and dt_iop_color_picker_request_update().
|
static |
Synchronize one picker cached geometry with the primary sample.
The active picker keeps a copy of the sample point/box so reopening it restores the previous GUI geometry. This function only mirrors the current primary sample into that cached geometry and reports whether the coordinates changed since the previous sampling pass.
It does not consume self->update_pending. That flag is the same update logic seen from the non-geometric side: first activation and colorspace changes request one callback even if the picker geometry itself did not move.
Definition at line 113 of file color_picker_proxy.c.
References dt_colorpicker_sample_t::box, dt_develop_t::color_picker, darktable, darktable_t::develop, DT_LIB_COLORPICKER_SIZE_BOX, DT_LIB_COLORPICKER_SIZE_POINT, FALSE, dt_iop_color_picker_t::geometry_is_raw, k, dt_iop_color_picker_t::pick_box, dt_iop_color_picker_t::pick_pos, dt_colorpicker_sample_t::point, dt_develop_t::primary_sample, dt_colorpicker_sample_t::size, and TRUE.
Referenced by _refresh_active_picker().
|
static |
Definition at line 576 of file color_picker_proxy.c.
References _record_point_area(), _sample_picker_from_cache(), _track_active_picker_hashes(), dt_develop_t::color_picker, DT_COLOR_PICKER_RESAMPLE_RETRY, dt_control_queue_redraw_center(), DT_DEBUG_DEV, dt_print(), dt_develop_t::enabled, FALSE, dt_develop_t::histogram_module, IS_NULL_PTR, dt_develop_t::picker, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, dt_develop_t::refresh_global_picker, and dt_develop_t::update_pending.
Referenced by _refresh_active_picker_idle().
|
static |
Definition at line 555 of file color_picker_proxy.c.
References _refresh_active_picker(), dt_develop_t::color_picker, and dt_develop_t::refresh_idle_source.
Referenced by _queue_refresh_active_picker().
|
static |
Definition at line 570 of file color_picker_proxy.c.
References _queue_refresh_active_picker().
Referenced by _sample_picker_from_cache().
|
static |
Definition at line 335 of file color_picker_proxy.c.
References _picker_sample_box(), dt_iop_buffer_dsc_t::cst, dt_color_picker_helper(), dt_iop_color_picker_get_active_cst(), dt_ioppr_get_pipe_current_profile_info(), FALSE, k, max, min, and TRUE.
Referenced by _sample_picker_from_cache().
|
static |
Definition at line 402 of file color_picker_proxy.c.
References _restart_picker_cache_wait(), _sample_picker_buffer(), dt_dev_pixelpipe_iop_t::bypass_cache, dt_dev_pixelpipe_t::bypass_cache, dt_develop_t::color_picker, darktable, dt_iop_buffer_dsc_t::datatype, dt_dev_pixelpipe_iop_t::dsc_out, DT_COLOR_PICKER_RESAMPLE_CONSUMED, DT_COLOR_PICKER_RESAMPLE_EMITTED, DT_COLOR_PICKER_RESAMPLE_RETRY, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_DEBUG_DEV, dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_cache_wait_set_owner(), dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), dt_dev_pixelpipe_get_realtime(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_print(), DT_SIGNAL_CONTROL_PICKERDATA_READY, dt_develop_t::enabled, dt_iop_module_t::enabled, FALSE, dt_dev_pixelpipe_iop_t::global_hash, dt_develop_t::gui_module, dt_develop_t::input_wait, IS_NULL_PTR, k, dt_dev_pixelpipe_t::no_cache, dt_develop_t::output_wait, dt_develop_t::pending_module, dt_develop_t::pending_pipe, dt_develop_t::picker, dt_develop_t::piece_hash, darktable_t::pixelpipe_cache, PIXELPIPE_PICKER_INPUT, PIXELPIPE_PICKER_OUTPUT, dt_develop_t::preview_pipe, dt_dev_pixelpipe_iop_t::roi_out, darktable_t::signals, TRUE, TYPE_FLOAT, dt_develop_t::update_pending, dt_develop_t::wait_input_hash, and dt_develop_t::wait_output_hash.
Referenced by _refresh_active_picker().
|
static |
Definition at line 848 of file color_picker_proxy.c.
References dt_develop_t::color_picker, dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_develop_t::enabled, dt_iop_module_t::enabled, dt_dev_pixelpipe_iop_t::global_hash, dt_develop_t::gui_module, IS_NULL_PTR, dt_develop_t::picker, dt_develop_t::preview_pipe, dt_develop_t::wait_input_hash, and dt_develop_t::wait_output_hash.
Referenced by _iop_color_picker_history_resync_callback(), and _refresh_active_picker().
| GtkWidget * dt_color_picker_new | ( | dt_iop_module_t * | module, |
| dt_iop_color_picker_kind_t | kind, | ||
| GtkWidget * | w | ||
| ) |
Definition at line 978 of file color_picker_proxy.c.
References _color_picker_new(), FALSE, IOP_CS_NONE, and kind.
Referenced by dt_iop_gui_init_blendif(), gui_init(), gui_init(), and gui_init_section().
| GtkWidget * dt_color_picker_new_with_cst | ( | dt_iop_module_t * | module, |
| dt_iop_color_picker_kind_t | kind, | ||
| GtkWidget * | w, | ||
| const dt_iop_colorspace_type_t | cst | ||
| ) |
Definition at line 983 of file color_picker_proxy.c.
References _color_picker_new(), kind, and TRUE.
Referenced by gui_init(), and gui_init().
Definition at line 909 of file color_picker_proxy.c.
References _iop_color_picker_cacheline_ready_callback(), _iop_color_picker_history_resync_callback(), darktable, DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, and darktable_t::signals.
Referenced by leave().
| gboolean dt_iop_color_picker_force_cache | ( | const dt_dev_pixelpipe_t * | pipe, |
| const dt_iop_module_t * | module | ||
| ) |
Definition at line 838 of file color_picker_proxy.c.
References dt_develop_t::color_picker, dt_dev_pixelpipe_t::dev, dt_dev_pixelpipe_get_module_piece(), and dt_dev_pixelpipe_get_prev_enabled_piece().
Referenced by _seal_opencl_cache_policy().
| dt_iop_colorspace_type_t dt_iop_color_picker_get_active_cst | ( | dt_iop_module_t * | module | ) |
Definition at line 812 of file color_picker_proxy.c.
References dt_develop_t::color_picker, darktable, darktable_t::develop, IOP_CS_NONE, dt_develop_t::picker, and dt_iop_color_picker_t::picker_cst.
Referenced by _blendif_colorpicker_cst(), and _sample_picker_buffer().
| int dt_iop_color_picker_get_ready_data | ( | const dt_iop_module_t * | module, |
| GtkWidget ** | picker, | ||
| dt_dev_pixelpipe_t ** | pipe, | ||
| const dt_dev_pixelpipe_iop_t ** | piece | ||
| ) |
Definition at line 362 of file color_picker_proxy.c.
References dt_develop_t::color_picker, darktable, dt_dev_pixelpipe_iop_t::data, darktable_t::develop, DT_DEBUG_DEV, dt_print(), dt_dev_pixelpipe_iop_t::global_hash, IS_NULL_PTR, dt_dev_pixelpipe_t::nodes, dt_iop_module_t::op, dt_develop_t::pending_module, dt_develop_t::pending_pipe, dt_develop_t::piece_hash, and dt_develop_t::widget.
Referenced by _iop_color_picker_data_ready_callback().
Definition at line 901 of file color_picker_proxy.c.
References _iop_color_picker_cacheline_ready_callback(), _iop_color_picker_history_resync_callback(), darktable, DT_DEBUG_CONTROL_SIGNAL_CONNECT, DT_SIGNAL_CACHELINE_READY, DT_SIGNAL_HISTORY_RESYNC, and darktable_t::signals.
Referenced by enter().
| gboolean dt_iop_color_picker_is_active_module | ( | const dt_iop_module_t * | module | ) |
Tell whether one module currently owns the active darkroom picker.
Module code often needs to know whether a GUI callback is running for the module that currently captures picker updates. That ownership lives under dt_develop_t::color_picker, so callers should query it through this API instead of open-coding the develop-state test at each call site.
| module | Candidate module. |
module. Definition at line 94 of file color_picker_proxy.c.
Referenced by _spot_settings_changed_callback(), and _spot_settings_changed_callback().
| gboolean dt_iop_color_picker_is_visible | ( | const dt_develop_t * | dev | ) |
Definition at line 82 of file color_picker_proxy.c.
References dt_develop_t::color_picker, dt_develop_t::enabled, dt_iop_module_t::enabled, and dt_develop_t::gui_module.
Referenced by _switch_cursors(), _switch_preview_cursor(), button_pressed(), button_pressed(), button_released(), expose(), gui_post_expose(), mouse_moved(), mouse_moved(), and scrolled().
Definition at line 822 of file color_picker_proxy.c.
References _queue_refresh_active_picker(), dt_develop_t::color_picker, darktable, darktable_t::develop, DT_DEBUG_DEV, dt_print(), dt_develop_t::picker, TRUE, dt_develop_t::update_pending, dt_iop_color_picker_t::update_pending, and dt_develop_t::widget.
Referenced by _color_picker_callback_button_press(), dt_iop_color_picker_set_cst(), dt_lib_colorpicker_set_box_area(), and dt_lib_colorpicker_set_point().
| void dt_iop_color_picker_reset | ( | dt_iop_module_t * | module, |
| gboolean | keep | ||
| ) |
Definition at line 651 of file color_picker_proxy.c.
References _color_picker_reset(), dt_develop_t::color_picker, darktable, darktable_t::develop, DT_COLOR_PICKER_POINT, dt_dev_pixelpipe_cache_wait_cleanup(), dt_develop_t::enabled, FALSE, dt_develop_t::input_wait, IOP_CS_NONE, dt_develop_t::kind, dt_develop_t::output_wait, dt_develop_t::picker, dt_develop_t::picker_cst, dt_develop_t::update_pending, and dt_develop_t::widget.
Referenced by _area_button_press_callback(), _area_button_press_callback(), _area_key_press_callback(), _area_key_press_callback(), _area_motion_notify_callback(), _area_motion_notify_callback(), _area_scrolled_callback(), _area_scrolled_callback(), _autoexp_disable(), _blendop_blendif_reset(), _blendop_blendif_sliders_callback(), _blendop_blendif_tab_switch(), _blendop_masks_shape_can_start(), _blendop_masks_show_and_edit(), _channel_tabs_switch_callback(), _delete_node(), _edit_masks(), _interpolator_callback(), _select_region_toggled_callback(), _select_region_toggled_callback(), _turn_selregion_picker_off(), _turn_selregion_picker_off(), apply_autocolor(), apply_autoluma(), area_button_press(), aspect_changed(), balance_callback(), black_point_source_callback(), black_point_target_callback(), center_callback(), colorpick_color_set(), colorpicker_callback(), contrast_callback(), controls_callback(), Dmin_picker_callback(), dt_iop_gui_changed(), dt_iop_gui_update_blendif(), dt_iop_gui_update_blending(), dt_iop_levels_autoadjust_callback(), dt_iop_levels_scroll(), dt_iop_monochrome_button_press(), dt_iop_monochrome_button_release(), dt_iop_monochrome_scrolled(), dt_iop_request_focus(), frame_colorpick_color_set(), global_saturation_callback(), grey_point_source_callback(), grey_point_target_callback(), gui_cleanup(), gui_reset(), gui_reset(), gui_reset(), gui_update(), gui_update(), gui_update(), interpolator_callback(), latitude_stops_callback(), leave(), notebook_button_press(), output_power_callback(), patch_callback(), position_h_changed(), position_v_changed(), preset_tune_callback(), rt_colorpick_color_set_callback(), rt_edit_masks_callback(), rt_shape_buttons_can_start(), saturation_callback(), security_threshold_callback(), show_luminance_mask_callback(), smoothing_callback(), target_callback(), temp_tint_callback(), WB_high_picker_callback(), WB_low_picker_callback(), white_point_source_callback(), and white_point_target_callback().
| void dt_iop_color_picker_set_cst | ( | dt_iop_module_t * | module, |
| const dt_iop_colorspace_type_t | picker_cst | ||
| ) |
Definition at line 801 of file color_picker_proxy.c.
References dt_develop_t::color_picker, darktable, darktable_t::develop, dt_iop_color_picker_request_update(), dt_develop_t::picker, and dt_iop_color_picker_t::picker_cst.
Referenced by _blendif_change_blend_colorspace(), _blendop_blendif_tab_switch(), and _update_gradient_slider_pickers().