60#ifdef GDK_WINDOWING_QUARTZ
107 return _(
"colorize");
137 _(
"linear or non-linear, Lab, display-referred"),
138 _(
"non-linear, Lab"),
139 _(
"non-linear, Lab, display-referred"));
143 void *new_params,
const int new_version)
145 if(old_version == 1 && new_version == 2)
169 const float L =
d->L;
170 const float a =
d->a;
171 const float b =
d->b;
172 const float mix =
d->mix;
173 const float Lmlmix =
L - (
mix * 100.0f) / 2.0f;
178 const int stride =
ch * roi_out->
width;
180 in = (
float *)ivoid + (
size_t)
k * stride;
181 out = (
float *)
ovoid + (
size_t)
k * stride;
183 for(
int l = 0; l < stride; l +=
ch)
185 out[l + 0] = Lmlmix + in[l + 0] *
mix;
188 out[l + 3] = in[l + 3];
209 gtk_widget_queue_draw(
g->saturation);
219 float H = .0f,
S = .0f,
L = .0f;
226 if(fabsf(
p->hue -
H) < 0.0001f && fabsf(
p->saturation -
S) < 0.0001f)
264 XYZ[0] = (
rgb[0] * 0.5767309f) + (
rgb[1] * 0.1855540f) + (
rgb[2] * 0.1881852f);
265 XYZ[1] = (
rgb[0] * 0.2973769f) + (
rgb[1] * 0.6273491f) + (
rgb[2] * 0.0752741f);
266 XYZ[2] = (
rgb[0] * 0.0270343f) + (
rgb[1] * 0.0706872f) + (
rgb[2] * 0.9911085f);
272 XYZ[0] = (
rgb[0] * 0.4360747f) + (
rgb[1] * 0.3850649f) + (
rgb[2] * 0.1430804f);
273 XYZ[1] = (
rgb[0] * 0.2225045f) + (
rgb[1] * 0.7168786f) + (
rgb[2] * 0.0606169f);
274 XYZ[2] = (
rgb[0] * 0.0139322f) + (
rgb[1] * 0.0971045f) + (
rgb[2] * 0.7141733f);
283 d->mix =
p->source_lightness_mix / 100.0f;
330 gtk_widget_set_tooltip_text(
g->hue, _(
"select the hue tone"));
336 gtk_widget_set_tooltip_text(
g->saturation, _(
"select the saturation shadow tone"));
340 gtk_widget_set_tooltip_text(
g->lightness, _(
"lightness of color"));
344 gtk_widget_set_tooltip_text(
g->source_mix, _(
"mix value of source lightness"));
void dt_bauhaus_slider_set_stop(GtkWidget *widget, float stop, float r, float g, float b)
void dt_bauhaus_slider_set_feedback(GtkWidget *widget, int feedback)
void dt_bauhaus_slider_set(GtkWidget *widget, float pos)
void dt_bauhaus_slider_set_format(GtkWidget *widget, const char *format)
void dt_bauhaus_slider_set_factor(GtkWidget *widget, float factor)
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep)
GtkWidget * dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
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)
void init(dt_iop_module_t *module)
const char ** description(struct dt_iop_module_t *self)
__DT_CLONE_TARGETS__ int process(struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid)
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void gui_reset(struct dt_iop_module_t *self)
void gui_update(struct dt_iop_module_t *self)
void gui_init(struct dt_iop_module_t *self)
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
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)
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
static void update_saturation_slider_end_color(GtkWidget *slider, float hue)
void color_picker_apply(dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
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 rgb2hsl(const dt_aligned_pixel_t rgb, float *h, float *s, float *l)
void hsl2rgb(dt_aligned_pixel_t rgb, float h, float s, float l)
static dt_aligned_pixel_t rgb
dt_XYZ_to_sRGB(XYZ, result)
static dt_aligned_pixel_t XYZ
static dt_aligned_pixel_t Lab
const dt_colormatrix_t dt_aligned_pixel_t out
#define dt_free_align(ptr)
static void * dt_calloc_align(size_t size)
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
#define __DT_CLONE_TARGETS__
#define __OMP_PARALLEL_FOR__(...)
#define dt_dev_add_history_item(dev, module, enable, redraw)
void dt_iop_default_init(dt_iop_module_t *module)
const char ** dt_iop_set_description(dt_iop_module_t *module, const char *main_text, const char *purpose, const char *input, const char *process, const char *output)
@ IOP_FLAGS_INCLUDE_IN_STYLES
@ IOP_FLAGS_SUPPORTS_BLENDING
#define IOP_GUI_ALLOC(module)
GtkWidget * dt_bauhaus_slider_from_params(dt_iop_module_t *self, const char *param)
static float mix(const float a, const float b, const float t)
float *const restrict const size_t k
float *const restrict const size_t const size_t ch
float dt_aligned_pixel_t[4]
struct _GtkWidget GtkWidget
struct dt_gui_gtk_t * gui
struct dt_develop_t * develop
struct dt_iop_module_t *void * data
dt_iop_buffer_type_t datatype
float source_lightness_mix
float source_lightness_mix
dt_iop_params_t * default_params
dt_iop_gui_data_t * gui_data
dt_aligned_pixel_t picked_color
Region of interest passed through the pixelpipe.