File: constitute.html

package info (click to toggle)
imagemagick 6%3A6.0.6.2-2.9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 33,284 kB
  • ctags: 14,844
  • sloc: ansic: 190,790; cpp: 17,203; sh: 8,740; perl: 4,190; makefile: 1,740; tcl: 459
file content (381 lines) | stat: -rw-r--r-- 19,465 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
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>constitute - Constitute an Image</title>
<link rel="stylesheet" type="text/css" href="../magick.css">
</head>

<body marginheight="1" marginwidth="1" topmargin="1" leftmargin="1">
<a name="top"></a> 
<table border="0" cellpadding="0" cellspacing="0" summary="Masthead" width="100%">
<tbody>
<tr>
<td bgcolor="#003399" width="25%" height="118" background="../../images/background.gif"><a href="http://www.imagemagick.org/"><img src="../../images/script.gif" width="278" height="118" border="0" alt="" /></a></td>
<td bgcolor="#003399" width="60%" height="118" background="../../images/background.gif"><a href="http://www.networkeleven.com/direct.php?magick_all"><img src="../../images/promote.png" border="0" width="186" height="52" vspace="29" alt="Powered by NetworkEleven" /></a></td>
<td bgcolor="#003399" width="114" height="118" align="right"><img src="../../images/sprite.png" width="114" height="118" alt="" /></td>
<td bgcolor="#003399" width="114" height="118" align="right"><a href="http://www.imagemagick.net"><img src="../../images/logo.png" width="114" height="118" border="0" alt="ImageMagick logo" /></a></td>
</tr></tbody></table>
<table align="left" border="0" cellpadding="2" cellspacing="2" summary="Navigation buttons" width="20%">
<tr>
<td>
<form target="_self" action="../../index.html"><input type="submit" title="ImageMagick Home" value=" Home" style="background-color: #1947A3; background-image:url('../../../images/background.gif'); color:#fbc713; font-weight:bold"></form></td>
<td>
<form target="_self" action="../../www/apis.html"><input type="submit" title="ImageMagick API" value=" API " style="background-color: #1947A3; background-image:url('../../../images/background.gif'); color:#fbc713; font-weight:bold"></form></td>
<td>
<form target="_self" action="../../www/archives.html"><input type="submit" title="ImageMagick Download" value="Download" style="background-color: #1947A3; background-image:url('../../../images/background.gif'); color:#fbc713; font-weight:bold"></form></td></tr></table>
<div align="right" style="margin-top:3px; padding-right:4px">
<form action="http://studio.imagemagick.org/Sage/scripts/Sage.cgi"><input type="TEXT" name="query" size="32" maxlength="255"> <input type="SUBMIT" name="sa" value="Search" style="background-color: #1947A3; background-image:url('../../../images/background.gif'); bgcolor:#003399; color:#fbc713; font-weight:bold"></form></div>
<table align="left" border="0" cellpadding="10" cellspacing="0" style="margin-top:-17px" width="100%">
<tr>
<td>


<P><a name="__index__"></a></P>
<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#function_descriptions">FUNCTION DESCRIPTIONS</a></li>
	<ul>

		<li><a href="#constituteimage">ConstituteImage</a></li>
		<li><a href="#destroyconstitute">DestroyConstitute</a></li>
		<li><a href="#exportimagepixels">ExportImagePixels</a></li>
		<li><a href="#importimagepixels">ImportImagePixels</a></li>
		<li><a href="#pingimage">PingImage</a></li>
		<li><a href="#popimagepixels">PopImagePixels</a></li>
		<li><a href="#pushimagepixels">PushImagePixels</a></li>
		<li><a href="#readimage">ReadImage</a></li>
		<li><a href="#readinlineimage">ReadInlineImage</a></li>
		<li><a href="#writeimage">WriteImage</a></li>
		<li><a href="#writeimages">WriteImages</a></li>
	</ul>

</ul>
<!-- INDEX END -->

<hr />
<P>
</P>
<h1><a name="name">NAME</a></h1>
<P>constitute - Constitute an Image</P>
<P>
</P>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<P>Image * <strong>ConstituteImage</strong>( const unsigned long columns, const unsigned long rows, const char *map, const StorageType storage, const void *pixels, ExceptionInfo *exception );</P>
<P><strong>DestroyConstitute</strong>( void );</P>
<P>MagickBooleanType  <strong>ExportImagePixels</strong>( const Image *image, const long x_offset, const long y_offset, const unsigned long columns, const unsigned long rows, const char *map, const StorageType type, void *pixels, ExceptionInfo *exception );</P>
<P>MagickBooleanType  <strong>ImportImagePixels</strong>( Image *image, const long x_offset, const long y_offset, const unsigned long columns, const unsigned long rows, const char *map, const StorageType type, const void *pixels );</P>
<P>Image * <strong>PingImage</strong>( const ImageInfo *image_info, ExceptionInfo *exception );</P>
<P>MagickBooleanType  <strong>PopImagePixels</strong>( Image *, const QuantumType quantum, unsigned char *destination );</P>
<P>MagickBooleanType  <strong>PushImagePixels</strong>( Image *image, const QuantumType quantum, const unsigned char *source );</P>
<P>Image * <strong>ReadImage</strong>( const ImageInfo *image_info, ExceptionInfo *exception );</P>
<P>Image * <strong>ReadInlineImage</strong>( const ImageInfo *image_info, const char *content, ExceptionInfo *exception );</P>
<P>MagickBooleanType  <strong>WriteImage</strong>( const ImageInfo *image_info, Image *image );</P>
<P>MagickBooleanType  <strong>WriteImages</strong>( const ImageInfo *image_info, Image *image, const char *filename, ExceptionInfo *exception );</P>
<P>
</P>
<hr />
<h1><a name="function_descriptions">FUNCTION DESCRIPTIONS</a></h1>
<P>
</P>
<h2><a name="constituteimage">ConstituteImage</a></h2>
<blockquote>ConstituteImage() returns an image from the the pixel data you supply. The pixel data must be in scanline order top-to-bottom. The data can be char, short int, int, float, or double. Float and double require the pixels to be normalized [0..1], otherwise [0..MaxRGB]. For example, to create a 640x480 image from unsigned red-green-blue character data, use </blockquote><blockquote>image=ConstituteImage ( 640, 480, "RGB", CharPixel, pixels, &exception );; </blockquote><P>The format of the Constitute method is:</P>
<blockquote><A HREF="types.html#Image">Image</A> *ConstituteImage ( const unsigned long columns, const unsigned long rows, const char *map, const <A HREF="types.html#StorageType">StorageType</A> storage, const void *pixels, <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong><a name="item_o_columns_3a">columns:</a></strong><br />
</dt>
<DD>
width in pixels of the image.
</dd>
<P></P>
<dt><strong><a name="item_o_rows_3a">rows:</a></strong><br />
</dt>
<DD>
height in pixels of the image.
</dd>
<P></P>
<dt><strong><a name="item_o_map_3a">map:</a></strong><br />
</dt>
<DD>
This string reflects the expected ordering of the pixel array.  It can be any combination or order of R = red, G = green, B = blue, A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, M = magenta, K = black, I = intensity (for grayscale), P = pad.
</dd>
<P></P>
<dt><strong><a name="item_o_storage_3a">storage:</a></strong><br />
</dt>
<DD>
Define the data type of the pixels.  Float and double types are expected to be normalized [0..1] otherwise [0..MaxRGB]. Choose from these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel, or DoublePixel.
</dd>
<P></P>
<dt><strong><a name="item_o_pixels_3a">pixels:</a></strong><br />
</dt>
<DD>
This array of values contain the pixel components as defined by map and type.  You must preallocate this array where the expected length varies depending on the values of width, height, map, and type.
</dd>
<P></P>
<dt><strong><a name="item_o_exception_3a">exception:</a></strong><br />
</dt>
<DD>
Return any errors or warnings in this structure.
</dd>
<P></P></dl>
<P>
</P>
<h2><a name="destroyconstitute">DestroyConstitute</a></h2>
<blockquote>DestroyConstitute() destroys the constitute environment. </blockquote><P>The format of the DestroyConstitute method is:</P>
<blockquote>DestroyConstitute ( void ); </blockquote><P>
</P>
<h2><a name="exportimagepixels">ExportImagePixels</a></h2>
<blockquote>ExportImagePixels() extracts pixel data from an image and returns it to you. The method returns MagickTrue on success otherwise MagickFalse if an error is encountered. The data is returned as char, short int, int, long, float, or double in the order specified by map. </blockquote><P>Suppose you want to extract the first scanline of a 640x480 image as character data in red-green-blue order:</P>
<blockquote>ExportImagePixels ( image, 0, 0, 640, 1, "RGB", CharPixel, pixels, exception );; </blockquote><P>The format of the ExportImagePixels method is:</P>
<blockquote>MagickBooleanType ExportImagePixels ( const <A HREF="types.html#Image">Image</A> *image, const long x_offset, const long y_offset, const unsigned long columns, const unsigned long rows, const char *map, const <A HREF="types.html#StorageType">StorageType</A> type, void *pixels, <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong><a name="item_o_image_3a">image:</a></strong><br />
</dt>
<DD>
The image.
</dd>
<P></P>
<dt><strong><a name="item_o_x_offset_2c_y_offset_2c_columns_2c_rows_3a">x_offset, y_offset, columns, rows:</a></strong><br />
</dt>
<DD>
These values define the perimeter of a region of pixels you want to extract.
</dd>
<P></P>
<dt><strong>map:</strong><br />
</dt>
<DD>
This string reflects the expected ordering of the pixel array.  It can be any combination or order of R = red, G = green, B = blue, A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, M = magenta, K = black, I = intensity (for grayscale), P = pad.
</dd>
<P></P>
<dt><strong><a name="item_o_type_3a">type:</a></strong><br />
</dt>
<DD>
Define the data type of the pixels.  Float and double types are normalized to [0..1] otherwise [0..MaxRGB]. Choose from these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel, or DoublePixel.
</dd>
<P></P>
<dt><strong>pixels:</strong><br />
</dt>
<DD>
This array of values contain the pixel components as defined by map and type.  You must preallocate this array where the expected length varies depending on the values of width, height, map, and type.
</dd>
<P></P>
<dt><strong>exception:</strong><br />
</dt>
<DD>
Return any errors or warnings in this structure.
</dd>
<P></P></dl>
<P>
</P>
<h2><a name="importimagepixels">ImportImagePixels</a></h2>
<blockquote>ImportImagePixels() accepts pixel data and stores in the image at the location you specify. The method returns MagickTrue on success otherwise MagickFalse if an error is encountered. The pixel data can be either char, short int, int, long, float, or double in the order specified by map. </blockquote><P>Suppose your want want to upload the first scanline of a 640x480 image from character data in red-green-blue order:</P>
<blockquote>ImportImagePixels ( image, 0, 0, 640, 1, "RGB", CharPixel, pixels );; </blockquote><P>The format of the ImportImagePixels method is:</P>
<blockquote>MagickBooleanType ImportImagePixels ( <A HREF="types.html#Image">Image</A> *image, const long x_offset, const long y_offset, const unsigned long columns, const unsigned long rows, const char *map, const <A HREF="types.html#StorageType">StorageType</A> type, const void *pixels ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image:</strong><br />
</dt>
<DD>
The image.
</dd>
<P></P>
<dt><strong>x_offset, y_offset, columns, rows:</strong><br />
</dt>
<DD>
These values define the perimeter of a region of pixels you want to define.
</dd>
<P></P>
<dt><strong>map:</strong><br />
</dt>
<DD>
This string reflects the expected ordering of the pixel array.  It can be any combination or order of R = red, G = green, B = blue, A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, M = magenta, K = black, I = intensity (for grayscale), P = pad.
</dd>
<P></P>
<dt><strong>type:</strong><br />
</dt>
<DD>
Define the data type of the pixels.  Float and double types are normalized to [0..1] otherwise [0..MaxRGB]. Choose from these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel, or DoublePixel.
</dd>
<P></P>
<dt><strong>pixels:</strong><br />
</dt>
<DD>
This array of values contain the pixel components as defined by map and type.  You must preallocate this array where the expected length varies depending on the values of width, height, map, and type.
</dd>
<P></P></dl>
<P>
</P>
<h2><a name="pingimage">PingImage</a></h2>
<blockquote>PingImage() returns all the attributes of an image or image sequence except for the pixels. It is much faster and consumes far less memory than ReadImage ( ) . On failure, a NULL image is returned and exception describes the reason for the failure. </blockquote><P>The format of the PingImage method is:</P>
<blockquote><A HREF="types.html#Image">Image</A> *PingImage ( const <A HREF="types.html#ImageInfo">ImageInfo</A> *image_info, <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong><a name="item_o_image_info_3a">image_info:</a></strong><br />
</dt>
<DD>
Ping the image defined by the file or filename members of this structure.
</dd>
<P></P>
<dt><strong>exception:</strong><br />
</dt>
<DD>
Return any errors or warnings in this structure.
</dd>
<P></P></dl>
<P>
</P>
<h2><a name="popimagepixels">PopImagePixels</a></h2>
<blockquote>PopImagePixels() transfers one or more pixel components from the image pixel cache to a user supplied buffer. The pixels are returned in network byte order. MagickTrue is returned if the pixels are successfully transferred, otherwise MagickFalse. </blockquote><P>The format of the PopImagePixels method is:</P>
<blockquote>MagickBooleanType PopImagePixels ( <A HREF="types.html#Image">Image</A> *, const <A HREF="types.html#QuantumType">QuantumType</A> quantum, unsigned char *destination ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image:</strong><br />
</dt>
<DD>
The image.
</dd>
<P></P>
<dt><strong><a name="item_o_quantum_3a">quantum:</a></strong><br />
</dt>
<DD>
Declare which pixel components to transfer (RGB, RGBA, etc).
</dd>
<P></P>
<dt><strong><a name="item_o_destination_3a">destination:</a></strong><br />
</dt>
<DD>
The components are transferred to this buffer.
</dd>
<P></P></dl>
<P>
</P>
<h2><a name="pushimagepixels">PushImagePixels</a></h2>
<blockquote>PushImagePixels() transfers one or more pixel components from a user supplied buffer into the image pixel cache of an image. The pixels are expected in network byte order. It returns MagickTrue if the pixels are successfully transferred, otherwise MagickFalse. </blockquote><P>The format of the PushImagePixels method is:</P>
<blockquote>MagickBooleanType PushImagePixels ( <A HREF="types.html#Image">Image</A> *image, const <A HREF="types.html#QuantumType">QuantumType</A> quantum, const unsigned char *source ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image:</strong><br />
</dt>
<DD>
The image.
</dd>
<P></P>
<dt><strong>quantum:</strong><br />
</dt>
<DD>
Declare which pixel components to transfer (red, green, blue, opacity, RGB, or RGBA).
</dd>
<P></P>
<dt><strong><a name="item_o_source_3a">source:</a></strong><br />
</dt>
<DD>
The pixel components are transferred from this buffer.
</dd>
<P></P></dl>
<P>
</P>
<h2><a name="readimage">ReadImage</a></h2>
<blockquote>ReadImage() reads an image or image sequence from a file or file handle. The method returns a NULL if there is a memory shortage or if the image cannot be read. On failure, a NULL image is returned and exception describes the reason for the failure. </blockquote><P>The format of the ReadImage method is:</P>
<blockquote><A HREF="types.html#Image">Image</A> *ReadImage ( const <A HREF="types.html#ImageInfo">ImageInfo</A> *image_info, <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image_info:</strong><br />
</dt>
<DD>
Read the image defined by the file or filename members of this structure.
</dd>
<P></P>
<dt><strong>exception:</strong><br />
</dt>
<DD>
Return any errors or warnings in this structure.
</dd>
<P></P></dl>
<P>
</P>
<h2><a name="readinlineimage">ReadInlineImage</a></h2>
<blockquote>ReadInlineImage() reads a Base64-encoded inline image or image sequence. The method returns a NULL if there is a memory shortage or if the image cannot be read. On failure, a NULL image is returned and exception describes the reason for the failure. </blockquote><P>The format of the ReadInlineImage method is:</P>
<blockquote><A HREF="types.html#Image">Image</A> *ReadInlineImage ( const <A HREF="types.html#ImageInfo">ImageInfo</A> *image_info, const char *content, <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image_info:</strong><br />
</dt>
<DD>
The image info.
</dd>
<P></P>
<dt><strong><a name="item_o_content_3a">content:</a></strong><br />
</dt>
<DD>
The image encoded in Base64.
</dd>
<P></P>
<dt><strong>exception:</strong><br />
</dt>
<DD>
Return any errors or warnings in this structure.
</dd>
<P></P></dl>
<P>
</P>
<h2><a name="writeimage">WriteImage</a></h2>
<P>Use <code>Write()</code> to write an image or an image sequence to a file or filehandle.  If writing to a file on disk, the name is defined by the filename member of the image structure.  <code>Write()</code> returns 0 is there is a memory shortage or if the image cannot be written.  Check the exception member of image to determine the cause for any failure.</P>
<P>The format of the WriteImage method is:</P>
<blockquote>MagickBooleanType WriteImage ( const <A HREF="types.html#ImageInfo">ImageInfo</A> *image_info, <A HREF="types.html#Image">Image</A> *image ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image_info:</strong><br />
</dt>
<DD>
The image info.
</dd>
<P></P>
<dt><strong>image:</strong><br />
</dt>
<DD>
The image.
</dd>
<P></P></dl>
<P>
</P>
<h2><a name="writeimages">WriteImages</a></h2>
<blockquote>WriteImages() writes an image sequence. </blockquote><P>The format of the WriteImages method is:</P>
<blockquote>MagickBooleanType WriteImages ( const <A HREF="types.html#ImageInfo">ImageInfo</A> *image_info, <A HREF="types.html#Image">Image</A> *image, const char *filename, <A HREF="types.html#ExceptionInfo">ExceptionInfo</A> *exception ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image_info:</strong><br />
</dt>
<DD>
The image info.
</dd>
<P></P>
<dt><strong><a name="item_o_images_3a">images:</a></strong><br />
</dt>
<DD>
The image list.
</dd>
<P></P>
<dt><strong><a name="item_o_filename_3a">filename:</a></strong><br />
</dt>
<DD>
The image filename.
</dd>
<P></P>
<dt><strong>exception:</strong><br />
</dt>
<DD>
Return any errors or warnings in this structure.
</dd>
</dl>


<HR>

<a href="#top"><img src="../../../images/top.gif" border=0 width=42 height=42 align="right" alt="Top of page"></a>
<form action="http://studio.imagemagick.org/magick/" style="margin-top:5px">
<input type="submit" title="Help!" value="Help!" style="background-image:url('../../../images/background.gif'); color:#fbc713; font-weight:bold">
  <small>&quot;Image manipulation software that works like magick&quot;</small>
</form></td>
</tr></table>

</body>


</html>