blob: de3ba2099cab351d431c6e655851352112ccbb06 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
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 %
cristyde984cd2013-12-01 14:49:27 +000022% Cristy %
cristy3ed852e2009-09-05 21:47:34 +000023% August 2003 %
24% %
25% %
Cristy7ce65e72015-12-12 18:03:16 -050026% Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization %
cristy3ed852e2009-09-05 21:47:34 +000027% dedicated to making software imaging solutions freely available. %
28% %
29% You may not use this file except in compliance with the License. You may %
30% obtain a copy of the License at %
31% %
32% http://www.imagemagick.org/script/license.php %
33% %
34% Unless required by applicable law or agreed to in writing, software %
35% distributed under the License is distributed on an "AS IS" BASIS, %
36% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
37% See the License for the specific language governing permissions and %
38% limitations under the License. %
39% %
40%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41%
42%
43%
44*/
45
46/*
47 Include declarations.
48*/
cristy4c08aed2011-07-01 19:47:50 +000049#include "MagickWand/studio.h"
50#include "MagickWand/MagickWand.h"
51#include "MagickWand/magick-wand-private.h"
52#include "MagickWand/wand.h"
53#include "MagickCore/string-private.h"
cristy3ed852e2009-09-05 21:47:34 +000054
55/*
cristy3ed852e2009-09-05 21:47:34 +000056%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57% %
58% %
59% %
cristy6a97fda2009-10-11 20:42:55 +000060% 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*/
80WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
81 const char *artifact)
82{
83 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +000084 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +000085 if( IfMagickTrue(wand->debug) )
cristy6a97fda2009-10-11 20:42:55 +000086 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +000087
cristy6a97fda2009-10-11 20:42:55 +000088 if (wand->images == (Image *) NULL)
89 {
90 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +000091 "ContainsNoImages","`%s'",wand->name);
cristy6a97fda2009-10-11 20:42:55 +000092 return(MagickFalse);
93 }
94 return(DeleteImageArtifact(wand->images,artifact));
95}
96
97/*
98%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99% %
100% %
101% %
cristy3ed852e2009-09-05 21:47:34 +0000102% 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);
cristye1c94d92015-06-28 12:16:33 +0000126 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000127 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000128 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000129
cristy3ed852e2009-09-05 21:47:34 +0000130 if (wand->images == (Image *) NULL)
131 {
132 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +0000133 "ContainsNoImages","`%s'",wand->name);
cristy3ed852e2009-09-05 21:47:34 +0000134 return(MagickFalse);
135 }
136 return(DeleteImageProperty(wand->images,property));
137}
138
139/*
140%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
141% %
142% %
143% %
144% M a g i c k D e l e t e O p t i o n %
145% %
146% %
147% %
148%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149%
150% MagickDeleteOption() deletes a wand option.
151%
152% The format of the MagickDeleteOption method is:
153%
154% MagickBooleanType MagickDeleteOption(MagickWand *wand,
155% const char *option)
156%
157% A description of each parameter follows:
158%
159% o image: the image.
160%
161% o option: the image option.
162%
163*/
164WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
165 const char *option)
166{
167 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000168 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000169 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000170 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000171
cristy3ed852e2009-09-05 21:47:34 +0000172 return(DeleteImageOption(wand->image_info,option));
173}
174
175/*
176%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
177% %
178% %
179% %
180% M a g i c k G e t A n t i a l i a s %
181% %
182% %
183% %
184%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
185%
186% MagickGetAntialias() returns the antialias property associated with the
187% wand.
188%
189% The format of the MagickGetAntialias method is:
190%
191% MagickBooleanType MagickGetAntialias(const MagickWand *wand)
192%
193% A description of each parameter follows:
194%
195% o wand: the magick wand.
196%
197*/
198WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
199{
200 assert(wand != (const MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000201 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000202 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000203 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000204
cristy3ed852e2009-09-05 21:47:34 +0000205 return(wand->image_info->antialias);
206}
207
208/*
209%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
210% %
211% %
212% %
213% M a g i c k G e t B a c k g r o u n d C o l o r %
214% %
215% %
216% %
217%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
218%
219% MagickGetBackgroundColor() returns the wand background color.
220%
221% The format of the MagickGetBackgroundColor method is:
222%
223% PixelWand *MagickGetBackgroundColor(MagickWand *wand)
224%
225% A description of each parameter follows:
226%
227% o wand: the magick wand.
228%
229*/
230WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
231{
232 PixelWand
233 *background_color;
234
235 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000236 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000237 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000238 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000239
cristy3ed852e2009-09-05 21:47:34 +0000240 background_color=NewPixelWand();
cristyf82c4a02011-12-15 02:43:44 +0000241 PixelSetPixelColor(background_color,&wand->image_info->background_color);
cristy3ed852e2009-09-05 21:47:34 +0000242 return(background_color);
243}
244
245/*
246%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
247% %
248% %
249% %
250% M a g i c k G e t C o l o r s p a c e %
251% %
252% %
253% %
254%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255%
256% MagickGetColorspace() gets the wand colorspace type.
257%
258% The format of the MagickGetColorspace method is:
259%
260% ColorspaceType MagickGetColorspace(MagickWand *wand)
261%
262% A description of each parameter follows:
263%
264% o wand: the magick wand.
265%
266*/
267WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
268{
269 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000270 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000271 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000272 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000273
cristy3ed852e2009-09-05 21:47:34 +0000274 return(wand->image_info->colorspace);
275}
276
277/*
278%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
279% %
280% %
281% %
282% M a g i c k G e t C o m p r e s s i o n %
283% %
284% %
285% %
286%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
287%
288% MagickGetCompression() gets the wand compression type.
289%
290% The format of the MagickGetCompression method is:
291%
292% CompressionType MagickGetCompression(MagickWand *wand)
293%
294% A description of each parameter follows:
295%
296% o wand: the magick wand.
297%
298*/
299WandExport CompressionType MagickGetCompression(MagickWand *wand)
300{
301 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000302 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000303 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000304 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000305
cristy3ed852e2009-09-05 21:47:34 +0000306 return(wand->image_info->compression);
307}
308
309/*
310%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
311% %
312% %
313% %
314% M a g i c k G e t C o m p r e s s i o n Q u a l i t y %
315% %
316% %
317% %
318%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
319%
320% MagickGetCompressionQuality() gets the wand compression quality.
321%
322% The format of the MagickGetCompressionQuality method is:
323%
cristybb503372010-05-27 20:51:26 +0000324% size_t MagickGetCompressionQuality(MagickWand *wand)
cristy3ed852e2009-09-05 21:47:34 +0000325%
326% A description of each parameter follows:
327%
328% o wand: the magick wand.
329%
330*/
cristybb503372010-05-27 20:51:26 +0000331WandExport size_t MagickGetCompressionQuality(MagickWand *wand)
cristy3ed852e2009-09-05 21:47:34 +0000332{
333 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000334 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000335 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000336 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000337
cristy3ed852e2009-09-05 21:47:34 +0000338 return(wand->image_info->quality);
339}
340
341/*
342%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
343% %
344% %
345% %
346% M a g i c k G e t C o p y r i g h t %
347% %
348% %
349% %
350%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
351%
352% MagickGetCopyright() returns the ImageMagick API copyright as a string
353% constant.
354%
355% The format of the MagickGetCopyright method is:
356%
357% const char *MagickGetCopyright(void)
358%
359*/
360WandExport const char *MagickGetCopyright(void)
361{
362 return(GetMagickCopyright());
363}
364
365/*
366%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
367% %
368% %
369% %
370% M a g i c k G e t F i l e n a m e %
371% %
372% %
373% %
374%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
375%
376% MagickGetFilename() returns the filename associated with an image sequence.
377%
378% The format of the MagickGetFilename method is:
379%
380% const char *MagickGetFilename(const MagickWand *wand)
381%
382% A description of each parameter follows:
383%
384% o wand: the magick wand.
385%
386*/
387WandExport char *MagickGetFilename(const MagickWand *wand)
388{
389 assert(wand != (const MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000390 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000391 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000392 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000393
cristy3ed852e2009-09-05 21:47:34 +0000394 return(AcquireString(wand->image_info->filename));
395}
396
397/*
398%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
399% %
400% %
401% %
402% M a g i c k G e t F o n t %
403% %
404% %
405% %
406%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
407%
408% MagickGetFont() returns the font associated with the MagickWand.
409%
410% The format of the MagickGetFont method is:
411%
412% char *MagickGetFont(MagickWand *wand)
413%
414% A description of each parameter follows:
415%
416% o wand: the magick wand.
417%
418*/
419WandExport char *MagickGetFont(MagickWand *wand)
420{
421 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000422 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000423 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000424 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000425
cristy3ed852e2009-09-05 21:47:34 +0000426 if (wand->image_info->font == (char *) NULL)
427 return((char *) NULL);
428 return(AcquireString(wand->image_info->font));
429}
430
431/*
432%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
433% %
434% %
435% %
436% M a g i c k G e t F o r m a t %
437% %
438% %
439% %
440%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
441%
442% MagickGetFormat() returns the format of the magick wand.
443%
444% The format of the MagickGetFormat method is:
445%
446% const char MagickGetFormat(MagickWand *wand)
447%
448% A description of each parameter follows:
449%
450% o wand: the magick wand.
451%
452*/
453WandExport char *MagickGetFormat(MagickWand *wand)
454{
455 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000456 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000457 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000459
cristy3ed852e2009-09-05 21:47:34 +0000460 return(AcquireString(wand->image_info->magick));
461}
462
463/*
464%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
465% %
466% %
467% %
468% M a g i c k G e t G r a v i t y %
469% %
470% %
471% %
472%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
473%
474% MagickGetGravity() gets the wand gravity.
475%
476% The format of the MagickGetGravity method is:
477%
478% GravityType MagickGetGravity(MagickWand *wand)
479%
480% A description of each parameter follows:
481%
482% o wand: the magick wand.
483%
484*/
485WandExport GravityType MagickGetGravity(MagickWand *wand)
486{
487 const char
488 *option;
489
490 GravityType
491 type;
492
493 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000494 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000495 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000496 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000497
cristy3ed852e2009-09-05 21:47:34 +0000498 option=GetImageOption(wand->image_info,"gravity");
499 if (option == (const char *) NULL)
500 return(UndefinedGravity);
cristy042ee782011-04-22 18:48:30 +0000501 type=(GravityType) ParseCommandOption(MagickGravityOptions,MagickFalse,option);
cristy3ed852e2009-09-05 21:47:34 +0000502 return(type);
503}
504
505/*
506%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
507% %
508% %
509% %
510% M a g i c k G e t H o m e U R L %
511% %
512% %
513% %
514%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
515%
516% MagickGetHomeURL() returns the ImageMagick home URL.
517%
518% The format of the MagickGetHomeURL method is:
519%
520% char *MagickGetHomeURL(void)
521%
522*/
523WandExport char *MagickGetHomeURL(void)
524{
525 return(GetMagickHomeURL());
526}
527
528/*
529%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
530% %
531% %
532% %
cristy6a97fda2009-10-11 20:42:55 +0000533% M a g i c k G e t I m a g e A r t i f a c t %
534% %
535% %
536% %
537%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
538%
539% MagickGetImageArtifact() returns a value associated with the specified
540% artifact. Use MagickRelinquishMemory() to free the value when you are
541% finished with it.
542%
543% The format of the MagickGetImageArtifact method is:
544%
545% char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
546%
547% A description of each parameter follows:
548%
549% o wand: the magick wand.
550%
551% o artifact: the artifact.
552%
553*/
554WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
555{
556 const char
557 *value;
558
559 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000560 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000561 if( IfMagickTrue(wand->debug) )
cristy6a97fda2009-10-11 20:42:55 +0000562 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000563
cristy6a97fda2009-10-11 20:42:55 +0000564 if (wand->images == (Image *) NULL)
565 {
566 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +0000567 "ContainsNoImages","`%s'",wand->name);
cristy6a97fda2009-10-11 20:42:55 +0000568 return((char *) NULL);
569 }
570 value=GetImageArtifact(wand->images,artifact);
571 if (value == (const char *) NULL)
572 return((char *) NULL);
573 return(ConstantString(value));
574}
575
576/*
577%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
578% %
579% %
580% %
581% M a g i c k G e t I m a g e P r o p e r t i e s %
582% %
583% %
584% %
585%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
586%
587% MagickGetImageArtifacts() returns all the artifact names that match the
588% specified pattern associated with a wand. Use MagickGetImageProperty() to
589% return the value of a particular artifact. Use MagickRelinquishMemory() to
590% free the value when you are finished with it.
591%
592% The format of the MagickGetImageArtifacts method is:
593%
594% char *MagickGetImageArtifacts(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +0000595% const char *pattern,size_t *number_artifacts)
cristy6a97fda2009-10-11 20:42:55 +0000596%
597% A description of each parameter follows:
598%
599% o wand: the magick wand.
600%
601% o pattern: Specifies a pointer to a text string containing a pattern.
602%
603% o number_artifacts: the number artifacts associated with this wand.
604%
605*/
606WandExport char **MagickGetImageArtifacts(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +0000607 const char *pattern,size_t *number_artifacts)
cristy6a97fda2009-10-11 20:42:55 +0000608{
609 char
610 **artifacts;
611
612 const char
613 *artifact;
614
cristybb503372010-05-27 20:51:26 +0000615 register ssize_t
cristy6a97fda2009-10-11 20:42:55 +0000616 i;
617
618 size_t
619 length;
620
621 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000622 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000623 if( IfMagickTrue(wand->debug) )
cristy6a97fda2009-10-11 20:42:55 +0000624 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000625
cristy6a97fda2009-10-11 20:42:55 +0000626 if (wand->images == (Image *) NULL)
627 {
628 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +0000629 "ContainsNoImages","`%s'",wand->name);
cristy6a97fda2009-10-11 20:42:55 +0000630 return((char **) NULL);
631 }
cristyd15e6592011-10-15 00:13:06 +0000632 (void) GetImageProperty(wand->images,"exif:*",wand->exception);
cristy6a97fda2009-10-11 20:42:55 +0000633 length=1024;
634 artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
635 if (artifacts == (char **) NULL)
636 return((char **) NULL);
637 ResetImagePropertyIterator(wand->images);
638 artifact=GetNextImageProperty(wand->images);
639 for (i=0; artifact != (const char *) NULL; )
640 {
641 if ((*artifact != '[') &&
anthony8270b722012-03-30 14:35:24 +0000642 (IfMagickTrue(GlobExpression(artifact,pattern,MagickFalse))))
cristy6a97fda2009-10-11 20:42:55 +0000643 {
cristybb503372010-05-27 20:51:26 +0000644 if ((i+1) >= (ssize_t) length)
cristy6a97fda2009-10-11 20:42:55 +0000645 {
646 length<<=1;
647 artifacts=(char **) ResizeQuantumMemory(artifacts,length,
648 sizeof(*artifacts));
649 if (artifacts == (char **) NULL)
650 {
651 (void) ThrowMagickException(wand->exception,GetMagickModule(),
cristyefe601c2013-01-05 17:51:12 +0000652 ResourceLimitError,"MemoryAllocationFailed","`%s'",
cristy6a97fda2009-10-11 20:42:55 +0000653 wand->name);
654 return((char **) NULL);
655 }
656 }
657 artifacts[i]=ConstantString(artifact);
658 i++;
659 }
660 artifact=GetNextImageProperty(wand->images);
661 }
662 artifacts[i]=(char *) NULL;
cristybb503372010-05-27 20:51:26 +0000663 *number_artifacts=(size_t) i;
cristy6a97fda2009-10-11 20:42:55 +0000664 return(artifacts);
665}
666
667/*
668%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
669% %
670% %
671% %
cristy3ed852e2009-09-05 21:47:34 +0000672% M a g i c k G e t I m a g e P r o f i l e %
673% %
674% %
675% %
676%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
677%
678% MagickGetImageProfile() returns the named image profile.
679%
680% The format of the MagickGetImageProfile method is:
681%
682% unsigned char *MagickGetImageProfile(MagickWand *wand,const char *name,
683% size_t *length)
684%
685% A description of each parameter follows:
686%
687% o wand: the magick wand.
688%
689% o name: Name of profile to return: ICC, IPTC, or generic profile.
690%
691% o length: the length of the profile.
692%
693*/
694WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
695 const char *name,size_t *length)
696{
697 const StringInfo
698 *profile;
699
700 unsigned char
701 *datum;
702
703 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000704 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000705 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000706 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000707
cristy3ed852e2009-09-05 21:47:34 +0000708 if (wand->images == (Image *) NULL)
709 {
710 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +0000711 "ContainsNoImages","`%s'",wand->name);
cristy3ed852e2009-09-05 21:47:34 +0000712 return((unsigned char *) NULL);
713 }
714 *length=0;
715 if (wand->images->profiles == (SplayTreeInfo *) NULL)
716 return((unsigned char *) NULL);
717 profile=GetImageProfile(wand->images,name);
718 if (profile == (StringInfo *) NULL)
719 return((unsigned char *) NULL);
720 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
721 sizeof(*datum));
722 if (datum == (unsigned char *) NULL)
723 return((unsigned char *) NULL);
724 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
725 GetStringInfoLength(profile));
cristybb503372010-05-27 20:51:26 +0000726 *length=(size_t) GetStringInfoLength(profile);
cristy3ed852e2009-09-05 21:47:34 +0000727 return(datum);
728}
729
730/*
731%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
732% %
733% %
734% %
735% M a g i c k G e t I m a g e P r o f i l e s %
736% %
737% %
738% %
739%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
740%
741% MagickGetImageProfiles() returns all the profile names that match the
742% specified pattern associated with a wand. Use MagickGetImageProfile() to
743% return the value of a particular property. Use MagickRelinquishMemory() to
744% free the value when you are finished with it.
745%
746% The format of the MagickGetImageProfiles method is:
747%
cristy3e211bf2012-04-24 19:52:52 +0000748% char *MagickGetImageProfiles(MagickWand *wand,const char *pattern,
cristybb503372010-05-27 20:51:26 +0000749% size_t *number_profiles)
cristy3ed852e2009-09-05 21:47:34 +0000750%
751% A description of each parameter follows:
752%
753% o wand: the magick wand.
754%
755% o pattern: Specifies a pointer to a text string containing a pattern.
756%
757% o number_profiles: the number profiles associated with this wand.
758%
759*/
760WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
cristybb503372010-05-27 20:51:26 +0000761 size_t *number_profiles)
cristy3ed852e2009-09-05 21:47:34 +0000762{
763 char
764 **profiles;
765
766 const char
767 *property;
768
cristybb503372010-05-27 20:51:26 +0000769 register ssize_t
cristy3ed852e2009-09-05 21:47:34 +0000770 i;
771
772 size_t
773 length;
774
775 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000776 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000777 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000778 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000779
cristy3ed852e2009-09-05 21:47:34 +0000780 if (wand->images == (Image *) NULL)
781 {
782 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +0000783 "ContainsNoImages","`%s'",wand->name);
cristy3ed852e2009-09-05 21:47:34 +0000784 return((char **) NULL);
785 }
786 (void) GetImageProfile(wand->images,"exif:*");
787 length=1024;
788 profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
789 if (profiles == (char **) NULL)
790 return((char **) NULL);
791 ResetImageProfileIterator(wand->images);
792 property=GetNextImageProfile(wand->images);
793 for (i=0; property != (const char *) NULL; )
794 {
795 if ((*property != '[') &&
anthony8270b722012-03-30 14:35:24 +0000796 (IfMagickTrue(GlobExpression(property,pattern,MagickFalse))))
cristy3ed852e2009-09-05 21:47:34 +0000797 {
cristybb503372010-05-27 20:51:26 +0000798 if ((i+1) >= (ssize_t) length)
cristy3ed852e2009-09-05 21:47:34 +0000799 {
800 length<<=1;
801 profiles=(char **) ResizeQuantumMemory(profiles,length,
802 sizeof(*profiles));
803 if (profiles == (char **) NULL)
804 {
805 (void) ThrowMagickException(wand->exception,GetMagickModule(),
cristyefe601c2013-01-05 17:51:12 +0000806 ResourceLimitError,"MemoryAllocationFailed","`%s'",
cristy3ed852e2009-09-05 21:47:34 +0000807 wand->name);
808 return((char **) NULL);
809 }
810 }
811 profiles[i]=ConstantString(property);
812 i++;
813 }
814 property=GetNextImageProfile(wand->images);
815 }
816 profiles[i]=(char *) NULL;
cristybb503372010-05-27 20:51:26 +0000817 *number_profiles=(size_t) i;
cristy3ed852e2009-09-05 21:47:34 +0000818 return(profiles);
819}
820
821/*
822%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
823% %
824% %
825% %
826% M a g i c k G e t I m a g e P r o p e r t y %
827% %
828% %
829% %
830%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
831%
832% MagickGetImageProperty() returns a value associated with the specified
833% property. Use MagickRelinquishMemory() to free the value when you are
834% finished with it.
835%
836% The format of the MagickGetImageProperty method is:
837%
838% char *MagickGetImageProperty(MagickWand *wand,const char *property)
839%
840% A description of each parameter follows:
841%
842% o wand: the magick wand.
843%
844% o property: the property.
845%
846*/
847WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
848{
849 const char
850 *value;
851
852 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000853 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000854 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000855 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000856
cristy3ed852e2009-09-05 21:47:34 +0000857 if (wand->images == (Image *) NULL)
858 {
859 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +0000860 "ContainsNoImages","`%s'",wand->name);
cristy3ed852e2009-09-05 21:47:34 +0000861 return((char *) NULL);
862 }
cristyd15e6592011-10-15 00:13:06 +0000863 value=GetImageProperty(wand->images,property,wand->exception);
cristy3ed852e2009-09-05 21:47:34 +0000864 if (value == (const char *) NULL)
865 return((char *) NULL);
866 return(ConstantString(value));
867}
868
869/*
870%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
871% %
872% %
873% %
874% M a g i c k G e t I m a g e P r o p e r t i e s %
875% %
876% %
877% %
878%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
879%
880% MagickGetImageProperties() returns all the property names that match the
881% specified pattern associated with a wand. Use MagickGetImageProperty() to
882% return the value of a particular property. Use MagickRelinquishMemory() to
883% free the value when you are finished with it.
884%
885% The format of the MagickGetImageProperties method is:
886%
887% char *MagickGetImageProperties(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +0000888% const char *pattern,size_t *number_properties)
cristy3ed852e2009-09-05 21:47:34 +0000889%
890% A description of each parameter follows:
891%
892% o wand: the magick wand.
893%
894% o pattern: Specifies a pointer to a text string containing a pattern.
895%
896% o number_properties: the number properties associated with this wand.
897%
898*/
899WandExport char **MagickGetImageProperties(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +0000900 const char *pattern,size_t *number_properties)
cristy3ed852e2009-09-05 21:47:34 +0000901{
902 char
903 **properties;
904
905 const char
906 *property;
907
cristybb503372010-05-27 20:51:26 +0000908 register ssize_t
cristy3ed852e2009-09-05 21:47:34 +0000909 i;
910
911 size_t
912 length;
913
914 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000915 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000916 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000917 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000918
cristy3ed852e2009-09-05 21:47:34 +0000919 if (wand->images == (Image *) NULL)
920 {
921 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +0000922 "ContainsNoImages","`%s'",wand->name);
cristy3ed852e2009-09-05 21:47:34 +0000923 return((char **) NULL);
924 }
cristyd15e6592011-10-15 00:13:06 +0000925 (void) GetImageProperty(wand->images,"exif:*",wand->exception);
cristy3ed852e2009-09-05 21:47:34 +0000926 length=1024;
927 properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
928 if (properties == (char **) NULL)
929 return((char **) NULL);
930 ResetImagePropertyIterator(wand->images);
931 property=GetNextImageProperty(wand->images);
932 for (i=0; property != (const char *) NULL; )
933 {
934 if ((*property != '[') &&
anthony8270b722012-03-30 14:35:24 +0000935 (IfMagickTrue(GlobExpression(property,pattern,MagickFalse))))
cristy3ed852e2009-09-05 21:47:34 +0000936 {
cristybb503372010-05-27 20:51:26 +0000937 if ((i+1) >= (ssize_t) length)
cristy3ed852e2009-09-05 21:47:34 +0000938 {
939 length<<=1;
940 properties=(char **) ResizeQuantumMemory(properties,length,
941 sizeof(*properties));
942 if (properties == (char **) NULL)
943 {
944 (void) ThrowMagickException(wand->exception,GetMagickModule(),
cristyefe601c2013-01-05 17:51:12 +0000945 ResourceLimitError,"MemoryAllocationFailed","`%s'",
cristy3ed852e2009-09-05 21:47:34 +0000946 wand->name);
947 return((char **) NULL);
948 }
949 }
950 properties[i]=ConstantString(property);
951 i++;
952 }
953 property=GetNextImageProperty(wand->images);
954 }
955 properties[i]=(char *) NULL;
cristybb503372010-05-27 20:51:26 +0000956 *number_properties=(size_t) i;
cristy3ed852e2009-09-05 21:47:34 +0000957 return(properties);
958}
959
960/*
961%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
962% %
963% %
964% %
965% M a g i c k G e t I n t e r l a c e S c h e m e %
966% %
967% %
968% %
969%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
970%
971% MagickGetInterlaceScheme() gets the wand interlace scheme.
972%
973% The format of the MagickGetInterlaceScheme method is:
974%
975% InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
976%
977% A description of each parameter follows:
978%
979% o wand: the magick wand.
980%
981*/
982WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
983{
984 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +0000985 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +0000986 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +0000987 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +0000988
cristy3ed852e2009-09-05 21:47:34 +0000989 return(wand->image_info->interlace);
990}
991
992/*
993%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
994% %
995% %
996% %
997% M a g i c k G e t I n t e r p o l a t e M e t h o d %
998% %
999% %
1000% %
1001%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1002%
1003% MagickGetInterpolateMethod() gets the wand compression.
1004%
1005% The format of the MagickGetInterpolateMethod method is:
1006%
cristy5c4e2582011-09-11 19:21:03 +00001007% PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
cristy3ed852e2009-09-05 21:47:34 +00001008%
1009% A description of each parameter follows:
1010%
1011% o wand: the magick wand.
1012%
1013*/
cristy5c4e2582011-09-11 19:21:03 +00001014WandExport PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
cristy3ed852e2009-09-05 21:47:34 +00001015{
1016 const char
1017 *option;
1018
cristy5c4e2582011-09-11 19:21:03 +00001019 PixelInterpolateMethod
cristy3ed852e2009-09-05 21:47:34 +00001020 method;
1021
1022 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001023 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001024 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001025 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001026
cristy3ed852e2009-09-05 21:47:34 +00001027 option=GetImageOption(wand->image_info,"interpolate");
1028 if (option == (const char *) NULL)
1029 return(UndefinedInterpolatePixel);
cristy5c4e2582011-09-11 19:21:03 +00001030 method=(PixelInterpolateMethod) ParseCommandOption(MagickInterpolateOptions,
cristy3ed852e2009-09-05 21:47:34 +00001031 MagickFalse,option);
1032 return(method);
1033}
1034
1035/*
1036%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1037% %
1038% %
1039% %
1040% M a g i c k G e t O p t i o n %
1041% %
1042% %
1043% %
1044%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1045%
1046% MagickGetOption() returns a value associated with a wand and the specified
1047% key. Use MagickRelinquishMemory() to free the value when you are finished
1048% with it.
1049%
1050% The format of the MagickGetOption method is:
1051%
1052% char *MagickGetOption(MagickWand *wand,const char *key)
1053%
1054% A description of each parameter follows:
1055%
1056% o wand: the magick wand.
1057%
1058% o key: the key.
1059%
1060*/
1061WandExport char *MagickGetOption(MagickWand *wand,const char *key)
1062{
1063 const char
1064 *option;
1065
1066 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001067 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001068 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001069 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001070
cristy3ed852e2009-09-05 21:47:34 +00001071 option=GetImageOption(wand->image_info,key);
1072 return(ConstantString(option));
1073}
1074
1075/*
1076%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1077% %
1078% %
1079% %
cristy9a41c6e2012-04-25 00:23:48 +00001080% M a g i c k G e t O p t i o n s %
cristy3ed852e2009-09-05 21:47:34 +00001081% %
1082% %
1083% %
1084%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1085%
1086% MagickGetOptions() returns all the option names that match the specified
1087% pattern associated with a wand. Use MagickGetOption() to return the value
1088% of a particular option. Use MagickRelinquishMemory() to free the value
1089% when you are finished with it.
1090%
1091% The format of the MagickGetOptions method is:
1092%
cristy9a41c6e2012-04-25 00:23:48 +00001093% char *MagickGetOptions(MagickWand *wand,const char *pattern,
1094% size_t *number_options)
cristy3ed852e2009-09-05 21:47:34 +00001095%
1096% A description of each parameter follows:
1097%
1098% o wand: the magick wand.
1099%
1100% o pattern: Specifies a pointer to a text string containing a pattern.
1101%
1102% o number_options: the number options associated with this wand.
1103%
1104*/
1105WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
cristybb503372010-05-27 20:51:26 +00001106 size_t *number_options)
cristy3ed852e2009-09-05 21:47:34 +00001107{
1108 char
1109 **options;
1110
1111 const char
1112 *option;
1113
cristybb503372010-05-27 20:51:26 +00001114 register ssize_t
cristy3ed852e2009-09-05 21:47:34 +00001115 i;
1116
1117 size_t
1118 length;
1119
1120 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001121 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001122 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001123 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001124
cristy3ed852e2009-09-05 21:47:34 +00001125 if (wand->images == (Image *) NULL)
1126 {
1127 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +00001128 "ContainsNoImages","`%s'",wand->name);
cristy3ed852e2009-09-05 21:47:34 +00001129 return((char **) NULL);
1130 }
1131 length=1024;
1132 options=(char **) AcquireQuantumMemory(length,sizeof(*options));
1133 if (options == (char **) NULL)
1134 return((char **) NULL);
1135 ResetImageOptionIterator(wand->image_info);
1136 option=GetNextImageOption(wand->image_info);
1137 for (i=0; option != (const char *) NULL; )
1138 {
1139 if ((*option != '[') &&
anthony8270b722012-03-30 14:35:24 +00001140 (IfMagickTrue(GlobExpression(option,pattern,MagickFalse))))
cristy3ed852e2009-09-05 21:47:34 +00001141 {
cristybb503372010-05-27 20:51:26 +00001142 if ((i+1) >= (ssize_t) length)
cristy3ed852e2009-09-05 21:47:34 +00001143 {
1144 length<<=1;
1145 options=(char **) ResizeQuantumMemory(options,length,
1146 sizeof(*options));
1147 if (options == (char **) NULL)
1148 {
1149 (void) ThrowMagickException(wand->exception,GetMagickModule(),
cristyefe601c2013-01-05 17:51:12 +00001150 ResourceLimitError,"MemoryAllocationFailed","`%s'",
cristy3ed852e2009-09-05 21:47:34 +00001151 wand->name);
1152 return((char **) NULL);
1153 }
1154 }
1155 options[i]=ConstantString(option);
1156 i++;
1157 }
1158 option=GetNextImageOption(wand->image_info);
1159 }
1160 options[i]=(char *) NULL;
cristybb503372010-05-27 20:51:26 +00001161 *number_options=(size_t) i;
cristy3ed852e2009-09-05 21:47:34 +00001162 return(options);
1163}
1164
1165/*
1166%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1167% %
1168% %
1169% %
1170% M a g i c k G e t O r i e n t a t i o n %
1171% %
1172% %
1173% %
1174%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1175%
1176% MagickGetOrientation() gets the wand orientation type.
1177%
1178% The format of the MagickGetOrientation method is:
1179%
1180% OrientationType MagickGetOrientation(MagickWand *wand)
1181%
1182% A description of each parameter follows:
1183%
1184% o wand: the magick wand.
1185%
1186*/
1187WandExport OrientationType MagickGetOrientation(MagickWand *wand)
1188{
1189 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001190 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001191 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001192 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001193
cristy3ed852e2009-09-05 21:47:34 +00001194 return(wand->image_info->orientation);
1195}
1196
1197/*
1198%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1199% %
1200% %
1201% %
1202% M a g i c k G e t P a c k a g e N a m e %
1203% %
1204% %
1205% %
1206%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1207%
1208% MagickGetPackageName() returns the ImageMagick package name as a string
1209% constant.
1210%
1211% The format of the MagickGetPackageName method is:
1212%
1213% const char *MagickGetPackageName(void)
1214%
1215%
1216*/
1217WandExport const char *MagickGetPackageName(void)
1218{
1219 return(GetMagickPackageName());
1220}
1221
1222/*
1223%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1224% %
1225% %
1226% %
1227% M a g i c k G e t P a g e %
1228% %
1229% %
1230% %
1231%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1232%
1233% MagickGetPage() returns the page geometry associated with the magick wand.
1234%
1235% The format of the MagickGetPage method is:
1236%
1237% MagickBooleanType MagickGetPage(const MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001238% size_t *width,size_t *height,ssize_t *x,ssize_t *y)
cristy3ed852e2009-09-05 21:47:34 +00001239%
1240% A description of each parameter follows:
1241%
1242% o wand: the magick wand.
1243%
1244% o width: the page width.
1245%
1246% o height: page height.
1247%
1248% o x: the page x-offset.
1249%
1250% o y: the page y-offset.
1251%
1252*/
1253WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001254 size_t *width,size_t *height,ssize_t *x,ssize_t *y)
cristy3ed852e2009-09-05 21:47:34 +00001255{
1256 RectangleInfo
1257 geometry;
1258
1259 assert(wand != (const MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001260 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001261 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001263
cristy3ed852e2009-09-05 21:47:34 +00001264 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1265 (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
1266 *width=geometry.width;
1267 *height=geometry.height;
1268 *x=geometry.x;
1269 *y=geometry.y;
1270 return(MagickTrue);
1271}
1272
1273/*
1274%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1275% %
1276% %
1277% %
1278% M a g i c k G e t P o i n t s i z e %
1279% %
1280% %
1281% %
1282%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1283%
1284% MagickGetPointsize() returns the font pointsize associated with the
1285% MagickWand.
1286%
1287% The format of the MagickGetPointsize method is:
1288%
1289% double MagickGetPointsize(MagickWand *wand)
1290%
1291% A description of each parameter follows:
1292%
1293% o wand: the magick wand.
1294%
1295*/
1296WandExport double MagickGetPointsize(MagickWand *wand)
1297{
1298 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001299 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001300 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001301 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001302
cristy3ed852e2009-09-05 21:47:34 +00001303 return(wand->image_info->pointsize);
1304}
1305
1306/*
1307%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1308% %
1309% %
1310% %
1311% M a g i c k G e t Q u a n t u m D e p t h %
1312% %
1313% %
1314% %
1315%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1316%
1317% MagickGetQuantumDepth() returns the ImageMagick quantum depth as a string
1318% constant.
1319%
1320% The format of the MagickGetQuantumDepth method is:
1321%
cristybb503372010-05-27 20:51:26 +00001322% const char *MagickGetQuantumDepth(size_t *depth)
cristy3ed852e2009-09-05 21:47:34 +00001323%
1324% A description of each parameter follows:
1325%
1326% o depth: the quantum depth is returned as a number.
1327%
1328*/
cristybb503372010-05-27 20:51:26 +00001329WandExport const char *MagickGetQuantumDepth(size_t *depth)
cristy3ed852e2009-09-05 21:47:34 +00001330{
1331 return(GetMagickQuantumDepth(depth));
1332}
1333
1334/*
1335%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1336% %
1337% %
1338% %
1339% M a g i c k G e t Q u a n t u m R a n g e %
1340% %
1341% %
1342% %
1343%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1344%
1345% MagickGetQuantumRange() returns the ImageMagick quantum range as a string
1346% constant.
1347%
1348% The format of the MagickGetQuantumRange method is:
1349%
cristybb503372010-05-27 20:51:26 +00001350% const char *MagickGetQuantumRange(size_t *range)
cristy3ed852e2009-09-05 21:47:34 +00001351%
1352% A description of each parameter follows:
1353%
1354% o range: the quantum range is returned as a number.
1355%
1356*/
cristybb503372010-05-27 20:51:26 +00001357WandExport const char *MagickGetQuantumRange(size_t *range)
cristy3ed852e2009-09-05 21:47:34 +00001358{
1359 return(GetMagickQuantumRange(range));
1360}
1361
1362/*
1363%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1364% %
1365% %
1366% %
1367% M a g i c k G e t R e l e a s e D a t e %
1368% %
1369% %
1370% %
1371%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1372%
1373% MagickGetReleaseDate() returns the ImageMagick release date as a string
1374% constant.
1375%
1376% The format of the MagickGetReleaseDate method is:
1377%
1378% const char *MagickGetReleaseDate(void)
1379%
1380*/
1381WandExport const char *MagickGetReleaseDate(void)
1382{
1383 return(GetMagickReleaseDate());
1384}
1385
1386/*
1387%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1388% %
1389% %
1390% %
cristy56375382010-11-21 23:49:30 +00001391% M a g i c k G e t R e s o l u t i o n %
1392% %
1393% %
1394% %
1395%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1396%
1397% MagickGetResolution() gets the image X and Y resolution.
1398%
1399% The format of the MagickGetResolution method is:
1400%
1401% MagickBooleanType MagickGetResolution(const MagickWand *wand,double *x,
1402% double *y)
1403%
1404% A description of each parameter follows:
1405%
1406% o wand: the magick wand.
1407%
1408% o x: the x-resolution.
1409%
1410% o y: the y-resolution.
1411%
1412*/
1413WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand,
1414 double *x,double *y)
1415{
1416 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001417 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001418 if( IfMagickTrue(wand->debug) )
cristy56375382010-11-21 23:49:30 +00001419 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001420
cristy56375382010-11-21 23:49:30 +00001421 *x=72.0;
1422 *y=72.0;
1423 if (wand->image_info->density != (char *) NULL)
1424 {
1425 GeometryInfo
1426 geometry_info;
1427
1428 MagickStatusType
1429 flags;
1430
1431 flags=ParseGeometry(wand->image_info->density,&geometry_info);
1432 *x=geometry_info.rho;
1433 *y=geometry_info.sigma;
anthony8270b722012-03-30 14:35:24 +00001434 if ((flags & SigmaValue) == 0)
cristy56375382010-11-21 23:49:30 +00001435 *y=(*x);
1436 }
1437 return(MagickTrue);
1438}
1439
1440/*
1441%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1442% %
1443% %
1444% %
cristy3ed852e2009-09-05 21:47:34 +00001445% M a g i c k G e t R e s o u r c e %
1446% %
1447% %
1448% %
1449%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1450%
1451% MagickGetResource() returns the specified resource in megabytes.
1452%
1453% The format of the MagickGetResource method is:
1454%
1455% MagickSizeType MagickGetResource(const ResourceType type)
1456%
1457% A description of each parameter follows:
1458%
1459% o wand: the magick wand.
1460%
1461*/
1462WandExport MagickSizeType MagickGetResource(const ResourceType type)
1463{
1464 return(GetMagickResource(type));
1465}
1466
1467/*
1468%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1469% %
1470% %
1471% %
1472% M a g i c k G e t R e s o u r c e L i m i t %
1473% %
1474% %
1475% %
1476%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1477%
1478% MagickGetResourceLimit() returns the specified resource limit in megabytes.
1479%
1480% The format of the MagickGetResourceLimit method is:
1481%
1482% MagickSizeType MagickGetResourceLimit(const ResourceType type)
1483%
1484% A description of each parameter follows:
1485%
1486% o wand: the magick wand.
1487%
1488*/
1489WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
1490{
1491 return(GetMagickResourceLimit(type));
1492}
1493
1494/*
1495%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1496% %
1497% %
1498% %
1499% M a g i c k G e t S a m p l i n g F a c t o r s %
1500% %
1501% %
1502% %
1503%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1504%
1505% MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.
1506%
1507% The format of the MagickGetSamplingFactors method is:
1508%
1509% double *MagickGetSamplingFactor(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001510% size_t *number_factors)
cristy3ed852e2009-09-05 21:47:34 +00001511%
1512% A description of each parameter follows:
1513%
1514% o wand: the magick wand.
1515%
1516% o number_factors: the number of factors in the returned array.
1517%
1518*/
1519WandExport double *MagickGetSamplingFactors(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001520 size_t *number_factors)
cristy3ed852e2009-09-05 21:47:34 +00001521{
1522 double
1523 *sampling_factors;
1524
1525 register const char
1526 *p;
1527
cristybb503372010-05-27 20:51:26 +00001528 register ssize_t
cristy3ed852e2009-09-05 21:47:34 +00001529 i;
1530
1531 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001532 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001533 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001534 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001535
cristy3ed852e2009-09-05 21:47:34 +00001536 *number_factors=0;
1537 sampling_factors=(double *) NULL;
1538 if (wand->image_info->sampling_factor == (char *) NULL)
1539 return(sampling_factors);
1540 i=0;
1541 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1542 {
1543 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1544 (*p == ',')))
1545 p++;
1546 i++;
1547 }
cristy54ebd8d2014-01-14 01:14:23 +00001548 sampling_factors=(double *) AcquireQuantumMemory((size_t) i+1,
cristy3ed852e2009-09-05 21:47:34 +00001549 sizeof(*sampling_factors));
1550 if (sampling_factors == (double *) NULL)
1551 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
1552 wand->image_info->filename);
1553 i=0;
1554 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
1555 {
1556 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
1557 (*p == ',')))
1558 p++;
cristydbdd0e32011-11-04 23:29:40 +00001559 sampling_factors[i]=StringToDouble(p,(char **) NULL);
cristy3ed852e2009-09-05 21:47:34 +00001560 i++;
1561 }
cristybb503372010-05-27 20:51:26 +00001562 *number_factors=(size_t) i;
cristy3ed852e2009-09-05 21:47:34 +00001563 return(sampling_factors);
1564}
1565
1566/*
1567%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1568% %
1569% %
1570% %
1571% M a g i c k G e t S i z e %
1572% %
1573% %
1574% %
1575%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1576%
1577% MagickGetSize() returns the size associated with the magick wand.
1578%
1579% The format of the MagickGetSize method is:
1580%
1581% MagickBooleanType MagickGetSize(const MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001582% size_t *columns,size_t *rows)
cristy3ed852e2009-09-05 21:47:34 +00001583%
1584% A description of each parameter follows:
1585%
1586% o wand: the magick wand.
1587%
1588% o columns: the width in pixels.
1589%
1590% o height: the height in pixels.
1591%
1592*/
1593WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001594 size_t *columns,size_t *rows)
cristy3ed852e2009-09-05 21:47:34 +00001595{
1596 RectangleInfo
1597 geometry;
1598
1599 assert(wand != (const MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001600 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001601 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001602 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001603
cristy3ed852e2009-09-05 21:47:34 +00001604 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1605 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1606 *columns=geometry.width;
1607 *rows=geometry.height;
1608 return(MagickTrue);
1609}
1610
1611/*
1612%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1613% %
1614% %
1615% %
1616% M a g i c k G e t S i z e O f f s e t %
1617% %
1618% %
1619% %
1620%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1621%
1622% MagickGetSizeOffset() returns the size offset associated with the magick
1623% wand.
1624%
1625% The format of the MagickGetSizeOffset method is:
1626%
1627% MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001628% ssize_t *offset)
cristy3ed852e2009-09-05 21:47:34 +00001629%
1630% A description of each parameter follows:
1631%
1632% o wand: the magick wand.
1633%
1634% o offset: the image offset.
1635%
1636*/
1637WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001638 ssize_t *offset)
cristy3ed852e2009-09-05 21:47:34 +00001639{
1640 RectangleInfo
1641 geometry;
1642
1643 assert(wand != (const MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001644 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001645 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001646 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001647
cristy3ed852e2009-09-05 21:47:34 +00001648 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
1649 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1650 *offset=geometry.x;
1651 return(MagickTrue);
1652}
1653
1654/*
1655%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1656% %
1657% %
1658% %
1659% M a g i c k G e t T y p e %
1660% %
1661% %
1662% %
1663%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1664%
1665% MagickGetType() returns the wand type.
1666%
1667% The format of the MagickGetType method is:
1668%
1669% ImageType MagickGetType(MagickWand *wand)
1670%
1671% A description of each parameter follows:
1672%
1673% o wand: the magick wand.
1674%
1675*/
1676WandExport ImageType MagickGetType(MagickWand *wand)
1677{
1678 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001679 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001680 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001681 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001682
cristy3ed852e2009-09-05 21:47:34 +00001683 return(wand->image_info->type);
1684}
1685
1686/*
1687%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1688% %
1689% %
1690% %
1691% M a g i c k G e t V e r s i o n %
1692% %
1693% %
1694% %
1695%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1696%
1697% MagickGetVersion() returns the ImageMagick API version as a string constant
1698% and as a number.
1699%
1700% The format of the MagickGetVersion method is:
1701%
cristybb503372010-05-27 20:51:26 +00001702% const char *MagickGetVersion(size_t *version)
cristy3ed852e2009-09-05 21:47:34 +00001703%
1704% A description of each parameter follows:
1705%
1706% o version: the ImageMagick version is returned as a number.
1707%
1708*/
cristybb503372010-05-27 20:51:26 +00001709WandExport const char *MagickGetVersion(size_t *version)
cristy3ed852e2009-09-05 21:47:34 +00001710{
1711 return(GetMagickVersion(version));
1712}
1713
1714/*
1715%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1716% %
1717% %
1718% %
1719% M a g i c k P r o f i l e I m a g e %
1720% %
1721% %
1722% %
1723%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1724%
1725% MagickProfileImage() adds or removes a ICC, IPTC, or generic profile
1726% from an image. If the profile is NULL, it is removed from the image
1727% otherwise added. Use a name of '*' and a profile of NULL to remove all
1728% profiles from the image.
1729%
1730% The format of the MagickProfileImage method is:
1731%
1732% MagickBooleanType MagickProfileImage(MagickWand *wand,const char *name,
1733% const void *profile,const size_t length)
1734%
1735% A description of each parameter follows:
1736%
1737% o wand: the magick wand.
1738%
1739% o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
1740%
1741% o profile: the profile.
1742%
1743% o length: the length of the profile.
1744%
1745*/
1746WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
1747 const char *name,const void *profile,const size_t length)
1748{
cristy3ed852e2009-09-05 21:47:34 +00001749 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001750 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001751 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001752 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001753
cristy3ed852e2009-09-05 21:47:34 +00001754 if (wand->images == (Image *) NULL)
1755 ThrowWandException(WandError,"ContainsNoImages",wand->name);
cristy092d71c2011-10-14 18:01:29 +00001756 return(ProfileImage(wand->images,name,profile,length,wand->exception));
cristy3ed852e2009-09-05 21:47:34 +00001757}
1758
1759/*
1760%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1761% %
1762% %
1763% %
1764% M a g i c k R e m o v e I m a g e P r o f i l e %
1765% %
1766% %
1767% %
1768%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1769%
1770% MagickRemoveImageProfile() removes the named image profile and returns it.
1771%
1772% The format of the MagickRemoveImageProfile method is:
1773%
1774% unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1775% const char *name,size_t *length)
1776%
1777% A description of each parameter follows:
1778%
1779% o wand: the magick wand.
1780%
1781% o name: Name of profile to return: ICC, IPTC, or generic profile.
1782%
1783% o length: the length of the profile.
1784%
1785*/
1786WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
1787 const char *name,size_t *length)
1788{
1789 StringInfo
1790 *profile;
1791
1792 unsigned char
1793 *datum;
1794
1795 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001796 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001797 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001798 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001799
cristy3ed852e2009-09-05 21:47:34 +00001800 if (wand->images == (Image *) NULL)
1801 {
1802 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
cristyefe601c2013-01-05 17:51:12 +00001803 "ContainsNoImages","`%s'",wand->name);
cristy3ed852e2009-09-05 21:47:34 +00001804 return((unsigned char *) NULL);
1805 }
1806 *length=0;
1807 profile=RemoveImageProfile(wand->images,name);
1808 if (profile == (StringInfo *) NULL)
1809 return((unsigned char *) NULL);
1810 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
1811 sizeof(*datum));
1812 if (datum == (unsigned char *) NULL)
1813 return((unsigned char *) NULL);
1814 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
1815 GetStringInfoLength(profile));
1816 *length=GetStringInfoLength(profile);
1817 profile=DestroyStringInfo(profile);
1818 return(datum);
1819}
1820
1821/*
1822%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1823% %
1824% %
1825% %
1826% M a g i c k S e t A n t i a l i a s %
1827% %
1828% %
1829% %
1830%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1831%
1832% MagickSetAntialias() sets the antialias propery of the wand.
1833%
1834% The format of the MagickSetAntialias method is:
1835%
1836% MagickBooleanType MagickSetAntialias(MagickWand *wand,
1837% const MagickBooleanType antialias)
1838%
1839% A description of each parameter follows:
1840%
1841% o wand: the magick wand.
1842%
1843% o antialias: the antialias property.
1844%
1845*/
1846WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
1847 const MagickBooleanType antialias)
1848{
1849 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001850 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001851 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001852 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001853
cristy3ed852e2009-09-05 21:47:34 +00001854 wand->image_info->antialias=antialias;
1855 return(MagickTrue);
1856}
1857
1858/*
1859%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1860% %
1861% %
1862% %
1863% M a g i c k S e t B a c k g r o u n d C o l o r %
1864% %
1865% %
1866% %
1867%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1868%
1869% MagickSetBackgroundColor() sets the wand background color.
1870%
1871% The format of the MagickSetBackgroundColor method is:
1872%
1873% MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1874% const PixelWand *background)
1875%
1876% A description of each parameter follows:
1877%
1878% o wand: the magick wand.
1879%
1880% o background: the background pixel wand.
1881%
1882*/
1883WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
1884 const PixelWand *background)
1885{
1886 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001887 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001888 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001889 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001890
cristy4c08aed2011-07-01 19:47:50 +00001891 PixelGetQuantumPacket(background,&wand->image_info->background_color);
cristy3ed852e2009-09-05 21:47:34 +00001892 return(MagickTrue);
1893}
1894
1895/*
1896%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1897% %
1898% %
1899% %
1900% M a g i c k S e t C o l o r s p a c e %
1901% %
1902% %
1903% %
1904%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1905%
1906% MagickSetColorspace() sets the wand colorspace type.
1907%
1908% The format of the MagickSetColorspace method is:
1909%
1910% MagickBooleanType MagickSetColorspace(MagickWand *wand,
1911% const ColorspaceType colorspace)
1912%
1913% A description of each parameter follows:
1914%
1915% o wand: the magick wand.
1916%
1917% o colorspace: the wand colorspace.
1918%
1919*/
1920WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
1921 const ColorspaceType colorspace)
1922{
1923 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001924 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001925 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001926 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001927
cristy3ed852e2009-09-05 21:47:34 +00001928 wand->image_info->colorspace=colorspace;
1929 return(MagickTrue);
1930}
1931
1932/*
1933%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1934% %
1935% %
1936% %
1937% M a g i c k S e t C o m p r e s s i o n %
1938% %
1939% %
1940% %
1941%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1942%
1943% MagickSetCompression() sets the wand compression type.
1944%
1945% The format of the MagickSetCompression method is:
1946%
1947% MagickBooleanType MagickSetCompression(MagickWand *wand,
1948% const CompressionType compression)
1949%
1950% A description of each parameter follows:
1951%
1952% o wand: the magick wand.
1953%
1954% o compression: the wand compression.
1955%
1956*/
1957WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
1958 const CompressionType compression)
1959{
1960 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001961 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001962 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00001963 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00001964
cristy3ed852e2009-09-05 21:47:34 +00001965 wand->image_info->compression=compression;
1966 return(MagickTrue);
1967}
1968
1969/*
1970%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1971% %
1972% %
1973% %
1974% M a g i c k S e t C o m p r e s s i o n Q u a l i t y %
1975% %
1976% %
1977% %
1978%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1979%
1980% MagickSetCompressionQuality() sets the wand compression quality.
1981%
1982% The format of the MagickSetCompressionQuality method is:
1983%
1984% MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001985% const size_t quality)
cristy3ed852e2009-09-05 21:47:34 +00001986%
1987% A description of each parameter follows:
1988%
1989% o wand: the magick wand.
1990%
1991% o quality: the wand compression quality.
1992%
1993*/
1994WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00001995 const size_t quality)
cristy3ed852e2009-09-05 21:47:34 +00001996{
1997 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00001998 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00001999 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002000 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002001
cristy3ed852e2009-09-05 21:47:34 +00002002 wand->image_info->quality=quality;
2003 return(MagickTrue);
2004}
2005
2006/*
2007%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2008% %
2009% %
2010% %
2011% M a g i c k S e t D e p t h %
2012% %
2013% %
2014% %
2015%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2016%
2017% MagickSetDepth() sets the wand pixel depth.
2018%
2019% The format of the MagickSetDepth method is:
2020%
2021% MagickBooleanType MagickSetDepth(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002022% const size_t depth)
cristy3ed852e2009-09-05 21:47:34 +00002023%
2024% A description of each parameter follows:
2025%
2026% o wand: the magick wand.
2027%
2028% o depth: the wand pixel depth.
2029%
2030*/
2031WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002032 const size_t depth)
cristy3ed852e2009-09-05 21:47:34 +00002033{
2034 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002035 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002036 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002037 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002038
cristy3ed852e2009-09-05 21:47:34 +00002039 wand->image_info->depth=depth;
2040 return(MagickTrue);
2041}
2042
2043/*
2044%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2045% %
2046% %
2047% %
cristy6a0fa192009-10-08 19:54:53 +00002048% M a g i c k S e t E x t r a c t %
2049% %
2050% %
2051% %
2052%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2053%
2054% MagickSetExtract() sets the extract geometry before you read or write an
2055% image file. Use it for inline cropping (e.g. 200x200+0+0) or resizing
2056% (e.g.200x200).
2057%
2058% The format of the MagickSetExtract method is:
2059%
2060% MagickBooleanType MagickSetExtract(MagickWand *wand,
2061% const char *geometry)
2062%
2063% A description of each parameter follows:
2064%
2065% o wand: the magick wand.
2066%
2067% o geometry: the extract geometry.
2068%
2069*/
2070WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
2071 const char *geometry)
2072{
2073 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002074 assert(wand->signature == MagickWandSignature);
cristyd8f16462014-07-20 11:46:59 +00002075 if (wand->debug != MagickFalse)
cristy6a0fa192009-10-08 19:54:53 +00002076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
cristyd8f16462014-07-20 11:46:59 +00002077 if (wand->image_info->extract != (char *) NULL)
2078 wand->image_info->extract=DestroyString(wand->image_info->extract);
cristy6a0fa192009-10-08 19:54:53 +00002079 if (geometry != (const char *) NULL)
cristyd8f16462014-07-20 11:46:59 +00002080 (void) CloneString(&wand->image_info->extract,geometry);
cristy6a0fa192009-10-08 19:54:53 +00002081 return(MagickTrue);
2082}
2083
2084/*
2085%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2086% %
2087% %
2088% %
cristy3ed852e2009-09-05 21:47:34 +00002089% M a g i c k S e t F i l e n a m e %
2090% %
2091% %
2092% %
2093%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2094%
2095% MagickSetFilename() sets the filename before you read or write an image file.
2096%
2097% The format of the MagickSetFilename method is:
2098%
2099% MagickBooleanType MagickSetFilename(MagickWand *wand,
2100% const char *filename)
2101%
2102% A description of each parameter follows:
2103%
2104% o wand: the magick wand.
2105%
2106% o filename: the image filename.
2107%
2108*/
2109WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
2110 const char *filename)
2111{
2112 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002113 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002114 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002115 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002116
cristy3ed852e2009-09-05 21:47:34 +00002117 if (filename != (const char *) NULL)
cristy151b66d2015-04-15 10:50:31 +00002118 (void) CopyMagickString(wand->image_info->filename,filename,MagickPathExtent);
cristy3ed852e2009-09-05 21:47:34 +00002119 return(MagickTrue);
2120}
2121
2122/*
2123%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2124% %
2125% %
2126% %
2127% M a g i c k S e t F o n t %
2128% %
2129% %
2130% %
2131%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2132%
2133% MagickSetFont() sets the font associated with the MagickWand.
2134%
2135% The format of the MagickSetFont method is:
2136%
2137% MagickBooleanType MagickSetFont(MagickWand *wand, const char *font)
2138%
2139% A description of each parameter follows:
2140%
2141% o wand: the magick wand.
2142%
2143% o font: the font
2144%
2145*/
2146WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
2147{
2148 if ((font == (const char *) NULL) || (*font == '\0'))
2149 return(MagickFalse);
2150 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002151 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002152 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002153 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002154
cristy3ed852e2009-09-05 21:47:34 +00002155 (void) CloneString(&wand->image_info->font,font);
2156 return(MagickTrue);
2157}
2158
2159/*
2160%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2161% %
2162% %
2163% %
2164% M a g i c k S e t F o r m a t %
2165% %
2166% %
2167% %
2168%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2169%
2170% MagickSetFormat() sets the format of the magick wand.
2171%
2172% The format of the MagickSetFormat method is:
2173%
2174% MagickBooleanType MagickSetFormat(MagickWand *wand,const char *format)
2175%
2176% A description of each parameter follows:
2177%
2178% o wand: the magick wand.
2179%
2180% o format: the image format.
2181%
2182*/
2183WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
2184 const char *format)
2185{
2186 const MagickInfo
2187 *magick_info;
2188
2189 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002190 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002191 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002192 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002193
cristy3ed852e2009-09-05 21:47:34 +00002194 if ((format == (char *) NULL) || (*format == '\0'))
2195 {
2196 *wand->image_info->magick='\0';
2197 return(MagickTrue);
2198 }
2199 magick_info=GetMagickInfo(format,wand->exception);
2200 if (magick_info == (const MagickInfo *) NULL)
2201 return(MagickFalse);
2202 ClearMagickException(wand->exception);
cristy151b66d2015-04-15 10:50:31 +00002203 (void) CopyMagickString(wand->image_info->magick,format,MagickPathExtent);
cristy3ed852e2009-09-05 21:47:34 +00002204 return(MagickTrue);
2205}
2206
2207/*
2208%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2209% %
2210% %
2211% %
2212% M a g i c k S e t G r a v i t y %
2213% %
2214% %
2215% %
2216%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2217%
2218% MagickSetGravity() sets the gravity type.
2219%
2220% The format of the MagickSetGravity type is:
2221%
2222% MagickBooleanType MagickSetGravity(MagickWand *wand,
2223% const GravityType type)
2224%
2225% A description of each parameter follows:
2226%
2227% o wand: the magick wand.
2228%
2229% o type: the gravity type.
2230%
2231*/
2232WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
2233 const GravityType type)
2234{
2235 MagickBooleanType
2236 status;
2237
2238 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002239 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002240 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002241 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002242
cristy042ee782011-04-22 18:48:30 +00002243 status=SetImageOption(wand->image_info,"gravity",CommandOptionToMnemonic(
cristybb503372010-05-27 20:51:26 +00002244 MagickGravityOptions,(ssize_t) type));
cristy220c4d52013-11-27 19:31:32 +00002245 return(status);
cristy3ed852e2009-09-05 21:47:34 +00002246}
2247
2248/*
2249%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2250% %
2251% %
2252% %
cristy6a97fda2009-10-11 20:42:55 +00002253% M a g i c k S e t I m a g e A r t i f r c t %
2254% %
2255% %
2256% %
2257%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2258%
2259% MagickSetImageArtifact() associates a artifact with an image.
2260%
2261% The format of the MagickSetImageArtifact method is:
2262%
2263% MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2264% const char *artifact,const char *value)
2265%
2266% A description of each parameter follows:
2267%
2268% o wand: the magick wand.
2269%
2270% o artifact: the artifact.
2271%
2272% o value: the value.
2273%
2274*/
2275WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
2276 const char *artifact,const char *value)
2277{
cristy6a97fda2009-10-11 20:42:55 +00002278 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002279 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002280 if( IfMagickTrue(wand->debug) )
cristy6a97fda2009-10-11 20:42:55 +00002281 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002282
cristy6a97fda2009-10-11 20:42:55 +00002283 if (wand->images == (Image *) NULL)
2284 ThrowWandException(WandError,"ContainsNoImages",wand->name);
cristycad4e1b2011-10-16 14:58:39 +00002285 return(SetImageArtifact(wand->images,artifact,value));
cristy6a97fda2009-10-11 20:42:55 +00002286}
2287
2288/*
2289%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2290% %
2291% %
2292% %
cristy3ed852e2009-09-05 21:47:34 +00002293% M a g i c k S e t P r o f i l e I m a g e %
2294% %
2295% %
2296% %
2297%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2298%
2299% MagickSetImageProfile() adds a named profile to the magick wand. If a
2300% profile with the same name already exists, it is replaced. This method
2301% differs from the MagickProfileImage() method in that it does not apply any
2302% CMS color profiles.
2303%
2304% The format of the MagickSetImageProfile method is:
2305%
2306% MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2307% const char *name,const void *profile,const size_t length)
2308%
2309% A description of each parameter follows:
2310%
2311% o wand: the magick wand.
2312%
2313% o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
2314%
2315% o profile: the profile.
2316%
2317% o length: the length of the profile.
2318%
2319*/
2320WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
2321 const char *name,const void *profile,const size_t length)
2322{
2323 MagickBooleanType
2324 status;
2325
2326 StringInfo
2327 *profile_info;
2328
2329 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002330 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002331 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002332 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002333
cristy3ed852e2009-09-05 21:47:34 +00002334 if (wand->images == (Image *) NULL)
2335 ThrowWandException(WandError,"ContainsNoImages",wand->name);
2336 profile_info=AcquireStringInfo((size_t) length);
2337 SetStringInfoDatum(profile_info,(unsigned char *) profile);
cristyd15e6592011-10-15 00:13:06 +00002338 status=SetImageProfile(wand->images,name,profile_info,wand->exception);
cristy3ed852e2009-09-05 21:47:34 +00002339 profile_info=DestroyStringInfo(profile_info);
cristy220c4d52013-11-27 19:31:32 +00002340 return(status);
cristy3ed852e2009-09-05 21:47:34 +00002341}
2342
2343/*
2344%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2345% %
2346% %
2347% %
2348% M a g i c k S e t I m a g e P r o p e r t y %
2349% %
2350% %
2351% %
2352%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2353%
2354% MagickSetImageProperty() associates a property with an image.
2355%
2356% The format of the MagickSetImageProperty method is:
2357%
2358% MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2359% const char *property,const char *value)
2360%
2361% A description of each parameter follows:
2362%
2363% o wand: the magick wand.
2364%
2365% o property: the property.
2366%
2367% o value: the value.
2368%
2369*/
2370WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
2371 const char *property,const char *value)
2372{
2373 MagickBooleanType
2374 status;
2375
2376 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002377 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002378 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002379 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002380
cristy3ed852e2009-09-05 21:47:34 +00002381 if (wand->images == (Image *) NULL)
2382 ThrowWandException(WandError,"ContainsNoImages",wand->name);
cristyd15e6592011-10-15 00:13:06 +00002383 status=SetImageProperty(wand->images,property,value,wand->exception);
cristy220c4d52013-11-27 19:31:32 +00002384 return(status);
cristy3ed852e2009-09-05 21:47:34 +00002385}
2386
2387/*
2388%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2389% %
2390% %
2391% %
2392% M a g i c k S e t I n t e r l a c e S c h e m e %
2393% %
2394% %
2395% %
2396%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2397%
2398% MagickSetInterlaceScheme() sets the image compression.
2399%
2400% The format of the MagickSetInterlaceScheme method is:
2401%
2402% MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2403% const InterlaceType interlace_scheme)
2404%
2405% A description of each parameter follows:
2406%
2407% o wand: the magick wand.
2408%
2409% o interlace_scheme: the image interlace scheme: NoInterlace, LineInterlace,
2410% PlaneInterlace, PartitionInterlace.
2411%
2412*/
2413WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
2414 const InterlaceType interlace_scheme)
2415{
2416 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002417 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002418 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002419 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002420
cristy3ed852e2009-09-05 21:47:34 +00002421 wand->image_info->interlace=interlace_scheme;
2422 return(MagickTrue);
2423}
2424
2425/*
2426%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2427% %
2428% %
2429% %
2430% 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 %
2431% %
2432% %
2433% %
2434%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2435%
2436% MagickSetInterpolateMethod() sets the interpolate pixel method.
2437%
2438% The format of the MagickSetInterpolateMethod method is:
2439%
2440% MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
2441% const InterpolateMethodPixel method)
2442%
2443% A description of each parameter follows:
2444%
2445% o wand: the magick wand.
2446%
2447% o method: the interpolate pixel method.
2448%
2449*/
2450WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
cristy5c4e2582011-09-11 19:21:03 +00002451 const PixelInterpolateMethod method)
cristy3ed852e2009-09-05 21:47:34 +00002452{
2453 MagickBooleanType
2454 status;
2455
2456 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002457 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002458 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002459 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002460
cristy3ed852e2009-09-05 21:47:34 +00002461 status=SetImageOption(wand->image_info,"interpolate",
cristy042ee782011-04-22 18:48:30 +00002462 CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
cristy220c4d52013-11-27 19:31:32 +00002463 return(status);
cristy3ed852e2009-09-05 21:47:34 +00002464}
2465
2466/*
2467%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2468% %
2469% %
2470% %
2471% M a g i c k S e t O p t i o n %
2472% %
2473% %
2474% %
2475%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2476%
2477% MagickSetOption() associates one or options with the wand (.e.g
2478% MagickSetOption(wand,"jpeg:perserve","yes")).
2479%
2480% The format of the MagickSetOption method is:
2481%
2482% MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2483% const char *value)
2484%
2485% A description of each parameter follows:
2486%
2487% o wand: the magick wand.
2488%
2489% o key: The key.
2490%
2491% o value: The value.
2492%
2493*/
2494WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
2495 const char *value)
2496{
2497 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002498 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002499 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002500 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002501
cristy3ed852e2009-09-05 21:47:34 +00002502 return(SetImageOption(wand->image_info,key,value));
2503}
2504
2505/*
2506%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2507% %
2508% %
2509% %
2510% M a g i c k S e t O r i e n t a t i o n %
2511% %
2512% %
2513% %
2514%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2515%
2516% MagickSetOrientation() sets the wand orientation type.
2517%
2518% The format of the MagickSetOrientation method is:
2519%
2520% MagickBooleanType MagickSetOrientation(MagickWand *wand,
2521% const OrientationType orientation)
2522%
2523% A description of each parameter follows:
2524%
2525% o wand: the magick wand.
2526%
2527% o orientation: the wand orientation.
2528%
2529*/
2530WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
2531 const OrientationType orientation)
2532{
2533 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002534 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002535 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002536 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002537
cristy3ed852e2009-09-05 21:47:34 +00002538 wand->image_info->orientation=orientation;
2539 return(MagickTrue);
2540}
2541
2542/*
2543%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2544% %
2545% %
2546% %
2547% M a g i c k S e t P a g e %
2548% %
2549% %
2550% %
2551%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2552%
2553% MagickSetPage() sets the page geometry of the magick wand.
2554%
2555% The format of the MagickSetPage method is:
2556%
2557% MagickBooleanType MagickSetPage(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002558% const size_t width,const size_t height,const ssize_t x,
2559% const ssize_t y)
cristy3ed852e2009-09-05 21:47:34 +00002560%
2561% A description of each parameter follows:
2562%
2563% o wand: the magick wand.
2564%
2565% o width: the page width.
2566%
2567% o height: the page height.
2568%
2569% o x: the page x-offset.
2570%
2571% o y: the page y-offset.
2572%
2573*/
2574WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002575 const size_t width,const size_t height,const ssize_t x,
2576 const ssize_t y)
cristy3ed852e2009-09-05 21:47:34 +00002577{
2578 char
cristy151b66d2015-04-15 10:50:31 +00002579 geometry[MagickPathExtent];
cristy3ed852e2009-09-05 21:47:34 +00002580
2581 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002582 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002583 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002584 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002585
cristy151b66d2015-04-15 10:50:31 +00002586 (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g%+.20g%+.20g",
cristye8c25f92010-06-03 00:53:06 +00002587 (double) width,(double) height,(double) x,(double) y);
cristy3ed852e2009-09-05 21:47:34 +00002588 (void) CloneString(&wand->image_info->page,geometry);
2589 return(MagickTrue);
2590}
2591
2592/*
2593%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2594% %
2595% %
2596% %
2597% M a g i c k S e t P a s s p h r a s e %
2598% %
2599% %
2600% %
2601%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2602%
2603% MagickSetPassphrase() sets the passphrase.
2604%
2605% The format of the MagickSetPassphrase method is:
2606%
2607% MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2608% const char *passphrase)
2609%
2610% A description of each parameter follows:
2611%
2612% o wand: the magick wand.
2613%
2614% o passphrase: the passphrase.
2615%
2616*/
2617WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
2618 const char *passphrase)
2619{
2620 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002621 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002622 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002623 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002624
anthony1afdc7a2011-10-05 11:54:28 +00002625 (void) SetImageOption(wand->image_info,"authenticate",passphrase);
cristy3ed852e2009-09-05 21:47:34 +00002626 return(MagickTrue);
2627}
2628
2629/*
2630%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2631% %
2632% %
2633% %
2634% M a g i c k S e t P o i n t s i z e %
2635% %
2636% %
2637% %
2638%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2639%
2640% MagickSetPointsize() sets the font pointsize associated with the MagickWand.
2641%
2642% The format of the MagickSetPointsize method is:
2643%
2644% MagickBooleanType MagickSetPointsize(MagickWand *wand,
2645% const double pointsize)
2646%
2647% A description of each parameter follows:
2648%
2649% o wand: the magick wand.
2650%
2651% o pointsize: the size of the font
2652%
2653*/
2654WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
2655 const double pointsize)
2656{
2657 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002658 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002659 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002660 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002661
cristy3ed852e2009-09-05 21:47:34 +00002662 wand->image_info->pointsize=pointsize;
2663 return(MagickTrue);
2664}
2665
2666/*
2667%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2668% %
2669% %
2670% %
2671% M a g i c k S e t P r o g r e s s M o n i t o r %
2672% %
2673% %
2674% %
2675%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2676%
2677% MagickSetProgressMonitor() sets the wand progress monitor to the specified
2678% method and returns the previous progress monitor if any. The progress
2679% monitor method looks like this:
2680%
2681% MagickBooleanType MagickProgressMonitor(const char *text,
2682% const MagickOffsetType offset,const MagickSizeType span,
2683% void *client_data)
2684%
2685% If the progress monitor returns MagickFalse, the current operation is
2686% interrupted.
2687%
2688% The format of the MagickSetProgressMonitor method is:
2689%
2690% MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand
2691% const MagickProgressMonitor progress_monitor,void *client_data)
2692%
2693% A description of each parameter follows:
2694%
2695% o wand: the magick wand.
2696%
2697% o progress_monitor: Specifies a pointer to a method to monitor progress
2698% of an image operation.
2699%
2700% o client_data: Specifies a pointer to any client data.
2701%
2702*/
2703WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
2704 const MagickProgressMonitor progress_monitor,void *client_data)
2705{
2706 MagickProgressMonitor
2707 previous_monitor;
2708
2709 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002710 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002711 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002712 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002713
cristy3ed852e2009-09-05 21:47:34 +00002714 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
2715 progress_monitor,client_data);
2716 return(previous_monitor);
2717}
2718
2719/*
2720%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2721% %
2722% %
2723% %
2724% M a g i c k S e t R e s o u r c e L i m i t %
2725% %
2726% %
2727% %
2728%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2729%
2730% MagickSetResourceLimit() sets the limit for a particular resource in
2731% megabytes.
2732%
2733% The format of the MagickSetResourceLimit method is:
2734%
2735% MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2736% const MagickSizeType limit)
2737%
2738% A description of each parameter follows:
2739%
2740% o type: the type of resource: AreaResource, MemoryResource, MapResource,
2741% DiskResource, FileResource.
2742%
2743% o The maximum limit for the resource.
2744%
2745*/
2746WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
2747 const MagickSizeType limit)
2748{
2749 return(SetMagickResourceLimit(type,limit));
2750}
2751
2752/*
2753%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2754% %
2755% %
2756% %
2757% M a g i c k S e t R e s o l u t i o n %
2758% %
2759% %
2760% %
2761%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2762%
2763% MagickSetResolution() sets the image resolution.
2764%
2765% The format of the MagickSetResolution method is:
2766%
2767% MagickBooleanType MagickSetResolution(MagickWand *wand,
cristy9a41c6e2012-04-25 00:23:48 +00002768% const double x_resolution,const double y_resolution)
cristy3ed852e2009-09-05 21:47:34 +00002769%
2770% A description of each parameter follows:
2771%
2772% o wand: the magick wand.
2773%
2774% o x_resolution: the image x resolution.
2775%
2776% o y_resolution: the image y resolution.
2777%
2778*/
2779WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
2780 const double x_resolution,const double y_resolution)
2781{
2782 char
cristy151b66d2015-04-15 10:50:31 +00002783 density[MagickPathExtent];
cristy3ed852e2009-09-05 21:47:34 +00002784
2785 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002786 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002787 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002788 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002789
cristy151b66d2015-04-15 10:50:31 +00002790 (void) FormatLocaleString(density,MagickPathExtent,"%gx%g",x_resolution,
cristy3ed852e2009-09-05 21:47:34 +00002791 y_resolution);
2792 (void) CloneString(&wand->image_info->density,density);
2793 return(MagickTrue);
2794}
2795
2796/*
2797%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2798% %
2799% %
2800% %
2801% M a g i c k S e t S a m p l i n g F a c t o r s %
2802% %
2803% %
2804% %
2805%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2806%
2807% MagickSetSamplingFactors() sets the image sampling factors.
2808%
2809% The format of the MagickSetSamplingFactors method is:
2810%
2811% MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002812% const size_t number_factors,const double *sampling_factors)
cristy3ed852e2009-09-05 21:47:34 +00002813%
2814% A description of each parameter follows:
2815%
2816% o wand: the magick wand.
2817%
2818% o number_factoes: the number of factors.
2819%
2820% o sampling_factors: An array of doubles representing the sampling factor
2821% for each color component (in RGB order).
2822%
2823*/
2824WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002825 const size_t number_factors,const double *sampling_factors)
cristy3ed852e2009-09-05 21:47:34 +00002826{
2827 char
cristy151b66d2015-04-15 10:50:31 +00002828 sampling_factor[MagickPathExtent];
cristy3ed852e2009-09-05 21:47:34 +00002829
cristybb503372010-05-27 20:51:26 +00002830 register ssize_t
cristy3ed852e2009-09-05 21:47:34 +00002831 i;
2832
2833 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002834 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002835 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002836 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002837
cristy3ed852e2009-09-05 21:47:34 +00002838 if (wand->image_info->sampling_factor != (char *) NULL)
2839 wand->image_info->sampling_factor=(char *)
2840 RelinquishMagickMemory(wand->image_info->sampling_factor);
2841 if (number_factors == 0)
2842 return(MagickTrue);
cristybb503372010-05-27 20:51:26 +00002843 for (i=0; i < (ssize_t) (number_factors-1); i++)
cristy3ed852e2009-09-05 21:47:34 +00002844 {
cristy151b66d2015-04-15 10:50:31 +00002845 (void) FormatLocaleString(sampling_factor,MagickPathExtent,"%g,",
cristy3ed852e2009-09-05 21:47:34 +00002846 sampling_factors[i]);
2847 (void) ConcatenateString(&wand->image_info->sampling_factor,
2848 sampling_factor);
2849 }
cristy151b66d2015-04-15 10:50:31 +00002850 (void) FormatLocaleString(sampling_factor,MagickPathExtent,"%g",
cristy3ed852e2009-09-05 21:47:34 +00002851 sampling_factors[i]);
2852 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
2853 return(MagickTrue);
2854}
2855
2856/*
2857%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2858% %
2859% %
2860% %
2861% M a g i c k S e t S i z e %
2862% %
2863% %
2864% %
2865%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2866%
2867% MagickSetSize() sets the size of the magick wand. Set it before you
2868% read a raw image format such as RGB, GRAY, or CMYK.
2869%
2870% The format of the MagickSetSize method is:
2871%
2872% MagickBooleanType MagickSetSize(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002873% const size_t columns,const size_t rows)
cristy3ed852e2009-09-05 21:47:34 +00002874%
2875% A description of each parameter follows:
2876%
2877% o wand: the magick wand.
2878%
2879% o columns: the width in pixels.
2880%
2881% o rows: the rows in pixels.
2882%
2883*/
2884WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002885 const size_t columns,const size_t rows)
cristy3ed852e2009-09-05 21:47:34 +00002886{
2887 char
cristy151b66d2015-04-15 10:50:31 +00002888 geometry[MagickPathExtent];
cristy3ed852e2009-09-05 21:47:34 +00002889
2890 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002891 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002892 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002893 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002894
cristy151b66d2015-04-15 10:50:31 +00002895 (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g",(double)
cristye8c25f92010-06-03 00:53:06 +00002896 columns,(double) rows);
cristy3ed852e2009-09-05 21:47:34 +00002897 (void) CloneString(&wand->image_info->size,geometry);
2898 return(MagickTrue);
2899}
2900
2901/*
2902%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2903% %
2904% %
2905% %
2906% M a g i c k S e t S i z e O f f s e t %
2907% %
2908% %
2909% %
2910%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2911%
2912% MagickSetSizeOffset() sets the size and offset of the magick wand. Set it
2913% before you read a raw image format such as RGB, GRAY, or CMYK.
2914%
2915% The format of the MagickSetSizeOffset method is:
2916%
2917% MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002918% const size_t columns,const size_t rows,
2919% const ssize_t offset)
cristy3ed852e2009-09-05 21:47:34 +00002920%
2921% A description of each parameter follows:
2922%
2923% o wand: the magick wand.
2924%
2925% o columns: the image width in pixels.
2926%
2927% o rows: the image rows in pixels.
2928%
2929% o offset: the image offset.
2930%
2931*/
2932WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
cristybb503372010-05-27 20:51:26 +00002933 const size_t columns,const size_t rows,const ssize_t offset)
cristy3ed852e2009-09-05 21:47:34 +00002934{
2935 char
cristy151b66d2015-04-15 10:50:31 +00002936 geometry[MagickPathExtent];
cristy3ed852e2009-09-05 21:47:34 +00002937
2938 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002939 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002940 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002941 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002942
cristy151b66d2015-04-15 10:50:31 +00002943 (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g%+.20g",
cristye8c25f92010-06-03 00:53:06 +00002944 (double) columns,(double) rows,(double) offset);
cristy3ed852e2009-09-05 21:47:34 +00002945 (void) CloneString(&wand->image_info->size,geometry);
2946 return(MagickTrue);
2947}
2948
2949/*
2950%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2951% %
2952% %
2953% %
2954% M a g i c k S e t T y p e %
2955% %
2956% %
2957% %
2958%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2959%
2960% MagickSetType() sets the image type attribute.
2961%
2962% The format of the MagickSetType method is:
2963%
2964% MagickBooleanType MagickSetType(MagickWand *wand,
2965% const ImageType image_type)
2966%
2967% A description of each parameter follows:
2968%
2969% o wand: the magick wand.
2970%
cristy5f1c1ff2010-12-23 21:38:06 +00002971% o image_type: the image type: UndefinedType, BilevelType, GrayscaleType,
cristydef23e52015-01-22 11:52:01 +00002972% GrayscaleAlphaType, PaletteType, PaletteAlphaType, TrueColorType,
2973% TrueColorAlphaType, ColorSeparationType, ColorSeparationAlphaType,
cristy3ed852e2009-09-05 21:47:34 +00002974% or OptimizeType.
2975%
2976*/
2977WandExport MagickBooleanType MagickSetType(MagickWand *wand,
2978 const ImageType image_type)
2979{
2980 assert(wand != (MagickWand *) NULL);
cristye1c94d92015-06-28 12:16:33 +00002981 assert(wand->signature == MagickWandSignature);
anthony8270b722012-03-30 14:35:24 +00002982 if( IfMagickTrue(wand->debug) )
cristy3ed852e2009-09-05 21:47:34 +00002983 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
anthony8270b722012-03-30 14:35:24 +00002984
cristy3ed852e2009-09-05 21:47:34 +00002985 wand->image_info->type=image_type;
2986 return(MagickTrue);
2987}