Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
iop_api.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2016 Roman Lebedev.
4 Copyright (C) 2016, 2019 Tobias Ellinghaus.
5 Copyright (C) 2017-2018 Edgardo Hoszowski.
6 Copyright (C) 2019-2021 Aldric Renaudin.
7 Copyright (C) 2019 Heiko Bauke.
8 Copyright (C) 2019 Marcus Rückert.
9 Copyright (C) 2020, 2025-2026 Aurélien PIERRE.
10 Copyright (C) 2020-2022 Diederik Ter Rahe.
11 Copyright (C) 2020-2022 Pascal Obry.
12 Copyright (C) 2021 luzpaz.
13 Copyright (C) 2022 Martin Bařinka.
14
15 darktable is free software: you can redistribute it and/or modify
16 it under the terms of the GNU Lesser General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19
20 darktable is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU Lesser General Public License for more details.
24
25 You should have received a copy of the GNU Lesser General Public License
26 along with darktable. If not, see <http://www.gnu.org/licenses/>.
27*/
28
34#include "common/module_api.h"
35
36#ifdef FULL_API_H
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
43
44#include <cairo/cairo.h>
45#include <gtk/gtk.h>
46#include <glib.h>
47#include <stdint.h>
48
49#ifdef HAVE_CONFIG_H
50#include "config.h"
51#endif
52
53#ifdef HAVE_OPENCL
54#include <CL/cl.h>
55#endif
56
58struct dt_iop_module_t;
62struct dt_iop_roi_t;
65struct dt_gui_module_t;
66struct _GtkWidget;
67
68#ifndef DT_IOP_PARAMS_T
69#define DT_IOP_PARAMS_T
70typedef void dt_iop_params_t;
71#endif
72
73/* early definition of modules to do type checking */
74
75#pragma GCC visibility push(default)
76
77#endif // FULL_API_H
78
85
87REQUIRED(const char *, name, void);
89DEFAULT(const char *, aliases, void);
93DEFAULT(int, flags, void);
95DEFAULT(const char *, deprecated_msg, void);
96
98DEFAULT(int, iop_focus, struct dt_gui_module_t *module, gboolean toggle);
99
101DEFAULT(const char **, description, struct dt_iop_module_t *self);
102
105
107DEFAULT(void, input_format, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
108 struct dt_dev_pixelpipe_iop_t *piece, struct dt_iop_buffer_dsc_t *dsc);
110DEFAULT(void, output_format, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
111 struct dt_dev_pixelpipe_iop_t *piece, struct dt_iop_buffer_dsc_t *dsc);
112
115 const struct dt_dev_pixelpipe_iop_t *piece);
117DEFAULT(int, blend_colorspace, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
118 const struct dt_dev_pixelpipe_iop_t *piece);
119
121DEFAULT(void, tiling_callback, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
122 const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling);
123
128OPTIONAL(void, gui_reset, struct dt_iop_module_t *self);
130OPTIONAL(void, gui_init, struct dt_iop_module_t *self);
132OPTIONAL(void, color_picker_apply, struct dt_iop_module_t *self, struct _GtkWidget *picker,
133 struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece);
135OPTIONAL(void, gui_changed, struct dt_iop_module_t *self, GtkWidget *widget, void *previous);
139OPTIONAL(void, gui_post_expose, struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height,
140 int32_t pointerx, int32_t pointery);
142OPTIONAL(void, gui_focus, struct dt_iop_module_t *self, gboolean in);
145
150OPTIONAL(void, quiesce, struct dt_iop_module_t *self);
151
154OPTIONAL(int, mouse_moved, struct dt_iop_module_t *self, double x, double y, double pressure, int which);
155OPTIONAL(int, button_released, struct dt_iop_module_t *self, double x, double y, int which, uint32_t state);
156OPTIONAL(int, button_pressed, struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type,
157 uint32_t state);
158OPTIONAL(int, key_pressed, struct dt_iop_module_t *self, GdkEventKey *event);
159
160OPTIONAL(int, scrolled, struct dt_iop_module_t *self, double x, double y, int up, uint32_t state);
161OPTIONAL(void, configure, struct dt_iop_module_t *self, int width, int height);
162
163OPTIONAL(void, init, struct dt_iop_module_t *self); // this MUST set params_size!
164DEFAULT(void, cleanup, struct dt_iop_module_t *self);
165
167DEFAULT(void, init_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
168 struct dt_dev_pixelpipe_iop_t *piece);
172DEFAULT(void, commit_params, struct dt_iop_module_t *self, dt_iop_params_t *params, struct dt_dev_pixelpipe_t *pipe,
173 struct dt_dev_pixelpipe_iop_t *piece);
176
182DEFAULT(gboolean, has_defaults, struct dt_iop_module_t *self);
183
200DEFAULT(gboolean, runtime_data_hash, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
201 const struct dt_dev_pixelpipe_iop_t *piece);
202
219OPTIONAL(gboolean, geometry_record, struct dt_iop_module_t *self, const void *params,
220 struct dt_geometry_record_t *record);
221
224
231
233DEFAULT(void, cleanup_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
234 struct dt_dev_pixelpipe_iop_t *piece);
235OPTIONAL(void, modify_roi_in, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
236 struct dt_dev_pixelpipe_iop_t *piece,
237 const struct dt_iop_roi_t *roi_out, struct dt_iop_roi_t *roi_in);
238OPTIONAL(void, modify_roi_out, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
239 struct dt_dev_pixelpipe_iop_t *piece,
240 struct dt_iop_roi_t *roi_out, const struct dt_iop_roi_t *roi_in);
241OPTIONAL(int, legacy_params, struct dt_iop_module_t *self, const void *const old_params, const int old_version,
242 void *new_params, const int new_version);
243// allow to select a shape inside an iop
244OPTIONAL(void, masks_selection_changed, struct dt_iop_module_t *self, const int form_selected_id);
245
246
265REQUIRED(int, process, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
266 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o);
268DEFAULT(int, process_tiling, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
269 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o,
270 const int bpp);
271
272#ifdef HAVE_OPENCL
273
292OPTIONAL(int, process_cl, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
293 const struct dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out);
295OPTIONAL(int, process_tiling_cl, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
296 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i,
297 void *const o, const int bpp);
298#endif
299
304DEFAULT(int, distort_transform, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
305 const struct dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count);
308 const struct dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count);
309
310OPTIONAL(void, distort_mask, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
311 struct dt_dev_pixelpipe_iop_t *piece, const float *const in, float *const out,
312 const struct dt_iop_roi_t *const roi_in, const struct dt_iop_roi_t *const roi_out);
313
314// introspection related callbacks, will be auto-implemented if DT_MODULE_INTROSPECTION() is used,
315OPTIONAL(int, introspection_init, struct dt_iop_module_so_t *self, int api_version);
316DEFAULT(dt_introspection_t *, get_introspection, void);
317DEFAULT(dt_introspection_field_t *, get_introspection_linear, void);
318DEFAULT(void *, get_p, const void *param, const char *name);
319DEFAULT(dt_introspection_field_t *, get_f, const char *name);
320
321// optional preference entry to add at the bottom of the preset menu
322OPTIONAL(void, set_preferences, void *menu, struct dt_iop_module_t *self);
323
324// Perform checks on image type/metadata to forcefully self-enable or self-disable a module
325// depending on input image. current_state will usually be self->enabled but can also be tied
326// to history enabled state.
327// Returns final enabled/disabled state after correction
328OPTIONAL(gboolean, force_enable, struct dt_iop_module_t *self, const gboolean current_state);
329
339
340OPTIONAL(int, populate_masks_context_menu, struct dt_iop_module_t *self, GtkWidget *menu, const int formid,const float pzx, const float pzy);
341
351OPTIONAL(void, autoset, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *i);
352
353#ifdef FULL_API_H
354
355#pragma GCC visibility pop
356
357#ifdef __cplusplus
358}
359#endif
360
361#endif // FULL_API_H
362
363// clang-format off
364// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
365// vim: shiftwidth=2 expandtab tabstop=2 cindent
366// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
367// clang-format on
int operation_tags()
Definition ashift.c:188
int operation_tags_filter()
Definition ashift.c:193
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)
Definition ashift.c:5613
void distort_mask(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece, const float *const in, float *const out, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out)
Definition ashift.c:1060
const char ** description(struct dt_iop_module_t *self)
Definition ashift.c:168
int default_group()
Definition ashift.c:183
int scrolled(struct dt_iop_module_t *self, double x, double y, int up, uint32_t state)
Definition ashift.c:4949
__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)
Definition ashift.c:3179
void reload_defaults(dt_iop_module_t *module)
Definition ashift.c:5828
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)
Definition ashift.c:999
const char * aliases()
Definition ashift.c:163
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5723
void gui_update(struct dt_iop_module_t *self)
Definition ashift.c:5736
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)
Definition ashift.c:1030
int button_pressed(struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type, uint32_t state)
Definition ashift.c:4508
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
Definition ashift.c:5037
int button_released(struct dt_iop_module_t *self, double x, double y, int which, uint32_t state)
Definition ashift.c:4765
void cleanup_global(dt_iop_module_so_t *module)
Definition ashift.c:5871
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:199
void gui_post_expose(struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
Definition ashift.c:3809
void modify_roi_in(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *const roi_out, dt_iop_roi_t *roi_in)
Definition ashift.c:1180
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5730
void init_global(dt_iop_module_so_t *module)
Definition ashift.c:5859
gboolean geometry_record(struct dt_iop_module_t *self, const void *params, dt_geometry_record_t *record)
Definition ashift.c:5701
int process_cl(struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out)
Definition ashift.c:3329
int mouse_moved(struct dt_iop_module_t *self, double x, double y, double pressure, int which)
Definition ashift.c:4259
void modify_roi_out(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece, dt_iop_roi_t *roi_out, const dt_iop_roi_t *roi_in)
Definition ashift.c:1119
gboolean runtime_data_hash(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5714
void init_presets(dt_iop_module_so_t *self)
Definition atrous.c:812
void gui_reset(dt_imageio_module_format_t *self)
Definition avif.c:883
void cleanup(dt_imageio_module_format_t *self)
Definition avif.c:170
void init(dt_imageio_module_format_t *self)
Definition avif.c:157
void output_format(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc)
Definition basebuffer.c:104
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)
Definition basebuffer.c:111
void gui_focus(struct dt_iop_module_t *self, gboolean in)
Definition basicadj.c:571
void change_image(struct dt_iop_module_t *self)
Definition basicadj.c:576
const char * deprecated_msg()
Definition basicadj.c:162
void color_picker_apply(dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition basicadj.c:462
gboolean force_enable(struct dt_iop_module_t *self, const gboolean current_state)
Definition cacorrect.c:1422
void autoset(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *i)
gboolean has_defaults(struct dt_iop_module_t *self)
Definition clipping.c:1743
int mouse_leave(struct dt_iop_module_t *self)
static const float x
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
const dt_colormatrix_t dt_aligned_pixel_t out
void configure(dt_view_t *self, int wd, int ht)
Definition darkroom.c:3260
void dt_iop_params_t
Definition dev_history.h:43
void quiesce(dt_iop_module_t *self)
Destroy GUI resources and stop background worker.
Definition drawlayer.c:3441
gboolean module_will_remove(dt_iop_module_t *self)
Hook called before module removal from history stack.
Definition drawlayer.c:2894
void set_preferences(void *menu, dt_lib_module_t *self)
Definition export.c:1057
void * legacy_params(dt_imageio_module_format_t *self, const void *const old_params, const size_t old_params_size, const int old_version, const int new_version, size_t *new_size)
Definition exr.cc:293
int bpp
static void gui_cleanup(dt_lib_import_t *d)
Definition import.c:1549
static void gui_init(dt_lib_import_t *d)
Definition import.c:1182
int key_pressed(struct dt_iop_module_t *self, GdkEventKey *event)
Definition liquify.c:3777
_lib_location_type_t type
Definition location.c:1
uint32_t width
Definition mipmap_cache.c:0
uint32_t height
Definition mipmap_cache.c:1
dt_mipmap_buffer_dsc_flags flags
Definition mipmap_cache.c:4
#define REQUIRED(return_type, function_name,...)
Definition module_api.h:153
#define DEFAULT(return_type, function_name,...)
Definition module_api.h:154
#define OPTIONAL(return_type, function_name,...)
Definition module_api.h:152
const char * name
Definition pdf.h:90
void masks_selection_changed(struct dt_iop_module_t *self, const int form_selected_id)
Definition retouch.c:1993
void post_history_commit(dt_iop_module_t *self)
Definition retouch.c:783
int populate_masks_context_menu(struct dt_iop_module_t *self, GtkWidget *menu, const int formid, const float pzx, const float pzy)
Definition retouch.c:4529
const float uint32_t state[4]
const float const float param
One module instance's contribution, as data.
Definition geometry.h:99
The dt_gui_module_t type is the intersection between a dt_lib_module_t and a dt_iop_module_t structur...
Region of interest passed through the pixelpipe.
Definition format.h:49
void commit_proxy(dt_iop_module_t *self)
int process_tiling(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const int bpp)
int process_tiling_cl(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const int bpp)
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)
Definition atrous.c:664