49#include "wand/studio.h"
50#include "wand/MagickWand.h"
51#include "wand/magick-wand-private.h"
53#include "magick/image-private.h"
54#include "magick/string-private.h"
81WandExport MagickBooleanType MagickDeleteImageArtifact(
MagickWand *wand,
85 assert(wand->signature == WandSignature);
86 if (wand->debug != MagickFalse)
87 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
88 if (wand->images == (Image *) NULL)
90 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
91 "ContainsNoImages",
"`%s'",wand->name);
94 return(DeleteImageArtifact(wand->images,artifact));
122WandExport MagickBooleanType MagickDeleteImageProperty(
MagickWand *wand,
123 const char *property)
126 assert(wand->signature == WandSignature);
127 if (wand->debug != MagickFalse)
128 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
129 if (wand->images == (Image *) NULL)
131 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
132 "ContainsNoImages",
"`%s'",wand->name);
135 return(DeleteImageProperty(wand->images,property));
163WandExport MagickBooleanType MagickDeleteOption(
MagickWand *wand,
167 assert(wand->signature == WandSignature);
168 if (wand->debug != MagickFalse)
169 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
170 return(DeleteImageOption(wand->image_info,option));
196WandExport MagickBooleanType MagickGetAntialias(
const MagickWand *wand)
199 assert(wand->signature == WandSignature);
200 if (wand->debug != MagickFalse)
201 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
202 return(wand->image_info->antialias);
233 assert(wand->signature == WandSignature);
234 if (wand->debug != MagickFalse)
235 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
236 background_color=NewPixelWand();
237 PixelSetQuantumColor(background_color,&wand->image_info->background_color);
238 return(background_color);
263WandExport ColorspaceType MagickGetColorspace(
MagickWand *wand)
266 assert(wand->signature == WandSignature);
267 if (wand->debug != MagickFalse)
268 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
269 return(wand->image_info->colorspace);
294WandExport CompressionType MagickGetCompression(
MagickWand *wand)
297 assert(wand->signature == WandSignature);
298 if (wand->debug != MagickFalse)
299 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
300 return(wand->image_info->compression);
325WandExport
size_t MagickGetCompressionQuality(
MagickWand *wand)
328 assert(wand->signature == WandSignature);
329 if (wand->debug != MagickFalse)
330 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
331 return(wand->image_info->quality);
353WandExport
const char *MagickGetCopyright(
void)
355 return(GetMagickCopyright());
380WandExport
char *MagickGetFilename(
const MagickWand *wand)
383 assert(wand->signature == WandSignature);
384 if (wand->debug != MagickFalse)
385 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
386 return(AcquireString(wand->image_info->filename));
411WandExport
char *MagickGetFont(
MagickWand *wand)
414 assert(wand->signature == WandSignature);
415 if (wand->debug != MagickFalse)
416 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
417 if (wand->image_info->font == (
char *) NULL)
418 return((
char *) NULL);
419 return(AcquireString(wand->image_info->font));
444WandExport
char *MagickGetFormat(
MagickWand *wand)
447 assert(wand->signature == WandSignature);
448 if (wand->debug != MagickFalse)
449 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
450 return(AcquireString(wand->image_info->magick));
475WandExport GravityType MagickGetGravity(
MagickWand *wand)
484 assert(wand->signature == WandSignature);
485 if (wand->debug != MagickFalse)
486 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
487 option=GetImageOption(wand->image_info,
"gravity");
488 if (option == (
const char *) NULL)
489 return(UndefinedGravity);
490 type=(GravityType) ParseCommandOption(MagickGravityOptions,MagickFalse,option);
512WandExport
char *MagickGetHomeURL(
void)
514 return(GetMagickHomeURL());
543WandExport
char *MagickGetImageArtifact(
MagickWand *wand,
const char *artifact)
549 assert(wand->signature == WandSignature);
550 if (wand->debug != MagickFalse)
551 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
552 if (wand->images == (Image *) NULL)
554 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
555 "ContainsNoImages",
"`%s'",wand->name);
556 return((
char *) NULL);
558 value=GetImageArtifact(wand->images,artifact);
559 if (value == (
const char *) NULL)
560 return((
char *) NULL);
561 return(ConstantString(value));
594WandExport
char **MagickGetImageArtifacts(
MagickWand *wand,
595 const char *pattern,
size_t *number_artifacts)
610 assert(wand->signature == WandSignature);
611 if (wand->debug != MagickFalse)
612 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
613 if (wand->images == (Image *) NULL)
615 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
616 "ContainsNoImages",
"`%s'",wand->name);
617 return((
char **) NULL);
619 (void) GetImageArtifact(wand->images,
"exif:*");
621 artifacts=(
char **) AcquireQuantumMemory(length,
sizeof(*artifacts));
622 if (artifacts == (
char **) NULL)
623 return((
char **) NULL);
624 ResetImageArtifactIterator(wand->images);
625 artifact=GetNextImageArtifact(wand->images);
626 for (i=0; artifact != (
const char *) NULL; )
628 if ((*artifact !=
'[') &&
629 (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse))
631 if ((i+1) >= (ssize_t) length)
634 artifacts=(
char **) ResizeQuantumMemory(artifacts,length,
636 if (artifacts == (
char **) NULL)
638 (void) ThrowMagickException(wand->exception,GetMagickModule(),
639 ResourceLimitError,
"MemoryAllocationFailed",
"`%s'",
641 return((
char **) NULL);
644 artifacts[i]=ConstantString(artifact);
647 artifact=GetNextImageArtifact(wand->images);
649 artifacts[i]=(
char *) NULL;
650 *number_artifacts=(size_t) i;
681WandExport
unsigned char *MagickGetImageProfile(
MagickWand *wand,
682 const char *name,
size_t *length)
691 assert(wand->signature == WandSignature);
692 if (wand->debug != MagickFalse)
693 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
694 if (wand->images == (Image *) NULL)
696 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
697 "ContainsNoImages",
"`%s'",wand->name);
698 return((
unsigned char *) NULL);
701 if (wand->images->profiles == (SplayTreeInfo *) NULL)
702 return((
unsigned char *) NULL);
703 profile=GetImageProfile(wand->images,name);
704 if (profile == (StringInfo *) NULL)
705 return((
unsigned char *) NULL);
706 datum=(
unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
708 if (datum == (
unsigned char *) NULL)
709 return((
unsigned char *) NULL);
710 (void) memcpy(datum,GetStringInfoDatum(profile),GetStringInfoLength(profile));
711 *length=(size_t) GetStringInfoLength(profile);
745WandExport
char **MagickGetImageProfiles(
MagickWand *wand,
const char *pattern,
746 size_t *number_profiles)
761 assert(wand->signature == WandSignature);
762 if (wand->debug != MagickFalse)
763 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
764 if (wand->images == (Image *) NULL)
766 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
767 "ContainsNoImages",
"`%s'",wand->name);
768 return((
char **) NULL);
770 (void) GetImageProfile(wand->images,
"exif:*");
772 profiles=(
char **) AcquireQuantumMemory(length,
sizeof(*profiles));
773 if (profiles == (
char **) NULL)
774 return((
char **) NULL);
775 ResetImageProfileIterator(wand->images);
776 property=GetNextImageProfile(wand->images);
777 for (i=0;
property != (
const char *) NULL; )
779 if ((*property !=
'[') &&
780 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
782 if ((i+1) >= (ssize_t) length)
785 profiles=(
char **) ResizeQuantumMemory(profiles,length,
787 if (profiles == (
char **) NULL)
789 (void) ThrowMagickException(wand->exception,GetMagickModule(),
790 ResourceLimitError,
"MemoryAllocationFailed",
"`%s'",
792 return((
char **) NULL);
795 profiles[i]=ConstantString(property);
798 property=GetNextImageProfile(wand->images);
800 profiles[i]=(
char *) NULL;
801 *number_profiles=(size_t) i;
831WandExport
char *MagickGetImageProperty(
MagickWand *wand,
const char *property)
837 assert(wand->signature == WandSignature);
838 if (wand->debug != MagickFalse)
839 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
840 if (wand->images == (Image *) NULL)
842 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
843 "ContainsNoImages",
"`%s'",wand->name);
844 return((
char *) NULL);
846 value=GetImageProperty(wand->images,property);
847 if (value == (
const char *) NULL)
848 return((
char *) NULL);
849 return(ConstantString(value));
882WandExport
char **MagickGetImageProperties(
MagickWand *wand,
883 const char *pattern,
size_t *number_properties)
898 assert(wand->signature == WandSignature);
899 if (wand->debug != MagickFalse)
900 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
901 if (wand->images == (Image *) NULL)
903 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
904 "ContainsNoImages",
"`%s'",wand->name);
905 return((
char **) NULL);
907 (void) GetImageProperty(wand->images,
"exif:*");
909 properties=(
char **) AcquireQuantumMemory(length,
sizeof(*properties));
910 if (properties == (
char **) NULL)
911 return((
char **) NULL);
912 ResetImagePropertyIterator(wand->images);
913 property=GetNextImageProperty(wand->images);
914 for (i=0;
property != (
const char *) NULL; )
916 if ((*property !=
'[') &&
917 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
919 if ((i+1) >= (ssize_t) length)
922 properties=(
char **) ResizeQuantumMemory(properties,length,
923 sizeof(*properties));
924 if (properties == (
char **) NULL)
926 (void) ThrowMagickException(wand->exception,GetMagickModule(),
927 ResourceLimitError,
"MemoryAllocationFailed",
"`%s'",
929 return((
char **) NULL);
932 properties[i]=ConstantString(property);
935 property=GetNextImageProperty(wand->images);
937 properties[i]=(
char *) NULL;
938 *number_properties=(size_t) i;
964WandExport InterlaceType MagickGetInterlaceScheme(
MagickWand *wand)
967 assert(wand->signature == WandSignature);
968 if (wand->debug != MagickFalse)
969 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
970 return(wand->image_info->interlace);
995WandExport InterpolatePixelMethod MagickGetInterpolateMethod(
MagickWand *wand)
1000 InterpolatePixelMethod
1004 assert(wand->signature == WandSignature);
1005 if (wand->debug != MagickFalse)
1006 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1007 option=GetImageOption(wand->image_info,
"interpolate");
1008 if (option == (
const char *) NULL)
1009 return(UndefinedInterpolatePixel);
1010 method=(InterpolatePixelMethod) ParseCommandOption(MagickInterpolateOptions,
1011 MagickFalse,option);
1041WandExport
char *MagickGetOption(
MagickWand *wand,
const char *key)
1047 assert(wand->signature == WandSignature);
1048 if (wand->debug != MagickFalse)
1049 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1050 option=GetImageOption(wand->image_info,key);
1051 return(ConstantString(option));
1084WandExport
char **MagickGetOptions(
MagickWand *wand,
const char *pattern,
1085 size_t *number_options)
1100 assert(wand->signature == WandSignature);
1101 if (wand->debug != MagickFalse)
1102 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1103 if (wand->images == (Image *) NULL)
1105 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1106 "ContainsNoImages",
"`%s'",wand->name);
1107 return((
char **) NULL);
1110 options=(
char **) AcquireQuantumMemory(length,
sizeof(*options));
1111 if (options == (
char **) NULL)
1112 return((
char **) NULL);
1113 ResetImageOptionIterator(wand->image_info);
1114 option=GetNextImageOption(wand->image_info);
1115 for (i=0; option != (
const char *) NULL; )
1117 if ((*option !=
'[') &&
1118 (GlobExpression(option,pattern,MagickFalse) != MagickFalse))
1120 if ((i+1) >= (ssize_t) length)
1123 options=(
char **) ResizeQuantumMemory(options,length,
1125 if (options == (
char **) NULL)
1127 (void) ThrowMagickException(wand->exception,GetMagickModule(),
1128 ResourceLimitError,
"MemoryAllocationFailed",
"`%s'",
1130 return((
char **) NULL);
1133 options[i]=ConstantString(option);
1136 option=GetNextImageOption(wand->image_info);
1138 options[i]=(
char *) NULL;
1139 *number_options=(size_t) i;
1165WandExport OrientationType MagickGetOrientation(
MagickWand *wand)
1168 assert(wand->signature == WandSignature);
1169 if (wand->debug != MagickFalse)
1170 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1171 return(wand->image_info->orientation);
1194WandExport
const char *MagickGetPackageName(
void)
1196 return(GetMagickPackageName());
1230WandExport MagickBooleanType MagickGetPage(
const MagickWand *wand,
1231 size_t *width,
size_t *height,ssize_t *x,ssize_t *y)
1237 assert(wand->signature == WandSignature);
1238 if (wand->debug != MagickFalse)
1239 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1240 (void) memset(&geometry,0,
sizeof(geometry));
1241 (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
1242 *width=geometry.width;
1243 *height=geometry.height;
1272WandExport
double MagickGetPointsize(
MagickWand *wand)
1275 assert(wand->signature == WandSignature);
1276 if (wand->debug != MagickFalse)
1277 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1278 return(wand->image_info->pointsize);
1304WandExport
const char *MagickGetQuantumDepth(
size_t *depth)
1306 return(GetMagickQuantumDepth(depth));
1332WandExport
const char *MagickGetQuantumRange(
size_t *range)
1334 return(GetMagickQuantumRange(range));
1356WandExport
const char *MagickGetReleaseDate(
void)
1358 return(GetMagickReleaseDate());
1388WandExport MagickBooleanType MagickGetResolution(
const MagickWand *wand,
1389 double *x,
double *y)
1392 assert(wand->signature == WandSignature);
1393 if (wand->debug != MagickFalse)
1394 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1395 *x=DefaultResolution;
1396 *y=DefaultResolution;
1397 if (wand->image_info->density != (
char *) NULL)
1405 flags=ParseGeometry(wand->image_info->density,&geometry_info);
1406 *x=geometry_info.rho;
1407 *y=geometry_info.sigma;
1408 if ((flags & SigmaValue) == MagickFalse)
1436WandExport MagickSizeType MagickGetResource(
const ResourceType type)
1438 return(GetMagickResource(type));
1463WandExport MagickSizeType MagickGetResourceLimit(
const ResourceType type)
1465 return(GetMagickResourceLimit(type));
1493WandExport
double *MagickGetSamplingFactors(
MagickWand *wand,
1494 size_t *number_factors)
1506 assert(wand->signature == WandSignature);
1507 if (wand->debug != MagickFalse)
1508 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1510 sampling_factors=(
double *) NULL;
1511 if (wand->image_info->sampling_factor == (
char *) NULL)
1512 return(sampling_factors);
1514 for (p=wand->image_info->sampling_factor; p != (
char *) NULL; p=strchr(p,
':'))
1516 while (((
int) *p != 0) && ((isspace((
int) ((
unsigned char) *p)) != 0) ||
1521 sampling_factors=(
double *) AcquireQuantumMemory((
size_t) i+1,
1522 sizeof(*sampling_factors));
1523 if (sampling_factors == (
double *) NULL)
1524 ThrowWandFatalException(ResourceLimitFatalError,
"MemoryAllocationFailed",
1525 wand->image_info->filename);
1527 for (p=wand->image_info->sampling_factor; p != (
char *) NULL; p=strchr(p,
':'))
1529 while (((
int) *p != 0) && ((isspace((
int) ((
unsigned char) *p)) != 0) ||
1532 sampling_factors[i]=StringToDouble(p,(
char **) NULL);
1535 *number_factors=(size_t) i;
1536 return(sampling_factors);
1566WandExport MagickBooleanType MagickGetSize(
const MagickWand *wand,
1567 size_t *columns,
size_t *rows)
1573 assert(wand->signature == WandSignature);
1574 if (wand->debug != MagickFalse)
1575 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1576 (void) memset(&geometry,0,
sizeof(geometry));
1577 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1578 *columns=geometry.width;
1579 *rows=geometry.height;
1609WandExport MagickBooleanType MagickGetSizeOffset(
const MagickWand *wand,
1616 assert(wand->signature == WandSignature);
1617 if (wand->debug != MagickFalse)
1618 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1619 (void) memset(&geometry,0,
sizeof(geometry));
1620 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1647WandExport ImageType MagickGetType(
MagickWand *wand)
1650 assert(wand->signature == WandSignature);
1651 if (wand->debug != MagickFalse)
1652 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1653 return(wand->image_info->type);
1679WandExport
const char *MagickGetVersion(
size_t *version)
1681 return(GetMagickVersion(version));
1716WandExport MagickBooleanType MagickProfileImage(
MagickWand *wand,
1717 const char *name,
const void *profile,
const size_t length)
1723 assert(wand->signature == WandSignature);
1724 if (wand->debug != MagickFalse)
1725 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1726 if (wand->images == (Image *) NULL)
1727 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1728 status=ProfileImage(wand->images,name,profile,length,MagickTrue);
1729 if (status == MagickFalse)
1730 InheritException(wand->exception,&wand->images->exception);
1761WandExport
unsigned char *MagickRemoveImageProfile(
MagickWand *wand,
1762 const char *name,
size_t *length)
1771 assert(wand->signature == WandSignature);
1772 if (wand->debug != MagickFalse)
1773 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1774 if (wand->images == (Image *) NULL)
1776 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1777 "ContainsNoImages",
"`%s'",wand->name);
1778 return((
unsigned char *) NULL);
1781 profile=RemoveImageProfile(wand->images,name);
1782 if (profile == (StringInfo *) NULL)
1783 return((
unsigned char *) NULL);
1784 datum=(
unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
1786 if (datum == (
unsigned char *) NULL)
1787 return((
unsigned char *) NULL);
1788 (void) memcpy(datum,GetStringInfoDatum(profile),
1789 GetStringInfoLength(profile));
1790 *length=GetStringInfoLength(profile);
1791 profile=DestroyStringInfo(profile);
1820WandExport MagickBooleanType MagickSetAntialias(
MagickWand *wand,
1821 const MagickBooleanType antialias)
1824 assert(wand->signature == WandSignature);
1825 if (wand->debug != MagickFalse)
1826 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1827 wand->image_info->antialias=antialias;
1856WandExport MagickBooleanType MagickSetBackgroundColor(
MagickWand *wand,
1860 assert(wand->signature == WandSignature);
1861 if (wand->debug != MagickFalse)
1862 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1863 PixelGetQuantumColor(background,&wand->image_info->background_color);
1892WandExport MagickBooleanType MagickSetColorspace(
MagickWand *wand,
1893 const ColorspaceType colorspace)
1896 assert(wand->signature == WandSignature);
1897 if (wand->debug != MagickFalse)
1898 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1899 wand->image_info->colorspace=colorspace;
1928WandExport MagickBooleanType MagickSetCompression(
MagickWand *wand,
1929 const CompressionType compression)
1932 assert(wand->signature == WandSignature);
1933 if (wand->debug != MagickFalse)
1934 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1935 wand->image_info->compression=compression;
1964WandExport MagickBooleanType MagickSetCompressionQuality(
MagickWand *wand,
1965 const size_t quality)
1968 assert(wand->signature == WandSignature);
1969 if (wand->debug != MagickFalse)
1970 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1971 wand->image_info->quality=quality;
2000WandExport MagickBooleanType MagickSetDepth(
MagickWand *wand,
2004 assert(wand->signature == WandSignature);
2005 if (wand->debug != MagickFalse)
2006 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2007 wand->image_info->depth=depth;
2038WandExport MagickBooleanType MagickSetExtract(
MagickWand *wand,
2039 const char *geometry)
2042 assert(wand->signature == WandSignature);
2043 if (wand->debug != MagickFalse)
2044 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2045 if (wand->image_info->extract != (
char *) NULL)
2046 wand->image_info->extract=DestroyString(wand->image_info->extract);
2047 if (geometry != (
const char *) NULL)
2048 (void) CloneString(&wand->image_info->extract,geometry);
2077WandExport MagickBooleanType MagickSetFilename(
MagickWand *wand,
2078 const char *filename)
2081 assert(wand->signature == WandSignature);
2082 if (wand->debug != MagickFalse)
2083 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2084 if (filename != (
const char *) NULL)
2085 (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent);
2113WandExport MagickBooleanType MagickSetFont(
MagickWand *wand,
const char *font)
2115 if ((font == (
const char *) NULL) || (*font ==
'\0'))
2116 return(MagickFalse);
2118 assert(wand->signature == WandSignature);
2119 if (wand->debug != MagickFalse)
2120 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2121 (void) CloneString(&wand->image_info->font,font);
2149WandExport MagickBooleanType MagickSetFormat(
MagickWand *wand,
2156 assert(wand->signature == WandSignature);
2157 if (wand->debug != MagickFalse)
2158 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2159 if ((format == (
char *) NULL) || (*format ==
'\0'))
2161 *wand->image_info->magick=
'\0';
2164 magick_info=GetMagickInfo(format,wand->exception);
2165 if (magick_info == (
const MagickInfo *) NULL)
2166 return(MagickFalse);
2167 ClearMagickException(wand->exception);
2168 (void) CopyMagickString(wand->image_info->magick,format,MaxTextExtent);
2197WandExport MagickBooleanType MagickSetGravity(
MagickWand *wand,
2198 const GravityType type)
2204 assert(wand->signature == WandSignature);
2205 if (wand->debug != MagickFalse)
2206 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2207 status=SetImageOption(wand->image_info,
"gravity",CommandOptionToMnemonic(
2208 MagickGravityOptions,(ssize_t) type));
2243WandExport MagickBooleanType MagickSetImageArtifact(
MagickWand *wand,
2244 const char *artifact,
const char *value)
2250 assert(wand->signature == WandSignature);
2251 if (wand->debug != MagickFalse)
2252 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2253 if (wand->images == (Image *) NULL)
2254 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2255 status=SetImageArtifact(wand->images,artifact,value);
2256 if (status == MagickFalse)
2257 InheritException(wand->exception,&wand->images->exception);
2293WandExport MagickBooleanType MagickSetImageProfile(
MagickWand *wand,
2294 const char *name,
const void *profile,
const size_t length)
2303 assert(wand->signature == WandSignature);
2304 if (wand->debug != MagickFalse)
2305 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2306 if (wand->images == (Image *) NULL)
2307 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2308 profile_info=AcquireStringInfo((
size_t) length);
2309 SetStringInfoDatum(profile_info,(
const unsigned char *) profile);
2310 status=SetImageProfile(wand->images,name,profile_info);
2311 profile_info=DestroyStringInfo(profile_info);
2312 if (status == MagickFalse)
2313 InheritException(wand->exception,&wand->images->exception);
2344WandExport MagickBooleanType MagickSetImageProperty(
MagickWand *wand,
2345 const char *property,
const char *value)
2351 assert(wand->signature == WandSignature);
2352 if (wand->debug != MagickFalse)
2353 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2354 if (wand->images == (Image *) NULL)
2355 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2356 status=SetImageProperty(wand->images,property,value);
2357 if (status == MagickFalse)
2358 InheritException(wand->exception,&wand->images->exception);
2388WandExport MagickBooleanType MagickSetInterlaceScheme(
MagickWand *wand,
2389 const InterlaceType interlace_scheme)
2392 assert(wand->signature == WandSignature);
2393 if (wand->debug != MagickFalse)
2394 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2395 wand->image_info->interlace=interlace_scheme;
2424WandExport MagickBooleanType MagickSetInterpolateMethod(
MagickWand *wand,
2425 const InterpolatePixelMethod method)
2431 assert(wand->signature == WandSignature);
2432 if (wand->debug != MagickFalse)
2433 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2434 status=SetImageOption(wand->image_info,
"interpolate",
2435 CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
2467WandExport MagickBooleanType MagickSetOption(
MagickWand *wand,
const char *key,
2471 assert(wand->signature == WandSignature);
2472 if (wand->debug != MagickFalse)
2473 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2474 return(SetImageOption(wand->image_info,key,value));
2502WandExport MagickBooleanType MagickSetOrientation(
MagickWand *wand,
2503 const OrientationType orientation)
2506 assert(wand->signature == WandSignature);
2507 if (wand->debug != MagickFalse)
2508 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2509 wand->image_info->orientation=orientation;
2545WandExport MagickBooleanType MagickSetPage(
MagickWand *wand,
2546 const size_t width,
const size_t height,
const ssize_t x,
2550 geometry[MaxTextExtent];
2553 assert(wand->signature == WandSignature);
2554 if (wand->debug != MagickFalse)
2555 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2556 (void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",
2557 (
double) width,(
double) height,(
double) x,(
double) y);
2558 (void) CloneString(&wand->image_info->page,geometry);
2587WandExport MagickBooleanType MagickSetPassphrase(
MagickWand *wand,
2588 const char *passphrase)
2591 assert(wand->signature == WandSignature);
2592 if (wand->debug != MagickFalse)
2593 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2594 (void) CloneString(&wand->image_info->authenticate,passphrase);
2623WandExport MagickBooleanType MagickSetPointsize(
MagickWand *wand,
2624 const double pointsize)
2627 assert(wand->signature == WandSignature);
2628 if (wand->debug != MagickFalse)
2629 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2630 wand->image_info->pointsize=pointsize;
2671WandExport MagickProgressMonitor MagickSetProgressMonitor(
MagickWand *wand,
2672 const MagickProgressMonitor progress_monitor,
void *client_data)
2674 MagickProgressMonitor
2678 assert(wand->signature == WandSignature);
2679 if (wand->debug != MagickFalse)
2680 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2681 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
2682 progress_monitor,client_data);
2683 return(previous_monitor);
2713WandExport MagickBooleanType MagickSetResourceLimit(
const ResourceType type,
2714 const MagickSizeType limit)
2716 return(SetMagickResourceLimit(type,limit));
2746WandExport MagickBooleanType MagickSetResolution(
MagickWand *wand,
2747 const double x_resolution,
const double y_resolution)
2750 density[MaxTextExtent];
2753 assert(wand->signature == WandSignature);
2754 if (wand->debug != MagickFalse)
2755 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2756 (void) FormatLocaleString(density,MaxTextExtent,
"%gx%g",x_resolution,
2758 (void) CloneString(&wand->image_info->density,density);
2790WandExport MagickBooleanType MagickSetSamplingFactors(
MagickWand *wand,
2791 const size_t number_factors,
const double *sampling_factors)
2794 sampling_factor[MaxTextExtent];
2800 assert(wand->signature == WandSignature);
2801 if (wand->debug != MagickFalse)
2802 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2803 if (wand->image_info->sampling_factor != (
char *) NULL)
2804 wand->image_info->sampling_factor=(
char *)
2805 RelinquishMagickMemory(wand->image_info->sampling_factor);
2806 if (number_factors == 0)
2808 for (i=0; i < (ssize_t) (number_factors-1); i++)
2810 (void) FormatLocaleString(sampling_factor,MaxTextExtent,
"%g:",
2811 sampling_factors[i]);
2812 (void) ConcatenateString(&wand->image_info->sampling_factor,
2815 (void) FormatLocaleString(sampling_factor,MaxTextExtent,
"%g",
2816 sampling_factors[i]);
2817 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
2847WandExport MagickBooleanType MagickSetSecurityPolicy(
MagickWand *wand,
2851 assert(wand->signature == WandSignature);
2852 if (wand->debug != MagickFalse)
2853 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2855 return(SetMagickSecurityPolicy(policy,wand->exception));
2886WandExport MagickBooleanType MagickSetSize(
MagickWand *wand,
2887 const size_t columns,
const size_t rows)
2890 geometry[MaxTextExtent];
2893 assert(wand->signature == WandSignature);
2894 if (wand->debug != MagickFalse)
2895 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2896 (void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g",(
double)
2897 columns,(
double) rows);
2898 (void) CloneString(&wand->image_info->size,geometry);
2933WandExport MagickBooleanType MagickSetSizeOffset(
MagickWand *wand,
2934 const size_t columns,
const size_t rows,
const ssize_t offset)
2937 geometry[MaxTextExtent];
2940 assert(wand->signature == WandSignature);
2941 if (wand->debug != MagickFalse)
2942 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2943 (void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g",
2944 (
double) columns,(
double) rows,(
double) offset);
2945 (void) CloneString(&wand->image_info->size,geometry);
2977WandExport MagickBooleanType MagickSetType(
MagickWand *wand,
2978 const ImageType image_type)
2981 assert(wand->signature == WandSignature);
2982 if (wand->debug != MagickFalse)
2983 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2984 wand->image_info->type=image_type;