![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Include dependency graph for channelmixerrgb_shared.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_channelmixer_shared_simple_params_t |
| struct | dt_iop_channelmixer_shared_primaries_params_t |
| struct | dt_iop_channelmixer_shared_white_preserving_params_t |
| White-preserving primaries model : per-primary rotation and saturation, no white freedom. More... | |
Macros | |
| #define | DT_IOP_CHANNELMIXER_SHARED_SIMPLE_TAN_SCALE 1.55f |
| #define | DT_IOP_CHANNELMIXER_SHARED_SIMPLE_EPS 5e-5f |
| #define | DT_IOP_CHANNELMIXER_SHARED_SIMPLE_CHROMA_PROBE 0.5f |
| #define | DT_IOP_CHANNELMIXER_SHARED_MIN_FOOTPRINT 0.02f |
Typedefs | |
| typedef struct _GtkWidget | GtkWidget |
| typedef enum dt_iop_channelmixer_shared_primaries_basis_t | dt_iop_channelmixer_shared_primaries_basis_t |
| typedef enum dt_iop_channelmixer_shared_simple_probe_t | dt_iop_channelmixer_shared_simple_probe_t |
| typedef struct dt_iop_channelmixer_shared_simple_params_t | dt_iop_channelmixer_shared_simple_params_t |
| typedef struct dt_iop_channelmixer_shared_primaries_params_t | dt_iop_channelmixer_shared_primaries_params_t |
| typedef struct dt_iop_channelmixer_shared_white_preserving_params_t | dt_iop_channelmixer_shared_white_preserving_params_t |
| White-preserving primaries model : per-primary rotation and saturation, no white freedom. | |
| #define DT_IOP_CHANNELMIXER_SHARED_MIN_FOOTPRINT 0.02f |
Definition at line 20 of file channelmixerrgb_shared.h.
| #define DT_IOP_CHANNELMIXER_SHARED_SIMPLE_CHROMA_PROBE 0.5f |
Definition at line 17 of file channelmixerrgb_shared.h.
| #define DT_IOP_CHANNELMIXER_SHARED_SIMPLE_EPS 5e-5f |
Definition at line 16 of file channelmixerrgb_shared.h.
| #define DT_IOP_CHANNELMIXER_SHARED_SIMPLE_TAN_SCALE 1.55f |
Definition at line 15 of file channelmixerrgb_shared.h.
| typedef enum dt_iop_channelmixer_shared_primaries_basis_t dt_iop_channelmixer_shared_primaries_basis_t |
| typedef struct dt_iop_channelmixer_shared_primaries_params_t dt_iop_channelmixer_shared_primaries_params_t |
| typedef struct dt_iop_channelmixer_shared_simple_params_t dt_iop_channelmixer_shared_simple_params_t |
| typedef struct dt_iop_channelmixer_shared_white_preserving_params_t dt_iop_channelmixer_shared_white_preserving_params_t |
White-preserving primaries model : per-primary rotation and saturation, no white freedom.
Each primary is the chromaticity of one column of the mixer matrix, expressed in the affine plane of the current mixer basis. rotation turns it around the basis white, and saturation scales its distance to that white by 1 + saturation : -1 collapses the primary onto the white, 0 leaves it untouched, +1 doubles its distance. The three column magnitudes are then SOLVED, not chosen, so that the basis white maps to itself : that constraint is what removes the three remaining degrees of freedom of a 3x3 matrix, and is why six parameters describe the whole white-preserving submanifold exactly. All-zero parameters are the identity matrix, and a uniform saturation is the classic saturation matrix around the basis white.
| typedef struct _GtkWidget GtkWidget |
Definition at line 13 of file channelmixerrgb_shared.h.
Definition at line 22 of file channelmixerrgb_shared.h.
| Enumerator | |
|---|---|
| DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_ROTATION | |
| DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_1 | |
| DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_2 | |
Definition at line 30 of file channelmixerrgb_shared.h.
| float dt_iop_channelmixer_shared_decode_simple_coupling_amount | ( | float | slider | ) |
Definition at line 68 of file channelmixerrgb_shared.c.
References DT_IOP_CHANNELMIXER_SHARED_SIMPLE_TAN_SCALE.
Referenced by dt_iop_channelmixer_shared_paint_simple_sliders(), and dt_iop_channelmixer_shared_simple_from_sliders().
| float dt_iop_channelmixer_shared_decode_simple_stretch | ( | float | slider | ) |
Definition at line 56 of file channelmixerrgb_shared.c.
Referenced by dt_iop_channelmixer_shared_paint_simple_sliders(), and dt_iop_channelmixer_shared_simple_from_sliders().
| float dt_iop_channelmixer_shared_encode_simple_coupling_amount | ( | float | amount | ) |
Definition at line 63 of file channelmixerrgb_shared.c.
References DT_IOP_CHANNELMIXER_SHARED_SIMPLE_TAN_SCALE.
Referenced by dt_iop_channelmixer_shared_simple_to_sliders().
| float dt_iop_channelmixer_shared_encode_simple_stretch | ( | float | stretch | ) |
Definition at line 49 of file channelmixerrgb_shared.c.
Referenced by dt_iop_channelmixer_shared_simple_to_sliders().
| gboolean dt_iop_channelmixer_shared_get_matrix | ( | const float | rows[3][3], |
| const gboolean | normalize[3], | ||
| gboolean | force_normalize, | ||
| float | M[3][3] | ||
| ) |
Definition at line 152 of file channelmixerrgb_shared.c.
References FALSE, M, normalize(), row, and TRUE.
Referenced by _build_point_transform(), _channelmixerrgb_mixer_mode_callback(), _channelmixerrgb_sync_primaries_from_params(), _channelmixerrgb_sync_simple_from_params(), _channelmixerrgb_sync_white_preserving_from_params(), _sync_primaries_from_params(), _sync_simple_from_params(), and _sync_white_preserving_from_params().
| void dt_iop_channelmixer_shared_module_color_to_display | ( | const float | module_color[3], |
| dt_adaptation_t | adaptation, | ||
| const dt_iop_order_iccprofile_info_t * | work_profile, | ||
| const dt_iop_order_iccprofile_info_t * | display_profile, | ||
| float | display_rgb[3] | ||
| ) |
Definition at line 879 of file channelmixerrgb_shared.c.
References adaptation, DT_ADAPTATION_RGB, dt_iop_channelmixer_shared_work_rgb_to_display(), and LMS.
Referenced by _paint_RGB_slider_stop(), dt_iop_channelmixer_shared_paint_primaries_sliders(), dt_iop_channelmixer_shared_paint_simple_sliders(), and dt_iop_channelmixer_shared_paint_white_preserving_sliders().
| void dt_iop_channelmixer_shared_mul3x3 | ( | const float | A[3][3], |
| const float | B[3][3], | ||
| float | C[3][3] | ||
| ) |
Definition at line 177 of file channelmixerrgb_shared.c.
References A, B, C, k, and row.
Referenced by _build_point_transform(), _mixer_from_chroma_basis(), and _mixer_to_chroma_basis().
| void dt_iop_channelmixer_shared_paint_primaries_sliders | ( | dt_adaptation_t | adaptation, |
| const dt_iop_order_iccprofile_info_t * | work_profile, | ||
| const dt_iop_order_iccprofile_info_t * | display_profile, | ||
| dt_iop_channelmixer_shared_primaries_basis_t | basis, | ||
| const dt_iop_channelmixer_shared_primaries_params_t * | primaries, | ||
| GtkWidget *const | widgets[9] | ||
| ) |
Definition at line 1123 of file channelmixerrgb_shared.c.
References _shared_primaries_probe_color(), dt_iop_channelmixer_shared_primaries_params_t::achromatic_hue, dt_iop_channelmixer_shared_primaries_params_t::achromatic_purity, adaptation, dt_iop_channelmixer_shared_primaries_params_t::blue_hue, dt_iop_channelmixer_shared_primaries_params_t::blue_purity, dt_bauhaus_slider_clear_stops(), dt_bauhaus_slider_get_hard_max(), dt_bauhaus_slider_get_hard_min(), DT_BAUHAUS_SLIDER_MAX_STOPS, dt_bauhaus_slider_set_stop(), dt_iop_channelmixer_shared_module_color_to_display(), dt_iop_channelmixer_shared_primaries_to_matrix(), dt_iop_channelmixer_shared_primaries_params_t::gain, dt_iop_channelmixer_shared_primaries_params_t::green_hue, dt_iop_channelmixer_shared_primaries_params_t::green_purity, i, M, dt_iop_channelmixer_shared_primaries_params_t::red_hue, dt_iop_channelmixer_shared_primaries_params_t::red_purity, and value.
Referenced by _channelmixerrgb_update_primaries_colors(), and _update_point_slider_colors().
| void dt_iop_channelmixer_shared_paint_row_sliders | ( | dt_adaptation_t | adaptation, |
| const dt_iop_order_iccprofile_info_t * | work_profile, | ||
| const dt_iop_order_iccprofile_info_t * | display_profile, | ||
| float | r, | ||
| float | g, | ||
| float | b, | ||
| gboolean | normalize, | ||
| const float | row[3], | ||
| GtkWidget *const | widgets[3] | ||
| ) |
Definition at line 931 of file channelmixerrgb_shared.c.
References _paint_RGB_slider_stop(), adaptation, dt_bauhaus_slider_clear_stops(), dt_bauhaus_slider_get_hard_max(), dt_bauhaus_slider_get_hard_min(), DT_BAUHAUS_SLIDER_MAX_STOPS, g, i, normalize(), r, RGB, and row.
Referenced by _update_point_slider_colors().
| void dt_iop_channelmixer_shared_paint_simple_sliders | ( | dt_adaptation_t | adaptation, |
| const dt_iop_order_iccprofile_info_t * | work_profile, | ||
| const dt_iop_order_iccprofile_info_t * | display_profile, | ||
| const dt_iop_channelmixer_shared_simple_params_t * | simple, | ||
| GtkWidget *const | widgets[6] | ||
| ) |
Definition at line 1014 of file channelmixerrgb_shared.c.
References _shared_paint_probe_matrix(), _shared_simple_hue_probe(), adaptation, dt_iop_channelmixer_shared_simple_params_t::coupling_amount, dt_iop_channelmixer_shared_simple_params_t::coupling_hue, dt_bauhaus_slider_clear_stops(), DT_BAUHAUS_SLIDER_MAX_STOPS, dt_bauhaus_slider_set_stop(), dt_iop_channelmixer_shared_decode_simple_coupling_amount(), dt_iop_channelmixer_shared_decode_simple_stretch(), DT_IOP_CHANNELMIXER_SHARED_INV_SQRT_3, dt_iop_channelmixer_shared_module_color_to_display(), DT_IOP_CHANNELMIXER_SHARED_SIMPLE_CHROMA_PROBE, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_1, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_2, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_ROTATION, dt_iop_channelmixer_shared_simple_probe_source(), dt_iop_channelmixer_shared_simple_to_matrix(), i, M, M_PI, P, dt_iop_channelmixer_shared_simple_params_t::psi, row, dt_iop_channelmixer_shared_simple_params_t::stretch_1, dt_iop_channelmixer_shared_simple_params_t::stretch_2, and dt_iop_channelmixer_shared_simple_params_t::theta.
Referenced by _channelmixerrgb_update_simple_colors(), and _update_point_slider_colors().
| void dt_iop_channelmixer_shared_paint_temperature_slider | ( | GtkWidget * | widget, |
| float | temperature_min, | ||
| float | temperature_max | ||
| ) |
Definition at line 897 of file channelmixerrgb_shared.c.
References dt_bauhaus_slider_clear_stops(), DT_BAUHAUS_SLIDER_MAX_STOPS, dt_bauhaus_slider_set_stop(), i, illuminant_CCT_to_RGB(), and RGB.
Referenced by _auto_set_illuminant(), _develop_ui_pipe_finished_callback(), _update_point_slider_colors(), gui_changed(), and illum_xy_callback().
| void dt_iop_channelmixer_shared_paint_white_preserving_sliders | ( | dt_adaptation_t | adaptation, |
| const dt_iop_order_iccprofile_info_t * | work_profile, | ||
| const dt_iop_order_iccprofile_info_t * | display_profile, | ||
| dt_iop_channelmixer_shared_primaries_basis_t | basis, | ||
| const dt_iop_channelmixer_shared_white_preserving_params_t * | white_preserving, | ||
| GtkWidget *const | widgets[6] | ||
| ) |
Definition at line 1190 of file channelmixerrgb_shared.c.
References adaptation, dt_iop_channelmixer_shared_white_preserving_params_t::blue_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::blue_saturation, dt_bauhaus_slider_clear_stops(), dt_bauhaus_slider_get_hard_max(), dt_bauhaus_slider_get_hard_min(), DT_BAUHAUS_SLIDER_MAX_STOPS, dt_bauhaus_slider_set_stop(), dt_iop_channelmixer_shared_module_color_to_display(), dt_iop_channelmixer_shared_white_preserving_to_matrix(), dt_iop_channelmixer_shared_white_preserving_params_t::green_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::green_saturation, i, M, dt_iop_channelmixer_shared_white_preserving_params_t::red_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::red_saturation, row, and value.
Referenced by _channelmixerrgb_update_white_preserving_colors(), and _update_point_slider_colors().
| dt_iop_channelmixer_shared_primaries_basis_t dt_iop_channelmixer_shared_primaries_basis_from_adaptation | ( | dt_adaptation_t | adaptation | ) |
Definition at line 310 of file channelmixerrgb_shared.c.
References adaptation, DT_ADAPTATION_CAT16, DT_ADAPTATION_FULL_BRADFORD, DT_ADAPTATION_LAST, DT_ADAPTATION_LINEAR_BRADFORD, DT_ADAPTATION_RGB, DT_ADAPTATION_XYZ, DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_BRADFORD, DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_CAT16, DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_RGB, and DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_XYZ.
Referenced by _channelmixerrgb_primaries_slider_callback(), _channelmixerrgb_sync_primaries_from_params(), _channelmixerrgb_sync_white_preserving_from_params(), _channelmixerrgb_update_primaries_colors(), _channelmixerrgb_update_white_preserving_colors(), and _channelmixerrgb_white_preserving_slider_callback().
| gboolean dt_iop_channelmixer_shared_primaries_from_matrix | ( | dt_iop_channelmixer_shared_primaries_basis_t | basis, |
| const float | M[3][3], | ||
| dt_iop_channelmixer_shared_primaries_params_t * | primaries | ||
| ) |
Definition at line 630 of file channelmixerrgb_shared.c.
References _affine_normalize(), _affine_polar_from_point(), _affine_sum3(), _build_affine_simplex(), _primaries_reference_white(), dt_iop_channelmixer_shared_primaries_params_t::achromatic_hue, dt_iop_channelmixer_shared_primaries_params_t::achromatic_purity, dt_iop_channelmixer_shared_primaries_params_t::blue_hue, dt_iop_channelmixer_shared_primaries_params_t::blue_purity, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_EPS, FALSE, dt_iop_channelmixer_shared_primaries_params_t::gain, dt_iop_channelmixer_shared_primaries_params_t::green_hue, dt_iop_channelmixer_shared_primaries_params_t::green_purity, M, mat3SSEinv(), dt_iop_channelmixer_shared_primaries_params_t::red_hue, dt_iop_channelmixer_shared_primaries_params_t::red_purity, row, and TRUE.
Referenced by _channelmixerrgb_sync_primaries_from_params(), and _sync_primaries_from_params().
| void dt_iop_channelmixer_shared_primaries_from_sliders | ( | GtkWidget *const | widgets[9], |
| dt_iop_channelmixer_shared_primaries_params_t * | primaries | ||
| ) |
Definition at line 96 of file channelmixerrgb_shared.c.
References dt_iop_channelmixer_shared_primaries_params_t::achromatic_hue, dt_iop_channelmixer_shared_primaries_params_t::achromatic_purity, dt_iop_channelmixer_shared_primaries_params_t::blue_hue, dt_iop_channelmixer_shared_primaries_params_t::blue_purity, dt_bauhaus_slider_get(), dt_iop_channelmixer_shared_primaries_params_t::gain, dt_iop_channelmixer_shared_primaries_params_t::green_hue, dt_iop_channelmixer_shared_primaries_params_t::green_purity, dt_iop_channelmixer_shared_primaries_params_t::red_hue, and dt_iop_channelmixer_shared_primaries_params_t::red_purity.
Referenced by _channelmixerrgb_primaries_slider_callback(), _channelmixerrgb_update_primaries_colors(), _primaries_slider_callback(), and _update_point_slider_colors().
| gboolean dt_iop_channelmixer_shared_primaries_to_matrix | ( | dt_iop_channelmixer_shared_primaries_basis_t | basis, |
| const dt_iop_channelmixer_shared_primaries_params_t * | primaries, | ||
| float | M[3][3] | ||
| ) |
Definition at line 572 of file channelmixerrgb_shared.c.
References _affine_point_from_polar(), _affine_sum3(), _build_affine_simplex(), _primaries_reference_white(), dt_iop_channelmixer_shared_primaries_params_t::achromatic_hue, dt_iop_channelmixer_shared_primaries_params_t::achromatic_purity, dt_iop_channelmixer_shared_primaries_params_t::blue_hue, dt_iop_channelmixer_shared_primaries_params_t::blue_purity, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_EPS, FALSE, dt_iop_channelmixer_shared_primaries_params_t::gain, dt_iop_channelmixer_shared_primaries_params_t::green_hue, dt_iop_channelmixer_shared_primaries_params_t::green_purity, M, mat3SSEinv(), dt_iop_channelmixer_shared_primaries_params_t::red_hue, dt_iop_channelmixer_shared_primaries_params_t::red_purity, row, and TRUE.
Referenced by _channelmixerrgb_primaries_slider_callback(), _channelmixerrgb_sync_primaries_from_params(), _primaries_slider_callback(), _sync_primaries_from_params(), and dt_iop_channelmixer_shared_paint_primaries_sliders().
| void dt_iop_channelmixer_shared_primaries_to_sliders | ( | const dt_iop_channelmixer_shared_primaries_params_t * | primaries, |
| GtkWidget *const | widgets[9] | ||
| ) |
Definition at line 110 of file channelmixerrgb_shared.c.
References dt_iop_channelmixer_shared_primaries_params_t::achromatic_hue, dt_iop_channelmixer_shared_primaries_params_t::achromatic_purity, dt_iop_channelmixer_shared_primaries_params_t::blue_hue, dt_iop_channelmixer_shared_primaries_params_t::blue_purity, dt_bauhaus_slider_set(), dt_iop_channelmixer_shared_primaries_params_t::gain, dt_iop_channelmixer_shared_primaries_params_t::green_hue, dt_iop_channelmixer_shared_primaries_params_t::green_purity, dt_iop_channelmixer_shared_primaries_params_t::red_hue, and dt_iop_channelmixer_shared_primaries_params_t::red_purity.
Referenced by _channelmixerrgb_sync_primaries_from_params(), and _sync_primaries_from_params().
| float dt_iop_channelmixer_shared_roundtrip_error | ( | const float | M[3][3], |
| const float | roundtrip[3][3] | ||
| ) |
Definition at line 274 of file channelmixerrgb_shared.c.
References M, max_error(), and row.
Referenced by _channelmixerrgb_sync_primaries_from_params(), _channelmixerrgb_sync_simple_from_params(), _sync_primaries_from_params(), _sync_simple_from_params(), and dt_iop_channelmixer_shared_roundtrip_error_relative().
| float dt_iop_channelmixer_shared_roundtrip_error_relative | ( | const float | M[3][3], |
| const float | roundtrip[3][3] | ||
| ) |
Roundtrip error, measured against the magnitude of the matrix itself.
A reduced mixer model is a reparametrization, so the question its gate asks is whether the rebuilt matrix is the SAME matrix, which is a relative question. Comparing an absolute coefficient difference against a fixed tolerance silently demands more and more precision as the coefficients grow, and the white-preserving model can legitimately produce large ones : two primaries rotated onto the same ray make the chromaticity basis near-singular, which inflates the column scales that the white constraint solves for. The denominator is floored at 1 so ordinary, near-identity matrices keep the plain absolute behaviour.
| [in] | M | Original mixer matrix. |
| [in] | roundtrip | Matrix rebuilt from the parameters read back from M. |
Definition at line 299 of file channelmixerrgb_shared.c.
References dt_iop_channelmixer_shared_roundtrip_error(), M, and row.
Referenced by _channelmixerrgb_sync_white_preserving_from_params(), and _sync_white_preserving_from_params().
| gboolean dt_iop_channelmixer_shared_rows_are_normalized | ( | const gboolean | normalize[3] | ) |
Definition at line 147 of file channelmixerrgb_shared.c.
References normalize().
Referenced by _channelmixerrgb_sync_simple_from_params(), _sync_simple_from_params(), and gui_changed().
| void dt_iop_channelmixer_shared_set_matrix | ( | float | rows[3][3], |
| const float | M[3][3] | ||
| ) |
Definition at line 170 of file channelmixerrgb_shared.c.
| void dt_iop_channelmixer_shared_simple_from_matrix | ( | const float | M[3][3], |
| dt_iop_channelmixer_shared_simple_params_t * | simple | ||
| ) |
Definition at line 221 of file channelmixerrgb_shared.c.
References _mixer_to_chroma_basis(), B, dt_iop_channelmixer_shared_simple_params_t::coupling_amount, dt_iop_channelmixer_shared_simple_params_t::coupling_hue, d, dt_iop_channelmixer_shared_wrap_half_pi(), dt_iop_channelmixer_shared_wrap_pi(), M, dt_iop_channelmixer_shared_simple_params_t::psi, dt_iop_channelmixer_shared_simple_params_t::stretch_1, dt_iop_channelmixer_shared_simple_params_t::stretch_2, and dt_iop_channelmixer_shared_simple_params_t::theta.
Referenced by _channelmixerrgb_sync_simple_from_params(), and _sync_simple_from_params().
| void dt_iop_channelmixer_shared_simple_from_sliders | ( | GtkWidget *const | widgets[6], |
| dt_iop_channelmixer_shared_simple_params_t * | simple | ||
| ) |
Definition at line 74 of file channelmixerrgb_shared.c.
References dt_iop_channelmixer_shared_simple_params_t::coupling_amount, dt_iop_channelmixer_shared_simple_params_t::coupling_hue, dt_bauhaus_slider_get(), dt_iop_channelmixer_shared_decode_simple_coupling_amount(), dt_iop_channelmixer_shared_decode_simple_stretch(), M_PI, dt_iop_channelmixer_shared_simple_params_t::psi, dt_iop_channelmixer_shared_simple_params_t::stretch_1, dt_iop_channelmixer_shared_simple_params_t::stretch_2, and dt_iop_channelmixer_shared_simple_params_t::theta.
Referenced by _channelmixerrgb_simple_slider_callback(), _channelmixerrgb_update_simple_colors(), _simple_slider_callback(), and _update_point_slider_colors().
| void dt_iop_channelmixer_shared_simple_probe_source | ( | dt_iop_channelmixer_shared_simple_probe_t | probe, |
| float | source[3] | ||
| ) |
Definition at line 814 of file channelmixerrgb_shared.c.
References DT_IOP_CHANNELMIXER_SHARED_INV_SQRT_3, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_CHROMA_PROBE, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_1, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_2, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_ROTATION, P, and row.
Referenced by dt_iop_channelmixer_shared_paint_simple_sliders().
| void dt_iop_channelmixer_shared_simple_to_matrix | ( | const dt_iop_channelmixer_shared_simple_params_t * | simple, |
| float | M[3][3] | ||
| ) |
Definition at line 253 of file channelmixerrgb_shared.c.
References _mixer_from_chroma_basis(), B, dt_iop_channelmixer_shared_simple_params_t::coupling_amount, dt_iop_channelmixer_shared_simple_params_t::coupling_hue, M, dt_iop_channelmixer_shared_simple_params_t::psi, dt_iop_channelmixer_shared_simple_params_t::stretch_1, dt_iop_channelmixer_shared_simple_params_t::stretch_2, and dt_iop_channelmixer_shared_simple_params_t::theta.
Referenced by _channelmixerrgb_simple_slider_callback(), _channelmixerrgb_sync_simple_from_params(), _simple_slider_callback(), _sync_simple_from_params(), and dt_iop_channelmixer_shared_paint_simple_sliders().
| void dt_iop_channelmixer_shared_simple_to_sliders | ( | const dt_iop_channelmixer_shared_simple_params_t * | simple, |
| GtkWidget *const | widgets[6] | ||
| ) |
Definition at line 85 of file channelmixerrgb_shared.c.
References dt_iop_channelmixer_shared_simple_params_t::coupling_amount, dt_iop_channelmixer_shared_simple_params_t::coupling_hue, dt_bauhaus_slider_set(), dt_iop_channelmixer_shared_encode_simple_coupling_amount(), dt_iop_channelmixer_shared_encode_simple_stretch(), dt_iop_channelmixer_shared_wrap_half_pi(), dt_iop_channelmixer_shared_wrap_pi(), M_PI, dt_iop_channelmixer_shared_simple_params_t::psi, dt_iop_channelmixer_shared_simple_params_t::stretch_1, dt_iop_channelmixer_shared_simple_params_t::stretch_2, and dt_iop_channelmixer_shared_simple_params_t::theta.
Referenced by _channelmixerrgb_sync_simple_from_params(), and _sync_simple_from_params().
| gboolean dt_iop_channelmixer_shared_white_preserving_from_matrix | ( | const dt_iop_channelmixer_shared_primaries_basis_t | basis, |
| const float | M[3][3], | ||
| dt_iop_channelmixer_shared_white_preserving_params_t * | white_preserving | ||
| ) |
Read a white-preserving primaries state back from a mixer matrix.
Only the column DIRECTIONS are read here, so this succeeds for any matrix whose columns have a non-zero affine sum, white-preserving or not. Callers must gate on the roundtrip error against dt_iop_channelmixer_shared_white_preserving_to_matrix() to know whether the matrix actually sits on the white-preserving submanifold : a matrix that moves the white reconstructs to a different one, exactly like the other reduced mixer models.
| [in] | basis | Affine basis the mixer operates in, from the module's adaptation. |
| [in] | M | Mixer matrix. |
| [out] | white_preserving | Per-primary rotations and saturations. |
Definition at line 784 of file channelmixerrgb_shared.c.
References _affine_normalize(), _build_affine_simplex(), _white_preserving_polar_from_point(), dt_iop_channelmixer_shared_white_preserving_params_t::blue_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::blue_saturation, FALSE, dt_iop_channelmixer_shared_white_preserving_params_t::green_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::green_saturation, M, dt_iop_channelmixer_shared_white_preserving_params_t::red_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::red_saturation, and TRUE.
Referenced by _channelmixerrgb_sync_white_preserving_from_params(), and _sync_white_preserving_from_params().
| void dt_iop_channelmixer_shared_white_preserving_from_sliders | ( | GtkWidget *const | widgets[6], |
| dt_iop_channelmixer_shared_white_preserving_params_t * | white_preserving | ||
| ) |
Definition at line 124 of file channelmixerrgb_shared.c.
References dt_iop_channelmixer_shared_white_preserving_params_t::blue_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::blue_saturation, dt_bauhaus_slider_get(), dt_iop_channelmixer_shared_white_preserving_params_t::green_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::green_saturation, dt_iop_channelmixer_shared_white_preserving_params_t::red_rotation, and dt_iop_channelmixer_shared_white_preserving_params_t::red_saturation.
Referenced by _channelmixerrgb_update_white_preserving_colors(), _channelmixerrgb_white_preserving_slider_callback(), _update_point_slider_colors(), and _white_preserving_slider_callback().
| gboolean dt_iop_channelmixer_shared_white_preserving_to_matrix | ( | const dt_iop_channelmixer_shared_primaries_basis_t | basis, |
| const dt_iop_channelmixer_shared_white_preserving_params_t *const | white_preserving, | ||
| float | M[3][3] | ||
| ) |
Build the mixer matrix of a white-preserving primaries state.
The three rotated and rescaled chromaticities give the DIRECTION of each mixer column. Their magnitudes are then solved from the single constraint that the basis white maps to itself : with t = P^-1 . w (P holding the chromaticities in columns), column c of the matrix is t_c / w_c times chromaticity c, and M . w == w holds by construction.
| [in] | basis | Affine basis the mixer operates in, from the module's adaptation. |
| [in] | white_preserving | Per-primary rotations and saturations. |
| [out] | M | Resulting mixer matrix. |
Definition at line 707 of file channelmixerrgb_shared.c.
References _affine_project_difference(), _affine_triangle_area(), _build_affine_simplex(), _primaries_reference_white(), _white_preserving_point_from_polar(), dt_iop_channelmixer_shared_white_preserving_params_t::blue_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::blue_saturation, DT_IOP_CHANNELMIXER_SHARED_MIN_FOOTPRINT, DT_IOP_CHANNELMIXER_SHARED_SIMPLE_EPS, FALSE, dt_iop_channelmixer_shared_white_preserving_params_t::green_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::green_saturation, M, mat3SSEinv(), dt_iop_channelmixer_shared_white_preserving_params_t::red_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::red_saturation, row, and TRUE.
Referenced by _channelmixerrgb_sync_white_preserving_from_params(), _channelmixerrgb_white_preserving_slider_callback(), _sync_white_preserving_from_params(), _white_preserving_slider_callback(), and dt_iop_channelmixer_shared_paint_white_preserving_sliders().
| void dt_iop_channelmixer_shared_white_preserving_to_sliders | ( | const dt_iop_channelmixer_shared_white_preserving_params_t * | white_preserving, |
| GtkWidget *const | widgets[6] | ||
| ) |
Definition at line 135 of file channelmixerrgb_shared.c.
References dt_iop_channelmixer_shared_white_preserving_params_t::blue_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::blue_saturation, dt_bauhaus_slider_set(), dt_iop_channelmixer_shared_white_preserving_params_t::green_rotation, dt_iop_channelmixer_shared_white_preserving_params_t::green_saturation, dt_iop_channelmixer_shared_white_preserving_params_t::red_rotation, and dt_iop_channelmixer_shared_white_preserving_params_t::red_saturation.
Referenced by _channelmixerrgb_sync_white_preserving_from_params(), and _sync_white_preserving_from_params().
| void dt_iop_channelmixer_shared_work_rgb_to_display | ( | const dt_aligned_pixel_t | work_rgb, |
| const dt_iop_order_iccprofile_info_t * | work_profile, | ||
| const dt_iop_order_iccprofile_info_t * | display_profile, | ||
| dt_aligned_pixel_t | display_rgb | ||
| ) |
Definition at line 848 of file channelmixerrgb_shared.c.
References _normalize_linear_display_rgb(), dt_apply_transposed_color_matrix(), IS_NULL_PTR, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lut_out, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in_transposed, dt_iop_order_iccprofile_info_t::matrix_out_transposed, dt_iop_order_iccprofile_info_t::nonlinearlut, and XYZ.
Referenced by _convert_GUI_colors(), _render_preview_surface(), and dt_iop_channelmixer_shared_module_color_to_display().
| float dt_iop_channelmixer_shared_wrap_half_pi | ( | float | angle | ) |
Definition at line 42 of file channelmixerrgb_shared.c.
References M_PI.
Referenced by dt_iop_channelmixer_shared_simple_from_matrix(), and dt_iop_channelmixer_shared_simple_to_sliders().
| float dt_iop_channelmixer_shared_wrap_pi | ( | float | angle | ) |
Definition at line 35 of file channelmixerrgb_shared.c.
References M_PI.
Referenced by _affine_polar_from_point(), _white_preserving_polar_from_point(), dt_iop_channelmixer_shared_simple_from_matrix(), and dt_iop_channelmixer_shared_simple_to_sliders().