Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
channelmixerrgb_shared.h
Go to the documentation of this file.
1#ifndef DT_IOP_CHANNELMIXERRGB_SHARED_H
2#define DT_IOP_CHANNELMIXERRGB_SHARED_H
3
6
7#include <glib.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef struct _GtkWidget GtkWidget;
14
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
18// Smallest chromaticity triangle, as a fraction of the untouched basis triangle, that the
19// white-preserving model accepts before calling the primaries degenerate.
20#define DT_IOP_CHANNELMIXER_SHARED_MIN_FOOTPRINT 0.02f
21
29
36
46
59
81
82float dt_iop_channelmixer_shared_wrap_pi(float angle);
91 GtkWidget *const widgets[6]);
95 GtkWidget *const widgets[9]);
97 GtkWidget *const widgets[6], dt_iop_channelmixer_shared_white_preserving_params_t *white_preserving);
99 const dt_iop_channelmixer_shared_white_preserving_params_t *white_preserving, GtkWidget *const widgets[6]);
100
102gboolean dt_iop_channelmixer_shared_get_matrix(const float rows[3][3], const gboolean normalize[3],
103 gboolean force_normalize, float M[3][3]);
104void dt_iop_channelmixer_shared_set_matrix(float rows[3][3], const float M[3][3]);
105void dt_iop_channelmixer_shared_mul3x3(const float A[3][3], const float B[3][3], float C[3][3]);
106
110 float M[3][3]);
111float dt_iop_channelmixer_shared_roundtrip_error(const float M[3][3], const float roundtrip[3][3]);
112float dt_iop_channelmixer_shared_roundtrip_error_relative(const float M[3][3], const float roundtrip[3][3]);
113
118 float M[3][3]);
120 const float M[3][3],
124 const dt_iop_channelmixer_shared_white_preserving_params_t *white_preserving, float M[3][3]);
126 dt_iop_channelmixer_shared_primaries_basis_t basis, const float M[3][3],
128
131 const dt_iop_order_iccprofile_info_t *work_profile,
132 const dt_iop_order_iccprofile_info_t *display_profile,
133 dt_aligned_pixel_t display_rgb);
135 const dt_iop_order_iccprofile_info_t *work_profile,
136 const dt_iop_order_iccprofile_info_t *display_profile,
137 float display_rgb[3]);
138void dt_iop_channelmixer_shared_paint_temperature_slider(GtkWidget *widget, float temperature_min,
139 float temperature_max);
141 const dt_iop_order_iccprofile_info_t *work_profile,
142 const dt_iop_order_iccprofile_info_t *display_profile,
143 float r, float g, float b, gboolean normalize,
144 const float row[3], GtkWidget *const widgets[3]);
146 const dt_iop_order_iccprofile_info_t *work_profile,
147 const dt_iop_order_iccprofile_info_t *display_profile,
149 GtkWidget *const widgets[6]);
152 const dt_iop_order_iccprofile_info_t *display_profile,
154 const dt_iop_channelmixer_shared_primaries_params_t *primaries, GtkWidget *const widgets[9]);
157 const dt_iop_order_iccprofile_info_t *display_profile,
159 const dt_iop_channelmixer_shared_white_preserving_params_t *white_preserving, GtkWidget *const widgets[6]);
160
161#ifdef __cplusplus
162}
163#endif
164#endif // DT_IOP_CHANNELMIXERRGB_SHARED_H
static __DT_CLONE_TARGETS__ void normalize(float *const buffer, const size_t width, const size_t height, const float norm)
Definition blurs.c:351
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
#define B(y, x)
#define A(y, x)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
static const float const float C
static const int row
static const dt_colormatrix_t M
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
Definition simd.h:53
const float r
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,...