![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <stdint.h>#include "bauhaus/bauhaus.h"#include "common/atomic.h"#include "common/color_picker.h"#include "common/color_vocabulary.h"#include "common/darktable.h"#include "common/debug.h"#include "common/histogram.h"#include "common/iop_profile.h"#include "common/imagebuf.h"#include "common/image_cache.h"#include "common/math.h"#include "control/conf.h"#include "control/control.h"#include "control/signal.h"#include "develop/dev_pixelpipe.h"#include "develop/develop.h"#include "develop/pixelpipe_cache.h"#include "dtgtk/drawingarea.h"#include "dtgtk/button.h"#include "gui/color_picker_proxy.h"#include "gui/draw.h"#include "gui/gtk.h"#include "libs/lib.h"#include "libs/lib_api.h"#include "libs/colorpicker.h"
Include dependency graph for libs/histogram.c:Data Structures | |
| struct | dt_lib_histogram_cache_t |
| struct | dt_lib_histogram_t |
| struct | dt_histogram_pending_module_refresh_t |
| struct | dt_histogram_preview_refresh_state_t |
Macros | |
| #define | HISTOGRAM_BINS 256 |
| #define | TONES 128 |
| #define | GAMMA 1.f / 1.5f |
Typedefs | |
| typedef enum dt_lib_histogram_scope_type_t | dt_lib_histogram_scope_type_t |
| typedef struct dt_lib_histogram_cache_t | dt_lib_histogram_cache_t |
| typedef enum dt_lib_colorpicker_model_t | dt_lib_colorpicker_model_t |
| typedef struct dt_lib_histogram_t | dt_lib_histogram_t |
| typedef struct dt_histogram_pending_module_refresh_t | dt_histogram_pending_module_refresh_t |
| typedef struct dt_histogram_preview_refresh_state_t | dt_histogram_preview_refresh_state_t |
Functions | |
| static void | _clear_pending_preview_histograms (void) |
| static void | _refresh_module_histogram (const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const float *pixel, dt_iop_module_t *module) |
| static dt_backbuf_t * | _get_histogram_backbuf (dt_develop_t *dev, const char *op) |
| static void | _clear_histogram_backbuf (dt_backbuf_t *backbuf) |
| static gboolean | _refresh_global_histogram_backbuf_for_hash (dt_develop_t *dev, const char *op, const uint64_t expected_hash) |
| static gboolean | _refresh_preview_module_histogram_for_hash (dt_develop_t *dev, dt_iop_module_t *module, const uint64_t expected_hash) |
| static void | _refresh_preview_histograms (dt_develop_t *dev) |
| static void | _preview_history_resync_callback (gpointer instance, gpointer user_data) |
| static void | _preview_cacheline_ready_callback (gpointer instance, const guint64 hash, gpointer user_data) |
| const char * | name (struct dt_lib_module_t *self) |
| const char ** | views (dt_lib_module_t *self) |
| uint32_t | container (dt_lib_module_t *self) |
| int | expandable (dt_lib_module_t *self) |
| int | position () |
| static void | _update_picker_output (dt_lib_module_t *self) |
| static void | _update_sample_label (dt_lib_module_t *self, dt_colorpicker_sample_t *sample) |
| static void | _update_everything (dt_lib_module_t *self) |
| void | _backbuf_int_to_op (const int value, dt_lib_histogram_t *d) |
| int | _backbuf_op_to_int (dt_lib_histogram_t *d) |
| void | _scope_pixel_to_xyz (const dt_aligned_pixel_t rgb_in, dt_aligned_pixel_t xyz_out, dt_lib_histogram_t *d) |
| void | _scope_pixel_to_display_rgb (const dt_aligned_pixel_t rgb_in, dt_aligned_pixel_t rgb_out, dt_lib_histogram_t *d) |
| void | _reset_cache (dt_lib_histogram_t *d) |
| static void | _clear_pending_hashes (dt_lib_histogram_t *d) |
| static gboolean | _has_pending_hash (const dt_lib_histogram_t *d, const uint64_t hash) |
| static void | _add_pending_hash (dt_lib_histogram_t *d, const uint64_t hash) |
| static gboolean | _remove_pending_hash (dt_lib_histogram_t *d, const uint64_t hash) |
| static uint64_t | _get_live_histogram_hash (const char *op) |
| static gboolean | _histogram_refresh_idle (gpointer user_data) |
| static void | _schedule_histogram_refresh (dt_lib_module_t *self) |
| static void | _sync_pending_histogram_hashes (dt_lib_module_t *self) |
| static gboolean | _is_backbuf_ready (dt_lib_histogram_t *d) |
| static void | _redraw_scopes (dt_lib_histogram_t *d) |
| uint32_t | _find_max_histogram (const uint32_t *const restrict bins, const size_t binning_size) |
| static void | _bin_pixels_histogram_in_roi (const float *const restrict image, uint32_t *const restrict bins, const size_t min_x, const size_t max_x, const size_t min_y, const size_t max_y, const size_t width) |
| static void | _bin_pickers_histogram (const float *const restrict image, const size_t width, const size_t height, uint32_t *bins, dt_colorpicker_sample_t *sample) |
| static const dt_dev_pixelpipe_iop_t * | _get_backbuf_source_piece (const dt_backbuf_t *backbuf, const char *op) |
| static void | _process_histogram (dt_backbuf_t *backbuf, const char *op, cairo_t *cr, const int width, const int height) |
| static void | _bin_pixels_waveform_in_roi (const float *const restrict image, uint32_t *const restrict bins, const size_t min_x, const size_t max_x, const size_t min_y, const size_t max_y, const size_t width, const size_t binning_size, const gboolean vertical) |
| static void | _bin_pickers_waveforms (const float *const restrict image, uint32_t *const restrict bins, const size_t width, const size_t height, const size_t binning_size, const gboolean vertical, dt_colorpicker_sample_t *sample) |
| static void | _bin_pixels_waveform (const float *const restrict image, uint32_t *const restrict bins, const size_t width, const size_t height, const size_t binning_size, const gboolean vertical) |
| static void | _create_waveform_image (const uint32_t *const restrict bins, uint8_t *const restrict image, const uint32_t max_hist, const size_t width, const size_t height) |
| static void | _mask_waveform (const uint8_t *const restrict image, uint8_t *const restrict masked, const size_t width, const size_t height, const size_t channel) |
| static void | _paint_waveform (cairo_t *cr, uint8_t *const restrict image, const int width, const int height, const size_t img_width, const size_t img_height, const gboolean vertical) |
| static void | _paint_parade (cairo_t *cr, uint8_t *const restrict image, const int width, const int height, const size_t img_width, const size_t img_height, const gboolean vertical) |
| static void | _process_waveform (dt_backbuf_t *backbuf, const char *op, cairo_t *cr, const int width, const int height, const gboolean vertical, const gboolean parade) |
| static float | _Luv_to_vectorscope_coord_zoom (const float value, const float zoom) |
| static float | _vectorscope_coord_zoom_to_Luv (const float value, const float zoom) |
| static void | _bin_pixels_vectorscope_in_roi (const float *const restrict image, uint32_t *const restrict vectorscope, const size_t min_x, const size_t max_x, const size_t min_y, const size_t max_y, const size_t width, const float zoom, dt_lib_histogram_t *d) |
| static void | _bin_pickers_vectorscope (const float *const restrict image, uint32_t *const restrict vectorscope, const size_t width, const size_t height, const float zoom, dt_lib_histogram_t *d, const dt_colorpicker_sample_t *const sample) |
| static void | _create_vectorscope_image (const uint32_t *const restrict vectorscope, uint8_t *const restrict image, const uint32_t max_hist, const float zoom) |
| static void | _bin_vectorscope (const float *const restrict image, uint32_t *const vectorscope, const size_t width, const size_t height, const float zoom, dt_lib_histogram_t *d) |
| static void | _process_vectorscope (dt_backbuf_t *backbuf, const char *op, cairo_t *cr, const int width, const int height, const float zoom, dt_lib_histogram_t *d) |
| gboolean | _needs_recompute (dt_lib_histogram_t *d, const int width, const int height) |
| static gboolean | _draw_callback (GtkWidget *widget, cairo_t *crf, gpointer user_data) |
| void | _get_allocation_size (dt_lib_histogram_t *d, int *width, int *height) |
| gboolean | _redraw_surface (dt_lib_histogram_t *d) |
| static void | _destroy_surface (dt_lib_histogram_t *d) |
| gboolean | _trigger_recompute (dt_lib_histogram_t *d) |
| static gboolean | _resolve_backbuf_sampling_source (const char *const op, const dt_backbuf_t *const backbuf, dt_iop_roi_t *const roi, dt_iop_buffer_dsc_t *const dsc, double *const iop_order, int *const direction) |
| Resolve the live preview-stage geometry behind one global histogram backbuffer. | |
| static void | _pixelpipe_pick_from_image (const dt_backbuf_t *const backbuf, dt_colorpicker_sample_t *const sample, dt_lib_histogram_t *d, const char *op) |
| static void | _pixelpipe_pick_samples (dt_lib_histogram_t *d) |
| static gboolean | _refresh_global_picker (dt_lib_module_t *self) |
| static void | _lib_histogram_history_resync_callback (gpointer instance, dt_lib_module_t *self) |
| static void | _lib_histogram_cacheline_ready_callback (gpointer instance, const guint64 hash, dt_lib_module_t *self) |
| void | view_enter (struct dt_lib_module_t *self, struct dt_view_t *old_view, struct dt_view_t *new_view) |
| void | view_leave (struct dt_lib_module_t *self, struct dt_view_t *old_view, struct dt_view_t *new_view) |
| void | _stage_callback (GtkWidget *widget, dt_lib_module_t *self) |
| void | _display_callback (GtkWidget *widget, dt_lib_module_t *self) |
| static void | _resize_callback (GtkWidget *widget, GdkRectangle *allocation, dt_lib_histogram_t *d) |
| static gboolean | _area_scrolled_callback (GtkWidget *widget, GdkEventScroll *event, dt_lib_histogram_t *d) |
| void | _set_params (dt_lib_histogram_t *d) |
| static gboolean | _sample_draw_callback (GtkWidget *widget, cairo_t *cr, dt_colorpicker_sample_t *sample) |
| static void | _picker_button_toggled (GtkToggleButton *button, dt_lib_histogram_t *d) |
| static void | _update_size (dt_lib_module_t *self, dt_lib_colorpicker_size_t size) |
| static void | _set_sample_box_area (dt_lib_module_t *self, const dt_boundingbox_t box) |
| static void | _set_sample_point (dt_lib_module_t *self, const float pos[2]) |
| static gboolean | _sample_tooltip_callback (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, const dt_colorpicker_sample_t *sample) |
| static void | _statistic_changed (GtkWidget *widget, dt_lib_module_t *self) |
| static void | _color_mode_changed (GtkWidget *widget, dt_lib_module_t *self) |
| static void | _label_size_allocate_callback (GtkWidget *widget, GdkRectangle *allocation, gpointer user_data) |
| static gboolean | _sample_enter_callback (GtkWidget *widget, GdkEvent *event, dt_colorpicker_sample_t *sample) |
| static gboolean | _sample_leave_callback (GtkWidget *widget, GdkEvent *event, gpointer data) |
| static void | _remove_sample (dt_colorpicker_sample_t *sample) |
| static void | _remove_sample_cb (GtkButton *widget, dt_colorpicker_sample_t *sample) |
| static gboolean | _live_sample_button (GtkWidget *widget, GdkEventButton *event, dt_colorpicker_sample_t *sample) |
| static void | _add_sample (GtkButton *widget, dt_lib_module_t *self) |
| static void | _display_samples_changed (GtkToggleButton *button, dt_lib_module_t *self) |
| static void | _restrict_histogram_changed (GtkToggleButton *button, dt_lib_module_t *self) |
| void | gui_reset (dt_lib_module_t *self) |
| void | gui_init (dt_lib_module_t *self) |
| void | gui_cleanup (dt_lib_module_t *self) |
Variables | |
| const gchar * | dt_lib_colorpicker_model_names [] = { N_("RGB"), N_("Lab"), N_("LCh"), N_("HSL"), N_("HSV"), N_("none"), NULL } |
| const gchar * | dt_lib_colorpicker_statistic_names [] = { N_("mean"), N_("min"), N_("max"), NULL } |
| static dt_histogram_preview_refresh_state_t | _preview_refresh_state |
| #define HISTOGRAM_BINS 256 |
| #define TONES 128 |
| typedef enum dt_lib_colorpicker_model_t dt_lib_colorpicker_model_t |
| typedef struct dt_lib_histogram_cache_t dt_lib_histogram_cache_t |
| typedef struct dt_lib_histogram_t dt_lib_histogram_t |
|
static |
References _has_pending_hash(), d, DT_PIXELPIPE_CACHE_HASH_INVALID, and IS_NULL_PTR.
Referenced by _sync_pending_histogram_hashes().
|
static |
References _label_size_allocate_callback(), _live_sample_button(), _remove_sample_cb(), _sample_draw_callback(), _sample_enter_callback(), _sample_leave_callback(), _sample_tooltip_callback(), _update_everything(), dt_colorpicker_sample_t::backbuf_op, dt_colorpicker_sample_t::color_patch, dt_develop_t::color_picker, dt_colorpicker_sample_t::container, container(), d, darktable, dt_lib_module_t::data, darktable_t::develop, dt_gui_add_class(), dtgtk_cairo_paint_remove(), dtgtk_togglebutton_new(), FALSE, IS_NULL_PTR, dt_colorpicker_sample_t::locked, dt_colorpicker_sample_t::output_label, dt_develop_t::picker, dt_develop_t::primary_sample, dt_develop_t::samples, dt_develop_t::selected_sample, and TRUE.
Referenced by gui_init().
|
static |
References _is_backbuf_ready(), _redraw_scopes(), _redraw_surface(), d, dt_bauhaus_combobox_get(), dt_conf_set_float(), dt_gui_get_scroll_unit_deltas(), DT_LIB_HISTOGRAM_SCOPE_VECTORSCOPE, FALSE, and TRUE.
Referenced by gui_init().
| void _backbuf_int_to_op | ( | const int | value, |
| dt_lib_histogram_t * | d | ||
| ) |
Referenced by _stage_callback().
| int _backbuf_op_to_int | ( | dt_lib_histogram_t * | d | ) |
References d.
Referenced by _scope_pixel_to_display_rgb(), _scope_pixel_to_xyz(), and _set_params().
|
inlinestatic |
References _bin_pixels_histogram_in_roi(), dt_colorpicker_sample_t::box, DT_LIB_COLORPICKER_SIZE_BOX, height, dt_colorpicker_sample_t::point, dt_colorpicker_sample_t::size, width, and x.
Referenced by _process_histogram().
|
inlinestatic |
References _bin_pixels_vectorscope_in_roi(), dt_colorpicker_sample_t::box, d, DT_LIB_COLORPICKER_SIZE_BOX, height, dt_colorpicker_sample_t::point, dt_colorpicker_sample_t::size, width, and x.
Referenced by _bin_vectorscope().
|
inlinestatic |
References _bin_pixels_waveform_in_roi(), dt_colorpicker_sample_t::box, DT_LIB_COLORPICKER_SIZE_BOX, height, dt_colorpicker_sample_t::point, dt_colorpicker_sample_t::size, width, and x.
Referenced by _bin_pixels_waveform().
|
inlinestatic |
References HISTOGRAM_BINS, i, value, and width.
Referenced by _bin_pickers_histogram(), and _process_histogram().
|
static |
References _Luv_to_vectorscope_coord_zoom(), _scope_pixel_to_xyz(), d, dt_xyY_to_Luv(), dt_XYZ_to_xyY(), HISTOGRAM_BINS, i, Luv, width, xyY, and XYZ_D50.
Referenced by _bin_pickers_vectorscope(), and _bin_vectorscope().
|
inlinestatic |
|
inlinestatic |
References __OMP_PARALLEL_FOR__, i, TONES, value, and width.
Referenced by _bin_pickers_waveforms(), and _bin_pixels_waveform().
|
static |
References __OMP_FOR_SIMD__, _bin_pickers_vectorscope(), _bin_pixels_vectorscope_in_roi(), dt_develop_t::color_picker, d, darktable, darktable_t::develop, dt_conf_get_bool(), height, HISTOGRAM_BINS, k, dt_develop_t::picker, dt_develop_t::primary_sample, dt_develop_t::samples, and width.
Referenced by _process_vectorscope().
|
static |
|
static |
References d, and IS_NULL_PTR.
Referenced by _sync_pending_histogram_hashes(), gui_cleanup(), and view_leave().
References _preview_refresh_state, dt_histogram_preview_refresh_state_t::colorout_hash, DT_PIXELPIPE_CACHE_HASH_INVALID, dt_histogram_preview_refresh_state_t::gamma_hash, dt_histogram_preview_refresh_state_t::initialscale_hash, and dt_histogram_preview_refresh_state_t::module_histograms.
Referenced by _refresh_preview_histograms(), gui_cleanup(), and view_leave().
|
static |
References _update_everything(), d, dt_lib_module_t::data, dt_bauhaus_combobox_get(), dt_conf_set_string(), and dt_lib_colorpicker_model_names.
Referenced by gui_init().
|
static |
References __OMP_PARALLEL_FOR__, _vectorscope_coord_zoom_to_Luv(), darktable, darktable_t::develop, dt_apply_transposed_color_matrix(), dt_Luv_to_xyY(), dt_xyY_to_XYZ(), HISTOGRAM_BINS, i, Luv, dt_iop_order_iccprofile_info_t::matrix_out_transposed, dt_dev_pixelpipe_t::output_profile_info, dt_develop_t::preview_pipe, RGB, value, xyY, and XYZ.
Referenced by _process_vectorscope().
|
static |
References __OMP_FOR_SIMD__, GAMMA, height, k, and width.
Referenced by _process_waveform().
|
static |
References d.
Referenced by _trigger_recompute(), gui_cleanup(), and gui_reset().
| void _display_callback | ( | GtkWidget * | widget, |
| dt_lib_module_t * | self | ||
| ) |
References _redraw_scopes(), _trigger_recompute(), d, dt_lib_module_t::data, dt_bauhaus_combobox_get(), and dt_conf_set_int().
Referenced by gui_init().
|
static |
References _update_everything(), dt_develop_t::color_picker, darktable, darktable_t::develop, dt_develop_t::display_samples, dt_conf_set_bool(), and dt_control_queue_redraw_center().
Referenced by gui_init().
|
static |
References d, and IS_NULL_PTR.
Referenced by gui_init().
| uint32_t _find_max_histogram | ( | const uint32_t *const restrict | bins, |
| const size_t | binning_size | ||
| ) |
References __OMP_PARALLEL_FOR_SIMD__, k, and max.
Referenced by _process_histogram(), _process_vectorscope(), and _process_waveform().
| void _get_allocation_size | ( | dt_lib_histogram_t * | d, |
| int * | width, | ||
| int * | height | ||
| ) |
References d, height, and width.
Referenced by _redraw_surface(), and _trigger_recompute().
|
static |
References darktable, darktable_t::develop, dt_dev_backbuf_get_hash(), dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), dt_dev_pixelpipe_iop_t::global_hash, IS_NULL_PTR, and dt_develop_t::preview_pipe.
Referenced by _pixelpipe_pick_from_image(), _process_histogram(), _process_vectorscope(), and _process_waveform().
|
static |
References dt_develop_t::display_histogram, IS_NULL_PTR, dt_develop_t::output_histogram, and dt_develop_t::raw_histogram.
Referenced by _histogram_refresh_idle(), _pixelpipe_pick_samples(), _refresh_global_histogram_backbuf_for_hash(), _refresh_global_picker(), _refresh_preview_histograms(), _set_params(), and _sync_pending_histogram_hashes().
|
static |
|
static |
References d, DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, i, IS_NULL_PTR, and TRUE.
Referenced by _add_pending_hash().
|
static |
References _get_histogram_backbuf(), _update_everything(), d, darktable, dt_lib_module_t::data, darktable_t::develop, and IS_NULL_PTR.
Referenced by _schedule_histogram_refresh().
|
static |
References d, darktable, darktable_t::develop, dt_dev_backbuf_get_hash(), dt_dev_pixelpipe_is_backbufer_valid(), FALSE, IS_NULL_PTR, and dt_develop_t::preview_pipe.
Referenced by _area_scrolled_callback(), _refresh_global_picker(), and _trigger_recompute().
|
static |
Referenced by _add_sample(), and gui_init().
|
static |
References _remove_pending_hash(), _schedule_histogram_refresh(), d, dt_lib_module_t::data, dt_pixel_cache_entry_t::hash, IS_NULL_PTR, and void().
Referenced by view_enter(), and view_leave().
|
static |
References _sync_pending_histogram_hashes(), and void().
Referenced by view_enter(), and view_leave().
|
static |
References _set_sample_box_area(), _set_sample_point(), dt_colorpicker_sample_t::box, dt_develop_t::color_picker, darktable, darktable_t::develop, dt_control_queue_redraw_center(), DT_LIB_COLORPICKER_SIZE_BOX, DT_LIB_COLORPICKER_SIZE_POINT, FALSE, dt_develop_t::histogram_module, IS_NULL_PTR, dt_colorpicker_sample_t::locked, dt_develop_t::picker, dt_colorpicker_sample_t::point, and dt_colorpicker_sample_t::size.
Referenced by _add_sample().
|
static |
References HISTOGRAM_BINS, and value.
Referenced by _bin_pixels_vectorscope_in_roi(), and _process_vectorscope().
|
static |
References __OMP_PARALLEL_FOR__, __OMP_SIMD__, height, i, and width.
Referenced by _paint_parade().
| gboolean _needs_recompute | ( | dt_lib_histogram_t * | d, |
| const int | width, | ||
| const int | height | ||
| ) |
References d, dt_bauhaus_combobox_get(), dt_dev_backbuf_get_hash(), height, IS_NULL_PTR, view(), and width.
Referenced by _trigger_recompute().
|
static |
References _mask_waveform(), double(), dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_free_align, height, TONES, width, and x.
Referenced by _process_waveform().
|
static |
References double(), height, TONES, and width.
Referenced by _process_waveform().
|
static |
References d.
Referenced by gui_init().
|
static |
References _get_backbuf_source_piece(), _resolve_backbuf_sampling_source(), _scope_pixel_to_display_rgb(), _scope_pixel_to_xyz(), dt_colorpicker_sample_t::box, dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::cst, d, darktable, dt_pixel_cache_entry_t::data, darktable_t::develop, dt_colorpicker_sample_t::display, dt_color_picker_helper(), dt_dev_coordinates_image_norm_to_preview_abs(), dt_dev_distort_backtransform_plus(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_rdlock_entry(), DT_DEV_TRANSFORM_DIR_FORW_EXCL, DT_LIB_COLORPICKER_SIZE_BOX, DT_LIB_COLORPICKER_SIZE_POINT, DT_LIB_COLORPICKER_STATISTIC_MAX, DT_LIB_COLORPICKER_STATISTIC_MEAN, DT_LIB_COLORPICKER_STATISTIC_MIN, DT_LIB_COLORPICKER_STATISTIC_N, dt_XYZ_to_Lab(), FALSE, for_four_channels, dt_iop_roi_t::height, dt_backbuf_t::height, IOP_CS_RGB, IS_NULL_PTR, k, dt_colorpicker_sample_t::lab, MAX, max, MIN, min, dt_lib_histogram_t::op, darktable_t::pixelpipe_cache, dt_colorpicker_sample_t::point, dt_develop_t::preview_pipe, dt_colorpicker_sample_t::scope, dt_colorpicker_sample_t::size, TRUE, TYPE_FLOAT, dt_iop_roi_t::width, dt_backbuf_t::width, dt_iop_roi_t::x, XYZ, and dt_iop_roi_t::y.
Referenced by _pixelpipe_pick_samples().
|
static |
References _get_histogram_backbuf(), _pixelpipe_pick_from_image(), dt_colorpicker_sample_t::backbuf_op, dt_develop_t::color_picker, d, darktable, darktable_t::develop, dt_colorpicker_sample_t::locked, dt_develop_t::picker, dt_develop_t::primary_sample, and dt_develop_t::samples.
Referenced by _update_everything().
|
static |
References _preview_refresh_state, _refresh_global_histogram_backbuf_for_hash(), _refresh_preview_module_histogram_for_hash(), dt_histogram_preview_refresh_state_t::colorout_hash, darktable, darktable_t::develop, DT_PIXELPIPE_CACHE_HASH_INVALID, dt_histogram_preview_refresh_state_t::gamma_hash, dt_develop_t::gui_attached, dt_histogram_pending_module_refresh_t::hash, dt_histogram_preview_refresh_state_t::initialscale_hash, IS_NULL_PTR, dt_histogram_preview_refresh_state_t::module_histograms, dt_develop_t::preview_pipe, and void().
Referenced by view_enter(), and view_leave().
|
static |
References _refresh_preview_histograms(), darktable, darktable_t::develop, and void().
Referenced by view_enter(), and view_leave().
|
static |
References _bin_pickers_histogram(), _bin_pixels_histogram_in_roi(), _find_max_histogram(), _get_backbuf_source_piece(), darktable_t::bauhaus, dt_develop_t::color_picker, darktable, dt_pixel_cache_entry_t::data, darktable_t::develop, dt_conf_get_bool(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_draw_grid(), dt_draw_histogram_8(), dt_free, FALSE, dt_bauhaus_t::graph_bg, dt_bauhaus_t::graph_colors, dt_bauhaus_t::graph_grid, height, dt_backbuf_t::height, HISTOGRAM_BINS, IS_NULL_PTR, k, dt_develop_t::picker, darktable_t::pixelpipe_cache, dt_develop_t::preview_pipe, dt_develop_t::primary_sample, dt_develop_t::samples, set_color(), TRUE, width, and dt_backbuf_t::width.
Referenced by _redraw_surface().
|
static |
References _bin_vectorscope(), _create_vectorscope_image(), _find_max_histogram(), _get_backbuf_source_piece(), _Luv_to_vectorscope_coord_zoom(), colors, d, darktable, dt_pixel_cache_entry_t::data, darktable_t::develop, dt_apply_transposed_color_matrix(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_Lch_to_Luv(), dt_Luv_to_Lch(), dt_Luv_to_xyY(), DT_PIXEL_APPLY_DPI, dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_free_align, dt_xyY_to_Luv(), dt_xyY_to_XYZ(), dt_XYZ_to_xyY(), error(), FALSE, height, dt_backbuf_t::height, HISTOGRAM_BINS, IS_NULL_PTR, k, Lch, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, Luv, M_PI, M_PI_F, dt_iop_order_iccprofile_info_t::matrix_in_transposed, dt_iop_order_iccprofile_info_t::matrix_out_transposed, dt_iop_order_iccprofile_info_t::nonlinearlut, dt_dev_pixelpipe_t::output_profile_info, darktable_t::pixelpipe_cache, dt_develop_t::preview_pipe, RGB, TRUE, width, dt_backbuf_t::width, x, xyY, XYZ, and XYZ_D50.
Referenced by _redraw_surface().
|
static |
References _bin_pixels_waveform(), _create_waveform_image(), _find_max_histogram(), _get_backbuf_source_piece(), _paint_parade(), _paint_waveform(), darktable, dt_pixel_cache_entry_t::data, darktable_t::develop, dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_draw_grid(), dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_free_align, error(), FALSE, height, dt_backbuf_t::height, IS_NULL_PTR, darktable_t::pixelpipe_cache, dt_develop_t::preview_pipe, TONES, TRUE, width, and dt_backbuf_t::width.
Referenced by _redraw_surface().
|
static |
References d.
Referenced by _area_scrolled_callback(), _display_callback(), and _update_everything().
| gboolean _redraw_surface | ( | dt_lib_histogram_t * | d | ) |
References _get_allocation_size(), _process_histogram(), _process_vectorscope(), _process_waveform(), d, dt_bauhaus_combobox_get(), dt_dev_backbuf_get_hash(), dt_get_times(), DT_LIB_HISTOGRAM_SCOPE_HISTOGRAM, DT_LIB_HISTOGRAM_SCOPE_PARADE_HORIZONTAL, DT_LIB_HISTOGRAM_SCOPE_PARADE_VERTICAL, DT_LIB_HISTOGRAM_SCOPE_VECTORSCOPE, DT_LIB_HISTOGRAM_SCOPE_WAVEFORM_HORIZONTAL, DT_LIB_HISTOGRAM_SCOPE_WAVEFORM_VERTICAL, dt_show_times_f(), FALSE, height, IS_NULL_PTR, TRUE, and width.
Referenced by _area_scrolled_callback(), and _trigger_recompute().
|
static |
References _clear_histogram_backbuf(), _get_histogram_backbuf(), dt_iop_buffer_dsc_t::bpp, darktable, dt_dev_pixelpipe_iop_t::dsc_out, dt_dev_backbuf_get_hash(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_cache_unref_hash(), dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), dt_dev_set_backbuf(), dt_iop_get_module_by_op_priority(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, dt_dev_pixelpipe_iop_t::global_hash, dt_iop_roi_t::height, dt_develop_t::iop, IS_NULL_PTR, darktable_t::pixelpipe_cache, dt_develop_t::preview_pipe, dt_dev_pixelpipe_iop_t::roi_out, TRUE, and dt_iop_roi_t::width.
Referenced by _preview_cacheline_ready_callback(), and _refresh_preview_histograms().
|
static |
References _get_histogram_backbuf(), _is_backbuf_ready(), _update_everything(), d, darktable, dt_lib_module_t::data, darktable_t::develop, FALSE, IS_NULL_PTR, and TRUE.
Referenced by gui_init().
|
static |
References dt_iop_buffer_dsc_t::cst, dt_dev_pixelpipe_iop_t::dsc_in, dt_control_queue_redraw_widget(), dt_histogram_helper(), dt_histogram_max_helper(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_ioppr_get_pipe_work_profile_info(), dt_iop_roi_t::height, dt_iop_module_t::histogram, dt_iop_module_t::histogram_cst, dt_iop_module_t::histogram_max, dt_iop_module_t::histogram_middle_grey, dt_dev_pixelpipe_iop_t::histogram_params, dt_iop_module_t::histogram_stats, IS_NULL_PTR, dt_dev_histogram_collection_params_t::roi, dt_dev_pixelpipe_iop_t::roi_in, dt_iop_module_t::widget, dt_histogram_roi_t::width, and dt_iop_roi_t::width.
Referenced by _refresh_preview_module_histogram_for_hash().
|
static |
References _clear_histogram_backbuf(), _clear_pending_preview_histograms(), _get_histogram_backbuf(), _preview_refresh_state, _refresh_global_histogram_backbuf_for_hash(), _refresh_preview_module_histogram_for_hash(), dt_histogram_preview_refresh_state_t::colorout_hash, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), dt_iop_get_module_by_op_priority(), DT_PIXELPIPE_CACHE_HASH_INVALID, DT_REQUEST_ON, DT_REQUEST_ONLY_IN_GUI, dt_dev_pixelpipe_iop_t::enabled, dt_histogram_preview_refresh_state_t::gamma_hash, dt_dev_pixelpipe_iop_t::global_hash, dt_develop_t::gui_attached, dt_dev_pixelpipe_t::gui_observable_source, dt_histogram_pending_module_refresh_t::hash, i, dt_histogram_preview_refresh_state_t::initialscale_hash, dt_develop_t::iop, IS_NULL_PTR, dt_histogram_preview_refresh_state_t::module_histograms, dt_dev_pixelpipe_t::nodes, dt_develop_t::preview_pipe, and dt_dev_pixelpipe_iop_t::request_histogram.
Referenced by _preview_history_resync_callback(), and _stage_callback().
|
static |
References _refresh_module_histogram(), dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::cst, darktable, dt_iop_buffer_dsc_t::datatype, dt_dev_pixelpipe_iop_t::dsc_in, dt_dev_pixelpipe_iop_t::dsc_out, dt_alloc_align(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), dt_free_align, dt_iop_colorspace_is_rgb(), dt_ioppr_get_pipe_work_profile_info(), dt_ioppr_transform_image_colorspace(), DT_PIXELPIPE_CACHE_HASH_INVALID, DT_REQUEST_ON, DT_REQUEST_ONLY_IN_GUI, FALSE, dt_dev_pixelpipe_iop_t::global_hash, dt_develop_t::gui_attached, dt_iop_roi_t::height, IS_NULL_PTR, darktable_t::pixelpipe_cache, dt_develop_t::preview_pipe, dt_dev_pixelpipe_iop_t::request_histogram, dt_dev_pixelpipe_iop_t::roi_in, TRUE, TYPE_FLOAT, and dt_iop_roi_t::width.
Referenced by _preview_cacheline_ready_callback(), and _refresh_preview_histograms().
|
static |
References d, DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, i, IS_NULL_PTR, and TRUE.
Referenced by _lib_histogram_cacheline_ready_callback().
|
static |
References dt_develop_t::color_picker, dt_colorpicker_sample_t::container, darktable, darktable_t::develop, dt_free, and dt_develop_t::samples.
Referenced by _remove_sample_cb(), gui_cleanup(), and gui_reset().
|
static |
References _remove_sample(), and dt_control_queue_redraw_center().
Referenced by _add_sample().
| void _reset_cache | ( | dt_lib_histogram_t * | d | ) |
References d, and DT_LIB_HISTOGRAM_SCOPE_N.
Referenced by _resize_callback(), gui_init(), gui_reset(), view_enter(), and view_leave().
|
static |
References _reset_cache(), _trigger_recompute(), and d.
Referenced by gui_init().
|
static |
Resolve the live preview-stage geometry behind one global histogram backbuffer.
The global histogram stores only the published cache hash, width, and height. For color-picker sampling we also need the live ROI, colorspace, and backtransform cut in the current preview graph so the picker point drawn on the final image is mapped back to the selected histogram stage before sampling pixels.
We reopen the stage by operation name because the current preview graph is authoritative once the preview run completed. The published backbuffer hash must still match that live graph, otherwise we are looking at stale geometry and should not trust it.
| op | Histogram stage operation name. |
| backbuf | Published histogram backbuffer for op. |
| roi | Output ROI of the sampled stage buffer. |
| dsc | Buffer descriptor of the sampled stage buffer. |
| iop_order | IOP order at which to stop the backtransform. |
| direction | Inclusive/exclusive transform cut matching the sampled stage buffer. |
References darktable, darktable_t::develop, dt_dev_pixelpipe_iop_t::dsc_out, dt_dev_backbuf_get_hash(), dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), DT_DEV_TRANSFORM_DIR_FORW_EXCL, DT_DEV_TRANSFORM_DIR_FORW_INCL, FALSE, dt_dev_pixelpipe_iop_t::global_hash, dt_pixel_cache_entry_t::hash, IS_NULL_PTR, dt_develop_t::preview_pipe, and dt_dev_pixelpipe_iop_t::roi_out.
Referenced by _pixelpipe_pick_from_image().
|
static |
References _update_everything(), dt_develop_t::color_picker, darktable, darktable_t::develop, dt_conf_set_bool(), and dt_develop_t::restrict_histogram.
Referenced by gui_init().
|
static |
References DT_PIXEL_APPLY_DPI, dtgtk_cairo_paint_lock(), FALSE, height, dt_colorpicker_sample_t::locked, set_color(), dt_colorpicker_sample_t::swatch, and width.
Referenced by _add_sample(), and gui_init().
|
static |
References dt_develop_t::color_picker, darktable, darktable_t::develop, dt_control_queue_redraw_center(), FALSE, dt_develop_t::picker, and dt_develop_t::selected_sample.
Referenced by _add_sample(), and gui_init().
|
static |
References dt_develop_t::color_picker, darktable, darktable_t::develop, dt_control_queue_redraw_center(), FALSE, and dt_develop_t::selected_sample.
Referenced by _add_sample(), and gui_init().
|
static |
References dt_colorpicker_sample_t::display, dt_free, dt_gui_add_class(), DT_LIB_COLORPICKER_STATISTIC_MEAN, DT_LIB_COLORPICKER_STATISTIC_N, dt_lib_colorpicker_statistic_names, i, IS_NULL_PTR, dt_colorpicker_sample_t::lab, dt_colorpicker_sample_t::label_rgb, Lch_to_color_name(), dt_colorpicker_sample_t::scope, tooltip, TRUE, and view().
Referenced by _add_sample(), and gui_init().
|
static |
References _histogram_refresh_idle(), d, dt_lib_module_t::data, and IS_NULL_PTR.
Referenced by _lib_histogram_cacheline_ready_callback().
| void _scope_pixel_to_display_rgb | ( | const dt_aligned_pixel_t | rgb_in, |
| dt_aligned_pixel_t | rgb_out, | ||
| dt_lib_histogram_t * | d | ||
| ) |
| void _scope_pixel_to_xyz | ( | const dt_aligned_pixel_t | rgb_in, |
| dt_aligned_pixel_t | xyz_out, | ||
| dt_lib_histogram_t * | d | ||
| ) |
References _backbuf_op_to_int(), d, darktable, darktable_t::develop, dt_dev_pixelpipe_t::input_profile_info, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in_transposed, dt_iop_order_iccprofile_info_t::nonlinearlut, dt_dev_pixelpipe_t::output_profile_info, and dt_develop_t::preview_pipe.
Referenced by _bin_pixels_vectorscope_in_roi(), and _pixelpipe_pick_from_image().
| void _set_params | ( | dt_lib_histogram_t * | d | ) |
References _backbuf_op_to_int(), _get_histogram_backbuf(), d, darktable, darktable_t::develop, dt_bauhaus_combobox_entry_set_sensitive(), dt_bauhaus_combobox_set(), dt_conf_get_float(), dt_conf_get_int(), dt_conf_get_string_const(), dt_conf_set_string(), dt_image_is_raw(), DT_LIB_HISTOGRAM_SCOPE_VECTORSCOPE, and dt_develop_t::image_storage.
Referenced by gui_init(), and gui_reset().
|
static |
|
static |
| void _stage_callback | ( | GtkWidget * | widget, |
| dt_lib_module_t * | self | ||
| ) |
References _backbuf_int_to_op(), _refresh_preview_histograms(), _sync_pending_histogram_hashes(), d, darktable, dt_lib_module_t::data, darktable_t::develop, dt_bauhaus_combobox_entry_set_sensitive(), dt_bauhaus_combobox_get(), dt_conf_set_string(), DT_LIB_HISTOGRAM_SCOPE_VECTORSCOPE, and value.
Referenced by gui_init().
|
static |
|
static |
References _add_pending_hash(), _clear_pending_hashes(), _get_histogram_backbuf(), _get_live_histogram_hash(), _update_everything(), dt_colorpicker_sample_t::backbuf_op, dt_develop_t::color_picker, d, darktable, dt_lib_module_t::data, darktable_t::develop, IS_NULL_PTR, dt_colorpicker_sample_t::locked, dt_develop_t::picker, and dt_develop_t::samples.
Referenced by _lib_histogram_history_resync_callback(), and _stage_callback().
| gboolean _trigger_recompute | ( | dt_lib_histogram_t * | d | ) |
References _destroy_surface(), _get_allocation_size(), _is_backbuf_ready(), _needs_recompute(), _redraw_surface(), d, dt_cairo_image_surface_create(), height, and width.
Referenced by _display_callback(), _resize_callback(), _update_everything(), and gui_reset().
|
static |
References _pixelpipe_pick_samples(), _redraw_scopes(), _trigger_recompute(), _update_sample_label(), dt_develop_t::color_picker, d, darktable, dt_lib_module_t::data, darktable_t::develop, IS_NULL_PTR, dt_develop_t::picker, dt_develop_t::primary_sample, and dt_develop_t::samples.
Referenced by _add_sample(), _color_mode_changed(), _display_samples_changed(), _histogram_refresh_idle(), _refresh_global_picker(), _restrict_histogram_changed(), _set_sample_box_area(), _set_sample_point(), _statistic_changed(), _sync_pending_histogram_hashes(), and _update_picker_output().
|
static |
References _update_everything().
Referenced by _update_size(), and gui_reset().
|
static |
References ch, dt_colorpicker_sample_t::color_patch, d, dt_lib_module_t::data, dt_colorpicker_sample_t::display, DT_LIB_COLORPICKER_MODEL_HSL, DT_LIB_COLORPICKER_MODEL_HSV, DT_LIB_COLORPICKER_MODEL_LAB, DT_LIB_COLORPICKER_MODEL_LCH, DT_LIB_COLORPICKER_MODEL_NONE, DT_LIB_COLORPICKER_MODEL_RGB, DT_LIB_COLORPICKER_STATISTIC_MEAN, for_each_channel, dt_colorpicker_sample_t::lab, dt_colorpicker_sample_t::label_rgb, dt_colorpicker_sample_t::output_label, dt_colorpicker_sample_t::scope, and dt_colorpicker_sample_t::swatch.
Referenced by _update_everything().
|
static |
References _update_picker_output(), dt_develop_t::color_picker, darktable, darktable_t::develop, dt_develop_t::primary_sample, size, and dt_colorpicker_sample_t::size.
Referenced by _set_sample_box_area(), and _set_sample_point().
|
static |
References HISTOGRAM_BINS, and value.
Referenced by _create_vectorscope_image().
| uint32_t container | ( | dt_lib_module_t * | self | ) |
References DT_UI_CONTAINER_PANEL_LEFT_CENTER.
Referenced by _add_sample().
| int expandable | ( | dt_lib_module_t * | self | ) |
| void gui_cleanup | ( | dt_lib_module_t * | self | ) |
References _clear_pending_hashes(), _clear_pending_preview_histograms(), _destroy_surface(), _remove_sample(), dt_develop_t::color_picker, d, darktable, dt_lib_module_t::data, darktable_t::develop, dt_iop_color_picker_reset(), dt_pixelpipe_cache_free_align, FALSE, dt_develop_t::histogram_module, dt_develop_t::refresh_global_picker, dt_develop_t::samples, and TRUE.
| void gui_init | ( | dt_lib_module_t * | self | ) |
References _add_sample(), _area_scrolled_callback(), _color_mode_changed(), _display_callback(), _display_samples_changed(), _draw_callback(), _label_size_allocate_callback(), _picker_button_toggled(), _refresh_global_picker(), _reset_cache(), _resize_callback(), _restrict_histogram_changed(), _sample_draw_callback(), _sample_enter_callback(), _sample_leave_callback(), _sample_tooltip_callback(), _set_params(), _stage_callback(), _statistic_changed(), darktable_t::bauhaus, dt_colorpicker_sample_t::color_patch, dt_develop_t::color_picker, d, darktable, dt_lib_module_t::data, darktable_t::develop, dt_develop_t::display_samples, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_new(), dt_bauhaus_combobox_new_full(), dt_bauhaus_combobox_set_entries_ellipsis(), dt_bauhaus_widget_set_label(), dt_color_picker_new(), DT_COLOR_PICKER_POINT_AREA, dt_conf_get_bool(), dt_conf_get_string_const(), dt_gui_add_class(), DT_GUI_MODULE, dt_lib_colorpicker_model_names, dt_lib_colorpicker_statistic_names, DT_PIXEL_APPLY_DPI, dt_pixelpipe_cache_alloc_align_cache, dt_ui_scroll_wrap(), dt_ui_section_label_new(), dtgtk_button_new(), dtgtk_cairo_paint_square_plus(), dtgtk_drawing_area_new_with_aspect_ratio(), FALSE, darktable_t::gui, dt_develop_t::histogram_module, i, dt_colorpicker_sample_t::output_label, dt_develop_t::primary_sample, dt_develop_t::refresh_global_picker, dt_develop_t::restrict_histogram, dt_gui_gtk_t::scroll_mask, dt_colorpicker_sample_t::swatch, TRUE, and dt_lib_module_t::widget.
| void gui_reset | ( | dt_lib_module_t * | self | ) |
References _destroy_surface(), _remove_sample(), _reset_cache(), _set_params(), _trigger_recompute(), _update_picker_output(), dt_develop_t::color_picker, d, darktable, dt_lib_module_t::data, darktable_t::develop, dt_colorpicker_sample_t::display, dt_bauhaus_combobox_set(), dt_dev_pixelpipe_update_history_preview, dt_iop_color_picker_reset(), DT_LIB_COLORPICKER_STATISTIC_N, FALSE, i, dt_colorpicker_sample_t::lab, dt_colorpicker_sample_t::label_rgb, dt_develop_t::primary_sample, dt_develop_t::samples, dt_colorpicker_sample_t::scope, and dt_colorpicker_sample_t::swatch.
| const char * name | ( | struct dt_lib_module_t * | self | ) |
| int position | ( | ) |
| void view_enter | ( | struct dt_lib_module_t * | self, |
| struct dt_view_t * | old_view, | ||
| struct dt_view_t * | new_view | ||
| ) |
References _lib_histogram_cacheline_ready_callback(), _lib_histogram_history_resync_callback(), _preview_cacheline_ready_callback(), _preview_history_resync_callback(), _reset_cache(), d, darktable, dt_lib_module_t::data, DT_DEBUG_CONTROL_SIGNAL_CONNECT, DT_SIGNAL_CACHELINE_READY, DT_SIGNAL_HISTORY_RESYNC, and darktable_t::signals.
| void view_leave | ( | struct dt_lib_module_t * | self, |
| struct dt_view_t * | old_view, | ||
| struct dt_view_t * | new_view | ||
| ) |
References _clear_pending_hashes(), _clear_pending_preview_histograms(), _lib_histogram_cacheline_ready_callback(), _lib_histogram_history_resync_callback(), _preview_cacheline_ready_callback(), _preview_history_resync_callback(), _reset_cache(), d, darktable, dt_lib_module_t::data, DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, and darktable_t::signals.
| const char ** views | ( | dt_lib_module_t * | self | ) |
References v.
|
static |
Referenced by _clear_pending_preview_histograms(), _preview_cacheline_ready_callback(), and _refresh_preview_histograms().
| const gchar* dt_lib_colorpicker_model_names[] = { N_("RGB"), N_("Lab"), N_("LCh"), N_("HSL"), N_("HSV"), N_("none"), NULL } |
Referenced by _color_mode_changed(), and gui_init().
| const gchar* dt_lib_colorpicker_statistic_names[] = { N_("mean"), N_("min"), N_("max"), NULL } |
Referenced by _sample_tooltip_callback(), _statistic_changed(), and gui_init().