49#include "MagickWand/studio.h"
50#include "MagickWand/MagickWand.h"
51#include "MagickWand/magick-wand-private.h"
52#include "MagickWand/wand.h"
53#include "MagickCore/image-private.h"
54#include "MagickCore/profile-private.h"
55#include "MagickCore/string-private.h"
82WandExport MagickBooleanType MagickDeleteImageArtifact(
MagickWand *wand,
86 assert(wand->signature == MagickWandSignature);
87 if (wand->debug != MagickFalse)
88 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
89 if (wand->images == (Image *) NULL)
91 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
92 "ContainsNoImages",
"`%s'",wand->name);
95 return(DeleteImageArtifact(wand->images,artifact));
123WandExport MagickBooleanType MagickDeleteImageProperty(
MagickWand *wand,
124 const char *property)
127 assert(wand->signature == MagickWandSignature);
128 if (wand->debug != MagickFalse)
129 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
130 if (wand->images == (Image *) NULL)
132 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
133 "ContainsNoImages",
"`%s'",wand->name);
136 return(DeleteImageProperty(wand->images,property));
164WandExport MagickBooleanType MagickDeleteOption(
MagickWand *wand,
168 assert(wand->signature == MagickWandSignature);
169 if (wand->debug != MagickFalse)
170 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
171 return(DeleteImageOption(wand->image_info,option));
197WandExport MagickBooleanType MagickGetAntialias(
const MagickWand *wand)
200 assert(wand->signature == MagickWandSignature);
201 if (wand->debug != MagickFalse)
202 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
203 return(wand->image_info->antialias);
234 assert(wand->signature == MagickWandSignature);
235 if (wand->debug != MagickFalse)
236 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
237 background_color=NewPixelWand();
238 PixelSetPixelColor(background_color,&wand->image_info->background_color);
239 return(background_color);
264WandExport ColorspaceType MagickGetColorspace(
MagickWand *wand)
267 assert(wand->signature == MagickWandSignature);
268 if (wand->debug != MagickFalse)
269 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
270 return(wand->image_info->colorspace);
295WandExport CompressionType MagickGetCompression(
MagickWand *wand)
298 assert(wand->signature == MagickWandSignature);
299 if (wand->debug != MagickFalse)
300 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
301 return(wand->image_info->compression);
326WandExport
size_t MagickGetCompressionQuality(
MagickWand *wand)
329 assert(wand->signature == MagickWandSignature);
330 if (wand->debug != MagickFalse)
331 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
332 return(wand->image_info->quality);
354WandExport
const char *MagickGetCopyright(
void)
356 return(GetMagickCopyright());
381WandExport
char *MagickGetFilename(
const MagickWand *wand)
384 assert(wand->signature == MagickWandSignature);
385 if (wand->debug != MagickFalse)
386 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
387 return(AcquireString(wand->image_info->filename));
412WandExport
char *MagickGetFont(
MagickWand *wand)
415 assert(wand->signature == MagickWandSignature);
416 if (wand->debug != MagickFalse)
417 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
418 if (wand->image_info->font == (
char *) NULL)
419 return((
char *) NULL);
420 return(AcquireString(wand->image_info->font));
445WandExport
char *MagickGetFormat(
MagickWand *wand)
448 assert(wand->signature == MagickWandSignature);
449 if (wand->debug != MagickFalse)
450 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
451 return(AcquireString(wand->image_info->magick));
476WandExport FilterType MagickGetFilter(
MagickWand *wand)
485 assert(wand->signature == MagickWandSignature);
486 if (wand->debug != MagickFalse)
487 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
488 option=GetImageOption(wand->image_info,
"filter");
489 if (option == (
const char *) NULL)
490 return(UndefinedFilter);
491 type=(FilterType) ParseCommandOption(MagickFilterOptions,MagickFalse,option);
517WandExport GravityType MagickGetGravity(
MagickWand *wand)
526 assert(wand->signature == MagickWandSignature);
527 if (wand->debug != MagickFalse)
528 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
529 option=GetImageOption(wand->image_info,
"gravity");
530 if (option == (
const char *) NULL)
531 return(UndefinedGravity);
532 type=(GravityType) ParseCommandOption(MagickGravityOptions,MagickFalse,
555WandExport
char *MagickGetHomeURL(
void)
557 return(GetMagickHomeURL());
586WandExport
char *MagickGetImageArtifact(
MagickWand *wand,
const char *artifact)
592 assert(wand->signature == MagickWandSignature);
593 if (wand->debug != MagickFalse)
594 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
595 if (wand->images == (Image *) NULL)
597 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
598 "ContainsNoImages",
"`%s'",wand->name);
599 return((
char *) NULL);
601 value=GetImageArtifact(wand->images,artifact);
602 if (value == (
const char *) NULL)
603 return((
char *) NULL);
604 return(ConstantString(value));
637WandExport
char **MagickGetImageArtifacts(
MagickWand *wand,
638 const char *pattern,
size_t *number_artifacts)
653 assert(wand->signature == MagickWandSignature);
654 if (wand->debug != MagickFalse)
655 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
656 if (wand->images == (Image *) NULL)
658 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
659 "ContainsNoImages",
"`%s'",wand->name);
660 return((
char **) NULL);
662 (void) GetImageArtifact(wand->images,
"exif:*");
664 artifacts=(
char **) AcquireQuantumMemory(length,
sizeof(*artifacts));
665 if (artifacts == (
char **) NULL)
666 return((
char **) NULL);
667 ResetImageArtifactIterator(wand->images);
668 artifact=GetNextImageArtifact(wand->images);
669 for (i=0; artifact != (
const char *) NULL; )
671 if ((*artifact !=
'[') &&
672 (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse))
674 if ((i+1) >= (ssize_t) length)
677 artifacts=(
char **) ResizeQuantumMemory(artifacts,length,
679 if (artifacts == (
char **) NULL)
681 (void) ThrowMagickException(wand->exception,GetMagickModule(),
682 ResourceLimitError,
"MemoryAllocationFailed",
"`%s'",
684 return((
char **) NULL);
687 artifacts[i]=ConstantString(artifact);
690 artifact=GetNextImageArtifact(wand->images);
692 artifacts[i]=(
char *) NULL;
693 *number_artifacts=(size_t) i;
724WandExport
unsigned char *MagickGetImageProfile(
MagickWand *wand,
725 const char *name,
size_t *length)
734 assert(wand->signature == MagickWandSignature);
735 if (wand->debug != MagickFalse)
736 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
737 if (wand->images == (Image *) NULL)
739 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
740 "ContainsNoImages",
"`%s'",wand->name);
741 return((
unsigned char *) NULL);
744 if (wand->images->profiles == (SplayTreeInfo *) NULL)
745 return((
unsigned char *) NULL);
746 profile=GetImageProfile(wand->images,name);
747 if (profile == (StringInfo *) NULL)
748 return((
unsigned char *) NULL);
749 datum=(
unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
751 if (datum == (
unsigned char *) NULL)
752 return((
unsigned char *) NULL);
753 (void) memcpy(datum,GetStringInfoDatum(profile),GetStringInfoLength(profile));
754 *length=(size_t) GetStringInfoLength(profile);
788WandExport
char **MagickGetImageProfiles(
MagickWand *wand,
const char *pattern,
789 size_t *number_profiles)
804 assert(wand->signature == MagickWandSignature);
805 if (wand->debug != MagickFalse)
806 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
807 if (wand->images == (Image *) NULL)
809 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
810 "ContainsNoImages",
"`%s'",wand->name);
811 return((
char **) NULL);
813 (void) GetImageProfile(wand->images,
"exif:*");
815 profiles=(
char **) AcquireQuantumMemory(length,
sizeof(*profiles));
816 if (profiles == (
char **) NULL)
817 return((
char **) NULL);
818 ResetImageProfileIterator(wand->images);
819 property=GetNextImageProfile(wand->images);
820 for (i=0;
property != (
const char *) NULL; )
822 if ((*property !=
'[') &&
823 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
825 if ((i+1) >= (ssize_t) length)
828 profiles=(
char **) ResizeQuantumMemory(profiles,length,
830 if (profiles == (
char **) NULL)
832 (void) ThrowMagickException(wand->exception,GetMagickModule(),
833 ResourceLimitError,
"MemoryAllocationFailed",
"`%s'",
835 return((
char **) NULL);
838 profiles[i]=ConstantString(property);
841 property=GetNextImageProfile(wand->images);
843 profiles[i]=(
char *) NULL;
844 *number_profiles=(size_t) i;
874WandExport
char *MagickGetImageProperty(
MagickWand *wand,
const char *property)
880 assert(wand->signature == MagickWandSignature);
881 if (wand->debug != MagickFalse)
882 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
883 if (wand->images == (Image *) NULL)
885 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
886 "ContainsNoImages",
"`%s'",wand->name);
887 return((
char *) NULL);
889 value=GetImageProperty(wand->images,property,wand->exception);
890 if (value == (
const char *) NULL)
891 return((
char *) NULL);
892 return(ConstantString(value));
925WandExport
char **MagickGetImageProperties(
MagickWand *wand,
926 const char *pattern,
size_t *number_properties)
941 assert(wand->signature == MagickWandSignature);
942 if (wand->debug != MagickFalse)
943 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
944 if (wand->images == (Image *) NULL)
946 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
947 "ContainsNoImages",
"`%s'",wand->name);
948 return((
char **) NULL);
950 (void) GetImageProperty(wand->images,
"exif:*",wand->exception);
952 properties=(
char **) AcquireQuantumMemory(length,
sizeof(*properties));
953 if (properties == (
char **) NULL)
954 return((
char **) NULL);
955 ResetImagePropertyIterator(wand->images);
956 property=GetNextImageProperty(wand->images);
957 for (i=0;
property != (
const char *) NULL; )
959 if ((*property !=
'[') &&
960 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
962 if ((i+1) >= (ssize_t) length)
965 properties=(
char **) ResizeQuantumMemory(properties,length,
966 sizeof(*properties));
967 if (properties == (
char **) NULL)
969 (void) ThrowMagickException(wand->exception,GetMagickModule(),
970 ResourceLimitError,
"MemoryAllocationFailed",
"`%s'",
972 return((
char **) NULL);
975 properties[i]=ConstantString(property);
978 property=GetNextImageProperty(wand->images);
980 properties[i]=(
char *) NULL;
981 *number_properties=(size_t) i;
1007WandExport InterlaceType MagickGetInterlaceScheme(
MagickWand *wand)
1010 assert(wand->signature == MagickWandSignature);
1011 if (wand->debug != MagickFalse)
1012 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1013 return(wand->image_info->interlace);
1038WandExport PixelInterpolateMethod MagickGetInterpolateMethod(
MagickWand *wand)
1043 PixelInterpolateMethod
1047 assert(wand->signature == MagickWandSignature);
1048 if (wand->debug != MagickFalse)
1049 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1050 option=GetImageOption(wand->image_info,
"interpolate");
1051 if (option == (
const char *) NULL)
1052 return(UndefinedInterpolatePixel);
1053 method=(PixelInterpolateMethod) ParseCommandOption(MagickInterpolateOptions,
1054 MagickFalse,option);
1084WandExport
char *MagickGetOption(
MagickWand *wand,
const char *key)
1090 assert(wand->signature == MagickWandSignature);
1091 if (wand->debug != MagickFalse)
1092 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1093 option=GetImageOption(wand->image_info,key);
1094 return(ConstantString(option));
1127WandExport
char **MagickGetOptions(
MagickWand *wand,
const char *pattern,
1128 size_t *number_options)
1143 assert(wand->signature == MagickWandSignature);
1144 if (wand->debug != MagickFalse)
1145 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1146 if (wand->images == (Image *) NULL)
1148 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1149 "ContainsNoImages",
"`%s'",wand->name);
1150 return((
char **) NULL);
1153 options=(
char **) AcquireQuantumMemory(length,
sizeof(*options));
1154 if (options == (
char **) NULL)
1155 return((
char **) NULL);
1156 ResetImageOptionIterator(wand->image_info);
1157 option=GetNextImageOption(wand->image_info);
1158 for (i=0; option != (
const char *) NULL; )
1160 if ((*option !=
'[') &&
1161 (GlobExpression(option,pattern,MagickFalse) != MagickFalse))
1163 if ((i+1) >= (ssize_t) length)
1166 options=(
char **) ResizeQuantumMemory(options,length,
1168 if (options == (
char **) NULL)
1170 (void) ThrowMagickException(wand->exception,GetMagickModule(),
1171 ResourceLimitError,
"MemoryAllocationFailed",
"`%s'",
1173 return((
char **) NULL);
1176 options[i]=ConstantString(option);
1179 option=GetNextImageOption(wand->image_info);
1181 options[i]=(
char *) NULL;
1182 *number_options=(size_t) i;
1208WandExport OrientationType MagickGetOrientation(
MagickWand *wand)
1211 assert(wand->signature == MagickWandSignature);
1212 if (wand->debug != MagickFalse)
1213 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1214 return(wand->image_info->orientation);
1237WandExport
const char *MagickGetPackageName(
void)
1239 return(GetMagickPackageName());
1273WandExport MagickBooleanType MagickGetPage(
const MagickWand *wand,
1274 size_t *width,
size_t *height,ssize_t *x,ssize_t *y)
1280 assert(wand->signature == MagickWandSignature);
1281 if (wand->debug != MagickFalse)
1282 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1283 (void) memset(&geometry,0,
sizeof(geometry));
1284 (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
1285 *width=geometry.width;
1286 *height=geometry.height;
1315WandExport
double MagickGetPointsize(
MagickWand *wand)
1318 assert(wand->signature == MagickWandSignature);
1319 if (wand->debug != MagickFalse)
1320 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1321 return(wand->image_info->pointsize);
1347WandExport
const char *MagickGetQuantumDepth(
size_t *depth)
1349 return(GetMagickQuantumDepth(depth));
1375WandExport
const char *MagickGetQuantumRange(
size_t *range)
1377 return(GetMagickQuantumRange(range));
1399WandExport
const char *MagickGetReleaseDate(
void)
1401 return(GetMagickReleaseDate());
1431WandExport MagickBooleanType MagickGetResolution(
const MagickWand *wand,
1432 double *x,
double *y)
1435 assert(wand->signature == MagickWandSignature);
1436 if (wand->debug != MagickFalse)
1437 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1438 *x=DefaultResolution;
1439 *y=DefaultResolution;
1440 if (wand->image_info->density != (
char *) NULL)
1448 flags=ParseGeometry(wand->image_info->density,&geometry_info);
1449 *x=geometry_info.rho;
1450 *y=geometry_info.sigma;
1451 if ((flags & SigmaValue) == 0)
1479WandExport MagickSizeType MagickGetResource(
const ResourceType type)
1481 return(GetMagickResource(type));
1506WandExport MagickSizeType MagickGetResourceLimit(
const ResourceType type)
1508 return(GetMagickResourceLimit(type));
1536WandExport
double *MagickGetSamplingFactors(
MagickWand *wand,
1537 size_t *number_factors)
1549 assert(wand->signature == MagickWandSignature);
1550 if (wand->debug != MagickFalse)
1551 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1553 sampling_factors=(
double *) NULL;
1554 if (wand->image_info->sampling_factor == (
char *) NULL)
1555 return(sampling_factors);
1557 for (p=wand->image_info->sampling_factor; p != (
char *) NULL; p=strchr(p,
':'))
1559 while (((
int) *p != 0) && ((isspace((
int) ((
unsigned char) *p)) != 0) ||
1564 sampling_factors=(
double *) AcquireQuantumMemory((
size_t) i+1,
1565 sizeof(*sampling_factors));
1566 if (sampling_factors == (
double *) NULL)
1567 ThrowWandFatalException(ResourceLimitFatalError,
"MemoryAllocationFailed",
1568 wand->image_info->filename);
1570 for (p=wand->image_info->sampling_factor; p != (
char *) NULL; p=strchr(p,
':'))
1572 while (((
int) *p != 0) && ((isspace((
int) ((
unsigned char) *p)) != 0) ||
1575 sampling_factors[i]=StringToDouble(p,(
char **) NULL);
1578 *number_factors=(size_t) i;
1579 return(sampling_factors);
1609WandExport MagickBooleanType MagickGetSize(
const MagickWand *wand,
1610 size_t *columns,
size_t *rows)
1616 assert(wand->signature == MagickWandSignature);
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);
1621 *columns=geometry.width;
1622 *rows=geometry.height;
1652WandExport MagickBooleanType MagickGetSizeOffset(
const MagickWand *wand,
1659 assert(wand->signature == MagickWandSignature);
1660 if (wand->debug != MagickFalse)
1661 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1662 (void) memset(&geometry,0,
sizeof(geometry));
1663 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
1690WandExport ImageType MagickGetType(
MagickWand *wand)
1693 assert(wand->signature == MagickWandSignature);
1694 if (wand->debug != MagickFalse)
1695 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1696 return(wand->image_info->type);
1722WandExport
const char *MagickGetVersion(
size_t *version)
1724 return(GetMagickVersion(version));
1759WandExport MagickBooleanType MagickProfileImage(
MagickWand *wand,
1760 const char *name,
const void *profile,
const size_t length)
1763 assert(wand->signature == MagickWandSignature);
1764 if (wand->debug != MagickFalse)
1765 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1766 if (wand->images == (Image *) NULL)
1767 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
1768 return(ProfileImage(wand->images,name,profile,length,wand->exception));
1798WandExport
unsigned char *MagickRemoveImageProfile(
MagickWand *wand,
1799 const char *name,
size_t *length)
1808 assert(wand->signature == MagickWandSignature);
1809 if (wand->debug != MagickFalse)
1810 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1811 if (wand->images == (Image *) NULL)
1813 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
1814 "ContainsNoImages",
"`%s'",wand->name);
1815 return((
unsigned char *) NULL);
1818 profile=RemoveImageProfile(wand->images,name);
1819 if (profile == (StringInfo *) NULL)
1820 return((
unsigned char *) NULL);
1821 datum=(
unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
1823 if (datum == (
unsigned char *) NULL)
1824 return((
unsigned char *) NULL);
1825 (void) memcpy(datum,GetStringInfoDatum(profile),
1826 GetStringInfoLength(profile));
1827 *length=GetStringInfoLength(profile);
1828 profile=DestroyStringInfo(profile);
1857WandExport MagickBooleanType MagickSetAntialias(
MagickWand *wand,
1858 const MagickBooleanType antialias)
1861 assert(wand->signature == MagickWandSignature);
1862 if (wand->debug != MagickFalse)
1863 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1864 wand->image_info->antialias=antialias;
1893WandExport MagickBooleanType MagickSetBackgroundColor(
MagickWand *wand,
1897 assert(wand->signature == MagickWandSignature);
1898 if (wand->debug != MagickFalse)
1899 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1900 PixelGetQuantumPacket(background,&wand->image_info->background_color);
1929WandExport MagickBooleanType MagickSetColorspace(
MagickWand *wand,
1930 const ColorspaceType colorspace)
1933 assert(wand->signature == MagickWandSignature);
1934 if (wand->debug != MagickFalse)
1935 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1936 wand->image_info->colorspace=colorspace;
1965WandExport MagickBooleanType MagickSetCompression(
MagickWand *wand,
1966 const CompressionType compression)
1969 assert(wand->signature == MagickWandSignature);
1970 if (wand->debug != MagickFalse)
1971 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1972 wand->image_info->compression=compression;
2001WandExport MagickBooleanType MagickSetCompressionQuality(
MagickWand *wand,
2002 const size_t quality)
2005 assert(wand->signature == MagickWandSignature);
2006 if (wand->debug != MagickFalse)
2007 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2008 wand->image_info->quality=quality;
2037WandExport MagickBooleanType MagickSetDepth(
MagickWand *wand,
const size_t depth)
2040 assert(wand->signature == MagickWandSignature);
2041 if (wand->debug != MagickFalse)
2042 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2043 wand->image_info->depth=depth;
2074WandExport MagickBooleanType MagickSetExtract(
MagickWand *wand,
2075 const char *geometry)
2078 assert(wand->signature == MagickWandSignature);
2079 if (wand->debug != MagickFalse)
2080 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2081 if (wand->image_info->extract != (
char *) NULL)
2082 wand->image_info->extract=DestroyString(wand->image_info->extract);
2083 if (geometry != (
const char *) NULL)
2084 (void) CloneString(&wand->image_info->extract,geometry);
2113WandExport MagickBooleanType MagickSetFilename(
MagickWand *wand,
2114 const char *filename)
2117 assert(wand->signature == MagickWandSignature);
2118 if (wand->debug != MagickFalse)
2119 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2120 if (filename != (
const char *) NULL)
2121 (void) CopyMagickString(wand->image_info->filename,filename,
2150WandExport MagickBooleanType MagickSetFont(
MagickWand *wand,
const char *font)
2152 if ((font == (
const char *) NULL) || (*font ==
'\0'))
2153 return(MagickFalse);
2155 assert(wand->signature == MagickWandSignature);
2156 if (wand->debug != MagickFalse)
2157 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2158 (void) CloneString(&wand->image_info->font,font);
2186WandExport MagickBooleanType MagickSetFormat(
MagickWand *wand,
2193 assert(wand->signature == MagickWandSignature);
2194 if (wand->debug != MagickFalse)
2195 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2197 if ((format == (
char *) NULL) || (*format ==
'\0'))
2199 *wand->image_info->magick=
'\0';
2202 magick_info=GetMagickInfo(format,wand->exception);
2203 if (magick_info == (
const MagickInfo *) NULL)
2204 return(MagickFalse);
2205 ClearMagickException(wand->exception);
2206 (void) CopyMagickString(wand->image_info->magick,format,MagickPathExtent);
2235WandExport MagickBooleanType MagickSetFilter(
MagickWand *wand,
2236 const FilterType type)
2242 assert(wand->signature == MagickWandSignature);
2243 if (wand->debug != MagickFalse)
2244 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2245 status=SetImageOption(wand->image_info,
"filter",CommandOptionToMnemonic(
2246 MagickFilterOptions,(ssize_t) type));
2275WandExport MagickBooleanType MagickSetGravity(
MagickWand *wand,
2276 const GravityType type)
2282 assert(wand->signature == MagickWandSignature);
2283 if (wand->debug != MagickFalse)
2284 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2285 status=SetImageOption(wand->image_info,
"gravity",CommandOptionToMnemonic(
2286 MagickGravityOptions,(ssize_t) type));
2321WandExport MagickBooleanType MagickSetImageArtifact(
MagickWand *wand,
2322 const char *artifact,
const char *value)
2325 assert(wand->signature == MagickWandSignature);
2326 if (wand->debug != MagickFalse)
2327 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2328 if (wand->images == (Image *) NULL)
2329 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2330 return(SetImageArtifact(wand->images,artifact,value));
2365WandExport MagickBooleanType MagickSetImageProfile(
MagickWand *wand,
2366 const char *name,
const void *profile,
const size_t length)
2375 assert(wand->signature == MagickWandSignature);
2376 if (wand->debug != MagickFalse)
2377 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2378 if (wand->images == (Image *) NULL)
2379 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2380 profile_info=BlobToProfileStringInfo(name,profile,length,wand->exception);
2381 status=SetImageProfilePrivate(wand->images,profile_info,wand->exception);
2412WandExport MagickBooleanType MagickSetImageProperty(
MagickWand *wand,
2413 const char *property,
const char *value)
2419 assert(wand->signature == MagickWandSignature);
2420 if (wand->debug != MagickFalse)
2421 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2422 if (wand->images == (Image *) NULL)
2423 ThrowWandException(WandError,
"ContainsNoImages",wand->name);
2424 status=SetImageProperty(wand->images,property,value,wand->exception);
2454WandExport MagickBooleanType MagickSetInterlaceScheme(
MagickWand *wand,
2455 const InterlaceType interlace_scheme)
2458 assert(wand->signature == MagickWandSignature);
2459 if (wand->debug != MagickFalse)
2460 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2461 wand->image_info->interlace=interlace_scheme;
2490WandExport MagickBooleanType MagickSetInterpolateMethod(
MagickWand *wand,
2491 const PixelInterpolateMethod method)
2497 assert(wand->signature == MagickWandSignature);
2498 if (wand->debug != MagickFalse)
2499 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2500 status=SetImageOption(wand->image_info,
"interpolate",
2501 CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
2533WandExport MagickBooleanType MagickSetOption(
MagickWand *wand,
const char *key,
2537 assert(wand->signature == MagickWandSignature);
2538 if (wand->debug != MagickFalse)
2539 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2540 return(SetImageOption(wand->image_info,key,value));
2568WandExport MagickBooleanType MagickSetOrientation(
MagickWand *wand,
2569 const OrientationType orientation)
2572 assert(wand->signature == MagickWandSignature);
2573 if (wand->debug != MagickFalse)
2574 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2575 wand->image_info->orientation=orientation;
2611WandExport MagickBooleanType MagickSetPage(
MagickWand *wand,
2612 const size_t width,
const size_t height,
const ssize_t x,
2616 geometry[MagickPathExtent];
2619 assert(wand->signature == MagickWandSignature);
2620 if (wand->debug != MagickFalse)
2621 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2622 (void) FormatLocaleString(geometry,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",
2623 (
double) width,(
double) height,(
double) x,(
double) y);
2624 (void) CloneString(&wand->image_info->page,geometry);
2653WandExport MagickBooleanType MagickSetPassphrase(
MagickWand *wand,
2654 const char *passphrase)
2657 assert(wand->signature == MagickWandSignature);
2658 if (wand->debug != MagickFalse)
2659 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2660 (void) SetImageOption(wand->image_info,
"authenticate",passphrase);
2689WandExport MagickBooleanType MagickSetPointsize(
MagickWand *wand,
2690 const double pointsize)
2693 assert(wand->signature == MagickWandSignature);
2694 if (wand->debug != MagickFalse)
2695 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2696 wand->image_info->pointsize=pointsize;
2737WandExport MagickProgressMonitor MagickSetProgressMonitor(
MagickWand *wand,
2738 const MagickProgressMonitor progress_monitor,
void *client_data)
2740 MagickProgressMonitor
2744 assert(wand->signature == MagickWandSignature);
2745 if (wand->debug != MagickFalse)
2746 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2747 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
2748 progress_monitor,client_data);
2749 return(previous_monitor);
2779WandExport MagickBooleanType MagickSetResourceLimit(
const ResourceType type,
2780 const MagickSizeType limit)
2782 return(SetMagickResourceLimit(type,limit));
2812WandExport MagickBooleanType MagickSetResolution(
MagickWand *wand,
2813 const double x_resolution,
const double y_resolution)
2816 density[MagickPathExtent];
2819 assert(wand->signature == MagickWandSignature);
2820 if (wand->debug != MagickFalse)
2821 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2822 (void) FormatLocaleString(density,MagickPathExtent,
"%gx%g",x_resolution,
2824 (void) CloneString(&wand->image_info->density,density);
2856WandExport MagickBooleanType MagickSetSamplingFactors(
MagickWand *wand,
2857 const size_t number_factors,
const double *sampling_factors)
2860 sampling_factor[MagickPathExtent];
2866 assert(wand->signature == MagickWandSignature);
2867 if (wand->debug != MagickFalse)
2868 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2869 if (wand->image_info->sampling_factor != (
char *) NULL)
2870 wand->image_info->sampling_factor=(
char *)
2871 RelinquishMagickMemory(wand->image_info->sampling_factor);
2872 if (number_factors == 0)
2874 for (i=0; i < (ssize_t) (number_factors-1); i++)
2876 (void) FormatLocaleString(sampling_factor,MagickPathExtent,
"%g:",
2877 sampling_factors[i]);
2878 (void) ConcatenateString(&wand->image_info->sampling_factor,
2881 (void) FormatLocaleString(sampling_factor,MagickPathExtent,
"%g",
2882 sampling_factors[i]);
2883 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
2910WandExport
void MagickSetSeed(
const unsigned long seed)
2912 SetRandomSecretKey(seed);
2941WandExport MagickBooleanType MagickSetSecurityPolicy(
MagickWand *wand,
2945 assert(wand->signature == MagickWandSignature);
2946 if (wand->debug != MagickFalse)
2947 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2948 return(SetMagickSecurityPolicy(policy,wand->exception));
2979WandExport MagickBooleanType MagickSetSize(
MagickWand *wand,
2980 const size_t columns,
const size_t rows)
2983 geometry[MagickPathExtent];
2986 assert(wand->signature == MagickWandSignature);
2987 if (wand->debug != MagickFalse)
2988 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2989 (void) FormatLocaleString(geometry,MagickPathExtent,
"%.20gx%.20g",(
double)
2990 columns,(
double) rows);
2991 (void) CloneString(&wand->image_info->size,geometry);
3026WandExport MagickBooleanType MagickSetSizeOffset(
MagickWand *wand,
3027 const size_t columns,
const size_t rows,
const ssize_t offset)
3030 geometry[MagickPathExtent];
3033 assert(wand->signature == MagickWandSignature);
3034 if (wand->debug != MagickFalse)
3035 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3036 (void) FormatLocaleString(geometry,MagickPathExtent,
"%.20gx%.20g%+.20g",
3037 (
double) columns,(
double) rows,(
double) offset);
3038 (void) CloneString(&wand->image_info->size,geometry);
3070WandExport MagickBooleanType MagickSetType(
MagickWand *wand,
3071 const ImageType image_type)
3074 assert(wand->signature == MagickWandSignature);
3075 if (wand->debug != MagickFalse)
3076 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
3077 wand->image_info->type=image_type;