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