forked from darktable-org/darktable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelop.h
More file actions
202 lines (172 loc) · 7.74 KB
/
Copy pathdevelop.h
File metadata and controls
202 lines (172 loc) · 7.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/*
This file is part of darktable,
copyright (c) 2009--2011 johannes hanika.
darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
darktable is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with darktable. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DARKTABLE_DEVELOP_H
#define DARKTABLE_DEVELOP_H
#include "common/darktable.h"
#include "common/dtpthread.h"
#include "control/settings.h"
#include "develop/imageop.h"
#include "common/image.h"
#include <inttypes.h>
#include <cairo.h>
#include <glib.h>
struct dt_iop_module_t;
struct dt_iop_params_t;
typedef struct dt_dev_history_item_t
{
struct dt_iop_module_t *module; // pointer to image operation module
int32_t enabled; // switched respective module on/off
struct dt_iop_params_t *params; // parameters for this operation
struct dt_develop_blend_params_t *blend_params;
}
dt_dev_history_item_t;
struct dt_dev_pixelpipe_t;
struct dt_iop_module_t;
typedef struct dt_develop_t
{
int32_t gui_attached; // != 0 if the gui should be notified of changes in hist stack and modules should be gui_init'ed.
int32_t gui_leaving; // set if everything is scheduled to shut down.
int32_t gui_synch; // set by the render threads if gui_update should be called in the modules.
int32_t image_loading, image_dirty;
int32_t image_force_reload;
int32_t preview_loading, preview_dirty, preview_input_changed;
uint32_t timestamp;
struct dt_iop_module_t *gui_module; // this module claims gui expose/event callbacks.
float preview_downsampling; // < 1.0: optionally downsample preview
// width, height: dimensions of window
// capwidth, capheight: actual dimensions of scaled image inside window.
int32_t width, height, capwidth, capheight, capwidth_preview, capheight_preview;
// image processing pipeline with caching
struct dt_dev_pixelpipe_t *pipe, *preview_pipe;
// image under consideration, which
// is copied each time an image is changed. this means we have some information
// always cached (might be out of sync, so stars are not reliable), but for the iops
// it's quite a convenience to access trivial stuff which is constant anyways without
// calling into the cache explicitly. this should never be accessed directly, but
// by the iop through the copy their respective pixelpipe holds, for thread-safety.
dt_image_t image_storage;
// history stack
dt_pthread_mutex_t history_mutex;
int32_t history_end;
GList *history;
// operations pipeline
int32_t iop_instance;
GList *iop;
// histogram for display.
float *histogram, *histogram_pre_tonecurve, *histogram_pre_levels;
float histogram_max, histogram_pre_tonecurve_max, histogram_pre_levels_max;
gboolean histogram_linear;
/* proxy for communication between plugins and develop/darkroom */
struct
{
// exposure plugin hooks, used by histogram dragging functions
struct
{
struct dt_iop_module_t *module;
void (*set_white)(struct dt_iop_module_t *exp, const float white);
float (*get_white)(struct dt_iop_module_t *exp);
void (*set_black)(struct dt_iop_module_t *exp, const float black);
float (*get_black)(struct dt_iop_module_t *exp);
}
exposure;
// modulegroups plugin hooks
struct
{
struct dt_lib_module_t *module;
/* switch module group */
void (*set)(struct dt_lib_module_t *self, uint32_t group);
/* get current module group */
uint32_t (*get)(struct dt_lib_module_t *self);
/* test if iop group flags matches modulegroup */
gboolean (*test)(struct dt_lib_module_t *self, uint32_t group, uint32_t iop_group);
/* switch to modulegroup */
void (*switch_group)(struct dt_lib_module_t *self, struct dt_iop_module_t *module);
}
modulegroups;
// snapshots plugin hooks
struct
{
// this flag is set by snapshot plugin to signal that expose of darkroom
// should store cairo surface as snapshot to disk using filename.
gboolean request;
const gchar *filename;
}
snapshot;
}
proxy;
}
dt_develop_t;
void dt_dev_init(dt_develop_t *dev, int32_t gui_attached);
void dt_dev_cleanup(dt_develop_t *dev);
void dt_dev_process_image_job(dt_develop_t *dev);
void dt_dev_process_preview_job(dt_develop_t *dev);
// launch jobs above
void dt_dev_process_image(dt_develop_t *dev);
void dt_dev_process_preview(dt_develop_t *dev);
void dt_dev_load_image(dt_develop_t *dev, const uint32_t imgid);
void dt_dev_reload_image(dt_develop_t *dev, const uint32_t imgid);
/** checks if provided imgid is the image currently in develop */
int dt_dev_is_current_image(dt_develop_t *dev, uint32_t imgid);
void dt_dev_add_history_item(dt_develop_t *dev, struct dt_iop_module_t *module, gboolean enable);
void dt_dev_reload_history_items(dt_develop_t *dev);
void dt_dev_pop_history_items(dt_develop_t *dev, int32_t cnt);
void dt_dev_write_history(dt_develop_t *dev);
void dt_dev_read_history(dt_develop_t *dev);
void dt_dev_invalidate(dt_develop_t *dev);
// also invalidates preview (which is unaffected by resize/zoom/pan)
void dt_dev_invalidate_all(dt_develop_t *dev);
void dt_dev_set_histogram(dt_develop_t *dev);
void dt_dev_set_histogram_pre(dt_develop_t *dev);
void dt_dev_get_history_item_label(dt_dev_history_item_t *hist, char *label, const int cnt);
void dt_dev_get_processed_size(const dt_develop_t *dev, int *procw, int *proch);
void dt_dev_check_zoom_bounds(dt_develop_t *dev, float *zoom_x, float *zoom_y, dt_dev_zoom_t zoom, int closeup, float *boxw, float *boxh);
float dt_dev_get_zoom_scale(dt_develop_t *dev, dt_dev_zoom_t zoom, int closeup_factor, int mode);
void dt_dev_get_pointer_zoom_pos(dt_develop_t *dev, const float px, const float py, float *zoom_x, float *zoom_y);
void dt_dev_configure (dt_develop_t *dev, int wd, int ht);
void dt_dev_invalidate_from_gui (dt_develop_t *dev);
/*
* exposure plugin hook, set the white level
*/
/** check if exposure iop hooks are available */
gboolean dt_dev_exposure_hooks_available(dt_develop_t *dev);
/** reset exposure to defaults */
void dt_dev_exposure_reset_defaults(dt_develop_t *dev);
/** set exposure white level */
void dt_dev_exposure_set_white(dt_develop_t *dev, const float white);
/** get exposure white level */
float dt_dev_exposure_get_white(dt_develop_t *dev);
/** set exposure black level */
void dt_dev_exposure_set_black(dt_develop_t *dev, const float black);
/** get exposure black level */
float dt_dev_exposure_get_black(dt_develop_t *dev);
/*
* modulegroups plugin hooks
*/
/** check if modulegroups hooks are available */
gboolean dt_dev_modulegroups_available(dt_develop_t *dev);
/** switch to modulegroup of module */
void dt_dev_modulegroups_switch(dt_develop_t *dev, struct dt_iop_module_t *module);
/** set the active modulegroup */
void dt_dev_modulegroups_set(dt_develop_t *dev, uint32_t group);
/** get the active modulegroup */
uint32_t dt_dev_modulegroups_get(dt_develop_t *dev);
/** test if iop group flags matches modulegroup */
gboolean dt_dev_modulegroups_test(dt_develop_t *dev, uint32_t group, uint32_t iop_group);
/** request snapshot */
void dt_dev_snapshot_request(dt_develop_t *dev, const char *filename);
#endif
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
// vim: shiftwidth=2 expandtab tabstop=2 cindent
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-space on;