File: blob.html

package info (click to toggle)
imagemagick 4.2.8-9
  • links: PTS
  • area: main
  • in suites: potato
  • size: 11,116 kB
  • ctags: 5,107
  • sloc: ansic: 98,927; sh: 11,151; cpp: 8,810; perl: 1,922; tcl: 458; makefile: 347
file content (492 lines) | stat: -rw-r--r-- 11,221 bytes parent folder | download | duplicates (2)
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
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
<HTML>
<HEAD>
<TITLE>NAME</TITLE>
<LINK REV="made" HREF="mailto:magick@wizards.dupont.com">
</HEAD>

<body background="../../images/background.gif">

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A>
	<UL>

		<LI><A HREF="#BlobToImage">BlobToImage</A>
		<LI><A HREF="#CloseBlob">CloseBlob</A>
		<LI><A HREF="#EOFBlob">EOFBlob</A>
		<LI><A HREF="#FlushBlob">FlushBlob</A>
		<LI><A HREF="#GetBlobInfo">GetBlobInfo</A>
		<LI><A HREF="#GetStringBlob">GetStringBlob</A>
		<LI><A HREF="#ImageToBlob">ImageToBlob</A>
		<LI><A HREF="#OpenBlob">OpenBlob</A>
		<LI><A HREF="#ReadBlob">ReadBlob</A>
		<LI><A HREF="#SeekBlob">SeekBlob</A>
		<LI><A HREF="#TellBlob">TellBlob</A>
		<LI><A HREF="#WriteBlob">WriteBlob</A>
	</UL>

</UL>
<!-- INDEX END -->

<HR>
<P>
<H1><A NAME="NAME">NAME</A></H1>
<P>
blob - 

<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<P>
void <STRONG>CloseBlob</STRONG>(Image*image)

<P>
int <STRONG>EOFBlob</STRONG>(constImage*image)

<P>
int <STRONG>FlushBlob</STRONG>(constImage*image)

<P>
void <STRONG>GetBlobInfo</STRONG>(BlobInfo*blob_info)

<P>
char* <STRONG>GetStringBlob</STRONG>(Image*image,char*string)

<P>
int <STRONG>SeekBlob</STRONG>(Image*image,constlongoffset,constintwhence)

<P>
void <STRONG>SetBlobQuantum</STRONG>(BlobInfo*blob_info,constunsignedlongquantum)

<P>
int <STRONG>TellBlob</STRONG>(constImage*image)

<P>
<HR>
<H1><A NAME="FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A></H1>
<P>
<HR>
<H2><A NAME="BlobToImage">BlobToImage</A></H2>
<P>
Method BlobToImage implements direct to memory image formats. It returns
the blob as an image.

<P>
The format of the BlobToImage method is:

<P>
<PRE>    Image *BlobToImage(const ImageInfo *image_info,const char *blob,
      const unsigned long length)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG><A NAME="item_o">image:</A></STRONG><DD>
<P>
Method BlobToImage returns an image from the supplied blob. If an error occurs 
<FONT SIZE=-1>NULL</FONT> is returned.


<DT><STRONG>image_info:</STRONG><DD>
<P>
Specifies a pointer to an ImageInfo structure.

<DT><STRONG>blob:</STRONG><DD>
<P>
The address of a character stream in one of the image formats understood by
ImageMagick.

<DT><STRONG>length:</STRONG><DD>
<P>
This unsigned integer reflects the length in bytes of the blob.

</DL></DL>
<P>
<HR>
<H2><A NAME="CloseBlob">CloseBlob</A></H2>
<P>
Method CloseBlob closes a file associated with the image. If the filename
prefix is '|', the file is a pipe and is closed with PipeClose.

<P>
The format of the CloseBlob method is:

<blockquote>void CloseBlob (<A HREF="types/Image.html">Image</A> *image) </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

</DL></DL>
<P>
<HR>
<H2><A NAME="EOFBlob">EOFBlob</A></H2>
<P>
Method EOFBlob returns a non-zero value when 
<FONT SIZE=-1>EOF</FONT> has been detected reading from a blob or file.

<P>
The format of the EOFBlob method is:

<blockquote>int EOFBlob (const <A HREF="types/Image.html">Image</A> *image) </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
Method EOFBlob returns 0 on success; otherwise, it returns -1 and set errno
to indicate the error.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

</DL></DL>
<P>
<HR>
<H2><A NAME="FlushBlob">FlushBlob</A></H2>
<P>
Method FlushBlob flushes the datastream if it is a file.

<P>
The format of the FlushBlob method is:

<blockquote>int FlushBlob (const <A HREF="types/Image.html">Image</A> *image) </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
Method FlushBlob returns 0 on success; otherwise, it returns -1 and set
errno to indicate the error.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

</DL></DL>
<P>
<HR>
<H2><A NAME="GetBlobInfo">GetBlobInfo</A></H2>
<P>
Method GetBlobInfo initializes the BlobInfo structure.

<P>
The format of the GetBlobInfo method is:

<blockquote>void GetBlobInfo (BlobInfo *blob_info) </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>blob_info:</STRONG><DD>
<P>
Specifies a pointer to a BlobInfo structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="GetStringBlob">GetStringBlob</A></H2>
<P>
Method GetStringBlob reads characters from a blob or file until a newline
character is read or an end-of-file condition is encountered. from a blob
or file.

<P>
The format of the GetStringBlob method is:

<blockquote>char *GetStringBlob (<A HREF="types/Image.html">Image</A> *image, char *string) </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
Method GetStringBlob returns the string on success, otherwise, a null is
returned.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

<DT><STRONG>string:</STRONG><DD>
<P>
The address of a character buffer.

</DL></DL>
<P>
<HR>
<H2><A NAME="ImageToBlob">ImageToBlob</A></H2>
<P>
Method ImageToBlob implements direct to memory image formats. It returns
the image as a blob and its length.

<P>
The format of the ImageToBlob method is:

<P>
<PRE>    char *ImageToBlob(const ImageInfo *image_info,Image *image,
      unsigned long *length)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>blob:</STRONG><DD>
<P>
Method ImageToBlob returns a chunk of memory written in the desired image format (e.g. 
<FONT SIZE=-1>JPEG,</FONT> 
<FONT SIZE=-1>GIF,</FONT> etc.). If an error occurs 
<FONT SIZE=-1>NULL</FONT> is returned.


<DT><STRONG>image_info:</STRONG><DD>
<P>
Specifies a pointer to an ImageInfo structure.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

<DT><STRONG>length:</STRONG><DD>
<P>
This pointer to an unsigned int sets the initial length of the blob. On
return, it reflects the actual length of the blob.

</DL></DL>
<P>
<HR>
<H2><A NAME="OpenBlob">OpenBlob</A></H2>
<P>
Method OpenBlob open a file associated with the image. 
<FONT SIZE=-1>A</FONT> file name of '-' sets the file to stdin for type 'r' and stdout for type 'w'. If the filename suffix is '.gz' or 
<FONT SIZE=-1>'.Z',</FONT> the image is decompressed for type 'r' and compressed for type 'w'. If the filename prefix is '|', it is piped to or from a system command.


<P>
The format of the OpenBlob method is:

<P>
<PRE>    unsigned int OpenBlob(const ImageInfo *image_info,Image *image,
      const char *type)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
Method OpenBlob returns True if the file is successfully opened otherwise
False.

<DT><STRONG>image_info:</STRONG><DD>
<P>
Specifies a pointer to an ImageInfo structure.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

<DT><STRONG>type:</STRONG><DD>
<P>
'r' for reading; 'w' for writing.

</DL></DL>
<P>
<HR>
<H2><A NAME="ReadBlob">ReadBlob</A></H2>
<P>
Method ReadBlob reads data from the blob or image file and returns it. It
returns the number of bytes read.

<P>
The format of the ReadBlob method is:

<P>
<PRE>    unsigned long ReadBlob(Image *image,const unsigned long number_bytes,
      char *data)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>count:</STRONG><DD>
<P>
Method ReadBlob returns the number of items read.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

<DT><STRONG>number_bytes:</STRONG><DD>
<P>
Specifies an integer representing the number of bytes to read from the
file.

<DT><STRONG>data:</STRONG><DD>
<P>
Specifies an area to place the information requested from the file.

</DL></DL>
<P>
<HR>
<H2><A NAME="SeekBlob">SeekBlob</A></H2>
<P>
Method SeekBlob sets the offset in bytes from the beginning of a blob or
file.

<P>
The format of the SeekBlob method is:

<blockquote>int SeekBlob (<A HREF="types/Image.html">Image</A> *image, const long offset,const int whence) </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
Method SeekBlob returns 0 on success; otherwise, it returned -1 and set
errno to indicate the error.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

<DT><STRONG>offset:</STRONG><DD>
<P>
Specifies an integer representing the offset in bytes.

<DT><STRONG>whence:</STRONG><DD>
<P>
Specifies an integer representing how the offset is treated relative to the
beginning of the blob as follows:

</DL></DL>
<P>
<PRE>      SEEK_SET  Set position equal to offset bytes.
      SEEK_CUR  Set position to current location plus offset.
      SEEK_END  Set position to EOF plus offset.
=head2 SetBlobQuantum
</PRE>
<P>
Method SetBlobQuantum set the current value of the blob quantum. This is
the size in bytes to add to a blob when writing to a blob exceeds its
current length.

<P>
The format of the SetBlobQuantum method is:

<blockquote>void SetBlobQuantum (BlobInfo *blob_info, const unsigned long quantum) </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>blob_info:</STRONG><DD>
<P>

<FONT SIZE=-1>A</FONT> pointer to a BlobInfo structure.

<DT><STRONG>quantum:</STRONG><DD>
<P>
An unsigned long that reflects the number of bytes to increase a blob.

</DL></DL>
<P>
<HR>
<H2><A NAME="TellBlob">TellBlob</A></H2>
<P>
Method TellBlob obtains the current value of the blob or file position.

<P>
The format of the TellBlob method is:

<blockquote>int TellBlob (const <A HREF="types/Image.html">Image</A> *image) </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
Method TellBlob returns 0 on success; otherwise, it returned -1 and set
errno to indicate the error.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

</DL></DL>
<P>
<HR>
<H2><A NAME="WriteBlob">WriteBlob</A></H2>
<P>
Method WriteBlob writes data to a blob or image file. It returns the number
of items written.

<P>
The format of the WriteBlob method is:

<P>
<PRE>    unsigned long WriteBlob(Image *image,const unsigned long number_bytes,
      const char *data)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>status:</STRONG><DD>
<P>
Method WriteBlob returns True if all the data requested is obtained without
error, otherwise False.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

<DT><STRONG>size:</STRONG><DD>
<P>
Specifies an integer representing the length of an individual item to be
written to the file.

<DT><STRONG>number_items:</STRONG><DD>
<P>
Specifies an integer representing the number of items to write to the file.

<DT><STRONG>data:</STRONG><DD>
<P>
The address of the data to write to the blob or file.

</DL></DL>
</BODY>

</HTML>