]> granicus.if.org Git - imagemagick/blob - MagickWand/magick-property.c
(no commit message)
[imagemagick] / MagickWand / magick-property.c
1 /*
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %                                                                             %
4 %                                                                             %
5 %                                                                             %
6 %                 M   M   AAA    GGGG  IIIII   CCCC  K   K                    %
7 %                 MM MM  A   A  G        I    C      K  K                     %
8 %                 M M M  AAAAA  G GGG    I    C      KKK                      %
9 %                 M   M  A   A  G   G    I    C      K  K                     %
10 %                 M   M  A   A   GGGG  IIIII   CCCC  K   K                    %
11 %                                                                             %
12 %           PPPP    RRRR     OOO   PPPP   EEEEE  RRRR   TTTTT  Y   Y          %
13 %           P   P   R   R   O   O  P   P  E      R   R    T     Y Y           %
14 %           PPPP    RRRR    O   O  PPPP   EEE    RRRR     T      Y            %
15 %           P       R R     O   O  P      E      R R      T      Y            %
16 %           P       R  R     OOO   P      EEEEE  R  R     T      Y            %
17 %                                                                             %
18 %                                                                             %
19 %            Set or Get MagickWand Properties, Options, or Profiles           %
20 %                                                                             %
21 %                               Software Design                               %
22 %                                    Cristy                                   %
23 %                                 August 2003                                 %
24 %                                                                             %
25 %                                                                             %
26 %  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
27 %  dedicated to making software imaging solutions freely available.           %
28 %                                                                             %
29 %  You may not use this file except in compliance with the License.  You may  %
30 %  obtain a copy of the License at                                            %
31 %                                                                             %
32 %    http://www.imagemagick.org/script/license.php                            %
33 %                                                                             %
34 %  Unless required by applicable law or agreed to in writing, software        %
35 %  distributed under the License is distributed on an "AS IS" BASIS,          %
36 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
37 %  See the License for the specific language governing permissions and        %
38 %  limitations under the License.                                             %
39 %                                                                             %
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41 %
42 %
43 %
44 */
45 \f
46 /*
47   Include declarations.
48 */
49 #include "MagickWand/studio.h"
50 #include "MagickWand/MagickWand.h"
51 #include "MagickWand/magick-wand-private.h"
52 #include "MagickWand/wand.h"
53 #include "MagickCore/string-private.h"
54 \f
55 /*
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 %                                                                             %
58 %                                                                             %
59 %                                                                             %
60 %   M a g i c k D e l e t e I m a g e A r t i f a c t                         %
61 %                                                                             %
62 %                                                                             %
63 %                                                                             %
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 %
66 %  MagickDeleteImageArtifact() deletes a wand artifact.
67 %
68 %  The format of the MagickDeleteImageArtifact method is:
69 %
70 %      MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
71 %        const char *artifact)
72 %
73 %  A description of each parameter follows:
74 %
75 %    o image: the image.
76 %
77 %    o artifact: the image artifact.
78 %
79 */
80 WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
81   const char *artifact)
82 {
83   assert(wand != (MagickWand *) NULL);
84   assert(wand->signature == WandSignature);
85   if( IfMagickTrue(wand->debug) )
86     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
87
88   if (wand->images == (Image *) NULL)
89     {
90       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
91         "ContainsNoImages","`%s'",wand->name);
92       return(MagickFalse);
93     }
94   return(DeleteImageArtifact(wand->images,artifact));
95 }
96 \f
97 /*
98 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99 %                                                                             %
100 %                                                                             %
101 %                                                                             %
102 %   M a g i c k D e l e t e I m a g e P r o p e r t y                         %
103 %                                                                             %
104 %                                                                             %
105 %                                                                             %
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 %
108 %  MagickDeleteImageProperty() deletes a wand property.
109 %
110 %  The format of the MagickDeleteImageProperty method is:
111 %
112 %      MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
113 %        const char *property)
114 %
115 %  A description of each parameter follows:
116 %
117 %    o image: the image.
118 %
119 %    o property: the image property.
120 %
121 */
122 WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
123   const char *property)
124 {
125   assert(wand != (MagickWand *) NULL);
126   assert(wand->signature == WandSignature);
127   if( IfMagickTrue(wand->debug) )
128     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
129
130   if (wand->images == (Image *) NULL)
131     {
132       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
133         "ContainsNoImages","`%s'",wand->name);
134       return(MagickFalse);
135     }
136   return(DeleteImageProperty(wand->images,property));
137 }
138 \f
139 /*
140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
141 %                                                                             %
142 %                                                                             %
143 %                                                                             %
144 %   M a g i c k D e l e t e O p t i o n                                       %
145 %                                                                             %
146 %                                                                             %
147 %                                                                             %
148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149 %
150 %  MagickDeleteOption() deletes a wand option.
151 %
152 %  The format of the MagickDeleteOption method is:
153 %
154 %      MagickBooleanType MagickDeleteOption(MagickWand *wand,
155 %        const char *option)
156 %
157 %  A description of each parameter follows:
158 %
159 %    o image: the image.
160 %
161 %    o option: the image option.
162 %
163 */
164 WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
165   const char *option)
166 {
167   assert(wand != (MagickWand *) NULL);
168   assert(wand->signature == WandSignature);
169   if( IfMagickTrue(wand->debug) )
170     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
171
172   return(DeleteImageOption(wand->image_info,option));
173 }
174 \f
175 /*
176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
177 %                                                                             %
178 %                                                                             %
179 %                                                                             %
180 %   M a g i c k G e t A n t i a l i a s                                       %
181 %                                                                             %
182 %                                                                             %
183 %                                                                             %
184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
185 %
186 %  MagickGetAntialias() returns the antialias property associated with the
187 %  wand.
188 %
189 %  The format of the MagickGetAntialias method is:
190 %
191 %      MagickBooleanType MagickGetAntialias(const MagickWand *wand)
192 %
193 %  A description of each parameter follows:
194 %
195 %    o wand: the magick wand.
196 %
197 */
198 WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
199 {
200   assert(wand != (const MagickWand *) NULL);
201   assert(wand->signature == WandSignature);
202   if( IfMagickTrue(wand->debug) )
203     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
204
205   return(wand->image_info->antialias);
206 }
207 \f
208 /*
209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
210 %                                                                             %
211 %                                                                             %
212 %                                                                             %
213 %   M a g i c k G e t B a c k g r o u n d C o l o r                           %
214 %                                                                             %
215 %                                                                             %
216 %                                                                             %
217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
218 %
219 %  MagickGetBackgroundColor() returns the wand background color.
220 %
221 %  The format of the MagickGetBackgroundColor method is:
222 %
223 %      PixelWand *MagickGetBackgroundColor(MagickWand *wand)
224 %
225 %  A description of each parameter follows:
226 %
227 %    o wand: the magick wand.
228 %
229 */
230 WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
231 {
232   PixelWand
233     *background_color;
234
235   assert(wand != (MagickWand *) NULL);
236   assert(wand->signature == WandSignature);
237   if( IfMagickTrue(wand->debug) )
238     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
239
240   background_color=NewPixelWand();
241   PixelSetPixelColor(background_color,&wand->image_info->background_color);
242   return(background_color);
243 }
244 \f
245 /*
246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
247 %                                                                             %
248 %                                                                             %
249 %                                                                             %
250 %   M a g i c k G e t C o l o r s p a c e                                     %
251 %                                                                             %
252 %                                                                             %
253 %                                                                             %
254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255 %
256 %  MagickGetColorspace() gets the wand colorspace type.
257 %
258 %  The format of the MagickGetColorspace method is:
259 %
260 %      ColorspaceType MagickGetColorspace(MagickWand *wand)
261 %
262 %  A description of each parameter follows:
263 %
264 %    o wand: the magick wand.
265 %
266 */
267 WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
268 {
269   assert(wand != (MagickWand *) NULL);
270   assert(wand->signature == WandSignature);
271   if( IfMagickTrue(wand->debug) )
272     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
273
274   return(wand->image_info->colorspace);
275 }
276 \f
277 /*
278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
279 %                                                                             %
280 %                                                                             %
281 %                                                                             %
282 %   M a g i c k G e t C o m p r e s s i o n                                   %
283 %                                                                             %
284 %                                                                             %
285 %                                                                             %
286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
287 %
288 %  MagickGetCompression() gets the wand compression type.
289 %
290 %  The format of the MagickGetCompression method is:
291 %
292 %      CompressionType MagickGetCompression(MagickWand *wand)
293 %
294 %  A description of each parameter follows:
295 %
296 %    o wand: the magick wand.
297 %
298 */
299 WandExport CompressionType MagickGetCompression(MagickWand *wand)
300 {
301   assert(wand != (MagickWand *) NULL);
302   assert(wand->signature == WandSignature);
303   if( IfMagickTrue(wand->debug) )
304     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
305
306   return(wand->image_info->compression);
307 }
308 \f
309 /*
310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
311 %                                                                             %
312 %                                                                             %
313 %                                                                             %
314 %   M a g i c k G e t C o m p r e s s i o n Q u a l i t y                     %
315 %                                                                             %
316 %                                                                             %
317 %                                                                             %
318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
319 %
320 %  MagickGetCompressionQuality() gets the wand compression quality.
321 %
322 %  The format of the MagickGetCompressionQuality method is:
323 %
324 %      size_t MagickGetCompressionQuality(MagickWand *wand)
325 %
326 %  A description of each parameter follows:
327 %
328 %    o wand: the magick wand.
329 %
330 */
331 WandExport size_t MagickGetCompressionQuality(MagickWand *wand)
332 {
333   assert(wand != (MagickWand *) NULL);
334   assert(wand->signature == WandSignature);
335   if( IfMagickTrue(wand->debug) )
336     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
337
338   return(wand->image_info->quality);
339 }
340 \f
341 /*
342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
343 %                                                                             %
344 %                                                                             %
345 %                                                                             %
346 %   M a g i c k G e t C o p y r i g h t                                       %
347 %                                                                             %
348 %                                                                             %
349 %                                                                             %
350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
351 %
352 %  MagickGetCopyright() returns the ImageMagick API copyright as a string
353 %  constant.
354 %
355 %  The format of the MagickGetCopyright method is:
356 %
357 %      const char *MagickGetCopyright(void)
358 %
359 */
360 WandExport const char *MagickGetCopyright(void)
361 {
362   return(GetMagickCopyright());
363 }
364 \f
365 /*
366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
367 %                                                                             %
368 %                                                                             %
369 %                                                                             %
370 %   M a g i c k G e t F i l e n a m e                                         %
371 %                                                                             %
372 %                                                                             %
373 %                                                                             %
374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
375 %
376 %  MagickGetFilename() returns the filename associated with an image sequence.
377 %
378 %  The format of the MagickGetFilename method is:
379 %
380 %      const char *MagickGetFilename(const MagickWand *wand)
381 %
382 %  A description of each parameter follows:
383 %
384 %    o wand: the magick wand.
385 %
386 */
387 WandExport char *MagickGetFilename(const MagickWand *wand)
388 {
389   assert(wand != (const MagickWand *) NULL);
390   assert(wand->signature == WandSignature);
391   if( IfMagickTrue(wand->debug) )
392     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
393
394   return(AcquireString(wand->image_info->filename));
395 }
396 \f
397 /*
398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
399 %                                                                             %
400 %                                                                             %
401 %                                                                             %
402 %   M a g i c k G e t F o n t                                                 %
403 %                                                                             %
404 %                                                                             %
405 %                                                                             %
406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
407 %
408 %  MagickGetFont() returns the font associated with the MagickWand.
409 %
410 %  The format of the MagickGetFont method is:
411 %
412 %      char *MagickGetFont(MagickWand *wand)
413 %
414 %  A description of each parameter follows:
415 %
416 %    o wand: the magick wand.
417 %
418 */
419 WandExport char *MagickGetFont(MagickWand *wand)
420 {
421   assert(wand != (MagickWand *) NULL);
422   assert(wand->signature == WandSignature);
423   if( IfMagickTrue(wand->debug) )
424     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
425
426   if (wand->image_info->font == (char *) NULL)
427     return((char *) NULL);
428   return(AcquireString(wand->image_info->font));
429 }
430 \f
431 /*
432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
433 %                                                                             %
434 %                                                                             %
435 %                                                                             %
436 %   M a g i c k G e t F o r m a t                                             %
437 %                                                                             %
438 %                                                                             %
439 %                                                                             %
440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
441 %
442 %  MagickGetFormat() returns the format of the magick wand.
443 %
444 %  The format of the MagickGetFormat method is:
445 %
446 %      const char MagickGetFormat(MagickWand *wand)
447 %
448 %  A description of each parameter follows:
449 %
450 %    o wand: the magick wand.
451 %
452 */
453 WandExport char *MagickGetFormat(MagickWand *wand)
454 {
455   assert(wand != (MagickWand *) NULL);
456   assert(wand->signature == WandSignature);
457   if( IfMagickTrue(wand->debug) )
458     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
459
460   return(AcquireString(wand->image_info->magick));
461 }
462 \f
463 /*
464 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
465 %                                                                             %
466 %                                                                             %
467 %                                                                             %
468 %   M a g i c k G e t G r a v i t y                                           %
469 %                                                                             %
470 %                                                                             %
471 %                                                                             %
472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
473 %
474 %  MagickGetGravity() gets the wand gravity.
475 %
476 %  The format of the MagickGetGravity method is:
477 %
478 %      GravityType MagickGetGravity(MagickWand *wand)
479 %
480 %  A description of each parameter follows:
481 %
482 %    o wand: the magick wand.
483 %
484 */
485 WandExport GravityType MagickGetGravity(MagickWand *wand)
486 {
487   const char
488     *option;
489
490   GravityType
491     type;
492
493   assert(wand != (MagickWand *) NULL);
494   assert(wand->signature == WandSignature);
495   if( IfMagickTrue(wand->debug) )
496     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
497
498   option=GetImageOption(wand->image_info,"gravity");
499   if (option == (const char *) NULL)
500     return(UndefinedGravity);
501   type=(GravityType) ParseCommandOption(MagickGravityOptions,MagickFalse,option);
502   return(type);
503 }
504 \f
505 /*
506 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
507 %                                                                             %
508 %                                                                             %
509 %                                                                             %
510 %   M a g i c k G e t H o m e U R L                                           %
511 %                                                                             %
512 %                                                                             %
513 %                                                                             %
514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
515 %
516 %  MagickGetHomeURL() returns the ImageMagick home URL.
517 %
518 %  The format of the MagickGetHomeURL method is:
519 %
520 %      char *MagickGetHomeURL(void)
521 %
522 */
523 WandExport char *MagickGetHomeURL(void)
524 {
525   return(GetMagickHomeURL());
526 }
527 \f
528 /*
529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
530 %                                                                             %
531 %                                                                             %
532 %                                                                             %
533 %   M a g i c k G e t I m a g e A r t i f a c t                               %
534 %                                                                             %
535 %                                                                             %
536 %                                                                             %
537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
538 %
539 %  MagickGetImageArtifact() returns a value associated with the specified
540 %  artifact.  Use MagickRelinquishMemory() to free the value when you are
541 %  finished with it.
542 %
543 %  The format of the MagickGetImageArtifact method is:
544 %
545 %      char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
546 %
547 %  A description of each parameter follows:
548 %
549 %    o wand: the magick wand.
550 %
551 %    o artifact: the artifact.
552 %
553 */
554 WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
555 {
556   const char
557     *value;
558
559   assert(wand != (MagickWand *) NULL);
560   assert(wand->signature == WandSignature);
561   if( IfMagickTrue(wand->debug) )
562     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
563
564   if (wand->images == (Image *) NULL)
565     {
566       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
567         "ContainsNoImages","`%s'",wand->name);
568       return((char *) NULL);
569     }
570   value=GetImageArtifact(wand->images,artifact);
571   if (value == (const char *) NULL)
572     return((char *) NULL);
573   return(ConstantString(value));
574 }
575 \f
576 /*
577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
578 %                                                                             %
579 %                                                                             %
580 %                                                                             %
581 %   M a g i c k G e t I m a g e P r o p e r t i e s                           %
582 %                                                                             %
583 %                                                                             %
584 %                                                                             %
585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
586 %
587 %  MagickGetImageArtifacts() returns all the artifact names that match the
588 %  specified pattern associated with a wand.  Use MagickGetImageProperty() to
589 %  return the value of a particular artifact.  Use MagickRelinquishMemory() to
590 %  free the value when you are finished with it.
591 %
592 %  The format of the MagickGetImageArtifacts method is:
593 %
594 %      char *MagickGetImageArtifacts(MagickWand *wand,
595 %        const char *pattern,size_t *number_artifacts)
596 %
597 %  A description of each parameter follows:
598 %
599 %    o wand: the magick wand.
600 %
601 %    o pattern: Specifies a pointer to a text string containing a pattern.
602 %
603 %    o number_artifacts: the number artifacts associated with this wand.
604 %
605 */
606 WandExport char **MagickGetImageArtifacts(MagickWand *wand,
607   const char *pattern,size_t *number_artifacts)
608 {
609   char
610     **artifacts;
611
612   const char
613     *artifact;
614
615   register ssize_t
616     i;
617
618   size_t
619     length;
620
621   assert(wand != (MagickWand *) NULL);
622   assert(wand->signature == WandSignature);
623   if( IfMagickTrue(wand->debug) )
624     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
625
626   if (wand->images == (Image *) NULL)
627     {
628       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
629         "ContainsNoImages","`%s'",wand->name);
630       return((char **) NULL);
631     }
632   (void) GetImageProperty(wand->images,"exif:*",wand->exception);
633   length=1024;
634   artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
635   if (artifacts == (char **) NULL)
636     return((char **) NULL);
637   ResetImagePropertyIterator(wand->images);
638   artifact=GetNextImageProperty(wand->images);
639   for (i=0; artifact != (const char *) NULL; )
640   {
641     if ((*artifact != '[') &&
642         (IfMagickTrue(GlobExpression(artifact,pattern,MagickFalse))))
643       {
644         if ((i+1) >= (ssize_t) length)
645           {
646             length<<=1;
647             artifacts=(char **) ResizeQuantumMemory(artifacts,length,
648               sizeof(*artifacts));
649             if (artifacts == (char **) NULL)
650               {
651                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
652                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
653                   wand->name);
654                 return((char **) NULL);
655               }
656           }
657         artifacts[i]=ConstantString(artifact);
658         i++;
659       }
660     artifact=GetNextImageProperty(wand->images);
661   }
662   artifacts[i]=(char *) NULL;
663   *number_artifacts=(size_t) i;
664   return(artifacts);
665 }
666 \f
667 /*
668 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
669 %                                                                             %
670 %                                                                             %
671 %                                                                             %
672 %   M a g i c k G e t I m a g e P r o f i l e                                 %
673 %                                                                             %
674 %                                                                             %
675 %                                                                             %
676 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
677 %
678 %  MagickGetImageProfile() returns the named image profile.
679 %
680 %  The format of the MagickGetImageProfile method is:
681 %
682 %      unsigned char *MagickGetImageProfile(MagickWand *wand,const char *name,
683 %        size_t *length)
684 %
685 %  A description of each parameter follows:
686 %
687 %    o wand: the magick wand.
688 %
689 %    o name: Name of profile to return: ICC, IPTC, or generic profile.
690 %
691 %    o length: the length of the profile.
692 %
693 */
694 WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
695   const char *name,size_t *length)
696 {
697   const StringInfo
698     *profile;
699
700   unsigned char
701     *datum;
702
703   assert(wand != (MagickWand *) NULL);
704   assert(wand->signature == WandSignature);
705   if( IfMagickTrue(wand->debug) )
706     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
707
708   if (wand->images == (Image *) NULL)
709     {
710       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
711         "ContainsNoImages","`%s'",wand->name);
712       return((unsigned char *) NULL);
713     }
714   *length=0;
715   if (wand->images->profiles == (SplayTreeInfo *) NULL)
716     return((unsigned char *) NULL);
717   profile=GetImageProfile(wand->images,name);
718   if (profile == (StringInfo *) NULL)
719     return((unsigned char *) NULL);
720   datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
721     sizeof(*datum));
722   if (datum == (unsigned char *) NULL)
723     return((unsigned char *) NULL);
724   (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
725     GetStringInfoLength(profile));
726   *length=(size_t) GetStringInfoLength(profile);
727   return(datum);
728 }
729 \f
730 /*
731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
732 %                                                                             %
733 %                                                                             %
734 %                                                                             %
735 %   M a g i c k G e t I m a g e P r o f i l e s                               %
736 %                                                                             %
737 %                                                                             %
738 %                                                                             %
739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
740 %
741 %  MagickGetImageProfiles() returns all the profile names that match the
742 %  specified pattern associated with a wand.  Use MagickGetImageProfile() to
743 %  return the value of a particular property.  Use MagickRelinquishMemory() to
744 %  free the value when you are finished with it.
745 %
746 %  The format of the MagickGetImageProfiles method is:
747 %
748 %      char *MagickGetImageProfiles(MagickWand *wand,const char *pattern,
749 %        size_t *number_profiles)
750 %
751 %  A description of each parameter follows:
752 %
753 %    o wand: the magick wand.
754 %
755 %    o pattern: Specifies a pointer to a text string containing a pattern.
756 %
757 %    o number_profiles: the number profiles associated with this wand.
758 %
759 */
760 WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
761   size_t *number_profiles)
762 {
763   char
764     **profiles;
765
766   const char
767     *property;
768
769   register ssize_t
770     i;
771
772   size_t
773     length;
774
775   assert(wand != (MagickWand *) NULL);
776   assert(wand->signature == WandSignature);
777   if( IfMagickTrue(wand->debug) )
778     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
779
780   if (wand->images == (Image *) NULL)
781     {
782       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
783         "ContainsNoImages","`%s'",wand->name);
784       return((char **) NULL);
785     }
786   (void) GetImageProfile(wand->images,"exif:*");
787   length=1024;
788   profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
789   if (profiles == (char **) NULL)
790     return((char **) NULL);
791   ResetImageProfileIterator(wand->images);
792   property=GetNextImageProfile(wand->images);
793   for (i=0; property != (const char *) NULL; )
794   {
795     if ((*property != '[') &&
796         (IfMagickTrue(GlobExpression(property,pattern,MagickFalse))))
797       {
798         if ((i+1) >= (ssize_t) length)
799           {
800             length<<=1;
801             profiles=(char **) ResizeQuantumMemory(profiles,length,
802               sizeof(*profiles));
803             if (profiles == (char **) NULL)
804               {
805                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
806                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
807                   wand->name);
808                 return((char **) NULL);
809               }
810           }
811         profiles[i]=ConstantString(property);
812         i++;
813       }
814     property=GetNextImageProfile(wand->images);
815   }
816   profiles[i]=(char *) NULL;
817   *number_profiles=(size_t) i;
818   return(profiles);
819 }
820 \f
821 /*
822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
823 %                                                                             %
824 %                                                                             %
825 %                                                                             %
826 %   M a g i c k G e t I m a g e P r o p e r t y                               %
827 %                                                                             %
828 %                                                                             %
829 %                                                                             %
830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
831 %
832 %  MagickGetImageProperty() returns a value associated with the specified
833 %  property.  Use MagickRelinquishMemory() to free the value when you are
834 %  finished with it.
835 %
836 %  The format of the MagickGetImageProperty method is:
837 %
838 %      char *MagickGetImageProperty(MagickWand *wand,const char *property)
839 %
840 %  A description of each parameter follows:
841 %
842 %    o wand: the magick wand.
843 %
844 %    o property: the property.
845 %
846 */
847 WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
848 {
849   const char
850     *value;
851
852   assert(wand != (MagickWand *) NULL);
853   assert(wand->signature == WandSignature);
854   if( IfMagickTrue(wand->debug) )
855     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
856
857   if (wand->images == (Image *) NULL)
858     {
859       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
860         "ContainsNoImages","`%s'",wand->name);
861       return((char *) NULL);
862     }
863   value=GetImageProperty(wand->images,property,wand->exception);
864   if (value == (const char *) NULL)
865     return((char *) NULL);
866   return(ConstantString(value));
867 }
868 \f
869 /*
870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
871 %                                                                             %
872 %                                                                             %
873 %                                                                             %
874 %   M a g i c k G e t I m a g e P r o p e r t i e s                           %
875 %                                                                             %
876 %                                                                             %
877 %                                                                             %
878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
879 %
880 %  MagickGetImageProperties() returns all the property names that match the
881 %  specified pattern associated with a wand.  Use MagickGetImageProperty() to
882 %  return the value of a particular property.  Use MagickRelinquishMemory() to
883 %  free the value when you are finished with it.
884 %
885 %  The format of the MagickGetImageProperties method is:
886 %
887 %      char *MagickGetImageProperties(MagickWand *wand,
888 %        const char *pattern,size_t *number_properties)
889 %
890 %  A description of each parameter follows:
891 %
892 %    o wand: the magick wand.
893 %
894 %    o pattern: Specifies a pointer to a text string containing a pattern.
895 %
896 %    o number_properties: the number properties associated with this wand.
897 %
898 */
899 WandExport char **MagickGetImageProperties(MagickWand *wand,
900   const char *pattern,size_t *number_properties)
901 {
902   char
903     **properties;
904
905   const char
906     *property;
907
908   register ssize_t
909     i;
910
911   size_t
912     length;
913
914   assert(wand != (MagickWand *) NULL);
915   assert(wand->signature == WandSignature);
916   if( IfMagickTrue(wand->debug) )
917     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
918
919   if (wand->images == (Image *) NULL)
920     {
921       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
922         "ContainsNoImages","`%s'",wand->name);
923       return((char **) NULL);
924     }
925   (void) GetImageProperty(wand->images,"exif:*",wand->exception);
926   length=1024;
927   properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
928   if (properties == (char **) NULL)
929     return((char **) NULL);
930   ResetImagePropertyIterator(wand->images);
931   property=GetNextImageProperty(wand->images);
932   for (i=0; property != (const char *) NULL; )
933   {
934     if ((*property != '[') &&
935         (IfMagickTrue(GlobExpression(property,pattern,MagickFalse))))
936       {
937         if ((i+1) >= (ssize_t) length)
938           {
939             length<<=1;
940             properties=(char **) ResizeQuantumMemory(properties,length,
941               sizeof(*properties));
942             if (properties == (char **) NULL)
943               {
944                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
945                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
946                   wand->name);
947                 return((char **) NULL);
948               }
949           }
950         properties[i]=ConstantString(property);
951         i++;
952       }
953     property=GetNextImageProperty(wand->images);
954   }
955   properties[i]=(char *) NULL;
956   *number_properties=(size_t) i;
957   return(properties);
958 }
959 \f
960 /*
961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
962 %                                                                             %
963 %                                                                             %
964 %                                                                             %
965 %   M a g i c k G e t I n t e r l a c e S c h e m e                           %
966 %                                                                             %
967 %                                                                             %
968 %                                                                             %
969 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
970 %
971 %  MagickGetInterlaceScheme() gets the wand interlace scheme.
972 %
973 %  The format of the MagickGetInterlaceScheme method is:
974 %
975 %      InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
976 %
977 %  A description of each parameter follows:
978 %
979 %    o wand: the magick wand.
980 %
981 */
982 WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
983 {
984   assert(wand != (MagickWand *) NULL);
985   assert(wand->signature == WandSignature);
986   if( IfMagickTrue(wand->debug) )
987     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
988
989   return(wand->image_info->interlace);
990 }
991 \f
992 /*
993 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
994 %                                                                             %
995 %                                                                             %
996 %                                                                             %
997 %   M a g i c k G e t I n t e r p o l a t e M e t h o d                       %
998 %                                                                             %
999 %                                                                             %
1000 %                                                                             %
1001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1002 %
1003 %  MagickGetInterpolateMethod() gets the wand compression.
1004 %
1005 %  The format of the MagickGetInterpolateMethod method is:
1006 %
1007 %      PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
1008 %
1009 %  A description of each parameter follows:
1010 %
1011 %    o wand: the magick wand.
1012 %
1013 */
1014 WandExport PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
1015 {
1016   const char
1017     *option;
1018
1019   PixelInterpolateMethod
1020     method;
1021
1022   assert(wand != (MagickWand *) NULL);
1023   assert(wand->signature == WandSignature);
1024   if( IfMagickTrue(wand->debug) )
1025     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1026
1027   option=GetImageOption(wand->image_info,"interpolate");
1028   if (option == (const char *) NULL)
1029     return(UndefinedInterpolatePixel);
1030   method=(PixelInterpolateMethod) ParseCommandOption(MagickInterpolateOptions,
1031     MagickFalse,option);
1032   return(method);
1033 }
1034 \f
1035 /*
1036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1037 %                                                                             %
1038 %                                                                             %
1039 %                                                                             %
1040 %   M a g i c k G e t O p t i o n                                             %
1041 %                                                                             %
1042 %                                                                             %
1043 %                                                                             %
1044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1045 %
1046 %  MagickGetOption() returns a value associated with a wand and the specified
1047 %  key.  Use MagickRelinquishMemory() to free the value when you are finished
1048 %  with it.
1049 %
1050 %  The format of the MagickGetOption method is:
1051 %
1052 %      char *MagickGetOption(MagickWand *wand,const char *key)
1053 %
1054 %  A description of each parameter follows:
1055 %
1056 %    o wand: the magick wand.
1057 %
1058 %    o key: the key.
1059 %
1060 */
1061 WandExport char *MagickGetOption(MagickWand *wand,const char *key)
1062 {
1063   const char
1064     *option;
1065
1066   assert(wand != (MagickWand *) NULL);
1067   assert(wand->signature == WandSignature);
1068   if( IfMagickTrue(wand->debug) )
1069     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1070
1071   option=GetImageOption(wand->image_info,key);
1072   return(ConstantString(option));
1073 }
1074 \f
1075 /*
1076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1077 %                                                                             %
1078 %                                                                             %
1079 %                                                                             %
1080 %   M a g i c k G e t O p t i o n s                                           %
1081 %                                                                             %
1082 %                                                                             %
1083 %                                                                             %
1084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1085 %
1086 %  MagickGetOptions() returns all the option names that match the specified
1087 %  pattern associated with a wand.  Use MagickGetOption() to return the value
1088 %  of a particular option.  Use MagickRelinquishMemory() to free the value
1089 %  when you are finished with it.
1090 %
1091 %  The format of the MagickGetOptions method is:
1092 %
1093 %      char *MagickGetOptions(MagickWand *wand,const char *pattern,
1094 %        size_t *number_options)
1095 %
1096 %  A description of each parameter follows:
1097 %
1098 %    o wand: the magick wand.
1099 %
1100 %    o pattern: Specifies a pointer to a text string containing a pattern.
1101 %
1102 %    o number_options: the number options associated with this wand.
1103 %
1104 */
1105 WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
1106   size_t *number_options)
1107 {
1108   char
1109     **options;
1110
1111   const char
1112     *option;
1113
1114   register ssize_t
1115     i;
1116
1117   size_t
1118     length;
1119
1120   assert(wand != (MagickWand *) NULL);
1121   assert(wand->signature == WandSignature);
1122   if( IfMagickTrue(wand->debug) )
1123     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1124
1125   if (wand->images == (Image *) NULL)
1126     {
1127       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1128         "ContainsNoImages","`%s'",wand->name);
1129       return((char **) NULL);
1130     }
1131   length=1024;
1132   options=(char **) AcquireQuantumMemory(length,sizeof(*options));
1133   if (options == (char **) NULL)
1134     return((char **) NULL);
1135   ResetImageOptionIterator(wand->image_info);
1136   option=GetNextImageOption(wand->image_info);
1137   for (i=0; option != (const char *) NULL; )
1138   {
1139     if ((*option != '[') &&
1140         (IfMagickTrue(GlobExpression(option,pattern,MagickFalse))))
1141       {
1142         if ((i+1) >= (ssize_t) length)
1143           {
1144             length<<=1;
1145             options=(char **) ResizeQuantumMemory(options,length,
1146               sizeof(*options));
1147             if (options == (char **) NULL)
1148               {
1149                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
1150                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
1151                   wand->name);
1152                 return((char **) NULL);
1153               }
1154           }
1155         options[i]=ConstantString(option);
1156         i++;
1157       }
1158     option=GetNextImageOption(wand->image_info);
1159   }
1160   options[i]=(char *) NULL;
1161   *number_options=(size_t) i;
1162   return(options);
1163 }
1164 \f
1165 /*
1166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1167 %                                                                             %
1168 %                                                                             %
1169 %                                                                             %
1170 %   M a g i c k G e t O r i e n t a t i o n                                   %
1171 %                                                                             %
1172 %                                                                             %
1173 %                                                                             %
1174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1175 %
1176 %  MagickGetOrientation() gets the wand orientation type.
1177 %
1178 %  The format of the MagickGetOrientation method is:
1179 %
1180 %      OrientationType MagickGetOrientation(MagickWand *wand)
1181 %
1182 %  A description of each parameter follows:
1183 %
1184 %    o wand: the magick wand.
1185 %
1186 */
1187 WandExport OrientationType MagickGetOrientation(MagickWand *wand)
1188 {
1189   assert(wand != (MagickWand *) NULL);
1190   assert(wand->signature == WandSignature);
1191   if( IfMagickTrue(wand->debug) )
1192     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1193
1194   return(wand->image_info->orientation);
1195 }
1196 \f
1197 /*
1198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1199 %                                                                             %
1200 %                                                                             %
1201 %                                                                             %
1202 %   M a g i c k G e t P a c k a g e N a m e                                   %
1203 %                                                                             %
1204 %                                                                             %
1205 %                                                                             %
1206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1207 %
1208 %  MagickGetPackageName() returns the ImageMagick package name as a string
1209 %  constant.
1210 %
1211 %  The format of the MagickGetPackageName method is:
1212 %
1213 %      const char *MagickGetPackageName(void)
1214 %
1215 %
1216 */
1217 WandExport const char *MagickGetPackageName(void)
1218 {
1219   return(GetMagickPackageName());
1220 }
1221 \f
1222 /*
1223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1224 %                                                                             %
1225 %                                                                             %
1226 %                                                                             %
1227 %   M a g i c k G e t P a g e                                                 %
1228 %                                                                             %
1229 %                                                                             %
1230 %                                                                             %
1231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1232 %
1233 %  MagickGetPage() returns the page geometry associated with the magick wand.
1234 %
1235 %  The format of the MagickGetPage method is:
1236 %
1237 %      MagickBooleanType MagickGetPage(const MagickWand *wand,
1238 %        size_t *width,size_t *height,ssize_t *x,ssize_t *y)
1239 %
1240 %  A description of each parameter follows:
1241 %
1242 %    o wand: the magick wand.
1243 %
1244 %    o width: the page width.
1245 %
1246 %    o height: page height.
1247 %
1248 %    o x: the page x-offset.
1249 %
1250 %    o y: the page y-offset.
1251 %
1252 */
1253 WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
1254   size_t *width,size_t *height,ssize_t *x,ssize_t *y)
1255 {
1256   RectangleInfo
1257     geometry;
1258
1259   assert(wand != (const MagickWand *) NULL);
1260   assert(wand->signature == WandSignature);
1261   if( IfMagickTrue(wand->debug) )
1262     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1263
1264   (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1265   (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
1266   *width=geometry.width;
1267   *height=geometry.height;
1268   *x=geometry.x;
1269   *y=geometry.y;
1270   return(MagickTrue);
1271 }
1272 \f
1273 /*
1274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1275 %                                                                             %
1276 %                                                                             %
1277 %                                                                             %
1278 %   M a g i c k G e t P o i n t s i z e                                       %
1279 %                                                                             %
1280 %                                                                             %
1281 %                                                                             %
1282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1283 %
1284 %  MagickGetPointsize() returns the font pointsize associated with the
1285 %  MagickWand.
1286 %
1287 %  The format of the MagickGetPointsize method is:
1288 %
1289 %      double MagickGetPointsize(MagickWand *wand)
1290 %
1291 %  A description of each parameter follows:
1292 %
1293 %    o wand: the magick wand.
1294 %
1295 */
1296 WandExport double MagickGetPointsize(MagickWand *wand)
1297 {
1298   assert(wand != (MagickWand *) NULL);
1299   assert(wand->signature == WandSignature);
1300   if( IfMagickTrue(wand->debug) )
1301     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1302
1303   return(wand->image_info->pointsize);
1304 }
1305 \f
1306 /*
1307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1308 %                                                                             %
1309 %                                                                             %
1310 %                                                                             %
1311 %   M a g i c k G e t Q u a n t u m D e p t h                                 %
1312 %                                                                             %
1313 %                                                                             %
1314 %                                                                             %
1315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1316 %
1317 %  MagickGetQuantumDepth() returns the ImageMagick quantum depth as a string
1318 %  constant.
1319 %
1320 %  The format of the MagickGetQuantumDepth method is:
1321 %
1322 %      const char *MagickGetQuantumDepth(size_t *depth)
1323 %
1324 %  A description of each parameter follows:
1325 %
1326 %    o depth: the quantum depth is returned as a number.
1327 %
1328 */
1329 WandExport const char *MagickGetQuantumDepth(size_t *depth)
1330 {
1331   return(GetMagickQuantumDepth(depth));
1332 }
1333 \f
1334 /*
1335 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1336 %                                                                             %
1337 %                                                                             %
1338 %                                                                             %
1339 %   M a g i c k G e t Q u a n t u m R a n g e                                 %
1340 %                                                                             %
1341 %                                                                             %
1342 %                                                                             %
1343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1344 %
1345 %  MagickGetQuantumRange() returns the ImageMagick quantum range as a string
1346 %  constant.
1347 %
1348 %  The format of the MagickGetQuantumRange method is:
1349 %
1350 %      const char *MagickGetQuantumRange(size_t *range)
1351 %
1352 %  A description of each parameter follows:
1353 %
1354 %    o range: the quantum range is returned as a number.
1355 %
1356 */
1357 WandExport const char *MagickGetQuantumRange(size_t *range)
1358 {
1359   return(GetMagickQuantumRange(range));
1360 }
1361 \f
1362 /*
1363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1364 %                                                                             %
1365 %                                                                             %
1366 %                                                                             %
1367 %   M a g i c k G e t R e l e a s e D a t e                                   %
1368 %                                                                             %
1369 %                                                                             %
1370 %                                                                             %
1371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1372 %
1373 %  MagickGetReleaseDate() returns the ImageMagick release date as a string
1374 %  constant.
1375 %
1376 %  The format of the MagickGetReleaseDate method is:
1377 %
1378 %      const char *MagickGetReleaseDate(void)
1379 %
1380 */
1381 WandExport const char *MagickGetReleaseDate(void)
1382 {
1383   return(GetMagickReleaseDate());
1384 }
1385 \f
1386 /*
1387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1388 %                                                                             %
1389 %                                                                             %
1390 %                                                                             %
1391 %   M a g i c k G e t R e s o l u t i o n                                     %
1392 %                                                                             %
1393 %                                                                             %
1394 %                                                                             %
1395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1396 %
1397 %  MagickGetResolution() gets the image X and Y resolution.
1398 %
1399 %  The format of the MagickGetResolution method is:
1400 %
1401 %      MagickBooleanType MagickGetResolution(const MagickWand *wand,double *x,
1402 %        double *y)
1403 %
1404 %  A description of each parameter follows:
1405 %
1406 %    o wand: the magick wand.
1407 %
1408 %    o x: the x-resolution.
1409 %
1410 %    o y: the y-resolution.
1411 %
1412 */
1413 WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand,
1414   double *x,double *y)
1415 {
1416   assert(wand != (MagickWand *) NULL);
1417   assert(wand->signature == WandSignature);
1418   if( IfMagickTrue(wand->debug) )
1419     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1420
1421   *x=72.0;
1422   *y=72.0;
1423   if (wand->image_info->density != (char *) NULL)
1424     {
1425       GeometryInfo
1426         geometry_info;
1427
1428       MagickStatusType
1429         flags;
1430
1431       flags=ParseGeometry(wand->image_info->density,&geometry_info);
1432       *x=geometry_info.rho;
1433       *y=geometry_info.sigma;
1434       if ((flags & SigmaValue) == 0)
1435         *y=(*x);
1436     }
1437   return(MagickTrue);
1438 }
1439 \f
1440 /*
1441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1442 %                                                                             %
1443 %                                                                             %
1444 %                                                                             %
1445 %   M a g i c k G e t R e s o u r c e                                         %
1446 %                                                                             %
1447 %                                                                             %
1448 %                                                                             %
1449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1450 %
1451 %  MagickGetResource() returns the specified resource in megabytes.
1452 %
1453 %  The format of the MagickGetResource method is:
1454 %
1455 %      MagickSizeType MagickGetResource(const ResourceType type)
1456 %
1457 %  A description of each parameter follows:
1458 %
1459 %    o wand: the magick wand.
1460 %
1461 */
1462 WandExport MagickSizeType MagickGetResource(const ResourceType type)
1463 {
1464   return(GetMagickResource(type));
1465 }
1466 \f
1467 /*
1468 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1469 %                                                                             %
1470 %                                                                             %
1471 %                                                                             %
1472 %   M a g i c k G e t R e s o u r c e L i m i t                               %
1473 %                                                                             %
1474 %                                                                             %
1475 %                                                                             %
1476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1477 %
1478 %  MagickGetResourceLimit() returns the specified resource limit in megabytes.
1479 %
1480 %  The format of the MagickGetResourceLimit method is:
1481 %
1482 %      MagickSizeType MagickGetResourceLimit(const ResourceType type)
1483 %
1484 %  A description of each parameter follows:
1485 %
1486 %    o wand: the magick wand.
1487 %
1488 */
1489 WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
1490 {
1491   return(GetMagickResourceLimit(type));
1492 }
1493 \f
1494 /*
1495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1496 %                                                                             %
1497 %                                                                             %
1498 %                                                                             %
1499 %   M a g i c k G e t S a m p l i n g F a c t o r s                           %
1500 %                                                                             %
1501 %                                                                             %
1502 %                                                                             %
1503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1504 %
1505 %  MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.
1506 %
1507 %  The format of the MagickGetSamplingFactors method is:
1508 %
1509 %      double *MagickGetSamplingFactor(MagickWand *wand,
1510 %        size_t *number_factors)
1511 %
1512 %  A description of each parameter follows:
1513 %
1514 %    o wand: the magick wand.
1515 %
1516 %    o number_factors: the number of factors in the returned array.
1517 %
1518 */
1519 WandExport double *MagickGetSamplingFactors(MagickWand *wand,
1520   size_t *number_factors)
1521 {
1522   double
1523     *sampling_factors;
1524
1525   register const char
1526     *p;
1527
1528   register ssize_t
1529     i;
1530
1531   assert(wand != (MagickWand *) NULL);
1532   assert(wand->signature == WandSignature);
1533   if( IfMagickTrue(wand->debug) )
1534     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1535
1536   *number_factors=0;
1537   sampling_factors=(double *) NULL;
1538   if (wand->image_info->sampling_factor == (char *) NULL)
1539     return(sampling_factors);
1540   i=0;
1541   for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1542   {
1543     while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1544            (*p == ',')))
1545       p++;
1546     i++;
1547   }
1548   sampling_factors=(double *) AcquireQuantumMemory((size_t) i+1,
1549     sizeof(*sampling_factors));
1550   if (sampling_factors == (double *) NULL)
1551     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
1552       wand->image_info->filename);
1553   i=0;
1554   for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1555   {
1556     while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1557            (*p == ',')))
1558       p++;
1559     sampling_factors[i]=StringToDouble(p,(char **) NULL);
1560     i++;
1561   }
1562   *number_factors=(size_t) i;
1563   return(sampling_factors);
1564 }
1565 \f
1566 /*
1567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1568 %                                                                             %
1569 %                                                                             %
1570 %                                                                             %
1571 %   M a g i c k G e t S i z e                                                 %
1572 %                                                                             %
1573 %                                                                             %
1574 %                                                                             %
1575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1576 %
1577 %  MagickGetSize() returns the size associated with the magick wand.
1578 %
1579 %  The format of the MagickGetSize method is:
1580 %
1581 %      MagickBooleanType MagickGetSize(const MagickWand *wand,
1582 %        size_t *columns,size_t *rows)
1583 %
1584 %  A description of each parameter follows:
1585 %
1586 %    o wand: the magick wand.
1587 %
1588 %    o columns: the width in pixels.
1589 %
1590 %    o height: the height in pixels.
1591 %
1592 */
1593 WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
1594   size_t *columns,size_t *rows)
1595 {
1596   RectangleInfo
1597     geometry;
1598
1599   assert(wand != (const MagickWand *) NULL);
1600   assert(wand->signature == WandSignature);
1601   if( IfMagickTrue(wand->debug) )
1602     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1603
1604   (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1605   (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1606   *columns=geometry.width;
1607   *rows=geometry.height;
1608   return(MagickTrue);
1609 }
1610 \f
1611 /*
1612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1613 %                                                                             %
1614 %                                                                             %
1615 %                                                                             %
1616 %   M a g i c k G e t S i z e O f f s e t                                     %
1617 %                                                                             %
1618 %                                                                             %
1619 %                                                                             %
1620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1621 %
1622 %  MagickGetSizeOffset() returns the size offset associated with the magick
1623 %  wand.
1624 %
1625 %  The format of the MagickGetSizeOffset method is:
1626 %
1627 %      MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1628 %        ssize_t *offset)
1629 %
1630 %  A description of each parameter follows:
1631 %
1632 %    o wand: the magick wand.
1633 %
1634 %    o offset: the image offset.
1635 %
1636 */
1637 WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
1638   ssize_t *offset)
1639 {
1640   RectangleInfo
1641     geometry;
1642
1643   assert(wand != (const MagickWand *) NULL);
1644   assert(wand->signature == WandSignature);
1645   if( IfMagickTrue(wand->debug) )
1646     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1647
1648   (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1649   (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1650   *offset=geometry.x;
1651   return(MagickTrue);
1652 }
1653 \f
1654 /*
1655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1656 %                                                                             %
1657 %                                                                             %
1658 %                                                                             %
1659 %   M a g i c k G e t T y p e                                                 %
1660 %                                                                             %
1661 %                                                                             %
1662 %                                                                             %
1663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1664 %
1665 %  MagickGetType() returns the wand type.
1666 %
1667 %  The format of the MagickGetType method is:
1668 %
1669 %      ImageType MagickGetType(MagickWand *wand)
1670 %
1671 %  A description of each parameter follows:
1672 %
1673 %    o wand: the magick wand.
1674 %
1675 */
1676 WandExport ImageType MagickGetType(MagickWand *wand)
1677 {
1678   assert(wand != (MagickWand *) NULL);
1679   assert(wand->signature == WandSignature);
1680   if( IfMagickTrue(wand->debug) )
1681     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1682
1683   return(wand->image_info->type);
1684 }
1685 \f
1686 /*
1687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1688 %                                                                             %
1689 %                                                                             %
1690 %                                                                             %
1691 %   M a g i c k G e t V e r s i o n                                           %
1692 %                                                                             %
1693 %                                                                             %
1694 %                                                                             %
1695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1696 %
1697 %  MagickGetVersion() returns the ImageMagick API version as a string constant
1698 %  and as a number.
1699 %
1700 %  The format of the MagickGetVersion method is:
1701 %
1702 %      const char *MagickGetVersion(size_t *version)
1703 %
1704 %  A description of each parameter follows:
1705 %
1706 %    o version: the ImageMagick version is returned as a number.
1707 %
1708 */
1709 WandExport const char *MagickGetVersion(size_t *version)
1710 {
1711   return(GetMagickVersion(version));
1712 }
1713 \f
1714 /*
1715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1716 %                                                                             %
1717 %                                                                             %
1718 %                                                                             %
1719 %   M a g i c k P r o f i l e I m a g e                                       %
1720 %                                                                             %
1721 %                                                                             %
1722 %                                                                             %
1723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1724 %
1725 %  MagickProfileImage() adds or removes a ICC, IPTC, or generic profile
1726 %  from an image.  If the profile is NULL, it is removed from the image
1727 %  otherwise added.  Use a name of '*' and a profile of NULL to remove all
1728 %  profiles from the image.
1729 %
1730 %  The format of the MagickProfileImage method is:
1731 %
1732 %      MagickBooleanType MagickProfileImage(MagickWand *wand,const char *name,
1733 %        const void *profile,const size_t length)
1734 %
1735 %  A description of each parameter follows:
1736 %
1737 %    o wand: the magick wand.
1738 %
1739 %    o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
1740 %
1741 %    o profile: the profile.
1742 %
1743 %    o length: the length of the profile.
1744 %
1745 */
1746 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
1747   const char *name,const void *profile,const size_t length)
1748 {
1749   assert(wand != (MagickWand *) NULL);
1750   assert(wand->signature == WandSignature);
1751   if( IfMagickTrue(wand->debug) )
1752     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1753
1754   if (wand->images == (Image *) NULL)
1755     ThrowWandException(WandError,"ContainsNoImages",wand->name);
1756   return(ProfileImage(wand->images,name,profile,length,wand->exception));
1757 }
1758 \f
1759 /*
1760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1761 %                                                                             %
1762 %                                                                             %
1763 %                                                                             %
1764 %   M a g i c k R e m o v e I m a g e P r o f i l e                           %
1765 %                                                                             %
1766 %                                                                             %
1767 %                                                                             %
1768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1769 %
1770 %  MagickRemoveImageProfile() removes the named image profile and returns it.
1771 %
1772 %  The format of the MagickRemoveImageProfile method is:
1773 %
1774 %      unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1775 %        const char *name,size_t *length)
1776 %
1777 %  A description of each parameter follows:
1778 %
1779 %    o wand: the magick wand.
1780 %
1781 %    o name: Name of profile to return: ICC, IPTC, or generic profile.
1782 %
1783 %    o length: the length of the profile.
1784 %
1785 */
1786 WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1787   const char *name,size_t *length)
1788 {
1789   StringInfo
1790     *profile;
1791
1792   unsigned char
1793     *datum;
1794
1795   assert(wand != (MagickWand *) NULL);
1796   assert(wand->signature == WandSignature);
1797   if( IfMagickTrue(wand->debug) )
1798     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1799
1800   if (wand->images == (Image *) NULL)
1801     {
1802       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1803         "ContainsNoImages","`%s'",wand->name);
1804       return((unsigned char *) NULL);
1805     }
1806   *length=0;
1807   profile=RemoveImageProfile(wand->images,name);
1808   if (profile == (StringInfo *) NULL)
1809     return((unsigned char *) NULL);
1810   datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
1811     sizeof(*datum));
1812   if (datum == (unsigned char *) NULL)
1813     return((unsigned char *) NULL);
1814   (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
1815     GetStringInfoLength(profile));
1816   *length=GetStringInfoLength(profile);
1817   profile=DestroyStringInfo(profile);
1818   return(datum);
1819 }
1820 \f
1821 /*
1822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1823 %                                                                             %
1824 %                                                                             %
1825 %                                                                             %
1826 %   M a g i c k S e t A n t i a l i a s                                       %
1827 %                                                                             %
1828 %                                                                             %
1829 %                                                                             %
1830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1831 %
1832 %  MagickSetAntialias() sets the antialias propery of the wand.
1833 %
1834 %  The format of the MagickSetAntialias method is:
1835 %
1836 %      MagickBooleanType MagickSetAntialias(MagickWand *wand,
1837 %        const MagickBooleanType antialias)
1838 %
1839 %  A description of each parameter follows:
1840 %
1841 %    o wand: the magick wand.
1842 %
1843 %    o antialias: the antialias property.
1844 %
1845 */
1846 WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
1847   const MagickBooleanType antialias)
1848 {
1849   assert(wand != (MagickWand *) NULL);
1850   assert(wand->signature == WandSignature);
1851   if( IfMagickTrue(wand->debug) )
1852     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1853
1854   wand->image_info->antialias=antialias;
1855   return(MagickTrue);
1856 }
1857 \f
1858 /*
1859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1860 %                                                                             %
1861 %                                                                             %
1862 %                                                                             %
1863 %   M a g i c k S e t B a c k g r o u n d C o l o r                           %
1864 %                                                                             %
1865 %                                                                             %
1866 %                                                                             %
1867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1868 %
1869 %  MagickSetBackgroundColor() sets the wand background color.
1870 %
1871 %  The format of the MagickSetBackgroundColor method is:
1872 %
1873 %      MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1874 %        const PixelWand *background)
1875 %
1876 %  A description of each parameter follows:
1877 %
1878 %    o wand: the magick wand.
1879 %
1880 %    o background: the background pixel wand.
1881 %
1882 */
1883 WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1884   const PixelWand *background)
1885 {
1886   assert(wand != (MagickWand *) NULL);
1887   assert(wand->signature == WandSignature);
1888   if( IfMagickTrue(wand->debug) )
1889     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1890
1891   PixelGetQuantumPacket(background,&wand->image_info->background_color);
1892   return(MagickTrue);
1893 }
1894 \f
1895 /*
1896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1897 %                                                                             %
1898 %                                                                             %
1899 %                                                                             %
1900 %   M a g i c k S e t C o l o r s p a c e                                     %
1901 %                                                                             %
1902 %                                                                             %
1903 %                                                                             %
1904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1905 %
1906 %  MagickSetColorspace() sets the wand colorspace type.
1907 %
1908 %  The format of the MagickSetColorspace method is:
1909 %
1910 %      MagickBooleanType MagickSetColorspace(MagickWand *wand,
1911 %        const ColorspaceType colorspace)
1912 %
1913 %  A description of each parameter follows:
1914 %
1915 %    o wand: the magick wand.
1916 %
1917 %    o colorspace: the wand colorspace.
1918 %
1919 */
1920 WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
1921   const ColorspaceType colorspace)
1922 {
1923   assert(wand != (MagickWand *) NULL);
1924   assert(wand->signature == WandSignature);
1925   if( IfMagickTrue(wand->debug) )
1926     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1927
1928   wand->image_info->colorspace=colorspace;
1929   return(MagickTrue);
1930 }
1931 \f
1932 /*
1933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1934 %                                                                             %
1935 %                                                                             %
1936 %                                                                             %
1937 %   M a g i c k S e t C o m p r e s s i o n                                   %
1938 %                                                                             %
1939 %                                                                             %
1940 %                                                                             %
1941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1942 %
1943 %  MagickSetCompression() sets the wand compression type.
1944 %
1945 %  The format of the MagickSetCompression method is:
1946 %
1947 %      MagickBooleanType MagickSetCompression(MagickWand *wand,
1948 %        const CompressionType compression)
1949 %
1950 %  A description of each parameter follows:
1951 %
1952 %    o wand: the magick wand.
1953 %
1954 %    o compression: the wand compression.
1955 %
1956 */
1957 WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
1958   const CompressionType compression)
1959 {
1960   assert(wand != (MagickWand *) NULL);
1961   assert(wand->signature == WandSignature);
1962   if( IfMagickTrue(wand->debug) )
1963     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1964
1965   wand->image_info->compression=compression;
1966   return(MagickTrue);
1967 }
1968 \f
1969 /*
1970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1971 %                                                                             %
1972 %                                                                             %
1973 %                                                                             %
1974 %   M a g i c k S e t C o m p r e s s i o n Q u a l i t y                     %
1975 %                                                                             %
1976 %                                                                             %
1977 %                                                                             %
1978 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1979 %
1980 %  MagickSetCompressionQuality() sets the wand compression quality.
1981 %
1982 %  The format of the MagickSetCompressionQuality method is:
1983 %
1984 %      MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
1985 %        const size_t quality)
1986 %
1987 %  A description of each parameter follows:
1988 %
1989 %    o wand: the magick wand.
1990 %
1991 %    o quality: the wand compression quality.
1992 %
1993 */
1994 WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
1995   const size_t quality)
1996 {
1997   assert(wand != (MagickWand *) NULL);
1998   assert(wand->signature == WandSignature);
1999   if( IfMagickTrue(wand->debug) )
2000     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2001
2002   wand->image_info->quality=quality;
2003   return(MagickTrue);
2004 }
2005 \f
2006 /*
2007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2008 %                                                                             %
2009 %                                                                             %
2010 %                                                                             %
2011 %   M a g i c k S e t D e p t h                                               %
2012 %                                                                             %
2013 %                                                                             %
2014 %                                                                             %
2015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2016 %
2017 %  MagickSetDepth() sets the wand pixel depth.
2018 %
2019 %  The format of the MagickSetDepth method is:
2020 %
2021 %      MagickBooleanType MagickSetDepth(MagickWand *wand,
2022 %        const size_t depth)
2023 %
2024 %  A description of each parameter follows:
2025 %
2026 %    o wand: the magick wand.
2027 %
2028 %    o depth: the wand pixel depth.
2029 %
2030 */
2031 WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
2032   const size_t depth)
2033 {
2034   assert(wand != (MagickWand *) NULL);
2035   assert(wand->signature == WandSignature);
2036   if( IfMagickTrue(wand->debug) )
2037     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2038
2039   wand->image_info->depth=depth;
2040   return(MagickTrue);
2041 }
2042 \f
2043 /*
2044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2045 %                                                                             %
2046 %                                                                             %
2047 %                                                                             %
2048 %   M a g i c k S e t E x t r a c t                                           %
2049 %                                                                             %
2050 %                                                                             %
2051 %                                                                             %
2052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2053 %
2054 %  MagickSetExtract() sets the extract geometry before you read or write an
2055 %  image file.  Use it for inline cropping (e.g. 200x200+0+0) or resizing
2056 %  (e.g.200x200).
2057 %
2058 %  The format of the MagickSetExtract method is:
2059 %
2060 %      MagickBooleanType MagickSetExtract(MagickWand *wand,
2061 %        const char *geometry)
2062 %
2063 %  A description of each parameter follows:
2064 %
2065 %    o wand: the magick wand.
2066 %
2067 %    o geometry: the extract geometry.
2068 %
2069 */
2070 WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
2071   const char *geometry)
2072 {
2073   assert(wand != (MagickWand *) NULL);
2074   assert(wand->signature == WandSignature);
2075   if( IfMagickTrue(wand->debug) )
2076     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2077
2078   if (geometry != (const char *) NULL)
2079     (void) CopyMagickString(wand->image_info->extract,geometry,MaxTextExtent);
2080   return(MagickTrue);
2081 }
2082 \f
2083 /*
2084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2085 %                                                                             %
2086 %                                                                             %
2087 %                                                                             %
2088 %   M a g i c k S e t F i l e n a m e                                         %
2089 %                                                                             %
2090 %                                                                             %
2091 %                                                                             %
2092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2093 %
2094 %  MagickSetFilename() sets the filename before you read or write an image file.
2095 %
2096 %  The format of the MagickSetFilename method is:
2097 %
2098 %      MagickBooleanType MagickSetFilename(MagickWand *wand,
2099 %        const char *filename)
2100 %
2101 %  A description of each parameter follows:
2102 %
2103 %    o wand: the magick wand.
2104 %
2105 %    o filename: the image filename.
2106 %
2107 */
2108 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
2109   const char *filename)
2110 {
2111   assert(wand != (MagickWand *) NULL);
2112   assert(wand->signature == WandSignature);
2113   if( IfMagickTrue(wand->debug) )
2114     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2115
2116   if (filename != (const char *) NULL)
2117     (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent);
2118   return(MagickTrue);
2119 }
2120 \f
2121 /*
2122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2123 %                                                                             %
2124 %                                                                             %
2125 %                                                                             %
2126 %   M a g i c k S e t F o n t                                                 %
2127 %                                                                             %
2128 %                                                                             %
2129 %                                                                             %
2130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2131 %
2132 %  MagickSetFont() sets the font associated with the MagickWand.
2133 %
2134 %  The format of the MagickSetFont method is:
2135 %
2136 %      MagickBooleanType MagickSetFont(MagickWand *wand, const char *font)
2137 %
2138 %  A description of each parameter follows:
2139 %
2140 %    o wand: the magick wand.
2141 %
2142 %    o font: the font
2143 %
2144 */
2145 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
2146 {
2147   if ((font == (const char *) NULL) || (*font == '\0'))
2148     return(MagickFalse);
2149   assert(wand != (MagickWand *) NULL);
2150   assert(wand->signature == WandSignature);
2151   if( IfMagickTrue(wand->debug) )
2152     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2153
2154   (void) CloneString(&wand->image_info->font,font);
2155   return(MagickTrue);
2156 }
2157 \f
2158 /*
2159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2160 %                                                                             %
2161 %                                                                             %
2162 %                                                                             %
2163 %   M a g i c k S e t F o r m a t                                             %
2164 %                                                                             %
2165 %                                                                             %
2166 %                                                                             %
2167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2168 %
2169 %  MagickSetFormat() sets the format of the magick wand.
2170 %
2171 %  The format of the MagickSetFormat method is:
2172 %
2173 %      MagickBooleanType MagickSetFormat(MagickWand *wand,const char *format)
2174 %
2175 %  A description of each parameter follows:
2176 %
2177 %    o wand: the magick wand.
2178 %
2179 %    o format: the image format.
2180 %
2181 */
2182 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
2183   const char *format)
2184 {
2185   const MagickInfo
2186     *magick_info;
2187
2188   assert(wand != (MagickWand *) NULL);
2189   assert(wand->signature == WandSignature);
2190   if( IfMagickTrue(wand->debug) )
2191     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2192
2193   if ((format == (char *) NULL) || (*format == '\0'))
2194     {
2195       *wand->image_info->magick='\0';
2196       return(MagickTrue);
2197     }
2198   magick_info=GetMagickInfo(format,wand->exception);
2199   if (magick_info == (const MagickInfo *) NULL)
2200     return(MagickFalse);
2201   ClearMagickException(wand->exception);
2202   (void) CopyMagickString(wand->image_info->magick,format,MaxTextExtent);
2203   return(MagickTrue);
2204 }
2205 \f
2206 /*
2207 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2208 %                                                                             %
2209 %                                                                             %
2210 %                                                                             %
2211 %   M a g i c k S e t G r a v i t y                                           %
2212 %                                                                             %
2213 %                                                                             %
2214 %                                                                             %
2215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2216 %
2217 %  MagickSetGravity() sets the gravity type.
2218 %
2219 %  The format of the MagickSetGravity type is:
2220 %
2221 %      MagickBooleanType MagickSetGravity(MagickWand *wand,
2222 %        const GravityType type)
2223 %
2224 %  A description of each parameter follows:
2225 %
2226 %    o wand: the magick wand.
2227 %
2228 %    o type: the gravity type.
2229 %
2230 */
2231 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
2232   const GravityType type)
2233 {
2234   MagickBooleanType
2235     status;
2236
2237   assert(wand != (MagickWand *) NULL);
2238   assert(wand->signature == WandSignature);
2239   if( IfMagickTrue(wand->debug) )
2240     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2241
2242   status=SetImageOption(wand->image_info,"gravity",CommandOptionToMnemonic(
2243     MagickGravityOptions,(ssize_t) type));
2244   return(status);
2245 }
2246 \f
2247 /*
2248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2249 %                                                                             %
2250 %                                                                             %
2251 %                                                                             %
2252 %   M a g i c k S e t I m a g e A r t i f r c t                               %
2253 %                                                                             %
2254 %                                                                             %
2255 %                                                                             %
2256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2257 %
2258 %  MagickSetImageArtifact() associates a artifact with an image.
2259 %
2260 %  The format of the MagickSetImageArtifact method is:
2261 %
2262 %      MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2263 %        const char *artifact,const char *value)
2264 %
2265 %  A description of each parameter follows:
2266 %
2267 %    o wand: the magick wand.
2268 %
2269 %    o artifact: the artifact.
2270 %
2271 %    o value: the value.
2272 %
2273 */
2274 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2275   const char *artifact,const char *value)
2276 {
2277   assert(wand != (MagickWand *) NULL);
2278   assert(wand->signature == WandSignature);
2279   if( IfMagickTrue(wand->debug) )
2280     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2281
2282   if (wand->images == (Image *) NULL)
2283     ThrowWandException(WandError,"ContainsNoImages",wand->name);
2284   return(SetImageArtifact(wand->images,artifact,value));
2285 }
2286 \f
2287 /*
2288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2289 %                                                                             %
2290 %                                                                             %
2291 %                                                                             %
2292 %   M a g i c k S e t P r o f i l e I m a g e                                 %
2293 %                                                                             %
2294 %                                                                             %
2295 %                                                                             %
2296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2297 %
2298 %  MagickSetImageProfile() adds a named profile to the magick wand.  If a
2299 %  profile with the same name already exists, it is replaced.  This method
2300 %  differs from the MagickProfileImage() method in that it does not apply any
2301 %  CMS color profiles.
2302 %
2303 %  The format of the MagickSetImageProfile method is:
2304 %
2305 %      MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2306 %        const char *name,const void *profile,const size_t length)
2307 %
2308 %  A description of each parameter follows:
2309 %
2310 %    o wand: the magick wand.
2311 %
2312 %    o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
2313 %
2314 %    o profile: the profile.
2315 %
2316 %    o length: the length of the profile.
2317 %
2318 */
2319 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2320   const char *name,const void *profile,const size_t length)
2321 {
2322   MagickBooleanType
2323     status;
2324
2325   StringInfo
2326     *profile_info;
2327
2328   assert(wand != (MagickWand *) NULL);
2329   assert(wand->signature == WandSignature);
2330   if( IfMagickTrue(wand->debug) )
2331     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2332
2333   if (wand->images == (Image *) NULL)
2334     ThrowWandException(WandError,"ContainsNoImages",wand->name);
2335   profile_info=AcquireStringInfo((size_t) length);
2336   SetStringInfoDatum(profile_info,(unsigned char *) profile);
2337   status=SetImageProfile(wand->images,name,profile_info,wand->exception);
2338   profile_info=DestroyStringInfo(profile_info);
2339   return(status);
2340 }
2341 \f
2342 /*
2343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2344 %                                                                             %
2345 %                                                                             %
2346 %                                                                             %
2347 %   M a g i c k S e t I m a g e P r o p e r t y                               %
2348 %                                                                             %
2349 %                                                                             %
2350 %                                                                             %
2351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2352 %
2353 %  MagickSetImageProperty() associates a property with an image.
2354 %
2355 %  The format of the MagickSetImageProperty method is:
2356 %
2357 %      MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2358 %        const char *property,const char *value)
2359 %
2360 %  A description of each parameter follows:
2361 %
2362 %    o wand: the magick wand.
2363 %
2364 %    o property: the property.
2365 %
2366 %    o value: the value.
2367 %
2368 */
2369 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2370   const char *property,const char *value)
2371 {
2372   MagickBooleanType
2373     status;
2374
2375   assert(wand != (MagickWand *) NULL);
2376   assert(wand->signature == WandSignature);
2377   if( IfMagickTrue(wand->debug) )
2378     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2379
2380   if (wand->images == (Image *) NULL)
2381     ThrowWandException(WandError,"ContainsNoImages",wand->name);
2382   status=SetImageProperty(wand->images,property,value,wand->exception);
2383   return(status);
2384 }
2385 \f
2386 /*
2387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2388 %                                                                             %
2389 %                                                                             %
2390 %                                                                             %
2391 %   M a g i c k S e t I n t e r l a c e S c h e m e                           %
2392 %                                                                             %
2393 %                                                                             %
2394 %                                                                             %
2395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2396 %
2397 %  MagickSetInterlaceScheme() sets the image compression.
2398 %
2399 %  The format of the MagickSetInterlaceScheme method is:
2400 %
2401 %      MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2402 %        const InterlaceType interlace_scheme)
2403 %
2404 %  A description of each parameter follows:
2405 %
2406 %    o wand: the magick wand.
2407 %
2408 %    o interlace_scheme: the image interlace scheme: NoInterlace, LineInterlace,
2409 %      PlaneInterlace, PartitionInterlace.
2410 %
2411 */
2412 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2413   const InterlaceType interlace_scheme)
2414 {
2415   assert(wand != (MagickWand *) NULL);
2416   assert(wand->signature == WandSignature);
2417   if( IfMagickTrue(wand->debug) )
2418     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2419
2420   wand->image_info->interlace=interlace_scheme;
2421   return(MagickTrue);
2422 }
2423 \f
2424 /*
2425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2426 %                                                                             %
2427 %                                                                             %
2428 %                                                                             %
2429 %   M a g i c k S e t I n t e r p o l a t e M e t h o d                       %
2430 %                                                                             %
2431 %                                                                             %
2432 %                                                                             %
2433 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2434 %
2435 %  MagickSetInterpolateMethod() sets the interpolate pixel method.
2436 %
2437 %  The format of the MagickSetInterpolateMethod method is:
2438 %
2439 %      MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2440 %        const InterpolateMethodPixel method)
2441 %
2442 %  A description of each parameter follows:
2443 %
2444 %    o wand: the magick wand.
2445 %
2446 %    o method: the interpolate pixel method.
2447 %
2448 */
2449 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2450   const PixelInterpolateMethod method)
2451 {
2452   MagickBooleanType
2453     status;
2454
2455   assert(wand != (MagickWand *) NULL);
2456   assert(wand->signature == WandSignature);
2457   if( IfMagickTrue(wand->debug) )
2458     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2459
2460   status=SetImageOption(wand->image_info,"interpolate",
2461     CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
2462   return(status);
2463 }
2464 \f
2465 /*
2466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2467 %                                                                             %
2468 %                                                                             %
2469 %                                                                             %
2470 %   M a g i c k S e t O p t i o n                                             %
2471 %                                                                             %
2472 %                                                                             %
2473 %                                                                             %
2474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2475 %
2476 %  MagickSetOption() associates one or options with the wand (.e.g
2477 %  MagickSetOption(wand,"jpeg:perserve","yes")).
2478 %
2479 %  The format of the MagickSetOption method is:
2480 %
2481 %      MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2482 %        const char *value)
2483 %
2484 %  A description of each parameter follows:
2485 %
2486 %    o wand: the magick wand.
2487 %
2488 %    o key:  The key.
2489 %
2490 %    o value:  The value.
2491 %
2492 */
2493 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2494   const char *value)
2495 {
2496   assert(wand != (MagickWand *) NULL);
2497   assert(wand->signature == WandSignature);
2498   if( IfMagickTrue(wand->debug) )
2499     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2500
2501   return(SetImageOption(wand->image_info,key,value));
2502 }
2503 \f
2504 /*
2505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2506 %                                                                             %
2507 %                                                                             %
2508 %                                                                             %
2509 %   M a g i c k S e t O r i e n t a t i o n                                   %
2510 %                                                                             %
2511 %                                                                             %
2512 %                                                                             %
2513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2514 %
2515 %  MagickSetOrientation() sets the wand orientation type.
2516 %
2517 %  The format of the MagickSetOrientation method is:
2518 %
2519 %      MagickBooleanType MagickSetOrientation(MagickWand *wand,
2520 %        const OrientationType orientation)
2521 %
2522 %  A description of each parameter follows:
2523 %
2524 %    o wand: the magick wand.
2525 %
2526 %    o orientation: the wand orientation.
2527 %
2528 */
2529 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
2530   const OrientationType orientation)
2531 {
2532   assert(wand != (MagickWand *) NULL);
2533   assert(wand->signature == WandSignature);
2534   if( IfMagickTrue(wand->debug) )
2535     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2536
2537   wand->image_info->orientation=orientation;
2538   return(MagickTrue);
2539 }
2540 \f
2541 /*
2542 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2543 %                                                                             %
2544 %                                                                             %
2545 %                                                                             %
2546 %   M a g i c k S e t P a g e                                                 %
2547 %                                                                             %
2548 %                                                                             %
2549 %                                                                             %
2550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2551 %
2552 %  MagickSetPage() sets the page geometry of the magick wand.
2553 %
2554 %  The format of the MagickSetPage method is:
2555 %
2556 %      MagickBooleanType MagickSetPage(MagickWand *wand,
2557 %        const size_t width,const size_t height,const ssize_t x,
2558 %        const ssize_t y)
2559 %
2560 %  A description of each parameter follows:
2561 %
2562 %    o wand: the magick wand.
2563 %
2564 %    o width: the page width.
2565 %
2566 %    o height: the page height.
2567 %
2568 %    o x: the page x-offset.
2569 %
2570 %    o y: the page y-offset.
2571 %
2572 */
2573 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
2574   const size_t width,const size_t height,const ssize_t x,
2575   const ssize_t y)
2576 {
2577   char
2578     geometry[MaxTextExtent];
2579
2580   assert(wand != (MagickWand *) NULL);
2581   assert(wand->signature == WandSignature);
2582   if( IfMagickTrue(wand->debug) )
2583     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2584
2585   (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
2586     (double) width,(double) height,(double) x,(double) y);
2587   (void) CloneString(&wand->image_info->page,geometry);
2588   return(MagickTrue);
2589 }
2590 \f
2591 /*
2592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2593 %                                                                             %
2594 %                                                                             %
2595 %                                                                             %
2596 %   M a g i c k S e t P a s s p h r a s e                                     %
2597 %                                                                             %
2598 %                                                                             %
2599 %                                                                             %
2600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2601 %
2602 %  MagickSetPassphrase() sets the passphrase.
2603 %
2604 %  The format of the MagickSetPassphrase method is:
2605 %
2606 %      MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2607 %        const char *passphrase)
2608 %
2609 %  A description of each parameter follows:
2610 %
2611 %    o wand: the magick wand.
2612 %
2613 %    o passphrase: the passphrase.
2614 %
2615 */
2616 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2617   const char *passphrase)
2618 {
2619   assert(wand != (MagickWand *) NULL);
2620   assert(wand->signature == WandSignature);
2621   if( IfMagickTrue(wand->debug) )
2622     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2623
2624   (void) SetImageOption(wand->image_info,"authenticate",passphrase);
2625   return(MagickTrue);
2626 }
2627 \f
2628 /*
2629 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2630 %                                                                             %
2631 %                                                                             %
2632 %                                                                             %
2633 %   M a g i c k S e t P o i n t s i z e                                       %
2634 %                                                                             %
2635 %                                                                             %
2636 %                                                                             %
2637 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2638 %
2639 %  MagickSetPointsize() sets the font pointsize associated with the MagickWand.
2640 %
2641 %  The format of the MagickSetPointsize method is:
2642 %
2643 %      MagickBooleanType MagickSetPointsize(MagickWand *wand,
2644 %        const double pointsize)
2645 %
2646 %  A description of each parameter follows:
2647 %
2648 %    o wand: the magick wand.
2649 %
2650 %    o pointsize: the size of the font
2651 %
2652 */
2653 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
2654   const double pointsize)
2655 {
2656   assert(wand != (MagickWand *) NULL);
2657   assert(wand->signature == WandSignature);
2658   if( IfMagickTrue(wand->debug) )
2659     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2660
2661   wand->image_info->pointsize=pointsize;
2662   return(MagickTrue);
2663 }
2664 \f
2665 /*
2666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2667 %                                                                             %
2668 %                                                                             %
2669 %                                                                             %
2670 %   M a g i c k S e t P r o g r e s s M o n i t o r                           %
2671 %                                                                             %
2672 %                                                                             %
2673 %                                                                             %
2674 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2675 %
2676 %  MagickSetProgressMonitor() sets the wand progress monitor to the specified
2677 %  method and returns the previous progress monitor if any.  The progress
2678 %  monitor method looks like this:
2679 %
2680 %    MagickBooleanType MagickProgressMonitor(const char *text,
2681 %      const MagickOffsetType offset,const MagickSizeType span,
2682 %      void *client_data)
2683 %
2684 %  If the progress monitor returns MagickFalse, the current operation is
2685 %  interrupted.
2686 %
2687 %  The format of the MagickSetProgressMonitor method is:
2688 %
2689 %      MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand
2690 %        const MagickProgressMonitor progress_monitor,void *client_data)
2691 %
2692 %  A description of each parameter follows:
2693 %
2694 %    o wand: the magick wand.
2695 %
2696 %    o progress_monitor: Specifies a pointer to a method to monitor progress
2697 %      of an image operation.
2698 %
2699 %    o client_data: Specifies a pointer to any client data.
2700 %
2701 */
2702 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
2703   const MagickProgressMonitor progress_monitor,void *client_data)
2704 {
2705   MagickProgressMonitor
2706     previous_monitor;
2707
2708   assert(wand != (MagickWand *) NULL);
2709   assert(wand->signature == WandSignature);
2710   if( IfMagickTrue(wand->debug) )
2711     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2712
2713   previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
2714     progress_monitor,client_data);
2715   return(previous_monitor);
2716 }
2717 \f
2718 /*
2719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2720 %                                                                             %
2721 %                                                                             %
2722 %                                                                             %
2723 %   M a g i c k S e t R e s o u r c e L i m i t                               %
2724 %                                                                             %
2725 %                                                                             %
2726 %                                                                             %
2727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2728 %
2729 %  MagickSetResourceLimit() sets the limit for a particular resource in
2730 %  megabytes.
2731 %
2732 %  The format of the MagickSetResourceLimit method is:
2733 %
2734 %      MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2735 %        const MagickSizeType limit)
2736 %
2737 %  A description of each parameter follows:
2738 %
2739 %    o type: the type of resource: AreaResource, MemoryResource, MapResource,
2740 %      DiskResource, FileResource.
2741 %
2742 %    o The maximum limit for the resource.
2743 %
2744 */
2745 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2746   const MagickSizeType limit)
2747 {
2748   return(SetMagickResourceLimit(type,limit));
2749 }
2750 \f
2751 /*
2752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2753 %                                                                             %
2754 %                                                                             %
2755 %                                                                             %
2756 %   M a g i c k S e t R e s o l u t i o n                                     %
2757 %                                                                             %
2758 %                                                                             %
2759 %                                                                             %
2760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2761 %
2762 %  MagickSetResolution() sets the image resolution.
2763 %
2764 %  The format of the MagickSetResolution method is:
2765 %
2766 %      MagickBooleanType MagickSetResolution(MagickWand *wand,
2767 %        const double x_resolution,const double y_resolution)
2768 %
2769 %  A description of each parameter follows:
2770 %
2771 %    o wand: the magick wand.
2772 %
2773 %    o x_resolution: the image x resolution.
2774 %
2775 %    o y_resolution: the image y resolution.
2776 %
2777 */
2778 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
2779   const double x_resolution,const double y_resolution)
2780 {
2781   char
2782     density[MaxTextExtent];
2783
2784   assert(wand != (MagickWand *) NULL);
2785   assert(wand->signature == WandSignature);
2786   if( IfMagickTrue(wand->debug) )
2787     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2788
2789   (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",x_resolution,
2790     y_resolution);
2791   (void) CloneString(&wand->image_info->density,density);
2792   return(MagickTrue);
2793 }
2794 \f
2795 /*
2796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2797 %                                                                             %
2798 %                                                                             %
2799 %                                                                             %
2800 %   M a g i c k S e t S a m p l i n g F a c t o r s                           %
2801 %                                                                             %
2802 %                                                                             %
2803 %                                                                             %
2804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2805 %
2806 %  MagickSetSamplingFactors() sets the image sampling factors.
2807 %
2808 %  The format of the MagickSetSamplingFactors method is:
2809 %
2810 %      MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2811 %        const size_t number_factors,const double *sampling_factors)
2812 %
2813 %  A description of each parameter follows:
2814 %
2815 %    o wand: the magick wand.
2816 %
2817 %    o number_factoes: the number of factors.
2818 %
2819 %    o sampling_factors: An array of doubles representing the sampling factor
2820 %      for each color component (in RGB order).
2821 %
2822 */
2823 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
2824   const size_t number_factors,const double *sampling_factors)
2825 {
2826   char
2827     sampling_factor[MaxTextExtent];
2828
2829   register ssize_t
2830     i;
2831
2832   assert(wand != (MagickWand *) NULL);
2833   assert(wand->signature == WandSignature);
2834   if( IfMagickTrue(wand->debug) )
2835     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2836
2837   if (wand->image_info->sampling_factor != (char *) NULL)
2838     wand->image_info->sampling_factor=(char *)
2839       RelinquishMagickMemory(wand->image_info->sampling_factor);
2840   if (number_factors == 0)
2841     return(MagickTrue);
2842   for (i=0; i < (ssize_t) (number_factors-1); i++)
2843   {
2844     (void) FormatLocaleString(sampling_factor,MaxTextExtent,"%g,",
2845       sampling_factors[i]);
2846     (void) ConcatenateString(&wand->image_info->sampling_factor,
2847       sampling_factor);
2848   }
2849   (void) FormatLocaleString(sampling_factor,MaxTextExtent,"%g",
2850     sampling_factors[i]);
2851   (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
2852   return(MagickTrue);
2853 }
2854 \f
2855 /*
2856 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2857 %                                                                             %
2858 %                                                                             %
2859 %                                                                             %
2860 %   M a g i c k S e t S i z e                                                 %
2861 %                                                                             %
2862 %                                                                             %
2863 %                                                                             %
2864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2865 %
2866 %  MagickSetSize() sets the size of the magick wand.  Set it before you
2867 %  read a raw image format such as RGB, GRAY, or CMYK.
2868 %
2869 %  The format of the MagickSetSize method is:
2870 %
2871 %      MagickBooleanType MagickSetSize(MagickWand *wand,
2872 %        const size_t columns,const size_t rows)
2873 %
2874 %  A description of each parameter follows:
2875 %
2876 %    o wand: the magick wand.
2877 %
2878 %    o columns: the width in pixels.
2879 %
2880 %    o rows: the rows in pixels.
2881 %
2882 */
2883 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
2884   const size_t columns,const size_t rows)
2885 {
2886   char
2887     geometry[MaxTextExtent];
2888
2889   assert(wand != (MagickWand *) NULL);
2890   assert(wand->signature == WandSignature);
2891   if( IfMagickTrue(wand->debug) )
2892     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2893
2894   (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g",(double)
2895     columns,(double) rows);
2896   (void) CloneString(&wand->image_info->size,geometry);
2897   return(MagickTrue);
2898 }
2899 \f
2900 /*
2901 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2902 %                                                                             %
2903 %                                                                             %
2904 %                                                                             %
2905 %   M a g i c k S e t S i z e O f f s e t                                     %
2906 %                                                                             %
2907 %                                                                             %
2908 %                                                                             %
2909 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2910 %
2911 %  MagickSetSizeOffset() sets the size and offset of the magick wand.  Set it
2912 %  before you read a raw image format such as RGB, GRAY, or CMYK.
2913 %
2914 %  The format of the MagickSetSizeOffset method is:
2915 %
2916 %      MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2917 %        const size_t columns,const size_t rows,
2918 %        const ssize_t offset)
2919 %
2920 %  A description of each parameter follows:
2921 %
2922 %    o wand: the magick wand.
2923 %
2924 %    o columns: the image width in pixels.
2925 %
2926 %    o rows: the image rows in pixels.
2927 %
2928 %    o offset: the image offset.
2929 %
2930 */
2931 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
2932   const size_t columns,const size_t rows,const ssize_t offset)
2933 {
2934   char
2935     geometry[MaxTextExtent];
2936
2937   assert(wand != (MagickWand *) NULL);
2938   assert(wand->signature == WandSignature);
2939   if( IfMagickTrue(wand->debug) )
2940     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2941
2942   (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g",
2943     (double) columns,(double) rows,(double) offset);
2944   (void) CloneString(&wand->image_info->size,geometry);
2945   return(MagickTrue);
2946 }
2947 \f
2948 /*
2949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2950 %                                                                             %
2951 %                                                                             %
2952 %                                                                             %
2953 %   M a g i c k S e t T y p e                                                 %
2954 %                                                                             %
2955 %                                                                             %
2956 %                                                                             %
2957 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2958 %
2959 %  MagickSetType() sets the image type attribute.
2960 %
2961 %  The format of the MagickSetType method is:
2962 %
2963 %      MagickBooleanType MagickSetType(MagickWand *wand,
2964 %        const ImageType image_type)
2965 %
2966 %  A description of each parameter follows:
2967 %
2968 %    o wand: the magick wand.
2969 %
2970 %    o image_type: the image type:   UndefinedType, BilevelType, GrayscaleType,
2971 %      GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
2972 %      TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
2973 %      or OptimizeType.
2974 %
2975 */
2976 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
2977   const ImageType image_type)
2978 {
2979   assert(wand != (MagickWand *) NULL);
2980   assert(wand->signature == WandSignature);
2981   if( IfMagickTrue(wand->debug) )
2982     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2983
2984   wand->image_info->type=image_type;
2985   return(MagickTrue);
2986 }