62#ifdef GDK_WINDOWING_QUARTZ
108 return _(
"colorize");
138 _(
"linear or non-linear, Lab, display-referred"),
139 _(
"non-linear, Lab"),
140 _(
"non-linear, Lab, display-referred"));
144 void *new_params,
const int new_version)
146 if(old_version == 1 && new_version == 2)
170 const float L =
d->L;
171 const float a =
d->a;
172 const float b =
d->b;
173 const float mix =
d->mix;
174 const float Lmlmix =
L - (
mix * 100.0f) / 2.0f;
179 const int stride =
ch * roi_out->
width;
181 in = (
float *)ivoid + (
size_t)
k * stride;
182 out = (
float *)
ovoid + (
size_t)
k * stride;
184 for(
int l = 0; l < stride; l +=
ch)
186 out[l + 0] = Lmlmix + in[l + 0] *
mix;
189 out[l + 3] = in[l + 3];
210 gtk_widget_queue_draw(
g->saturation);
220 float H = .0f,
S = .0f,
L = .0f;
227 if(fabsf(
p->hue -
H) < 0.0001f && fabsf(
p->saturation -
S) < 0.0001f)
265 XYZ[0] = (
rgb[0] * 0.5767309f) + (
rgb[1] * 0.1855540f) + (
rgb[2] * 0.1881852f);
266 XYZ[1] = (
rgb[0] * 0.2973769f) + (
rgb[1] * 0.6273491f) + (
rgb[2] * 0.0752741f);
267 XYZ[2] = (
rgb[0] * 0.0270343f) + (
rgb[1] * 0.0706872f) + (
rgb[2] * 0.9911085f);
273 XYZ[0] = (
rgb[0] * 0.4360747f) + (
rgb[1] * 0.3850649f) + (
rgb[2] * 0.1430804f);
274 XYZ[1] = (
rgb[0] * 0.2225045f) + (
rgb[1] * 0.7168786f) + (
rgb[2] * 0.0606169f);
275 XYZ[2] = (
rgb[0] * 0.0139322f) + (
rgb[1] * 0.0971045f) + (
rgb[2] * 0.7141733f);
284 d->mix =
p->source_lightness_mix / 100.0f;
331 gtk_widget_set_tooltip_text(
g->hue, _(
"select the hue tone"));
337 gtk_widget_set_tooltip_text(
g->saturation, _(
"select the saturation shadow tone"));
341 gtk_widget_set_tooltip_text(
g->lightness, _(
"lightness of color"));
345 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)
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)
Convert RGB to HSL. Common helper used by iop modules.
void hsl2rgb(dt_aligned_pixel_t rgb, float h, float s, float l)
Convert HSL back to RGB. Common helper used by iop modules.
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
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_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
GtkWidget * dt_bauhaus_slider_from_params(dt_iop_module_t *self, const char *param)
static dt_iop_gui_data_t * dt_iop_gui_data(const struct dt_iop_module_t *m)
The module's GUI data blob, NULL-safe for headless callers: IOP process() implementations read it for...
#define IOP_GUI_ALLOC(module)
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
#define dt_free_align(ptr)
Release memory from dt_alloc_align() and set ptr to NULL.
static void * dt_calloc_align(size_t size)
dt_alloc_align() followed by a zero fill.
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
DT_MODULE() for a module whose params struct is introspected.
#define __OMP_PARALLEL_FOR__(...)
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
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
struct dt_develop_t * dev
dt_aligned_pixel_t picked_color
Region of interest passed through the pixelpipe.
#define __DT_CLONE_TARGETS__