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-2021 darktable developers.
4
5 darktable is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 darktable is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include "common/module_api.h"
20
21#ifdef FULL_API_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
28
29#include <cairo/cairo.h>
30#include <gtk/gtk.h>
31#include <glib.h>
32#include <stdint.h>
33
34#ifdef HAVE_CONFIG_H
35#include "config.h"
36#endif
37
38#ifdef HAVE_OPENCL
39#include <CL/cl.h>
40#endif
41
43struct dt_iop_module_t;
46struct dt_iop_roi_t;
49struct dt_gui_module_t;
50struct _GtkWidget;
51
52#ifndef DT_IOP_PARAMS_T
53#define DT_IOP_PARAMS_T
54typedef void dt_iop_params_t;
55#endif
56
57/* early definition of modules to do type checking */
58
59#pragma GCC visibility push(default)
60
61#endif // FULL_API_H
62
69
71REQUIRED(const char *, name, void);
73DEFAULT(const char *, aliases, void);
77DEFAULT(int, flags, void);
79DEFAULT(const char *, deprecated_msg, void);
80
82DEFAULT(int, iop_focus, struct dt_gui_module_t *module, gboolean toggle);
83
85DEFAULT(const char **, description, struct dt_iop_module_t *self);
86
89
91DEFAULT(void, input_format, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
92 struct dt_dev_pixelpipe_iop_t *piece, struct dt_iop_buffer_dsc_t *dsc);
94DEFAULT(void, output_format, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
95 struct dt_dev_pixelpipe_iop_t *piece, struct dt_iop_buffer_dsc_t *dsc);
96
99 struct dt_dev_pixelpipe_iop_t *piece);
102 struct dt_dev_pixelpipe_iop_t *piece);
105 struct dt_dev_pixelpipe_iop_t *piece);
107DEFAULT(int, blend_colorspace, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
108 struct dt_dev_pixelpipe_iop_t *piece);
109
112 const struct dt_iop_roi_t *roi_in, const struct dt_iop_roi_t *roi_out,
114
119OPTIONAL(void, gui_reset, struct dt_iop_module_t *self);
121OPTIONAL(void, gui_init, struct dt_iop_module_t *self);
123OPTIONAL(void, color_picker_apply, struct dt_iop_module_t *self, struct _GtkWidget *picker, struct dt_dev_pixelpipe_iop_t *piece);
125OPTIONAL(void, gui_changed, struct dt_iop_module_t *self, GtkWidget *widget, void *previous);
129OPTIONAL(void, gui_post_expose, struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height,
130 int32_t pointerx, int32_t pointery);
132OPTIONAL(void, gui_focus, struct dt_iop_module_t *self, gboolean in);
133
136OPTIONAL(int, mouse_moved, struct dt_iop_module_t *self, double x, double y, double pressure, int which);
137OPTIONAL(int, button_released, struct dt_iop_module_t *self, double x, double y, int which, uint32_t state);
138OPTIONAL(int, button_pressed, struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type,
139 uint32_t state);
140
141OPTIONAL(int, scrolled, struct dt_iop_module_t *self, double x, double y, int up, uint32_t state);
142OPTIONAL(void, configure, struct dt_iop_module_t *self, int width, int height);
143
144OPTIONAL(void, init, struct dt_iop_module_t *self); // this MUST set params_size!
145DEFAULT(void, cleanup, struct dt_iop_module_t *self);
146
148DEFAULT(void, init_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
149 struct dt_dev_pixelpipe_iop_t *piece);
153DEFAULT(void, commit_params, struct dt_iop_module_t *self, dt_iop_params_t *params, struct dt_dev_pixelpipe_t *pipe,
154 struct dt_dev_pixelpipe_iop_t *piece);
157
163DEFAULT(gboolean, has_defaults, struct dt_iop_module_t *self);
164
167
169DEFAULT(void, cleanup_pipe, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_t *pipe,
170 struct dt_dev_pixelpipe_iop_t *piece);
172 const struct dt_iop_roi_t *roi_out, struct dt_iop_roi_t *roi_in);
174 struct dt_iop_roi_t *roi_out, const struct dt_iop_roi_t *roi_in);
175OPTIONAL(int, legacy_params, struct dt_iop_module_t *self, const void *const old_params, const int old_version,
176 void *new_params, const int new_version);
177// allow to select a shape inside an iop
178OPTIONAL(void, masks_selection_changed, struct dt_iop_module_t *self, const int form_selected_id);
179
186REQUIRED(void, process, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const void *const i,
187 void *const o, const struct dt_iop_roi_t *const roi_in,
188 const struct dt_iop_roi_t *const roi_out);
190DEFAULT(void, process_tiling, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const void *const i,
191 void *const o, const struct dt_iop_roi_t *const roi_in,
192 const struct dt_iop_roi_t *const roi_out, const int bpp);
193
194#if defined(__SSE__)
197OPTIONAL(void, process_sse2, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const void *const i,
198 void *const o, const struct dt_iop_roi_t *const roi_in,
199 const struct dt_iop_roi_t *const roi_out);
200#endif
201
202#ifdef HAVE_OPENCL
204OPTIONAL(int, process_cl, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in,
205 cl_mem dev_out, const struct dt_iop_roi_t *const roi_in,
206 const struct dt_iop_roi_t *const roi_out);
208OPTIONAL(int, process_tiling_cl, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const void *const i,
209 void *const o, const struct dt_iop_roi_t *const roi_in,
210 const struct dt_iop_roi_t *const roi_out, const int bpp);
211#endif
212
217DEFAULT(int, distort_transform, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, float *points,
218 size_t points_count);
220DEFAULT(int, distort_backtransform, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, float *points,
221 size_t points_count);
222
223OPTIONAL(void, distort_mask, struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const float *const in,
224 float *const out, const struct dt_iop_roi_t *const roi_in, const struct dt_iop_roi_t *const roi_out);
225
226// introspection related callbacks, will be auto-implemented if DT_MODULE_INTROSPECTION() is used,
227OPTIONAL(int, introspection_init, struct dt_iop_module_so_t *self, int api_version);
228DEFAULT(dt_introspection_t *, get_introspection, void);
229DEFAULT(dt_introspection_field_t *, get_introspection_linear, void);
230DEFAULT(void *, get_p, const void *param, const char *name);
231DEFAULT(dt_introspection_field_t *, get_f, const char *name);
232
233// optional preference entry to add at the bottom of the preset menu
234OPTIONAL(void, set_preferences, void *menu, struct dt_iop_module_t *self);
235
236// Perform checks on image type/metadata to forcefully self-enable or self-disable a module
237// depending on input image. current_state will usually be self->enabled but can also be tied
238// to history enabled state.
239// Returns final enabled/disabled state after correction
240OPTIONAL(gboolean, force_enable, struct dt_iop_module_t *self, const gboolean current_state);
241
251
252#ifdef FULL_API_H
253
254#pragma GCC visibility pop
255
256#ifdef __cplusplus
257}
258#endif
259
260#endif // FULL_API_H
261
262// clang-format off
263// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
264// vim: shiftwidth=2 expandtab tabstop=2 cindent
265// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
266// clang-format on
int operation_tags()
Definition ashift.c:149
int operation_tags_filter()
Definition ashift.c:154
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:5241
const char ** description(struct dt_iop_module_t *self)
Definition ashift.c:129
int default_group()
Definition ashift.c:144
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:1087
int scrolled(struct dt_iop_module_t *self, double x, double y, int up, uint32_t state)
Definition ashift.c:4682
void reload_defaults(dt_iop_module_t *module)
Definition ashift.c:5300
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:1147
void process(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out)
Definition ashift.c:3088
const char * aliases()
Definition ashift.c:124
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:160
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5276
void gui_update(struct dt_iop_module_t *self)
Definition ashift.c:5289
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:4309
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
Definition ashift.c:4766
int button_released(struct dt_iop_module_t *self, double x, double y, int which, uint32_t state)
Definition ashift.c:4516
void cleanup_global(dt_iop_module_so_t *module)
Definition ashift.c:5415
void distort_mask(struct dt_iop_module_t *self, 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:1024
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:3671
int distort_backtransform(dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, float *points, size_t points_count)
Definition ashift.c:989
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition ashift.c:5283
void init_global(dt_iop_module_so_t *module)
Definition ashift.c:5402
int mouse_moved(struct dt_iop_module_t *self, double x, double y, double pressure, int which)
Definition ashift.c:4090
int distort_transform(dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, float *const restrict points, size_t points_count)
Definition ashift.c:954
void init_presets(dt_iop_module_so_t *self)
Definition atrous.c:757
void gui_reset(dt_imageio_module_format_t *self)
Definition avif.c:927
void cleanup(dt_imageio_module_format_t *self)
Definition avif.c:204
void init(dt_imageio_module_format_t *self)
Definition avif.c:142
void color_picker_apply(dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_iop_t *piece)
Definition basicadj.c:464
void gui_focus(struct dt_iop_module_t *self, gboolean in)
Definition basicadj.c:570
void change_image(struct dt_iop_module_t *self)
Definition basicadj.c:575
const char * deprecated_msg()
Definition basicadj.c:135
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
gboolean has_defaults(struct dt_iop_module_t *self)
Definition clipping.c:1653
void set_preferences(void *menu, dt_lib_module_t *self)
Definition collect.c:3108
int input_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition colorin.c:157
int output_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition colorin.c:169
int type
Definition common/metadata.c:42
char * name
Definition common/metadata.c:41
void configure(dt_view_t *self, int wd, int ht)
Definition darkroom.c:2698
gboolean force_enable(struct dt_iop_module_t *self, const gboolean current_state)
Definition demosaic.c:1339
void dt_iop_params_t
Definition dev_history.h:22
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:300
int bpp
Definition imageio/format/pdf.c:76
static void gui_cleanup(dt_lib_import_t *d)
Definition import.c:1243
static void gui_init(dt_lib_import_t *d)
Definition import.c:926
dt_mipmap_buffer_dsc_flags flags
Definition mipmap_cache.c:4
#define REQUIRED(return_type, function_name,...)
Definition module_api.h:74
#define DEFAULT(return_type, function_name,...)
Definition module_api.h:75
#define OPTIONAL(return_type, function_name,...)
Definition module_api.h:73
Definition tiling.py:1
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 rawprepare.c:274
void masks_selection_changed(struct dt_iop_module_t *self, const int form_selected_id)
Definition retouch.c:1930
void post_history_commit(dt_iop_module_t *self)
Definition retouch.c:748
Definition pixelpipe_hb.h:46
Definition pixelpipe_hb.h:127
Definition tiling.h:30
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:25
Definition introspection.h:238
Definition develop/format.h:36
Definition imageop.h:155
Definition imageop.h:182
Definition imageop.h:32
void tiling_callback(struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out, struct dt_develop_tiling_t *tiling)
Definition atrous.c:627
int process_tiling_cl(struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const int bpp)
void process_tiling(struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const int bpp)
int mouse_leave(struct dt_iop_module_t *self)
Definition toneequal.c:2023
Definition introspection.h:215