Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
iop_order.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2018-2020 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
120#ifndef DT_IOP_ORDER_H
121#define DT_IOP_ORDER_H
122
123#ifdef HAVE_CONFIG_H
124#include "config.h"
125#endif
126
127#ifdef __cplusplus
128extern "C" {
129#endif
130
131struct dt_iop_module_t;
132struct dt_develop_t;
133struct dt_dev_pixelpipe_t;
134
135typedef enum dt_iop_order_t
136{
137 DT_IOP_ORDER_CUSTOM = 0, // a customr order (re-ordering the pipe)
138 DT_IOP_ORDER_LEGACY = 1, // up to dt 2.6.3
139 DT_IOP_ORDER_V30 = 2, // starts with dt 3.0
140 DT_IOP_ORDER_V30_JPG = 3, // same as previous but tuned for non-linear input
143
145{
146 union {
147 double iop_order_f; // only used for backward compatibility while migrating db
148 int iop_order; // order from 1 and incrementing
149 } o;
150 // operation + instance is the unique id for an active module in the pipe
151 char operation[20];
152 int32_t instance; // or previously named multi_priority
153 char name[25];
155
157{
158 char op_prev[20];
159 char op_next[20];
161
163const char *dt_iop_order_string(const dt_iop_order_t order);
164
167
171
173gboolean dt_ioppr_has_iop_order_list(int32_t imgid);
174
176GList *dt_ioppr_get_iop_order_list(int32_t imgid, gboolean sorted);
180dt_iop_order_entry_t *dt_ioppr_get_iop_order_entry(GList *iop_order_list, const char *op_name, const int multi_priority);
182GList *dt_ioppr_get_iop_order_link(GList *iop_order_list, const char *op_name, const int multi_priority);
184gboolean dt_ioppr_has_multiple_instances(GList *iop_order_list);
185
187int dt_ioppr_get_iop_order(GList *iop_order_list, const char *op_name, const int multi_priority);
188
189/* write iop-order list for the given image */
190gboolean dt_ioppr_write_iop_order_list(GList *iop_order_list, const int32_t imgid);
191gboolean dt_ioppr_write_iop_order(const dt_iop_order_t kind, GList *iop_order_list, const int32_t imgid);
192
194void *dt_ioppr_serialize_iop_order_list(GList *iop_order_list, size_t *size);
196GList *dt_ioppr_deserialize_iop_order_list(const char *buf, size_t size);
198char *dt_ioppr_serialize_text_iop_order_list(GList *iop_order_list);
199GList *dt_ioppr_deserialize_text_iop_order_list(const char *buf);
200
202void dt_ioppr_insert_module_instance(struct dt_develop_t *dev, struct dt_iop_module_t *module);
204void dt_ioppr_resync_iop_list(struct dt_develop_t *dev);
205
208void dt_ioppr_update_for_entries(struct dt_develop_t *dev, GList *entry_list, gboolean append);
209void dt_ioppr_update_for_style_items(struct dt_develop_t *dev, GList *st_items, gboolean append);
210void dt_ioppr_update_for_modules(struct dt_develop_t *dev, GList *modules, gboolean append);
211
213void dt_ioppr_check_duplicate_iop_order(GList **_iop_list, GList *history_list);
214
216void dt_ioppr_set_default_iop_order(struct dt_develop_t *dev, const int32_t imgid);
217void dt_ioppr_migrate_iop_order(struct dt_develop_t *dev, const int32_t imgid);
218void dt_ioppr_change_iop_order(struct dt_develop_t *dev, const int32_t imgid, GList *new_iop_list);
220GList *dt_ioppr_extract_multi_instances_list(GList *iop_order_list);
222GList *dt_ioppr_merge_multi_instance_iop_order_list(GList *iop_order_list, GList *multi_instance_list);
223
225int dt_ioppr_check_so_iop_order(GList *iop_list, GList *iop_order_list);
226
227/* returns a list of dt_iop_order_rule_t with the current iop order rules */
229
231GList *dt_ioppr_iop_order_copy_deep(GList *iop_order_list);
232
234gint dt_sort_iop_by_order(gconstpointer a, gconstpointer b);
235gint dt_sort_iop_list_by_order_f(gconstpointer a, gconstpointer b);
236
238gboolean dt_ioppr_check_can_move_before_iop(GList *iop_list, struct dt_iop_module_t *module, struct dt_iop_module_t *module_next);
240gboolean dt_ioppr_check_can_move_after_iop(GList *iop_list, struct dt_iop_module_t *module, struct dt_iop_module_t *module_prev);
241
243gboolean dt_ioppr_move_iop_before(struct dt_develop_t *dev, struct dt_iop_module_t *module, struct dt_iop_module_t *module_next);
244gboolean dt_ioppr_move_iop_after(struct dt_develop_t *dev, struct dt_iop_module_t *module, struct dt_iop_module_t *module_prev);
245
246// for debug only
247int dt_ioppr_check_iop_order(struct dt_develop_t *dev, const int32_t imgid, const char *msg);
248void dt_ioppr_print_module_iop_order(GList *iop_list, const char *msg);
249void dt_ioppr_print_history_iop_order(GList *history_list, const char *msg);
250void dt_ioppr_print_iop_order(GList *iop_order_list, const char *msg);
251
252#ifdef __cplusplus
253}
254#endif
255
256#endif
257// clang-format off
258// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
259// vim: shiftwidth=2 expandtab tabstop=2 cindent
260// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
261// clang-format on
gboolean dt_ioppr_write_iop_order(const dt_iop_order_t kind, GList *iop_order_list, const int32_t imgid)
Definition iop_order.c:653
GList * dt_ioppr_get_iop_order_list(int32_t imgid, gboolean sorted)
Definition iop_order.c:760
gboolean dt_ioppr_has_multiple_instances(GList *iop_order_list)
Definition iop_order.c:635
gboolean dt_ioppr_has_iop_order_list(int32_t imgid)
Definition iop_order.c:737
void * dt_ioppr_serialize_iop_order_list(GList *iop_order_list, size_t *size)
Definition iop_order.c:2027
GList * dt_ioppr_get_iop_order_list_version(dt_iop_order_t version)
Definition iop_order.c:717
gint dt_sort_iop_list_by_order_f(gconstpointer a, gconstpointer b)
Definition iop_order.c:543
GList * dt_ioppr_merge_multi_instance_iop_order_list(GList *iop_order_list, GList *multi_instance_list)
Definition iop_order.c:1008
void dt_ioppr_update_for_modules(struct dt_develop_t *dev, GList *modules, gboolean append)
Definition iop_order.c:1252
gint dt_sort_iop_by_order(gconstpointer a, gconstpointer b)
Definition iop_order.c:1446
void dt_ioppr_update_for_entries(struct dt_develop_t *dev, GList *entry_list, gboolean append)
Definition iop_order.c:1120
GList * dt_ioppr_get_iop_order_rules()
Definition iop_order.c:452
void dt_ioppr_print_module_iop_order(GList *iop_list, const char *msg)
Definition iop_order.c:1728
void dt_ioppr_resync_iop_list(struct dt_develop_t *dev)
Definition iop_order.c:855
int dt_ioppr_check_iop_order(struct dt_develop_t *dev, const int32_t imgid, const char *msg)
Definition iop_order.c:1913
gboolean dt_ioppr_check_can_move_after_iop(GList *iop_list, struct dt_iop_module_t *module, struct dt_iop_module_t *module_prev)
Definition iop_order.c:1646
gboolean dt_ioppr_move_iop_after(struct dt_develop_t *dev, struct dt_iop_module_t *module, struct dt_iop_module_t *module_prev)
Definition iop_order.c:1701
void dt_ioppr_set_default_iop_order(struct dt_develop_t *dev, const int32_t imgid)
Definition iop_order.c:900
void dt_ioppr_resync_modules_order(struct dt_develop_t *dev)
Definition iop_order.c:874
void dt_ioppr_migrate_iop_order(struct dt_develop_t *dev, const int32_t imgid)
Definition iop_order.c:918
GList * dt_ioppr_iop_order_copy_deep(GList *iop_order_list)
Definition iop_order.c:1440
gboolean dt_ioppr_write_iop_order_list(GList *iop_order_list, const int32_t imgid)
Definition iop_order.c:692
void dt_ioppr_check_duplicate_iop_order(GList **_iop_list, GList *history_list)
Definition iop_order.c:1310
int dt_ioppr_get_iop_order(GList *iop_order_list, const char *op_name, const int multi_priority)
Definition iop_order.c:518
int dt_ioppr_check_so_iop_order(GList *iop_list, GList *iop_order_list)
Definition iop_order.c:1411
GList * dt_ioppr_extract_multi_instances_list(GList *iop_order_list)
Definition iop_order.c:938
gboolean dt_ioppr_move_iop_before(struct dt_develop_t *dev, struct dt_iop_module_t *module, struct dt_iop_module_t *module_next)
Definition iop_order.c:1681
dt_iop_order_t
Definition iop_order.h:136
@ DT_IOP_ORDER_LEGACY
Definition iop_order.h:138
@ DT_IOP_ORDER_LAST
Definition iop_order.h:141
@ DT_IOP_ORDER_V30_JPG
Definition iop_order.h:140
@ DT_IOP_ORDER_V30
Definition iop_order.h:139
@ DT_IOP_ORDER_CUSTOM
Definition iop_order.h:137
dt_iop_order_t dt_ioppr_get_iop_order_list_kind(GList *iop_order_list)
Definition iop_order.c:552
dt_iop_order_entry_t * dt_ioppr_get_iop_order_entry(GList *iop_order_list, const char *op_name, const int multi_priority)
Definition iop_order.c:508
gboolean dt_ioppr_check_can_move_before_iop(GList *iop_list, struct dt_iop_module_t *module, struct dt_iop_module_t *module_next)
Definition iop_order.c:1459
char * dt_ioppr_serialize_text_iop_order_list(GList *iop_order_list)
Definition iop_order.c:2069
GList * dt_ioppr_deserialize_text_iop_order_list(const char *buf)
Definition iop_order.c:2116
void dt_ioppr_print_history_iop_order(GList *history_list, const char *msg)
Definition iop_order.c:1739
void dt_ioppr_update_for_style_items(struct dt_develop_t *dev, GList *st_items, gboolean append)
Definition iop_order.c:1216
const char * dt_iop_order_string(const dt_iop_order_t order)
Definition iop_order.c:64
dt_iop_order_t dt_ioppr_get_iop_order_version(const int32_t imgid)
Definition iop_order.c:432
GList * dt_ioppr_deserialize_iop_order_list(const char *buf, size_t size)
Definition iop_order.c:2159
void dt_ioppr_print_iop_order(GList *iop_order_list, const char *msg)
Definition iop_order.c:1750
void dt_ioppr_insert_module_instance(struct dt_develop_t *dev, struct dt_iop_module_t *module)
Definition iop_order.c:1885
void dt_ioppr_change_iop_order(struct dt_develop_t *dev, const int32_t imgid, GList *new_iop_list)
Definition iop_order.c:924
GList * dt_ioppr_get_iop_order_link(GList *iop_order_list, const char *op_name, const int multi_priority)
Definition iop_order.c:488
size_t size
Definition mipmap_cache.c:3
Definition pixelpipe_hb.h:127
Definition develop.h:143
Definition imageop.h:182
Definition iop_order.h:145
char name[25]
Definition iop_order.h:153
int iop_order
Definition iop_order.h:148
char operation[20]
Definition iop_order.h:151
union dt_iop_order_entry_t::@8 o
double iop_order_f
Definition iop_order.h:147
int32_t instance
Definition iop_order.h:152
Definition iop_order.h:157
char op_prev[20]
Definition iop_order.h:158
char op_next[20]
Definition iop_order.h:159