![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <stdint.h>#include <inttypes.h>#include "develop/imageop_gui.h"#include "widgets/bauhaus.h"#include "widgets/resize_handle.h"#include "widgets/widget_settings.h"#include "common/color_picker.h"#include "common/color_vocabulary.h"#include "caches/pixelpipe_cache_alloc.h"#include "common/histogram.h"#include "common/image.h"#include "imageio/imageio_core.h"#include "develop/iop_profile.h"#include "common/logging.h"#include "system/macros.h"#include "math/math.h"#include "system/mem_alloc.h"#include "common/module_versioning.h"#include "system/openmp.h"#include "system/simd.h"#include "common/times.h"#include "common/conf.h"#include "control/control.h"#include "control/signal.h"#include "develop/dev_pixelpipe.h"#include "develop/develop.h"#include "caches/pixelpipe_cache.h"#include "widgets/button.h"#include "gui/color_picker_proxy.h"#include "widgets/draw.h"#include "gui/application.h"#include "libs/lib.h"#include "libs/lib_api.h"#include "libs/colorpicker.h"#include "widgets/collapsible_section.h"#include "widgets/label.h"#include "widgets/scroll_wrap.h"#include "widgets/widget_style.h"#include "gui/screen_metrics.h"#include "widgets/togglebutton.h"
Include dependency graph for libs/histogram.c:Go to the source code of this file.
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 |
| struct | dt_histogram_scope_buf_t |
Macros | |
| #define | HISTOGRAM_BINS 256 |
| #define | GAMMA 1.f / 2.f |
| #define | DT_LIB_HISTOGRAM_SCOPE_MIN_VALUE (1.f / 256.f) |
| #define | DT_LIB_HISTOGRAM_SCOPE_ENABLE_SMOOTHING 1 |
| #define | DT_LIB_HISTOGRAM_SCOPE_SMOOTH_SPATIAL_PASSES 1 |
| #define | DT_LIB_HISTOGRAM_SCOPE_SMOOTH_TONE_PASSES 4 |
| #define | DT_LIB_HISTOGRAM_SCOPE_SMOOTH_FORCE (256 * 0.33) |
| #define | DT_LIB_HISTOGRAM_SCOPE_RESTRICTED_LABEL_OPERATOR CAIRO_OPERATOR_ADD |
| #define | DT_LIB_HISTOGRAM_SCOPE_DEFAULT_HEIGHT 250 |
| #define | DT_LIB_HISTOGRAM_SCOPE_MIN_HEIGHT 120 |
| #define | DT_LIB_HISTOGRAM_SCOPE_MAX_HEIGHT 500 |
| #define | DT_LIB_HISTOGRAM_SCOPE_HANDLE_HEIGHT 8 |
| #define | DT_LIB_HISTOGRAM_SCOPE_HEIGHT_CONF "plugin/darkroom/histogram/scope_height" |
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 DT_LIB_HISTOGRAM_SCOPE_DEFAULT_HEIGHT 250 |
Definition at line 107 of file libs/histogram.c.
| #define DT_LIB_HISTOGRAM_SCOPE_ENABLE_SMOOTHING 1 |
Definition at line 102 of file libs/histogram.c.
| #define DT_LIB_HISTOGRAM_SCOPE_HANDLE_HEIGHT 8 |
Definition at line 110 of file libs/histogram.c.
| #define DT_LIB_HISTOGRAM_SCOPE_HEIGHT_CONF "plugin/darkroom/histogram/scope_height" |
Definition at line 111 of file libs/histogram.c.
| #define DT_LIB_HISTOGRAM_SCOPE_MAX_HEIGHT 500 |
Definition at line 109 of file libs/histogram.c.
| #define DT_LIB_HISTOGRAM_SCOPE_MIN_HEIGHT 120 |
Definition at line 108 of file libs/histogram.c.
Definition at line 101 of file libs/histogram.c.
| #define DT_LIB_HISTOGRAM_SCOPE_RESTRICTED_LABEL_OPERATOR CAIRO_OPERATOR_ADD |
Definition at line 106 of file libs/histogram.c.
| #define DT_LIB_HISTOGRAM_SCOPE_SMOOTH_FORCE (256 * 0.33) |
Definition at line 105 of file libs/histogram.c.
| #define DT_LIB_HISTOGRAM_SCOPE_SMOOTH_SPATIAL_PASSES 1 |
Definition at line 103 of file libs/histogram.c.
| #define DT_LIB_HISTOGRAM_SCOPE_SMOOTH_TONE_PASSES 4 |
Definition at line 104 of file libs/histogram.c.
Definition at line 100 of file libs/histogram.c.
| #define HISTOGRAM_BINS 256 |
Definition at line 99 of file libs/histogram.c.
A scope backbuffer, reoriented to match the darkroom view when it comes from a pre-flip pipeline stage. Every scope binning function should read data/width/height from here instead of the raw backbuf/cache pointer – for already-view-oriented stages, or an identity orientation, this is a plain passthrough (no copy, no allocation).
Only "initialscale" (the "Raw image" scope stage) lives upstream of the flip module in iop_order; "colorout" and "gamma" already sit downstream of it, i.e. already in the same orientation the darkroom view shows – so those are always a passthrough regardless of the image's own orientation.
| Enumerator | |
|---|---|
| DT_LIB_COLORPICKER_MODEL_RGB | |
| DT_LIB_COLORPICKER_MODEL_LAB | |
| DT_LIB_COLORPICKER_MODEL_LCH | |
| DT_LIB_COLORPICKER_MODEL_HSL | |
| DT_LIB_COLORPICKER_MODEL_HSV | |
| DT_LIB_COLORPICKER_MODEL_NONE | |
Definition at line 137 of file libs/histogram.c.
Definition at line 115 of file libs/histogram.c.
|
static |
Definition at line 778 of file libs/histogram.c.
References _has_pending_hash(), d, DT_PIXELPIPE_CACHE_HASH_INVALID, hash, IS_NULL_PTR, and L.
Referenced by _sync_pending_histogram_hashes().
|
static |
Definition at line 2874 of file libs/histogram.c.
References _label_size_allocate_callback(), _live_sample_button(), _remove_sample_cb(), _reset_cache(), _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, dt_lib_module_t::data, dt_conf_get_bool(), dt_dev_get_global(), dt_gui_add_class(), DT_GUI_BOX_SPACING, dtgtk_cairo_paint_remove(), dtgtk_togglebutton_new(), FALSE, IS_NULL_PTR, L, 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.
|
static |
Definition at line 2510 of file libs/histogram.c.
References _is_backbuf_ready(), _redraw_scopes(), _redraw_surface(), d, dt_conf_set_float(), dt_gui_get_scroll_unit_deltas(), DT_LIB_HISTOGRAM_SCOPE_VECTORSCOPE, FALSE, L, and TRUE.
| void _backbuf_int_to_op | ( | const int | value, |
| dt_lib_histogram_t * | d | ||
| ) |
Definition at line 673 of file libs/histogram.c.
Referenced by _set_stage().
| int _backbuf_op_to_int | ( | dt_lib_histogram_t * | d | ) |
Definition at line 695 of file libs/histogram.c.
Referenced by _scope_pixel_to_display_rgb(), _scope_pixel_to_xyz(), and set_preferences().
|
inlinestatic |
Definition at line 942 of file libs/histogram.c.
References _bin_pixels_histogram_in_roi(), _sample_raw_box_to_image_norm(), _sample_raw_point_to_image_norm(), DT_LIB_COLORPICKER_SIZE_BOX, height, L, dt_colorpicker_sample_t::size, width, and x.
Referenced by _process_histogram().
|
inlinestatic |
Definition at line 1713 of file libs/histogram.c.
References _bin_pixels_vectorscope_in_roi(), _sample_raw_box_to_image_norm(), _sample_raw_point_to_image_norm(), d, DT_LIB_COLORPICKER_SIZE_BOX, height, L, dt_colorpicker_sample_t::size, width, and x.
Referenced by _bin_vectorscope().
|
inlinestatic |
Definition at line 1197 of file libs/histogram.c.
References _bin_pixels_waveform_in_roi(), _sample_raw_box_to_image_norm(), _sample_raw_point_to_image_norm(), DT_LIB_COLORPICKER_SIZE_BOX, height, L, dt_colorpicker_sample_t::size, width, and x.
Referenced by _bin_pixels_waveform().
|
inlinestatic |
Definition at line 917 of file libs/histogram.c.
References __OMP_PARALLEL_FOR__, HISTOGRAM_BINS, i, L, and value.
Referenced by _bin_pickers_histogram(), and _process_histogram().
|
static |
Definition at line 1680 of file libs/histogram.c.
References _Luv_to_vectorscope_coord_zoom(), _scope_pixel_to_xyz(), d, dt_xyY_to_Luv(), dt_XYZ_to_xyY(), HISTOGRAM_BINS, i, L, Luv, width, xyY, and XYZ_D50.
Referenced by _bin_pickers_vectorscope(), and _bin_vectorscope().
|
inlinestatic |
Definition at line 1227 of file libs/histogram.c.
References __OMP_FOR_SIMD__, _bin_pickers_waveforms(), _bin_pixels_waveform_in_roi(), dt_develop_t::color_picker, dt_dev_get_global(), height, k, L, dt_develop_t::picker, dt_develop_t::primary_sample, dt_develop_t::samples, and width.
|
inlinestatic |
Definition at line 1119 of file libs/histogram.c.
References __OMP_PARALLEL_FOR__, CLAMPF, double(), i, L, MAX, MIN, value, and weight().
Referenced by _bin_pickers_waveforms(), and _bin_pixels_waveform().
|
static |
Definition at line 1775 of file libs/histogram.c.
References __OMP_FOR_SIMD__, _bin_pickers_vectorscope(), _bin_pixels_vectorscope_in_roi(), _is_restricted(), dt_develop_t::color_picker, d, dt_dev_get_global(), height, HISTOGRAM_BINS, k, L, dt_develop_t::picker, dt_develop_t::primary_sample, dt_develop_t::samples, and width.
Referenced by _process_vectorscope().
|
static |
Definition at line 285 of file libs/histogram.c.
References dt_dev_backbuf_release_keepalive(), dt_dev_set_backbuf(), DT_PIXELPIPE_CACHE_HASH_INVALID, and IS_NULL_PTR.
Referenced by _refresh_global_histogram_backbuf_for_hash(), and _refresh_preview_histograms().
|
static |
Definition at line 762 of file libs/histogram.c.
References d, IS_NULL_PTR, and L.
Referenced by _sync_pending_histogram_hashes(), gui_cleanup(), and view_leave().
Definition at line 231 of file libs/histogram.c.
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, L, and dt_histogram_preview_refresh_state_t::module_histograms.
Referenced by gui_cleanup(), and view_leave().
|
static |
Definition at line 2765 of file libs/histogram.c.
References _update_everything(), d, dt_lib_module_t::data, dt_bauhaus_combobox_get(), dt_conf_set_string(), and dt_lib_colorpicker_model_names.
|
static |
Definition at line 1741 of file libs/histogram.c.
References __OMP_PARALLEL_FOR__, _vectorscope_coord_zoom_to_Luv(), dt_apply_transposed_color_matrix(), dt_dev_get_global(), dt_Luv_to_xyY(), dt_xyY_to_XYZ(), HISTOGRAM_BINS, i, L, 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 |
Definition at line 1259 of file libs/histogram.c.
References __OMP_FOR_SIMD__, GAMMA, height, k, L, and width.
|
static |
Definition at line 2140 of file libs/histogram.c.
Referenced by _trigger_recompute(), gui_cleanup(), and gui_reset().
|
static |
Definition at line 2938 of file libs/histogram.c.
References _update_everything(), dt_develop_t::color_picker, dt_develop_t::display_samples, dt_conf_set_bool(), dt_control_queue_redraw_center(), dt_dev_get_global(), and L.
Definition at line 1998 of file libs/histogram.c.
References d, IS_NULL_PTR, and L.
Definition at line 890 of file libs/histogram.c.
References __OMP_PARALLEL_FOR_SIMD__, k, L, and max.
Referenced by _process_histogram(), and _process_vectorscope().
| void _get_allocation_size | ( | dt_lib_histogram_t * | d, |
| int * | width, | ||
| int * | height | ||
| ) |
Definition at line 2010 of file libs/histogram.c.
References d, height, L, and width.
Referenced by _redraw_surface(), and _trigger_recompute().
|
static |
Definition at line 2166 of file libs/histogram.c.
References dt_dev_backbuf_get_hash(), dt_dev_get_global(), dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), IS_NULL_PTR, L, piece, pipe, and dt_develop_t::preview_pipe.
Referenced by _is_backbuf_ready(), _pixelpipe_pick_from_image(), _process_histogram(), and _process_vectorscope().
|
static |
Definition at line 271 of file libs/histogram.c.
References dt_develop_t::display_histogram, IS_NULL_PTR, L, 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().
Definition at line 800 of file libs/histogram.c.
References dt_dev_get_global(), dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), DT_PIXELPIPE_CACHE_HASH_INVALID, hash, IS_NULL_PTR, L, piece, pipe, and dt_develop_t::preview_pipe.
Referenced by _sync_pending_histogram_hashes().
|
static |
Definition at line 768 of file libs/histogram.c.
References d, DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, hash, i, IS_NULL_PTR, L, and TRUE.
Referenced by _add_pending_hash().
|
static |
Definition at line 821 of file libs/histogram.c.
References _get_histogram_backbuf(), _update_everything(), d, dt_lib_module_t::data, dt_dev_get_global(), IS_NULL_PTR, and L.
Referenced by _schedule_histogram_refresh().
Definition at line 206 of file libs/histogram.c.
References _schedule_histogram_refresh(), and IS_NULL_PTR.
Referenced by _pixelpipe_pick_from_image(), and _refresh_preview_module_histogram_for_hash().
Retry a scope render after its source cacheline has been published.
The first render attempt stores the current backbuffer hash in the Cairo cache before the non-blocking GUI cache probe can report a miss. Invalidate that rendered-state cache here so the wait-manager wake-up retries pixel binning instead of treating the incomplete surface as current.
Definition at line 221 of file libs/histogram.c.
References _reset_cache(), _schedule_histogram_refresh(), d, dt_lib_module_t::data, IS_NULL_PTR, and L.
Referenced by _process_histogram(), and _process_vectorscope().
|
static |
Check that the selected histogram backbuffer belongs to the current preview graph.
Global histogram stages are independent published cachelines. Their CACHELINE_READY signal is raised while the preview pipeline is still processing, before its final backbuffer becomes valid. Requiring that final backbuffer here would discard the only refresh scheduled for the newly published histogram stage after a module parameter change.
Matching the stage hash against the current piece is sufficient: the histogram backbuffer owns its cache reference, and the piece hash proves that its pixels and geometry belong to the synchronized preview graph.
Definition at line 878 of file libs/histogram.c.
References _get_backbuf_source_piece(), d, FALSE, and IS_NULL_PTR.
Referenced by _area_scrolled_callback(), _refresh_global_picker(), and _trigger_recompute().
|
static |
Definition at line 969 of file libs/histogram.c.
References d, FALSE, IS_NULL_PTR, and L.
Referenced by _bin_vectorscope(), _process_histogram(), and _process_restricted_text().
|
static |
|
static |
Definition at line 2427 of file libs/histogram.c.
References _remove_pending_hash(), _schedule_histogram_refresh(), d, dt_lib_module_t::data, hash, IS_NULL_PTR, dt_pixel_cache_entry_t::producer_node_key, and void().
Referenced by view_enter(), and view_leave().
|
static |
Definition at line 2421 of file libs/histogram.c.
References _sync_pending_histogram_hashes(), and void().
Referenced by view_enter(), and view_leave().
|
static |
Definition at line 2838 of file libs/histogram.c.
References _sample_raw_box_to_image_norm(), _sample_raw_point_to_image_norm(), _set_sample_box_area(), _set_sample_point(), dt_develop_t::color_picker, dt_control_queue_redraw_center(), dt_dev_get_global(), DT_LIB_COLORPICKER_SIZE_BOX, DT_LIB_COLORPICKER_SIZE_POINT, FALSE, dt_develop_t::histogram_module, IS_NULL_PTR, L, dt_colorpicker_sample_t::locked, dt_develop_t::picker, and dt_colorpicker_sample_t::size.
Referenced by _add_sample().
Definition at line 1667 of file libs/histogram.c.
References HISTOGRAM_BINS, and value.
Referenced by _bin_pixels_vectorscope_in_roi(), and _process_vectorscope().
| gboolean _needs_recompute | ( | dt_lib_histogram_t * | d, |
| const int | width, | ||
| const int | height | ||
| ) |
Definition at line 1985 of file libs/histogram.c.
References d, dt_dev_backbuf_get_hash(), height, IS_NULL_PTR, L, view, and width.
Referenced by _trigger_recompute().
|
static |
Definition at line 996 of file libs/histogram.c.
References bpp, dt_histogram_scope_buf_t::data, dt_alloc_align(), dt_dev_get_global(), dt_image_get_effective_orientation(), dt_imageio_flip_buffers(), FALSE, dt_backbuf_t::height, dt_histogram_scope_buf_t::height, IS_NULL_PTR, L, ORIENTATION_NONE, ORIENTATION_SWAP_XY, dt_histogram_scope_buf_t::owned, TRUE, width, dt_backbuf_t::width, and dt_histogram_scope_buf_t::width.
Referenced by _process_histogram().
|
static |
Definition at line 2671 of file libs/histogram.c.
References _redraw_scopes(), _reset_cache(), _trigger_recompute(), d, IS_NULL_PTR, and L.
|
static |
Definition at line 2243 of file libs/histogram.c.
References _get_backbuf_source_piece(), _histogram_restart_cache_wait(), _resolve_backbuf_sampling_source(), _sample_raw_box_to_image_norm(), _sample_raw_point_to_image_norm(), _scope_pixel_to_display_rgb(), _scope_pixel_to_xyz(), dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::cst, d, dt_pixel_cache_entry_t::data, dt_colorpicker_sample_t::display, dt_color_picker_helper(), dt_dev_coordinates_image_norm_to_preview_abs(), dt_dev_distort_backtransform_plus(), dt_dev_get_global(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_wait_set_owner(), 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_backbuf_t::height, dt_iop_roi_t::height, IOP_CS_RGB, IS_NULL_PTR, k, L, dt_colorpicker_sample_t::lab, max, MAX, min, MIN, dt_lib_histogram_t::op, dt_colorpicker_sample_t::scope, dt_colorpicker_sample_t::size, TRUE, TYPE_FLOAT, dt_backbuf_t::width, dt_iop_roi_t::width, dt_iop_roi_t::x, XYZ, and dt_iop_roi_t::y.
Referenced by _pixelpipe_pick_samples().
|
static |
Definition at line 2356 of file libs/histogram.c.
References _get_histogram_backbuf(), _pixelpipe_pick_from_image(), dt_colorpicker_sample_t::backbuf_op, dt_develop_t::color_picker, d, dt_dev_get_global(), L, dt_colorpicker_sample_t::locked, dt_develop_t::picker, dt_develop_t::primary_sample, and dt_develop_t::samples.
Referenced by _update_everything().
|
static |
Definition at line 3013 of file libs/histogram.c.
References _set_scope(), and L.
Referenced by set_preferences().
|
static |
Definition at line 3006 of file libs/histogram.c.
References _set_stage(), and L.
Referenced by set_preferences().
|
static |
Definition at line 600 of file libs/histogram.c.
References _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_get_global(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_histogram_preview_refresh_state_t::gamma_hash, dt_develop_t::gui_attached, hash, dt_histogram_pending_module_refresh_t::hash, dt_histogram_preview_refresh_state_t::initialscale_hash, IS_NULL_PTR, L, dt_histogram_preview_refresh_state_t::module_histograms, dt_develop_t::preview_pipe, and void().
Referenced by view_enter(), and view_leave().
Definition at line 593 of file libs/histogram.c.
References _refresh_preview_histograms(), dt_dev_get_global(), and void().
Referenced by view_enter(), and view_leave().
|
static |
Definition at line 1029 of file libs/histogram.c.
References _bin_pickers_histogram(), _bin_pixels_histogram_in_roi(), _find_max_histogram(), _get_backbuf_source_piece(), _histogram_restart_scope_cache_wait(), _is_restricted(), _orient_scope_buf(), dt_develop_t::color_picker, d, dt_pixel_cache_entry_t::data, dt_bauhaus_get_global(), dt_dev_get_global(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_wait_set_owner(), dt_draw_grid(), dt_draw_histogram_8(), dt_free, dt_free_align, FALSE, height, HISTOGRAM_BINS, IS_NULL_PTR, k, L, log, dt_develop_t::picker, piece, dt_develop_t::primary_sample, dt_develop_t::samples, set_color(), TRUE, and width.
Referenced by _redraw_surface().
|
static |
Draw the restricted-scope label over the current Cairo surface.
The scope content is rendered first because the label describes the final visible state. The theme owns the text color through graph_scope_restricted, while the module keeps the Cairo operator explicit because it controls how the label is composited with the already-rendered graph pixels.
Definition at line 2041 of file libs/histogram.c.
References _is_restricted(), d, dt_bauhaus_get_global(), DT_LIB_HISTOGRAM_SCOPE_RESTRICTED_LABEL_OPERATOR, DT_PIXEL_APPLY_DPI, height, L, MAX, and set_color().
Referenced by _redraw_surface().
|
static |
Definition at line 1805 of file libs/histogram.c.
References _bin_vectorscope(), _create_vectorscope_image(), _find_max_histogram(), _get_backbuf_source_piece(), _histogram_restart_scope_cache_wait(), _Luv_to_vectorscope_coord_zoom(), colors, d, dt_pixel_cache_entry_t::data, dt_apply_transposed_color_matrix(), dt_dev_get_global(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_wait_set_owner(), 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, L, 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, MIN, dt_iop_order_iccprofile_info_t::nonlinearlut, dt_dev_pixelpipe_t::output_profile_info, piece, dt_develop_t::preview_pipe, RGB, TRUE, width, dt_backbuf_t::width, x, xyY, XYZ, and XYZ_D50.
Referenced by _redraw_surface().
|
static |
Definition at line 885 of file libs/histogram.c.
Referenced by _area_scrolled_callback(), _picker_button_toggled(), _set_scope(), and _update_everything().
| gboolean _redraw_surface | ( | dt_lib_histogram_t * | d | ) |
Definition at line 2073 of file libs/histogram.c.
References _get_allocation_size(), _process_histogram(), _process_restricted_text(), _process_vectorscope(), d, 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, L, TRUE, and width.
Referenced by _area_scrolled_callback(), and _trigger_recompute().
|
static |
Definition at line 295 of file libs/histogram.c.
References _clear_histogram_backbuf(), _get_histogram_backbuf(), dt_iop_buffer_dsc_t::bpp, dt_dev_backbuf_take_keepalive(), dt_dev_pixelpipe_cache_peek_gui_retained(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_cache_unref_entry(), 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_pixel_cache_entry_get_size(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, hash, dt_iop_roi_t::height, dt_develop_t::iop, IS_NULL_PTR, L, piece, dt_develop_t::preview_pipe, TRUE, and dt_iop_roi_t::width.
Referenced by _preview_cacheline_ready_callback(), and _refresh_preview_histograms().
|
static |
Definition at line 2401 of file libs/histogram.c.
References _get_histogram_backbuf(), _is_backbuf_ready(), _reset_cache(), _update_everything(), d, dt_lib_module_t::data, dt_conf_get_bool(), dt_dev_get_global(), FALSE, IS_NULL_PTR, and TRUE.
|
static |
Definition at line 244 of file libs/histogram.c.
References 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, IS_NULL_PTR, L, piece, pipe, dt_dev_histogram_collection_params_t::roi, dt_histogram_roi_t::width, and dt_iop_roi_t::width.
Referenced by _refresh_preview_module_histogram_for_hash().
|
static |
Definition at line 475 of file libs/histogram.c.
References _clear_histogram_backbuf(), _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_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, FALSE, dt_histogram_preview_refresh_state_t::gamma_hash, dt_develop_t::gui_attached, dt_dev_pixelpipe_t::gui_observable_source, hash, dt_histogram_pending_module_refresh_t::hash, i, dt_histogram_preview_refresh_state_t::initialscale_hash, dt_develop_t::iop, IS_NULL_PTR, L, dt_histogram_preview_refresh_state_t::module_histograms, dt_dev_pixelpipe_t::nodes, piece, dt_develop_t::preview_pipe, and TRUE.
Referenced by _preview_history_resync_callback(), and _set_stage().
|
static |
Definition at line 377 of file libs/histogram.c.
References _histogram_restart_cache_wait(), _refresh_module_histogram(), dt_iop_buffer_dsc_t::channels, dt_develop_t::color_picker, dt_iop_buffer_dsc_t::cst, d, dt_lib_module_t::data, dt_alloc_align(), dt_colorspaces_apply_profile(), dt_dev_get_global(), dt_dev_pixelpipe_cache_peek_gui_retained(), 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_free_align, dt_iop_colorspace_is_rgb(), dt_ioppr_get_pipe_work_profile_info(), dt_pixel_cache_entry_get_size(), DT_PIXELPIPE_CACHE_HASH_INVALID, DT_REQUEST_ON, DT_REQUEST_ONLY_IN_GUI, FALSE, dt_develop_t::gui_attached, dt_iop_roi_t::height, dt_develop_t::histogram_module, IS_NULL_PTR, L, piece, dt_develop_t::preview_pipe, TRUE, TYPE_FLOAT, and dt_iop_roi_t::width.
Referenced by _preview_cacheline_ready_callback(), and _refresh_preview_histograms().
|
static |
Definition at line 784 of file libs/histogram.c.
References d, DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, hash, i, IS_NULL_PTR, L, and TRUE.
Referenced by _lib_histogram_cacheline_ready_callback().
|
static |
Definition at line 2817 of file libs/histogram.c.
References dt_develop_t::color_picker, dt_colorpicker_sample_t::container, dt_dev_get_global(), dt_free, L, and dt_develop_t::samples.
Referenced by _remove_sample_cb(), gui_cleanup(), and gui_reset().
|
static |
Definition at line 2825 of file libs/histogram.c.
References _remove_sample(), _reset_cache(), _update_everything(), dt_develop_t::color_picker, d, dt_lib_module_t::data, dt_conf_get_bool(), dt_control_queue_redraw_center(), dt_dev_get_global(), dt_develop_t::histogram_module, IS_NULL_PTR, and L.
Referenced by _add_sample().
|
static |
Definition at line 753 of file libs/histogram.c.
References d, and DT_LIB_HISTOGRAM_SCOPE_N.
Referenced by _add_sample(), _histogram_restart_scope_cache_wait(), _picker_button_toggled(), _refresh_global_picker(), _remove_sample_cb(), _resize_callback(), _restrict_histogram_changed(), _set_sample_box_area(), _set_sample_point(), gui_reset(), view_enter(), and view_leave().
|
static |
Definition at line 2503 of file libs/histogram.c.
References _reset_cache(), _trigger_recompute(), and d.
|
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. |
Definition at line 2207 of file libs/histogram.c.
References dt_dev_backbuf_get_hash(), dt_dev_get_global(), 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, hash, IS_NULL_PTR, L, piece, pipe, and dt_develop_t::preview_pipe.
Referenced by _pixelpipe_pick_from_image().
|
static |
Definition at line 2946 of file libs/histogram.c.
References _reset_cache(), _update_everything(), dt_develop_t::color_picker, d, dt_lib_module_t::data, dt_conf_set_bool(), dt_dev_get_global(), IS_NULL_PTR, L, and dt_develop_t::restrict_histogram.
|
static |
Definition at line 2584 of file libs/histogram.c.
References DT_PIXEL_APPLY_DPI, dtgtk_cairo_paint_lock(), FALSE, height, L, dt_colorpicker_sample_t::locked, set_color(), dt_colorpicker_sample_t::swatch, and width.
Referenced by _add_sample().
|
static |
Definition at line 2793 of file libs/histogram.c.
References dt_develop_t::color_picker, dt_control_queue_redraw_center(), dt_dev_get_global(), FALSE, dt_develop_t::picker, and dt_develop_t::selected_sample.
Referenced by _add_sample().
|
static |
Definition at line 2804 of file libs/histogram.c.
References dt_develop_t::color_picker, dt_control_queue_redraw_center(), dt_dev_get_global(), FALSE, L, and dt_develop_t::selected_sample.
Referenced by _add_sample().
|
inlinestatic |
Definition at line 899 of file libs/histogram.c.
References dt_colorpicker_sample_t::box, dt_dev_coordinates_raw_norm_to_image_norm(), dt_dev_get_global(), and L.
Referenced by _bin_pickers_histogram(), _bin_pickers_vectorscope(), _bin_pickers_waveforms(), _live_sample_button(), and _pixelpipe_pick_from_image().
|
inlinestatic |
Definition at line 905 of file libs/histogram.c.
References dt_dev_coordinates_raw_norm_to_image_norm(), dt_dev_get_global(), and dt_colorpicker_sample_t::point.
Referenced by _bin_pickers_histogram(), _bin_pickers_vectorscope(), _bin_pickers_waveforms(), _live_sample_button(), and _pixelpipe_pick_from_image().
|
static |
Definition at line 2709 of file libs/histogram.c.
References color, dt_colorpicker_sample_t::display, dt_free, DT_LIB_COLORPICKER_STATISTIC_MEAN, DT_LIB_COLORPICKER_STATISTIC_N, dt_lib_colorpicker_statistic_names, i, L, dt_colorpicker_sample_t::lab, dt_colorpicker_sample_t::label_rgb, Lch_to_color_name(), dt_colorpicker_sample_t::scope, tooltip, and TRUE.
Referenced by _add_sample().
|
static |
Definition at line 833 of file libs/histogram.c.
References _histogram_refresh_idle(), d, dt_lib_module_t::data, IS_NULL_PTR, and L.
Referenced by _histogram_restart_cache_wait(), _histogram_restart_scope_cache_wait(), and _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 | ||
| ) |
Definition at line 733 of file libs/histogram.c.
References _backbuf_op_to_int(), d, dt_dev_get_global(), dt_ioppr_transform_image_colorspace_rgb(), for_each_channel, dt_dev_pixelpipe_t::input_profile_info, L, dt_dev_pixelpipe_t::output_profile_info, dt_develop_t::preview_pipe, and rgb_out.
Referenced by _pixelpipe_pick_from_image().
| void _scope_pixel_to_xyz | ( | const dt_aligned_pixel_t | rgb_in, |
| dt_aligned_pixel_t | xyz_out, | ||
| dt_lib_histogram_t * | d | ||
| ) |
Definition at line 709 of file libs/histogram.c.
References _backbuf_op_to_int(), d, dt_dev_get_global(), dt_dev_pixelpipe_t::input_profile_info, L, 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().
|
static |
Definition at line 2532 of file libs/histogram.c.
|
static |
Apply one vertical size request from the generic Bauhaus resize handle.
The Bauhaus widget owns pointer tracking and sends requested heights here. The histogram owns the scope widget, the window-relative clamp, and persistence, so these side effects remain explicit in the module that owns the resized surface.
Definition at line 2545 of file libs/histogram.c.
References d, dt_conf_set_int(), dt_gui_main_window(), DT_LIB_HISTOGRAM_SCOPE_HEIGHT_CONF, DT_LIB_HISTOGRAM_SCOPE_MAX_HEIGHT, DT_LIB_HISTOGRAM_SCOPE_MIN_HEIGHT, DT_PIXEL_APPLY_DPI, L, MAX, and MIN.
| void _set_params | ( | dt_lib_histogram_t * | d | ) |
Definition at line 2564 of file libs/histogram.c.
References _get_histogram_backbuf(), d, dt_conf_get_float(), dt_conf_get_int(), dt_conf_get_string_const(), dt_conf_set_string(), dt_dev_get_global(), DT_LIB_HISTOGRAM_SCOPE_HISTOGRAM, DT_LIB_HISTOGRAM_SCOPE_N, DT_LIB_HISTOGRAM_SCOPE_VECTORSCOPE, and L.
Referenced by gui_reset().
|
static |
Definition at line 2690 of file libs/histogram.c.
References _reset_cache(), _update_everything(), d, dt_lib_module_t::data, dt_conf_get_bool(), dt_lib_colorpicker_set_box_area(), and dt_lib_get_global().
Referenced by _live_sample_button().
|
static |
Definition at line 2699 of file libs/histogram.c.
References _reset_cache(), _update_everything(), d, dt_lib_module_t::data, dt_conf_get_bool(), dt_lib_colorpicker_set_point(), and dt_lib_get_global().
Referenced by _live_sample_button().
|
static |
Definition at line 2494 of file libs/histogram.c.
References _redraw_scopes(), _trigger_recompute(), d, dt_lib_module_t::data, and dt_conf_set_int().
Referenced by _pref_display_toggled().
|
static |
Definition at line 2477 of file libs/histogram.c.
References _backbuf_int_to_op(), _refresh_preview_histograms(), _sync_pending_histogram_hashes(), d, dt_lib_module_t::data, dt_conf_set_int(), dt_conf_set_string(), dt_dev_get_global(), DT_LIB_HISTOGRAM_SCOPE_HISTOGRAM, DT_LIB_HISTOGRAM_SCOPE_VECTORSCOPE, L, and value.
Referenced by _pref_stage_toggled().
|
static |
Definition at line 2756 of file libs/histogram.c.
References _update_everything(), dt_develop_t::color_picker, d, dt_lib_module_t::data, dt_bauhaus_combobox_get(), dt_conf_set_string(), dt_dev_get_global(), dt_lib_colorpicker_statistic_names, and dt_develop_t::statistic.
|
static |
Definition at line 840 of file libs/histogram.c.
References _add_pending_hash(), _clear_pending_hashes(), _get_histogram_backbuf(), _get_live_histogram_hash(), _update_everything(), dt_colorpicker_sample_t::backbuf_op, d, dt_lib_module_t::data, dt_dev_get_global(), IS_NULL_PTR, L, dt_colorpicker_sample_t::locked, dt_develop_t::picker, and dt_develop_t::samples.
Referenced by _lib_histogram_history_resync_callback(), and _set_stage().
| gboolean _trigger_recompute | ( | dt_lib_histogram_t * | d | ) |
Definition at line 2146 of file libs/histogram.c.
References _destroy_surface(), _get_allocation_size(), _is_backbuf_ready(), _needs_recompute(), _redraw_surface(), d, dt_cairo_image_surface_create(), height, L, and width.
Referenced by _picker_button_toggled(), _resize_callback(), _set_scope(), _update_everything(), and gui_reset().
|
static |
Definition at line 2376 of file libs/histogram.c.
References _pixelpipe_pick_samples(), _redraw_scopes(), _trigger_recompute(), _update_sample_label(), d, dt_lib_module_t::data, dt_dev_get_global(), IS_NULL_PTR, L, 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(), _remove_sample_cb(), _restrict_histogram_changed(), _set_sample_box_area(), _set_sample_point(), _statistic_changed(), _sync_pending_histogram_hashes(), and _update_picker_output().
|
static |
Definition at line 2666 of file libs/histogram.c.
References _update_everything().
Referenced by gui_reset().
|
static |
Definition at line 2612 of file libs/histogram.c.
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, L, 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().
Definition at line 1674 of file libs/histogram.c.
References HISTOGRAM_BINS, and value.
Referenced by _create_vectorscope_image().
| uint32_t container | ( | dt_lib_module_t * | self | ) |
Definition at line 653 of file libs/histogram.c.
References DT_UI_CONTAINER_PANEL_LEFT_CENTER.
Referenced by _add_sample().
| int expandable | ( | dt_lib_module_t * | self | ) |
Definition at line 658 of file libs/histogram.c.
| void gui_cleanup | ( | dt_lib_module_t * | self | ) |
Definition at line 3243 of file libs/histogram.c.
References _clear_pending_hashes(), _clear_pending_preview_histograms(), _destroy_surface(), _remove_sample(), dt_develop_t::color_picker, d, dt_lib_module_t::data, dt_dev_get_global(), dt_dev_pixelpipe_cache_wait_cleanup(), dt_iop_color_picker_reset(), dt_pixelpipe_cache_free_align, FALSE, dt_develop_t::histogram_module, IS_NULL_PTR, L, dt_develop_t::refresh_global_picker, dt_develop_t::samples, and TRUE.
| void gui_reset | ( | dt_lib_module_t * | self | ) |
Definition at line 2965 of file libs/histogram.c.
References _destroy_surface(), _remove_sample(), _reset_cache(), _set_params(), _trigger_recompute(), _update_picker_output(), dt_develop_t::color_picker, d, dt_lib_module_t::data, dt_colorpicker_sample_t::display, dt_bauhaus_combobox_set(), dt_dev_get_global(), dt_dev_pixelpipe_update_history_preview, dt_iop_color_picker_reset(), DT_LIB_COLORPICKER_STATISTIC_N, FALSE, i, L, 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 | ) |
Definition at line 642 of file libs/histogram.c.
References L.
| int position | ( | ) |
Definition at line 663 of file libs/histogram.c.
| void set_preferences | ( | void * | menu, |
| dt_lib_module_t * | self | ||
| ) |
Definition at line 3020 of file libs/histogram.c.
References _backbuf_op_to_int(), _pref_display_toggled(), _pref_stage_toggled(), d, dt_lib_module_t::data, DT_LIB_HISTOGRAM_SCOPE_VECTORSCOPE, i, L, and TRUE.
| void view_enter | ( | struct dt_lib_module_t * | self, |
| struct dt_view_t * | old_view, | ||
| struct dt_view_t * | new_view | ||
| ) |
Definition at line 2439 of file libs/histogram.c.
References _lib_histogram_cacheline_ready_callback(), _lib_histogram_history_resync_callback(), _preview_cacheline_ready_callback(), _preview_history_resync_callback(), _reset_cache(), d, dt_lib_module_t::data, dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, DT_SIGNAL_CACHELINE_READY, DT_SIGNAL_HISTORY_RESYNC, and L.
| void view_leave | ( | struct dt_lib_module_t * | self, |
| struct dt_view_t * | old_view, | ||
| struct dt_view_t * | new_view | ||
| ) |
Definition at line 2454 of file libs/histogram.c.
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, dt_lib_module_t::data, dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, dt_dev_pixelpipe_cache_wait_cleanup(), and L.
| const char ** views | ( | dt_lib_module_t * | self | ) |
Definition at line 647 of file libs/histogram.c.
|
static |
Definition at line 200 of file libs/histogram.c.
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 } |
Definition at line 147 of file libs/histogram.c.
Referenced by _color_mode_changed().
Definition at line 149 of file libs/histogram.c.
Referenced by _sample_tooltip_callback(), and _statistic_changed().