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