![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <math.h>#include <stdlib.h>#include <string.h>#include "bauhaus/bauhaus.h"#include "common/colorequal_shared.h"#include "common/chromatic_adaptation.h"#include "common/colorspaces_inline_conversions.h"#include "common/darktable.h"#include "common/imagebuf.h"#include "common/interpolation.h"#include "common/lut3d.h"#include "common/lut_viewer.h"#include "common/opencl.h"#include "control/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/imageop_math.h"#include "develop/pixelpipe_cache.h"#include "dtgtk/drawingarea.h"#include "gui/color_picker_proxy.h"#include "gui/draw.h"#include "gui/gtk.h"#include "gui/gui_throttle.h"#include "iop/iop_api.h"
Include dependency graph for colorequal.c: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 |
| #define DT_IOP_COLOREQUAL_AXIS_HEIGHT DT_PIXEL_APPLY_DPI(14) |
| #define DT_IOP_COLOREQUAL_CLUT_LEVEL 64 |
| #define DT_IOP_COLOREQUAL_DEFAULT_NODES 8 |
| #define DT_IOP_COLOREQUAL_GRAPH_GRADIENTS 48 |
| #define DT_IOP_COLOREQUAL_GRAPH_INSET DT_PIXEL_APPLY_DPI(4) |
| #define DT_IOP_COLOREQUAL_GRAPH_RES 360 |
| #define DT_IOP_COLOREQUAL_HUE_SAMPLES 64 |
| #define DT_IOP_COLOREQUAL_LOCAL_FIELD_RINGS (DT_IOP_COLOREQUAL_NUM_RINGS + 1) |
| #define DT_IOP_COLOREQUAL_MAXNODES 20 |
| #define DT_IOP_COLOREQUAL_MIN_X_DISTANCE 0.01f |
| #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.
| #define DT_IOP_COLOREQUAL_NUM_RINGS 3 |
| #define DT_IOP_COLOREQUAL_PREVIEW_CURSOR_RADIUS DT_PIXEL_APPLY_DPI(14.f) |
| #define DT_IOP_COLOREQUAL_SCROLL_STEP 0.05f |
| #define DT_IOP_COLOREQUAL_SCROLL_STEP_COARSE 0.10f |
| #define DT_IOP_COLOREQUAL_SCROLL_STEP_FINE 0.02f |
| #define DT_IOP_COLOREQUAL_VIEWER_CONTROL_NODES (DT_IOP_COLOREQUAL_NUM_RINGS * DT_IOP_COLOREQUAL_HUE_SAMPLES) |
| 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 |
|
inlinestatic |
References _channel_from_page(), dt_conf_get_int(), DT_IOP_COLOREQUAL_NUM_CHANNELS, and g.
Referenced by _cacheline_ready_callback(), _draw_curve(), _ring_tabs_switch_callback(), button_pressed(), gui_post_expose(), mouse_leave(), mouse_moved(), and scrolled().
|
inlinestatic |
References dt_conf_get_int(), DT_IOP_COLOREQUAL_NUM_RINGS, and g.
Referenced by _cacheline_ready_callback(), _draw_curve(), _ring_tabs_switch_callback(), button_pressed(), gui_post_expose(), mouse_leave(), mouse_moved(), and scrolled().
|
static |
References DT_IOP_COLOREQUAL_MIN_X_DISTANCE, k, x, dt_iop_colorequal_node_t::x, and dt_iop_colorequal_node_t::y.
Referenced by _area_button_press_callback(), and button_pressed().
|
static |
References _add_node(), _curve_nodes(), _curve_nodes_count(), _curve_nodes_count_const(), _find_selected_node(), _refresh_preview_cursor_sample(), d, dt_iop_module_t::default_params, dt_colorrings_curve_periodic_sample(), dt_control_queue_redraw_center(), dt_gui_throttle_queue(), DT_IOP_COLOREQUAL_AXIS_HEIGHT, DT_IOP_COLOREQUAL_GRAPH_INSET, DT_IOP_COLOREQUAL_MAXNODES, dt_iop_throttled_history_update(), dt_modifier_is(), FALSE, g, dt_iop_module_t::gui_data, k, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
Curve drags are throttled while the pointer moves, but the final pointer release must always commit the last state to history so the pixelpipes recompute even if another GUI refresh happens before the throttle timer expires.
References dt_gui_throttle_cancel(), dt_iop_throttled_history_update(), FALSE, g, dt_iop_module_t::gui_data, and TRUE.
Referenced by gui_init().
|
static |
References _find_selected_node(), _move_selected_node(), _refresh_preview_cursor_sample(), dt_control_queue_redraw_center(), dt_gui_throttle_queue(), DT_IOP_COLOREQUAL_AXIS_HEIGHT, DT_IOP_COLOREQUAL_GRAPH_INSET, dt_iop_throttled_history_update(), FALSE, g, dt_iop_module_t::gui_data, 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:
References _channel_value_from_y(), _curve_nodes_const(), _curve_nodes_count_const(), d, darktable, 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_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, darktable_t::unmuted, 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.
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 |
References _active_channel_from_gui(), _active_ring_from_gui(), _refresh_preview_cursor_sample(), dt_control_queue_redraw_center(), g, dt_iop_module_t::gui_data, and void().
Referenced by gui_cleanup(), and gui_focus().
|
inlinestatic |
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 |
References darktable, dt_conf_set_int(), dt_control_queue_redraw_center(), DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, g, darktable_t::gui, dt_iop_module_t::gui_data, and dt_gui_gtk_t::reset.
Referenced by gui_init().
|
inlinestatic |
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 |
References DT_IOP_COLOREQUAL_BRIGHTNESS, DT_IOP_COLOREQUAL_HUE, DT_IOP_COLOREQUAL_SATURATION, M_PI_F, and value.
Referenced by scrolled().
|
inlinestatic |
References RGB.
Referenced by _work_rgb_to_display_rgb().
|
inlinestatic |
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 |
References dt_iop_colorequal_params_t::curve, and dt_iop_colorequal_params_t::curve_num_nodes.
Referenced by _draw_curve(), _lut_fields_equal(), and gui_changed().
|
inlinestatic |
References p.
Referenced by _area_button_press_callback(), _move_selected_node(), _reset_channel_nodes(), button_pressed(), and scrolled().
|
inlinestatic |
References p.
Referenced by _build_clut(), _build_viewer_control_nodes(), _cursor_curve_state(), _draw_curve(), _find_selected_node(), and _update_curve_cache().
|
inlinestatic |
References p.
Referenced by _area_button_press_callback(), _reset_channel_nodes(), and button_pressed().
|
inlinestatic |
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 |
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.
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(), darktable_t::bauhaus, darktable, dt_iop_module_t::dev, 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_ioppr_get_pipe_output_profile_info(), DT_PIXEL_APPLY_DPI, g, dt_bauhaus_t::graph_bg, dt_bauhaus_t::graph_border, dt_bauhaus_t::graph_fg, dt_iop_module_t::gui_data, 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 |
|
static |
References _curve_nodes_const(), _curve_nodes_count_const(), DT_PIXEL_APPLY_DPI, g, dt_iop_module_t::gui_data, k, p, 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.
Referenced by color_picker_apply().
|
inlinestatic |
|
static |
References _reset_channel_nodes(), ch, DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, and p.
Referenced by init().
|
inlinestatic |
Referenced by _refresh_preview_cursor_sample(), mouse_leave(), and mouse_moved().
|
inlinestatic |
|
inlinestatic |
Referenced by _sample_ring_anchor().
|
static |
References _curve_nodes(), _curve_nodes_count_const(), DT_IOP_COLOREQUAL_MIN_X_DISTANCE, FALSE, g, dt_iop_module_t::gui_data, p, TRUE, x, dt_iop_colorequal_node_t::x, and dt_iop_colorequal_node_t::y.
Referenced by _area_motion_notify_callback().
|
static |
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 |
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 |
References _invalidate_preview_cursor(), _pipe_rgb_to_dt_ucs_hsb(), _work_rgb_to_display_rgb(), dt_dev_pixelpipe_iop_t::buf_out, dt_iop_buffer_dsc_t::channels, darktable, 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(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_get_module_piece(), dt_dev_pixelpipe_get_prev_enabled_piece(), dt_dev_pixelpipe_update_history_preview, dt_ioppr_get_pipe_current_profile_info(), DT_PIXELPIPE_CACHE_HASH_INVALID, dt_iop_module_t::enabled, FALSE, g, dt_iop_module_t::global_data, dt_dev_pixelpipe_iop_t::global_hash, dt_iop_module_t::gui_data, dt_iop_roi_t::height, IS_NULL_PTR, dt_iop_colorequal_global_data_t::lock, neutral, darktable_t::pixelpipe_cache, 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(), button_pressed(), gui_focus(), gui_post_expose(), mouse_moved(), and scrolled().
|
static |
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 |
References DT_IOP_COLOREQUAL_RING_DARK, DT_IOP_COLOREQUAL_RING_LIGHT, and DT_IOP_COLOREQUAL_RING_MID.
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.
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 |
References dt_colorrings_wrap_hue_2pi(), DT_IOP_COLOREQUAL_HUE_SAMPLES, M_PI_F, mix(), and RGB.
Referenced by _sample_ring_anchor().
|
static |
References darktable_t::control, darktable, dt_iop_module_t::dev, dt_control_change_cursor(), dt_control_hinter_message(), dt_control_set_cursor(), dt_iop_color_picker_is_visible(), dt_ui_main_window(), dt_iop_module_t::enabled, g, darktable_t::gui, dt_iop_module_t::gui_data, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, and dt_gui_gtk_t::ui.
Referenced by gui_focus(), mouse_leave(), and mouse_moved().
|
static |
References _curve_nodes_const(), _curve_nodes_count_const(), ch, darktable, 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_wtime(), DT_IOP_COLOREQUAL_GRAPH_RES, DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, dt_print(), g, k, MONOTONE_HERMITE, p, TRUE, darktable_t::unmuted, dt_iop_colorequal_node_t::x, and dt_iop_colorequal_node_t::y.
Referenced by _draw_curve().
|
static |
The authoritative CLUT lives in module-global data so pixelpipes and the GUI can reuse the same build. The viewer only receives that shared pointer plus the global read/write lock, which lets it read safely while the cache is rebuilt on parameter changes.
References _build_clut(), _build_viewer_control_nodes(), _lut_fields_equal(), dt_iop_colorequal_global_data_t::cache, dt_iop_colorequal_global_data_t::cache_generation, dt_iop_colorequal_global_data_t::cache_valid, dt_iop_colorequal_data_t::clut, dt_iop_colorequal_data_t::clut_level, darktable, dt_iop_module_t::dev, DT_COLORSPACE_HLG_REC2020, DT_DEBUG_PERF, dt_get_wtime(), DT_INTENT_PERCEPTUAL, dt_ioppr_add_profile_info_to_list(), 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_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, dt_pthread_rwlock_wrlock, dt_iop_module_t::enabled, FALSE, g, dt_iop_module_t::global_data, dt_iop_module_t::gui_data, IS_NULL_PTR, dt_iop_colorequal_global_data_t::lock, p, dt_iop_module_t::params, dt_iop_colorequal_global_data_t::params, dt_develop_t::preview_pipe, dt_iop_colorequal_data_t::reference_saturation, TRUE, and darktable_t::unmuted.
Referenced by commit_params().
|
static |
| const char * aliases | ( | ) |
| 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 | ||
| ) |
References __OMP_PARALLEL_FOR__, dt_iop_buffer_dsc_t::channels, dt_dev_pixelpipe_iop_t::dsc_in, dt_colorrings_profile_rgb_to_Ych(), dt_ioppr_get_pipe_current_profile_info(), g, dt_iop_module_t::gui_data, 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 | ||
| ) |
References _active_channel_from_gui(), _active_ring_from_gui(), _add_node(), _curve_nodes(), _curve_nodes_count(), _refresh_preview_cursor_sample(), darktable, dt_iop_module_t::dev, darktable_t::develop, dt_colorrings_curve_periodic_sample(), dt_colorrings_hue_to_curve_x(), dt_control_queue_redraw_center(), dt_dev_add_history_item, dt_iop_color_picker_is_visible(), DT_IOP_COLOREQUAL_MAXNODES, dt_iop_module_t::enabled, FALSE, g, dt_iop_module_t::gui_data, dt_iop_module_t::off, dt_iop_module_t::params, and TRUE.
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
References dt_iop_colorequal_global_data_t::cache, dt_iop_colorequal_data_t::clut, dt_iop_module_so_t::data, dt_free, dt_free_align, dt_opencl_free_kernel(), dt_pthread_rwlock_destroy, 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, and dt_iop_colorequal_global_data_t::lock.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References d, 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 | ||
| ) |
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.
References _format_picker_brightness_position(), _pipe_rgb_to_dt_ucs_hsb(), _pipe_rgb_to_Ych(), ch, darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_colorrings_project_to_cube_shell(), dt_colorrings_wrap_hue_pi(), dt_dev_add_history_item, DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, FALSE, g, darktable_t::gui, dt_iop_module_t::gui_data, 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, dt_gui_gtk_t::reset, 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 | ||
| ) |
References _build_clut(), _lut_fields_equal(), _update_gui_lut_cache(), dt_iop_colorequal_global_data_t::cache, dt_iop_colorequal_global_data_t::cache_generation, dt_iop_colorequal_global_data_t::cache_valid, dt_iop_colorequal_data_t::clut, dt_iop_colorequal_data_t::clut_level, d, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, DT_COLORSPACE_HLG_REC2020, DT_INTENT_PERCEPTUAL, dt_ioppr_add_profile_info_to_list(), dt_ioppr_get_pipe_current_profile_info(), DT_LUT3D_INTERP_TETRAHEDRAL, dt_pthread_rwlock_unlock, dt_pthread_rwlock_wrlock, g, dt_iop_module_t::global_data, dt_iop_module_t::gui_data, IS_NULL_PTR, dt_iop_colorequal_global_data_t::lock, p, dt_iop_colorequal_global_data_t::params, dt_iop_colorequal_data_t::reference_saturation, and TRUE.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References IOP_CS_RGB.
| int default_group | ( | ) |
References IOP_GROUP_COLOR.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
| int flags | ( | ) |
References IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
References _curve_fields_equal(), ch, dt_control_queue_redraw_center(), DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, FALSE, g, dt_iop_module_t::gui_data, p, and dt_iop_module_t::params.
Referenced by gui_update().
| void gui_cleanup | ( | dt_iop_module_t * | self | ) |
References _cacheline_ready_callback(), ch, darktable, dt_conf_set_int(), DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, dt_draw_curve_destroy(), dt_gui_throttle_cancel(), DT_IOP_COLOREQUAL_NUM_CHANNELS, DT_IOP_COLOREQUAL_NUM_RINGS, dt_lut_viewer_destroy(), DT_REQUEST_COLORPICK_OFF, FALSE, g, dt_iop_module_t::gui_data, IOP_GUI_FREE, dt_iop_module_t::request_color_pick, and darktable_t::signals.
| void gui_focus | ( | struct dt_iop_module_t * | self, |
| gboolean | in | ||
| ) |
References _cacheline_ready_callback(), _refresh_preview_cursor_sample(), _switch_preview_cursor(), darktable, dt_iop_module_t::dev, dt_control_queue_redraw_center(), DT_DEBUG_CONTROL_SIGNAL_CONNECT, DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, DT_PIXELPIPE_CACHE_HASH_INVALID, DT_SIGNAL_CACHELINE_READY, FALSE, g, dt_iop_module_t::gui_data, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, darktable_t::signals, and TRUE.
| void gui_init | ( | dt_iop_module_t * | self | ) |
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, darktable, dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_soft_range(), DT_BAUHAUS_SPACE, DT_COLOR_PICKER_AREA, dt_color_picker_new(), dt_color_picker_new_with_cst(), dt_conf_get_int(), dt_gui_add_class(), 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, dtgtk_drawing_area_new_with_aspect_ratio(), FALSE, g, darktable_t::gui, IOP_CS_RGB, IOP_GUI_ALLOC, dt_iop_module_t::params, dt_gui_gtk_t::reset, TRUE, and dt_iop_module_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 | ||
| ) |
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_PIXEL_APPLY_DPI, dt_iop_module_t::enabled, g, dt_iop_module_t::gui_data, height, M_PI_F, dt_develop_t::preview_pipe, dt_dev_pixelpipe_t::processing, and width.
| void gui_update | ( | dt_iop_module_t * | self | ) |
References dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), g, gui_changed(), dt_iop_module_t::gui_data, p, and dt_iop_module_t::params.
| void init | ( | dt_iop_module_t * | module | ) |
| void init_global | ( | dt_iop_module_so_t * | module | ) |
References dt_iop_colorequal_global_data_t::cache, dt_iop_colorequal_global_data_t::cache_generation, dt_iop_colorequal_global_data_t::cache_valid, dt_iop_colorequal_data_t::clut, dt_iop_colorequal_data_t::clut_level, dt_opencl_create_kernel(), dt_pthread_rwlock_init, FALSE, 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, dt_iop_colorequal_global_data_t::lock, dt_iop_colorequal_data_t::lut_profile, dt_iop_colorequal_global_data_t::params, dt_iop_colorequal_data_t::reference_saturation, dt_iop_colorequal_data_t::white_level, and dt_iop_colorequal_data_t::work_profile.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
| int mouse_leave | ( | struct dt_iop_module_t * | self | ) |
| int mouse_moved | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
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_iop_color_picker_is_visible(), FALSE, g, dt_iop_module_t::gui_data, dt_develop_t::preview_height, dt_develop_t::preview_pipe, dt_develop_t::preview_width, dt_dev_pixelpipe_t::processing, dt_develop_t::roi, TRUE, and x.
| const char * name | ( | ) |
| __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 | ||
| ) |
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(), dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, dt_iop_module_t::global_data, height, dt_iop_roi_t::height, IS_NULL_PTR, k, dt_iop_colorequal_global_data_t::lock, 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 | ||
| ) |
References dt_iop_colorequal_global_data_t::cache, cleanup(), dt_iop_colorequal_data_t::clut, 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(), dt_pthread_rwlock_rdlock, dt_pthread_rwlock_unlock, 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, dt_iop_colorequal_global_data_t::lock, 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 | ||
| ) |
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(), darktable, dt_iop_module_t::dev, darktable_t::develop, dt_colorrings_hue_to_curve_x(), dt_control_queue_redraw_center(), dt_dev_add_history_item, 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_modifier_is(), dt_iop_module_t::enabled, FALSE, g, dt_iop_module_t::gui_data, k, M_PI_F, dt_iop_module_t::off, dt_iop_module_t::params, sigma, state, TRUE, value, weight(), x, and dt_iop_colorequal_node_t::y.