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
00054
00055
00056
00057 #define ThrowWandException(severity,tag,context) \
00058 { \
00059 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
00060 tag,"`%s'",context); \
00061 return(MagickFalse); \
00062 }
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 WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
00090 const char *artifact)
00091 {
00092 assert(wand != (MagickWand *) NULL);
00093 assert(wand->signature == WandSignature);
00094 if (wand->debug != MagickFalse)
00095 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00096 if (wand->images == (Image *) NULL)
00097 {
00098 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00099 "ContainsNoImages","`%s'",wand->name);
00100 return(MagickFalse);
00101 }
00102 return(DeleteImageArtifact(wand->images,artifact));
00103 }
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 WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
00131 const char *property)
00132 {
00133 assert(wand != (MagickWand *) NULL);
00134 assert(wand->signature == WandSignature);
00135 if (wand->debug != MagickFalse)
00136 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00137 if (wand->images == (Image *) NULL)
00138 {
00139 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00140 "ContainsNoImages","`%s'",wand->name);
00141 return(MagickFalse);
00142 }
00143 return(DeleteImageProperty(wand->images,property));
00144 }
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 WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
00172 const char *option)
00173 {
00174 assert(wand != (MagickWand *) NULL);
00175 assert(wand->signature == WandSignature);
00176 if (wand->debug != MagickFalse)
00177 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00178 return(DeleteImageOption(wand->image_info,option));
00179 }
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 WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
00205 {
00206 assert(wand != (const MagickWand *) NULL);
00207 assert(wand->signature == WandSignature);
00208 if (wand->debug != MagickFalse)
00209 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00210 return(wand->image_info->antialias);
00211 }
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235 WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
00236 {
00237 PixelWand
00238 *background_color;
00239
00240 assert(wand != (MagickWand *) NULL);
00241 assert(wand->signature == WandSignature);
00242 if (wand->debug != MagickFalse)
00243 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00244 background_color=NewPixelWand();
00245 PixelSetQuantumColor(background_color,&wand->image_info->background_color);
00246 return(background_color);
00247 }
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271 WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
00272 {
00273 assert(wand != (MagickWand *) NULL);
00274 assert(wand->signature == WandSignature);
00275 if (wand->debug != MagickFalse)
00276 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00277 return(wand->image_info->colorspace);
00278 }
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302 WandExport CompressionType MagickGetCompression(MagickWand *wand)
00303 {
00304 assert(wand != (MagickWand *) NULL);
00305 assert(wand->signature == WandSignature);
00306 if (wand->debug != MagickFalse)
00307 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00308 return(wand->image_info->compression);
00309 }
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333 WandExport unsigned long MagickGetCompressionQuality(MagickWand *wand)
00334 {
00335 assert(wand != (MagickWand *) NULL);
00336 assert(wand->signature == WandSignature);
00337 if (wand->debug != MagickFalse)
00338 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00339 return(wand->image_info->quality);
00340 }
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361 WandExport const char *MagickGetCopyright(void)
00362 {
00363 return(GetMagickCopyright());
00364 }
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388 WandExport char *MagickGetFilename(const MagickWand *wand)
00389 {
00390 assert(wand != (const MagickWand *) NULL);
00391 assert(wand->signature == WandSignature);
00392 if (wand->debug != MagickFalse)
00393 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00394 return(AcquireString(wand->image_info->filename));
00395 }
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419 WandExport char *MagickGetFont(MagickWand *wand)
00420 {
00421 assert(wand != (MagickWand *) NULL);
00422 assert(wand->signature == WandSignature);
00423 if (wand->debug != MagickFalse)
00424 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00425 if (wand->image_info->font == (char *) NULL)
00426 return((char *) NULL);
00427 return(AcquireString(wand->image_info->font));
00428 }
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452 WandExport char *MagickGetFormat(MagickWand *wand)
00453 {
00454 assert(wand != (MagickWand *) NULL);
00455 assert(wand->signature == WandSignature);
00456 if (wand->debug != MagickFalse)
00457 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00458 return(AcquireString(wand->image_info->magick));
00459 }
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483 WandExport GravityType MagickGetGravity(MagickWand *wand)
00484 {
00485 const char
00486 *option;
00487
00488 GravityType
00489 type;
00490
00491 assert(wand != (MagickWand *) NULL);
00492 assert(wand->signature == WandSignature);
00493 if (wand->debug != MagickFalse)
00494 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00495 option=GetImageOption(wand->image_info,"gravity");
00496 if (option == (const char *) NULL)
00497 return(UndefinedGravity);
00498 type=(GravityType) ParseMagickOption(MagickGravityOptions,MagickFalse,option);
00499 return(type);
00500 }
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520 WandExport char *MagickGetHomeURL(void)
00521 {
00522 return(GetMagickHomeURL());
00523 }
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 WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
00552 {
00553 const char
00554 *value;
00555
00556 assert(wand != (MagickWand *) NULL);
00557 assert(wand->signature == WandSignature);
00558 if (wand->debug != MagickFalse)
00559 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00560 if (wand->images == (Image *) NULL)
00561 {
00562 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00563 "ContainsNoImages","`%s'",wand->name);
00564 return((char *) NULL);
00565 }
00566 value=GetImageArtifact(wand->images,artifact);
00567 if (value == (const char *) NULL)
00568 return((char *) NULL);
00569 return(ConstantString(value));
00570 }
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 WandExport char **MagickGetImageArtifacts(MagickWand *wand,
00603 const char *pattern,unsigned long *number_artifacts)
00604 {
00605 char
00606 **artifacts;
00607
00608 const char
00609 *artifact;
00610
00611 register long
00612 i;
00613
00614 size_t
00615 length;
00616
00617 assert(wand != (MagickWand *) NULL);
00618 assert(wand->signature == WandSignature);
00619 if (wand->debug != MagickFalse)
00620 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00621 if (wand->images == (Image *) NULL)
00622 {
00623 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00624 "ContainsNoImages","`%s'",wand->name);
00625 return((char **) NULL);
00626 }
00627 (void) GetImageProperty(wand->images,"exif:*");
00628 length=1024;
00629 artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
00630 if (artifacts == (char **) NULL)
00631 return((char **) NULL);
00632 ResetImagePropertyIterator(wand->images);
00633 artifact=GetNextImageProperty(wand->images);
00634 for (i=0; artifact != (const char *) NULL; )
00635 {
00636 if ((*artifact != '[') &&
00637 (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse))
00638 {
00639 if ((i+1) >= (long) length)
00640 {
00641 length<<=1;
00642 artifacts=(char **) ResizeQuantumMemory(artifacts,length,
00643 sizeof(*artifacts));
00644 if (artifacts == (char **) NULL)
00645 {
00646 (void) ThrowMagickException(wand->exception,GetMagickModule(),
00647 ResourceLimitError,"MemoryAllocationFailed","`%s'",
00648 wand->name);
00649 return((char **) NULL);
00650 }
00651 }
00652 artifacts[i]=ConstantString(artifact);
00653 i++;
00654 }
00655 artifact=GetNextImageProperty(wand->images);
00656 }
00657 artifacts[i]=(char *) NULL;
00658 *number_artifacts=(unsigned long) i;
00659 return(artifacts);
00660 }
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 WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
00690 const char *name,size_t *length)
00691 {
00692 const StringInfo
00693 *profile;
00694
00695 unsigned char
00696 *datum;
00697
00698 assert(wand != (MagickWand *) NULL);
00699 assert(wand->signature == WandSignature);
00700 if (wand->debug != MagickFalse)
00701 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00702 if (wand->images == (Image *) NULL)
00703 {
00704 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00705 "ContainsNoImages","`%s'",wand->name);
00706 return((unsigned char *) NULL);
00707 }
00708 *length=0;
00709 if (wand->images->profiles == (SplayTreeInfo *) NULL)
00710 return((unsigned char *) NULL);
00711 profile=GetImageProfile(wand->images,name);
00712 if (profile == (StringInfo *) NULL)
00713 return((unsigned char *) NULL);
00714 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
00715 sizeof(*datum));
00716 if (datum == (unsigned char *) NULL)
00717 return((unsigned char *) NULL);
00718 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
00719 GetStringInfoLength(profile));
00720 *length=(unsigned long) GetStringInfoLength(profile);
00721 return(datum);
00722 }
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 WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
00755 unsigned long *number_profiles)
00756 {
00757 char
00758 **profiles;
00759
00760 const char
00761 *property;
00762
00763 register long
00764 i;
00765
00766 size_t
00767 length;
00768
00769 assert(wand != (MagickWand *) NULL);
00770 assert(wand->signature == WandSignature);
00771 if (wand->debug != MagickFalse)
00772 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00773 if (wand->images == (Image *) NULL)
00774 {
00775 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00776 "ContainsNoImages","`%s'",wand->name);
00777 return((char **) NULL);
00778 }
00779 (void) GetImageProfile(wand->images,"exif:*");
00780 length=1024;
00781 profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
00782 if (profiles == (char **) NULL)
00783 return((char **) NULL);
00784 ResetImageProfileIterator(wand->images);
00785 property=GetNextImageProfile(wand->images);
00786 for (i=0; property != (const char *) NULL; )
00787 {
00788 if ((*property != '[') &&
00789 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
00790 {
00791 if ((i+1) >= (long) length)
00792 {
00793 length<<=1;
00794 profiles=(char **) ResizeQuantumMemory(profiles,length,
00795 sizeof(*profiles));
00796 if (profiles == (char **) NULL)
00797 {
00798 (void) ThrowMagickException(wand->exception,GetMagickModule(),
00799 ResourceLimitError,"MemoryAllocationFailed","`%s'",
00800 wand->name);
00801 return((char **) NULL);
00802 }
00803 }
00804 profiles[i]=ConstantString(property);
00805 i++;
00806 }
00807 property=GetNextImageProfile(wand->images);
00808 }
00809 profiles[i]=(char *) NULL;
00810 *number_profiles=(unsigned long) i;
00811 return(profiles);
00812 }
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 WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
00841 {
00842 const char
00843 *value;
00844
00845 assert(wand != (MagickWand *) NULL);
00846 assert(wand->signature == WandSignature);
00847 if (wand->debug != MagickFalse)
00848 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00849 if (wand->images == (Image *) NULL)
00850 {
00851 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00852 "ContainsNoImages","`%s'",wand->name);
00853 return((char *) NULL);
00854 }
00855 value=GetImageProperty(wand->images,property);
00856 if (value == (const char *) NULL)
00857 return((char *) NULL);
00858 return(ConstantString(value));
00859 }
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 WandExport char **MagickGetImageProperties(MagickWand *wand,
00892 const char *pattern,unsigned long *number_properties)
00893 {
00894 char
00895 **properties;
00896
00897 const char
00898 *property;
00899
00900 register long
00901 i;
00902
00903 size_t
00904 length;
00905
00906 assert(wand != (MagickWand *) NULL);
00907 assert(wand->signature == WandSignature);
00908 if (wand->debug != MagickFalse)
00909 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00910 if (wand->images == (Image *) NULL)
00911 {
00912 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00913 "ContainsNoImages","`%s'",wand->name);
00914 return((char **) NULL);
00915 }
00916 (void) GetImageProperty(wand->images,"exif:*");
00917 length=1024;
00918 properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
00919 if (properties == (char **) NULL)
00920 return((char **) NULL);
00921 ResetImagePropertyIterator(wand->images);
00922 property=GetNextImageProperty(wand->images);
00923 for (i=0; property != (const char *) NULL; )
00924 {
00925 if ((*property != '[') &&
00926 (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
00927 {
00928 if ((i+1) >= (long) length)
00929 {
00930 length<<=1;
00931 properties=(char **) ResizeQuantumMemory(properties,length,
00932 sizeof(*properties));
00933 if (properties == (char **) NULL)
00934 {
00935 (void) ThrowMagickException(wand->exception,GetMagickModule(),
00936 ResourceLimitError,"MemoryAllocationFailed","`%s'",
00937 wand->name);
00938 return((char **) NULL);
00939 }
00940 }
00941 properties[i]=ConstantString(property);
00942 i++;
00943 }
00944 property=GetNextImageProperty(wand->images);
00945 }
00946 properties[i]=(char *) NULL;
00947 *number_properties=(unsigned long) i;
00948 return(properties);
00949 }
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973 WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
00974 {
00975 assert(wand != (MagickWand *) NULL);
00976 assert(wand->signature == WandSignature);
00977 if (wand->debug != MagickFalse)
00978 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00979 return(wand->image_info->interlace);
00980 }
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004 WandExport InterpolatePixelMethod MagickGetInterpolateMethod(MagickWand *wand)
01005 {
01006 const char
01007 *option;
01008
01009 InterpolatePixelMethod
01010 method;
01011
01012 assert(wand != (MagickWand *) NULL);
01013 assert(wand->signature == WandSignature);
01014 if (wand->debug != MagickFalse)
01015 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01016 option=GetImageOption(wand->image_info,"interpolate");
01017 if (option == (const char *) NULL)
01018 return(UndefinedInterpolatePixel);
01019 method=(InterpolatePixelMethod) ParseMagickOption(MagickInterpolateOptions,
01020 MagickFalse,option);
01021 return(method);
01022 }
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 WandExport char *MagickGetOption(MagickWand *wand,const char *key)
01051 {
01052 const char
01053 *option;
01054
01055 assert(wand != (MagickWand *) NULL);
01056 assert(wand->signature == WandSignature);
01057 if (wand->debug != MagickFalse)
01058 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01059 option=GetImageOption(wand->image_info,key);
01060 return(ConstantString(option));
01061 }
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 WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
01093 unsigned long *number_options)
01094 {
01095 char
01096 **options;
01097
01098 const char
01099 *option;
01100
01101 register long
01102 i;
01103
01104 size_t
01105 length;
01106
01107 assert(wand != (MagickWand *) NULL);
01108 assert(wand->signature == WandSignature);
01109 if (wand->debug != MagickFalse)
01110 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01111 if (wand->images == (Image *) NULL)
01112 {
01113 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
01114 "ContainsNoImages","`%s'",wand->name);
01115 return((char **) NULL);
01116 }
01117 length=1024;
01118 options=(char **) AcquireQuantumMemory(length,sizeof(*options));
01119 if (options == (char **) NULL)
01120 return((char **) NULL);
01121 ResetImageOptionIterator(wand->image_info);
01122 option=GetNextImageOption(wand->image_info);
01123 for (i=0; option != (const char *) NULL; )
01124 {
01125 if ((*option != '[') &&
01126 (GlobExpression(option,pattern,MagickFalse) != MagickFalse))
01127 {
01128 if ((i+1) >= (long) length)
01129 {
01130 length<<=1;
01131 options=(char **) ResizeQuantumMemory(options,length,
01132 sizeof(*options));
01133 if (options == (char **) NULL)
01134 {
01135 (void) ThrowMagickException(wand->exception,GetMagickModule(),
01136 ResourceLimitError,"MemoryAllocationFailed","`%s'",
01137 wand->name);
01138 return((char **) NULL);
01139 }
01140 }
01141 options[i]=ConstantString(option);
01142 i++;
01143 }
01144 option=GetNextImageOption(wand->image_info);
01145 }
01146 options[i]=(char *) NULL;
01147 *number_options=(unsigned long) i;
01148 return(options);
01149 }
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173 WandExport OrientationType MagickGetOrientation(MagickWand *wand)
01174 {
01175 assert(wand != (MagickWand *) NULL);
01176 assert(wand->signature == WandSignature);
01177 if (wand->debug != MagickFalse)
01178 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01179 return(wand->image_info->orientation);
01180 }
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202 WandExport const char *MagickGetPackageName(void)
01203 {
01204 return(GetMagickPackageName());
01205 }
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 WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
01239 unsigned long *width,unsigned long *height,long *x,long *y)
01240 {
01241 RectangleInfo
01242 geometry;
01243
01244 assert(wand != (const MagickWand *) NULL);
01245 assert(wand->signature == WandSignature);
01246 if (wand->debug != MagickFalse)
01247 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01248 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
01249 (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
01250 *width=geometry.width;
01251 *height=geometry.height;
01252 *x=geometry.x;
01253 *y=geometry.y;
01254 return(MagickTrue);
01255 }
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 WandExport double MagickGetPointsize(MagickWand *wand)
01281 {
01282 assert(wand != (MagickWand *) NULL);
01283 assert(wand->signature == WandSignature);
01284 if (wand->debug != MagickFalse)
01285 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01286 return(wand->image_info->pointsize);
01287 }
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 WandExport const char *MagickGetQuantumDepth(unsigned long *depth)
01313 {
01314 return(GetMagickQuantumDepth(depth));
01315 }
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 WandExport const char *MagickGetQuantumRange(unsigned long *range)
01341 {
01342 return(GetMagickQuantumRange(range));
01343 }
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364 WandExport const char *MagickGetReleaseDate(void)
01365 {
01366 return(GetMagickReleaseDate());
01367 }
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391 WandExport MagickSizeType MagickGetResource(const ResourceType type)
01392 {
01393 return(GetMagickResource(type));
01394 }
01395
01396
01397
01398
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418 WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
01419 {
01420 return(GetMagickResourceLimit(type));
01421 }
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 WandExport double *MagickGetSamplingFactors(MagickWand *wand,
01449 unsigned long *number_factors)
01450 {
01451 double
01452 *sampling_factors;
01453
01454 register const char
01455 *p;
01456
01457 register long
01458 i;
01459
01460 assert(wand != (MagickWand *) NULL);
01461 assert(wand->signature == WandSignature);
01462 if (wand->debug != MagickFalse)
01463 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01464 *number_factors=0;
01465 sampling_factors=(double *) NULL;
01466 if (wand->image_info->sampling_factor == (char *) NULL)
01467 return(sampling_factors);
01468 i=0;
01469 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
01470 {
01471 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
01472 (*p == ',')))
01473 p++;
01474 i++;
01475 }
01476 sampling_factors=(double *) AcquireQuantumMemory((size_t) i,
01477 sizeof(*sampling_factors));
01478 if (sampling_factors == (double *) NULL)
01479 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
01480 wand->image_info->filename);
01481 i=0;
01482 for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
01483 {
01484 while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
01485 (*p == ',')))
01486 p++;
01487 sampling_factors[i]=atof(p);
01488 i++;
01489 }
01490 *number_factors=(unsigned long) i;
01491 return(sampling_factors);
01492 }
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 WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
01522 unsigned long *columns,unsigned long *rows)
01523 {
01524 RectangleInfo
01525 geometry;
01526
01527 assert(wand != (const MagickWand *) NULL);
01528 assert(wand->signature == WandSignature);
01529 if (wand->debug != MagickFalse)
01530 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01531 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
01532 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
01533 *columns=geometry.width;
01534 *rows=geometry.height;
01535 return(MagickTrue);
01536 }
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 WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
01565 long *offset)
01566 {
01567 RectangleInfo
01568 geometry;
01569
01570 assert(wand != (const MagickWand *) NULL);
01571 assert(wand->signature == WandSignature);
01572 if (wand->debug != MagickFalse)
01573 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01574 (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
01575 (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
01576 *offset=geometry.x;
01577 return(MagickTrue);
01578 }
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595
01596
01597
01598
01599
01600
01601
01602 WandExport ImageType MagickGetType(MagickWand *wand)
01603 {
01604 assert(wand != (MagickWand *) NULL);
01605 assert(wand->signature == WandSignature);
01606 if (wand->debug != MagickFalse)
01607 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01608 return(wand->image_info->type);
01609 }
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 WandExport const char *MagickGetVersion(unsigned long *version)
01635 {
01636 return(GetMagickVersion(version));
01637 }
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 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
01672 const char *name,const void *profile,const size_t length)
01673 {
01674 MagickBooleanType
01675 status;
01676
01677 assert(wand != (MagickWand *) NULL);
01678 assert(wand->signature == WandSignature);
01679 if (wand->debug != MagickFalse)
01680 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01681 if (wand->images == (Image *) NULL)
01682 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01683 status=ProfileImage(wand->images,name,profile,length,MagickTrue);
01684 if (status == MagickFalse)
01685 InheritException(wand->exception,&wand->images->exception);
01686 return(status);
01687 }
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 WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
01717 const char *name,size_t *length)
01718 {
01719 StringInfo
01720 *profile;
01721
01722 unsigned char
01723 *datum;
01724
01725 assert(wand != (MagickWand *) NULL);
01726 assert(wand->signature == WandSignature);
01727 if (wand->debug != MagickFalse)
01728 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01729 if (wand->images == (Image *) NULL)
01730 {
01731 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
01732 "ContainsNoImages","`%s'",wand->name);
01733 return((unsigned char *) NULL);
01734 }
01735 *length=0;
01736 profile=RemoveImageProfile(wand->images,name);
01737 if (profile == (StringInfo *) NULL)
01738 return((unsigned char *) NULL);
01739 datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
01740 sizeof(*datum));
01741 if (datum == (unsigned char *) NULL)
01742 return((unsigned char *) NULL);
01743 (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
01744 GetStringInfoLength(profile));
01745 *length=GetStringInfoLength(profile);
01746 profile=DestroyStringInfo(profile);
01747 return(datum);
01748 }
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 WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
01776 const MagickBooleanType antialias)
01777 {
01778 assert(wand != (MagickWand *) NULL);
01779 assert(wand->signature == WandSignature);
01780 if (wand->debug != MagickFalse)
01781 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01782 wand->image_info->antialias=antialias;
01783 return(MagickTrue);
01784 }
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 WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
01812 const PixelWand *background)
01813 {
01814 assert(wand != (MagickWand *) NULL);
01815 assert(wand->signature == WandSignature);
01816 if (wand->debug != MagickFalse)
01817 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01818 PixelGetQuantumColor(background,&wand->image_info->background_color);
01819 return(MagickTrue);
01820 }
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 WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
01848 const ColorspaceType colorspace)
01849 {
01850 assert(wand != (MagickWand *) NULL);
01851 assert(wand->signature == WandSignature);
01852 if (wand->debug != MagickFalse)
01853 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01854 wand->image_info->colorspace=colorspace;
01855 return(MagickTrue);
01856 }
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 WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
01884 const CompressionType compression)
01885 {
01886 assert(wand != (MagickWand *) NULL);
01887 assert(wand->signature == WandSignature);
01888 if (wand->debug != MagickFalse)
01889 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01890 wand->image_info->compression=compression;
01891 return(MagickTrue);
01892 }
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 WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
01920 const unsigned long quality)
01921 {
01922 assert(wand != (MagickWand *) NULL);
01923 assert(wand->signature == WandSignature);
01924 if (wand->debug != MagickFalse)
01925 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01926 wand->image_info->quality=quality;
01927 return(MagickTrue);
01928 }
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 WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
01956 const unsigned long depth)
01957 {
01958 assert(wand != (MagickWand *) NULL);
01959 assert(wand->signature == WandSignature);
01960 if (wand->debug != MagickFalse)
01961 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01962 wand->image_info->depth=depth;
01963 return(MagickTrue);
01964 }
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 WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
01994 const char *geometry)
01995 {
01996 assert(wand != (MagickWand *) NULL);
01997 assert(wand->signature == WandSignature);
01998 if (wand->debug != MagickFalse)
01999 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02000 if (geometry != (const char *) NULL)
02001 (void) CopyMagickString(wand->image_info->extract,geometry,MaxTextExtent);
02002 return(MagickTrue);
02003 }
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 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
02031 const char *filename)
02032 {
02033 assert(wand != (MagickWand *) NULL);
02034 assert(wand->signature == WandSignature);
02035 if (wand->debug != MagickFalse)
02036 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02037 if (filename != (const char *) NULL)
02038 (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent);
02039 return(MagickTrue);
02040 }
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 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
02067 {
02068 if ((font == (const char *) NULL) || (*font == '\0'))
02069 return(MagickFalse);
02070 assert(wand != (MagickWand *) NULL);
02071 assert(wand->signature == WandSignature);
02072 if (wand->debug != MagickFalse)
02073 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02074 (void) CloneString(&wand->image_info->font,font);
02075 return(MagickTrue);
02076 }
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 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
02103 const char *format)
02104 {
02105 const MagickInfo
02106 *magick_info;
02107
02108 assert(wand != (MagickWand *) NULL);
02109 assert(wand->signature == WandSignature);
02110 if (wand->debug != MagickFalse)
02111 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02112 if ((format == (char *) NULL) || (*format == '\0'))
02113 {
02114 *wand->image_info->magick='\0';
02115 return(MagickTrue);
02116 }
02117 magick_info=GetMagickInfo(format,wand->exception);
02118 if (magick_info == (const MagickInfo *) NULL)
02119 return(MagickFalse);
02120 ClearMagickException(wand->exception);
02121 (void) CopyMagickString(wand->image_info->magick,format,MaxTextExtent);
02122 return(MagickTrue);
02123 }
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 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
02151 const GravityType type)
02152 {
02153 MagickBooleanType
02154 status;
02155
02156 assert(wand != (MagickWand *) NULL);
02157 assert(wand->signature == WandSignature);
02158 if (wand->debug != MagickFalse)
02159 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02160 status=SetImageOption(wand->image_info,"gravity",MagickOptionToMnemonic(
02161 MagickGravityOptions,(long) type));
02162 return(status);
02163 }
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 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
02193 const char *artifact,const char *value)
02194 {
02195 MagickBooleanType
02196 status;
02197
02198 assert(wand != (MagickWand *) NULL);
02199 assert(wand->signature == WandSignature);
02200 if (wand->debug != MagickFalse)
02201 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02202 if (wand->images == (Image *) NULL)
02203 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02204 status=SetImageArtifact(wand->images,artifact,value);
02205 if (status == MagickFalse)
02206 InheritException(wand->exception,&wand->images->exception);
02207 return(status);
02208 }
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 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
02243 const char *name,const void *profile,const size_t length)
02244 {
02245 MagickBooleanType
02246 status;
02247
02248 StringInfo
02249 *profile_info;
02250
02251 assert(wand != (MagickWand *) NULL);
02252 assert(wand->signature == WandSignature);
02253 if (wand->debug != MagickFalse)
02254 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02255 if (wand->images == (Image *) NULL)
02256 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02257 profile_info=AcquireStringInfo((size_t) length);
02258 SetStringInfoDatum(profile_info,(unsigned char *) profile);
02259 status=SetImageProfile(wand->images,name,profile_info);
02260 profile_info=DestroyStringInfo(profile_info);
02261 if (status == MagickFalse)
02262 InheritException(wand->exception,&wand->images->exception);
02263 return(status);
02264 }
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 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
02294 const char *property,const char *value)
02295 {
02296 MagickBooleanType
02297 status;
02298
02299 assert(wand != (MagickWand *) NULL);
02300 assert(wand->signature == WandSignature);
02301 if (wand->debug != MagickFalse)
02302 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02303 if (wand->images == (Image *) NULL)
02304 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02305 status=SetImageProperty(wand->images,property,value);
02306 if (status == MagickFalse)
02307 InheritException(wand->exception,&wand->images->exception);
02308 return(status);
02309 }
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 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
02338 const InterlaceType interlace_scheme)
02339 {
02340 assert(wand != (MagickWand *) NULL);
02341 assert(wand->signature == WandSignature);
02342 if (wand->debug != MagickFalse)
02343 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02344 wand->image_info->interlace=interlace_scheme;
02345 return(MagickTrue);
02346 }
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 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
02374 const InterpolatePixelMethod method)
02375 {
02376 MagickBooleanType
02377 status;
02378
02379 assert(wand != (MagickWand *) NULL);
02380 assert(wand->signature == WandSignature);
02381 if (wand->debug != MagickFalse)
02382 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02383 status=SetImageOption(wand->image_info,"interpolate",
02384 MagickOptionToMnemonic(MagickInterpolateOptions,(long) method));
02385 return(status);
02386 }
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 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
02417 const char *value)
02418 {
02419 assert(wand != (MagickWand *) NULL);
02420 assert(wand->signature == WandSignature);
02421 if (wand->debug != MagickFalse)
02422 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02423 return(SetImageOption(wand->image_info,key,value));
02424 }
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 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
02452 const OrientationType orientation)
02453 {
02454 assert(wand != (MagickWand *) NULL);
02455 assert(wand->signature == WandSignature);
02456 if (wand->debug != MagickFalse)
02457 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02458 wand->image_info->orientation=orientation;
02459 return(MagickTrue);
02460 }
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 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
02495 const unsigned long width,const unsigned long height,const long x,
02496 const long y)
02497 {
02498 char
02499 geometry[MaxTextExtent];
02500
02501 assert(wand != (MagickWand *) NULL);
02502 assert(wand->signature == WandSignature);
02503 if (wand->debug != MagickFalse)
02504 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02505 (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu%+ld%+ld",
02506 width,height,x,y);
02507 (void) CloneString(&wand->image_info->page,geometry);
02508 return(MagickTrue);
02509 }
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 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
02537 const char *passphrase)
02538 {
02539 assert(wand != (MagickWand *) NULL);
02540 assert(wand->signature == WandSignature);
02541 if (wand->debug != MagickFalse)
02542 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02543 (void) CloneString(&wand->image_info->authenticate,passphrase);
02544 return(MagickTrue);
02545 }
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 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
02573 const double pointsize)
02574 {
02575 assert(wand != (MagickWand *) NULL);
02576 assert(wand->signature == WandSignature);
02577 if (wand->debug != MagickFalse)
02578 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02579 wand->image_info->pointsize=pointsize;
02580 return(MagickTrue);
02581 }
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 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
02621 const MagickProgressMonitor progress_monitor,void *client_data)
02622 {
02623 MagickProgressMonitor
02624 previous_monitor;
02625
02626 assert(wand != (MagickWand *) NULL);
02627 assert(wand->signature == WandSignature);
02628 if (wand->debug != MagickFalse)
02629 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02630 previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
02631 progress_monitor,client_data);
02632 return(previous_monitor);
02633 }
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 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
02663 const MagickSizeType limit)
02664 {
02665 return(SetMagickResourceLimit(type,limit));
02666 }
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 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
02696 const double x_resolution,const double y_resolution)
02697 {
02698 char
02699 density[MaxTextExtent];
02700
02701 assert(wand != (MagickWand *) NULL);
02702 assert(wand->signature == WandSignature);
02703 if (wand->debug != MagickFalse)
02704 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02705 (void) FormatMagickString(density,MaxTextExtent,"%gx%g",x_resolution,
02706 y_resolution);
02707 (void) CloneString(&wand->image_info->density,density);
02708 return(MagickTrue);
02709 }
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 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
02740 const unsigned long number_factors,const double *sampling_factors)
02741 {
02742 char
02743 sampling_factor[MaxTextExtent];
02744
02745 register long
02746 i;
02747
02748 assert(wand != (MagickWand *) NULL);
02749 assert(wand->signature == WandSignature);
02750 if (wand->debug != MagickFalse)
02751 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02752 if (wand->image_info->sampling_factor != (char *) NULL)
02753 wand->image_info->sampling_factor=(char *)
02754 RelinquishMagickMemory(wand->image_info->sampling_factor);
02755 if (number_factors == 0)
02756 return(MagickTrue);
02757 for (i=0; i < (long) (number_factors-1); i++)
02758 {
02759 (void) FormatMagickString(sampling_factor,MaxTextExtent,"%g,",
02760 sampling_factors[i]);
02761 (void) ConcatenateString(&wand->image_info->sampling_factor,
02762 sampling_factor);
02763 }
02764 (void) FormatMagickString(sampling_factor,MaxTextExtent,"%g",
02765 sampling_factors[i]);
02766 (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
02767 return(MagickTrue);
02768 }
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 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
02799 const unsigned long columns,const unsigned long rows)
02800 {
02801 char
02802 geometry[MaxTextExtent];
02803
02804 assert(wand != (MagickWand *) NULL);
02805 assert(wand->signature == WandSignature);
02806 if (wand->debug != MagickFalse)
02807 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02808 (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu",columns,rows);
02809 (void) CloneString(&wand->image_info->size,geometry);
02810 return(MagickTrue);
02811 }
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 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
02845 const unsigned long columns,const unsigned long rows,const long offset)
02846 {
02847 char
02848 geometry[MaxTextExtent];
02849
02850 assert(wand != (MagickWand *) NULL);
02851 assert(wand->signature == WandSignature);
02852 if (wand->debug != MagickFalse)
02853 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02854 (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu%+ld",columns,rows,
02855 offset);
02856 (void) CloneString(&wand->image_info->size,geometry);
02857 return(MagickTrue);
02858 }
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 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
02889 const ImageType image_type)
02890 {
02891 assert(wand != (MagickWand *) NULL);
02892 assert(wand->signature == WandSignature);
02893 if (wand->debug != MagickFalse)
02894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02895 wand->image_info->type=image_type;
02896 return(MagickTrue);
02897 }