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