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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
|
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf
*
* This program 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.
*
* This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_IMAGE_H__
#define __GIMP_IMAGE_H__
#include "gimpviewable.h"
#define GIMP_IMAGE_ACTIVE_PARENT ((gpointer) 1)
#define GIMP_TYPE_IMAGE (gimp_image_get_type ())
#define GIMP_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_IMAGE, GimpImage))
#define GIMP_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_IMAGE, GimpImageClass))
#define GIMP_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_IMAGE))
#define GIMP_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_IMAGE))
#define GIMP_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_IMAGE, GimpImageClass))
typedef struct _GimpImageClass GimpImageClass;
typedef struct _GimpImagePrivate GimpImagePrivate;
struct _GimpImage
{
GimpViewable parent_instance;
Gimp *gimp; /* the GIMP the image belongs to */
GimpImagePrivate *priv;
};
struct _GimpImageClass
{
GimpViewableClass parent_class;
/* signals */
void (* mode_changed) (GimpImage *image);
void (* precision_changed) (GimpImage *image);
void (* alpha_changed) (GimpImage *image);
void (* floating_selection_changed) (GimpImage *image);
void (* active_layer_changed) (GimpImage *image);
void (* active_channel_changed) (GimpImage *image);
void (* active_vectors_changed) (GimpImage *image);
void (* linked_items_changed) (GimpImage *image);
void (* component_visibility_changed) (GimpImage *image,
GimpChannelType channel);
void (* component_active_changed) (GimpImage *image,
GimpChannelType channel);
void (* mask_changed) (GimpImage *image);
void (* resolution_changed) (GimpImage *image);
void (* size_changed_detailed) (GimpImage *image,
gint previous_origin_x,
gint previous_origin_y,
gint previous_width,
gint previous_height);
void (* unit_changed) (GimpImage *image);
void (* quick_mask_changed) (GimpImage *image);
void (* selection_invalidate) (GimpImage *image);
void (* clean) (GimpImage *image,
GimpDirtyMask dirty_mask);
void (* dirty) (GimpImage *image,
GimpDirtyMask dirty_mask);
void (* saving) (GimpImage *image);
void (* saved) (GimpImage *image,
GFile *file);
void (* exported) (GimpImage *image,
GFile *file);
void (* guide_added) (GimpImage *image,
GimpGuide *guide);
void (* guide_removed) (GimpImage *image,
GimpGuide *guide);
void (* guide_moved) (GimpImage *image,
GimpGuide *guide);
void (* sample_point_added) (GimpImage *image,
GimpSamplePoint *sample_point);
void (* sample_point_removed) (GimpImage *image,
GimpSamplePoint *sample_point);
void (* sample_point_moved) (GimpImage *image,
GimpSamplePoint *sample_point);
void (* parasite_attached) (GimpImage *image,
const gchar *name);
void (* parasite_detached) (GimpImage *image,
const gchar *name);
void (* colormap_changed) (GimpImage *image,
gint color_index);
void (* undo_event) (GimpImage *image,
GimpUndoEvent event,
GimpUndo *undo);
};
GType gimp_image_get_type (void) G_GNUC_CONST;
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type,
GimpPrecision precision);
gint64 gimp_image_estimate_memsize (GimpImage *image,
GimpComponentType component_type,
gint width,
gint height);
GimpImageBaseType gimp_image_get_base_type (GimpImage *image);
GimpComponentType gimp_image_get_component_type (GimpImage *image);
GimpPrecision gimp_image_get_precision (GimpImage *image);
const Babl * gimp_image_get_format (GimpImage *image,
GimpImageBaseType base_type,
GimpPrecision precision,
gboolean with_alpha);
const Babl * gimp_image_get_layer_format (GimpImage *image,
gboolean with_alpha);
const Babl * gimp_image_get_channel_format (GimpImage *image);
const Babl * gimp_image_get_mask_format (GimpImage *image);
GimpLayerMode gimp_image_get_default_new_layer_mode
(GimpImage *image);
void gimp_image_unset_default_new_layer_mode
(GimpImage *image);
gint gimp_image_get_ID (GimpImage *image);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
GFile * gimp_image_get_file (GimpImage *image);
GFile * gimp_image_get_untitled_file (GimpImage *image);
GFile * gimp_image_get_file_or_untitled (GimpImage *image);
GFile * gimp_image_get_imported_file (GimpImage *image);
GFile * gimp_image_get_exported_file (GimpImage *image);
GFile * gimp_image_get_save_a_copy_file (GimpImage *image);
GFile * gimp_image_get_any_file (GimpImage *image);
void gimp_image_set_file (GimpImage *image,
GFile *file);
void gimp_image_set_imported_file (GimpImage *image,
GFile *file);
void gimp_image_set_exported_file (GimpImage *image,
GFile *file);
void gimp_image_set_save_a_copy_file (GimpImage *image,
GFile *file);
const gchar * gimp_image_get_display_name (GimpImage *image);
const gchar * gimp_image_get_display_path (GimpImage *image);
void gimp_image_set_load_proc (GimpImage *image,
GimpPlugInProcedure *proc);
GimpPlugInProcedure * gimp_image_get_load_proc (GimpImage *image);
void gimp_image_set_save_proc (GimpImage *image,
GimpPlugInProcedure *proc);
GimpPlugInProcedure * gimp_image_get_save_proc (GimpImage *image);
void gimp_image_saving (GimpImage *image);
void gimp_image_saved (GimpImage *image,
GFile *file);
void gimp_image_set_export_proc (GimpImage *image,
GimpPlugInProcedure *proc);
GimpPlugInProcedure * gimp_image_get_export_proc (GimpImage *image);
void gimp_image_exported (GimpImage *image,
GFile *file);
gint gimp_image_get_xcf_version (GimpImage *image,
gboolean zlib_compression,
gint *gimp_version,
const gchar **version_string,
gchar **version_reason);
void gimp_image_set_xcf_compression (GimpImage *image,
gboolean compression);
gboolean gimp_image_get_xcf_compression (GimpImage *image);
void gimp_image_set_resolution (GimpImage *image,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (GimpImage *image,
gdouble *xres,
gdouble *yres);
void gimp_image_resolution_changed (GimpImage *image);
void gimp_image_set_unit (GimpImage *image,
GimpUnit unit);
GimpUnit gimp_image_get_unit (GimpImage *image);
void gimp_image_unit_changed (GimpImage *image);
gint gimp_image_get_width (GimpImage *image);
gint gimp_image_get_height (GimpImage *image);
gboolean gimp_image_has_alpha (GimpImage *image);
gboolean gimp_image_is_empty (GimpImage *image);
void gimp_image_set_floating_selection (GimpImage *image,
GimpLayer *floating_sel);
GimpLayer * gimp_image_get_floating_selection (GimpImage *image);
void gimp_image_floating_selection_changed (GimpImage *image);
GimpChannel * gimp_image_get_mask (GimpImage *image);
void gimp_image_mask_changed (GimpImage *image);
/* image components */
const Babl * gimp_image_get_component_format (GimpImage *image,
GimpChannelType channel);
gint gimp_image_get_component_index (GimpImage *image,
GimpChannelType channel);
void gimp_image_set_component_active (GimpImage *image,
GimpChannelType type,
gboolean active);
gboolean gimp_image_get_component_active (GimpImage *image,
GimpChannelType type);
void gimp_image_get_active_array (GimpImage *image,
gboolean *components);
GimpComponentMask gimp_image_get_active_mask (GimpImage *image);
void gimp_image_set_component_visible (GimpImage *image,
GimpChannelType type,
gboolean visible);
gboolean gimp_image_get_component_visible (GimpImage *image,
GimpChannelType type);
void gimp_image_get_visible_array (GimpImage *image,
gboolean *components);
GimpComponentMask gimp_image_get_visible_mask (GimpImage *image);
/* emitting image signals */
void gimp_image_mode_changed (GimpImage *image);
void gimp_image_precision_changed (GimpImage *image);
void gimp_image_alpha_changed (GimpImage *image);
void gimp_image_linked_items_changed (GimpImage *image);
void gimp_image_invalidate (GimpImage *image,
gint x,
gint y,
gint width,
gint height);
void gimp_image_invalidate_all (GimpImage *image);
void gimp_image_guide_added (GimpImage *image,
GimpGuide *guide);
void gimp_image_guide_removed (GimpImage *image,
GimpGuide *guide);
void gimp_image_guide_moved (GimpImage *image,
GimpGuide *guide);
void gimp_image_sample_point_added (GimpImage *image,
GimpSamplePoint *sample_point);
void gimp_image_sample_point_removed (GimpImage *image,
GimpSamplePoint *sample_point);
void gimp_image_sample_point_moved (GimpImage *image,
GimpSamplePoint *sample_point);
void gimp_image_colormap_changed (GimpImage *image,
gint col);
void gimp_image_selection_invalidate (GimpImage *image);
void gimp_image_quick_mask_changed (GimpImage *image);
void gimp_image_size_changed_detailed (GimpImage *image,
gint previous_origin_x,
gint previous_origin_y,
gint previous_width,
gint previous_height);
void gimp_image_undo_event (GimpImage *image,
GimpUndoEvent event,
GimpUndo *undo);
/* dirty counters */
gint gimp_image_dirty (GimpImage *image,
GimpDirtyMask dirty_mask);
gint gimp_image_clean (GimpImage *image,
GimpDirtyMask dirty_mask);
void gimp_image_clean_all (GimpImage *image);
void gimp_image_export_clean_all (GimpImage *image);
gint gimp_image_is_dirty (GimpImage *image);
gboolean gimp_image_is_export_dirty (GimpImage *image);
gint64 gimp_image_get_dirty_time (GimpImage *image);
/* flush this image's displays */
void gimp_image_flush (GimpImage *image);
/* display / instance counters */
gint gimp_image_get_display_count (GimpImage *image);
void gimp_image_inc_display_count (GimpImage *image);
void gimp_image_dec_display_count (GimpImage *image);
gint gimp_image_get_instance_count (GimpImage *image);
void gimp_image_inc_instance_count (GimpImage *image);
void gimp_image_inc_show_all_count (GimpImage *image);
void gimp_image_dec_show_all_count (GimpImage *image);
/* parasites */
const GimpParasite * gimp_image_parasite_find (GimpImage *image,
const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image,
gint *count);
gboolean gimp_image_parasite_validate (GimpImage *image,
const GimpParasite *parasite,
GError **error);
void gimp_image_parasite_attach (GimpImage *image,
const GimpParasite *parasite,
gboolean push_undo);
void gimp_image_parasite_detach (GimpImage *image,
const gchar *name,
gboolean push_undo);
/* tattoos */
GimpTattoo gimp_image_get_new_tattoo (GimpImage *image);
gboolean gimp_image_set_tattoo_state (GimpImage *image,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *image);
/* projection */
GimpProjection * gimp_image_get_projection (GimpImage *image);
/* layers / channels / vectors */
GimpItemTree * gimp_image_get_layer_tree (GimpImage *image);
GimpItemTree * gimp_image_get_channel_tree (GimpImage *image);
GimpItemTree * gimp_image_get_vectors_tree (GimpImage *image);
GimpContainer * gimp_image_get_layers (GimpImage *image);
GimpContainer * gimp_image_get_channels (GimpImage *image);
GimpContainer * gimp_image_get_vectors (GimpImage *image);
gint gimp_image_get_n_layers (GimpImage *image);
gint gimp_image_get_n_channels (GimpImage *image);
gint gimp_image_get_n_vectors (GimpImage *image);
GList * gimp_image_get_layer_iter (GimpImage *image);
GList * gimp_image_get_channel_iter (GimpImage *image);
GList * gimp_image_get_vectors_iter (GimpImage *image);
GList * gimp_image_get_layer_list (GimpImage *image);
GList * gimp_image_get_channel_list (GimpImage *image);
GList * gimp_image_get_vectors_list (GimpImage *image);
GimpDrawable * gimp_image_get_active_drawable (GimpImage *image);
GimpLayer * gimp_image_get_active_layer (GimpImage *image);
GimpChannel * gimp_image_get_active_channel (GimpImage *image);
GimpVectors * gimp_image_get_active_vectors (GimpImage *image);
GimpLayer * gimp_image_set_active_layer (GimpImage *image,
GimpLayer *layer);
GimpChannel * gimp_image_set_active_channel (GimpImage *image,
GimpChannel *channel);
GimpChannel * gimp_image_unset_active_channel (GimpImage *image);
GimpVectors * gimp_image_set_active_vectors (GimpImage *image,
GimpVectors *vectors);
GimpLayer * gimp_image_get_layer_by_tattoo (GimpImage *image,
GimpTattoo tattoo);
GimpChannel * gimp_image_get_channel_by_tattoo (GimpImage *image,
GimpTattoo tattoo);
GimpVectors * gimp_image_get_vectors_by_tattoo (GimpImage *image,
GimpTattoo tattoo);
GimpLayer * gimp_image_get_layer_by_name (GimpImage *image,
const gchar *name);
GimpChannel * gimp_image_get_channel_by_name (GimpImage *image,
const gchar *name);
GimpVectors * gimp_image_get_vectors_by_name (GimpImage *image,
const gchar *name);
gboolean gimp_image_reorder_item (GimpImage *image,
GimpItem *item,
GimpItem *new_parent,
gint new_index,
gboolean push_undo,
const gchar *undo_desc);
gboolean gimp_image_raise_item (GimpImage *image,
GimpItem *item,
GError **error);
gboolean gimp_image_raise_item_to_top (GimpImage *image,
GimpItem *item);
gboolean gimp_image_lower_item (GimpImage *image,
GimpItem *item,
GError **error);
gboolean gimp_image_lower_item_to_bottom (GimpImage *image,
GimpItem *item);
gboolean gimp_image_add_layer (GimpImage *image,
GimpLayer *layer,
GimpLayer *parent,
gint position,
gboolean push_undo);
void gimp_image_remove_layer (GimpImage *image,
GimpLayer *layer,
gboolean push_undo,
GimpLayer *new_active);
void gimp_image_add_layers (GimpImage *image,
GList *layers,
GimpLayer *parent,
gint position,
gint x,
gint y,
gint width,
gint height,
const gchar *undo_desc);
gboolean gimp_image_add_channel (GimpImage *image,
GimpChannel *channel,
GimpChannel *parent,
gint position,
gboolean push_undo);
void gimp_image_remove_channel (GimpImage *image,
GimpChannel *channel,
gboolean push_undo,
GimpChannel *new_active);
gboolean gimp_image_add_vectors (GimpImage *image,
GimpVectors *vectors,
GimpVectors *parent,
gint position,
gboolean push_undo);
void gimp_image_remove_vectors (GimpImage *image,
GimpVectors *vectors,
gboolean push_undo,
GimpVectors *new_active);
gboolean gimp_image_coords_in_active_pickable (GimpImage *image,
const GimpCoords *coords,
gboolean show_all,
gboolean sample_merged,
gboolean selected_only);
void gimp_image_invalidate_previews (GimpImage *image);
void gimp_image_set_converting (GimpImage *image,
gboolean converting);
gboolean gimp_image_get_converting (GimpImage *image);
#endif /* __GIMP_IMAGE_H__ */
|