![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/masks_gui.h"#include <math.h>#include <stdlib.h>#include <string.h>#include "widgets/bauhaus.h"#include "widgets/accelerators.h"#include "pixel/colorequal_shared.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/logging.h"#include "common/times.h"#include "common/module_versioning.h"#include "common/imagebuf.h"#include "pixel/lut3d.h"#include "gui/lut_viewer.h"#include "common/opencl.h"#include "common/conf.h"#include "control/control.h"#include "control/signal.h"#include "develop/develop.h"#include "develop/dev_pixelpipe.h"#include "develop/imageop.h"#include "develop/imageop_gui.h"#include "develop/masks.h"#include "caches/pixelpipe_cache.h"#include "gui/color_picker_proxy.h"#include "widgets/draw.h"#include "gui/application.h"#include "develop/gui_throttle.h"#include "iop/iop_api.h"#include "widgets/scroll_wrap.h"#include "widgets/widget_style.h"#include "gui/screen_metrics.h"
Include dependency graph for colorequal.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_colorequal_node_t |
| struct | dt_iop_colorequal_params_t |
| struct | dt_iop_colorequal_data_t |
| struct | dt_iop_colorequal_global_data_t |
| struct | dt_iop_colorequal_gui_data_t |
Typedefs | |
| typedef enum dt_iop_colorequal_channel_t | dt_iop_colorequal_channel_t |
| typedef enum dt_iop_colorequal_ring_t | dt_iop_colorequal_ring_t |
| typedef enum dt_iop_colorequal_interpolation_t | dt_iop_colorequal_interpolation_t |
| typedef struct dt_iop_colorequal_node_t | dt_iop_colorequal_node_t |
| typedef struct dt_iop_colorequal_params_t | dt_iop_colorequal_params_t |
| typedef struct dt_iop_colorequal_data_t | dt_iop_colorequal_data_t |
| typedef struct dt_iop_colorequal_global_data_t | dt_iop_colorequal_global_data_t |
| typedef struct dt_iop_colorequal_gui_data_t | dt_iop_colorequal_gui_data_t |
Enumerations | |
| enum | dt_iop_colorequal_channel_t { DT_IOP_COLOREQUAL_SATURATION = 0 , DT_IOP_COLOREQUAL_HUE = 1 , DT_IOP_COLOREQUAL_BRIGHTNESS = 2 } |
| enum | dt_iop_colorequal_ring_t { DT_IOP_COLOREQUAL_RING_DARK = 0 , DT_IOP_COLOREQUAL_RING_MID = 1 , DT_IOP_COLOREQUAL_RING_LIGHT = 2 } |
| enum | dt_iop_colorequal_interpolation_t { DT_IOP_COLOREQUAL_TETRAHEDRAL = 0 , DT_IOP_COLOREQUAL_TRILINEAR = 1 , DT_IOP_COLOREQUAL_PYRAMID = 2 } |
| #define DT_IOP_COLOREQUAL_AXIAL_SAMPLES 64 |
Definition at line 79 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_AXIS_HEIGHT DT_PIXEL_APPLY_DPI(14) |
Definition at line 85 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_CLUT_LEVEL 64 |
Definition at line 80 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_DEFAULT_NODES 8 |
Definition at line 74 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_GRAPH_GRADIENTS 48 |
Definition at line 76 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_GRAPH_INSET DT_PIXEL_APPLY_DPI(4) |
Definition at line 84 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_GRAPH_RES 360 |
Definition at line 75 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_HUE_SAMPLES 64 |
Definition at line 77 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_LOCAL_FIELD_RINGS (DT_IOP_COLOREQUAL_NUM_RINGS + 1) |
Definition at line 81 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_MAXNODES 20 |
Definition at line 73 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_MIN_X_DISTANCE 0.01f |
Definition at line 82 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_NUM_CHANNELS 3 |
We keep the same GUI hue convention as the old prototype: the darktable UCS hue of sRGB red sits around +20 degrees, so the graph is shifted to place red at the left edge of the widget.
Definition at line 71 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_NUM_RINGS 3 |
Definition at line 72 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_PREVIEW_CURSOR_RADIUS DT_PIXEL_APPLY_DPI(14.f) |
Definition at line 83 of file colorequal.c.
Definition at line 90 of file colorequal.c.
Definition at line 92 of file colorequal.c.
Definition at line 91 of file colorequal.c.
Definition at line 86 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_SCROLL_STEP 0.05f |
Definition at line 87 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_SCROLL_STEP_COARSE 0.10f |
Definition at line 89 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_SCROLL_STEP_FINE 0.02f |
Definition at line 88 of file colorequal.c.
| #define DT_IOP_COLOREQUAL_VIEWER_CONTROL_NODES (DT_IOP_COLOREQUAL_NUM_RINGS * DT_IOP_COLOREQUAL_HUE_SAMPLES) |
Definition at line 78 of file colorequal.c.
| typedef enum dt_iop_colorequal_channel_t dt_iop_colorequal_channel_t |
| typedef struct dt_iop_colorequal_data_t dt_iop_colorequal_data_t |
| typedef struct dt_iop_colorequal_global_data_t dt_iop_colorequal_global_data_t |
| typedef struct dt_iop_colorequal_gui_data_t dt_iop_colorequal_gui_data_t |
| typedef struct dt_iop_colorequal_node_t dt_iop_colorequal_node_t |
| typedef struct dt_iop_colorequal_params_t dt_iop_colorequal_params_t |
| typedef enum dt_iop_colorequal_ring_t dt_iop_colorequal_ring_t |
| Enumerator | |
|---|---|
| DT_IOP_COLOREQUAL_SATURATION | |
| DT_IOP_COLOREQUAL_HUE | |
| DT_IOP_COLOREQUAL_BRIGHTNESS | |
Definition at line 96 of file colorequal.c.
| Enumerator | |
|---|---|
| DT_IOP_COLOREQUAL_TETRAHEDRAL | |
| DT_IOP_COLOREQUAL_TRILINEAR | |
| DT_IOP_COLOREQUAL_PYRAMID | |
Definition at line 110 of file colorequal.c.
| Enumerator | |
|---|---|
| DT_IOP_COLOREQUAL_RING_DARK | |
| DT_IOP_COLOREQUAL_RING_MID | |
| DT_IOP_COLOREQUAL_RING_LIGHT | |
Definition at line 103 of file colorequal.c.
|
inlinestatic |
Definition at line 388 of file colorequal.c.
References _channel_from_page(), dt_conf_get_int(), DT_IOP_COLOREQUAL_NUM_CHANNELS, and g.
Referenced by _cacheline_ready_callback(), _draw_curve(), _preview_cache_wait_restart(), _ring_tabs_switch_callback(), button_pressed(), gui_post_expose(), mouse_leave(), mouse_moved(), and scrolled().
|
inlinestatic |
Definition at line 380 of file colorequal.c.
References dt_conf_get_int(), DT_IOP_COLOREQUAL_NUM_RINGS, and g.
Referenced by _cacheline_ready_callback(), _draw_curve(), _preview_cache_wait_restart(), _ring_tabs_switch_callback(), button_pressed(), gui_post_expose(), mouse_leave(), mouse_moved(), and scrolled().
|
static |
Definition at line 1431 of file colorequal.c.
References DT_IOP_COLOREQUAL_MIN_X_DISTANCE, k, selected, x, dt_iop_colorequal_node_t::x, and dt_iop_colorequal_node_t::y.
Referenced by _area_button_press_callback(), and button_pressed().
|
static |
Definition at line 1542 of file colorequal.c.
References _add_node(), _curve_nodes(), _curve_nodes_count(), _curve_nodes_count_const(), _find_selected_node(), _refresh_preview_cursor_sample(), _update_gui_lut_cache_throttled(), d, dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_colorrings_curve_periodic_sample(), dt_control_queue_redraw_center(), dt_dev_add_history_item, dt_gui_throttle_queue(), DT_IOP_COLOREQUAL_AXIS_HEIGHT, DT_IOP_COLOREQUAL_GRAPH_INSET, DT_IOP_COLOREQUAL_MAXNODES, dt_iop_gui_data(), dt_modifier_is(), DT_PRIMARY_MASK, FALSE, g, k, p, dt_iop_module_t::params, selected, and TRUE.
Referenced by gui_init().
|
static |
The final pointer release must always commit the last state to history, so the pixelpipes recompute even if another GUI refresh happens first. The LUT viewer is still throttled on its own source (&g->viewer_lut, a GUI-side cache with nothing to do with history); flush it here too so the viewer doesn't lag behind the released state either.
Definition at line 1641 of file colorequal.c.
References _update_gui_lut_cache(), dt_iop_module_t::dev, dt_dev_add_history_item, dt_gui_throttle_cancel(), dt_iop_gui_data(), FALSE, g, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 1498 of file colorequal.c.
References _find_selected_node(), _move_selected_node(), _refresh_preview_cursor_sample(), _update_gui_lut_cache_throttled(), dt_iop_module_t::dev, dt_control_queue_redraw_center(), dt_dev_add_history_item, dt_gui_throttle_queue(), DT_IOP_COLOREQUAL_AXIS_HEIGHT, DT_IOP_COLOREQUAL_GRAPH_INSET, dt_iop_gui_data(), FALSE, g, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
Build a procedural RGB CLUT from the three dt UCS HSB hue rings.
The editable control surface lives in dt UCS HSB because it gives uniform hue, saturation and brightness handles in the GUI. The CLUT itself however is authored in HLG Rec2020 code values, so the LUT generation never leaves those coordinates once the sparse before -> after ring samples have been turned into Rec2020 HLG RGB anchors.
The deformation model is:
This avoids assuming that the dt UCS hue rings become flat slices orthogonal to the RGB diagonal once projected into the LUT profile.
Sample every ring on 64 evenly-spaced hue positions. Those samples are the sparse control surface the user actually edits: one in-gamut source ring and one deformed destination ring, both expressed in the current work RGB.
The user edits hue and saturation in dt UCS HSB, so the local field must preserve that semantic separation in work RGB too:
When saturation expands beyond the cube shell, clamp the requested scale to the actually projected anchor so the sparse ring samples stay inside gamut.
The local field is evaluated in LUT code coordinates, so the smoothing sigmas belong to that geometry too:
Definition at line 559 of file colorequal.c.
References _channel_value_from_y(), _curve_nodes_const(), _curve_nodes_count_const(), d, dt_alloc_align_float(), dt_colorrings_brightness_to_axis_rgb(), dt_colorrings_compute_reference_saturations(), dt_colorrings_curve_periodic_sample(), dt_colorrings_curve_x_to_hue(), dt_colorrings_fill_lut_local_field(), dt_colorrings_graph_white(), dt_colorrings_hsb_to_profile_rgb(), dt_colorrings_project_to_cube_shell(), dt_colorrings_rgb_to_gray_cyl(), dt_colorrings_ring_brightness(), dt_colorrings_wrap_hue_pi(), dt_colorrings_wrap_pi(), DT_DEBUG_PERF, dt_get_debug_flags(), dt_get_wtime(), DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_CLUT_LEVEL, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_HUE_SAMPLES, DT_IOP_COLOREQUAL_LOCAL_FIELD_RINGS, DT_IOP_COLOREQUAL_NUM_RINGS, DT_IOP_COLOREQUAL_SATURATION, dt_print(), IS_NULL_PTR, p, value, and x.
Referenced by _update_gui_lut_cache(), and commit_params().
|
static |
The LUT viewer should display the same sparse control surface the local field actually interpolates. Rebuild the ring samples here from the GUI curves so the control-node overlay matches the authored RGB anchors exactly, not just the user-visible spline control points.
Definition at line 699 of file colorequal.c.
References _channel_value_from_y(), _curve_nodes_const(), _curve_nodes_count_const(), dt_colorrings_brightness_to_axis_rgb(), dt_colorrings_compute_reference_saturations(), dt_colorrings_curve_periodic_sample(), dt_colorrings_curve_x_to_hue(), dt_colorrings_graph_white(), dt_colorrings_hsb_to_profile_rgb(), dt_colorrings_project_to_cube_shell(), dt_colorrings_ring_brightness(), dt_colorrings_wrap_hue_pi(), DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_HUE_SAMPLES, DT_IOP_COLOREQUAL_NUM_RINGS, DT_IOP_COLOREQUAL_SATURATION, dt_lut_viewer_control_node_t::input_rgb, IS_NULL_PTR, dt_lut_viewer_control_node_t::output_rgb, p, and x.
Referenced by _update_gui_lut_cache().
|
static |
Definition at line 1373 of file colorequal.c.
References _active_channel_from_gui(), _active_ring_from_gui(), _refresh_preview_cursor_sample(), dt_control_queue_redraw_center(), dt_iop_gui_data(), g, and void().
Referenced by gui_cleanup(), and gui_focus().
|
inlinestatic |
Definition at line 366 of file colorequal.c.
References DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_NUM_CHANNELS, and DT_IOP_COLOREQUAL_SATURATION.
Referenced by _active_channel_from_gui().
|
static |
Definition at line 1672 of file colorequal.c.
References dt_conf_set_int(), dt_control_queue_redraw_center(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, dt_iop_gui_data(), g, and notebook.
Referenced by gui_init().
|
inlinestatic |
Definition at line 256 of file colorequal.c.
References DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_SATURATION, and M_PI_F.
Referenced by _build_clut(), _build_viewer_control_nodes(), _cursor_curve_state(), _graph_background_hsb(), and scrolled().
|
inlinestatic |
Definition at line 269 of file colorequal.c.
References DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_SATURATION, M_PI_F, and value.
Referenced by scrolled().
|
inlinestatic |
Definition at line 439 of file colorequal.c.
References RGB.
Referenced by _work_rgb_to_display_rgb().
|
inlinestatic |
Definition at line 404 of file colorequal.c.
References _channel_value_from_y(), _curve_nodes_const(), _curve_nodes_count_const(), dt_colorrings_curve_periodic_sample(), dt_colorrings_hue_to_curve_x(), DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_SATURATION, FALSE, IS_NULL_PTR, M_PI_F, p, TRUE, value, and x.
Referenced by _draw_curve(), and gui_post_expose().
|
inlinestatic |
Definition at line 342 of file colorequal.c.
References IS_NULL_PTR.
Referenced by _draw_curve(), _lut_fields_equal(), and gui_changed().
|
inlinestatic |
Definition at line 296 of file colorequal.c.
References p.
Referenced by _area_button_press_callback(), _move_selected_node(), _reset_channel_nodes(), button_pressed(), and scrolled().
|
inlinestatic |
Definition at line 303 of file colorequal.c.
References p.
Referenced by _build_clut(), _build_viewer_control_nodes(), _cursor_curve_state(), _draw_curve(), _find_selected_node(), and _update_curve_cache().
|
inlinestatic |
Definition at line 310 of file colorequal.c.
References p.
Referenced by _area_button_press_callback(), _reset_channel_nodes(), and button_pressed().
|
inlinestatic |
Definition at line 316 of file colorequal.c.
References p.
Referenced by _area_button_press_callback(), _build_clut(), _build_viewer_control_nodes(), _cursor_curve_state(), _draw_curve(), _find_selected_node(), _move_selected_node(), _update_curve_cache(), and scrolled().
|
inlinestatic |
Definition at line 360 of file colorequal.c.
Referenced by scrolled().
|
static |
Hue backgrounds need to keep the ring lightness cue readable across the three tabs. Pushing their saturation beyond the in-gamut reference sends more hues into the display normalization path, which flattens the intended 15/45/75% brightness separation. Keep the hue tab on the reference ring and only boost the other channels for contrast.
Definition at line 1153 of file colorequal.c.
References _active_channel_from_gui(), _active_ring_from_gui(), _cursor_curve_state(), _curve_fields_equal(), _curve_nodes_const(), _curve_nodes_count_const(), _draw_graph_background(), _update_curve_cache(), dt_iop_module_t::dev, dt_bauhaus_get_global(), dt_cairo_image_surface_create(), dt_colorrings_compute_reference_saturations(), dt_colorrings_curve_x_to_hue(), dt_colorrings_graph_white(), dt_colorrings_hsb_to_display_rgb(), dt_colorrings_hue_to_curve_x(), dt_colorrings_ring_brightness(), dt_draw_grid(), DT_IOP_COLOREQUAL_AXIS_HEIGHT, DT_IOP_COLOREQUAL_GRAPH_INSET, DT_IOP_COLOREQUAL_GRAPH_RES, DT_IOP_COLOREQUAL_HUE, dt_iop_gui_data(), dt_ioppr_get_pipe_output_profile_info(), DT_PIXEL_APPLY_DPI, g, k, M_PI_F, p, dt_develop_t::preview_pipe, RGB, set_color(), TRUE, x, dt_iop_colorequal_node_t::x, and dt_iop_colorequal_node_t::y.
Referenced by gui_init().
|
static |
Definition at line 1110 of file colorequal.c.
References __OMP_PARALLEL_FOR__, _graph_background_hsb(), colors, dt_alloc_align_float(), dt_colorrings_hsb_to_display_rgb(), dt_colorrings_ring_brightness(), dt_free_align, DT_IOP_COLOREQUAL_GRAPH_GRADIENTS, DT_IOP_COLOREQUAL_GRAPH_RES, k, and x.
Referenced by _draw_curve().
|
static |
Definition at line 1402 of file colorequal.c.
References _curve_nodes_const(), _curve_nodes_count_const(), dt_iop_gui_data(), DT_PIXEL_APPLY_DPI, g, k, p, selected, dt_iop_colorequal_node_t::x, and dt_iop_colorequal_node_t::y.
Referenced by _area_button_press_callback(), and _area_motion_notify_callback().
|
static |
The module-level picker reports where the sampled dt UCS brightness sits between the three editable rings, using the same fixed ring boundaries as the control surface. This gives users an immediate reading of which graph pair will mostly influence the picked color.
Definition at line 2130 of file colorequal.c.
Referenced by color_picker_apply().
|
inlinestatic |
Definition at line 1083 of file colorequal.c.
References _channel_value_from_y(), dt_colorrings_curve_x_to_hue(), dt_colorrings_wrap_hue_pi(), DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_SATURATION, and x.
Referenced by _draw_graph_background().
|
static |
Definition at line 335 of file colorequal.c.
References _reset_channel_nodes(), ch, DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, and p.
Referenced by init().
|
inlinestatic |
Definition at line 396 of file colorequal.c.
Referenced by _refresh_preview_cursor_sample(), mouse_leave(), and mouse_moved().
|
inlinestatic |
Definition at line 351 of file colorequal.c.
References _curve_fields_equal(), and IS_NULL_PTR.
Referenced by _update_gui_lut_cache(), and commit_params().
|
inlinestatic |
Definition at line 470 of file colorequal.c.
Referenced by _sample_ring_anchor().
|
static |
Definition at line 1465 of file colorequal.c.
References _curve_nodes(), _curve_nodes_count_const(), DT_IOP_COLOREQUAL_MIN_X_DISTANCE, dt_iop_gui_data(), FALSE, g, p, TRUE, x, dt_iop_colorequal_node_t::x, and dt_iop_colorequal_node_t::y.
Referenced by _area_motion_notify_callback().
|
static |
Definition at line 1985 of file colorequal.c.
References dt_colorrings_graph_white(), dt_colorrings_profile_rgb_to_dt_ucs_hsb(), dt_ioppr_get_pipe_current_profile_info(), IS_NULL_PTR, and RGB.
Referenced by _refresh_preview_cursor_sample(), and color_picker_apply().
|
static |
Definition at line 1977 of file colorequal.c.
References dt_colorrings_profile_rgb_to_Ych(), dt_ioppr_get_pipe_current_profile_info(), IS_NULL_PTR, and RGB.
Referenced by color_picker_apply().
|
static |
Definition at line 1388 of file colorequal.c.
References _active_channel_from_gui(), _active_ring_from_gui(), _refresh_preview_cursor_sample(), dt_control_queue_redraw_center(), dt_iop_gui_data(), g, and IS_NULL_PTR.
Referenced by _refresh_preview_cursor_sample().
|
static |
Definition at line 2024 of file colorequal.c.
References _invalidate_preview_cursor(), _pipe_rgb_to_dt_ucs_hsb(), _preview_cache_wait_restart(), _work_rgb_to_display_rgb(), dt_dev_pixelpipe_iop_t::buf_out, dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::datatype, dt_iop_module_t::dev, dt_dev_pixelpipe_iop_t::dsc_out, dt_colorrings_apply_rgb_lut(), dt_colorrings_project_to_cube_shell(), dt_colorrings_wrap_hue_pi(), dt_dev_coordinates_preview_abs_to_image_norm(), 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_cleanup(), dt_dev_pixelpipe_cache_wait_set_owner(), dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), dt_dev_pixelpipe_update_history_preview, dt_iop_gui_data(), dt_ioppr_get_pipe_current_profile_info(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_iop_module_t::enabled, FALSE, g, dt_dev_pixelpipe_iop_t::global_hash, dt_iop_roi_t::height, IS_NULL_PTR, neutral, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, dt_dev_pixelpipe_iop_t::roi_out, TRUE, TYPE_FLOAT, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _area_button_press_callback(), _area_motion_notify_callback(), _cacheline_ready_callback(), _preview_cache_wait_restart(), button_pressed(), gui_focus(), gui_post_expose(), mouse_moved(), and scrolled().
|
static |
Definition at line 323 of file colorequal.c.
References _curve_nodes(), _curve_nodes_count(), DT_IOP_COLOREQUAL_DEFAULT_NODES, k, p, dt_iop_colorequal_node_t::x, and dt_iop_colorequal_node_t::y.
Referenced by _init_default_curves().
|
inlinestatic |
Definition at line 282 of file colorequal.c.
References DT_IOP_COLOREQUAL_RING_DARK, DT_IOP_COLOREQUAL_RING_LIGHT, and DT_IOP_COLOREQUAL_RING_MID.
Referenced by gui_init().
|
static |
Definition at line 1698 of file colorequal.c.
References _active_channel_from_gui(), _active_ring_from_gui(), dt_conf_set_int(), dt_control_queue_redraw_center(), dt_gui_widgets_suppressed(), DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, dt_iop_gui_data(), and g.
Referenced by gui_init().
|
inlinestatic |
The editable hue rings are defined in dt UCS HSB brightness. We therefore sample them by that same brightness coordinate when extending the sparse ring displacements to the full RGB cube. Black and white stay fixed and provide the boundary conditions of the interpolation.
Definition at line 497 of file colorequal.c.
References _mix_rgb_anchors(), _sample_ring_hue(), dt_colorrings_brightness_to_axis_rgb(), dt_colorrings_ring_brightness(), DT_IOP_COLOREQUAL_NUM_RINGS, DT_IOP_COLOREQUAL_RING_DARK, DT_IOP_COLOREQUAL_RING_LIGHT, DT_IOP_COLOREQUAL_RING_MID, mix(), and RGB.
|
inlinestatic |
Definition at line 477 of file colorequal.c.
References dt_colorrings_wrap_hue_2pi(), DT_IOP_COLOREQUAL_HUE_SAMPLES, M_PI_F, mix(), and RGB.
Referenced by _sample_ring_anchor().
|
static |
Definition at line 1993 of file colorequal.c.
References dt_iop_module_t::dev, dt_control_get_global(), dt_control_hinter_message(), dt_control_queue_cursor_by_name(), dt_control_set_cursor_visible, dt_gui_main_window(), dt_iop_color_picker_is_visible(), dt_iop_gui_data(), dt_iop_module_t::enabled, FALSE, g, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, and TRUE.
Referenced by gui_focus(), mouse_leave(), and mouse_moved().
|
static |
Definition at line 1046 of file colorequal.c.
References _curve_nodes_const(), _curve_nodes_count_const(), ch, DT_DEBUG_PERF, dt_draw_curve_add_point(), dt_draw_curve_calc_values_V2(), dt_draw_curve_destroy(), dt_draw_curve_new(), dt_draw_curve_set_point(), dt_get_debug_flags(), dt_get_wtime(), DT_IOP_COLOREQUAL_GRAPH_RES, DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, dt_print(), g, k, MONOTONE_HERMITE, p, TRUE, dt_iop_colorequal_node_t::x, and dt_iop_colorequal_node_t::y.
Referenced by _draw_curve().
|
static |
GUI-thread only (called from gui_changed()/gui_update()): g->gui_params is live GUI state and must never be read from a pipeline thread (see commit_params(), which uses the historical params it is passed instead). g->viewer_lut is this instance's own gui_data, never shared with any other instance's viewer or with the pipeline's piece->data clut.
Definition at line 988 of file colorequal.c.
References _build_clut(), _build_viewer_control_nodes(), _lut_fields_equal(), dt_iop_module_t::dev, DT_COLORSPACE_HLG_REC2020, dt_colorspaces_add_profile(), DT_DEBUG_PERF, dt_get_debug_flags(), dt_get_wtime(), DT_INTENT_PERCEPTUAL, dt_iop_gui_data(), dt_ioppr_get_pipe_output_profile_info(), dt_lut_viewer_queue_draw(), dt_lut_viewer_set_control_nodes(), dt_lut_viewer_set_lut(), dt_print(), dt_iop_module_t::enabled, FALSE, g, IS_NULL_PTR, p, dt_iop_module_t::params, dt_develop_t::preview_pipe, and TRUE.
Referenced by _area_button_release_callback(), _update_gui_lut_cache_throttled(), and gui_changed().
|
static |
The curve-editing mouse handlers below don't go through gui_changed() (unlike bauhaus sliders, which the framework calls automatically) and drag motion can fire far too often to rebuild the LUT synchronously on every event – so they queue this instead. This is a GUI-side cache and has nothing to do with history: the pipeline recompute those same handlers trigger is batched by the history commit itself, not here.
Definition at line 1041 of file colorequal.c.
References _update_gui_lut_cache().
Referenced by _area_button_press_callback(), _area_motion_notify_callback(), button_pressed(), and scrolled().
|
static |
Definition at line 447 of file colorequal.c.
References _clamp_display_rgb(), dt_ioppr_get_pipe_current_profile_info(), dt_ioppr_get_pipe_output_profile_info(), dt_ioppr_transform_image_colorspace_rgb(), IS_NULL_PTR, and out.
Referenced by _refresh_preview_cursor_sample().
| const char * aliases | ( | ) |
Definition at line 224 of file colorequal.c.
| 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 2222 of file colorequal.c.
References __OMP_PARALLEL_FOR__, dt_iop_buffer_dsc_t::channels, dt_dev_pixelpipe_iop_t::dsc_in, dt_colorrings_profile_rgb_to_Ych(), dt_iop_gui_data(), dt_ioppr_get_pipe_current_profile_info(), g, dt_iop_roi_t::height, i, IS_NULL_PTR, k, max, p, dt_iop_module_t::params, dt_dev_pixelpipe_iop_t::roi_out, and dt_iop_roi_t::width.
| int button_pressed | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which, | ||
| int | type, | ||
| uint32_t | state | ||
| ) |
Definition at line 1794 of file colorequal.c.
References _active_channel_from_gui(), _active_ring_from_gui(), _add_node(), _curve_nodes(), _curve_nodes_count(), _refresh_preview_cursor_sample(), _update_gui_lut_cache_throttled(), dt_iop_module_t::dev, dt_colorrings_curve_periodic_sample(), dt_colorrings_hue_to_curve_x(), dt_control_queue_redraw_center(), dt_dev_add_history_item, dt_gui_throttle_queue(), dt_iop_color_picker_is_visible(), DT_IOP_COLOREQUAL_MAXNODES, dt_iop_gui_data(), dt_iop_module_t::enabled, FALSE, g, dt_iop_module_t::gui, dt_iop_module_gui_t::off, dt_iop_module_t::params, selected, and TRUE.
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 2507 of file colorequal.c.
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), dt_iop_colorequal_global_data_t::kernel_exposure, dt_iop_colorequal_global_data_t::kernel_lut3d_pyramid, dt_iop_colorequal_global_data_t::kernel_lut3d_tetrahedral, and dt_iop_colorequal_global_data_t::kernel_lut3d_trilinear.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 847 of file colorequal.c.
References d, dt_dev_pixelpipe_iop_t::data, dt_free_align, and IS_NULL_PTR.
| void color_picker_apply | ( | dt_iop_module_t * | self, |
| GtkWidget * | picker, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
The pipe sample is scene-linear working RGB and may be negative or far above diffuse white. The GUI rings however live on bounded dt UCS hue rings derived from RGB code values in [0, 1]. Project the normalized sample back to the RGB cube shell before converting it to dt UCS HSB so the marker reports where that color sits in the editable control space.
Definition at line 2154 of file colorequal.c.
References _format_picker_brightness_position(), _pipe_rgb_to_dt_ucs_hsb(), _pipe_rgb_to_Ych(), ch, dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_colorrings_project_to_cube_shell(), dt_colorrings_wrap_hue_pi(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, dt_iop_gui_data(), FALSE, g, neutral, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, dt_iop_module_t::picked_color_max, dt_iop_module_t::picked_color_min, RGB, and TRUE.
| 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 769 of file colorequal.c.
References _build_clut(), _lut_fields_equal(), d, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, DT_COLORSPACE_HLG_REC2020, dt_colorspaces_add_profile(), DT_INTENT_PERCEPTUAL, dt_ioppr_get_pipe_current_profile_info(), DT_LUT3D_INTERP_TETRAHEDRAL, dt_dev_pixelpipe_iop_t::enabled, FALSE, IS_NULL_PTR, p, and TRUE.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 246 of file colorequal.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 236 of file colorequal.c.
References IOP_GROUP_COLOR.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 229 of file colorequal.c.
References dt_iop_set_description().
| int flags | ( | ) |
Definition at line 241 of file colorequal.c.
References IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
Definition at line 2248 of file colorequal.c.
References _curve_fields_equal(), _update_gui_lut_cache(), ch, dt_control_queue_redraw_center(), DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, dt_iop_gui_data(), FALSE, g, p, and dt_iop_module_t::params.
Referenced by gui_update().
| void gui_cleanup | ( | dt_iop_module_t * | self | ) |
Definition at line 2313 of file colorequal.c.
References _cacheline_ready_callback(), ch, dt_conf_set_int(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, dt_dev_pixelpipe_cache_wait_cleanup(), dt_draw_curve_destroy(), dt_free_align, dt_gui_throttle_cancel(), DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, dt_iop_gui_data(), dt_lut_viewer_destroy(), DT_REQUEST_COLORPICK_OFF, FALSE, g, IOP_GUI_FREE, and dt_iop_module_t::request_color_pick.
| void gui_focus | ( | struct dt_iop_module_t * | self, |
| gboolean | in | ||
| ) |
Definition at line 2284 of file colorequal.c.
References _cacheline_ready_callback(), _refresh_preview_cursor_sample(), _switch_preview_cursor(), dt_iop_module_t::dev, dt_control_queue_redraw_center(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, dt_dev_pixelpipe_cache_wait_cleanup(), dt_iop_gui_data(), DT_PIXELPIPE_CACHE_HASH_INVALID, DT_SIGNAL_CACHELINE_READY, FALSE, g, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, and TRUE.
| void gui_init | ( | dt_iop_module_t * | self | ) |
Definition at line 2348 of file colorequal.c.
References _area_button_press_callback(), _area_button_release_callback(), _area_motion_notify_callback(), _channel_tabs_switch_callback(), _draw_curve(), _ring_label(), _ring_tabs_switch_callback(), ch, dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_soft_range(), DT_COLOR_PICKER_AREA, dt_color_picker_new(), dt_color_picker_new_with_cst(), dt_conf_get_int(), dt_gui_add_class(), DT_GUI_BOX_SPACING, dt_gui_freeze_begin, dt_gui_freeze_end, DT_GUI_MODULE, DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, DT_IOP_COLOREQUAL_SATURATION, dt_lut_viewer_get_widget(), dt_lut_viewer_new(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_ui_resizable_drawing_area(), FALSE, g, dt_iop_module_t::gui, IOP_CS_RGB, IOP_GUI_ALLOC, dt_iop_module_t::params, 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 1899 of file colorequal.c.
References _active_channel_from_gui(), _active_ring_from_gui(), _cursor_curve_state(), _refresh_preview_cursor_sample(), dt_iop_module_t::dev, dt_dev_get_overlay_scale(), dt_dev_rescale_roi(), dt_iop_color_picker_is_visible(), DT_IOP_COLOREQUAL_PREVIEW_CURSOR_RADIUS, dt_iop_gui_data(), DT_PIXEL_APPLY_DPI, dt_iop_module_t::enabled, g, height, IS_NULL_PTR, M_PI_F, and width.
| void gui_update | ( | dt_iop_module_t * | self | ) |
Definition at line 2266 of file colorequal.c.
References dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), dt_iop_gui_data(), g, gui_changed(), IS_NULL_PTR, p, and dt_iop_module_t::params.
| void init | ( | dt_iop_module_t * | module | ) |
Definition at line 2519 of file colorequal.c.
References _init_default_curves(), dt_iop_module_t::default_params, dt_iop_default_init(), dt_iop_module_t::params, and dt_iop_module_t::params_size.
| void init_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 2488 of file colorequal.c.
References dt_opencl_create_kernel(), dt_iop_colorequal_global_data_t::kernel_exposure, dt_iop_colorequal_global_data_t::kernel_lut3d_pyramid, dt_iop_colorequal_global_data_t::kernel_lut3d_tetrahedral, and dt_iop_colorequal_global_data_t::kernel_lut3d_trilinear.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 827 of file colorequal.c.
References d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, dt_calloc_align(), DT_LUT3D_INTERP_TETRAHEDRAL, and IS_NULL_PTR.
| int mouse_leave | ( | struct dt_iop_module_t * | self | ) |
Definition at line 1775 of file colorequal.c.
References _active_channel_from_gui(), _active_ring_from_gui(), _invalidate_preview_cursor(), _switch_preview_cursor(), dt_control_queue_cursor_by_name(), dt_control_queue_redraw_center(), dt_control_set_cursor_visible, dt_iop_gui_data(), FALSE, g, and TRUE.
| int mouse_moved | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 1727 of file colorequal.c.
References _active_channel_from_gui(), _active_ring_from_gui(), _invalidate_preview_cursor(), _refresh_preview_cursor_sample(), _switch_preview_cursor(), dt_iop_module_t::dev, dt_control_queue_redraw_center(), dt_dev_coordinates_image_norm_to_preview_abs(), dt_dev_coordinates_widget_to_image_norm(), dt_dev_roi_request_preview_height(), dt_dev_roi_request_preview_width(), dt_iop_color_picker_is_visible(), dt_iop_gui_data(), FALSE, g, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, TRUE, and x.
| const char * name | ( | ) |
Definition at line 219 of file colorequal.c.
| __DT_CLONE_TARGETS__ int process | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const void *const | ibuf, | ||
| void *const | obuf | ||
| ) |
Definition at line 936 of file colorequal.c.
References __OMP_PARALLEL_FOR__, ch, dt_iop_buffer_dsc_t::channels, d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::dsc_in, dt_iop_image_copy_by_size(), dt_ioppr_transform_image_colorspace_rgb(), dt_lut3d_apply(), height, dt_iop_roi_t::height, IS_NULL_PTR, k, out, dt_dev_pixelpipe_iop_t::roi_in, width, and dt_iop_roi_t::width.
| int process_cl | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| cl_mem | dev_in, | ||
| cl_mem | dev_out | ||
| ) |
Definition at line 859 of file colorequal.c.
References cleanup(), d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_t::devid, DT_DEBUG_OPENCL, dt_ioppr_transform_image_colorspace_rgb_cl(), DT_LUT3D_INTERP_PYRAMID, DT_LUT3D_INTERP_TRILINEAR, dt_opencl_copy_host_to_device_constant(), dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_print(), FALSE, dt_iop_module_t::global_data, height, dt_iop_roi_t::height, IS_NULL_PTR, kernel(), dt_iop_colorequal_global_data_t::kernel_exposure, dt_iop_colorequal_global_data_t::kernel_lut3d_pyramid, dt_iop_colorequal_global_data_t::kernel_lut3d_tetrahedral, dt_iop_colorequal_global_data_t::kernel_lut3d_trilinear, normalize(), dt_dev_pixelpipe_iop_t::roi_in, ROUNDUPDHT, ROUNDUPDWD, width, and dt_iop_roi_t::width.
| int scrolled | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| int | up, | ||
| uint32_t | state | ||
| ) |
Definition at line 1832 of file colorequal.c.
References _active_channel_from_gui(), _active_ring_from_gui(), _channel_value_from_y(), _channel_y_from_value(), _curve_nodes(), _curve_nodes_count_const(), _curve_periodic_distance(), _refresh_preview_cursor_sample(), _update_gui_lut_cache_throttled(), dt_iop_module_t::dev, dt_colorrings_hue_to_curve_x(), dt_control_queue_redraw_center(), dt_dev_add_history_item, dt_gui_throttle_queue(), dt_iop_color_picker_is_visible(), DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_SATURATION, DT_IOP_COLOREQUAL_SCROLL_HUE_STEP, DT_IOP_COLOREQUAL_SCROLL_HUE_STEP_COARSE, DT_IOP_COLOREQUAL_SCROLL_HUE_STEP_FINE, DT_IOP_COLOREQUAL_SCROLL_SIGMA, DT_IOP_COLOREQUAL_SCROLL_STEP, DT_IOP_COLOREQUAL_SCROLL_STEP_COARSE, DT_IOP_COLOREQUAL_SCROLL_STEP_FINE, dt_iop_gui_data(), dt_masks_get_visible_form(), dt_modifier_is(), DT_PRIMARY_MASK, dt_iop_module_t::enabled, FALSE, dt_develop_t::form_gui, g, dt_iop_module_t::gui, k, M_PI_F, dt_iop_module_gui_t::off, dt_iop_module_t::params, sigma, state, TRUE, value, weight(), x, and dt_iop_colorequal_node_t::y.