Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
mask_manager.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2018 Edgardo Hoszowski.
4 Copyright (C) 2019 luzpaz.
5 Copyright (C) 2019 Tobias Ellinghaus.
6 Copyright (C) 2020 Aldric Renaudin.
7 Copyright (C) 2020, 2022-2023, 2025-2026 Aurélien PIERRE.
8 Copyright (C) 2020 Diederik Ter Rahe.
9 Copyright (C) 2020 Hubert Kowalski.
10 Copyright (C) 2020 Pascal Obry.
11 Copyright (C) 2020 Ralf Brown.
12 Copyright (C) 2022 Martin Bařinka.
13 Copyright (C) 2022 Philipp Lutz.
14
15 darktable is free software: you can redistribute it and/or modify
16 it under the terms of the GNU 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 General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with darktable. If not, see <http://www.gnu.org/licenses/>.
27*/
28
29/*
30 * This is a dummy module intended only to be used in history so hist->module is not NULL
31 * when the entry correspond to the mask manager
32 *
33 * It is always disabled and do not show in module list, only in history
34 *
35 * We start at version 2 so previous version of dt can add records in history with NULL params
36 */
37
38#ifdef HAVE_CONFIG_H
39#include "config.h"
40#endif
41
42#include "common/imagebuf.h"
43#include "develop/develop.h"
44
46
51
53
54const char *name()
55{
56 return _("mask manager");
57}
58
59int groups()
60{
62}
63
68
73
74int legacy_params(dt_iop_module_t *self, const void *const old_params, const int old_version,
75 void *new_params, const int new_version)
76{
77 if(old_version == 1 && new_version == 2)
78 {
81
82 *n = *d; // start with a fresh copy of default parameters
83 return 0;
84 }
85 return 1;
86}
87
88int process(struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o)
89{
90 return 0;
91}
92
95{
96 self->enabled = FALSE;
97 piece->enabled = FALSE;
98 memcpy(piece->data, params, sizeof(dt_iop_mask_manager_params_t));
99}
100
102{
104 piece->data_size = sizeof(dt_iop_mask_manager_data_t);
105 piece->enabled = FALSE;
106}
107
109{
110 dt_free_align(piece->data);
111 piece->data = NULL;
112}
113
115{
116 dt_iop_default_init(module);
117
118 // module is disabled by default
119 module->default_enabled = 0;
120}
121
122
123// clang-format off
124// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
125// vim: shiftwidth=2 expandtab tabstop=2 cindent
126// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
127// clang-format on
#define FALSE
Definition ashift_lsd.c:158
@ IOP_CS_RGB
#define dt_free_align(ptr)
Definition darktable.h:481
static void * dt_calloc_align(size_t size)
Definition darktable.h:488
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
Definition darktable.h:151
void dt_iop_params_t
Definition dev_history.h:41
void dt_iop_default_init(dt_iop_module_t *module)
Definition imageop.c:316
@ IOP_FLAGS_HIDDEN
Definition imageop.h:170
@ IOP_FLAGS_INTERNAL_MASKS
Definition imageop.h:179
@ IOP_FLAGS_ONE_INSTANCE
Definition imageop.h:172
@ IOP_GROUP_TECHNICAL
Definition imageop.h:143
void init(dt_iop_module_t *module)
int process(struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o)
void commit_params(struct dt_iop_module_t *self, dt_iop_params_t *params, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void init_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
int groups()
const char * name()
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
int flags()
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
struct dt_iop_mask_manager_params_t dt_iop_mask_manager_data_t
int legacy_params(dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version)
struct dt_iop_module_t *void * data
dt_iop_params_t * default_params
Definition imageop.h:307
gboolean enabled
Definition imageop.h:298