summaryrefslogtreecommitdiffstats
path: root/devel-docs/libgimp/html/libgimp-gimpexport.html
blob: 1dde234c4208e15fa835ebe229dc573a1cd032f9 (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gimpexport: GIMP Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GIMP Library Reference Manual">
<link rel="up" href="libgimpui.html" title="Part II. GIMP User Interface Library">
<link rel="prev" href="libgimp-gimpui.html" title="gimpui">
<link rel="next" href="GimpDrawablePreview.html" title="GimpDrawablePreview">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libgimp-gimpexport.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libgimpui.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libgimp-gimpui.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GimpDrawablePreview.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libgimp-gimpexport"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgimp-gimpexport.top_of_page"></a>gimpexport</span></h2>
<p>gimpexport — Export an image before it is saved.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libgimp-gimpexport.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="libgimp-gimpexport.html#GimpExportReturn" title="enum GimpExportReturn"><span class="returnvalue">GimpExportReturn</span></a>
</td>
<td class="function_name">
<a class="link" href="libgimp-gimpexport.html#gimp-export-image" title="gimp_export_image ()">gimp_export_image</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GtkWidget</span> *
</td>
<td class="function_name">
<a class="link" href="libgimp-gimpexport.html#gimp-export-dialog-new" title="gimp_export_dialog_new ()">gimp_export_dialog_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GtkWidget</span> *
</td>
<td class="function_name">
<a class="link" href="libgimp-gimpexport.html#gimp-export-dialog-get-content-area" title="gimp_export_dialog_get_content_area ()">gimp_export_dialog_get_content_area</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgimp-gimpexport.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libgimp-gimpexport.html#GimpExportCapabilities" title="enum GimpExportCapabilities">GimpExportCapabilities</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libgimp-gimpexport.html#GimpExportReturn" title="enum GimpExportReturn">GimpExportReturn</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgimp-gimpexport.description"></a><h2>Description</h2>
<p>This function should be called by all save_plugins unless they are
able to save all image formats GIMP knows about. It takes care of
asking the user if she wishes to export the image to a format the
save_plugin can handle. It then performs the necessary conversions
(e.g. Flatten) on a copy of the image so that the image can be
saved without changing the original image.</p>
<p>The capabilities of the save_plugin are specified by combining
<a class="link" href="libgimp-gimpexport.html#GimpExportCapabilities" title="enum GimpExportCapabilities"><span class="type">GimpExportCapabilities</span></a> using a bitwise OR.</p>
<p>Make sure you have initialized GTK+ before you call this function
as it will most probably have to open a dialog.</p>
</div>
<div class="refsect1">
<a name="libgimp-gimpexport.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gimp-export-image"></a><h3>gimp_export_image ()</h3>
<pre class="programlisting"><a class="link" href="libgimp-gimpexport.html#GimpExportReturn" title="enum GimpExportReturn"><span class="returnvalue">GimpExportReturn</span></a>
gimp_export_image (<em class="parameter"><code><span class="type">gint32</span> *image_ID</code></em>,
                   <em class="parameter"><code><span class="type">gint32</span> *drawable_ID</code></em>,
                   <em class="parameter"><code>const <span class="type">gchar</span> *format_name</code></em>,
                   <em class="parameter"><code><a class="link" href="libgimp-gimpexport.html#GimpExportCapabilities" title="enum GimpExportCapabilities"><span class="type">GimpExportCapabilities</span></a> capabilities</code></em>);</pre>
<p>Takes an image and a drawable to be saved together with a
description of the capabilities of the image_format. If the
type of image doesn't match the capabilities of the format
a dialog is opened that informs the user that the image has
to be exported and offers to do the necessary conversions.</p>
<p>If the user chooses to export the image, a copy is created.
This copy is then converted, the image_ID and drawable_ID
are changed to point to the new image and the procedure returns
GIMP_EXPORT_EXPORT. The save_plugin has to take care of deleting the
created image using <a class="link" href="libgimp-gimpimage.html#gimp-image-delete" title="gimp_image_delete ()"><code class="function">gimp_image_delete()</code></a> when it has saved it.</p>
<p>If the user chooses to Ignore the export problem, the image_ID
and drawable_ID is not altered, GIMP_EXPORT_IGNORE is returned and
the save_plugin should try to save the original image. If the
user chooses Cancel, GIMP_EXPORT_CANCEL is returned and the
save_plugin should quit itself with status <a href="../html/libgimpbase-gimpbaseenums.html#GIMP-PDB-CANCEL:CAPS"><code class="literal">GIMP_PDB_CANCEL</code></a>.</p>
<p>If <em class="parameter"><code>format_name</code></em>
 is NULL, no dialogs will be shown and this function
will behave as if the user clicked on the 'Export' button, if a
dialog would have been shown.</p>
<div class="refsect3">
<a name="gimp-export-image.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>image_ID</p></td>
<td class="parameter_description"><p>Pointer to the image_ID.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>drawable_ID</p></td>
<td class="parameter_description"><p>Pointer to the drawable_ID.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format_name</p></td>
<td class="parameter_description"><p>The (short) name of the image_format (e.g. JPEG or GIF).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>capabilities</p></td>
<td class="parameter_description"><p>What can the image_format do?</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-export-image.returns"></a><h4>Returns</h4>
<p> An enum of <a class="link" href="libgimp-gimpexport.html#GimpExportReturn" title="enum GimpExportReturn"><span class="type">GimpExportReturn</span></a> describing the user_action.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-export-dialog-new"></a><h3>gimp_export_dialog_new ()</h3>
<pre class="programlisting"><span class="returnvalue">GtkWidget</span> *
gimp_export_dialog_new (<em class="parameter"><code>const <span class="type">gchar</span> *format_name</code></em>,
                        <em class="parameter"><code>const <span class="type">gchar</span> *role</code></em>,
                        <em class="parameter"><code>const <span class="type">gchar</span> *help_id</code></em>);</pre>
<p>Creates a new export dialog. All file plug-ins should use this
dialog to get a consistent look on the export dialogs. Use
<a class="link" href="libgimp-gimpexport.html#gimp-export-dialog-get-content-area" title="gimp_export_dialog_get_content_area ()"><code class="function">gimp_export_dialog_get_content_area()</code></a> to get a <span class="type">GtkVBox</span> to be
filled with export options. The export dialog is a wrapped
<a href="../html/GimpDialog.html#GimpDialog-struct"><span class="type">GimpDialog</span></a>.</p>
<p>The dialog response when the user clicks on the Export button is
<code class="literal">GTK_RESPONSE_OK</code>, and when the Cancel button is clicked it is
<code class="literal">GTK_RESPONSE_CANCEL</code>.</p>
<div class="refsect3">
<a name="gimp-export-dialog-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>format_name</p></td>
<td class="parameter_description"><p>The short name of the image_format (e.g. JPEG or PNG).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>role</p></td>
<td class="parameter_description"><p>The dialog's <em class="parameter"><code>role</code></em>
which will be set with
<code class="function">gtk_window_set_role()</code>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>help_id</p></td>
<td class="parameter_description"><p>The GIMP help id.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-export-dialog-new.returns"></a><h4>Returns</h4>
<p> The new export dialog.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-8.html#api-index-2.8">2.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-export-dialog-get-content-area"></a><h3>gimp_export_dialog_get_content_area ()</h3>
<pre class="programlisting"><span class="returnvalue">GtkWidget</span> *
gimp_export_dialog_get_content_area (<em class="parameter"><code><span class="type">GtkWidget</span> *dialog</code></em>);</pre>
<p>Returns the <span class="type">GtkVBox</span> of the passed export dialog to be filled with
export options.</p>
<div class="refsect3">
<a name="gimp-export-dialog-get-content-area.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>dialog</p></td>
<td class="parameter_description"><p>A dialog created with <a class="link" href="libgimp-gimpexport.html#gimp-export-dialog-new" title="gimp_export_dialog_new ()"><code class="function">gimp_export_dialog_new()</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-export-dialog-get-content-area.returns"></a><h4>Returns</h4>
<p> The <span class="type">GtkVBox</span> to fill with export options.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-8.html#api-index-2.8">2.8</a></p>
</div>
</div>
<div class="refsect1">
<a name="libgimp-gimpexport.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GimpExportCapabilities"></a><h3>enum GimpExportCapabilities</h3>
<p>The types of images and layers an export procedure can handle</p>
<div class="refsect3">
<a name="GimpExportCapabilities.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-CAN-HANDLE-RGB:CAPS"></a>GIMP_EXPORT_CAN_HANDLE_RGB</p></td>
<td class="enum_member_description">
<p>Handles RGB images</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-CAN-HANDLE-GRAY:CAPS"></a>GIMP_EXPORT_CAN_HANDLE_GRAY</p></td>
<td class="enum_member_description">
<p>Handles grayscale images</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-CAN-HANDLE-INDEXED:CAPS"></a>GIMP_EXPORT_CAN_HANDLE_INDEXED</p></td>
<td class="enum_member_description">
<p>Handles indexed images</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-CAN-HANDLE-BITMAP:CAPS"></a>GIMP_EXPORT_CAN_HANDLE_BITMAP</p></td>
<td class="enum_member_description">
<p>Handles two-color indexed images</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-CAN-HANDLE-ALPHA:CAPS"></a>GIMP_EXPORT_CAN_HANDLE_ALPHA</p></td>
<td class="enum_member_description">
<p>Handles alpha channels</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-CAN-HANDLE-LAYERS:CAPS"></a>GIMP_EXPORT_CAN_HANDLE_LAYERS</p></td>
<td class="enum_member_description">
<p>Hanldes layers</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-CAN-HANDLE-LAYERS-AS-ANIMATION:CAPS"></a>GIMP_EXPORT_CAN_HANDLE_LAYERS_AS_ANIMATION</p></td>
<td class="enum_member_description">
<p>Handles aminations of layers</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-CAN-HANDLE-LAYER-MASKS:CAPS"></a>GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS</p></td>
<td class="enum_member_description">
<p>Handles layer masks</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-NEEDS-ALPHA:CAPS"></a>GIMP_EXPORT_NEEDS_ALPHA</p></td>
<td class="enum_member_description">
<p>Needs alpha channels</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-NEEDS-CROP:CAPS"></a>GIMP_EXPORT_NEEDS_CROP</p></td>
<td class="enum_member_description">
<p>Needs to crop content to image bounds</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GimpExportReturn"></a><h3>enum GimpExportReturn</h3>
<p>Possible return values of <a class="link" href="libgimp-gimpexport.html#gimp-export-image" title="gimp_export_image ()"><code class="function">gimp_export_image()</code></a>.</p>
<div class="refsect3">
<a name="GimpExportReturn.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-CANCEL:CAPS"></a>GIMP_EXPORT_CANCEL</p></td>
<td class="enum_member_description">
<p>The export was cancelled</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-IGNORE:CAPS"></a>GIMP_EXPORT_IGNORE</p></td>
<td class="enum_member_description">
<p>The image is unmodified but export shall continue anyway</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GIMP-EXPORT-EXPORT:CAPS"></a>GIMP_EXPORT_EXPORT</p></td>
<td class="enum_member_description">
<p>The chosen transforms were applied to the image</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>