File: v-sim-dumpToGif.html

package info (click to toggle)
v-sim 3.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,860 kB
  • sloc: ansic: 75,222; sh: 10,239; makefile: 580; python: 572; cpp: 353; xml: 130
file content (282 lines) | stat: -rw-r--r-- 13,694 bytes parent folder | download
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>dumpToGif</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="V_Sim API - Reference Manual">
<link rel="up" href="ch08.html" title="Methods to export to other formats">
<link rel="prev" href="v-sim-dumpThroughGdkPixbuf.html" title="dumpThroughGdkPixbuf">
<link rel="next" href="v-sim-dumpToAscii.html" title="dumpToAscii">
<meta name="generator" content="GTK-Doc V1.14 (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="2">
<tr valign="middle">
<td><a accesskey="p" href="v-sim-dumpThroughGdkPixbuf.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch08.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">V_Sim API - Reference Manual</th>
<td><a accesskey="n" href="v-sim-dumpToAscii.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#v-sim-dumpToGif.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#v-sim-dumpToGif.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="dumpToGif">
<a name="v-sim-dumpToGif"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="v-sim-dumpToGif.top_of_page"></a>dumpToGif</span></h2>
<p>dumpToGif — add an export capability into GIF files.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="v-sim-dumpToGif.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><a class="link" href="v-sim-visu-dump.html#VisuDump" title="VisuDump"><span class="returnvalue">VisuDump</span></a>*           <a class="link" href="v-sim-dumpToGif.html#dumpToGif-init" title="dumpToGif_init ()">dumpToGif_init</a>                      ();
                    <a class="link" href="v-sim-dumpToGif.html#ColorPacket" title="ColorPacket">ColorPacket</a>;
                    <a class="link" href="v-sim-dumpToGif.html#Image" title="Image">Image</a>;
unsigned <span class="returnvalue">int</span>        <a class="link" href="v-sim-dumpToGif.html#dumpToGif-quantizeImage" title="dumpToGif_quantizeImage ()">dumpToGif_quantizeImage</a>             (<em class="parameter"><code>unsigned <span class="type">int</span> number_colors</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>,
                                                         <em class="parameter"><code><span class="type">ToolVoidDataFunc</span> functionWait</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="v-sim-dumpToGif.html#dumpToGif-syncImage" title="dumpToGif_syncImage ()">dumpToGif_syncImage</a>                 (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="v-sim-dumpToGif.html#dumpToGif-setImage" title="dumpToGif_setImage ()">dumpToGif_setImage</a>                  (<em class="parameter"><code><a class="link" href="v-sim-dumpToGif.html#Image" title="Image"><span class="type">Image</span></a> *data</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="v-sim-dumpToGif.description"></a><h2>Description</h2>
<p>
</p>
<p>This provides a write routine to export V_Sim views into GIF
files.</p>
<p>
</p>
<p>
</p>
<p>Most of the routines used there have been modified by
L. Billard (1997 - 2001) from the original ones taken from the
ImageMagick package of cristy<em class="parameter"><code>dupont.com</code></em>.</p>
<p>
</p>
<p>
</p>
<p>The goal of this is to reduce the colour span into 256 to be
able to output as GIF file.</p>
<p>
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>Copyright 1994 E. I. du Pont de Nemours &amp; Company</p>
<p>Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
E. I. du Pont de Nemours &amp; Company not be used in advertising or
publicity pertaining to distribution of the software without
specific, written prior permission.  E. I. du Pont de Nemours &amp;
Company makes no representations about the suitability of this
software for any purpose.  It is provided "as is" without express
or implied warranty.</p>
<p>E. I. du Pont de Nemours &amp; Company disclaims all warranties
with regard to this software, including all implied warranties of
merchantability and fitness, in no event shall E. I. du Pont de
Nemours &amp; Company be liable for any special, indirect or
consequential damages or any damages whatsoever resulting from loss
of use, data or profits, whether in an action of contract,
negligence or other tortious action, arising out of or in
connection with the use or performance of this software.</p>
</div>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="v-sim-dumpToGif.details"></a><h2>Details</h2>
<div class="refsect2" title="dumpToGif_init ()">
<a name="dumpToGif-init"></a><h3>dumpToGif_init ()</h3>
<pre class="programlisting"><a class="link" href="v-sim-visu-dump.html#VisuDump" title="VisuDump"><span class="returnvalue">VisuDump</span></a>*           dumpToGif_init                      ();</pre>
<p>
This routine should not be used since it inialised the module
and is already called when V_Sim is launched.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly created dump object to create GIF files.. <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>. </td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="ColorPacket">
<a name="ColorPacket"></a><h3>ColorPacket</h3>
<pre class="programlisting">typedef struct {
  unsigned char red, green, blue;
  unsigned short index;
} ColorPacket;
</pre>
<p>
A private structure used by the GIF conversion. It is usefull for all
convertion from RGB to color table.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">unsigned <span class="type">char</span> <em class="structfield"><code><a name="ColorPacket.red"></a>red</code></em>;</span></p></td>
<td>red value ;
</td>
</tr>
<tr>
<td><p><span class="term">unsigned <span class="type">char</span> <em class="structfield"><code><a name="ColorPacket.green"></a>green</code></em>;</span></p></td>
<td>green value ;
</td>
</tr>
<tr>
<td><p><span class="term">unsigned <span class="type">char</span> <em class="structfield"><code><a name="ColorPacket.blue"></a>blue</code></em>;</span></p></td>
<td>blue value ;
</td>
</tr>
<tr>
<td><p><span class="term">unsigned <span class="type">short</span> <em class="structfield"><code><a name="ColorPacket.index"></a>index</code></em>;</span></p></td>
<td>??.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="Image">
<a name="Image"></a><h3>Image</h3>
<pre class="programlisting">typedef struct {
  unsigned int columns, rows, colors;
  ColorPacket *colormap, *pixels, *packet;
  unsigned long packets;    
} Image;
</pre>
<p>
A private structure used by the GIF conversion. It is usefull for all
convertion from RGB to color table.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">unsigned <span class="type">int</span> <em class="structfield"><code><a name="Image.columns"></a>columns</code></em>;</span></p></td>
<td>number of columns ;
</td>
</tr>
<tr>
<td><p><span class="term">unsigned <span class="type">int</span> <em class="structfield"><code><a name="Image.rows"></a>rows</code></em>;</span></p></td>
<td>number of rows ;
</td>
</tr>
<tr>
<td><p><span class="term">unsigned <span class="type">int</span> <em class="structfield"><code><a name="Image.colors"></a>colors</code></em>;</span></p></td>
<td>number of colours ;
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="v-sim-dumpToGif.html#ColorPacket" title="ColorPacket"><span class="type">ColorPacket</span></a> *<em class="structfield"><code><a name="Image.colormap"></a>colormap</code></em>;</span></p></td>
<td>an array of colours ;
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="v-sim-dumpToGif.html#ColorPacket" title="ColorPacket"><span class="type">ColorPacket</span></a> *<em class="structfield"><code><a name="Image.pixels"></a>pixels</code></em>;</span></p></td>
<td>the definition for each pixels ;
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="v-sim-dumpToGif.html#ColorPacket" title="ColorPacket"><span class="type">ColorPacket</span></a> *<em class="structfield"><code><a name="Image.packet"></a>packet</code></em>;</span></p></td>
<td>?? ;
</td>
</tr>
<tr>
<td><p><span class="term">unsigned <span class="type">long</span> <em class="structfield"><code><a name="Image.packets"></a>packets</code></em>;</span></p></td>
<td>??.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="dumpToGif_quantizeImage ()">
<a name="dumpToGif-quantizeImage"></a><h3>dumpToGif_quantizeImage ()</h3>
<pre class="programlisting">unsigned <span class="returnvalue">int</span>        dumpToGif_quantizeImage             (<em class="parameter"><code>unsigned <span class="type">int</span> number_colors</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>,
                                                         <em class="parameter"><code><span class="type">ToolVoidDataFunc</span> functionWait</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
This routine transform an RGB image to an indexed colours image. To set the image
to quantize, use <code class="function">setImage()</code>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>number_colors</code></em> :</span></p></td>
<td>the number of desired colours ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>an error location ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>functionWait</code></em> :</span></p></td>
<td>a method that will be called during the quantize process ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>an argument to give to the wait function.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> 0 if everithing went right.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="dumpToGif_syncImage ()">
<a name="dumpToGif-syncImage"></a><h3>dumpToGif_syncImage ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                dumpToGif_syncImage                 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Do something in the GIF exoprt process.
</p>
</div>
<hr>
<div class="refsect2" title="dumpToGif_setImage ()">
<a name="dumpToGif-setImage"></a><h3>dumpToGif_setImage ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                dumpToGif_setImage                  (<em class="parameter"><code><a class="link" href="v-sim-dumpToGif.html#Image" title="Image"><span class="type">Image</span></a> *data</code></em>);</pre>
<p>
Set the image to be manipulated by the GIF convertor (see
<a class="link" href="v-sim-dumpToGif.html#dumpToGif-quantizeImage" title="dumpToGif_quantizeImage ()"><code class="function">dumpToGif_quantizeImage()</code></a>).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>a <a class="link" href="v-sim-dumpToGif.html#Image" title="Image"><span class="type">Image</span></a> structure.
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>