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
147OPTIONAL(int, mouse_moved, struct dt_iop_module_t *self, double x, double y, double pressure, int which);
148OPTIONAL(int, button_released, struct dt_iop_module_t *self, double x, double y, int which, uint32_t state);
149OPTIONAL(int, button_pressed, struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type,
150 uint32_t state);
151
152OPTIONAL(int, scrolled, struct dt_iop_module_t *self, double x, double y, int up, uint32_t state);
153OPTIONAL(void, configure, struct dt_iop_module_t *self, int width, int height);
154
155OPTIONAL(void, init, struct dt_iop_module_t *self); // this MUST set params_size!
156DEFAULT(void, cleanup, struct dt_iop_module_t *self);
157
159DEFAULT(void, init_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
160 struct dt_dev_pixelpipe_iop_t *piece);
164DEFAULT(void, commit_params, struct dt_iop_module_t *self, dt_iop_params_t *params, struct dt_dev_pixelpipe_t *pipe,
165 struct dt_dev_pixelpipe_iop_t *piece);
168
174DEFAULT(gboolean, has_defaults, struct dt_iop_module_t *self);
175
177DEFAULT(gboolean, runtime_data_hash, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
178 const struct dt_dev_pixelpipe_iop_t *piece);
179
182
184DEFAULT(void, cleanup_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
185 struct dt_dev_pixelpipe_iop_t *piece);
186OPTIONAL(void, modify_roi_in, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
187 struct dt_dev_pixelpipe_iop_t *piece,
188 const struct dt_iop_roi_t *roi_out, struct dt_iop_roi_t *roi_in);
189OPTIONAL(void, modify_roi_out, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
190 struct dt_dev_pixelpipe_iop_t *piece,
191 struct dt_iop_roi_t *roi_out, const struct dt_iop_roi_t *roi_in);
192OPTIONAL(int, legacy_params, struct dt_iop_module_t *self, const void *const old_params, const int old_version,
193 void *new_params, const int new_version);
194// allow to select a shape inside an iop
195OPTIONAL(void, masks_selection_changed, struct dt_iop_module_t *self, const int form_selected_id);
196
197
216REQUIRED(int, process, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
217 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o);
219DEFAULT(int, process_tiling, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
220 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o,
221 const int bpp);
222
223#ifdef HAVE_OPENCL
224
243OPTIONAL(int, process_cl, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
244 const struct dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out);
246OPTIONAL(int, process_tiling_cl, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
247 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i,
248 void *const o, const int bpp);
249#endif
250
255DEFAULT(int, distort_transform, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
256 const struct dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count);
259 const struct dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count);
260
261OPTIONAL(void, distort_mask, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
262 struct dt_dev_pixelpipe_iop_t *piece, const float *const in, float *const out,
263 const struct dt_iop_roi_t *const roi_in, const struct dt_iop_roi_t *const roi_out);
264
265// introspection related callbacks, will be auto-implemented if DT_MODULE_INTROSPECTION() is used,
266OPTIONAL(int, introspection_init, struct dt_iop_module_so_t *self, int api_version);
267DEFAULT(dt_introspection_t *, get_introspection, void);
268DEFAULT(dt_introspection_field_t *, get_introspection_linear, void);
269DEFAULT(void *, get_p, const void *param, const char *name);
270DEFAULT(dt_introspection_field_t *, get_f, const char *name);
271
272// optional preference entry to add at the bottom of the preset menu
273OPTIONAL(void, set_preferences, void *menu, struct dt_iop_module_t *self);
274
275// Perform checks on image type/metadata to forcefully self-enable or self-disable a module
276// depending on input image. current_state will usually be self->enabled but can also be tied
277// to history enabled state.
278// Returns final enabled/disabled state after correction
279OPTIONAL(gboolean, force_enable, struct dt_iop_module_t *self, const gboolean current_state);
280
290
291OPTIONAL(int, populate_masks_context_menu, struct dt_iop_module_t *self, GtkWidget *menu, const int formid,const float pzx, const float pzy);
292
302OPTIONAL(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);
303
304#ifdef FULL_API_H
305
306#pragma GCC visibility pop
307
308#ifdef __cplusplus
309}
310#endif
311
312#endif // FULL_API_H
313
314// clang-format off
315// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
316// vim: shiftwidth=2 expandtab tabstop=2 cindent
317// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
318// 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:5603
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:1048
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:4995
__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:3325
void reload_defaults(dt_iop_module_t *module)
Definition ashift.c:5665
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:987
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:5641
void gui_update(struct dt_iop_module_t *self)
Definition ashift.c:5654
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:1018
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:4609
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
Definition ashift.c:5078
int button_released(struct dt_iop_module_t *self, double x, double y, int which, uint32_t state)
Definition ashift.c:4824
void cleanup_global(dt_iop_module_so_t *module)
Definition ashift.c:5780
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:3936
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:1168
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5648
void init_global(dt_iop_module_so_t *module)
Definition ashift.c:5767
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:3461
int mouse_moved(struct dt_iop_module_t *self, double x, double y, double pressure, int which)
Definition ashift.c:4386
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:1107
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:5632
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 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
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 cacorrect.c:139
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)
Definition channelmixerrgb.c:4381
gboolean has_defaults(struct dt_iop_module_t *self)
Definition clipping.c:1551
void set_preferences(void *menu, dt_lib_module_t *self)
Definition collect.c:3286
int mouse_leave(struct dt_iop_module_t *self)
Definition colorequal.c:1719
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 colorin.c:214
const float i
Definition colorspaces_inline_conversions.h:440
const dt_colormatrix_t dt_aligned_pixel_t out
Definition colorspaces_inline_conversions.h:42
int type
Definition common/metadata.c:62
char * name
Definition common/metadata.c:61
void configure(dt_view_t *self, int wd, int ht)
Definition darkroom.c:3103
gboolean force_enable(struct dt_iop_module_t *self, const gboolean current_state)
Definition demosaic.c:2066
void dt_iop_params_t
Definition dev_history.h:41
gboolean module_will_remove(dt_iop_module_t *self)
Hook called before module removal from history stack.
Definition drawlayer.c:2744
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
Definition imageio/format/pdf.c:88
static void gui_cleanup(dt_lib_import_t *d)
Definition import.c:1319
static void gui_init(dt_lib_import_t *d)
Definition import.c:1001
static const float x
Definition iop_profile.h:235
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
Definition tiling.py:1
void masks_selection_changed(struct dt_iop_module_t *self, const int form_selected_id)
Definition retouch.c:1973
void post_history_commit(dt_iop_module_t *self)
Definition retouch.c:786
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:4456
struct _GtkWidget GtkWidget
Definition splash.h:29
const float uint32_t state[4]
Definition src/develop/noise_generator.h:72
const float const float param
Definition src/develop/noise_generator.h:108
Definition pixelpipe_hb.h:96
Definition pixelpipe_hb.h:218
Definition tiling.h:39
The dt_gui_module_t type is the intersection between a dt_lib_module_t and a dt_iop_module_t structur...
Definition gui_module_api.h:42
Definition introspection.h:241
Definition format.h:52
Definition imageop.h:220
Definition imageop.h:246
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
Definition introspection.h:218