![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/bauhaus.h"#include "common/paths.h"#include "widgets/collapsible_section.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/module_versioning.h"#include "math/homography.h"#include "pixel/chromatic_adaptation.h"#include "common/colorspaces_inline_conversions.h"#include "common/colorchecker.h"#include "math/matrices.h"#include "common/file_location.h"#include "pixel/illuminants.h"#include "common/imagebuf.h"#include "develop/dev_roi_request.h"#include "develop/iop_profile.h"#include "common/opencl.h"#include "control/control.h"#include "develop/imageop_gui.h"#include "math/openmp_maths.h"#include "math/gaussian_elimination.h"#include "gui/color_picker_proxy.h"#include "gui/presets.h"#include "iop/channelmixerrgb_shared.h"#include "iop/iop_api.h"#include <assert.h>#include <float.h>#include <gtk/gtk.h>#include <glib.h>#include <inttypes.h>#include <math.h>#include <stdlib.h>#include <string.h>#include <time.h>#include "widgets/label.h"#include "widgets/notebook.h"#include "gui/screen_metrics.h"#include "control/signal.h"
Include dependency graph for channelmixerrgb.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_channelmixer_rgb_params_t |
| struct | dt_iop_channelmixer_rgb_gui_data_t |
| struct | dt_iop_channelmixer_rbg_data_t |
| struct | dt_iop_channelmixer_rgb_global_data_t |
| struct | extraction_result_t |
| struct | dt_iop_channelmixer_rgb_box_map_t |
| The affine map taking chart bounding-box coordinates to the buffer process() was handed. More... | |
Enumerations | |
| enum | dt_iop_channelmixer_rgb_version_t { CHANNELMIXERRGB_V_1 = 0 , CHANNELMIXERRGB_V_2 = 1 , CHANNELMIXERRGB_V_3 = 2 } |
| enum | dt_solving_strategy_t { DT_SOLVE_OPTIMIZE_NONE = 0 , DT_SOLVE_OPTIMIZE_LOW_SAT = 1 , DT_SOLVE_OPTIMIZE_HIGH_SAT = 2 , DT_SOLVE_OPTIMIZE_SKIN = 3 , DT_SOLVE_OPTIMIZE_FOLIAGE = 4 , DT_SOLVE_OPTIMIZE_SKY = 5 , DT_SOLVE_OPTIMIZE_AVG_DELTA_E = 6 , DT_SOLVE_OPTIMIZE_MAX_DELTA_E = 7 } |
| enum | dt_spot_mode_t { DT_SPOT_MODE_CORRECT = 0 , DT_SPOT_MODE_MEASURE = 1 , DT_SPOT_MODE_LAST } |
| enum | dt_iop_channelmixer_rgb_mixer_mode_t { DT_CHANNELMIXERRGB_MIXER_COMPLETE = 0 , DT_CHANNELMIXERRGB_MIXER_SIMPLE = 1 , DT_CHANNELMIXERRGB_MIXER_PRIMARIES = 2 , DT_CHANNELMIXERRGB_MIXER_WHITE_PRESERVING = 3 } |
Functions | |
| void | _auto_set_illuminant (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe) |
| static void | _channelmixerrgb_set_mixer_mode (dt_iop_channelmixer_rgb_gui_data_t *g, dt_iop_channelmixer_rgb_mixer_mode_t mode) |
| const char * | name () |
| const char * | aliases () |
| const char ** | description (struct dt_iop_module_t *self) |
| int | flags () |
| int | default_group () |
| 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) |
| void | init_presets (dt_iop_module_so_t *self) |
| static __DT_CLONE_TARGETS__ int | _custom_wb_from_coeffs (struct dt_iop_module_t *self, const dt_aligned_pixel_t wb_coeffs, dt_aligned_pixel_t custom_wb) |
| static __DT_CLONE_TARGETS__ int | get_white_balance_coeff (struct dt_iop_module_t *self, dt_aligned_pixel_t custom_wb) |
| static | __attribute__ ((always_inline)) |
| __OMP_DECLARE_SIMD__ (aligned(input, saturation, lightness, output:16) uniform(version)) | |
| static __DT_CLONE_TARGETS__ void | loop_switch (const float *const restrict in, float *const restrict out, const size_t width, const size_t height, const size_t ch, const dt_colormatrix_t XYZ_to_RGB, const dt_colormatrix_t RGB_to_XYZ, const dt_colormatrix_t MIX, const dt_aligned_pixel_t illuminant, const dt_aligned_pixel_t saturation, const dt_aligned_pixel_t lightness, const dt_aligned_pixel_t grey, const float p, const float gamut, const int clip, const int apply_grey, const dt_adaptation_t kind, const dt_iop_channelmixer_rgb_version_t version) |
| static __DT_CLONE_TARGETS__ int | auto_detect_WB (const float *const restrict in, dt_illuminant_t illuminant, const size_t width, const size_t height, const size_t ch, const dt_colormatrix_t RGB_to_XYZ, dt_aligned_pixel_t xyz) |
| static __DT_CLONE_TARGETS__ void | declare_cat_on_pipe (struct dt_iop_module_t *self, gboolean preset) |
| static gboolean | _is_another_module_cat_on_pipe (struct dt_iop_module_t *self) |
| static void | update_illuminants (struct dt_iop_module_t *self) |
| static void | update_approx_cct (struct dt_iop_module_t *self) |
| static void | update_illuminant_color (struct dt_iop_module_t *self) |
| static void | compute_patches_delta_E (const float *const restrict patches, const dt_color_checker_t *const checker, float *const restrict delta_E, float *const restrict avg_delta_E, float *const restrict max_delta_E) |
| static dt_iop_channelmixer_rgb_box_map_t | _box_map (const dt_dev_pixelpipe_t *const pipe, const dt_iop_roi_t *const roi) |
| Derive that map from the request this pipe was planned from. | |
| static void | _map_homographies (const dt_iop_channelmixer_rgb_gui_data_t *const g, const dt_iop_channelmixer_rgb_box_map_t *const map, float forward[9], float backward[9]) |
| Compose the box->buffer map onto the chart homographies. | |
| static __DT_CLONE_TARGETS__ int | _extract_patches (const float *const restrict in, const dt_iop_roi_t *const roi_in, dt_iop_channelmixer_rgb_gui_data_t *g, const dt_iop_channelmixer_rgb_box_map_t *const box_map, const dt_colormatrix_t RGB_to_XYZ, const dt_colormatrix_t XYZ_to_CAM, float *const restrict patches, const gboolean normalize_exposure, extraction_result_t *result) |
| __DT_CLONE_TARGETS__ int | extract_color_checker (const float *const restrict in, float *const restrict out, const dt_iop_roi_t *const roi_in, dt_iop_channelmixer_rgb_gui_data_t *g, const dt_iop_channelmixer_rgb_box_map_t *const box_map, const dt_colormatrix_t RGB_to_XYZ, const dt_colormatrix_t XYZ_to_RGB, const dt_colormatrix_t XYZ_to_CAM, const dt_adaptation_t kind) |
| int | validate_color_checker (const float *const restrict in, const dt_iop_roi_t *const roi_in, dt_iop_channelmixer_rgb_gui_data_t *g, const dt_iop_channelmixer_rgb_box_map_t *const box_map, const dt_colormatrix_t RGB_to_XYZ, const dt_colormatrix_t XYZ_to_RGB, const dt_colormatrix_t XYZ_to_CAM) |
| 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) |
| 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) |
| void | init_global (dt_iop_module_so_t *module) |
| void | cleanup_global (dt_iop_module_so_t *module) |
| static void | update_bounding_box (dt_iop_channelmixer_rgb_gui_data_t *g, const float x_increment, const float y_increment) |
| static void | init_bounding_box (dt_iop_channelmixer_rgb_gui_data_t *g, const float width, const float height) |
| int | mouse_moved (struct dt_iop_module_t *self, double x, double y, double pressure, int which) |
| int | button_pressed (struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type, uint32_t state) |
| int | button_released (struct dt_iop_module_t *self, double x, double y, int which, uint32_t state) |
| 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) |
| static const dt_colorchecker_label_t * | _checker_label_from_combobox (GtkWidget *combobox, GList *labels) |
| Find the chart a combo box currently shows, in the label list backing that combo box. | |
| static void | _set_checker_from_labels (dt_iop_channelmixer_rgb_gui_data_t *g, const dt_colorchecker_label_t *checker_label, const dt_colorchecker_label_t *color_label) |
| Rebuild g->checker from the charts currently selected in both combo boxes. | |
| void | color_list_visibility (dt_iop_module_t *self, const dt_colorchecker_label_t *checker_label) |
| void | update_colorchecker_color_list (dt_iop_module_t *self) |
| This function filters the list of all .cht files to only those that match the currently selected colorchecker. | |
| void | update_colorchecker_list (dt_iop_module_t *self) |
| static void | optimize_changed_callback (GtkWidget *widget, gpointer user_data) |
| static void | checker_color_changed_callback (GtkWidget *widget, gpointer user_data) |
| void | checker_changed_callback (GtkWidget *widget, gpointer user_data) |
| static void | safety_changed_callback (GtkWidget *widget, gpointer user_data) |
| static void | start_profiling_callback (GtkWidget *togglebutton, dt_iop_module_t *self) |
| static void | run_profile_callback (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static void | run_validation_callback (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static void | commit_profile_callback (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static void | _develop_ui_pipe_finished_callback (gpointer instance, gpointer user_data) |
| static void | _preview_pipe_finished_callback (gpointer instance, gpointer user_data) |
| 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) |
| static void | update_xy_color (dt_iop_module_t *self) |
| static void | paint_hue (dt_iop_module_t *self) |
| static gboolean | _channelmixerrgb_sync_primaries_from_params (dt_iop_module_t *self, float *error) |
| Synchronize the primaries-mode GUI from the effective mixer matrix. | |
| static void | _channelmixerrgb_update_primaries_colors (dt_iop_module_t *self) |
| static gboolean | _channelmixerrgb_white_preserving_widgets (const dt_iop_channelmixer_rgb_gui_data_t *const g, GtkWidget *widgets[6]) |
| Collect the six white-preserving mode widgets. | |
| static gboolean | _channelmixerrgb_sync_white_preserving_from_params (dt_iop_module_t *self, float *error) |
| Synchronize the white-preserving mode GUI from the effective mixer matrix. | |
| static void | _channelmixerrgb_update_white_preserving_colors (dt_iop_module_t *self) |
| static void | _convert_GUI_colors (dt_iop_channelmixer_rgb_params_t *p, const struct dt_iop_order_iccprofile_info_t *const work_profile, const struct dt_iop_order_iccprofile_info_t *const display_profile, const dt_aligned_pixel_t LMS, dt_aligned_pixel_t RGB) |
| static void | _update_RGB_slider_stop (dt_iop_channelmixer_rgb_params_t *p, const struct dt_iop_order_iccprofile_info_t *const work_profile, const struct dt_iop_order_iccprofile_info_t *const display_profile, GtkWidget *w, float stop, float c, float r, float g, float b) |
| static void | _update_RGB_colors (dt_iop_module_t *self, float r, float g, float b, gboolean normalize, float *a, GtkWidget *w_r, GtkWidget *w_g, GtkWidget *w_b) |
| static gboolean | _channelmixerrgb_sync_simple_from_params (dt_iop_module_t *self, float *error) |
| Rebuild the simple mixer sliders from the current normalized 3x3 matrix. | |
| static void | _channelmixerrgb_update_simple_colors (dt_iop_module_t *self) |
| Paint the simple mixer sliders from the exact chroma-basis model. | |
| static gboolean | illuminant_color_draw (GtkWidget *widget, cairo_t *crf, gpointer user_data) |
| static gboolean | target_color_draw (GtkWidget *widget, cairo_t *crf, gpointer user_data) |
| static gboolean | origin_color_draw (GtkWidget *widget, cairo_t *crf, gpointer user_data) |
| static void | illum_xy_callback (GtkWidget *slider, gpointer user_data) |
| 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 | gui_reset (dt_iop_module_t *self) |
| void | gui_update (struct dt_iop_module_t *self) |
| void | init (dt_iop_module_t *module) |
| void | reload_defaults (dt_iop_module_t *module) |
| static void | _spot_settings_changed_callback (GtkWidget *slider, dt_iop_module_t *self) |
| static gboolean | _channelmixerrgb_push_matrix_to_params (dt_iop_module_t *self, const float M[3][3]) |
| Write a mixer matrix into the module params and mirror it on the complete-mode sliders. | |
| static void | _channelmixerrgb_reject_mixer_mode (dt_iop_module_t *self, const char *message) |
| Leave a reduced mixer mode that cannot represent the current matrix. | |
| static void | _channelmixerrgb_mixer_mode_callback (GtkWidget *combo, gpointer user_data) |
| static void | _channelmixerrgb_simple_slider_callback (GtkWidget *slider, gpointer user_data) |
| static void | _channelmixerrgb_primaries_slider_callback (GtkWidget *slider, gpointer user_data) |
| static void | _channelmixerrgb_white_preserving_slider_callback (GtkWidget *slider, gpointer user_data) |
| void | gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous) |
| void | color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| 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) |
| #define CHANNEL_SIZE 4 |
Definition at line 100 of file channelmixerrgb.c.
| #define CHROMA_MAX 128.0 |
Definition at line 108 of file channelmixerrgb.c.
| #define COLOR_MAX 2.0 |
Definition at line 103 of file channelmixerrgb.c.
| #define COLOR_MIN -2.0 |
Definition at line 102 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_PRIMARIES_BASIS_BRADFORD DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_BRADFORD |
Definition at line 189 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_PRIMARIES_BASIS_CAT16 DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_CAT16 |
Definition at line 190 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_PRIMARIES_BASIS_RGB DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_RGB |
Definition at line 187 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_PRIMARIES_BASIS_XYZ DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_XYZ |
Definition at line 188 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_SIMPLE_CHROMA_PROBE DT_IOP_CHANNELMIXER_SHARED_SIMPLE_CHROMA_PROBE |
Definition at line 114 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_SIMPLE_EPS DT_IOP_CHANNELMIXER_SHARED_SIMPLE_EPS |
Definition at line 113 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_SIMPLE_MODE_CONF "plugins/darkroom/channelmixerrgb/mixer_mode" |
Definition at line 111 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_SIMPLE_PROBE_AXIS_1 DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_1 |
Definition at line 185 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_SIMPLE_PROBE_AXIS_2 DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_2 |
Definition at line 186 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_SIMPLE_PROBE_ROTATION DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_ROTATION |
Definition at line 184 of file channelmixerrgb.c.
| #define DT_CHANNELMIXERRGB_SIMPLE_TAN_SCALE DT_IOP_CHANNELMIXER_SHARED_SIMPLE_TAN_SCALE |
Definition at line 112 of file channelmixerrgb.c.
| #define GET_WEIGHT |
Definition at line 1352 of file channelmixerrgb.c.
| #define HUE_MAX 360.0 |
Definition at line 107 of file channelmixerrgb.c.
| #define ILLUM_X_MAX 360.0 |
Definition at line 104 of file channelmixerrgb.c.
| #define ILLUM_Y_MAX 300.0 |
Definition at line 105 of file channelmixerrgb.c.
| #define INVERSE_SQRT_3 0.5773502691896258f |
Definition at line 101 of file channelmixerrgb.c.
| #define LIGHTNESS_MAX 100.0 |
Definition at line 106 of file channelmixerrgb.c.
| #define MIXER_ROW | ( | var, | |
| short, | |||
| section, | |||
| swap | |||
| ) |
| #define OFF 4 |
Definition at line 964 of file channelmixerrgb.c.
| #define OUTPUT_SECTION | ( | var, | |
| short, | |||
| section, | |||
| swap | |||
| ) |
Definition at line 963 of file channelmixerrgb.c.
| #define TEMP_MAX 25000. |
Definition at line 110 of file channelmixerrgb.c.
| #define TEMP_MIN 1667. |
Definition at line 109 of file channelmixerrgb.c.
| #define WHITE_PRESERVING_PRIMARY | ( | var, | |
| section, | |||
| rotation_label, | |||
| rotation_tooltip, | |||
| saturation_label, | |||
| saturation_tooltip | |||
| ) |
| typedef struct dt_iop_channelmixer_rbg_data_t dt_iop_channelmixer_rbg_data_t |
The affine map taking chart bounding-box coordinates to the buffer process() was handed.
g->box and both homographies are authored by the mouse handlers in PREVIEW-REQUEST pixels – dt_dev_coordinates_image_norm_to_preview_abs(), which is also the grid gui_post_expose() draws the overlay in. The buffer this module is handed is NOT guaranteed to be that grid, and nothing used to check: with "rendering size = full resolution" (darkroom/render_size == 0) iop/finalscale.c's modify_roi_in() forces scale = 1.0 for everything upstream of iop_order 65, this module included, so the pipe runs at 1:1 while the box is still at natural_scale. Indexing the buffer with box coordinates then reads a shrunken corner of the frame and the solver is fitted against patches that were never on the chart – with the overlay still drawn perfectly over the chart, because it uses the other grid.
| typedef struct dt_iop_channelmixer_rgb_params_t dt_iop_channelmixer_rgb_params_t |
Definition at line 179 of file channelmixerrgb.c.
Definition at line 181 of file channelmixerrgb.c.
Definition at line 180 of file channelmixerrgb.c.
Definition at line 178 of file channelmixerrgb.c.
| typedef dt_iop_channelmixer_shared_white_preserving_params_t dt_iop_channelmixer_rgb_white_preserving_params_t |
Definition at line 182 of file channelmixerrgb.c.
| typedef enum dt_solving_strategy_t dt_solving_strategy_t |
| typedef enum dt_spot_mode_t dt_spot_mode_t |
| Enumerator | |
|---|---|
| DT_CHANNELMIXERRGB_MIXER_COMPLETE | |
| DT_CHANNELMIXERRGB_MIXER_SIMPLE | |
| DT_CHANNELMIXERRGB_MIXER_PRIMARIES | |
| DT_CHANNELMIXERRGB_MIXER_WHITE_PRESERVING | |
Definition at line 170 of file channelmixerrgb.c.
| Enumerator | |
|---|---|
| CHANNELMIXERRGB_V_1 | |
| CHANNELMIXERRGB_V_2 | |
| CHANNELMIXERRGB_V_3 | |
Definition at line 116 of file channelmixerrgb.c.
Definition at line 150 of file channelmixerrgb.c.
| enum dt_spot_mode_t |
| Enumerator | |
|---|---|
| DT_SPOT_MODE_CORRECT | |
| DT_SPOT_MODE_MEASURE | |
| DT_SPOT_MODE_LAST | |
Definition at line 163 of file channelmixerrgb.c.
|
inlinestatic |
Definition at line 642 of file channelmixerrgb.c.
References delta, DT_ALIGNED_PIXEL, DT_FMA, NORM_MIN, v, and x.
| __OMP_DECLARE_SIMD__ | ( | aligned(input, saturation, lightness, output:16) uniform(version) | ) |
Definition at line 708 of file channelmixerrgb.c.
References CHANNELMIXERRGB_V_1, CHANNELMIXERRGB_V_3, DT_FMA, INVERSE_SQRT_3, mix(), and NORM_MIN.
| void _auto_set_illuminant | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe | ||
| ) |
Definition at line 4783 of file channelmixerrgb.c.
References adaptation, convert_D50_to_LMS(), dt_iop_module_t::dev, dt_bauhaus_combobox_get(), dt_bauhaus_combobox_set(), dt_bauhaus_slider_get(), dt_bauhaus_slider_set(), dt_conf_set_bool(), dt_conf_set_float(), DT_DEBUG_DEV, dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, DT_ILLUMINANT_CAMERA, DT_ILLUMINANT_CUSTOM, dt_iop_channelmixer_shared_paint_temperature_slider(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_ioppr_get_pipe_current_profile_info(), dt_Lab_to_XYZ(), dt_print(), DT_SPOT_MODE_CORRECT, DT_SPOT_MODE_MEASURE, dt_store_simd_aligned(), dt_XYZ_to_Lab(), dt_XYZ_to_sRGB(), g, get_white_balance_coeff(), i, illuminant_to_xy(), illuminant_xy_to_XYZ(), dt_develop_t::image_storage, IS_NULL_PTR, Lab, Lch, LMS, M_PI, matrice_pseudoinverse(), dt_iop_order_iccprofile_info_t::matrix_in, NORM_MIN, p, pack_3xSSE_to_3x3(), paint_hue(), 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, TEMP_MAX, TEMP_MIN, transpose_3x3_to_3xSSE(), TRUE, update_approx_cct(), update_illuminant_color(), update_illuminants(), x, xyY, and XYZ.
Referenced by _spot_settings_changed_callback(), and color_picker_apply().
|
inlinestatic |
Derive that map from the request this pipe was planned from.
The pipe's LATCHED request, not the live one: this runs on the pipeline thread, and the mapping has to describe the frame this iteration actually produced.
Definition at line 1398 of file channelmixerrgb.c.
References dt_dev_roi_request_of_pipe(), dt_iop_roi_t::height, dt_dev_roi_request_t::preview_height, dt_dev_roi_request_t::preview_width, dt_iop_channelmixer_rgb_box_map_t::scale_x, dt_iop_channelmixer_rgb_box_map_t::scale_y, dt_dev_roi_request_t::valid, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by process().
Definition at line 4318 of file channelmixerrgb.c.
References _channelmixerrgb_push_matrix_to_params(), _channelmixerrgb_reject_mixer_mode(), _channelmixerrgb_set_mixer_mode(), _channelmixerrgb_sync_primaries_from_params(), _channelmixerrgb_sync_simple_from_params(), _channelmixerrgb_sync_white_preserving_from_params(), dt_iop_module_t::dev, dt_bauhaus_combobox_get(), dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), DT_CHANNELMIXERRGB_MIXER_COMPLETE, DT_CHANNELMIXERRGB_MIXER_PRIMARIES, DT_CHANNELMIXERRGB_MIXER_SIMPLE, DT_CHANNELMIXERRGB_MIXER_WHITE_PRESERVING, DT_CHANNELMIXERRGB_SIMPLE_MODE_CONF, dt_conf_set_int(), dt_control_log(), DT_DEBUG_DEV, dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_channelmixer_shared_get_matrix(), dt_iop_gui_data(), dt_print(), error(), FALSE, g, gui_changed(), M, normalize(), p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 4486 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_log(), DT_DEBUG_DEV, dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_channelmixer_shared_primaries_basis_from_adaptation(), dt_iop_channelmixer_shared_primaries_from_sliders(), dt_iop_channelmixer_shared_primaries_to_matrix(), dt_iop_gui_data(), dt_print(), FALSE, g, gui_changed(), M, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
Write a mixer matrix into the module params and mirror it on the complete-mode sliders.
The reduced mixer models describe the EFFECTIVE matrix, which the row normalization toggles would otherwise rescale a second time, so those toggles are cleared here.
| [in] | self | Current module instance. |
| [in] | M | Mixer matrix to commit. |
Definition at line 4264 of file channelmixerrgb.c.
References dt_bauhaus_slider_set(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_gui_data(), FALSE, g, M, p, and dt_iop_module_t::params.
Referenced by _channelmixerrgb_mixer_mode_callback(), and _channelmixerrgb_white_preserving_slider_callback().
|
static |
Leave a reduced mixer mode that cannot represent the current matrix.
| [in] | self | Current module instance. |
| [in] | message | User-facing reason, already translated. |
Definition at line 4306 of file channelmixerrgb.c.
References _channelmixerrgb_set_mixer_mode(), dt_bauhaus_combobox_set(), DT_CHANNELMIXERRGB_MIXER_COMPLETE, DT_CHANNELMIXERRGB_SIMPLE_MODE_CONF, dt_conf_set_int(), dt_control_log(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_gui_data(), and g.
Referenced by _channelmixerrgb_mixer_mode_callback().
|
static |
Definition at line 4244 of file channelmixerrgb.c.
References DT_CHANNELMIXERRGB_MIXER_PRIMARIES, DT_CHANNELMIXERRGB_MIXER_SIMPLE, DT_CHANNELMIXERRGB_MIXER_WHITE_PRESERVING, and g.
Referenced by _channelmixerrgb_mixer_mode_callback(), _channelmixerrgb_reject_mixer_mode(), gui_changed(), and gui_update().
|
static |
Definition at line 4441 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), DT_DEBUG_DEV, dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_channelmixer_shared_simple_from_sliders(), dt_iop_channelmixer_shared_simple_to_matrix(), dt_iop_gui_data(), dt_print(), g, gui_changed(), M, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
Synchronize the primaries-mode GUI from the effective mixer matrix.
| [in] | self | Current module instance. |
| [out] | error | Largest absolute coefficient error after a full roundtrip. |
Definition at line 3467 of file channelmixerrgb.c.
References DT_CHANNELMIXERRGB_SIMPLE_EPS, dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_channelmixer_shared_get_matrix(), dt_iop_channelmixer_shared_primaries_basis_from_adaptation(), dt_iop_channelmixer_shared_primaries_from_matrix(), dt_iop_channelmixer_shared_primaries_to_matrix(), dt_iop_channelmixer_shared_primaries_to_sliders(), dt_iop_channelmixer_shared_roundtrip_error(), dt_iop_gui_data(), error(), FALSE, g, IS_NULL_PTR, M, normalize(), p, and dt_iop_module_t::params.
Referenced by _channelmixerrgb_mixer_mode_callback(), gui_changed(), and gui_update().
|
static |
Rebuild the simple mixer sliders from the current normalized 3x3 matrix.
| [in] | self | Current module instance. |
| [out] | error | Largest absolute roundtrip error after 3x3 -> simple -> 3x3. |
Definition at line 3671 of file channelmixerrgb.c.
References DT_CHANNELMIXERRGB_SIMPLE_EPS, dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_channelmixer_shared_get_matrix(), dt_iop_channelmixer_shared_roundtrip_error(), dt_iop_channelmixer_shared_rows_are_normalized(), dt_iop_channelmixer_shared_simple_from_matrix(), dt_iop_channelmixer_shared_simple_to_matrix(), dt_iop_channelmixer_shared_simple_to_sliders(), dt_iop_gui_data(), error(), FALSE, g, IS_NULL_PTR, M, normalize(), p, and dt_iop_module_t::params.
Referenced by _channelmixerrgb_mixer_mode_callback(), gui_changed(), and gui_update().
|
static |
Synchronize the white-preserving mode GUI from the effective mixer matrix.
| [in] | self | Current module instance. |
| [out] | error | Largest coefficient error after a full roundtrip, relative to the matrix. |
Definition at line 3549 of file channelmixerrgb.c.
References _channelmixerrgb_white_preserving_widgets(), DT_CHANNELMIXERRGB_SIMPLE_EPS, dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_channelmixer_shared_get_matrix(), dt_iop_channelmixer_shared_primaries_basis_from_adaptation(), dt_iop_channelmixer_shared_roundtrip_error_relative(), dt_iop_channelmixer_shared_white_preserving_from_matrix(), dt_iop_channelmixer_shared_white_preserving_to_matrix(), dt_iop_channelmixer_shared_white_preserving_to_sliders(), dt_iop_gui_data(), error(), FALSE, g, IS_NULL_PTR, M, normalize(), p, and dt_iop_module_t::params.
Referenced by _channelmixerrgb_mixer_mode_callback(), _channelmixerrgb_white_preserving_slider_callback(), gui_changed(), and gui_update().
|
static |
Definition at line 3498 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_iop_channelmixer_shared_paint_primaries_sliders(), dt_iop_channelmixer_shared_primaries_basis_from_adaptation(), dt_iop_channelmixer_shared_primaries_from_sliders(), dt_iop_gui_data(), dt_ioppr_get_pipe_output_profile_info(), dt_ioppr_get_pipe_work_profile_info(), g, p, dt_iop_module_t::params, and dt_develop_t::pipe.
Referenced by gui_changed().
|
static |
Paint the simple mixer sliders from the exact chroma-basis model.
Each slider is swept independently while the others keep their current values. We probe the resulting mixer on representative chroma-plane vectors, then convert that module-space pseudo color to the actual display profile so the slider background matches the active darkroom display transform.
| [in] | self | Current module instance. |
Definition at line 3713 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_iop_channelmixer_shared_paint_simple_sliders(), dt_iop_channelmixer_shared_simple_from_sliders(), dt_iop_gui_data(), dt_ioppr_get_pipe_output_profile_info(), dt_ioppr_get_pipe_work_profile_info(), g, p, dt_iop_module_t::params, and dt_develop_t::pipe.
Referenced by gui_changed().
|
static |
Definition at line 3578 of file channelmixerrgb.c.
References _channelmixerrgb_white_preserving_widgets(), dt_iop_module_t::dev, dt_iop_channelmixer_shared_paint_white_preserving_sliders(), dt_iop_channelmixer_shared_primaries_basis_from_adaptation(), dt_iop_channelmixer_shared_white_preserving_from_sliders(), dt_iop_gui_data(), dt_ioppr_get_pipe_output_profile_info(), dt_ioppr_get_pipe_work_profile_info(), g, p, dt_iop_module_t::params, and dt_develop_t::pipe.
Referenced by gui_changed().
|
static |
Definition at line 4542 of file channelmixerrgb.c.
References _channelmixerrgb_push_matrix_to_params(), _channelmixerrgb_sync_white_preserving_from_params(), _channelmixerrgb_white_preserving_widgets(), dt_iop_module_t::dev, dt_control_log(), DT_DEBUG_DEV, dt_dev_add_history_item, dt_gui_widgets_suppressed(), dt_iop_channelmixer_shared_primaries_basis_from_adaptation(), dt_iop_channelmixer_shared_white_preserving_from_sliders(), dt_iop_channelmixer_shared_white_preserving_to_matrix(), dt_iop_gui_data(), dt_print(), g, gui_changed(), M, p, dt_iop_module_t::params, and TRUE.
|
static |
Collect the six white-preserving mode widgets.
| [in] | g | Current module GUI data. |
| [out] | widgets | Rotation/saturation pairs, in red, green, blue order. |
Definition at line 3525 of file channelmixerrgb.c.
References FALSE, g, IS_NULL_PTR, and TRUE.
Referenced by _channelmixerrgb_sync_white_preserving_from_params(), _channelmixerrgb_update_white_preserving_colors(), _channelmixerrgb_white_preserving_slider_callback(), and gui_changed().
|
static |
Find the chart a combo box currently shows, in the label list backing that combo box.
Charts are matched on the displayed name, never on a position: the list of available charts is rebuilt at runtime from the built-in ones and from the .cht files the user installed, so an index saved in a conf key means nothing on the next run – delete a reference file, or add a built-in chart, and every later index shifts. The name is the only stable identity we have.
| combobox | The combo box holding the chart names. |
| labels | The dt_colorchecker_label_t list the combo box was populated from. |
Definition at line 2742 of file channelmixerrgb.c.
References dt_bauhaus_combobox_get(), dt_bauhaus_combobox_get_entry(), IS_NULL_PTR, dt_colorchecker_label_t::name, and name().
Referenced by checker_changed_callback(), checker_color_changed_callback(), gui_update(), and update_colorchecker_color_list().
|
static |
Definition at line 3597 of file channelmixerrgb.c.
References DT_ADAPTATION_RGB, dt_iop_channelmixer_shared_work_rgb_to_display(), LMS, p, and RGB.
Referenced by _update_RGB_slider_stop().
|
static |
Definition at line 580 of file channelmixerrgb.c.
References dt_image_t::adobe_XYZ_to_CAM, dt_image_t::d65_color_matrix, dt_iop_module_t::dev, dt_colorspaces_conversion_matrices_rgb(), DT_IMAGE_4BAYER, dt_image_is_matrix_correction_supported(), dt_image_pipe_class(), dt_image_pipe_class_name(), dt_iop_fmt_log, dt_image_t::flags, dt_develop_t::image_storage, and k.
Referenced by commit_params(), get_white_balance_coeff(), process(), and process_cl().
|
static |
Definition at line 3063 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), DT_DEBUG_DEV, dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, DT_ILLUMINANT_DETECT_EDGES, DT_ILLUMINANT_DETECT_SURFACES, dt_iop_channelmixer_shared_paint_temperature_slider(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_print(), g, gui_changed(), IS_NULL_PTR, Lch, M_PI, p, dt_iop_module_t::params, TEMP_MAX, TEMP_MIN, TRUE, update_approx_cct(), update_illuminant_color(), update_illuminants(), and xyY.
Referenced by gui_cleanup(), and gui_init().
|
static |
Definition at line 1449 of file channelmixerrgb.c.
References _map_homographies(), apply_homography(), extraction_result_t::black, dt_alloc_align_float(), dt_control_log(), DT_DEBUG_ALWAYS, DT_DEBUG_DEV, dt_Lab_to_XYZ(), dt_print(), extraction_result_t::exposure, g, height, dt_iop_roi_t::height, homography(), i, IS_NULL_PTR, k, dt_iop_channelmixer_rgb_box_map_t::offset_x, dt_iop_channelmixer_rgb_box_map_t::offset_y, dt_iop_channelmixer_rgb_box_map_t::scale_x, dt_iop_channelmixer_rgb_box_map_t::scale_y, width, dt_iop_roi_t::width, x, point_t::x, XYZ, and point_t::y.
Referenced by extract_color_checker(), and validate_color_checker().
|
inlinestatic |
Definition at line 1159 of file channelmixerrgb.c.
References dt_develop_t::chroma_adaptation, dt_iop_module_t::dev, dt_iop_gui_data(), FALSE, g, IS_NULL_PTR, and dt_develop_t::proxy.
|
inlinestatic |
Compose the box->buffer map onto the chart homographies.
| [out] | forward | ideal chart coordinates -> buffer pixels |
| [out] | backward | buffer pixels -> ideal chart coordinates |
Definition at line 1422 of file channelmixerrgb.c.
References g, dt_iop_channelmixer_rgb_box_map_t::offset_x, dt_iop_channelmixer_rgb_box_map_t::offset_y, r, dt_iop_channelmixer_rgb_box_map_t::scale_x, and dt_iop_channelmixer_rgb_box_map_t::scale_y.
Referenced by _extract_patches().
|
static |
Definition at line 3105 of file channelmixerrgb.c.
References dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), and g.
Referenced by gui_cleanup(), and gui_init().
|
static |
Rebuild g->checker from the charts currently selected in both combo boxes.
| g | The module GUI data. |
| checker_label | The chart label, NULL to fall back on the default built-in chart. |
| color_label | The CGATS reference values label, NULL for a built-in chart. |
Definition at line 2762 of file channelmixerrgb.c.
References COLOR_CHECKER_XRITE_24_2000, dt_colorchecker_cleanup(), dt_get_color_checker(), g, IS_NULL_PTR, dt_colorchecker_label_t::path, and dt_colorchecker_label_t::type.
Referenced by checker_changed_callback(), checker_color_changed_callback(), and gui_update().
|
static |
Definition at line 4211 of file channelmixerrgb.c.
References _auto_set_illuminant(), dt_iop_module_t::dev, dt_bauhaus_combobox_get(), dt_bauhaus_slider_get(), dt_conf_set_bool(), dt_conf_set_float(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_color_picker_is_active_module(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_SPOT_MODE_CORRECT, g, paint_hue(), and dt_develop_t::pipe.
Referenced by gui_init().
|
static |
Definition at line 3629 of file channelmixerrgb.c.
References _update_RGB_slider_stop(), COLOR_MAX, COLOR_MIN, dt_iop_module_t::dev, DT_BAUHAUS_SLIDER_MAX_STOPS, dt_ioppr_get_pipe_output_profile_info(), dt_ioppr_get_pipe_work_profile_info(), g, i, normalize(), p, dt_iop_module_t::params, dt_develop_t::pipe, r, RGB, and x.
Referenced by gui_changed().
|
static |
Definition at line 3616 of file channelmixerrgb.c.
References _convert_GUI_colors(), dt_bauhaus_slider_set_stop(), g, LMS, p, and r.
Referenced by _update_RGB_colors().
| const char * aliases | ( | ) |
Definition at line 294 of file channelmixerrgb.c.
|
inlinestatic |
Detect the chromaticity of the illuminant based on the grey edges hypothesis. So we compute a laplacian filter and get the weighted average of its chromaticities
Inspired by : A Fast White Balance Algorithm Based on Pixel Greyness, Ba Thai·Guang Deng·Robert Ross https://www.researchgate.net/profile/Ba_Son_Thai/publication/308692177_A_Fast_White_Balance_Algorithm_Based_on_Pixel_Greyness/
Edge-Based Color Constancy, Joost van de Weijer, Theo Gevers, Arjan Gijsenij https://hal.inria.fr/inria-00548686/document
Definition at line 967 of file channelmixerrgb.c.
References __OMP_PARALLEL_FOR__, ch, DT_ALIGNED_PIXEL, DT_ILLUMINANT_DETECT_EDGES, DT_ILLUMINANT_DETECT_SURFACES, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, for_each_channel, height, i, illuminant, IS_NULL_PTR, NORM_MIN, OFF, p, RGB, SHF, weight(), width, xyY, and XYZ.
Referenced by process().
| 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 5070 of file channelmixerrgb.c.
References __OMP_PARALLEL_FOR__, dt_iop_buffer_dsc_t::channels, convert_D50_to_LMS(), dt_dev_pixelpipe_iop_t::dsc_in, dt_conf_get_float(), dt_conf_key_exists(), DT_ILLUMINANT_CUSTOM, dt_ioppr_get_pipe_current_profile_info(), dt_Lab_to_XYZ(), dt_store_simd_aligned(), dt_iop_roi_t::height, i, IS_NULL_PTR, k, LMS, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, matrice_pseudoinverse(), dt_iop_order_iccprofile_info_t::matrix_in_transposed, dt_iop_order_iccprofile_info_t::nonlinearlut, NORM_MIN, p, pack_3xSSE_to_3x3(), dt_iop_module_t::params, dt_dev_pixelpipe_iop_t::roi_out, transpose_3x3_to_3xSSE(), dt_iop_roi_t::width, and XYZ.
| 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 2474 of file channelmixerrgb.c.
References 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_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_module_t::enabled, FALSE, g, init_bounding_box(), IS_NULL_PTR, TRUE, type, and x.
| int button_released | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| int | which, | ||
| uint32_t | state | ||
| ) |
Definition at line 2523 of file channelmixerrgb.c.
References 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_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_module_t::enabled, FALSE, g, IS_NULL_PTR, update_bounding_box(), and x.
Definition at line 2911 of file channelmixerrgb.c.
References _checker_label_from_combobox(), _set_checker_from_labels(), color_list_visibility(), dt_iop_module_t::dev, dt_conf_set_string(), dt_control_queue_redraw_center(), dt_dev_roi_request_preview_height(), dt_dev_roi_request_preview_width(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), FALSE, g, init_bounding_box(), IS_NULL_PTR, dt_colorchecker_label_t::name, and update_colorchecker_color_list().
Referenced by gui_init().
Definition at line 2886 of file channelmixerrgb.c.
References _checker_label_from_combobox(), _set_checker_from_labels(), dt_iop_module_t::dev, dt_conf_set_string(), dt_control_queue_redraw_center(), dt_dev_roi_request_preview_height(), dt_dev_roi_request_preview_width(), dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), FALSE, g, init_bounding_box(), IS_NULL_PTR, and dt_colorchecker_label_t::name.
Referenced by gui_init().
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 2332 of file channelmixerrgb.c.
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_bradford_full, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_bradford_linear, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_cat16, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_rgb, and dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_xyz.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 3947 of file channelmixerrgb.c.
References dt_develop_t::chroma_adaptation, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, dt_free_align, and dt_develop_t::proxy.
| void color_list_visibility | ( | dt_iop_module_t * | self, |
| const dt_colorchecker_label_t * | checker_label | ||
| ) |
Definition at line 2772 of file channelmixerrgb.c.
References COLOR_CHECKER_USER_REF, dt_bauhaus_combobox_get_entry(), dt_iop_gui_data(), g, IS_NULL_PTR, and dt_colorchecker_label_t::type.
Referenced by checker_changed_callback(), and gui_update().
| void color_picker_apply | ( | dt_iop_module_t * | self, |
| GtkWidget * | picker, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 5062 of file channelmixerrgb.c.
References _auto_set_illuminant(), DT_DEBUG_DEV, dt_gui_widgets_suppressed(), and dt_print().
| 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 3115 of file channelmixerrgb.c.
References _custom_wb_from_coeffs(), CHANNEL_SIZE, CHANNELMIXERRGB_V_1, dt_iop_buffer_dsc_t::coeffs, d, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, dt_dev_pixelpipe_t::dev, dt_dev_pixelpipe_iop_t::dsc_in, DT_DEV_PIXELPIPE_FULL, DT_DEV_PIXELPIPE_PREVIEW, DT_ILLUMINANT_CAMERA, DT_ILLUMINANT_DETECT_EDGES, DT_ILLUMINANT_DETECT_SURFACES, dt_image_is_matrix_correction_supported(), dt_image_pipe_class(), dt_image_pipe_class_name(), dt_iop_fmt_log, dt_iop_gui_data(), dt_store_simd_aligned(), g, dt_develop_t::gui_attached, i, illuminant_to_xy(), illuminant_xy_to_XYZ(), dt_develop_t::image_storage, p, dt_dev_pixelpipe_iop_t::process_cl_ready, dt_dev_pixelpipe_iop_t::process_tiling_ready, dt_iop_buffer_dsc_t::temperature, dt_dev_pixelpipe_t::type, x, and XYZ.
|
static |
Definition at line 3003 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), DT_DEBUG_DEV, dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), DT_ILLUMINANT_CUSTOM, dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_print(), g, gui_changed(), Lch, M_PI, p, dt_iop_module_t::params, TRUE, and xyY.
Referenced by gui_init().
|
inlinestatic |
Definition at line 1239 of file channelmixerrgb.c.
References DEG_TO_RAD, dt_XYZ_to_Lab(), k, dt_color_checker_patch::Lab, M_PI, dt_color_checker_t::patches, RAD_TO_DEG, and dt_color_checker_t::values.
Referenced by extract_color_checker(), and validate_color_checker().
|
static |
Definition at line 1122 of file channelmixerrgb.c.
References dt_develop_t::chroma_adaptation, dt_iop_module_t::dev, DT_ADAPTATION_RGB, DT_ILLUMINANT_PIPE, dt_iop_is_first_instance(), dt_iop_module_t::enabled, dt_develop_t::iop, IS_NULL_PTR, p, dt_iop_module_t::params, preset, and dt_develop_t::proxy.
Referenced by gui_changed(), process(), process_cl(), and reload_defaults().
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 320 of file channelmixerrgb.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 315 of file channelmixerrgb.c.
References IOP_GROUP_COLOR.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 299 of file channelmixerrgb.c.
References dt_iop_set_description().
| __DT_CLONE_TARGETS__ int extract_color_checker | ( | const float *const restrict | in, |
| float *const restrict | out, | ||
| const dt_iop_roi_t *const | roi_in, | ||
| dt_iop_channelmixer_rgb_gui_data_t * | g, | ||
| const dt_iop_channelmixer_rgb_box_map_t *const | box_map, | ||
| const dt_colormatrix_t | RGB_to_XYZ, | ||
| const dt_colormatrix_t | XYZ_to_RGB, | ||
| const dt_colormatrix_t | XYZ_to_CAM, | ||
| const dt_adaptation_t | kind | ||
| ) |
Definition at line 1682 of file channelmixerrgb.c.
References _extract_patches(), A, extraction_result_t::black, bradford_adapt_D50(), CAT16_adapt_D50(), compute_patches_delta_E(), DT_ADAPTATION_CAT16, DT_ADAPTATION_FULL_BRADFORD, DT_ADAPTATION_LAST, DT_ADAPTATION_LINEAR_BRADFORD, DT_ADAPTATION_RGB, DT_ADAPTATION_XYZ, dt_alloc_align(), dt_alloc_align_float(), dt_free, dt_free_align, DT_ILLUMINANT_BB, DT_ILLUMINANT_D, dt_Lab_to_XYZ(), dt_simd_memcpy(), DT_SOLVE_OPTIMIZE_AVG_DELTA_E, DT_SOLVE_OPTIMIZE_FOLIAGE, DT_SOLVE_OPTIMIZE_HIGH_SAT, DT_SOLVE_OPTIMIZE_LOW_SAT, DT_SOLVE_OPTIMIZE_MAX_DELTA_E, DT_SOLVE_OPTIMIZE_NONE, DT_SOLVE_OPTIMIZE_SKIN, DT_SOLVE_OPTIMIZE_SKY, dt_store_simd_aligned(), dt_XYZ_to_xyY(), extraction_result_t::exposure, FALSE, g, GET_WEIGHT, dt_iop_roi_t::height, illuminant, illuminant_xy_to_XYZ(), IS_NULL_PTR, k, kind, LMS, out, p, pseudo_solve_gaussian(), reference(), repack_double3x3_to_3xSSE(), TRUE, dt_iop_roi_t::width, x, and XYZ_adapt_D50().
Referenced by process().
| int flags | ( | ) |
Definition at line 310 of file channelmixerrgb.c.
References IOP_FLAGS_ALLOW_TILING, IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.
|
static |
Definition at line 636 of file channelmixerrgb.c.
References _custom_wb_from_coeffs(), dt_iop_module_t::dev, dt_develop_t::proxy, and dt_develop_t::wb_coeffs.
Referenced by _auto_set_illuminant(), gui_changed(), illuminant_color_draw(), reload_defaults(), and update_approx_cct().
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
Definition at line 4578 of file channelmixerrgb.c.
References _channelmixerrgb_set_mixer_mode(), _channelmixerrgb_sync_primaries_from_params(), _channelmixerrgb_sync_simple_from_params(), _channelmixerrgb_sync_white_preserving_from_params(), _channelmixerrgb_update_primaries_colors(), _channelmixerrgb_update_simple_colors(), _channelmixerrgb_update_white_preserving_colors(), _channelmixerrgb_white_preserving_widgets(), _update_RGB_colors(), declare_cat_on_pipe(), dt_iop_module_t::dev, dt_bauhaus_combobox_get(), dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), DT_CHANNELMIXERRGB_MIXER_COMPLETE, DT_CHANNELMIXERRGB_MIXER_PRIMARIES, DT_CHANNELMIXERRGB_MIXER_SIMPLE, DT_CHANNELMIXERRGB_MIXER_WHITE_PRESERVING, DT_CHANNELMIXERRGB_SIMPLE_MODE_CONF, dt_conf_set_int(), dt_control_log(), DT_DEBUG_DEV, dt_gui_freeze_begin, dt_gui_freeze_end, DT_ILLUMINANT_BB, DT_ILLUMINANT_CAMERA, DT_ILLUMINANT_CUSTOM, DT_ILLUMINANT_D, DT_ILLUMINANT_DETECT_EDGES, DT_ILLUMINANT_DETECT_SURFACES, dt_iop_channelmixer_shared_paint_temperature_slider(), dt_iop_channelmixer_shared_rows_are_normalized(), dt_iop_gui_data(), dt_print(), error(), FALSE, find_temperature_from_raw_coeffs(), g, get_white_balance_coeff(), illuminant_to_xy(), dt_develop_t::image_storage, IS_NULL_PTR, Lch, M_PI, normalize(), p, paint_hue(), dt_iop_module_t::params, TEMP_MAX, TEMP_MIN, update_approx_cct(), update_illuminant_color(), update_illuminants(), and xyY.
Referenced by _channelmixerrgb_mixer_mode_callback(), _channelmixerrgb_primaries_slider_callback(), _channelmixerrgb_simple_slider_callback(), _channelmixerrgb_white_preserving_slider_callback(), _develop_ui_pipe_finished_callback(), commit_profile_callback(), gui_reset(), and gui_update().
| void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
Definition at line 5774 of file channelmixerrgb.c.
References _develop_ui_pipe_finished_callback(), _preview_pipe_finished_callback(), dt_colorchecker_cleanup(), dt_colorchecker_label_list_cleanup(), dt_conf_set_int(), dt_control_signal_get_global(), DT_DEBUG_CONTROL_SIGNAL_DISCONNECT, dt_free, dt_free_align, dt_iop_gui_data(), DT_REQUEST_COLORPICK_OFF, g, IOP_GUI_FREE, and dt_iop_module_t::request_color_pick.
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
Definition at line 5200 of file channelmixerrgb.c.
References _channelmixerrgb_mixer_mode_callback(), _channelmixerrgb_primaries_slider_callback(), _channelmixerrgb_simple_slider_callback(), _develop_ui_pipe_finished_callback(), _preview_pipe_finished_callback(), _spot_settings_changed_callback(), B, checker_changed_callback(), checker_color_changed_callback(), CHROMA_MAX, commit_profile_callback(), dt_bauhaus_combobox_add(), dt_bauhaus_combobox_from_params(), dt_bauhaus_combobox_new(), DT_BAUHAUS_COMBOBOX_NEW_FULL, dt_bauhaus_combobox_set(), dt_bauhaus_get_global(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_new_with_range(), dt_bauhaus_slider_new_with_range_and_feedback(), dt_bauhaus_slider_set_default(), dt_bauhaus_slider_set_digits(), dt_bauhaus_slider_set_factor(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_hard_max(), dt_bauhaus_slider_set_soft_max(), dt_bauhaus_slider_set_soft_range(), DT_BAUHAUS_SPACE, dt_bauhaus_toggle_from_params(), 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_free, DT_GUI_BOX_SPACING, DT_GUI_MODULE, dt_gui_new_collapsible_section(), dt_loc_get_user_config_dir(), DT_PATH_MAX, DT_PIXEL_APPLY_DPI, DT_SIGNAL_DEVELOP_PREVIEW_PIPE_FINISHED, DT_SIGNAL_DEVELOP_UI_PIPE_FINISHED, dt_ui_label_new(), dt_ui_notebook_new(), dt_ui_notebook_page(), dt_ui_notebook_set_picker_owner(), dt_ui_section_label_new(), dtgtk_button_new(), dtgtk_cairo_paint_check_mark(), dtgtk_cairo_paint_refresh(), dtgtk_cairo_paint_softproof(), FALSE, g, dt_iop_order_iccprofile_info_t::grey, dt_iop_module_t::gui, HUE_MAX, ILLUM_X_MAX, illum_xy_callback(), ILLUM_Y_MAX, illuminant_color_draw(), IOP_GUI_ALLOC, k, LIGHTNESS_MAX, MIXER_ROW, optimize_changed_callback(), origin_color_draw(), OUTPUT_SECTION, R, run_profile_callback(), run_validation_callback(), safety_changed_callback(), start_profiling_callback(), target_color_draw(), tooltip, TRUE, WHITE_PRESERVING_PRIMARY, 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 2555 of file channelmixerrgb.c.
References apply_homography(), apply_homography_scaling(), dt_iop_module_t::dev, dt_dev_get_overlay_scale(), dt_dev_rescale_roi(), dt_iop_gui_data(), dt_ioppr_get_pipe_output_profile_info(), g, height, IS_NULL_PTR, k, dt_iop_order_iccprofile_info_t::lut_out, dt_iop_order_iccprofile_info_t::lutsize, M_PI, dt_iop_order_iccprofile_info_t::matrix_out_transposed, dt_iop_order_iccprofile_info_t::nonlinearlut, dt_develop_t::pipe, RGB, scaling, top, width, x, point_t::x, and point_t::y.
| void gui_reset | ( | dt_iop_module_t * | self | ) |
Definition at line 3954 of file channelmixerrgb.c.
References dt_iop_color_picker_reset(), dt_iop_gui_data(), FALSE, g, gui_changed(), and TRUE.
| void gui_update | ( | struct dt_iop_module_t * | self | ) |
Definition at line 3962 of file channelmixerrgb.c.
References _channelmixerrgb_set_mixer_mode(), _channelmixerrgb_sync_primaries_from_params(), _channelmixerrgb_sync_simple_from_params(), _channelmixerrgb_sync_white_preserving_from_params(), _checker_label_from_combobox(), _set_checker_from_labels(), CHANNELMIXERRGB_V_3, color_list_visibility(), d, dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_bauhaus_combobox_add_full(), DT_BAUHAUS_COMBOBOX_ALIGN_RIGHT, dt_bauhaus_combobox_length(), dt_bauhaus_combobox_remove_at(), dt_bauhaus_combobox_set(), dt_bauhaus_combobox_set_default(), dt_bauhaus_combobox_set_from_text(), dt_bauhaus_slider_set(), dt_bauhaus_slider_set_default(), DT_CHANNELMIXERRGB_MIXER_COMPLETE, DT_CHANNELMIXERRGB_MIXER_PRIMARIES, DT_CHANNELMIXERRGB_MIXER_SIMPLE, DT_CHANNELMIXERRGB_MIXER_WHITE_PRESERVING, DT_CHANNELMIXERRGB_SIMPLE_MODE_CONF, dt_conf_get_bool(), dt_conf_get_float(), dt_conf_get_int(), dt_conf_get_string(), dt_conf_key_exists(), dt_free, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_hide_collapsible_section(), dt_gui_update_collapsible_section(), DT_ILLUMINANT_CAMERA, dt_image_is_matrix_correction_supported(), dt_image_is_monochrome(), dt_iop_color_picker_reset(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_SPOT_MODE_CORRECT, FALSE, g, gui_changed(), dt_develop_t::image_storage, Lch, M_PI, p, TRUE, update_colorchecker_color_list(), update_colorchecker_list(), and xyY.
Definition at line 3907 of file channelmixerrgb.c.
References CCT_reverse_lookup(), dt_iop_module_t::dev, dt_bauhaus_slider_get(), dt_bauhaus_slider_set(), DT_DEBUG_DEV, dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_channelmixer_shared_paint_temperature_slider(), dt_iop_gui_data(), dt_print(), g, Lch, M_PI, p, dt_iop_module_t::params, t, TEMP_MAX, TEMP_MIN, TRUE, update_approx_cct(), update_illuminant_color(), xy_to_CCT(), and xyY.
Referenced by gui_init().
|
static |
Definition at line 3741 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_cairo_image_surface_create(), DT_PIXEL_APPLY_DPI, get_white_balance_coeff(), height, illuminant_to_xy(), illuminant_xy_to_RGB(), dt_develop_t::image_storage, INNER_PADDING, INTERNAL_PADDING, p, dt_iop_module_t::params, RGB, TRUE, width, and x.
Referenced by gui_init().
| void init | ( | dt_iop_module_t * | module | ) |
Definition at line 4123 of file channelmixerrgb.c.
References d, dt_iop_module_t::default_params, dt_iop_default_init(), and TRUE.
|
inlinestatic |
Definition at line 2363 of file channelmixerrgb.c.
References g, TRUE, update_bounding_box(), and width.
Referenced by button_pressed(), checker_changed_callback(), checker_color_changed_callback(), and start_profiling_callback().
| void init_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 2317 of file channelmixerrgb.c.
References dt_opencl_create_kernel(), dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_bradford_full, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_bradford_linear, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_cat16, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_rgb, and dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_xyz.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 3941 of file channelmixerrgb.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 395 of file channelmixerrgb.c.
References CHANNELMIXERRGB_V_3, DT_ADAPTATION_RGB, DT_ADAPTATION_XYZ, dt_gui_presets_add_generic(), DT_ILLUMINANT_FLUO_F3, DT_ILLUMINANT_FLUO_LAST, DT_ILLUMINANT_LED_B5, DT_ILLUMINANT_LED_LAST, DT_ILLUMINANT_PIPE, FALSE, illuminant_to_xy(), dt_iop_module_so_t::op, p, and TRUE.
| 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 325 of file channelmixerrgb.c.
References dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::datatype, default_input_format(), and TYPE_FLOAT.
| 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 333 of file channelmixerrgb.c.
References adaptation, B, CHANNEL_SIZE, CHANNELMIXERRGB_V_1, illuminant, n, dt_iop_channelmixer_rgb_params_t::normalize_grey, R, dt_iop_channelmixer_rgb_params_t::saturation, TRUE, and x.
|
inlinestatic |
Definition at line 767 of file channelmixerrgb.c.
References __OMP_PARALLEL_FOR__, bradford_adapt_D50(), CAT16_adapt_D50(), convert_bradford_LMS_to_XYZ(), convert_CAT16_LMS_to_XYZ(), convert_XYZ_to_bradford_LMS(), convert_XYZ_to_CAT16_LMS(), DT_ADAPTATION_CAT16, DT_ADAPTATION_FULL_BRADFORD, DT_ADAPTATION_LAST, DT_ADAPTATION_LINEAR_BRADFORD, DT_ADAPTATION_RGB, DT_ADAPTATION_XYZ, dt_omploop_sfence, dt_store_simd_aligned(), FALSE, height, illuminant, k, kind, out, p, transpose_3xSSE(), TRUE, width, and XYZ_adapt_D50().
Referenced by process().
| int mouse_moved | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 2402 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_control_queue_redraw_center(), dt_control_set_cursor_visible, 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_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_module_t::enabled, FALSE, g, IS_NULL_PTR, k, TRUE, update_bounding_box(), and x.
| const char * name | ( | ) |
Definition at line 289 of file channelmixerrgb.c.
Referenced by _checker_label_from_combobox().
Definition at line 2872 of file channelmixerrgb.c.
References dt_bauhaus_combobox_get(), dt_conf_set_int(), dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), g, and i.
Referenced by gui_init().
|
static |
Definition at line 3822 of file channelmixerrgb.c.
References dt_cairo_image_surface_create(), dt_iop_gui_data(), DT_PIXEL_APPLY_DPI, g, height, INNER_PADDING, INTERNAL_PADDING, TRUE, and width.
Referenced by gui_init().
|
static |
Definition at line 3416 of file channelmixerrgb.c.
References CHROMA_MAX, dt_bauhaus_slider_get(), DT_BAUHAUS_SLIDER_MAX_STOPS, dt_bauhaus_slider_set_stop(), dt_iop_gui_data(), dt_Lab_to_XYZ(), dt_XYZ_to_sRGB(), g, HUE_MAX, i, Lab, LIGHTNESS_MAX, RGB, and XYZ.
Referenced by _auto_set_illuminant(), _spot_settings_changed_callback(), and gui_changed().
| 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 2030 of file channelmixerrgb.c.
References _box_map(), _custom_wb_from_coeffs(), dt_iop_channelmixer_rbg_data_t::adaptation, dt_iop_channelmixer_rbg_data_t::apply_grey, auto_detect_WB(), ch, dt_iop_channelmixer_rbg_data_t::clip, dt_iop_buffer_dsc_t::coeffs, dt_dev_pixelpipe_iop_t::data, declare_cat_on_pipe(), dt_iop_module_t::dev, dt_dev_pixelpipe_iop_t::dsc_in, DT_ADAPTATION_CAT16, DT_ADAPTATION_FULL_BRADFORD, DT_ADAPTATION_LAST, DT_ADAPTATION_LINEAR_BRADFORD, DT_ADAPTATION_RGB, DT_ADAPTATION_XYZ, dt_control_log(), DT_DEV_PIXELPIPE_FULL, DT_DEV_PIXELPIPE_PREVIEW, DT_ILLUMINANT_CAMERA, DT_ILLUMINANT_DETECT_EDGES, DT_ILLUMINANT_DETECT_SURFACES, dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_image_copy_by_size(), dt_iop_set_cache_bypass(), dt_ioppr_get_pipe_current_profile_info(), dt_ioppr_get_pipe_input_profile_info(), dt_store_simd_aligned(), extract_color_checker(), FALSE, find_temperature_from_raw_coeffs(), g, dt_iop_channelmixer_rbg_data_t::gamut, dt_iop_channelmixer_rbg_data_t::grey, dt_develop_t::gui_attached, dt_iop_roi_t::height, dt_iop_channelmixer_rbg_data_t::illuminant, dt_iop_channelmixer_rbg_data_t::illuminant_type, illuminant_xy_to_XYZ(), dt_develop_t::image_storage, IS_NULL_PTR, dt_iop_channelmixer_rbg_data_t::lightness, loop_switch(), dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_out, dt_iop_channelmixer_rbg_data_t::MIX, out, ovoid, dt_iop_channelmixer_rbg_data_t::p, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, dt_iop_channelmixer_rbg_data_t::saturation, dt_iop_buffer_dsc_t::temperature, TRUE, dt_dev_pixelpipe_t::type, validate_color_checker(), dt_iop_channelmixer_rbg_data_t::version, dt_iop_roi_t::width, x, and XYZ.
| 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 2193 of file channelmixerrgb.c.
References _custom_wb_from_coeffs(), dt_iop_buffer_dsc_t::coeffs, d, dt_dev_pixelpipe_iop_t::data, declare_cat_on_pipe(), dt_iop_module_t::dev, dt_dev_pixelpipe_t::devid, dt_dev_pixelpipe_iop_t::dsc_in, DT_ADAPTATION_CAT16, DT_ADAPTATION_FULL_BRADFORD, DT_ADAPTATION_LAST, DT_ADAPTATION_LINEAR_BRADFORD, DT_ADAPTATION_RGB, DT_ADAPTATION_XYZ, DT_DEBUG_OPENCL, DT_ILLUMINANT_CAMERA, dt_ioppr_get_pipe_current_profile_info(), 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_store_simd_aligned(), error(), FALSE, find_temperature_from_raw_coeffs(), dt_iop_module_t::global_data, height, dt_iop_roi_t::height, illuminant_xy_to_XYZ(), dt_develop_t::image_storage, kernel(), dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_bradford_full, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_bradford_linear, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_cat16, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_rgb, dt_iop_channelmixer_rgb_global_data_t::kernel_channelmixer_rgb_xyz, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_out, pack_3xSSE_to_3x4(), dt_dev_pixelpipe_iop_t::roi_in, ROUNDUPDHT, ROUNDUPDWD, dt_iop_buffer_dsc_t::temperature, TRUE, width, dt_iop_roi_t::width, x, and XYZ.
| void reload_defaults | ( | dt_iop_module_t * | module | ) |
Definition at line 4134 of file channelmixerrgb.c.
References dt_develop_t::chroma_adaptation, d, declare_cat_on_pipe(), dt_iop_module_t::default_params, dt_iop_module_t::dev, DT_ADAPTATION_RGB, dt_conf_is_equal(), DT_ILLUMINANT_CAMERA, DT_ILLUMINANT_PIPE, dt_image_is_monochrome(), dt_iop_get_module_from_list(), find_temperature_from_raw_coeffs(), get_white_balance_coeff(), dt_develop_t::iop, dt_iop_module_t::iop_order, IS_NULL_PTR, dt_develop_t::proxy, and TRUE.
|
static |
Definition at line 2977 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_dev_pixelpipe_resync_history_preview, dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_set_cache_bypass(), g, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 2990 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_dev_pixelpipe_resync_history_preview, dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_set_cache_bypass(), g, and TRUE.
Referenced by gui_init().
Definition at line 2940 of file channelmixerrgb.c.
References dt_bauhaus_slider_get(), dt_conf_set_float(), dt_control_queue_redraw_center(), dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), and g.
Referenced by gui_init().
|
static |
Definition at line 2955 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_control_queue_redraw_center(), dt_dev_roi_request_preview_height(), dt_dev_roi_request_preview_width(), dt_gui_widgets_suppressed(), dt_iop_gui_data(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_request_focus(), g, dt_iop_module_t::gui, init_bounding_box(), dt_iop_module_gui_t::off, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 3780 of file channelmixerrgb.c.
References dt_bauhaus_slider_get(), dt_cairo_image_surface_create(), dt_iop_gui_data(), dt_Lab_to_XYZ(), DT_PIXEL_APPLY_DPI, dt_XYZ_to_sRGB(), g, height, INNER_PADDING, INTERNAL_PADDING, Lab, Lch, RGB, TRUE, width, and XYZ.
Referenced by gui_init().
|
static |
Definition at line 3852 of file channelmixerrgb.c.
References dt_iop_module_t::dev, dt_free, DT_ILLUMINANT_BB, DT_ILLUMINANT_D, dt_iop_gui_data(), g, get_white_balance_coeff(), illuminant_to_xy(), dt_develop_t::image_storage, p, dt_iop_module_t::params, t, and x.
Referenced by _auto_set_illuminant(), _develop_ui_pipe_finished_callback(), gui_changed(), and illum_xy_callback().
|
inlinestatic |
Definition at line 2345 of file channelmixerrgb.c.
References g, get_homography(), and k.
Referenced by button_released(), init_bounding_box(), and mouse_moved().
| void update_colorchecker_color_list | ( | dt_iop_module_t * | self | ) |
This function filters the list of all .cht files to only those that match the currently selected colorchecker.
| self |
Definition at line 2800 of file channelmixerrgb.c.
References _checker_label_from_combobox(), COLOR_CHECKER_USER_REF, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_clear(), dt_colorchecker_find_color(), dt_control_queue_redraw_widget(), dt_iop_gui_data(), g, IS_NULL_PTR, dt_colorchecker_label_t::name, dt_colorchecker_label_t::patch_nb, and dt_colorchecker_label_t::type.
Referenced by checker_changed_callback(), and gui_update().
| void update_colorchecker_list | ( | dt_iop_module_t * | self | ) |
Definition at line 2841 of file channelmixerrgb.c.
References COLOR_CHECKER_USER_REF, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_add_separator(), dt_bauhaus_combobox_clear(), dt_colorchecker_find(), dt_colorchecker_label_list_cleanup(), dt_iop_gui_data(), FALSE, g, IS_NULL_PTR, dt_colorchecker_label_t::name, TRUE, and dt_colorchecker_label_t::type.
Referenced by gui_update().
|
static |
Definition at line 3730 of file channelmixerrgb.c.
References dt_iop_gui_data(), g, IS_NULL_PTR, and update_xy_color().
Referenced by _auto_set_illuminant(), _develop_ui_pipe_finished_callback(), gui_changed(), and illum_xy_callback().
|
static |
Definition at line 3231 of file channelmixerrgb.c.
References DT_ADAPTATION_LAST, DT_ADAPTATION_RGB, DT_ILLUMINANT_A, DT_ILLUMINANT_BB, DT_ILLUMINANT_CAMERA, DT_ILLUMINANT_CUSTOM, DT_ILLUMINANT_D, DT_ILLUMINANT_DETECT_EDGES, DT_ILLUMINANT_DETECT_SURFACES, DT_ILLUMINANT_E, DT_ILLUMINANT_F, DT_ILLUMINANT_LAST, DT_ILLUMINANT_LED, DT_ILLUMINANT_PIPE, dt_iop_gui_data(), FALSE, g, p, dt_iop_module_t::params, and TRUE.
Referenced by _auto_set_illuminant(), _develop_ui_pipe_finished_callback(), and gui_changed().
|
static |
DOCUMENTATION
The illuminant is stored in params as a set of x and y coordinates, describing its chrominance in xyY color space. xyY is a normalized XYZ space, derivated from the retina cone sensors. By definition, for an illuminant, Y = 1, so we only really care about (x, y).
Using (x, y) is a robust and interoperable way to describe an illuminant, since it is all the actual pixel code needs to perform the chromatic adaptation. This (x, y) can be computed in many different ways or taken from databases, and possibly from other software, so storing only the result let us room to improve the computation in the future, without losing compatibility with older versions.
However, it's not a great GUI since x and y are not perceptually scaled. So the g->illum_x and g->illum_y actually display respectively hue and chroma, in LCh color space, which is designed for illuminants and preceptually spaced. This gives UI controls which effect feels more even to the user.
But that makes things a bit tricky, API-wise, since a set of (x, y) depends on a set of (hue, chroma), so they always need to be handled together, but also because the back-and-forth computations Lch <-> xyY need to be done anytime we read or write from/to params from/to GUI.
Also, the R, G, B sliders have a background color gradient that shows the actual R, G, B sensors used by the selected chromatic adaptation. Each chromatic adaptation method uses a different RGB space, called LMS in the literature (but it's only a special-purpose RGB space for all we care here), which primaries are projected to sRGB colors, to be displayed in the GUI, so users may get a feeling of what colors they will get.
Definition at line 3375 of file channelmixerrgb.c.
References DT_BAUHAUS_SLIDER_MAX_STOPS, dt_bauhaus_slider_set_stop(), dt_iop_gui_data(), g, i, ILLUM_X_MAX, ILLUM_Y_MAX, illuminant_xy_to_RGB(), IS_NULL_PTR, Lch, M_PI, p, dt_iop_module_t::params, RGB, x, and xyY.
Referenced by update_illuminant_color().
| int validate_color_checker | ( | const float *const restrict | in, |
| const dt_iop_roi_t *const | roi_in, | ||
| dt_iop_channelmixer_rgb_gui_data_t * | g, | ||
| const dt_iop_channelmixer_rgb_box_map_t *const | box_map, | ||
| const dt_colormatrix_t | RGB_to_XYZ, | ||
| const dt_colormatrix_t | XYZ_to_RGB, | ||
| const dt_colormatrix_t | XYZ_to_CAM | ||
| ) |
Definition at line 1987 of file channelmixerrgb.c.
References _extract_patches(), extraction_result_t::black, compute_patches_delta_E(), dt_alloc_align_float(), dt_free, dt_free_align, extraction_result_t::exposure, FALSE, g, and IS_NULL_PTR.
Referenced by process().