Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
color_picker_proxy.c File Reference
#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:

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
}
 

Functions

gboolean dt_iop_color_picker_is_visible (const dt_develop_t *dev)
 
gboolean dt_iop_color_picker_is_active_module (const dt_iop_module_t *module)
 Tell whether one module currently owns the active darkroom picker.
 
static gboolean _record_point_area (dt_iop_color_picker_t *self)
 Synchronize one picker cached geometry with the primary sample.
 
static void _refresh_active_picker (dt_develop_t *dev)
 
static int _picker_sample_box (const dt_iop_module_t *module, const dt_iop_roi_t *roi, const dt_pixelpipe_picker_source_t picker_source, int *box)
 
static gboolean _sample_picker_buffer (dt_dev_pixelpipe_t *pipe, dt_iop_module_t *module, const dt_iop_buffer_dsc_t *dsc, const dt_iop_roi_t *roi, const float *pixel, dt_aligned_pixel_t avg_out, dt_aligned_pixel_t min_out, dt_aligned_pixel_t max_out, const dt_pixelpipe_picker_source_t picker_source)
 
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)
 
static dt_color_picker_resample_status_t _sample_picker_from_cache (dt_develop_t *dev)
 
static void _request_picker_recompute (dt_develop_t *dev)
 
static gboolean _refresh_active_picker_idle (gpointer user_data)
 
static void _queue_refresh_active_picker (dt_develop_t *dev)
 
static void _color_picker_reset (dt_iop_color_picker_t *picker)
 
static void _color_picker_widget_destroy (GtkWidget *widget, dt_iop_color_picker_t *picker)
 
void dt_iop_color_picker_reset (dt_iop_module_t *module, gboolean keep)
 
static void _init_picker (dt_iop_color_picker_t *picker, dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *button)
 
static gboolean _color_picker_callback_button_press (GtkWidget *button, GdkEventButton *e, dt_iop_color_picker_t *self)
 
static void _color_picker_callback (GtkWidget *button, dt_iop_color_picker_t *self)
 
void dt_iop_color_picker_set_cst (dt_iop_module_t *module, const dt_iop_colorspace_type_t picker_cst)
 
dt_iop_colorspace_type_t dt_iop_color_picker_get_active_cst (dt_iop_module_t *module)
 
void dt_iop_color_picker_request_update (void)
 
gboolean dt_iop_color_picker_force_cache (const dt_develop_t *dev, const dt_dev_pixelpipe_t *pipe, const dt_iop_module_t *module)
 
static void _iop_color_picker_preview_pipe_finished_callback (gpointer instance, gpointer user_data)
 
void dt_iop_color_picker_init (void)
 
void dt_iop_color_picker_cleanup (void)
 
static GtkWidget_color_picker_new (dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w, const gboolean init_cst, const dt_iop_colorspace_type_t cst)
 
GtkWidgetdt_color_picker_new (dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
 
GtkWidgetdt_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)
 

Typedef Documentation

◆ dt_color_picker_resample_status_t

◆ dt_pixelpipe_picker_source_t

Enumeration Type Documentation

◆ dt_color_picker_resample_status_t

Enumerator
DT_COLOR_PICKER_RESAMPLE_CONSUMED 
DT_COLOR_PICKER_RESAMPLE_RETRY 
DT_COLOR_PICKER_RESAMPLE_EMITTED 

◆ dt_pixelpipe_picker_source_t

Enumerator
PIXELPIPE_PICKER_INPUT 
PIXELPIPE_PICKER_OUTPUT 

Function Documentation

◆ _color_picker_callback()

static void _color_picker_callback ( GtkWidget button,
dt_iop_color_picker_t self 
)
static

◆ _color_picker_callback_button_press()

◆ _color_picker_new()

◆ _color_picker_reset()

◆ _color_picker_widget_destroy()

static void _color_picker_widget_destroy ( GtkWidget widget,
dt_iop_color_picker_t picker 
)
static

◆ _init_picker()

◆ _iop_color_picker_preview_pipe_finished_callback()

static void _iop_color_picker_preview_pipe_finished_callback ( gpointer  instance,
gpointer  user_data 
)
static

◆ _picker_sample_box()

◆ _queue_refresh_active_picker()

◆ _record_point_area()

static gboolean _record_point_area ( dt_iop_color_picker_t self)
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.

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

◆ _refresh_active_picker()

◆ _refresh_active_picker_idle()

static gboolean _refresh_active_picker_idle ( gpointer  user_data)
static

◆ _request_picker_recompute()

◆ _sample_picker_buffer()

static gboolean _sample_picker_buffer ( dt_dev_pixelpipe_t pipe,
dt_iop_module_t module,
const dt_iop_buffer_dsc_t dsc,
const dt_iop_roi_t roi,
const float *  pixel,
dt_aligned_pixel_t  avg_out,
dt_aligned_pixel_t  min_out,
dt_aligned_pixel_t  max_out,
const dt_pixelpipe_picker_source_t  picker_source 
)
static

◆ _sample_picker_from_cache()

◆ dt_color_picker_new()

◆ dt_color_picker_new_with_cst()

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 
)

References _color_picker_new(), kind, and TRUE.

Referenced by gui_init(), and gui_init().

◆ dt_iop_color_picker_cleanup()

◆ dt_iop_color_picker_force_cache()

◆ dt_iop_color_picker_get_active_cst()

◆ dt_iop_color_picker_get_ready_data()

◆ dt_iop_color_picker_init()

◆ dt_iop_color_picker_is_active_module()

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.

Parameters
moduleCandidate module.
Returns
TRUE when the picker manager is enabled and the active picker belongs to module.

Referenced by _spot_settings_changed_callback(), and _spot_settings_changed_callback().

◆ dt_iop_color_picker_is_visible()

gboolean dt_iop_color_picker_is_visible ( const dt_develop_t dev)

◆ dt_iop_color_picker_request_update()

◆ dt_iop_color_picker_reset()

void dt_iop_color_picker_reset ( dt_iop_module_t module,
gboolean  keep 
)

References _color_picker_reset(), dt_develop_t::color_picker, darktable, darktable_t::develop, DT_COLOR_PICKER_POINT, dt_develop_t::enabled, FALSE, IOP_CS_NONE, dt_develop_t::kind, dt_develop_t::picker, dt_develop_t::picker_cst, dt_develop_t::recompute_requested, 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_add_shape(), _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(), auto_adjust_contrast_boost(), auto_adjust_exposure_boost(), 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_add_shape_callback(), rt_colorpick_color_set_callback(), rt_edit_masks_callback(), 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().

◆ dt_iop_color_picker_set_cst()