00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #include "wand/studio.h"
00050 #include "wand/MagickWand.h"
00051 #include "wand/magick-wand-private.h"
00052 #include "wand/wand.h"
00053 #include "magick/string-private.h"
00054
00055
00056
00057
00058 #define ThrowWandException(severity,tag,context) \
00059 { \
00060 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
00061 tag,"`%s'",context); \
00062 return(MagickFalse); \
00063 }
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
00091 const char *artifact)
00092 {
00093 assert(wand != (MagickWand *) NULL);
00094 assert(wand->signature == WandSignature);
00095 if (wand->debug != MagickFalse)
00096 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00097 if (wand->images == (Image *) NULL)
00098 {
00099 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00100 "ContainsNoImages","`%s'",wand->name);
00101 return(MagickFalse);
00102 }
00103 return(DeleteImageArtifact(wand->images,artifact));
00104 }
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
00132 const char *property)
00133 {
00134 assert(wand != (MagickWand *) NULL);
00135 assert(wand->signature == WandSignature);
00136 if (wand->debug != MagickFalse)
00137 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00138 if (wand->images == (Image *) NULL)
00139 {
00140 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00141 "ContainsNoImages","`%s'",wand->name);
00142 return(MagickFalse);
00143 }
00144 return(DeleteImageProperty(wand->images,property));
00145 }
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172 WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
00173 const char *option)
00174 {
00175 assert(wand != (MagickWand *) NULL);
00176 assert(wand->signature == WandSignature);
00177 if (wand->debug != MagickFalse)
00178 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00179 return(DeleteImageOption(wand->image_info,option));
00180 }
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205 WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
00206 {
00207 assert(wand != (const MagickWand *) NULL);
00208 assert(wand->signature == WandSignature);
00209 if (wand->debug != MagickFalse)
00210 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00211 return(wand->image_info->antialias);
00212 }
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236 WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
00237 {
00238 PixelWand
00239 *background_color;
00240
00241 assert(wand != (MagickWand *) NULL);
00242 assert(wand->signature == WandSignature);
00243 if (wand->debug != MagickFalse)
00244 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00245 background_color=NewPixelWand();
00246 PixelSetQuantumColor(background_color,&wand->image_info->background_color);
00247 return(background_color);
00248 }
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272 WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
00273 {
00274 assert(wand != (MagickWand *) NULL);
00275 assert(wand->signature == WandSignature);
00276 if (wand->debug != MagickFalse)
00277 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00278 return(wand->image_info->colorspace);
00279 }
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303 WandExport CompressionType MagickGetCompression(MagickWand *wand)
00304 {
00305 assert(wand != (MagickWand *) NULL);
00306 assert(wand->signature == WandSignature);
00307 if (wand->debug != MagickFalse)
00308 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00309 return(wand->image_info->compression);
00310 }
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334 WandExport unsigned long MagickGetCompressionQuality(MagickWand *wand)
00335 {
00336 assert(wand != (MagickWand *) NULL);
00337 assert(wand->signature == WandSignature);
00338 if (wand->debug != MagickFalse)
00339 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00340 return(wand->image_info->quality);
00341 }
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362 WandExport const char *MagickGetCopyright(void)
00363 {
00364 return(GetMagickCopyright());
00365 }
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389 WandExport char *MagickGetFilename(const MagickWand *wand)
00390 {
00391 assert(wand != (const MagickWand *) NULL);
00392 assert(wand->signature == WandSignature);
00393 if (wand->debug != MagickFalse)
00394 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00395 return(AcquireString(wand->image_info->filename));
00396 }
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420 WandExport char *MagickGetFont(MagickWand *wand)
00421 {
00422 assert(wand != (MagickWand *) NULL);
00423 assert(wand->signature == WandSignature);
00424 if (wand->debug != MagickFalse)
00425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00426 if (wand->image_info->font == (char *) NULL)
00427 return((char *) NULL);
00428 return(AcquireString(wand->image_info->font));
00429 }
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453 WandExport char *MagickGetFormat(MagickWand *wand)
00454 {
00455 assert(wand != (MagickWand *) NULL);
00456 assert(wand->signature == WandSignature);
00457 if (wand->debug != MagickFalse)
00458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00459 return(AcquireString(wand->image_info->magick));
00460 }
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484 WandExport GravityType MagickGetGravity(MagickWand *wand)
00485 {
00486 const char
00487 *option;
00488
00489 GravityType
00490 type;
00491
00492 assert(wand != (MagickWand *) NULL);
00493 assert(wand->signature == WandSignature);
00494 if (wand->debug != MagickFalse)
00495 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00496 option=GetImageOption(wand->image_info,"gravity");
00497 if (option == (const char *) NULL)
00498 return(UndefinedGravity);
00499 type=(GravityType) ParseMagickOption(MagickGravityOptions,MagickFalse,option);
00500 return(type);
00501 }
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521 WandExport char *MagickGetHomeURL(void)
00522 {
00523 return(GetMagickHomeURL());
00524 }
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552 WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
00553 {
00554 const char
00555 *value;
00556
00557 assert(wand != (MagickWand *) NULL);
00558 assert(wand->signature == WandSignature);
00559 if (wand->debug != MagickFalse)
00560 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00561 if (wand->images == (Image *) NULL)
00562 {
00563 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00564 "ContainsNoImages","`%s'",wand->name);
00565 return((char *) NULL);
00566 }
00567 value=GetImageArtifact(wand->images,artifact);
00568 if (value == (const char *) NULL)
00569 return((char *) NULL);
00570 return(ConstantString(value));
00571 }
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603 WandExport char **MagickGetImageArtifacts(MagickWand *wand,
00604 const char *pattern,unsigned long *number_artifacts)
00605 {
00606 char
00607 **artifacts;
00608
00609 const char
00610 *artifact;
00611
00612 register long
00613 i;
00614
00615 size_t
00616 length;
00617
00618 assert(wand != (MagickWand *) NULL);
00619 assert(wand->signature == WandSignature);
00620 if (wand->debug != MagickFalse)
00621 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00622 if (wand->images == (Image *) NULL)
00623 {
00624 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00625 "ContainsNoImages","`%s'",wand->name);
00626 return((char **) NULL);
00627 }
00628 (void) GetImageProperty(wand->images,"exif:*");
00629 length=1024;
00630 artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
00631 if (artifacts == (char **) NULL)
00632 return((char **) NULL);
00633 ResetImagePropertyIterator(wand->images);
00634 artifact=GetNextImageProperty(wand->images);
00635 for (i=0; artifact != (const char *) NULL; )
00636 {
00637 if ((*artifact != '[') &&
00638 (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse))
00639 {
00640 if ((i+1) >= (long) length)
00641 {
00642 length<<=1;
00643 artifacts=(char **) ResizeQuantumMemory(artifacts,length,
00644 sizeof(*artifacts));
00645 if (artifacts == (char **) NULL)
00646 {
00647 (void) ThrowMagickException(wand->exception,GetMagickModule(),
00648 ResourceLimitError,"MemoryAllocationFailed","`%s'",
00649 wand->name);
00650 return((char **) NULL);
00651 }
00652 }
00653 artifacts[i]=ConstantString(artifact);
00654 i++;
00655 }
00656 artifact=GetNextImageProperty(wand->images);
00657 }
00658 artifacts[i]=(char *) NULL;
00659 *number_artifacts=(unsigned long) i;
00660 return(artifacts);
00661 }
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690 WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
00691 const char *name,size_t *length)
00692 {
00693 const StringInfo
00694 *profile;
00695
00696 unsigned char
00697 *datum;
00698
00699 assert(wand != (MagickWand *) NULL);
00700 assert(wand->signature == WandSignature);
00701 if (wand->debug != MagickFalse)
00702 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00703 if (wand->images == (Image *) NULL)
00704 {
00705 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00706 "ContainsNoImages","`%s'",wand->name);
00707 return((unsigned char *) NULL);
00708 }
00709 *length=0;
00710 if (wand->images->profiles == (SplayTreeInfo *) NULL)
00711 return((unsigned char *) NULL);
00712 profile=GetImageProfile(wand->images,name);
00713 if (profile == (StringInfo *) NULL)
00714 return((unsigned char *) NULL);
00715 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
00716 sizeof(*datum));
00717 if (datum == (unsigned char *) NULL)
00718 return((unsigned char *) NULL);
00719 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
00720 GetStringInfoLength(profile));
00721 *length=(unsigned long) GetStringInfoLength(profile);
00722 return(datum);
00723 }
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755 WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
00756 unsigned long *number_profiles)
00757 {
00758 char
00759 **profiles;
00760
00761 const char
00762 *property;
00763
00764 register long
00765 i;
00766
00767 size_t
00768 length;
00769
00770 assert(wand != (MagickWand *) NULL);
00771 assert(wand->signature == WandSignature);
00772 if (wand->debug != MagickFalse)
00773 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00774 if (wand->images == (Image *) NULL)
00775 {
00776 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00777 "ContainsNoImages","`%s'",wand->name);
00778 return((char **) NULL);
00779 }
00780 (void) GetImageProfile(wand->images,"exif:*");
00781 length=1024;
00782 profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
00783 if (profiles == (char **) NULL)
00784 return((char **) NULL);
00785 ResetImageProfileIterator(wand->images);
00786 property=GetNextImageProfile(wand->images);
00787 for (i=0; property != (const char *) NULL; )
00788 {
00789 if ((*property != '[') &&
00790 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
00791 {
00792 if ((i+1) >= (long) length)
00793 {
00794 length<<=1;
00795 profiles=(char **) ResizeQuantumMemory(profiles,length,
00796 sizeof(*profiles));
00797 if (profiles == (char **) NULL)
00798 {
00799 (void) ThrowMagickException(wand->exception,GetMagickModule(),
00800 ResourceLimitError,"MemoryAllocationFailed","`%s'",
00801 wand->name);
00802 return((char **) NULL);
00803 }
00804 }
00805 profiles[i]=ConstantString(property);
00806 i++;
00807 }
00808 property=GetNextImageProfile(wand->images);
00809 }
00810 profiles[i]=(char *) NULL;
00811 *number_profiles=(unsigned long) i;
00812 return(profiles);
00813 }
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841 WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
00842 {
00843 const char
00844 *value;
00845
00846 assert(wand != (MagickWand *) NULL);
00847 assert(wand->signature == WandSignature);
00848 if (wand->debug != MagickFalse)
00849 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00850 if (wand->images == (Image *) NULL)
00851 {
00852 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00853 "ContainsNoImages","`%s'",wand->name);
00854 return((char *) NULL);
00855 }
00856 value=GetImageProperty(wand->images,property);
00857 if (value == (const char *) NULL)
00858 return((char *) NULL);
00859 return(ConstantString(value));
00860 }
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892 WandExport char **MagickGetImageProperties(MagickWand *wand,
00893 const char *pattern,unsigned long *number_properties)
00894 {
00895 char
00896 **properties;
00897
00898 const char
00899 *property;
00900
00901 register long
00902 i;
00903
00904 size_t
00905 length;
00906
00907 assert(wand != (MagickWand *) NULL);
00908 assert(wand->signature == WandSignature);
00909 if (wand->debug != MagickFalse)
00910 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00911 if (wand->images == (Image *) NULL)
00912 {
00913 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00914 "ContainsNoImages","`%s'",wand->name);
00915 return((char **) NULL);
00916 }
00917 (void) GetImageProperty(wand->images,"exif:*");
00918 length=1024;
00919 properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
00920 if (properties == (char **) NULL)
00921 return((char **) NULL);
00922 ResetImagePropertyIterator(wand->images);
00923 property=GetNextImageProperty(wand->images);
00924 for (i=0; property != (const char *) NULL; )
00925 {
00926 if ((*property != '[') &&
00927 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
00928 {
00929 if ((i+1) >= (long) length)
00930 {
00931 length<<=1;
00932 properties=(char **) ResizeQuantumMemory(properties,length,
00933 sizeof(*properties));
00934 if (properties == (char **) NULL)
00935 {
00936 (void) ThrowMagickException(wand->exception,GetMagickModule(),
00937 ResourceLimitError,"MemoryAllocationFailed","`%s'",
00938 wand->name);
00939 return((char **) NULL);
00940 }
00941 }
00942 properties[i]=ConstantString(property);
00943 i++;
00944 }
00945 property=GetNextImageProperty(wand->images);
00946 }
00947 properties[i]=(char *) NULL;
00948 *number_properties=(unsigned long) i;
00949 return(properties);
00950 }
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974 WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
00975 {
00976 assert(wand != (MagickWand *) NULL);
00977 assert(wand->signature == WandSignature);
00978 if (wand->debug != MagickFalse)
00979 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00980 return(wand->image_info->interlace);
00981 }
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005 WandExport InterpolatePixelMethod MagickGetInterpolateMethod(MagickWand *wand)
01006 {
01007 const char
01008 *option;
01009
01010 InterpolatePixelMethod
01011 method;
01012
01013 assert(wand != (MagickWand *) NULL);
01014 assert(wand->signature == WandSignature);
01015 if (wand->debug != MagickFalse)
01016 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01017 option=GetImageOption(wand->image_info,"interpolate");
01018 if (option == (const char *) NULL)
01019 return(UndefinedInterpolatePixel);
01020 method=(InterpolatePixelMethod) ParseMagickOption(MagickInterpolateOptions,
01021 MagickFalse,option);
01022 return(method);
01023 }
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051 WandExport char *MagickGetOption(MagickWand *wand,const char *key)
01052 {
01053 const char
01054 *option;
01055
01056 assert(wand != (MagickWand *) NULL);
01057 assert(wand->signature == WandSignature);
01058 if (wand->debug != MagickFalse)
01059 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01060 option=GetImageOption(wand->image_info,key);
01061 return(ConstantString(option));
01062 }
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093 WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
01094 unsigned long *number_options)
01095 {
01096 char
01097 **options;
01098
01099 const char
01100 *option;
01101
01102 register long
01103 i;
01104
01105 size_t
01106 length;
01107
01108 assert(wand != (MagickWand *) NULL);
01109 assert(wand->signature == WandSignature);
01110 if (wand->debug != MagickFalse)
01111 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01112 if (wand->images == (Image *) NULL)
01113 {
01114 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
01115 "ContainsNoImages","`%s'",wand->name);
01116 return((char **) NULL);
01117 }
01118 length=1024;
01119 options=(char **) AcquireQuantumMemory(length,sizeof(*options));
01120 if (options == (char **) NULL)
01121 return((char **) NULL);
01122 ResetImageOptionIterator(wand->image_info);
01123 option=GetNextImageOption(wand->image_info);
01124 for (i=0; option != (const char *) NULL; )
01125 {
01126 if ((*option != '[') &&
01127 (GlobExpression(option,pattern,MagickFalse) != MagickFalse))
01128 {
01129 if ((i+1) >= (long) length)
01130 {
01131 length<<=1;
01132 options=(char **) ResizeQuantumMemory(options,length,
01133 sizeof(*options));
01134 if (options == (char **) NULL)
01135 {
01136 (void) ThrowMagickException(wand->exception,GetMagickModule(),
01137 ResourceLimitError,"MemoryAllocationFailed","`%s'",
01138 wand->name);
01139 return((char **) NULL);
01140 }
01141 }
01142 options[i]=ConstantString(option);
01143 i++;
01144 }
01145 option=GetNextImageOption(wand->image_info);
01146 }
01147 options[i]=(char *) NULL;
01148 *number_options=(unsigned long) i;
01149 return(options);
01150 }
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174 WandExport OrientationType MagickGetOrientation(MagickWand *wand)
01175 {
01176 assert(wand != (MagickWand *) NULL);
01177 assert(wand->signature == WandSignature);
01178 if (wand->debug != MagickFalse)
01179 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01180 return(wand->image_info->orientation);
01181 }
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203 WandExport const char *MagickGetPackageName(void)
01204 {
01205 return(GetMagickPackageName());
01206 }
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239 WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
01240 unsigned long *width,unsigned long *height,long *x,long *y)
01241 {
01242 RectangleInfo
01243 geometry;
01244
01245 assert(wand != (const MagickWand *) NULL);
01246 assert(wand->signature == WandSignature);
01247 if (wand->debug != MagickFalse)
01248 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01249 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
01250 (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
01251 *width=geometry.width;
01252 *height=geometry.height;
01253 *x=geometry.x;
01254 *y=geometry.y;
01255 return(MagickTrue);
01256 }
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280
01281 WandExport double MagickGetPointsize(MagickWand *wand)
01282 {
01283 assert(wand != (MagickWand *) NULL);
01284 assert(wand->signature == WandSignature);
01285 if (wand->debug != MagickFalse)
01286 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01287 return(wand->image_info->pointsize);
01288 }
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313 WandExport const char *MagickGetQuantumDepth(unsigned long *depth)
01314 {
01315 return(GetMagickQuantumDepth(depth));
01316 }
01317
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341 WandExport const char *MagickGetQuantumRange(unsigned long *range)
01342 {
01343 return(GetMagickQuantumRange(range));
01344 }
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365 WandExport const char *MagickGetReleaseDate(void)
01366 {
01367 return(GetMagickReleaseDate());
01368 }
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391
01392 WandExport MagickSizeType MagickGetResource(const ResourceType type)
01393 {
01394 return(GetMagickResource(type));
01395 }
01396
01397
01398
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419 WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
01420 {
01421 return(GetMagickResourceLimit(type));
01422 }
01423
01424
01425
01426
01427
01428
01429
01430
01431
01432
01433
01434
01435
01436
01437
01438
01439
01440
01441
01442
01443
01444
01445
01446
01447
01448
01449 WandExport double *MagickGetSamplingFactors(MagickWand *wand,
01450 unsigned long *number_factors)
01451 {
01452 double
01453 *sampling_factors;
01454
01455 register const char
01456 *p;
01457
01458 register long
01459 i;
01460
01461 assert(wand != (MagickWand *) NULL);
01462 assert(wand->signature == WandSignature);
01463 if (wand->debug != MagickFalse)
01464 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01465 *number_factors=0;
01466 sampling_factors=(double *) NULL;
01467 if (wand->image_info->sampling_factor == (char *) NULL)
01468 return(sampling_factors);
01469 i=0;
01470 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
01471 {
01472 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
01473 (*p == ',')))
01474 p++;
01475 i++;
01476 }
01477 sampling_factors=(double *) AcquireQuantumMemory((size_t) i,
01478 sizeof(*sampling_factors));
01479 if (sampling_factors == (double *) NULL)
01480 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
01481 wand->image_info->filename);
01482 i=0;
01483 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
01484 {
01485 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
01486 (*p == ',')))
01487 p++;
01488 sampling_factors[i]=StringToDouble(p);
01489 i++;
01490 }
01491 *number_factors=(unsigned long) i;
01492 return(sampling_factors);
01493 }
01494
01495
01496
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506
01507
01508
01509
01510
01511
01512
01513
01514
01515
01516
01517
01518
01519
01520
01521
01522 WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
01523 unsigned long *columns,unsigned long *rows)
01524 {
01525 RectangleInfo
01526 geometry;
01527
01528 assert(wand != (const MagickWand *) NULL);
01529 assert(wand->signature == WandSignature);
01530 if (wand->debug != MagickFalse)
01531 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01532 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
01533 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
01534 *columns=geometry.width;
01535 *rows=geometry.height;
01536 return(MagickTrue);
01537 }
01538
01539
01540
01541
01542
01543
01544
01545
01546
01547
01548
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565 WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
01566 long *offset)
01567 {
01568 RectangleInfo
01569 geometry;
01570
01571 assert(wand != (const MagickWand *) NULL);
01572 assert(wand->signature == WandSignature);
01573 if (wand->debug != MagickFalse)
01574 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01575 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
01576 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
01577 *offset=geometry.x;
01578 return(MagickTrue);
01579 }
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595
01596
01597
01598
01599
01600
01601
01602
01603 WandExport ImageType MagickGetType(MagickWand *wand)
01604 {
01605 assert(wand != (MagickWand *) NULL);
01606 assert(wand->signature == WandSignature);
01607 if (wand->debug != MagickFalse)
01608 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01609 return(wand->image_info->type);
01610 }
01611
01612
01613
01614
01615
01616
01617
01618
01619
01620
01621
01622
01623
01624
01625
01626
01627
01628
01629
01630
01631
01632
01633
01634
01635 WandExport const char *MagickGetVersion(unsigned long *version)
01636 {
01637 return(GetMagickVersion(version));
01638 }
01639
01640
01641
01642
01643
01644
01645
01646
01647
01648
01649
01650
01651
01652
01653
01654
01655
01656
01657
01658
01659
01660
01661
01662
01663
01664
01665
01666
01667
01668
01669
01670
01671
01672 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
01673 const char *name,const void *profile,const size_t length)
01674 {
01675 MagickBooleanType
01676 status;
01677
01678 assert(wand != (MagickWand *) NULL);
01679 assert(wand->signature == WandSignature);
01680 if (wand->debug != MagickFalse)
01681 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01682 if (wand->images == (Image *) NULL)
01683 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01684 status=ProfileImage(wand->images,name,profile,length,MagickTrue);
01685 if (status == MagickFalse)
01686 InheritException(wand->exception,&wand->images->exception);
01687 return(status);
01688 }
01689
01690
01691
01692
01693
01694
01695
01696
01697
01698
01699
01700
01701
01702
01703
01704
01705
01706
01707
01708
01709
01710
01711
01712
01713
01714
01715
01716
01717 WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
01718 const char *name,size_t *length)
01719 {
01720 StringInfo
01721 *profile;
01722
01723 unsigned char
01724 *datum;
01725
01726 assert(wand != (MagickWand *) NULL);
01727 assert(wand->signature == WandSignature);
01728 if (wand->debug != MagickFalse)
01729 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01730 if (wand->images == (Image *) NULL)
01731 {
01732 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
01733 "ContainsNoImages","`%s'",wand->name);
01734 return((unsigned char *) NULL);
01735 }
01736 *length=0;
01737 profile=RemoveImageProfile(wand->images,name);
01738 if (profile == (StringInfo *) NULL)
01739 return((unsigned char *) NULL);
01740 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
01741 sizeof(*datum));
01742 if (datum == (unsigned char *) NULL)
01743 return((unsigned char *) NULL);
01744 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
01745 GetStringInfoLength(profile));
01746 *length=GetStringInfoLength(profile);
01747 profile=DestroyStringInfo(profile);
01748 return(datum);
01749 }
01750
01751
01752
01753
01754
01755
01756
01757
01758
01759
01760
01761
01762
01763
01764
01765
01766
01767
01768
01769
01770
01771
01772
01773
01774
01775
01776 WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
01777 const MagickBooleanType antialias)
01778 {
01779 assert(wand != (MagickWand *) NULL);
01780 assert(wand->signature == WandSignature);
01781 if (wand->debug != MagickFalse)
01782 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01783 wand->image_info->antialias=antialias;
01784 return(MagickTrue);
01785 }
01786
01787
01788
01789
01790
01791
01792
01793
01794
01795
01796
01797
01798
01799
01800
01801
01802
01803
01804
01805
01806
01807
01808
01809
01810
01811
01812 WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
01813 const PixelWand *background)
01814 {
01815 assert(wand != (MagickWand *) NULL);
01816 assert(wand->signature == WandSignature);
01817 if (wand->debug != MagickFalse)
01818 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01819 PixelGetQuantumColor(background,&wand->image_info->background_color);
01820 return(MagickTrue);
01821 }
01822
01823
01824
01825
01826
01827
01828
01829
01830
01831
01832
01833
01834
01835
01836
01837
01838
01839
01840
01841
01842
01843
01844
01845
01846
01847
01848 WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
01849 const ColorspaceType colorspace)
01850 {
01851 assert(wand != (MagickWand *) NULL);
01852 assert(wand->signature == WandSignature);
01853 if (wand->debug != MagickFalse)
01854 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01855 wand->image_info->colorspace=colorspace;
01856 return(MagickTrue);
01857 }
01858
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875
01876
01877
01878
01879
01880
01881
01882
01883
01884 WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
01885 const CompressionType compression)
01886 {
01887 assert(wand != (MagickWand *) NULL);
01888 assert(wand->signature == WandSignature);
01889 if (wand->debug != MagickFalse)
01890 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01891 wand->image_info->compression=compression;
01892 return(MagickTrue);
01893 }
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903
01904
01905
01906
01907
01908
01909
01910
01911
01912
01913
01914
01915
01916
01917
01918
01919
01920 WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
01921 const unsigned long quality)
01922 {
01923 assert(wand != (MagickWand *) NULL);
01924 assert(wand->signature == WandSignature);
01925 if (wand->debug != MagickFalse)
01926 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01927 wand->image_info->quality=quality;
01928 return(MagickTrue);
01929 }
01930
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951
01952
01953
01954
01955
01956 WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
01957 const unsigned long depth)
01958 {
01959 assert(wand != (MagickWand *) NULL);
01960 assert(wand->signature == WandSignature);
01961 if (wand->debug != MagickFalse)
01962 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01963 wand->image_info->depth=depth;
01964 return(MagickTrue);
01965 }
01966
01967
01968
01969
01970
01971
01972
01973
01974
01975
01976
01977
01978
01979
01980
01981
01982
01983
01984
01985
01986
01987
01988
01989
01990
01991
01992
01993
01994 WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
01995 const char *geometry)
01996 {
01997 assert(wand != (MagickWand *) NULL);
01998 assert(wand->signature == WandSignature);
01999 if (wand->debug != MagickFalse)
02000 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02001 if (geometry != (const char *) NULL)
02002 (void) CopyMagickString(wand->image_info->extract,geometry,MaxTextExtent);
02003 return(MagickTrue);
02004 }
02005
02006
02007
02008
02009
02010
02011
02012
02013
02014
02015
02016
02017
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029
02030
02031 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
02032 const char *filename)
02033 {
02034 assert(wand != (MagickWand *) NULL);
02035 assert(wand->signature == WandSignature);
02036 if (wand->debug != MagickFalse)
02037 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02038 if (filename != (const char *) NULL)
02039 (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent);
02040 return(MagickTrue);
02041 }
02042
02043
02044
02045
02046
02047
02048
02049
02050
02051
02052
02053
02054
02055
02056
02057
02058
02059
02060
02061
02062
02063
02064
02065
02066
02067 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
02068 {
02069 if ((font == (const char *) NULL) || (*font == '\0'))
02070 return(MagickFalse);
02071 assert(wand != (MagickWand *) NULL);
02072 assert(wand->signature == WandSignature);
02073 if (wand->debug != MagickFalse)
02074 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02075 (void) CloneString(&wand->image_info->font,font);
02076 return(MagickTrue);
02077 }
02078
02079
02080
02081
02082
02083
02084
02085
02086
02087
02088
02089
02090
02091
02092
02093
02094
02095
02096
02097
02098
02099
02100
02101
02102
02103 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
02104 const char *format)
02105 {
02106 const MagickInfo
02107 *magick_info;
02108
02109 assert(wand != (MagickWand *) NULL);
02110 assert(wand->signature == WandSignature);
02111 if (wand->debug != MagickFalse)
02112 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02113 if ((format == (char *) NULL) || (*format == '\0'))
02114 {
02115 *wand->image_info->magick='\0';
02116 return(MagickTrue);
02117 }
02118 magick_info=GetMagickInfo(format,wand->exception);
02119 if (magick_info == (const MagickInfo *) NULL)
02120 return(MagickFalse);
02121 ClearMagickException(wand->exception);
02122 (void) CopyMagickString(wand->image_info->magick,format,MaxTextExtent);
02123 return(MagickTrue);
02124 }
02125
02126
02127
02128
02129
02130
02131
02132
02133
02134
02135
02136
02137
02138
02139
02140
02141
02142
02143
02144
02145
02146
02147
02148
02149
02150
02151 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
02152 const GravityType type)
02153 {
02154 MagickBooleanType
02155 status;
02156
02157 assert(wand != (MagickWand *) NULL);
02158 assert(wand->signature == WandSignature);
02159 if (wand->debug != MagickFalse)
02160 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02161 status=SetImageOption(wand->image_info,"gravity",MagickOptionToMnemonic(
02162 MagickGravityOptions,(long) type));
02163 return(status);
02164 }
02165
02166
02167
02168
02169
02170
02171
02172
02173
02174
02175
02176
02177
02178
02179
02180
02181
02182
02183
02184
02185
02186
02187
02188
02189
02190
02191
02192
02193 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
02194 const char *artifact,const char *value)
02195 {
02196 MagickBooleanType
02197 status;
02198
02199 assert(wand != (MagickWand *) NULL);
02200 assert(wand->signature == WandSignature);
02201 if (wand->debug != MagickFalse)
02202 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02203 if (wand->images == (Image *) NULL)
02204 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02205 status=SetImageArtifact(wand->images,artifact,value);
02206 if (status == MagickFalse)
02207 InheritException(wand->exception,&wand->images->exception);
02208 return(status);
02209 }
02210
02211
02212
02213
02214
02215
02216
02217
02218
02219
02220
02221
02222
02223
02224
02225
02226
02227
02228
02229
02230
02231
02232
02233
02234
02235
02236
02237
02238
02239
02240
02241
02242
02243 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
02244 const char *name,const void *profile,const size_t length)
02245 {
02246 MagickBooleanType
02247 status;
02248
02249 StringInfo
02250 *profile_info;
02251
02252 assert(wand != (MagickWand *) NULL);
02253 assert(wand->signature == WandSignature);
02254 if (wand->debug != MagickFalse)
02255 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02256 if (wand->images == (Image *) NULL)
02257 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02258 profile_info=AcquireStringInfo((size_t) length);
02259 SetStringInfoDatum(profile_info,(unsigned char *) profile);
02260 status=SetImageProfile(wand->images,name,profile_info);
02261 profile_info=DestroyStringInfo(profile_info);
02262 if (status == MagickFalse)
02263 InheritException(wand->exception,&wand->images->exception);
02264 return(status);
02265 }
02266
02267
02268
02269
02270
02271
02272
02273
02274
02275
02276
02277
02278
02279
02280
02281
02282
02283
02284
02285
02286
02287
02288
02289
02290
02291
02292
02293
02294 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
02295 const char *property,const char *value)
02296 {
02297 MagickBooleanType
02298 status;
02299
02300 assert(wand != (MagickWand *) NULL);
02301 assert(wand->signature == WandSignature);
02302 if (wand->debug != MagickFalse)
02303 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02304 if (wand->images == (Image *) NULL)
02305 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02306 status=SetImageProperty(wand->images,property,value);
02307 if (status == MagickFalse)
02308 InheritException(wand->exception,&wand->images->exception);
02309 return(status);
02310 }
02311
02312
02313
02314
02315
02316
02317
02318
02319
02320
02321
02322
02323
02324
02325
02326
02327
02328
02329
02330
02331
02332
02333
02334
02335
02336
02337
02338 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
02339 const InterlaceType interlace_scheme)
02340 {
02341 assert(wand != (MagickWand *) NULL);
02342 assert(wand->signature == WandSignature);
02343 if (wand->debug != MagickFalse)
02344 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02345 wand->image_info->interlace=interlace_scheme;
02346 return(MagickTrue);
02347 }
02348
02349
02350
02351
02352
02353
02354
02355
02356
02357
02358
02359
02360
02361
02362
02363
02364
02365
02366
02367
02368
02369
02370
02371
02372
02373
02374 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
02375 const InterpolatePixelMethod method)
02376 {
02377 MagickBooleanType
02378 status;
02379
02380 assert(wand != (MagickWand *) NULL);
02381 assert(wand->signature == WandSignature);
02382 if (wand->debug != MagickFalse)
02383 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02384 status=SetImageOption(wand->image_info,"interpolate",
02385 MagickOptionToMnemonic(MagickInterpolateOptions,(long) method));
02386 return(status);
02387 }
02388
02389
02390
02391
02392
02393
02394
02395
02396
02397
02398
02399
02400
02401
02402
02403
02404
02405
02406
02407
02408
02409
02410
02411
02412
02413
02414
02415
02416
02417 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
02418 const char *value)
02419 {
02420 assert(wand != (MagickWand *) NULL);
02421 assert(wand->signature == WandSignature);
02422 if (wand->debug != MagickFalse)
02423 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02424 return(SetImageOption(wand->image_info,key,value));
02425 }
02426
02427
02428
02429
02430
02431
02432
02433
02434
02435
02436
02437
02438
02439
02440
02441
02442
02443
02444
02445
02446
02447
02448
02449
02450
02451
02452 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
02453 const OrientationType orientation)
02454 {
02455 assert(wand != (MagickWand *) NULL);
02456 assert(wand->signature == WandSignature);
02457 if (wand->debug != MagickFalse)
02458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02459 wand->image_info->orientation=orientation;
02460 return(MagickTrue);
02461 }
02462
02463
02464
02465
02466
02467
02468
02469
02470
02471
02472
02473
02474
02475
02476
02477
02478
02479
02480
02481
02482
02483
02484
02485
02486
02487
02488
02489
02490
02491
02492
02493
02494
02495 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
02496 const unsigned long width,const unsigned long height,const long x,
02497 const long y)
02498 {
02499 char
02500 geometry[MaxTextExtent];
02501
02502 assert(wand != (MagickWand *) NULL);
02503 assert(wand->signature == WandSignature);
02504 if (wand->debug != MagickFalse)
02505 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02506 (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu%+ld%+ld",
02507 width,height,x,y);
02508 (void) CloneString(&wand->image_info->page,geometry);
02509 return(MagickTrue);
02510 }
02511
02512
02513
02514
02515
02516
02517
02518
02519
02520
02521
02522
02523
02524
02525
02526
02527
02528
02529
02530
02531
02532
02533
02534
02535
02536
02537 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
02538 const char *passphrase)
02539 {
02540 assert(wand != (MagickWand *) NULL);
02541 assert(wand->signature == WandSignature);
02542 if (wand->debug != MagickFalse)
02543 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02544 (void) CloneString(&wand->image_info->authenticate,passphrase);
02545 return(MagickTrue);
02546 }
02547
02548
02549
02550
02551
02552
02553
02554
02555
02556
02557
02558
02559
02560
02561
02562
02563
02564
02565
02566
02567
02568
02569
02570
02571
02572
02573 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
02574 const double pointsize)
02575 {
02576 assert(wand != (MagickWand *) NULL);
02577 assert(wand->signature == WandSignature);
02578 if (wand->debug != MagickFalse)
02579 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02580 wand->image_info->pointsize=pointsize;
02581 return(MagickTrue);
02582 }
02583
02584
02585
02586
02587
02588
02589
02590
02591
02592
02593
02594
02595
02596
02597
02598
02599
02600
02601
02602
02603
02604
02605
02606
02607
02608
02609
02610
02611
02612
02613
02614
02615
02616
02617
02618
02619
02620
02621 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
02622 const MagickProgressMonitor progress_monitor,void *client_data)
02623 {
02624 MagickProgressMonitor
02625 previous_monitor;
02626
02627 assert(wand != (MagickWand *) NULL);
02628 assert(wand->signature == WandSignature);
02629 if (wand->debug != MagickFalse)
02630 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02631 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
02632 progress_monitor,client_data);
02633 return(previous_monitor);
02634 }
02635
02636
02637
02638
02639
02640
02641
02642
02643
02644
02645
02646
02647
02648
02649
02650
02651
02652
02653
02654
02655
02656
02657
02658
02659
02660
02661
02662
02663 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
02664 const MagickSizeType limit)
02665 {
02666 return(SetMagickResourceLimit(type,limit));
02667 }
02668
02669
02670
02671
02672
02673
02674
02675
02676
02677
02678
02679
02680
02681
02682
02683
02684
02685
02686
02687
02688
02689
02690
02691
02692
02693
02694
02695
02696 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
02697 const double x_resolution,const double y_resolution)
02698 {
02699 char
02700 density[MaxTextExtent];
02701
02702 assert(wand != (MagickWand *) NULL);
02703 assert(wand->signature == WandSignature);
02704 if (wand->debug != MagickFalse)
02705 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02706 (void) FormatMagickString(density,MaxTextExtent,"%gx%g",x_resolution,
02707 y_resolution);
02708 (void) CloneString(&wand->image_info->density,density);
02709 return(MagickTrue);
02710 }
02711
02712
02713
02714
02715
02716
02717
02718
02719
02720
02721
02722
02723
02724
02725
02726
02727
02728
02729
02730
02731
02732
02733
02734
02735
02736
02737
02738
02739
02740 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
02741 const unsigned long number_factors,const double *sampling_factors)
02742 {
02743 char
02744 sampling_factor[MaxTextExtent];
02745
02746 register long
02747 i;
02748
02749 assert(wand != (MagickWand *) NULL);
02750 assert(wand->signature == WandSignature);
02751 if (wand->debug != MagickFalse)
02752 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02753 if (wand->image_info->sampling_factor != (char *) NULL)
02754 wand->image_info->sampling_factor=(char *)
02755 RelinquishMagickMemory(wand->image_info->sampling_factor);
02756 if (number_factors == 0)
02757 return(MagickTrue);
02758 for (i=0; i < (long) (number_factors-1); i++)
02759 {
02760 (void) FormatMagickString(sampling_factor,MaxTextExtent,"%g,",
02761 sampling_factors[i]);
02762 (void) ConcatenateString(&wand->image_info->sampling_factor,
02763 sampling_factor);
02764 }
02765 (void) FormatMagickString(sampling_factor,MaxTextExtent,"%g",
02766 sampling_factors[i]);
02767 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
02768 return(MagickTrue);
02769 }
02770
02771
02772
02773
02774
02775
02776
02777
02778
02779
02780
02781
02782
02783
02784
02785
02786
02787
02788
02789
02790
02791
02792
02793
02794
02795
02796
02797
02798
02799 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
02800 const unsigned long columns,const unsigned long rows)
02801 {
02802 char
02803 geometry[MaxTextExtent];
02804
02805 assert(wand != (MagickWand *) NULL);
02806 assert(wand->signature == WandSignature);
02807 if (wand->debug != MagickFalse)
02808 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02809 (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu",columns,rows);
02810 (void) CloneString(&wand->image_info->size,geometry);
02811 return(MagickTrue);
02812 }
02813
02814
02815
02816
02817
02818
02819
02820
02821
02822
02823
02824
02825
02826
02827
02828
02829
02830
02831
02832
02833
02834
02835
02836
02837
02838
02839
02840
02841
02842
02843
02844
02845 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
02846 const unsigned long columns,const unsigned long rows,const long offset)
02847 {
02848 char
02849 geometry[MaxTextExtent];
02850
02851 assert(wand != (MagickWand *) NULL);
02852 assert(wand->signature == WandSignature);
02853 if (wand->debug != MagickFalse)
02854 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02855 (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu%+ld",columns,rows,
02856 offset);
02857 (void) CloneString(&wand->image_info->size,geometry);
02858 return(MagickTrue);
02859 }
02860
02861
02862
02863
02864
02865
02866
02867
02868
02869
02870
02871
02872
02873
02874
02875
02876
02877
02878
02879
02880
02881
02882
02883
02884
02885
02886
02887
02888
02889 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
02890 const ImageType image_type)
02891 {
02892 assert(wand != (MagickWand *) NULL);
02893 assert(wand->signature == WandSignature);
02894 if (wand->debug != MagickFalse)
02895 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02896 wand->image_info->type=image_type;
02897 return(MagickTrue);
02898 }