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