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;
61struct dt_iop_roi_t;
64struct dt_gui_module_t;
65struct _GtkWidget;
66
67#ifndef DT_IOP_PARAMS_T
68#define DT_IOP_PARAMS_T
69typedef void dt_iop_params_t;
70#endif
71
72/* early definition of modules to do type checking */
73
74#pragma GCC visibility push(default)
75
76#endif // FULL_API_H
77
84
86REQUIRED(const char *, name, void);
88DEFAULT(const char *, aliases, void);
92DEFAULT(int, flags, void);
94DEFAULT(const char *, deprecated_msg, void);
95
97DEFAULT(int, iop_focus, struct dt_gui_module_t *module, gboolean toggle);
98
100DEFAULT(const char **, description, struct dt_iop_module_t *self);
101
104
106DEFAULT(void, input_format, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
107 struct dt_dev_pixelpipe_iop_t *piece, struct dt_iop_buffer_dsc_t *dsc);
109DEFAULT(void, output_format, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
110 struct dt_dev_pixelpipe_iop_t *piece, struct dt_iop_buffer_dsc_t *dsc);
111
114 const struct dt_dev_pixelpipe_iop_t *piece);
116DEFAULT(int, blend_colorspace, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
117 const struct dt_dev_pixelpipe_iop_t *piece);
118
120DEFAULT(void, tiling_callback, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
121 const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling);
122
127OPTIONAL(void, gui_reset, struct dt_iop_module_t *self);
129OPTIONAL(void, gui_init, struct dt_iop_module_t *self);
131OPTIONAL(void, color_picker_apply, struct dt_iop_module_t *self, struct _GtkWidget *picker,
132 struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece);
134OPTIONAL(void, gui_changed, struct dt_iop_module_t *self, GtkWidget *widget, void *previous);
138OPTIONAL(void, gui_post_expose, struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height,
139 int32_t pointerx, int32_t pointery);
141OPTIONAL(void, gui_focus, struct dt_iop_module_t *self, gboolean in);
144
149OPTIONAL(void, quiesce, struct dt_iop_module_t *self);
150
153OPTIONAL(int, mouse_moved, struct dt_iop_module_t *self, double x, double y, double pressure, int which);
154OPTIONAL(int, button_released, struct dt_iop_module_t *self, double x, double y, int which, uint32_t state);
155OPTIONAL(int, button_pressed, struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type,
156 uint32_t state);
157OPTIONAL(int, key_pressed, struct dt_iop_module_t *self, GdkEventKey *event);
158
159OPTIONAL(int, scrolled, struct dt_iop_module_t *self, double x, double y, int up, uint32_t state);
160OPTIONAL(void, configure, struct dt_iop_module_t *self, int width, int height);
161
162OPTIONAL(void, init, struct dt_iop_module_t *self); // this MUST set params_size!
163DEFAULT(void, cleanup, struct dt_iop_module_t *self);
164
166DEFAULT(void, init_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
167 struct dt_dev_pixelpipe_iop_t *piece);
171DEFAULT(void, commit_params, struct dt_iop_module_t *self, dt_iop_params_t *params, struct dt_dev_pixelpipe_t *pipe,
172 struct dt_dev_pixelpipe_iop_t *piece);
175
181DEFAULT(gboolean, has_defaults, struct dt_iop_module_t *self);
182
184DEFAULT(gboolean, runtime_data_hash, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
185 const struct dt_dev_pixelpipe_iop_t *piece);
186
189
191DEFAULT(void, cleanup_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
192 struct dt_dev_pixelpipe_iop_t *piece);
193OPTIONAL(void, modify_roi_in, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
194 struct dt_dev_pixelpipe_iop_t *piece,
195 const struct dt_iop_roi_t *roi_out, struct dt_iop_roi_t *roi_in);
196OPTIONAL(void, modify_roi_out, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
197 struct dt_dev_pixelpipe_iop_t *piece,
198 struct dt_iop_roi_t *roi_out, const struct dt_iop_roi_t *roi_in);
199OPTIONAL(int, legacy_params, struct dt_iop_module_t *self, const void *const old_params, const int old_version,
200 void *new_params, const int new_version);
201// allow to select a shape inside an iop
202OPTIONAL(void, masks_selection_changed, struct dt_iop_module_t *self, const int form_selected_id);
203
204
223REQUIRED(int, process, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
224 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o);
226DEFAULT(int, process_tiling, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
227 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o,
228 const int bpp);
229
230#ifdef HAVE_OPENCL
231
250OPTIONAL(int, process_cl, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
251 const struct dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out);
253OPTIONAL(int, process_tiling_cl, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
254 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i,
255 void *const o, const int bpp);
256#endif
257
262DEFAULT(int, distort_transform, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
263 const struct dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count);
266 const struct dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count);
267
268OPTIONAL(void, distort_mask, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
269 struct dt_dev_pixelpipe_iop_t *piece, const float *const in, float *const out,
270 const struct dt_iop_roi_t *const roi_in, const struct dt_iop_roi_t *const roi_out);
271
272// introspection related callbacks, will be auto-implemented if DT_MODULE_INTROSPECTION() is used,
273OPTIONAL(int, introspection_init, struct dt_iop_module_so_t *self, int api_version);
274DEFAULT(dt_introspection_t *, get_introspection, void);
275DEFAULT(dt_introspection_field_t *, get_introspection_linear, void);
276DEFAULT(void *, get_p, const void *param, const char *name);
277DEFAULT(dt_introspection_field_t *, get_f, const char *name);
278
279// optional preference entry to add at the bottom of the preset menu
280OPTIONAL(void, set_preferences, void *menu, struct dt_iop_module_t *self);
281
282// Perform checks on image type/metadata to forcefully self-enable or self-disable a module
283// depending on input image. current_state will usually be self->enabled but can also be tied
284// to history enabled state.
285// Returns final enabled/disabled state after correction
286OPTIONAL(gboolean, force_enable, struct dt_iop_module_t *self, const gboolean current_state);
287
297
298OPTIONAL(int, populate_masks_context_menu, struct dt_iop_module_t *self, GtkWidget *menu, const int formid,const float pzx, const float pzy);
299
309OPTIONAL(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);
310
311#ifdef FULL_API_H
312
313#pragma GCC visibility pop
314
315#ifdef __cplusplus
316}
317#endif
318
319#endif // FULL_API_H
320
321// clang-format off
322// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
323// vim: shiftwidth=2 expandtab tabstop=2 cindent
324// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
325// clang-format on
int operation_tags()
Definition ashift.c:180
int operation_tags_filter()
Definition ashift.c:185
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:5492
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:1052
const char ** description(struct dt_iop_module_t *self)
Definition ashift.c:160
int default_group()
Definition ashift.c:175
int scrolled(struct dt_iop_module_t *self, double x, double y, int up, uint32_t state)
Definition ashift.c:4895
__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:3153
void reload_defaults(dt_iop_module_t *module)
Definition ashift.c:5565
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:991
const char * aliases()
Definition ashift.c:155
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5540
void gui_update(struct dt_iop_module_t *self)
Definition ashift.c:5553
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:1022
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:4460
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
Definition ashift.c:4983
int button_released(struct dt_iop_module_t *self, double x, double y, int which, uint32_t state)
Definition ashift.c:4712
void cleanup_global(dt_iop_module_so_t *module)
Definition ashift.c:5680
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:191
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:3761
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:1172
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5547
void init_global(dt_iop_module_so_t *module)
Definition ashift.c:5668
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:3289
int mouse_moved(struct dt_iop_module_t *self, double x, double y, double pressure, int which)
Definition ashift.c:4213
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:1111
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:5531
void init_presets(dt_iop_module_so_t *self)
Definition atrous.c:775
void gui_reset(dt_imageio_module_format_t *self)
Definition avif.c:877
void cleanup(dt_imageio_module_format_t *self)
Definition avif.c:164
void init(dt_imageio_module_format_t *self)
Definition avif.c:151
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:75
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:82
void gui_focus(struct dt_iop_module_t *self, gboolean in)
Definition basicadj.c:562
void change_image(struct dt_iop_module_t *self)
Definition basicadj.c:567
const char * deprecated_msg()
Definition basicadj.c:153
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:453
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
gboolean force_enable(struct dt_iop_module_t *self, const gboolean current_state)
Definition cacorrect.c:1417
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:1551
int mouse_leave(struct dt_iop_module_t *self)
const dt_colormatrix_t dt_aligned_pixel_t out
int type
char * name
void configure(dt_view_t *self, int wd, int ht)
Definition darkroom.c:3712
void dt_iop_params_t
Definition dev_history.h:41
void quiesce(dt_iop_module_t *self)
Destroy GUI resources and stop background worker.
Definition drawlayer.c:3418
gboolean module_will_remove(dt_iop_module_t *self)
Hook called before module removal from history stack.
Definition drawlayer.c:2874
void set_preferences(void *menu, dt_lib_module_t *self)
Definition export.c:1067
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:290
int bpp
static void gui_cleanup(dt_lib_import_t *d)
Definition import.c:1414
static void gui_init(dt_lib_import_t *d)
Definition import.c:1047
static const float x
int key_pressed(struct dt_iop_module_t *self, GdkEventKey *event)
Definition liquify.c:3652
dt_mipmap_buffer_dsc_flags flags
Definition mipmap_cache.c:4
#define REQUIRED(return_type, function_name,...)
Definition module_api.h:80
#define DEFAULT(return_type, function_name,...)
Definition module_api.h:81
#define OPTIONAL(return_type, function_name,...)
Definition module_api.h:79
void masks_selection_changed(struct dt_iop_module_t *self, const int form_selected_id)
Definition retouch.c:1912
void post_history_commit(dt_iop_module_t *self)
Definition retouch.c:762
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:4413
struct _GtkWidget GtkWidget
Definition splash.h:29
const float uint32_t state[4]
const float const float param
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 imageop.h:72
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:645