![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/masks_gui.h"#include <assert.h>#include <math.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <time.h>#include "widgets/bauhaus.h"#include "system/macros.h"#include "system/openmp.h"#include "system/target_clones.h"#include "system/mem_alloc.h"#include "system/simd.h"#include "common/hash.h"#include "common/logging.h"#include "common/module_versioning.h"#include "caches/pixelpipe_cache_alloc.h"#include "develop/masks.h"#include "pixel/fast_guided_filter.h"#include "pixel/eigf.h"#include "pixel/luminance_mask.h"#include "common/collection.h"#include "common/conf.h"#include "control/control.h"#include "develop/develop.h"#include "develop/imageop.h"#include "develop/imageop_gui.h"#include "caches/pixelpipe_cache.h"#include "gui/color_picker_proxy.h"#include "widgets/draw.h"#include "gui/application.h"#include "gui/presets.h"#include "iop/iop_api.h"#include "math/choleski.h"#include "libs/colorpicker.h"#include "widgets/label.h"#include "widgets/notebook.h"#include "widgets/scroll_wrap.h"#include "widgets/widget_style.h"#include "gui/screen_metrics.h"#include "control/signal.h"#include "widgets/togglebutton.h"
Include dependency graph for toneequal.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_toneequalizer_params_t |
| struct | dt_iop_toneequalizer_data_t |
| struct | dt_iop_toneequalizer_global_data_t |
| struct | dt_iop_toneequalizer_gui_data_t |
Macros | |
| #define | UI_SAMPLES 256 |
| #define | CONTRAST_FULCRUM exp2f(-4.0f) |
| #define | MIN_FLOAT exp2f(-16.0f) |
| #define | CHANNELS 9 |
| #define | PIXEL_CHAN 8 |
| #define | LUT_RESOLUTION 10000 |
| #define | DT_TONEEQ_USE_LUT TRUE |
| #define | TEMP_SAMPLES 2 * UI_SAMPLES |
Typedefs | |
| typedef enum dt_iop_toneequalizer_filter_t | dt_iop_toneequalizer_filter_t |
| typedef struct dt_iop_toneequalizer_params_t | dt_iop_toneequalizer_params_t |
| typedef struct dt_iop_toneequalizer_data_t | dt_iop_toneequalizer_data_t |
| typedef struct dt_iop_toneequalizer_global_data_t | dt_iop_toneequalizer_global_data_t |
| typedef struct dt_iop_toneequalizer_gui_data_t | dt_iop_toneequalizer_gui_data_t |
Enumerations | |
| enum | dt_iop_toneequalizer_filter_t { DT_TONEEQ_NONE = 0 , DT_TONEEQ_AVG_GUIDED , DT_TONEEQ_GUIDED , DT_TONEEQ_AVG_EIGF , DT_TONEEQ_EIGF } |
Functions | |
| const char * | name () |
| const char * | aliases () |
| const char ** | description (struct dt_iop_module_t *self) |
| int | default_group () |
| int | flags () |
| int | default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece) |
| void | input_format (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc) |
| int | legacy_params (dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version) |
| static void | compress_shadows_highlight_preset_set_exposure_params (dt_iop_toneequalizer_params_t *p, const float step) |
| static void | dilate_shadows_highlight_preset_set_exposure_params (dt_iop_toneequalizer_params_t *p, const float step) |
| void | init_presets (dt_iop_module_so_t *self) |
| static gboolean | in_mask_editing (dt_iop_module_t *self) |
| static void | invalidate_luminance_cache (dt_iop_module_t *const self) |
| static | __attribute__ ((always_inline)) |
| static float | get_luminance_from_buffer (const float *const buffer, const size_t width, const size_t height, const size_t x, const size_t y) |
| static float | get_luminance_at_norm (const float *const buffer, const size_t width, const size_t height, const float norm_x, const float norm_y) |
| Sample the luminance mask at a NORMALIZED image position. | |
| static gboolean | luminance_entry_fits (dt_pixel_cache_entry_t *entry, const size_t width, const size_t height) |
Tell whether a cache entry can hold a width x height luminance mask. | |
| static __DT_CLONE_TARGETS__ void | apply_toneequalizer (const float *const restrict in, const float *const restrict luminance, float *const restrict out, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const size_t ch, const dt_iop_toneequalizer_data_t *const d) |
| static float | pixel_correction (const float exposure, const float *const restrict factors, const float sigma) |
| static int | compute_luminance_mask (const float *const restrict in, float *const restrict luminance, const size_t width, const size_t height, const size_t ch, const dt_iop_toneequalizer_data_t *const d) |
| static __DT_CLONE_TARGETS__ void | display_luminance_mask (const float *const restrict in, const float *const restrict luminance, float *const restrict out, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const dt_dev_pixelpipe_t *pipe, const size_t ch) |
| int | process (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const restrict ivoid, void *const restrict ovoid) |
| void | modify_roi_in (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *roi_out, dt_iop_roi_t *roi_in) |
| static void | compute_correction_lut (float *restrict lut, const float sigma, const float *const restrict factors) |
| static void | get_channels_gains (float factors[9], const dt_iop_toneequalizer_params_t *p) |
| static void | get_channels_factors (float factors[9], const dt_iop_toneequalizer_params_t *p) |
| static int | compute_channels_factors (const float factors[8], float out[9], const float sigma) |
| static int | compute_channels_gains (const float in[9], float out[9]) |
| static int | commit_channels_gains (const float factors[9], dt_iop_toneequalizer_params_t *p) |
| static void | gui_cache_init (struct dt_iop_module_t *self) |
| static uint64_t | _current_preview_luminance_hash (dt_iop_module_t *self, size_t *width, size_t *height) |
| static void | build_interpolation_matrix (float A[9 *8], const float sigma) |
| static __DT_CLONE_TARGETS__ void | compute_log_histogram_and_stats (const float *const restrict luminance, int histogram[256], const size_t num_elem, int *max_histogram, float *first_decile, float *last_decile) |
| static void | update_histogram (struct dt_iop_module_t *const self) |
| static __DT_CLONE_TARGETS__ void | compute_lut_correction (struct dt_iop_toneequalizer_gui_data_t *g, const float offset, const float scaling) |
| static gboolean | update_curve_lut (struct dt_iop_module_t *self) |
| void | init_global (dt_iop_module_so_t *module) |
| void | cleanup_global (dt_iop_module_so_t *module) |
| void | commit_params (struct dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| void | init_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| void | cleanup_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| void | show_guiding_controls (struct dt_iop_module_t *self) |
| void | update_exposure_sliders (dt_iop_toneequalizer_gui_data_t *g, dt_iop_toneequalizer_params_t *p) |
| void | gui_update (struct dt_iop_module_t *self) |
| Refresh GUI controls from current params and configuration. | |
| void | gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous) |
| static void | smoothing_callback (GtkWidget *slider, gpointer user_data) |
| static void | show_luminance_mask_callback (GtkWidget *togglebutton, GdkEventButton *event, dt_iop_module_t *self) |
| static void | _switch_cursors (struct dt_iop_module_t *self) |
| int | mouse_moved (struct dt_iop_module_t *self, double x, double y, double pressure, int which) |
| int | mouse_leave (struct dt_iop_module_t *self) |
| static int | set_new_params_interactive (const float control_exposure, const float exposure_offset, const float blending_sigma, dt_iop_toneequalizer_gui_data_t *g, dt_iop_toneequalizer_params_t *p) |
| int | scrolled (struct dt_iop_module_t *self, double x, double y, int up, uint32_t state) |
| static gboolean | _init_drawing (dt_iop_module_t *const restrict self, GtkWidget *widget, dt_iop_toneequalizer_gui_data_t *const restrict g) |
| void | cairo_draw_hatches (cairo_t *cr, double center[2], double span[2], int instances, double line_width, double shade) |
| static void | get_shade_from_luminance (cairo_t *cr, const float luminance, const float alpha) |
| static void | draw_exposure_cursor (cairo_t *cr, const double pointerx, const double pointery, const double radius, const float luminance, const float zoom_scale, const int instances, const float alpha) |
| static void | match_color_to_background (cairo_t *cr, const float exposure, const float alpha) |
| void | gui_post_expose (struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery) |
| void | gui_focus (struct dt_iop_module_t *self, gboolean in) |
| static void | init_nodes_x (dt_iop_toneequalizer_gui_data_t *g) |
| static void | init_nodes_y (dt_iop_toneequalizer_gui_data_t *g) |
| static gboolean | area_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) |
| static gboolean | area_enter_notify (GtkWidget *widget, GdkEventCrossing *event, gpointer user_data) |
| static gboolean | area_leave_notify (GtkWidget *widget, GdkEventCrossing *event, gpointer user_data) |
| static gboolean | area_button_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static gboolean | area_motion_notify (GtkWidget *widget, GdkEventMotion *event, gpointer user_data) |
| static gboolean | area_button_release (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static gboolean | notebook_button_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static void | _develop_ui_pipe_started_callback (gpointer instance, gpointer user_data) |
| static void | _develop_history_resync_callback (gpointer instance, gpointer user_data) |
| static void | _develop_cacheline_ready_callback (gpointer instance, const guint64 hash, const guint64 producer_node_key, gpointer user_data) |
| static void | _develop_ui_pipe_finished_callback (gpointer instance, gpointer user_data) |
| void | gui_reset (struct dt_iop_module_t *self) |
| static gboolean | _sample_picker_luminance_mask (const dt_develop_t *const dev, const float *const buffer, const size_t width, const size_t height, float *const picked, float *const picked_min, float *const picked_max) |
| void | color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| Update tone equalizer sliders from one picker sample. | |
| void | autoset (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *i) |
| void | gui_init (struct dt_iop_module_t *self) |
| void | gui_cleanup (struct dt_iop_module_t *self) |
Variables | |
| static const float centers_ops[8] | DT_ALIGNED_ARRAY |
| static const dt_colormatrix_t | gauss_kernel |
| #define CHANNELS 9 |
Build the exposures octaves : band-pass filters with gaussian windows spaced by 1 EV
Definition at line 168 of file toneequal.c.
| #define CONTRAST_FULCRUM exp2f(-4.0f) |
Definition at line 160 of file toneequal.c.
| #define DT_TONEEQ_USE_LUT TRUE |
Definition at line 782 of file toneequal.c.
| #define LUT_RESOLUTION 10000 |
Definition at line 170 of file toneequal.c.
| #define MIN_FLOAT exp2f(-16.0f) |
Definition at line 161 of file toneequal.c.
| #define PIXEL_CHAN 8 |
Definition at line 169 of file toneequal.c.
| #define TEMP_SAMPLES 2 * UI_SAMPLES |
| #define UI_SAMPLES 256 |
Definition at line 159 of file toneequal.c.
| typedef struct dt_iop_toneequalizer_data_t dt_iop_toneequalizer_data_t |
| typedef struct dt_iop_toneequalizer_gui_data_t dt_iop_toneequalizer_gui_data_t |
| typedef struct dt_iop_toneequalizer_params_t dt_iop_toneequalizer_params_t |
| Enumerator | |
|---|---|
| DT_TONEEQ_NONE | |
| DT_TONEEQ_AVG_GUIDED | |
| DT_TONEEQ_GUIDED | |
| DT_TONEEQ_AVG_EIGF | |
| DT_TONEEQ_EIGF | |
Definition at line 186 of file toneequal.c.
|
inlinestatic |
Definition at line 628 of file toneequal.c.
References dt_iop_module_t::dev, dt_control_log(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_ioppr_get_iop_order(), dt_iop_module_t::enabled, enabled, FALSE, dt_iop_module_t::gui, dt_develop_t::gui_attached, dt_iop_module_t::iop_order, dt_develop_t::iop_order_list, dt_iop_module_gui_t::off, and TRUE.
|
static |
Definition at line 1383 of file toneequal.c.
References dt_iop_module_t::dev, dt_dev_distort_get_iop_pipe(), dt_hash(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_dev_pixelpipe_iop_t::enabled, dt_dev_pixelpipe_iop_t::global_hash, height, dt_iop_roi_t::height, IS_NULL_PTR, dt_develop_t::preview_pipe, dt_dev_pixelpipe_iop_t::roi_in, width, and dt_iop_roi_t::width.
Referenced by _develop_cacheline_ready_callback(), _develop_history_resync_callback(), and gui_focus().
|
static |
Definition at line 3165 of file toneequal.c.
References _current_preview_luminance_hash(), _switch_cursors(), dt_iop_module_t::dev, dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_cache_ref_entry_by_hash(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, g, IS_NULL_PTR, luminance_entry_fits(), dt_develop_t::preview_pipe, TRUE, and void().
Referenced by gui_cleanup(), and gui_init().
|
static |
Definition at line 3078 of file toneequal.c.
References _current_preview_luminance_hash(), _switch_cursors(), dt_iop_module_t::dev, dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_cache_ref_entry_by_hash(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, g, IS_NULL_PTR, luminance_entry_fits(), dt_develop_t::preview_pipe, TRUE, and void().
Referenced by gui_cleanup(), and gui_init().
|
static |
Definition at line 3225 of file toneequal.c.
References _switch_cursors(), dt_iop_gui_data(), g, and IS_NULL_PTR.
Referenced by gui_cleanup(), and gui_init().
|
static |
Post pipe events
Definition at line 3059 of file toneequal.c.
References _switch_cursors(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_gui_data(), dt_iop_module_t::enabled, dt_iop_module_gui_t::expanded, g, dt_iop_module_t::gui, and IS_NULL_PTR.
Referenced by gui_cleanup(), and gui_init().
|
inlinestatic |
x axis
y axis
Definition at line 2542 of file toneequal.c.
References CHANNELS, dt_bauhaus_get_global(), dt_cairo_image_surface_create(), dt_cairo_perceptual_gradient(), dt_gui_set_pango_resolution(), DT_PIXEL_APPLY_DPI, g, INNER_PADDING, k, dt_bauhaus_t::quad_width, set_color(), TRUE, and value.
Referenced by area_draw(), and gui_post_expose().
|
static |
Definition at line 3247 of file toneequal.c.
References dt_colorpicker_sample_t::box, dt_develop_t::color_picker, DT_LIB_COLORPICKER_SIZE_BOX, FALSE, get_luminance_from_buffer(), height, IS_NULL_PTR, MAX, MIN, dt_colorpicker_sample_t::point, dt_develop_t::primary_sample, row, dt_colorpicker_sample_t::size, value, width, and x.
Referenced by color_picker_apply().
|
static |
Definition at line 1864 of file toneequal.c.
References dt_iop_module_t::dev, dt_control_get_global(), dt_control_hinter_message(), dt_control_queue_cursor_by_name(), dt_control_queue_redraw_center(), dt_control_set_cursor_visible, dt_iop_color_picker_is_visible(), dt_iop_gui_data(), dt_iop_module_t::enabled, dt_iop_module_gui_t::expanded, FALSE, g, dt_iop_module_t::gui, dt_develop_t::gui_attached, in_mask_editing(), IS_NULL_PTR, dt_develop_t::pipe, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, and TRUE.
Referenced by _develop_cacheline_ready_callback(), _develop_history_resync_callback(), _develop_ui_pipe_finished_callback(), _develop_ui_pipe_started_callback(), color_picker_apply(), gui_focus(), and mouse_moved().
| const char * aliases | ( | ) |
Definition at line 349 of file toneequal.c.
|
inlinestatic |
Definition at line 818 of file toneequal.c.
References __OMP_PARALLEL_FOR__, __OMP_SIMD__, ch, d, dt_omploop_sfence, fast_clamp(), dt_iop_roi_t::height, i, k, luminance, out, PIXEL_CHAN, sigma, and dt_iop_roi_t::width.
|
static |
Definition at line 2914 of file toneequal.c.
References d, dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_dev_add_history_item, dt_gui_widgets_suppressed(), dt_iop_color_picker_reset(), dt_iop_gui_data(), dt_iop_request_focus(), dt_iop_module_t::enabled, FALSE, g, dt_iop_module_t::gui, p, dt_iop_module_t::params, TRUE, update_exposure_sliders(), and dt_iop_module_gui_t::widget.
Referenced by gui_init().
|
static |
Definition at line 3012 of file toneequal.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_request_focus(), dt_iop_module_t::enabled, FALSE, g, p, dt_iop_module_t::params, TRUE, and update_exposure_sliders().
Referenced by gui_init().
|
static |
Definition at line 2695 of file toneequal.c.
References _init_drawing(), CHANNELS, dt_bauhaus_get_global(), dt_draw_grid(), dt_iop_gui_data(), DT_PIXEL_APPLY_DPI, dtgtk_cairo_paint_gamut_check(), dt_iop_module_t::enabled, FALSE, g, init_nodes_x(), init_nodes_y(), IS_NULL_PTR, k, M_PI, set_color(), TRUE, UI_SAMPLES, update_curve_lut(), and update_histogram().
Referenced by gui_init().
|
static |
Definition at line 2869 of file toneequal.c.
References dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_module_t::enabled, FALSE, g, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 2887 of file toneequal.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_module_t::enabled, FALSE, g, p, dt_iop_module_t::params, TRUE, and update_exposure_sliders().
Referenced by gui_init().
|
static |
Definition at line 2968 of file toneequal.c.
References CHANNELS, dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_module_t::enabled, g, i, p, dt_iop_module_t::params, set_new_params_interactive(), and TRUE.
Referenced by gui_init().
| void autoset | ( | struct dt_iop_module_t * | self, |
| const struct dt_dev_pixelpipe_t * | pipe, | ||
| const struct dt_dev_pixelpipe_iop_t * | piece, | ||
| const void * | i | ||
| ) |
Definition at line 3457 of file toneequal.c.
References __OMP_PARALLEL_FOR__, dt_iop_buffer_dsc_t::channels, CONTRAST_FULCRUM, dt_dev_pixelpipe_iop_t::dsc_in, dt_pixelpipe_cache_alloc_align_float, dt_pixelpipe_cache_free_align, height, dt_iop_roi_t::height, i, IS_NULL_PTR, k, luminance, p, dt_iop_module_t::params, dt_dev_pixelpipe_iop_t::roi_out, value, width, and dt_iop_roi_t::width.
|
inlinestatic |
Definition at line 1401 of file toneequal.c.
References __OMP_SIMD__, A, CHANNELS, i, PIXEL_CHAN, and sigma.
Referenced by commit_params(), and update_curve_lut().
| void cairo_draw_hatches | ( | cairo_t * | cr, |
| double | center[2], | ||
| double | span[2], | ||
| int | instances, | ||
| double | line_width, | ||
| double | shade | ||
| ) |
Definition at line 2184 of file toneequal.c.
References delta, double(), and i.
Referenced by draw_exposure_cursor().
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 1636 of file toneequal.c.
References dt_iop_module_so_t::data, and dt_free.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1708 of file toneequal.c.
References dt_dev_pixelpipe_iop_t::data, and dt_free_align.
| void color_picker_apply | ( | dt_iop_module_t * | self, |
| GtkWidget * | picker, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Update tone equalizer sliders from one picker sample.
Tone equalizer exposes picker-enabled bauhaus sliders for exposure and contrast compensation. The sample is taken from the module input cache, so the picked luminance is measured before tone equalizer applies its own mask remapping. This keeps the call chain identical to filmicrgb: picker activation comes from the slider quad, sampling arrives through the shared picker proxy, and the callback commits the resulting parameter directly back into the GUI slider.
Blend and mask pickers dispatch through the same hook, therefore only the two tone equalizer slider widgets are handled here and every other picker falls through untouched.
| self | Current module instance. |
| picker | Active picker widget dispatched by the picker proxy. |
| pipe | Preview pipe that was sampled. |
| piece | Live pipe piece matching the sampled cacheline. |
Definition at line 3323 of file toneequal.c.
References _sample_picker_luminance_mask(), _switch_cursors(), CONTRAST_FULCRUM, dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_queue_redraw_center(), DT_DEBUG_DEV, dt_dev_add_history_item, dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_pixel_cache_entry_get_data(), dt_print(), DT_TONEEQ_EIGF, DT_TONEEQ_GUIDED, FALSE, g, dt_dev_pixelpipe_iop_t::global_hash, invalidate_luminance_cache(), IS_NULL_PTR, mix(), p, dt_iop_module_t::params, and TRUE.
|
static |
Definition at line 1321 of file toneequal.c.
References p.
Referenced by set_new_params_interactive().
| void commit_params | ( | struct dt_iop_module_t * | self, |
| dt_iop_params_t * | p1, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1642 of file toneequal.c.
References A, build_interpolation_matrix(), CHANNELS, compute_correction_lut(), d, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, DT_ALIGNED_ARRAY, dt_iop_gui_data(), dt_simd_memcpy(), FALSE, g, get_channels_factors(), dt_develop_t::gui_attached, IS_NULL_PTR, p, PIXEL_CHAN, pseudo_solve(), and update_curve_lut().
|
static |
|
static |
Definition at line 1285 of file toneequal.c.
References __OMP_PARALLEL_FOR_SIMD__, CHANNELS, i, out, PIXEL_CHAN, pixel_correction(), and sigma.
Referenced by set_new_params_interactive().
|
static |
Definition at line 1307 of file toneequal.c.
References CHANNELS, i, out, and PIXEL_CHAN.
Referenced by set_new_params_interactive().
|
static |
Definition at line 1236 of file toneequal.c.
References fast_clamp(), i, lut, LUT_RESOLUTION, PIXEL_CHAN, and sigma.
Referenced by commit_params().
|
inlinestatic |
Definition at line 1416 of file toneequal.c.
References __OMP_PARALLEL_FOR__, i, k, luminance, TEMP_SAMPLES, and UI_SAMPLES.
Referenced by update_histogram().
|
inlinestatic |
Definition at line 870 of file toneequal.c.
References ch, CONTRAST_FULCRUM, d, DT_GF_BLENDING_GEOMEAN, DT_GF_BLENDING_LINEAR, DT_TONEEQ_AVG_EIGF, DT_TONEEQ_AVG_GUIDED, DT_TONEEQ_EIGF, DT_TONEEQ_GUIDED, DT_TONEEQ_NONE, fast_eigf_surface_blur(), fast_surface_blur(), height, luminance, and width.
|
inlinestatic |
Definition at line 1554 of file toneequal.c.
References __OMP_FOR_SIMD__, g, k, pixel_correction(), scaling, sigma, UI_SAMPLES, and x.
Referenced by update_curve_lut().
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 374 of file toneequal.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 364 of file toneequal.c.
References IOP_GROUP_TONES.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 355 of file toneequal.c.
References dt_iop_set_description().
|
static |
|
inlinestatic |
Definition at line 945 of file toneequal.c.
References __OMP_PARALLEL_FOR__, ch, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_omploop_sfence, dt_simd_set1(), dt_iop_roi_t::height, i, luminance, dt_dev_pixelpipe_t::mask_display, out, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
|
static |
Definition at line 2216 of file toneequal.c.
References cairo_draw_hatches(), DT_PIXEL_APPLY_DPI, get_shade_from_luminance(), luminance, and M_PI.
Referenced by gui_post_expose().
| int flags | ( | ) |
Definition at line 369 of file toneequal.c.
References IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.
|
static |
Definition at line 1271 of file toneequal.c.
References __OMP_SIMD__, CHANNELS, get_channels_gains(), and p.
Referenced by commit_params(), set_new_params_interactive(), smoothing_callback(), and update_curve_lut().
|
static |
Definition at line 1254 of file toneequal.c.
Referenced by get_channels_factors().
|
inlinestatic |
Sample the luminance mask at a NORMALIZED image position.
The mask is the pipeline buffer this module computed, so its dimensions are the ROI the pipe planned for this run and nothing else – the preview size when darkroom renders scaled, the full sensor resolution when darkroom/render_size asks for 1:1. The cursor is therefore carried normalized and resolved here against the buffer actually attached.
Definition at line 721 of file toneequal.c.
References get_luminance_from_buffer(), height, IS_NULL_PTR, MIN, width, and x.
Referenced by gui_post_expose(), mouse_moved(), and scrolled().
|
static |
Definition at line 666 of file toneequal.c.
References DT_ALIGNED_PIXEL, for_each_channel, gauss_kernel, height, i, luminance, MAX, MIN, width, and x.
Referenced by _sample_picker_luminance_mask(), and get_luminance_at_norm().
|
static |
Definition at line 2207 of file toneequal.c.
References luminance.
Referenced by draw_exposure_cursor(), gui_post_expose(), and match_color_to_background().
|
static |
Definition at line 1342 of file toneequal.c.
References dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, g, IS_NULL_PTR, and TRUE.
Referenced by gui_init().
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
Definition at line 1785 of file toneequal.c.
References dt_bauhaus_widget_set_quad_active(), dt_iop_gui_data(), FALSE, g, invalidate_luminance_cache(), and show_guiding_controls().
| void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
Definition at line 3667 of file toneequal.c.
References _develop_cacheline_ready_callback(), _develop_history_resync_callback(), _develop_ui_pipe_finished_callback(), _develop_ui_pipe_started_callback(), dt_conf_set_int(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, dt_dev_pixelpipe_cache_ref_count_entry(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXELPIPE_CACHE_HASH_INVALID, DT_REQUEST_COLORPICK_OFF, FALSE, g, IOP_GUI_FREE, IS_NULL_PTR, and dt_iop_module_t::request_color_pick.
| void gui_focus | ( | struct dt_iop_module_t * | self, |
| gboolean | in | ||
| ) |
Definition at line 2440 of file toneequal.c.
References _current_preview_luminance_hash(), _switch_cursors(), dt_iop_module_t::dev, dt_collection_get_global(), dt_collection_hint_message(), dt_control_get_global(), dt_control_hinter_message(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_cache_ref_entry_by_hash(), dt_dev_pixelpipe_update_history_main, dt_dev_pixelpipe_update_history_preview, dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_iop_module_t::enabled, FALSE, g, IS_NULL_PTR, luminance_entry_fits(), dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, and TRUE.
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
Definition at line 3492 of file toneequal.c.
References _develop_cacheline_ready_callback(), _develop_history_resync_callback(), _develop_ui_pipe_finished_callback(), _develop_ui_pipe_started_callback(), area_button_press(), area_button_release(), area_draw(), area_enter_notify(), area_leave_notify(), area_motion_notify(), dt_bauhaus_combobox_from_params(), dt_bauhaus_combobox_remove_at(), dt_bauhaus_get_global(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_new_with_range(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_soft_max(), dt_bauhaus_slider_set_soft_range(), dt_bauhaus_widget_set_label(), DT_COLOR_PICKER_AREA, dt_color_picker_new(), dt_conf_get_int(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, dt_gui_add_class(), DT_GUI_BOX_SPACING, DT_GUI_MODULE, dt_iop_togglebutton_new(), DT_SIGNAL_CACHELINE_READY, DT_SIGNAL_DEVELOP_HISTORY_CHANGE, DT_SIGNAL_DEVELOP_UI_PIPE_FINISHED, DT_SIGNAL_HISTORY_RESYNC, DT_TONEEQ_LAST, dt_ui_label_new(), dt_ui_notebook_new(), dt_ui_notebook_page(), dt_ui_notebook_set_picker_owner(), dt_ui_resizable_drawing_area(), dt_widget_scroll_mask(), dtgtk_cairo_paint_showmask(), DTGTK_TOGGLEBUTTON, dtgtk_togglebutton_set_paint(), FALSE, g, dt_iop_module_t::gui, gui_cache_init(), IOP_GUI_ALLOC, notebook_button_press(), show_luminance_mask_callback(), smoothing_callback(), TRUE, and dt_iop_module_gui_t::widget.
| void gui_post_expose | ( | struct dt_iop_module_t * | self, |
| cairo_t * | cr, | ||
| int32_t | width, | ||
| int32_t | height, | ||
| int32_t | pointerx, | ||
| int32_t | pointery | ||
| ) |
Definition at line 2255 of file toneequal.c.
References _init_drawing(), CHANNELS, dt_iop_module_t::dev, draw_exposure_cursor(), DT_ALIGNED_ARRAY, dt_bauhaus_get_global(), dt_dev_get_overlay_scale(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_rescale_roi(), dt_dev_roi_request_preview_height(), dt_dev_roi_request_preview_width(), dt_gui_set_pango_resolution(), dt_iop_color_picker_is_visible(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXEL_APPLY_DPI, dt_pixel_cache_entry_get_data(), dt_simd_memcpy(), dt_iop_module_t::enabled, dt_iop_module_gui_t::expanded, FALSE, g, get_luminance_at_norm(), get_shade_from_luminance(), dt_iop_module_t::gui, height, i, in_mask_editing(), IS_NULL_PTR, M_PI, match_color_to_background(), dt_develop_t::pipe, PIXEL_CHAN, pixel_correction(), dt_dev_pixelpipe_t::processing, sigma, TRUE, dt_iop_module_gui_t::widget, and width.
| void gui_reset | ( | struct dt_iop_module_t * | self | ) |
Definition at line 3234 of file toneequal.c.
References dt_iop_module_t::dev, dt_bauhaus_widget_set_quad_active(), dt_dev_add_history_item, dt_iop_gui_data(), dt_iop_request_focus(), FALSE, g, dt_iop_module_t::gui, IS_NULL_PTR, TRUE, and dt_iop_module_gui_t::widget.
| void gui_update | ( | struct dt_iop_module_t * | self | ) |
Refresh GUI controls from current params and configuration.
gui callbacks, these are needed.
Definition at line 1772 of file toneequal.c.
References dt_bauhaus_slider_set(), dt_iop_gui_data(), g, invalidate_luminance_cache(), p, dt_iop_module_t::params, and show_guiding_controls().
|
static |
Helper functions
Definition at line 593 of file toneequal.c.
References dt_iop_module_t::dev, dt_masks_get_visible_form(), and dt_develop_t::form_gui.
Referenced by _switch_cursors(), gui_post_expose(), and scrolled().
| void init_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 1627 of file toneequal.c.
|
inlinestatic |
Definition at line 2668 of file toneequal.c.
References CHANNELS, g, i, IS_NULL_PTR, and TRUE.
Referenced by area_draw().
|
inlinestatic |
Definition at line 2682 of file toneequal.c.
References CHANNELS, g, i, IS_NULL_PTR, and TRUE.
Referenced by area_draw().
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1701 of file toneequal.c.
References dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
| void init_presets | ( | dt_iop_module_so_t * | self | ) |
Definition at line 467 of file toneequal.c.
References compress_shadows_highlight_preset_set_exposure_params(), dilate_shadows_highlight_preset_set_exposure_params(), dt_gui_presets_add_generic(), DT_TONEEQ_EIGF, DT_TONEEQ_GUIDED, DT_TONEEQ_NONE, DT_TONEEQ_NORM_2, DT_TONEEQ_NORM_POWER, dt_iop_module_so_t::op, and p.
| void input_format | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_iop_buffer_dsc_t * | dsc | ||
| ) |
Definition at line 379 of file toneequal.c.
References dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::datatype, default_input_format(), and TYPE_FLOAT.
|
static |
Definition at line 599 of file toneequal.c.
References dt_dev_pixelpipe_cache_ref_count_entry(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, g, and IS_NULL_PTR.
Referenced by color_picker_apply(), gui_changed(), and gui_update().
| int legacy_params | ( | dt_iop_module_t * | self, |
| const void *const | old_params, | ||
| const int | old_version, | ||
| void * | new_params, | ||
| const int | new_version | ||
| ) |
Definition at line 387 of file toneequal.c.
References contrast_boost, d, dt_iop_module_t::default_params, exposure_boost, n, and noise.
|
inlinestatic |
Tell whether a cache entry can hold a width x height luminance mask.
The GUI resolves its luminance cacheline by hash alone, and a hash carries no size: the pixelpipe cache hands back whatever entry answers to it. The dimensions come from a separate read of the pipe piece, so the two can describe different runs whenever the pipe replans in between – and toneequal's ROI genuinely changes size when finalscale enables or disables itself, which is a plain zoom away. Attaching only what fits is what keeps every sampler in bounds; the dimensions alone are never enough to trust a buffer.
Definition at line 745 of file toneequal.c.
References dt_pixel_cache_entry_get_size(), FALSE, height, IS_NULL_PTR, and width.
Referenced by _develop_cacheline_ready_callback(), _develop_history_resync_callback(), and gui_focus().
|
static |
Definition at line 2240 of file toneequal.c.
References get_shade_from_luminance().
Referenced by gui_post_expose().
| void modify_roi_in | ( | struct dt_iop_module_t * | self, |
| const struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece, | ||
| const dt_iop_roi_t * | roi_out, | ||
| dt_iop_roi_t * | roi_in | ||
| ) |
Definition at line 1179 of file toneequal.c.
References d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::iheight, dt_dev_pixelpipe_iop_t::iwidth, max_size, and dt_iop_roi_t::scale.
| int mouse_leave | ( | struct dt_iop_module_t * | self | ) |
Definition at line 2010 of file toneequal.c.
References dt_control_queue_cursor_by_name(), dt_control_queue_redraw_center(), dt_iop_gui_data(), FALSE, g, and IS_NULL_PTR.
| int mouse_moved | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 1921 of file toneequal.c.
References _switch_cursors(), dt_iop_module_t::dev, dt_dev_coordinates_widget_to_image_norm(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_iop_color_picker_is_visible(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_pixel_cache_entry_get_data(), FALSE, g, get_luminance_at_norm(), IS_NULL_PTR, dt_develop_t::pipe, dt_dev_pixelpipe_t::processing, TRUE, and x.
| const char * name | ( | ) |
Definition at line 344 of file toneequal.c.
|
static |
Definition at line 3040 of file toneequal.c.
References dt_gui_widgets_suppressed(), dt_iop_color_picker_reset(), dt_iop_request_focus(), and TRUE.
Referenced by gui_init().
|
inlinestatic |
Definition at line 853 of file toneequal.c.
References __OMP_SIMD__, fast_clamp(), i, PIXEL_CHAN, and sigma.
Referenced by compute_channels_factors(), compute_lut_correction(), and gui_post_expose().
| int process | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const void *const restrict | ivoid, | ||
| void *const restrict | ovoid | ||
| ) |
Definition at line 1170 of file toneequal.c.
References ovoid, dt_dev_pixelpipe_iop_t::roi_in, and dt_dev_pixelpipe_iop_t::roi_out.
| int scrolled | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| int | up, | ||
| uint32_t | state | ||
| ) |
Definition at line 2081 of file toneequal.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_gui_widgets_suppressed(), dt_iop_color_picker_is_visible(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_modifier_is(), dt_pixel_cache_entry_get_data(), DT_PRIMARY_MASK, dt_iop_module_t::enabled, dt_iop_module_gui_t::expanded, FALSE, g, get_luminance_at_norm(), dt_iop_module_t::gui, in_mask_editing(), IS_NULL_PTR, dt_iop_module_gui_t::off, p, dt_iop_module_t::params, dt_develop_t::pipe, dt_dev_pixelpipe_t::processing, set_new_params_interactive(), state, TRUE, and update_exposure_sliders().
|
inlinestatic |
Definition at line 2028 of file toneequal.c.
References CHANNELS, commit_channels_gains(), compute_channels_factors(), compute_channels_gains(), DT_ALIGNED_ARRAY, dt_control_log(), dt_simd_memcpy(), g, get_channels_factors(), i, p, PIXEL_CHAN, and pseudo_solve().
Referenced by area_motion_notify(), and scrolled().
| void show_guiding_controls | ( | struct dt_iop_module_t * | self | ) |
Definition at line 1714 of file toneequal.c.
References dt_iop_gui_data(), DT_TONEEQ_AVG_EIGF, DT_TONEEQ_AVG_GUIDED, DT_TONEEQ_EIGF, DT_TONEEQ_GUIDED, DT_TONEEQ_NONE, FALSE, g, p, and TRUE.
Referenced by gui_changed(), and gui_update().
|
static |
Definition at line 1833 of file toneequal.c.
References dt_iop_module_t::dev, DT_DEV_PIXELPIPE_DISPLAY_NONE, DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU, dt_dev_pixelpipe_update_history_main, dt_gui_widgets_suppressed(), dt_iop_color_picker_reset(), dt_iop_gui_data(), dt_iop_request_focus(), dt_iop_set_cache_bypass(), g, dt_iop_module_t::gui, dt_iop_module_gui_t::off, dt_iop_module_t::request_mask_display, and TRUE.
Referenced by gui_init().
Definition at line 1808 of file toneequal.c.
References CHANNELS, dt_iop_module_t::dev, DT_ALIGNED_ARRAY, dt_bauhaus_slider_get(), dt_control_log(), dt_dev_add_history_item, dt_gui_widgets_suppressed(), dt_iop_color_picker_reset(), dt_iop_gui_data(), g, get_channels_factors(), p, dt_iop_module_t::params, TRUE, and update_curve_lut().
Referenced by gui_init().
|
inlinestatic |
Definition at line 1576 of file toneequal.c.
References build_interpolation_matrix(), CHANNELS, compute_lut_correction(), DT_ALIGNED_ARRAY, dt_iop_gui_data(), dt_simd_memcpy(), FALSE, g, get_channels_factors(), IS_NULL_PTR, p, dt_iop_module_t::params, PIXEL_CHAN, pseudo_solve(), and TRUE.
Referenced by area_draw(), commit_params(), and smoothing_callback().
| void update_exposure_sliders | ( | dt_iop_toneequalizer_gui_data_t * | g, |
| dt_iop_toneequalizer_params_t * | p | ||
| ) |
Definition at line 1756 of file toneequal.c.
References dt_bauhaus_slider_set(), dt_gui_freeze_begin, dt_gui_freeze_end, g, and p.
Referenced by area_button_press(), area_button_release(), area_leave_notify(), and scrolled().
|
inlinestatic |
Definition at line 1486 of file toneequal.c.
References compute_log_histogram_and_stats(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_pixel_cache_entry_get_data(), DT_PIXELPIPE_CACHE_HASH_INVALID, FALSE, g, height, IS_NULL_PTR, TRUE, UI_SAMPLES, and width.
Referenced by area_draw().
|
static |
Definition at line 173 of file toneequal.c.
Referenced by commit_params(), gui_post_expose(), set_new_params_interactive(), smoothing_callback(), and update_curve_lut().
|
static |
Definition at line 661 of file toneequal.c.
Referenced by get_luminance_from_buffer().