130 return _(
"silly example");
172 void *new_params,
const int new_version)
176 typedef struct dt_iop_useless_params_v2_t
180 } dt_iop_useless_params_v2_t;
182 if(old_version == 2 && new_version == 3)
184 dt_iop_useless_params_v2_t *o = (dt_iop_useless_params_v2_t *)old_params;
185 dt_iop_useless_params_v3_t *
n = (dt_iop_useless_params_v3_t *)new_params;
187 memcpy(
n, o,
sizeof *o);
193 typedef struct dt_iop_useless_params_v1_t
196 } dt_iop_useless_params_v1_t;
198 if(old_version == 1 && new_version == 2)
200 dt_iop_useless_params_v1_t *o = (dt_iop_useless_params_v1_t *)old_params;
201 dt_iop_useless_params_v2_t *
n = (dt_iop_useless_params_v2_t *)new_params;
203 n->checker_scale = o->checker_scale;
262 float *points,
size_t points_count)
266 const float adjx = 0.0 *
d->factor;
267 const float adjy = 0.0;
270 if (adjx == 0.0 && adjy == 0.0)
return 1;
273 for(
size_t i = 0;
i < points_count * 2;
i += 2)
276 points[
i + 1] -= adjy;
286 float *points,
size_t points_count)
290 const float adjx = 0.0 *
d->factor;
291 const float adjy = 0.0;
294 if (adjx == 0.0 && adjy == 0.0)
return 1;
297 for(
size_t i = 0;
i < points_count * 2;
i += 2)
300 points[
i + 1] += adjy;
359#pragma omp parallel for default(firstprivate)
361 for(
int j = 0; j < roi_out->
height; j++)
363 float *in = ((
float *)ivoid)
367 float *out_mask = mask ? &(mask[(size_t)roi_out->
width * j]) : NULL;
368 for(
int i = 0;
i < roi_out->
width;
i++)
371 int wi = (roi_in->
x +
i) * scale, wj = (roi_in->
y + j) * scale;
372 if((wi /
d->checker_scale + wj /
d->checker_scale) & 1)
375 out[c] = in[c] * (1.0 -
d->factor);
390 const size_t mask_size =
sizeof(float) * (
size_t)roi_out->
width * roi_out->
height;
393 void *cache_data = NULL;
396 pipe->
type,
TRUE, &cache_data, &mask_entry);
417 memcpy(cache_data, mask, mask_size);
442 module->hide_enable_button = 1;
450 module->data = malloc(sizeof(dt_iop_useless_global_data_t));
519 if(picker ==
g->factor)
552 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
g->check),
p->check);
575 module->default_enabled = 0;
579 module->default_enabled = 1;
580 d->checker_scale = 3;
606 gboolean
enable = current_state;
612 else if(!is_raw && (self->
enabled))
677 gtk_widget_set_tooltip_text(
g->factor, _(
"adjust factor"));
690 gtk_box_pack_start(GTK_BOX(self->
widget), GTK_WIDGET(
g->extra),
TRUE,
TRUE, 0);
691 g_signal_connect(G_OBJECT(
g->extra),
"value-changed", G_CALLBACK(
extra_callback), self);
int distort_transform(dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, float *const restrict points, size_t points_count)
int distort_backtransform(dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count)
void dt_bauhaus_slider_set_soft_range(GtkWidget *widget, float soft_min, float soft_max)
void dt_bauhaus_slider_set_digits(GtkWidget *widget, int val)
void dt_bauhaus_slider_set_default(GtkWidget *widget, float def)
float dt_bauhaus_slider_get(GtkWidget *widget)
gboolean dt_bauhaus_combobox_set_from_value(GtkWidget *widget, int value)
void dt_bauhaus_slider_set_offset(GtkWidget *widget, float offset)
void dt_bauhaus_slider_set_step(GtkWidget *widget, float val)
void dt_bauhaus_slider_set(GtkWidget *widget, float pos)
void dt_bauhaus_widget_set_label(GtkWidget *widget, const char *label)
GtkWidget * dt_bauhaus_slider_new_with_range(dt_bauhaus_t *bh, dt_gui_module_t *self, float min, float max, float step, float defval, int digits)
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
GtkWidget * dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
const dt_colormatrix_t dt_aligned_pixel_t out
gboolean dt_image_is_raw(const dt_image_t *img)
void dt_control_queue_redraw_widget(GtkWidget *widget)
threadsafe request of redraw of specific widget. Use this function if you need to redraw a specific w...
#define dt_free_align(ptr)
static void * dt_calloc_align(size_t size)
static void copy_pixel(float *const __restrict__ out, const float *const __restrict__ in)
#define for_each_channel(_var,...)
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
#define dt_pixelpipe_cache_free_align(mem)
#define __DT_CLONE_TARGETS__
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_dev_add_history_item(dev, module, enable, redraw)
#define DT_GUI_BOX_SPACING
static gboolean enable(dt_image_t *image)
int dt_iop_alloc_image_buffers(struct dt_iop_module_t *const module, const struct dt_iop_roi_t *const roi_in, const struct dt_iop_roi_t *const roi_out,...)
void dt_iop_copy_image_roi(float *const __restrict__ out, const float *const __restrict__ in, const size_t ch, const dt_iop_roi_t *const __restrict__ roi_in, const dt_iop_roi_t *const __restrict__ roi_out, const int zero_pad)
#define DT_IMGSZ_CLEARBUF
gboolean dt_iop_is_raster_mask_used(dt_iop_module_t *module, int id)
void dt_iop_default_init(dt_iop_module_t *module)
float dt_dev_get_module_scale(const dt_dev_pixelpipe_t *const pipe, const dt_iop_roi_t *const roi_in)
@ IOP_FLAGS_INCLUDE_IN_STYLES
@ IOP_FLAGS_SUPPORTS_BLENDING
#define IOP_GUI_ALLOC(module)
GtkWidget * dt_bauhaus_toggle_from_params(dt_iop_module_t *self, const char *param)
GtkWidget * dt_bauhaus_slider_from_params(dt_iop_module_t *self, const char *param)
GtkWidget * dt_bauhaus_combobox_from_params(dt_iop_module_t *self, const char *param)
float *const restrict const size_t const size_t ch
uint64_t dt_dev_pixelpipe_raster_mask_hash(const dt_dev_pixelpipe_iop_t *piece, const int raster_mask_id)
void dt_dev_pixelpipe_cache_ref_count_entry(dt_dev_pixelpipe_cache_t *cache, gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Increase/Decrease the reference count on the cache line as to prevent LRU item removal....
int dt_dev_pixelpipe_cache_get(dt_dev_pixelpipe_cache_t *cache, const uint64_t hash, const size_t size, const char *name, const int id, const gboolean alloc, void **data, dt_pixel_cache_entry_t **entry)
Get a cache line from the cache.
int dt_dev_pixelpipe_cache_remove(dt_dev_pixelpipe_cache_t *cache, const gboolean force, dt_pixel_cache_entry_t *cache_entry)
Arbitrarily remove the cache entry matching hash. Entries having a reference count > 0 (inter-thread ...
void dt_dev_pixelpipe_cache_wrlock_entry(dt_dev_pixelpipe_cache_t *cache, gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Lock or release the write lock on the entry.
struct _GtkWidget GtkWidget
unsigned __int64 uint64_t
struct dt_dev_pixelpipe_cache_t * pixelpipe_cache
struct dt_gui_gtk_t * gui
struct dt_bauhaus_t * bauhaus
struct dt_develop_t * develop
dt_iop_buffer_dsc_t dsc_in
struct dt_iop_module_t *void * data
dt_dev_pixelpipe_type_t type
gboolean store_all_raster_masks
GArray * raster_mask_hashes
dt_iop_global_data_t * data
dt_iop_params_t * default_params
struct dt_iop_module_t::@31 raster_mask
struct dt_develop_t * dev
struct dt_iop_module_t::@31::@32 source
dt_iop_gui_data_t * gui_data
dt_aligned_pixel_t picked_color
Region of interest passed through the pixelpipe.
dt_iop_useless_type_t method
void tiling_callback(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling)
void init(dt_iop_module_t *module)
__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 reload_defaults(dt_iop_module_t *module)
void gui_update(dt_iop_module_t *self)
Refresh GUI controls from current params and configuration.
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void cleanup(dt_iop_module_t *module)
void gui_init(dt_iop_module_t *self)
static void extra_callback(GtkWidget *w, dt_iop_module_t *self)
commit_params(dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
void gui_cleanup(dt_iop_module_t *self)
void cleanup_global(dt_iop_module_so_t *module)
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
gboolean force_enable(struct dt_iop_module_t *self, const gboolean current_state)
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void init_global(dt_iop_module_so_t *module)
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)
static const char * mask_name