1#ifndef DT_IOP_CHANNELMIXERRGB_SHARED_H
2#define DT_IOP_CHANNELMIXERRGB_SHARED_H
15#define DT_IOP_CHANNELMIXER_SHARED_SIMPLE_TAN_SCALE 1.55f
16#define DT_IOP_CHANNELMIXER_SHARED_SIMPLE_EPS 5e-5f
17#define DT_IOP_CHANNELMIXER_SHARED_SIMPLE_CHROMA_PROBE 0.5f
20#define DT_IOP_CHANNELMIXER_SHARED_MIN_FOOTPRINT 0.02f
103 gboolean force_normalize,
float M[3][3]);
137 float display_rgb[3]);
139 float temperature_max);
static __DT_CLONE_TARGETS__ void normalize(float *const buffer, const size_t width, const size_t height, const float norm)
float dt_iop_channelmixer_shared_decode_simple_stretch(float slider)
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])
void dt_iop_channelmixer_shared_white_preserving_from_sliders(GtkWidget *const widgets[6], dt_iop_channelmixer_shared_white_preserving_params_t *white_preserving)
void dt_iop_channelmixer_shared_simple_from_sliders(GtkWidget *const widgets[6], dt_iop_channelmixer_shared_simple_params_t *simple)
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])
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])
dt_iop_channelmixer_shared_simple_probe_t
@ DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_2
@ DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_AXIS_1
@ DT_IOP_CHANNELMIXER_SHARED_SIMPLE_PROBE_ROTATION
float dt_iop_channelmixer_shared_decode_simple_coupling_amount(float slider)
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)
void dt_iop_channelmixer_shared_simple_probe_source(dt_iop_channelmixer_shared_simple_probe_t probe, float source[3])
float dt_iop_channelmixer_shared_encode_simple_stretch(float stretch)
void dt_iop_channelmixer_shared_primaries_to_sliders(const dt_iop_channelmixer_shared_primaries_params_t *primaries, GtkWidget *const widgets[9])
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)
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])
gboolean dt_iop_channelmixer_shared_white_preserving_to_matrix(dt_iop_channelmixer_shared_primaries_basis_t basis, const dt_iop_channelmixer_shared_white_preserving_params_t *white_preserving, float M[3][3])
Build the mixer matrix of a white-preserving primaries state.
float dt_iop_channelmixer_shared_encode_simple_coupling_amount(float amount)
void dt_iop_channelmixer_shared_set_matrix(float rows[3][3], const float M[3][3])
void dt_iop_channelmixer_shared_simple_to_sliders(const dt_iop_channelmixer_shared_simple_params_t *simple, GtkWidget *const widgets[6])
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])
void dt_iop_channelmixer_shared_simple_from_matrix(const float M[3][3], dt_iop_channelmixer_shared_simple_params_t *simple)
void dt_iop_channelmixer_shared_mul3x3(const float A[3][3], const float B[3][3], float C[3][3])
gboolean dt_iop_channelmixer_shared_rows_are_normalized(const gboolean normalize[3])
dt_iop_channelmixer_shared_primaries_basis_t dt_iop_channelmixer_shared_primaries_basis_from_adaptation(dt_adaptation_t adaptation)
float dt_iop_channelmixer_shared_wrap_pi(float angle)
float dt_iop_channelmixer_shared_roundtrip_error(const float M[3][3], const float roundtrip[3][3])
dt_iop_channelmixer_shared_primaries_basis_t
@ DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_CAT16
@ DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_RGB
@ DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_BRADFORD
@ DT_IOP_CHANNELMIXER_SHARED_PRIMARIES_BASIS_XYZ
gboolean dt_iop_channelmixer_shared_white_preserving_from_matrix(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.
void dt_iop_channelmixer_shared_white_preserving_to_sliders(const dt_iop_channelmixer_shared_white_preserving_params_t *white_preserving, GtkWidget *const widgets[6])
gboolean dt_iop_channelmixer_shared_get_matrix(const float rows[3][3], const gboolean normalize[3], gboolean force_normalize, float M[3][3])
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.
void dt_iop_channelmixer_shared_paint_temperature_slider(GtkWidget *widget, float temperature_min, float temperature_max)
void dt_iop_channelmixer_shared_simple_to_matrix(const dt_iop_channelmixer_shared_simple_params_t *simple, float M[3][3])
void dt_iop_channelmixer_shared_primaries_from_sliders(GtkWidget *const widgets[9], dt_iop_channelmixer_shared_primaries_params_t *primaries)
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])
float dt_iop_channelmixer_shared_wrap_half_pi(float angle)
static const dt_aligned_pixel_simd_t const dt_adaptation_t adaptation
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
static const float const float C
static const dt_colormatrix_t M
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
White-preserving primaries model : per-primary rotation and saturation, no white freedom.
A profile reduced to the arithmetic the pixel loop can run: two matrices and six tone-curve LUTs,...