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#include "common/module_api.h"
29
30#ifdef FULL_API_H
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
37
38#include <cairo/cairo.h>
39#include <gtk/gtk.h>
40#include <glib.h>
41#include <stdint.h>
42
43#ifdef HAVE_CONFIG_H
44#include "config.h"
45#endif
46
47#ifdef HAVE_OPENCL
48#include <CL/cl.h>
49#endif
50
52struct dt_iop_module_t;
55struct dt_iop_roi_t;
58struct dt_gui_module_t;
59struct _GtkWidget;
60
61#ifndef DT_IOP_PARAMS_T
62#define DT_IOP_PARAMS_T
63typedef void dt_iop_params_t;
64#endif
65
66/* early definition of modules to do type checking */
67
68#pragma GCC visibility push(default)
69
70#endif // FULL_API_H
71
78
80REQUIRED(const char *, name, void);
82DEFAULT(const char *, aliases, void);
86DEFAULT(int, flags, void);
88DEFAULT(const char *, deprecated_msg, void);
89
91DEFAULT(int, iop_focus, struct dt_gui_module_t *module, gboolean toggle);
92
94DEFAULT(const char **, description, struct dt_iop_module_t *self);
95
98
100DEFAULT(void, input_format, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
101 struct dt_dev_pixelpipe_iop_t *piece, struct dt_iop_buffer_dsc_t *dsc);
103DEFAULT(void, output_format, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
104 struct dt_dev_pixelpipe_iop_t *piece, struct dt_iop_buffer_dsc_t *dsc);
105
108 const struct dt_dev_pixelpipe_iop_t *piece);
110DEFAULT(int, blend_colorspace, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
111 const struct dt_dev_pixelpipe_iop_t *piece);
112
114DEFAULT(void, tiling_callback, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
115 const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling);
116
121OPTIONAL(void, gui_reset, struct dt_iop_module_t *self);
123OPTIONAL(void, gui_init, struct dt_iop_module_t *self);
125OPTIONAL(void, color_picker_apply, struct dt_iop_module_t *self, struct _GtkWidget *picker,
126 struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece);
128OPTIONAL(void, gui_changed, struct dt_iop_module_t *self, GtkWidget *widget, void *previous);
132OPTIONAL(void, gui_post_expose, struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height,
133 int32_t pointerx, int32_t pointery);
135OPTIONAL(void, gui_focus, struct dt_iop_module_t *self, gboolean in);
138
141OPTIONAL(int, mouse_moved, struct dt_iop_module_t *self, double x, double y, double pressure, int which);
142OPTIONAL(int, button_released, struct dt_iop_module_t *self, double x, double y, int which, uint32_t state);
143OPTIONAL(int, button_pressed, struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type,
144 uint32_t state);
145
146OPTIONAL(int, scrolled, struct dt_iop_module_t *self, double x, double y, int up, uint32_t state);
147OPTIONAL(void, configure, struct dt_iop_module_t *self, int width, int height);
148
149OPTIONAL(void, init, struct dt_iop_module_t *self); // this MUST set params_size!
150DEFAULT(void, cleanup, struct dt_iop_module_t *self);
151
153DEFAULT(void, init_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
154 struct dt_dev_pixelpipe_iop_t *piece);
158DEFAULT(void, commit_params, struct dt_iop_module_t *self, dt_iop_params_t *params, struct dt_dev_pixelpipe_t *pipe,
159 struct dt_dev_pixelpipe_iop_t *piece);
162
168DEFAULT(gboolean, has_defaults, struct dt_iop_module_t *self);
169
171DEFAULT(gboolean, runtime_data_hash, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
172 const struct dt_dev_pixelpipe_iop_t *piece);
173
176
178DEFAULT(void, cleanup_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
179 struct dt_dev_pixelpipe_iop_t *piece);
181 const struct dt_iop_roi_t *roi_out, struct dt_iop_roi_t *roi_in);
183 struct dt_iop_roi_t *roi_out, const struct dt_iop_roi_t *roi_in);
184OPTIONAL(int, legacy_params, struct dt_iop_module_t *self, const void *const old_params, const int old_version,
185 void *new_params, const int new_version);
186// allow to select a shape inside an iop
187OPTIONAL(void, masks_selection_changed, struct dt_iop_module_t *self, const int form_selected_id);
188
195REQUIRED(int, process, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
196 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o);
198DEFAULT(int, process_tiling, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
199 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o,
200 const int bpp);
201
202#if defined(__SSE__)
205OPTIONAL(int, process_sse2, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
206 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o);
207#endif
208
209#ifdef HAVE_OPENCL
211OPTIONAL(int, process_cl, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
212 const struct dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out);
214OPTIONAL(int, process_tiling_cl, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
215 const struct dt_dev_pixelpipe_iop_t *piece, const void *const i,
216 void *const o, const int bpp);
217#endif
218
223DEFAULT(int, distort_transform, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
224 const struct dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count);
227 const struct dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count);
228
229OPTIONAL(void, distort_mask, struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe,
230 struct dt_dev_pixelpipe_iop_t *piece, const float *const in, float *const out,
231 const struct dt_iop_roi_t *const roi_in, const struct dt_iop_roi_t *const roi_out);
232
233// introspection related callbacks, will be auto-implemented if DT_MODULE_INTROSPECTION() is used,
234OPTIONAL(int, introspection_init, struct dt_iop_module_so_t *self, int api_version);
235DEFAULT(dt_introspection_t *, get_introspection, void);
236DEFAULT(dt_introspection_field_t *, get_introspection_linear, void);
237DEFAULT(void *, get_p, const void *param, const char *name);
238DEFAULT(dt_introspection_field_t *, get_f, const char *name);
239
240// optional preference entry to add at the bottom of the preset menu
241OPTIONAL(void, set_preferences, void *menu, struct dt_iop_module_t *self);
242
243// Perform checks on image type/metadata to forcefully self-enable or self-disable a module
244// depending on input image. current_state will usually be self->enabled but can also be tied
245// to history enabled state.
246// Returns final enabled/disabled state after correction
247OPTIONAL(gboolean, force_enable, struct dt_iop_module_t *self, const gboolean current_state);
248
258
259OPTIONAL(int, populate_masks_context_menu, struct dt_iop_module_t *self, GtkWidget *menu, const int formid,const float pzx, const float pzy);
260
261#ifdef FULL_API_H
262
263#pragma GCC visibility pop
264
265#ifdef __cplusplus
266}
267#endif
268
269#endif // FULL_API_H
270
271// clang-format off
272// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
273// vim: shiftwidth=2 expandtab tabstop=2 cindent
274// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
275// clang-format on
int operation_tags()
Definition ashift.c:179
int operation_tags_filter()
Definition ashift.c:184
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:5513
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:1055
const char ** description(struct dt_iop_module_t *self)
Definition ashift.c:159
int default_group()
Definition ashift.c:174
void modify_roi_out(struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, dt_iop_roi_t *roi_out, const dt_iop_roi_t *roi_in)
Definition ashift.c:1120
int scrolled(struct dt_iop_module_t *self, double x, double y, int up, uint32_t state)
Definition ashift.c:4969
void reload_defaults(dt_iop_module_t *module)
Definition ashift.c:5581
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:984
void modify_roi_in(struct dt_iop_module_t *self, 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
const char * aliases()
Definition ashift.c:154
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5557
void gui_update(struct dt_iop_module_t *self)
Definition ashift.c:5570
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:1020
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:4583
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
Definition ashift.c:5052
int button_released(struct dt_iop_module_t *self, double x, double y, int which, uint32_t state)
Definition ashift.c:4798
void cleanup_global(dt_iop_module_so_t *module)
Definition ashift.c:5692
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:190
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:3910
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:3304
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5564
void init_global(dt_iop_module_so_t *module)
Definition ashift.c:5679
int mouse_moved(struct dt_iop_module_t *self, double x, double y, double pressure, int which)
Definition ashift.c:4360
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:5548
void init_presets(dt_iop_module_so_t *self)
Definition atrous.c:804
void gui_reset(dt_imageio_module_format_t *self)
Definition avif.c:936
void cleanup(dt_imageio_module_format_t *self)
Definition avif.c:213
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
gboolean has_defaults(struct dt_iop_module_t *self)
Definition clipping.c:1582
void set_preferences(void *menu, dt_lib_module_t *self)
Definition collect.c:3286
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:226
const float i
Definition colorspaces_inline_conversions.h:669
static const dt_colormatrix_t dt_aligned_pixel_t out
Definition colorspaces_inline_conversions.h:184
int type
Definition common/metadata.c:62
char * name
Definition common/metadata.c:61
int mouse_leave(struct dt_iop_module_t *self)
Definition crop.c:1735
void configure(dt_view_t *self, int wd, int ht)
Definition darkroom.c:3167
gboolean force_enable(struct dt_iop_module_t *self, const gboolean current_state)
Definition demosaic.c:1226
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:3486
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:320
int bpp
Definition imageio/format/pdf.c:88
static void gui_cleanup(dt_lib_import_t *d)
Definition import.c:1257
static void gui_init(dt_lib_import_t *d)
Definition import.c:939
static const float x
Definition iop_profile.h:239
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:1977
void post_history_commit(dt_iop_module_t *self)
Definition retouch.c:789
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:4555
struct _GtkWidget GtkWidget
Definition splash.h:29
Definition pixelpipe_hb.h:95
Definition pixelpipe_hb.h:216
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 develop/format.h:48
Definition imageop.h:190
Definition imageop.h:216
Definition imageop.h:67
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:674
Definition introspection.h:218