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
|
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="libgimp-gimpexport">
<refmeta>
<refentrytitle role="top_of_page">gimpexport</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGIMP Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>gimpexport</refname>
<refpurpose>Export an image before it is saved.</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>
<synopsis>
enum <link linkend="GimpExportCapabilities">GimpExportCapabilities</link>;
enum <link linkend="GimpExportReturn">GimpExportReturn</link>;
<link linkend="GimpExportReturn">GimpExportReturn</link> <link linkend="gimp-export-image">gimp_export_image</link> (<link linkend="gint32">gint32</link> *image_ID,
<link linkend="gint32">gint32</link> *drawable_ID,
const <link linkend="gchar">gchar</link> *format_name,
<link linkend="GimpExportCapabilities">GimpExportCapabilities</link> capabilities);
</synopsis>
</refsynopsisdiv>
<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
This function should be called by all save_plugins unless they are
able to save all image formats the 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.
The capabilities of the save_plugin are specified by combining
<link linkend="GimpExportCapabilities"><type>GimpExportCapabilities</type></link> using a bitwise OR.
Make sure you have initialized GTK+ before you call this function
as it will most probably have to open a dialog.
</para>
</refsect1>
<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="GimpExportCapabilities" role="enum"/>enum GimpExportCapabilities</title>
<indexterm><primary>GimpExportCapabilities</primary></indexterm><programlisting>typedef enum
{
GIMP_EXPORT_CAN_HANDLE_RGB = 1 << 0,
GIMP_EXPORT_CAN_HANDLE_GRAY = 1 << 1,
GIMP_EXPORT_CAN_HANDLE_INDEXED = 1 << 2,
GIMP_EXPORT_CAN_HANDLE_BITMAP = 1 << 3,
GIMP_EXPORT_CAN_HANDLE_ALPHA = 1 << 4,
GIMP_EXPORT_CAN_HANDLE_LAYERS = 1 << 5,
GIMP_EXPORT_CAN_HANDLE_LAYERS_AS_ANIMATION = 1 << 6,
GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS = 1 << 7,
GIMP_EXPORT_NEEDS_ALPHA = 1 << 8
} GimpExportCapabilities;
</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="GimpExportReturn" role="enum"/>enum GimpExportReturn</title>
<indexterm><primary>GimpExportReturn</primary></indexterm><programlisting>typedef enum
{
GIMP_EXPORT_CANCEL,
GIMP_EXPORT_IGNORE,
GIMP_EXPORT_EXPORT
} GimpExportReturn;
</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="gimp-export-image" role="function"/>gimp_export_image ()</title>
<indexterm><primary>gimp_export_image</primary></indexterm><programlisting><link linkend="GimpExportReturn">GimpExportReturn</link> gimp_export_image (<link linkend="gint32">gint32</link> *image_ID,
<link linkend="gint32">gint32</link> *drawable_ID,
const <link linkend="gchar">gchar</link> *format_name,
<link linkend="GimpExportCapabilities">GimpExportCapabilities</link> capabilities);</programlisting>
<para>
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.
</para>
<para>
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 <link linkend="gimp-image-delete"><function>gimp_image_delete()</function></link> when it has saved it.
</para>
<para>
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 <link linkend="GIMP-PDB-CANCEL:CAPS"><type>GIMP_PDB_CANCEL</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>image_ID</parameter> :</term>
<listitem><simpara> Pointer to the image_ID.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>drawable_ID</parameter> :</term>
<listitem><simpara> Pointer to the drawable_ID.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format_name</parameter> :</term>
<listitem><simpara> The (short) name of the image_format (e.g. JPEG or GIF).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>capabilities</parameter> :</term>
<listitem><simpara> What can the image_format do?
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> An enum of <link linkend="GimpExportReturn"><type>GimpExportReturn</type></link> describing the user_action.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
</refentry>
|