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 "wand/pixel-wand-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 #define MagickWandId "MagickWand"
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
00091
00092 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
00093 Image *images)
00094 {
00095 MagickWand
00096 *clone_wand;
00097
00098 assert(wand != (MagickWand *) NULL);
00099 assert(wand->signature == WandSignature);
00100 if (wand->debug != MagickFalse)
00101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00102 clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
00103 if (clone_wand == (MagickWand *) NULL)
00104 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
00105 images->filename);
00106 (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
00107 clone_wand->id=AcquireWandId();
00108 (void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%lu",
00109 MagickWandId,clone_wand->id);
00110 clone_wand->exception=AcquireExceptionInfo();
00111 InheritException(clone_wand->exception,wand->exception);
00112 clone_wand->image_info=CloneImageInfo(wand->image_info);
00113 clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
00114 clone_wand->images=images;
00115 clone_wand->debug=IsEventLogging();
00116 if (clone_wand->debug != MagickFalse)
00117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
00118 clone_wand->signature=WandSignature;
00119 return(clone_wand);
00120 }
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144 WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
00145 {
00146 assert(wand != (MagickWand *) NULL);
00147 assert(wand->signature == WandSignature);
00148 if (wand->debug != MagickFalse)
00149 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00150 if (wand->images == (Image *) NULL)
00151 {
00152 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00153 "ContainsNoImages","`%s'",wand->name);
00154 return((Image *) NULL);
00155 }
00156 return(wand->images);
00157 }
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
00198 const double radius,const double sigma)
00199 {
00200 MagickBooleanType
00201 status;
00202
00203 status=MagickAdaptiveBlurImageChannel(wand,DefaultChannels,radius,sigma);
00204 return(status);
00205 }
00206
00207 WandExport MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,
00208 const ChannelType channel,const double radius,const double sigma)
00209 {
00210 Image
00211 *sharp_image;
00212
00213 assert(wand != (MagickWand *) NULL);
00214 assert(wand->signature == WandSignature);
00215 if (wand->debug != MagickFalse)
00216 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00217 if (wand->images == (Image *) NULL)
00218 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00219 sharp_image=AdaptiveBlurImageChannel(wand->images,channel,radius,sigma,
00220 wand->exception);
00221 if (sharp_image == (Image *) NULL)
00222 return(MagickFalse);
00223 ReplaceImageInList(&wand->images,sharp_image);
00224 return(MagickTrue);
00225 }
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
00254 const unsigned long columns,const unsigned long rows)
00255 {
00256 Image
00257 *resize_image;
00258
00259 assert(wand != (MagickWand *) NULL);
00260 assert(wand->signature == WandSignature);
00261 if (wand->debug != MagickFalse)
00262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00263 if (wand->images == (Image *) NULL)
00264 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00265 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
00266 if (resize_image == (Image *) NULL)
00267 return(MagickFalse);
00268 ReplaceImageInList(&wand->images,resize_image);
00269 return(MagickTrue);
00270 }
00271
00272
00273
00274
00275
00276
00277
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
00303
00304
00305
00306
00307
00308
00309
00310 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
00311 const double radius,const double sigma)
00312 {
00313 MagickBooleanType
00314 status;
00315
00316 status=MagickAdaptiveSharpenImageChannel(wand,DefaultChannels,radius,sigma);
00317 return(status);
00318 }
00319
00320 WandExport MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand,
00321 const ChannelType channel,const double radius,const double sigma)
00322 {
00323 Image
00324 *sharp_image;
00325
00326 assert(wand != (MagickWand *) NULL);
00327 assert(wand->signature == WandSignature);
00328 if (wand->debug != MagickFalse)
00329 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00330 if (wand->images == (Image *) NULL)
00331 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00332 sharp_image=AdaptiveSharpenImageChannel(wand->images,channel,radius,sigma,
00333 wand->exception);
00334 if (sharp_image == (Image *) NULL)
00335 return(MagickFalse);
00336 ReplaceImageInList(&wand->images,sharp_image);
00337 return(MagickTrue);
00338 }
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
00373 const unsigned long width,const unsigned long height,const long offset)
00374 {
00375 Image
00376 *threshold_image;
00377
00378 assert(wand != (MagickWand *) NULL);
00379 assert(wand->signature == WandSignature);
00380 if (wand->debug != MagickFalse)
00381 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00382 if (wand->images == (Image *) NULL)
00383 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00384 threshold_image=AdaptiveThresholdImage(wand->images,width,height,offset,
00385 wand->exception);
00386 if (threshold_image == (Image *) NULL)
00387 return(MagickFalse);
00388 ReplaceImageInList(&wand->images,threshold_image);
00389 return(MagickTrue);
00390 }
00391
00392
00393
00394
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 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
00420 Image *images)
00421 {
00422 Image
00423 *sentinel;
00424
00425 sentinel=wand->images;
00426 if (sentinel == (Image *) NULL)
00427 {
00428 wand->images=GetFirstImageInList(images);
00429 return(MagickTrue);
00430 }
00431 if (wand->active == MagickFalse)
00432 {
00433 if ((wand->pend != MagickFalse) && (sentinel->next == (Image *) NULL))
00434 {
00435 AppendImageToList(&sentinel,images);
00436 wand->images=GetLastImageInList(images);
00437 return(MagickTrue);
00438 }
00439 if ((wand->pend != MagickFalse) && (sentinel->previous == (Image *) NULL))
00440 {
00441 PrependImageToList(&sentinel,images);
00442 wand->images=GetFirstImageInList(images);
00443 return(MagickTrue);
00444 }
00445 }
00446 InsertImageInList(&sentinel,images);
00447 wand->images=GetFirstImageInList(images);
00448 return(MagickTrue);
00449 }
00450
00451 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
00452 const MagickWand *add_wand)
00453 {
00454 Image
00455 *images;
00456
00457 assert(wand != (MagickWand *) NULL);
00458 assert(wand->signature == WandSignature);
00459 if (wand->debug != MagickFalse)
00460 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00461 assert(add_wand != (MagickWand *) NULL);
00462 assert(add_wand->signature == WandSignature);
00463 if (add_wand->images == (Image *) NULL)
00464 ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
00465 images=CloneImageList(add_wand->images,wand->exception);
00466 if (images == (Image *) NULL)
00467 return(MagickFalse);
00468 return(InsertImageInWand(wand,images));
00469 }
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
00502 const NoiseType noise_type)
00503 {
00504 MagickBooleanType
00505 status;
00506
00507 status=MagickAddNoiseImageChannel(wand,DefaultChannels,noise_type);
00508 return(status);
00509 }
00510
00511 WandExport MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,
00512 const ChannelType channel,const NoiseType noise_type)
00513 {
00514 Image
00515 *noise_image;
00516
00517 assert(wand != (MagickWand *) NULL);
00518 assert(wand->signature == WandSignature);
00519 if (wand->debug != MagickFalse)
00520 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00521 if (wand->images == (Image *) NULL)
00522 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00523 noise_image=AddNoiseImageChannel(wand->images,channel,noise_type,
00524 wand->exception);
00525 if (noise_image == (Image *) NULL)
00526 return(MagickFalse);
00527 ReplaceImageInList(&wand->images,noise_image);
00528 return(MagickTrue);
00529 }
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
00558 const DrawingWand *drawing_wand)
00559 {
00560 DrawInfo
00561 *draw_info;
00562
00563 Image
00564 *affine_image;
00565
00566 assert(wand != (MagickWand *) NULL);
00567 assert(wand->signature == WandSignature);
00568 if (wand->debug != MagickFalse)
00569 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00570 if (wand->images == (Image *) NULL)
00571 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00572 draw_info=PeekDrawingWand(drawing_wand);
00573 if (draw_info == (DrawInfo *) NULL)
00574 return(MagickFalse);
00575 affine_image=AffineTransformImage(wand->images,&draw_info->affine,
00576 wand->exception);
00577 draw_info=DestroyDrawInfo(draw_info);
00578 if (affine_image == (Image *) NULL)
00579 return(MagickFalse);
00580 ReplaceImageInList(&wand->images,affine_image);
00581 return(MagickTrue);
00582 }
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
00619 const DrawingWand *drawing_wand,const double x,const double y,
00620 const double angle,const char *text)
00621 {
00622 char
00623 geometry[MaxTextExtent];
00624
00625 DrawInfo
00626 *draw_info;
00627
00628 MagickBooleanType
00629 status;
00630
00631 assert(wand != (MagickWand *) NULL);
00632 assert(wand->signature == WandSignature);
00633 if (wand->debug != MagickFalse)
00634 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00635 if (wand->images == (Image *) NULL)
00636 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00637 draw_info=PeekDrawingWand(drawing_wand);
00638 if (draw_info == (DrawInfo *) NULL)
00639 return(MagickFalse);
00640 (void) CloneString(&draw_info->text,text);
00641 (void) FormatMagickString(geometry,MaxTextExtent,"%+g%+g",x,y);
00642 draw_info->affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
00643 draw_info->affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
00644 draw_info->affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
00645 draw_info->affine.sy=cos(DegreesToRadians(fmod(angle,360.0)));
00646 (void) CloneString(&draw_info->geometry,geometry);
00647 status=AnnotateImage(wand->images,draw_info);
00648 draw_info=DestroyDrawInfo(draw_info);
00649 if (status == MagickFalse)
00650 InheritException(wand->exception,&wand->images->exception);
00651 return(status);
00652 }
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
00680 const char *server_name)
00681 {
00682 MagickBooleanType
00683 status;
00684
00685 assert(wand != (MagickWand *) NULL);
00686 assert(wand->signature == WandSignature);
00687 if (wand->debug != MagickFalse)
00688 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00689 (void) CloneString(&wand->image_info->server_name,server_name);
00690 status=AnimateImages(wand->image_info,wand->images);
00691 if (status == MagickFalse)
00692 InheritException(wand->exception,&wand->images->exception);
00693 return(status);
00694 }
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
00723 const MagickBooleanType stack)
00724 {
00725 Image
00726 *append_image;
00727
00728 assert(wand != (MagickWand *) NULL);
00729 assert(wand->signature == WandSignature);
00730 if (wand->debug != MagickFalse)
00731 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00732 if (wand->images == (Image *) NULL)
00733 return((MagickWand *) NULL);
00734 append_image=AppendImages(wand->images,stack,wand->exception);
00735 if (append_image == (Image *) NULL)
00736 return((MagickWand *) NULL);
00737 return(CloneMagickWandFromImages(wand,append_image));
00738 }
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762 WandExport MagickWand *MagickAverageImages(MagickWand *wand)
00763 {
00764 Image
00765 *average_image;
00766
00767 assert(wand != (MagickWand *) NULL);
00768 assert(wand->signature == WandSignature);
00769 if (wand->debug != MagickFalse)
00770 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00771 if (wand->images == (Image *) NULL)
00772 return((MagickWand *) NULL);
00773 average_image=AverageImages(wand->images,wand->exception);
00774 if (average_image == (Image *) NULL)
00775 return((MagickWand *) NULL);
00776 return(CloneMagickWandFromImages(wand,average_image));
00777 }
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
00807 const PixelWand *threshold)
00808 {
00809 char
00810 thresholds[MaxTextExtent];
00811
00812 MagickBooleanType
00813 status;
00814
00815 assert(wand != (MagickWand *) NULL);
00816 assert(wand->signature == WandSignature);
00817 if (wand->debug != MagickFalse)
00818 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00819 if (wand->images == (Image *) NULL)
00820 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00821 (void) FormatMagickString(thresholds,MaxTextExtent,
00822 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
00823 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
00824 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
00825 status=BlackThresholdImage(wand->images,thresholds);
00826 if (status == MagickFalse)
00827 InheritException(wand->exception,&wand->images->exception);
00828 return(status);
00829 }
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand)
00855 {
00856 Image
00857 *shift_image;
00858
00859 assert(wand != (MagickWand *) NULL);
00860 assert(wand->signature == WandSignature);
00861 if (wand->debug != MagickFalse)
00862 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00863 if (wand->images == (Image *) NULL)
00864 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00865 shift_image=BlueShiftImage(wand->images,wand->exception);
00866 if (shift_image == (Image *) NULL)
00867 return(MagickFalse);
00868 ReplaceImageInList(&wand->images,shift_image);
00869 return(MagickTrue);
00870 }
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
00909 const double radius,const double sigma)
00910 {
00911 MagickBooleanType
00912 status;
00913
00914 status=MagickBlurImageChannel(wand,DefaultChannels,radius,sigma);
00915 return(status);
00916 }
00917
00918 WandExport MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
00919 const ChannelType channel,const double radius,const double sigma)
00920 {
00921 Image
00922 *blur_image;
00923
00924 assert(wand != (MagickWand *) NULL);
00925 assert(wand->signature == WandSignature);
00926 if (wand->debug != MagickFalse)
00927 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00928 if (wand->images == (Image *) NULL)
00929 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00930 blur_image=BlurImageChannel(wand->images,channel,radius,sigma,
00931 wand->exception);
00932 if (blur_image == (Image *) NULL)
00933 return(MagickFalse);
00934 ReplaceImageInList(&wand->images,blur_image);
00935 return(MagickTrue);
00936 }
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
00970 const PixelWand *bordercolor,const unsigned long width,
00971 const unsigned long height)
00972 {
00973 Image
00974 *border_image;
00975
00976 RectangleInfo
00977 border_info;
00978
00979 assert(wand != (MagickWand *) NULL);
00980 assert(wand->signature == WandSignature);
00981 if (wand->debug != MagickFalse)
00982 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00983 if (wand->images == (Image *) NULL)
00984 ThrowWandException(WandError,"ContainsNoImages",wand->name);
00985 border_info.width=width;
00986 border_info.height=height;
00987 border_info.x=0;
00988 border_info.y=0;
00989 PixelGetQuantumColor(bordercolor,&wand->images->border_color);
00990 border_image=BorderImage(wand->images,&border_info,wand->exception);
00991 if (border_image == (Image *) NULL)
00992 return(MagickFalse);
00993 ReplaceImageInList(&wand->images,border_image);
00994 return(MagickTrue);
00995 }
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
01026 const double radius,const double sigma)
01027 {
01028 Image
01029 *charcoal_image;
01030
01031 assert(wand != (MagickWand *) NULL);
01032 assert(wand->signature == WandSignature);
01033 if (wand->debug != MagickFalse)
01034 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01035 if (wand->images == (Image *) NULL)
01036 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01037 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
01038 if (charcoal_image == (Image *) NULL)
01039 return(MagickFalse);
01040 ReplaceImageInList(&wand->images,charcoal_image);
01041 return(MagickTrue);
01042 }
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077
01078 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
01079 const unsigned long width,const unsigned long height,const long x,
01080 const long y)
01081 {
01082 Image
01083 *chop_image;
01084
01085 RectangleInfo
01086 chop;
01087
01088 assert(wand != (MagickWand *) NULL);
01089 assert(wand->signature == WandSignature);
01090 if (wand->debug != MagickFalse)
01091 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01092 if (wand->images == (Image *) NULL)
01093 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01094 chop.width=width;
01095 chop.height=height;
01096 chop.x=x;
01097 chop.y=y;
01098 chop_image=ChopImage(wand->images,&chop,wand->exception);
01099 if (chop_image == (Image *) NULL)
01100 return(MagickFalse);
01101 ReplaceImageInList(&wand->images,chop_image);
01102 return(MagickTrue);
01103 }
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127
01128 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
01129 {
01130 MagickBooleanType
01131 status;
01132
01133 assert(wand != (MagickWand *) NULL);
01134 assert(wand->signature == WandSignature);
01135 if (wand->debug != MagickFalse)
01136 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01137 if (wand->images == (Image *) NULL)
01138 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01139 status=ClipImage(wand->images);
01140 if (status == MagickFalse)
01141 InheritException(wand->exception,&wand->images->exception);
01142 return(status);
01143 }
01144
01145
01146
01147
01148
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
01174
01175
01176
01177 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
01178 const char *pathname,const MagickBooleanType inside)
01179 {
01180 MagickBooleanType
01181 status;
01182
01183 assert(wand != (MagickWand *) NULL);
01184 assert(wand->signature == WandSignature);
01185 if (wand->debug != MagickFalse)
01186 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01187 if (wand->images == (Image *) NULL)
01188 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01189 status=ClipImagePath(wand->images,pathname,inside);
01190 if (status == MagickFalse)
01191 InheritException(wand->exception,&wand->images->exception);
01192 return(status);
01193 }
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
01224 const MagickWand *clut_wand)
01225 {
01226 MagickBooleanType
01227 status;
01228
01229 status=MagickClutImageChannel(wand,DefaultChannels,clut_wand);
01230 return(status);
01231 }
01232
01233 WandExport MagickBooleanType MagickClutImageChannel(MagickWand *wand,
01234 const ChannelType channel,const MagickWand *clut_wand)
01235 {
01236 MagickBooleanType
01237 status;
01238
01239 assert(wand != (MagickWand *) NULL);
01240 assert(wand->signature == WandSignature);
01241 if (wand->debug != MagickFalse)
01242 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01243 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
01244 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01245 status=ClutImageChannel(wand->images,channel,clut_wand->images);
01246 if (status == MagickFalse)
01247 InheritException(wand->exception,&wand->images->exception);
01248 return(status);
01249 }
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
01279 {
01280 Image
01281 *coalesce_image;
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 if (wand->images == (Image *) NULL)
01288 return((MagickWand *) NULL);
01289 coalesce_image=CoalesceImages(wand->images,wand->exception);
01290 if (coalesce_image == (Image *) NULL)
01291 return((MagickWand *) NULL);
01292 return(CloneMagickWandFromImages(wand,coalesce_image));
01293 }
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
01323 const PixelWand *colorize,const PixelWand *opacity)
01324 {
01325 char
01326 percent_opaque[MaxTextExtent];
01327
01328 Image
01329 *colorize_image;
01330
01331 PixelPacket
01332 target;
01333
01334 assert(wand != (MagickWand *) NULL);
01335 assert(wand->signature == WandSignature);
01336 if (wand->debug != MagickFalse)
01337 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01338 if (wand->images == (Image *) NULL)
01339 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01340 (void) FormatMagickString(percent_opaque,MaxTextExtent,"%g,%g,%g,%g",
01341 (double) (100.0*QuantumScale*PixelGetRedQuantum(opacity)),
01342 (double) (100.0*QuantumScale*PixelGetGreenQuantum(opacity)),
01343 (double) (100.0*QuantumScale*PixelGetBlueQuantum(opacity)),
01344 (double) (100.0*QuantumScale*PixelGetOpacityQuantum(opacity)));
01345 PixelGetQuantumColor(colorize,&target);
01346 colorize_image=ColorizeImage(wand->images,percent_opaque,target,
01347 wand->exception);
01348 if (colorize_image == (Image *) NULL)
01349 return(MagickFalse);
01350 ReplaceImageInList(&wand->images,colorize_image);
01351 return(MagickTrue);
01352 }
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380
01381
01382 WandExport MagickWand *MagickCombineImages(MagickWand *wand,
01383 const ChannelType channel)
01384 {
01385 Image
01386 *combine_image;
01387
01388 assert(wand != (MagickWand *) NULL);
01389 assert(wand->signature == WandSignature);
01390 if (wand->debug != MagickFalse)
01391 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01392 if (wand->images == (Image *) NULL)
01393 return((MagickWand *) NULL);
01394 combine_image=CombineImages(wand->images,channel,wand->exception);
01395 if (combine_image == (Image *) NULL)
01396 return((MagickWand *) NULL);
01397 return(CloneMagickWandFromImages(wand,combine_image));
01398 }
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421
01422
01423
01424
01425 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
01426 const char *comment)
01427 {
01428 MagickBooleanType
01429 status;
01430
01431 assert(wand != (MagickWand *) NULL);
01432 assert(wand->signature == WandSignature);
01433 if (wand->debug != MagickFalse)
01434 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01435 if (wand->images == (Image *) NULL)
01436 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01437 status=SetImageProperty(wand->images,"comment",comment);
01438 if (status == MagickFalse)
01439 InheritException(wand->exception,&wand->images->exception);
01440 return(status);
01441 }
01442
01443
01444
01445
01446
01447
01448
01449
01450
01451
01452
01453
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464
01465
01466
01467
01468
01469
01470
01471
01472
01473
01474
01475
01476 WandExport MagickWand *MagickCompareImageChannels(MagickWand *wand,
01477 const MagickWand *reference,const ChannelType channel,const MetricType metric,
01478 double *distortion)
01479 {
01480 Image
01481 *compare_image;
01482
01483 assert(wand != (MagickWand *) NULL);
01484 assert(wand->signature == WandSignature);
01485 if (wand->debug != MagickFalse)
01486 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01487 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
01488 {
01489 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
01490 "ContainsNoImages","`%s'",wand->name);
01491 return((MagickWand *) NULL);
01492 }
01493 compare_image=CompareImageChannels(wand->images,reference->images,channel,
01494 metric,distortion,&wand->images->exception);
01495 if (compare_image == (Image *) NULL)
01496 return((MagickWand *) NULL);
01497 return(CloneMagickWandFromImages(wand,compare_image));
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
01523
01524
01525
01526
01527 WandExport MagickWand *MagickCompareImageLayers(MagickWand *wand,
01528 const ImageLayerMethod method)
01529 {
01530 Image
01531 *layers_image;
01532
01533 assert(wand != (MagickWand *) NULL);
01534 assert(wand->signature == WandSignature);
01535 if (wand->debug != MagickFalse)
01536 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01537 if (wand->images == (Image *) NULL)
01538 return((MagickWand *) NULL);
01539 layers_image=CompareImageLayers(wand->images,method,wand->exception);
01540 if (layers_image == (Image *) NULL)
01541 return((MagickWand *) NULL);
01542 return(CloneMagickWandFromImages(wand,layers_image));
01543 }
01544
01545
01546
01547
01548
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565
01566
01567
01568
01569
01570
01571
01572
01573
01574
01575
01576 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
01577 const MagickWand *reference,const MetricType metric,double *distortion)
01578 {
01579 Image
01580 *compare_image;
01581
01582
01583 assert(wand != (MagickWand *) NULL);
01584 assert(wand->signature == WandSignature);
01585 if (wand->debug != MagickFalse)
01586 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01587 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
01588 {
01589 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
01590 "ContainsNoImages","`%s'",wand->name);
01591 return((MagickWand *) NULL);
01592 }
01593 compare_image=CompareImages(wand->images,reference->images,metric,distortion,
01594 &wand->images->exception);
01595 if (compare_image == (Image *) NULL)
01596 return((MagickWand *) NULL);
01597 return(CloneMagickWandFromImages(wand,compare_image));
01598 }
01599
01600
01601
01602
01603
01604
01605
01606
01607
01608
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
01635
01636
01637
01638
01639
01640
01641
01642
01643
01644 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
01645 const MagickWand *composite_wand,const CompositeOperator compose,const long x,
01646 const long y)
01647 {
01648 MagickBooleanType
01649 status;
01650
01651 status=MagickCompositeImageChannel(wand,DefaultChannels,composite_wand,
01652 compose,x,y);
01653 return(status);
01654 }
01655
01656 WandExport MagickBooleanType MagickCompositeImageChannel(MagickWand *wand,
01657 const ChannelType channel,const MagickWand *composite_wand,
01658 const CompositeOperator compose,const long x,const long y)
01659 {
01660 MagickBooleanType
01661 status;
01662
01663 assert(wand != (MagickWand *) NULL);
01664 assert(wand->signature == WandSignature);
01665 if (wand->debug != MagickFalse)
01666 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01667 if ((wand->images == (Image *) NULL) ||
01668 (composite_wand->images == (Image *) NULL))
01669 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01670 status=CompositeImageChannel(wand->images,channel,compose,
01671 composite_wand->images,x,y);
01672 if (status == MagickFalse)
01673 InheritException(wand->exception,&wand->images->exception);
01674 return(status);
01675 }
01676
01677
01678
01679
01680
01681
01682
01683
01684
01685
01686
01687
01688
01689
01690
01691
01692
01693
01694
01695
01696
01697
01698
01699
01700
01701
01702
01703
01704
01705 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
01706 const MagickBooleanType sharpen)
01707 {
01708 MagickBooleanType
01709 status;
01710
01711 assert(wand != (MagickWand *) NULL);
01712 assert(wand->signature == WandSignature);
01713 if (wand->debug != MagickFalse)
01714 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01715 if (wand->images == (Image *) NULL)
01716 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01717 status=ContrastImage(wand->images,sharpen);
01718 if (status == MagickFalse)
01719 InheritException(wand->exception,&wand->images->exception);
01720 return(status);
01721 }
01722
01723
01724
01725
01726
01727
01728
01729
01730
01731
01732
01733
01734
01735
01736
01737
01738
01739
01740
01741
01742
01743
01744
01745
01746
01747
01748
01749
01750
01751
01752
01753
01754
01755
01756
01757
01758
01759 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
01760 const double black_point,const double white_point)
01761 {
01762 MagickBooleanType
01763 status;
01764
01765 status=MagickContrastStretchImageChannel(wand,DefaultChannels,black_point,
01766 white_point);
01767 return(status);
01768 }
01769
01770 WandExport MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand,
01771 const ChannelType channel,const double black_point,const double white_point)
01772 {
01773 MagickBooleanType
01774 status;
01775
01776 assert(wand != (MagickWand *) NULL);
01777 assert(wand->signature == WandSignature);
01778 if (wand->debug != MagickFalse)
01779 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01780 if (wand->images == (Image *) NULL)
01781 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01782 status=ContrastStretchImageChannel(wand->images,channel,black_point,
01783 white_point);
01784 if (status == MagickFalse)
01785 InheritException(wand->exception,&wand->images->exception);
01786 return(status);
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
01813
01814
01815
01816
01817
01818
01819
01820
01821
01822 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
01823 const unsigned long order,const double *kernel)
01824 {
01825 MagickBooleanType
01826 status;
01827
01828 status=MagickConvolveImageChannel(wand,DefaultChannels,order,kernel);
01829 return(status);
01830 }
01831
01832 WandExport MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
01833 const ChannelType channel,const unsigned long order,const double *kernel)
01834 {
01835 Image
01836 *convolve_image;
01837
01838 assert(wand != (MagickWand *) NULL);
01839 assert(wand->signature == WandSignature);
01840 if (wand->debug != MagickFalse)
01841 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01842 if (kernel == (const double *) NULL)
01843 return(MagickFalse);
01844 if (wand->images == (Image *) NULL)
01845 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01846 convolve_image=ConvolveImageChannel(wand->images,channel,order,kernel,
01847 wand->exception);
01848 if (convolve_image == (Image *) NULL)
01849 return(MagickFalse);
01850 ReplaceImageInList(&wand->images,convolve_image);
01851 return(MagickTrue);
01852 }
01853
01854
01855
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
01884
01885
01886 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
01887 const unsigned long width,const unsigned long height,const long x,
01888 const long y)
01889 {
01890 Image
01891 *crop_image;
01892
01893 RectangleInfo
01894 crop;
01895
01896 assert(wand != (MagickWand *) NULL);
01897 assert(wand->signature == WandSignature);
01898 if (wand->debug != MagickFalse)
01899 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01900 if (wand->images == (Image *) NULL)
01901 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01902 crop.width=width;
01903 crop.height=height;
01904 crop.x=x;
01905 crop.y=y;
01906 crop_image=CropImage(wand->images,&crop,wand->exception);
01907 if (crop_image == (Image *) NULL)
01908 return(MagickFalse);
01909 ReplaceImageInList(&wand->images,crop_image);
01910 return(MagickTrue);
01911 }
01912
01913
01914
01915
01916
01917
01918
01919
01920
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
01941 const long displace)
01942 {
01943 MagickBooleanType
01944 status;
01945
01946 assert(wand != (MagickWand *) NULL);
01947 assert(wand->signature == WandSignature);
01948 if (wand->debug != MagickFalse)
01949 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01950 if (wand->images == (Image *) NULL)
01951 ThrowWandException(WandError,"ContainsNoImages",wand->name);
01952 status=CycleColormapImage(wand->images,displace);
01953 if (status == MagickFalse)
01954 InheritException(wand->exception,&wand->images->exception);
01955 return(status);
01956 }
01957
01958
01959
01960
01961
01962
01963
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
01994
01995
01996
01997
01998
01999
02000
02001
02002
02003
02004
02005
02006
02007
02008
02009
02010 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
02011 const unsigned long columns,const unsigned long rows,const char *map,
02012 const StorageType storage,const void *pixels)
02013 {
02014 Image
02015 *images;
02016
02017 assert(wand != (MagickWand *) NULL);
02018 assert(wand->signature == WandSignature);
02019 if (wand->debug != MagickFalse)
02020 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02021 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
02022 if (images == (Image *) NULL)
02023 return(MagickFalse);
02024 return(InsertImageInWand(wand,images));
02025 }
02026
02027
02028
02029
02030
02031
02032
02033
02034
02035
02036
02037
02038
02039
02040
02041
02042
02043
02044
02045
02046
02047
02048
02049
02050
02051
02052 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
02053 const char *passphrase)
02054 {
02055 assert(wand != (MagickWand *) NULL);
02056 assert(wand->signature == WandSignature);
02057 if (wand->debug != MagickFalse)
02058 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02059 if (wand->images == (Image *) NULL)
02060 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02061 return(DecipherImage(wand->images,passphrase,&wand->images->exception));
02062 }
02063
02064
02065
02066
02067
02068
02069
02070
02071
02072
02073
02074
02075
02076
02077
02078
02079
02080
02081
02082
02083
02084
02085
02086
02087
02088 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
02089 {
02090 Image
02091 *deconstruct_image;
02092
02093 assert(wand != (MagickWand *) NULL);
02094 assert(wand->signature == WandSignature);
02095 if (wand->debug != MagickFalse)
02096 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02097 if (wand->images == (Image *) NULL)
02098 return((MagickWand *) NULL);
02099 deconstruct_image=DeconstructImages(wand->images,wand->exception);
02100 if (deconstruct_image == (Image *) NULL)
02101 return((MagickWand *) NULL);
02102 return(CloneMagickWandFromImages(wand,deconstruct_image));
02103 }
02104
02105
02106
02107
02108
02109
02110
02111
02112
02113
02114
02115
02116
02117
02118
02119
02120
02121
02122
02123
02124
02125
02126
02127
02128
02129
02130
02131
02132
02133 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
02134 const double threshold)
02135 {
02136 Image
02137 *sepia_image;
02138
02139 assert(wand != (MagickWand *) NULL);
02140 assert(wand->signature == WandSignature);
02141 if (wand->debug != MagickFalse)
02142 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02143 if (wand->images == (Image *) NULL)
02144 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02145 sepia_image=DeskewImage(wand->images,threshold,wand->exception);
02146 if (sepia_image == (Image *) NULL)
02147 return(MagickFalse);
02148 ReplaceImageInList(&wand->images,sepia_image);
02149 return(MagickTrue);
02150 }
02151
02152
02153
02154
02155
02156
02157
02158
02159
02160
02161
02162
02163
02164
02165
02166
02167
02168
02169
02170
02171
02172
02173
02174
02175 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
02176 {
02177 Image
02178 *despeckle_image;
02179
02180 assert(wand != (MagickWand *) NULL);
02181 assert(wand->signature == WandSignature);
02182 if (wand->debug != MagickFalse)
02183 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02184 if (wand->images == (Image *) NULL)
02185 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02186 despeckle_image=DespeckleImage(wand->images,wand->exception);
02187 if (despeckle_image == (Image *) NULL)
02188 return(MagickFalse);
02189 ReplaceImageInList(&wand->images,despeckle_image);
02190 return(MagickTrue);
02191 }
02192
02193
02194
02195
02196
02197
02198
02199
02200
02201
02202
02203
02204
02205
02206
02207
02208
02209
02210
02211
02212
02213
02214
02215
02216 WandExport Image *MagickDestroyImage(Image *image)
02217 {
02218 return(DestroyImage(image));
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
02244
02245
02246 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
02247 const char *server_name)
02248 {
02249 Image
02250 *image;
02251
02252 MagickBooleanType
02253 status;
02254
02255 assert(wand != (MagickWand *) NULL);
02256 assert(wand->signature == WandSignature);
02257 if (wand->debug != MagickFalse)
02258 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02259 if (wand->images == (Image *) NULL)
02260 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02261 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
02262 if (image == (Image *) NULL)
02263 return(MagickFalse);
02264 (void) CloneString(&wand->image_info->server_name,server_name);
02265 status=DisplayImages(wand->image_info,image);
02266 if (status == MagickFalse)
02267 InheritException(wand->exception,&image->exception);
02268 image=DestroyImage(image);
02269 return(status);
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
02295
02296
02297 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
02298 const char *server_name)
02299 {
02300 MagickBooleanType
02301 status;
02302
02303 assert(wand != (MagickWand *) NULL);
02304 assert(wand->signature == WandSignature);
02305 if (wand->debug != MagickFalse)
02306 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02307 (void) CloneString(&wand->image_info->server_name,server_name);
02308 status=DisplayImages(wand->image_info,wand->images);
02309 if (status == MagickFalse)
02310 InheritException(wand->exception,&wand->images->exception);
02311 return(status);
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
02339
02340
02341
02342
02343
02344
02345
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
02374 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
02375 const DistortImageMethod method,const unsigned long number_arguments,
02376 const double *arguments,const MagickBooleanType bestfit)
02377 {
02378 Image
02379 *distort_image;
02380
02381 assert(wand != (MagickWand *) NULL);
02382 assert(wand->signature == WandSignature);
02383 if (wand->debug != MagickFalse)
02384 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02385 if (wand->images == (Image *) NULL)
02386 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02387 distort_image=DistortImage(wand->images,method,number_arguments,arguments,
02388 bestfit,wand->exception);
02389 if (distort_image == (Image *) NULL)
02390 return(MagickFalse);
02391 ReplaceImageInList(&wand->images,distort_image);
02392 return(MagickTrue);
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
02418
02419
02420 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
02421 const DrawingWand *drawing_wand)
02422 {
02423 char
02424 *primitive;
02425
02426 DrawInfo
02427 *draw_info;
02428
02429 MagickBooleanType
02430 status;
02431
02432 assert(wand != (MagickWand *) NULL);
02433 assert(wand->signature == WandSignature);
02434 if (wand->debug != MagickFalse)
02435 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02436 if (wand->images == (Image *) NULL)
02437 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02438 draw_info=PeekDrawingWand(drawing_wand);
02439 if ((draw_info == (DrawInfo *) NULL) ||
02440 (draw_info->primitive == (char *) NULL))
02441 return(MagickFalse);
02442 primitive=AcquireString(draw_info->primitive);
02443 draw_info=DestroyDrawInfo(draw_info);
02444 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
02445 draw_info->primitive=primitive;
02446 status=DrawImage(wand->images,draw_info);
02447 if (status == MagickFalse)
02448 InheritException(wand->exception,&wand->images->exception);
02449 draw_info=DestroyDrawInfo(draw_info);
02450 return(status);
02451 }
02452
02453
02454
02455
02456
02457
02458
02459
02460
02461
02462
02463
02464
02465
02466
02467
02468
02469
02470
02471
02472
02473
02474
02475
02476
02477
02478
02479 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
02480 const double radius)
02481 {
02482 Image
02483 *edge_image;
02484
02485 assert(wand != (MagickWand *) NULL);
02486 assert(wand->signature == WandSignature);
02487 if (wand->debug != MagickFalse)
02488 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02489 if (wand->images == (Image *) NULL)
02490 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02491 edge_image=EdgeImage(wand->images,radius,wand->exception);
02492 if (edge_image == (Image *) NULL)
02493 return(MagickFalse);
02494 ReplaceImageInList(&wand->images,edge_image);
02495 return(MagickTrue);
02496 }
02497
02498
02499
02500
02501
02502
02503
02504
02505
02506
02507
02508
02509
02510
02511
02512
02513
02514
02515
02516
02517
02518
02519
02520
02521
02522
02523
02524
02525
02526
02527
02528
02529
02530 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
02531 const double radius,const double sigma)
02532 {
02533 Image
02534 *emboss_image;
02535
02536 assert(wand != (MagickWand *) NULL);
02537 assert(wand->signature == WandSignature);
02538 if (wand->debug != MagickFalse)
02539 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02540 if (wand->images == (Image *) NULL)
02541 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02542 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
02543 if (emboss_image == (Image *) NULL)
02544 return(MagickFalse);
02545 ReplaceImageInList(&wand->images,emboss_image);
02546 return(MagickTrue);
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
02574 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
02575 const char *passphrase)
02576 {
02577 assert(wand != (MagickWand *) NULL);
02578 assert(wand->signature == WandSignature);
02579 if (wand->debug != MagickFalse)
02580 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02581 if (wand->images == (Image *) NULL)
02582 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02583 return(EncipherImage(wand->images,passphrase,&wand->images->exception));
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 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
02610 {
02611 Image
02612 *enhance_image;
02613
02614 assert(wand != (MagickWand *) NULL);
02615 assert(wand->signature == WandSignature);
02616 if (wand->debug != MagickFalse)
02617 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02618 if (wand->images == (Image *) NULL)
02619 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02620 enhance_image=EnhanceImage(wand->images,wand->exception);
02621 if (enhance_image == (Image *) NULL)
02622 return(MagickFalse);
02623 ReplaceImageInList(&wand->images,enhance_image);
02624 return(MagickTrue);
02625 }
02626
02627
02628
02629
02630
02631
02632
02633
02634
02635
02636
02637
02638
02639
02640
02641
02642
02643
02644
02645
02646
02647
02648
02649
02650
02651
02652
02653
02654 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
02655 {
02656 MagickBooleanType
02657 status;
02658
02659 status=MagickEqualizeImageChannel(wand,DefaultChannels);
02660 return(status);
02661 }
02662
02663 WandExport MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
02664 const ChannelType channel)
02665 {
02666 MagickBooleanType
02667 status;
02668
02669 assert(wand != (MagickWand *) NULL);
02670 assert(wand->signature == WandSignature);
02671 if (wand->debug != MagickFalse)
02672 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02673 if (wand->images == (Image *) NULL)
02674 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02675 status=EqualizeImageChannel(wand->images,channel);
02676 if (status == MagickFalse)
02677 InheritException(wand->exception,&wand->images->exception);
02678 return(status);
02679 }
02680
02681
02682
02683
02684
02685
02686
02687
02688
02689
02690
02691
02692
02693
02694
02695
02696
02697
02698
02699
02700
02701
02702
02703
02704
02705
02706
02707
02708
02709
02710
02711
02712
02713
02714
02715
02716
02717 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
02718 const MagickEvaluateOperator op,const double value)
02719 {
02720 MagickBooleanType
02721 status;
02722
02723 assert(wand != (MagickWand *) NULL);
02724 assert(wand->signature == WandSignature);
02725 if (wand->debug != MagickFalse)
02726 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02727 if (wand->images == (Image *) NULL)
02728 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02729 status=EvaluateImage(wand->images,op,value,&wand->images->exception);
02730 if (status == MagickFalse)
02731 InheritException(wand->exception,&wand->images->exception);
02732 return(status);
02733 }
02734
02735 WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
02736 const ChannelType channel,const MagickEvaluateOperator op,const double value)
02737 {
02738 MagickBooleanType
02739 status;
02740
02741 assert(wand != (MagickWand *) NULL);
02742 assert(wand->signature == WandSignature);
02743 if (wand->debug != MagickFalse)
02744 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02745 if (wand->images == (Image *) NULL)
02746 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02747 status=EvaluateImageChannel(wand->images,channel,op,value,
02748 &wand->images->exception);
02749 return(status);
02750 }
02751
02752
02753
02754
02755
02756
02757
02758
02759
02760
02761
02762
02763
02764
02765
02766
02767
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
02799
02800
02801
02802
02803 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
02804 const long x,const long y,const unsigned long columns,
02805 const unsigned long rows,const char *map,const StorageType storage,
02806 void *pixels)
02807 {
02808 MagickBooleanType
02809 status;
02810
02811 assert(wand != (MagickWand *) NULL);
02812 assert(wand->signature == WandSignature);
02813 if (wand->debug != MagickFalse)
02814 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02815 if (wand->images == (Image *) NULL)
02816 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02817 status=ExportImagePixels(wand->images,x,y,columns,rows,map,
02818 storage,pixels,wand->exception);
02819 if (status == MagickFalse)
02820 InheritException(wand->exception,&wand->images->exception);
02821 return(status);
02822 }
02823
02824
02825
02826
02827
02828
02829
02830
02831
02832
02833
02834
02835
02836
02837
02838
02839
02840
02841
02842
02843
02844
02845
02846
02847
02848
02849
02850
02851
02852
02853
02854
02855
02856
02857
02858 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
02859 const unsigned long width,const unsigned long height,const long x,
02860 const long y)
02861 {
02862 Image
02863 *extent_image;
02864
02865 RectangleInfo
02866 extent;
02867
02868 assert(wand != (MagickWand *) NULL);
02869 assert(wand->signature == WandSignature);
02870 if (wand->debug != MagickFalse)
02871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02872 if (wand->images == (Image *) NULL)
02873 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02874 extent.width=width;
02875 extent.height=height;
02876 extent.x=x;
02877 extent.y=y;
02878 extent_image=ExtentImage(wand->images,&extent,wand->exception);
02879 if (extent_image == (Image *) NULL)
02880 return(MagickFalse);
02881 ReplaceImageInList(&wand->images,extent_image);
02882 return(MagickTrue);
02883 }
02884
02885
02886
02887
02888
02889
02890
02891
02892
02893
02894
02895
02896
02897
02898
02899
02900
02901
02902
02903
02904
02905
02906
02907
02908 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
02909 {
02910 Image
02911 *flip_image;
02912
02913 assert(wand != (MagickWand *) NULL);
02914 assert(wand->signature == WandSignature);
02915 if (wand->debug != MagickFalse)
02916 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02917 if (wand->images == (Image *) NULL)
02918 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02919 flip_image=FlipImage(wand->images,wand->exception);
02920 if (flip_image == (Image *) NULL)
02921 return(MagickFalse);
02922 ReplaceImageInList(&wand->images,flip_image);
02923 return(MagickTrue);
02924 }
02925
02926
02927
02928
02929
02930
02931
02932
02933
02934
02935
02936
02937
02938
02939
02940
02941
02942
02943
02944
02945
02946
02947
02948
02949
02950
02951
02952
02953
02954
02955
02956
02957
02958
02959
02960
02961
02962
02963
02964
02965
02966
02967
02968
02969
02970
02971 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
02972 const ChannelType channel,const PixelWand *fill,const double fuzz,
02973 const PixelWand *bordercolor,const long x,const long y,
02974 const MagickBooleanType invert)
02975 {
02976 DrawInfo
02977 *draw_info;
02978
02979 MagickBooleanType
02980 status;
02981
02982 MagickPixelPacket
02983 target;
02984
02985 assert(wand != (MagickWand *) NULL);
02986 assert(wand->signature == WandSignature);
02987 if (wand->debug != MagickFalse)
02988 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02989 if (wand->images == (Image *) NULL)
02990 ThrowWandException(WandError,"ContainsNoImages",wand->name);
02991 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
02992 PixelGetQuantumColor(fill,&draw_info->fill);
02993 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns,
02994 y % wand->images->rows,&target,wand->exception);
02995 if (bordercolor != (PixelWand *) NULL)
02996 PixelGetMagickColor(bordercolor,&target);
02997 wand->images->fuzz=fuzz;
02998 status=FloodfillPaintImage(wand->images,channel,draw_info,&target,x,y,
02999 invert);
03000 if (status == MagickFalse)
03001 InheritException(wand->exception,&wand->images->exception);
03002 draw_info=DestroyDrawInfo(draw_info);
03003 return(status);
03004 }
03005
03006
03007
03008
03009
03010
03011
03012
03013
03014
03015
03016
03017
03018
03019
03020
03021
03022
03023
03024
03025
03026
03027
03028
03029 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
03030 {
03031 Image
03032 *flop_image;
03033
03034 assert(wand != (MagickWand *) NULL);
03035 assert(wand->signature == WandSignature);
03036 if (wand->debug != MagickFalse)
03037 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03038 if (wand->images == (Image *) NULL)
03039 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03040 flop_image=FlopImage(wand->images,wand->exception);
03041 if (flop_image == (Image *) NULL)
03042 return(MagickFalse);
03043 ReplaceImageInList(&wand->images,flop_image);
03044 return(MagickTrue);
03045 }
03046
03047
03048
03049
03050
03051
03052
03053
03054
03055
03056
03057
03058
03059
03060
03061
03062
03063
03064
03065
03066
03067
03068
03069
03070
03071
03072
03073
03074
03075
03076
03077
03078
03079
03080
03081
03082
03083
03084
03085 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
03086 const PixelWand *matte_color,const unsigned long width,
03087 const unsigned long height,const long inner_bevel,const long outer_bevel)
03088 {
03089 Image
03090 *frame_image;
03091
03092 FrameInfo
03093 frame_info;
03094
03095 assert(wand != (MagickWand *) NULL);
03096 assert(wand->signature == WandSignature);
03097 if (wand->debug != MagickFalse)
03098 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03099 if (wand->images == (Image *) NULL)
03100 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03101 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
03102 frame_info.width=wand->images->columns+2*width;
03103 frame_info.height=wand->images->rows+2*height;
03104 frame_info.x=(long) width;
03105 frame_info.y=(long) height;
03106 frame_info.inner_bevel=inner_bevel;
03107 frame_info.outer_bevel=outer_bevel;
03108 PixelGetQuantumColor(matte_color,&wand->images->matte_color);
03109 frame_image=FrameImage(wand->images,&frame_info,wand->exception);
03110 if (frame_image == (Image *) NULL)
03111 return(MagickFalse);
03112 ReplaceImageInList(&wand->images,frame_image);
03113 return(MagickTrue);
03114 }
03115
03116
03117
03118
03119
03120
03121
03122
03123
03124
03125
03126
03127
03128
03129
03130
03131
03132
03133
03134
03135
03136
03137
03138
03139
03140
03141
03142
03143
03144
03145
03146
03147
03148
03149
03150
03151
03152
03153
03154
03155 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
03156 const MagickFunction function,const unsigned long number_arguments,
03157 const double *arguments)
03158 {
03159 MagickBooleanType
03160 status;
03161
03162 assert(wand != (MagickWand *) NULL);
03163 assert(wand->signature == WandSignature);
03164 if (wand->debug != MagickFalse)
03165 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03166 if (wand->images == (Image *) NULL)
03167 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03168 status=FunctionImage(wand->images,function,number_arguments,arguments,
03169 &wand->images->exception);
03170 if (status == MagickFalse)
03171 InheritException(wand->exception,&wand->images->exception);
03172 return(status);
03173 }
03174
03175 WandExport MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
03176 const ChannelType channel,const MagickFunction function,
03177 const unsigned long number_arguments,const double *arguments)
03178 {
03179 MagickBooleanType
03180 status;
03181
03182 assert(wand != (MagickWand *) NULL);
03183 assert(wand->signature == WandSignature);
03184 if (wand->debug != MagickFalse)
03185 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03186 if (wand->images == (Image *) NULL)
03187 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03188 status=FunctionImageChannel(wand->images,channel,function,number_arguments,
03189 arguments,&wand->images->exception);
03190 return(status);
03191 }
03192
03193
03194
03195
03196
03197
03198
03199
03200
03201
03202
03203
03204
03205
03206
03207
03208
03209
03210
03211
03212
03213
03214
03215
03216
03217
03218
03219
03220
03221
03222 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
03223 {
03224 MagickWand
03225 *fx_wand;
03226
03227 fx_wand=MagickFxImageChannel(wand,DefaultChannels,expression);
03228 return(fx_wand);
03229 }
03230
03231 WandExport MagickWand *MagickFxImageChannel(MagickWand *wand,
03232 const ChannelType channel,const char *expression)
03233 {
03234 Image
03235 *fx_image;
03236
03237 assert(wand != (MagickWand *) NULL);
03238 assert(wand->signature == WandSignature);
03239 if (wand->debug != MagickFalse)
03240 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03241 if (wand->images == (Image *) NULL)
03242 return((MagickWand *) NULL);
03243 fx_image=FxImageChannel(wand->images,channel,expression,wand->exception);
03244 if (fx_image == (Image *) NULL)
03245 return((MagickWand *) NULL);
03246 return(CloneMagickWandFromImages(wand,fx_image));
03247 }
03248
03249
03250
03251
03252
03253
03254
03255
03256
03257
03258
03259
03260
03261
03262
03263
03264
03265
03266
03267
03268
03269
03270
03271
03272
03273
03274
03275
03276
03277
03278
03279
03280
03281
03282
03283
03284
03285 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
03286 const double gamma)
03287 {
03288 MagickBooleanType
03289 status;
03290
03291 status=MagickGammaImageChannel(wand,DefaultChannels,gamma);
03292 return(status);
03293 }
03294
03295 WandExport MagickBooleanType MagickGammaImageChannel(MagickWand *wand,
03296 const ChannelType channel,const double gamma)
03297 {
03298 MagickBooleanType
03299 status;
03300
03301 assert(wand != (MagickWand *) NULL);
03302 assert(wand->signature == WandSignature);
03303 if (wand->debug != MagickFalse)
03304 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03305 if (wand->images == (Image *) NULL)
03306 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03307 status=GammaImageChannel(wand->images,channel,gamma);
03308 if (status == MagickFalse)
03309 InheritException(wand->exception,&wand->images->exception);
03310 return(status);
03311 }
03312
03313
03314
03315
03316
03317
03318
03319
03320
03321
03322
03323
03324
03325
03326
03327
03328
03329
03330
03331
03332
03333
03334
03335
03336
03337
03338
03339
03340
03341
03342
03343
03344
03345
03346
03347
03348
03349 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
03350 const double radius,const double sigma)
03351 {
03352 MagickBooleanType
03353 status;
03354
03355 status=MagickGaussianBlurImageChannel(wand,DefaultChannels,radius,sigma);
03356 return(status);
03357 }
03358
03359 WandExport MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand,
03360 const ChannelType channel,const double radius,const double sigma)
03361 {
03362 Image
03363 *blur_image;
03364
03365 assert(wand != (MagickWand *) NULL);
03366 assert(wand->signature == WandSignature);
03367 if (wand->debug != MagickFalse)
03368 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03369 if (wand->images == (Image *) NULL)
03370 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03371 blur_image=GaussianBlurImageChannel(wand->images,channel,radius,sigma,
03372 wand->exception);
03373 if (blur_image == (Image *) NULL)
03374 return(MagickFalse);
03375 ReplaceImageInList(&wand->images,blur_image);
03376 return(MagickTrue);
03377 }
03378
03379
03380
03381
03382
03383
03384
03385
03386
03387
03388
03389
03390
03391
03392
03393
03394
03395
03396
03397
03398
03399
03400
03401 WandExport MagickWand *MagickGetImage(MagickWand *wand)
03402 {
03403 Image
03404 *image;
03405
03406 assert(wand != (MagickWand *) NULL);
03407 assert(wand->signature == WandSignature);
03408 if (wand->debug != MagickFalse)
03409 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03410 if (wand->images == (Image *) NULL)
03411 {
03412 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03413 "ContainsNoImages","`%s'",wand->name);
03414 return((MagickWand *) NULL);
03415 }
03416 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
03417 if (image == (Image *) NULL)
03418 return((MagickWand *) NULL);
03419 return(CloneMagickWandFromImages(wand,image));
03420 }
03421
03422
03423
03424
03425
03426
03427
03428
03429
03430
03431
03432
03433
03434
03435
03436
03437
03438
03439
03440
03441
03442
03443
03444
03445
03446 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
03447 {
03448 assert(wand != (MagickWand *) NULL);
03449 assert(wand->signature == WandSignature);
03450 if (wand->debug != MagickFalse)
03451 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03452 if (wand->images == (Image *) NULL)
03453 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03454 return(GetImageAlphaChannel(wand->images));
03455 }
03456
03457
03458
03459
03460
03461
03462
03463
03464
03465
03466
03467
03468
03469
03470
03471
03472
03473
03474
03475
03476
03477
03478
03479 WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
03480 {
03481 Image
03482 *image;
03483
03484 assert(wand != (MagickWand *) NULL);
03485 assert(wand->signature == WandSignature);
03486 if (wand->debug != MagickFalse)
03487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03488 if (wand->images == (Image *) NULL)
03489 {
03490 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03491 "ContainsNoImages","`%s'",wand->name);
03492 return((MagickWand *) NULL);
03493 }
03494 image=GetImageClipMask(wand->images,wand->exception);
03495 if (image == (Image *) NULL)
03496 return((MagickWand *) NULL);
03497 return(CloneMagickWandFromImages(wand,image));
03498 }
03499
03500
03501
03502
03503
03504
03505
03506
03507
03508
03509
03510
03511
03512
03513
03514
03515
03516
03517
03518
03519
03520
03521
03522
03523
03524
03525 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
03526 PixelWand *background_color)
03527 {
03528 assert(wand != (MagickWand *) NULL);
03529 assert(wand->signature == WandSignature);
03530 if (wand->debug != MagickFalse)
03531 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03532 if (wand->images == (Image *) NULL)
03533 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03534 PixelSetQuantumColor(background_color,&wand->images->background_color);
03535 return(MagickTrue);
03536 }
03537
03538
03539
03540
03541
03542
03543
03544
03545
03546
03547
03548
03549
03550
03551
03552
03553
03554
03555
03556
03557
03558
03559
03560
03561
03562
03563
03564
03565
03566 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
03567 {
03568 assert(wand != (MagickWand *) NULL);
03569 assert(wand->signature == WandSignature);
03570 if (wand->debug != MagickFalse)
03571 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03572 if (wand->images == (Image *) NULL)
03573 {
03574 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03575 "ContainsNoImages","`%s'",wand->name);
03576 return((unsigned char *) NULL);
03577 }
03578 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
03579 }
03580
03581
03582
03583
03584
03585
03586
03587
03588
03589
03590
03591
03592
03593
03594
03595
03596
03597
03598
03599
03600
03601
03602
03603
03604
03605
03606
03607
03608
03609
03610
03611
03612 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
03613 {
03614 unsigned char
03615 *blob;
03616
03617 assert(wand != (MagickWand *) NULL);
03618 assert(wand->signature == WandSignature);
03619 if (wand->debug != MagickFalse)
03620 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03621 if (wand->images == (Image *) NULL)
03622 {
03623 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03624 "ContainsNoImages","`%s'",wand->name);
03625 return((unsigned char *) NULL);
03626 }
03627 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
03628 wand->exception);
03629 return(blob);
03630 }
03631
03632
03633
03634
03635
03636
03637
03638
03639
03640
03641
03642
03643
03644
03645
03646
03647
03648
03649
03650
03651
03652
03653
03654
03655
03656
03657
03658
03659
03660 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
03661 double *x,double *y)
03662 {
03663 assert(wand != (MagickWand *) NULL);
03664 assert(wand->signature == WandSignature);
03665 if (wand->debug != MagickFalse)
03666 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03667 if (wand->images == (Image *) NULL)
03668 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03669 *x=wand->images->chromaticity.blue_primary.x;
03670 *y=wand->images->chromaticity.blue_primary.y;
03671 return(MagickTrue);
03672 }
03673
03674
03675
03676
03677
03678
03679
03680
03681
03682
03683
03684
03685
03686
03687
03688
03689
03690
03691
03692
03693
03694
03695
03696
03697
03698
03699 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
03700 PixelWand *border_color)
03701 {
03702 assert(wand != (MagickWand *) NULL);
03703 assert(wand->signature == WandSignature);
03704 if (wand->debug != MagickFalse)
03705 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03706 if (wand->images == (Image *) NULL)
03707 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03708 PixelSetQuantumColor(border_color,&wand->images->border_color);
03709 return(MagickTrue);
03710 }
03711
03712
03713
03714
03715
03716
03717
03718
03719
03720
03721
03722
03723
03724
03725
03726
03727
03728
03729
03730
03731
03732
03733
03734
03735
03736
03737 WandExport unsigned long MagickGetImageChannelDepth(MagickWand *wand,
03738 const ChannelType channel)
03739 {
03740 assert(wand != (MagickWand *) NULL);
03741 assert(wand->signature == WandSignature);
03742 if (wand->debug != MagickFalse)
03743 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03744 if (wand->images == (Image *) NULL)
03745 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03746 return(GetImageChannelDepth(wand->images,channel,wand->exception));
03747 }
03748
03749
03750
03751
03752
03753
03754
03755
03756
03757
03758
03759
03760
03761
03762
03763
03764
03765
03766
03767
03768
03769
03770
03771
03772
03773
03774
03775
03776
03777
03778
03779
03780
03781
03782 WandExport MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
03783 const MagickWand *reference,const ChannelType channel,const MetricType metric,
03784 double *distortion)
03785 {
03786 MagickBooleanType
03787 status;
03788
03789 assert(wand != (MagickWand *) NULL);
03790 assert(wand->signature == WandSignature);
03791 if (wand->debug != MagickFalse)
03792 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03793 assert(reference != (MagickWand *) NULL);
03794 assert(reference->signature == WandSignature);
03795 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
03796 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03797 status=GetImageChannelDistortion(wand->images,reference->images,channel,
03798 metric,distortion,&wand->images->exception);
03799 return(status);
03800 }
03801
03802
03803
03804
03805
03806
03807
03808
03809
03810
03811
03812
03813
03814
03815
03816
03817
03818
03819
03820
03821
03822
03823
03824
03825
03826
03827
03828
03829
03830
03831
03832 WandExport double *MagickGetImageChannelDistortions(MagickWand *wand,
03833 const MagickWand *reference,const MetricType metric)
03834 {
03835 double
03836 *channel_distortion;
03837
03838 assert(wand != (MagickWand *) NULL);
03839 assert(wand->signature == WandSignature);
03840 if (wand->debug != MagickFalse)
03841 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03842 assert(reference != (MagickWand *) NULL);
03843 assert(reference->signature == WandSignature);
03844 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
03845 {
03846 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03847 "ContainsNoImages","`%s'",wand->name);
03848 return((double *) NULL);
03849 }
03850 channel_distortion=GetImageChannelDistortions(wand->images,reference->images,
03851 metric,&wand->images->exception);
03852 return(channel_distortion);
03853 }
03854
03855
03856
03857
03858
03859
03860
03861
03862
03863
03864
03865
03866
03867
03868
03869
03870
03871
03872
03873
03874
03875
03876
03877
03878
03879
03880
03881
03882
03883
03884
03885 WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand,
03886 const ChannelType channel,double *mean,double *standard_deviation)
03887 {
03888 MagickBooleanType
03889 status;
03890
03891 assert(wand != (MagickWand *) NULL);
03892 assert(wand->signature == WandSignature);
03893 if (wand->debug != MagickFalse)
03894 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03895 if (wand->images == (Image *) NULL)
03896 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03897 status=GetImageChannelMean(wand->images,channel,mean,standard_deviation,
03898 wand->exception);
03899 return(status);
03900 }
03901
03902
03903
03904
03905
03906
03907
03908
03909
03910
03911
03912
03913
03914
03915
03916
03917
03918
03919
03920
03921
03922
03923
03924
03925
03926
03927
03928
03929
03930
03931
03932 WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,
03933 const ChannelType channel,double *kurtosis,double *skewness)
03934 {
03935 MagickBooleanType
03936 status;
03937
03938 assert(wand != (MagickWand *) NULL);
03939 assert(wand->signature == WandSignature);
03940 if (wand->debug != MagickFalse)
03941 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03942 if (wand->images == (Image *) NULL)
03943 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03944 status=GetImageChannelKurtosis(wand->images,channel,kurtosis,skewness,
03945 wand->exception);
03946 return(status);
03947 }
03948
03949
03950
03951
03952
03953
03954
03955
03956
03957
03958
03959
03960
03961
03962
03963
03964
03965
03966
03967
03968
03969
03970
03971
03972
03973
03974
03975
03976
03977
03978 WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,
03979 const ChannelType channel,double *minima,double *maxima)
03980 {
03981 MagickBooleanType
03982 status;
03983
03984 assert(wand != (MagickWand *) NULL);
03985 assert(wand->signature == WandSignature);
03986 if (wand->debug != MagickFalse)
03987 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03988 if (wand->images == (Image *) NULL)
03989 ThrowWandException(WandError,"ContainsNoImages",wand->name);
03990 status=GetImageChannelRange(wand->images,channel,minima,maxima,
03991 wand->exception);
03992 return(status);
03993 }
03994
03995
03996
03997
03998
03999
04000
04001
04002
04003
04004
04005
04006
04007
04008
04009
04010
04011
04012
04013
04014
04015
04016
04017
04018
04019
04020
04021
04022
04023
04024
04025 WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
04026 {
04027 assert(wand != (MagickWand *) NULL);
04028 assert(wand->signature == WandSignature);
04029 if (wand->debug != MagickFalse)
04030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04031 if (wand->images == (Image *) NULL)
04032 {
04033 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04034 "ContainsNoImages","`%s'",wand->name);
04035 return((ChannelStatistics *) NULL);
04036 }
04037 return(GetImageChannelStatistics(wand->images,wand->exception));
04038 }
04039
04040
04041
04042
04043
04044
04045
04046
04047
04048
04049
04050
04051
04052
04053
04054
04055
04056
04057
04058
04059
04060
04061
04062
04063
04064
04065
04066
04067
04068 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
04069 const unsigned long index,PixelWand *color)
04070 {
04071 assert(wand != (MagickWand *) NULL);
04072 assert(wand->signature == WandSignature);
04073 if (wand->debug != MagickFalse)
04074 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04075 if (wand->images == (Image *) NULL)
04076 ThrowWandException(WandError,"ContainsNoImages",wand->name);
04077 if ((wand->images->colormap == (PixelPacket *) NULL) ||
04078 (index >= wand->images->colors))
04079 {
04080 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04081 "InvalidColormapIndex","`%s'",wand->name);
04082 return(MagickFalse);
04083 }
04084 PixelSetQuantumColor(color,wand->images->colormap+index);
04085 return(MagickTrue);
04086 }
04087
04088
04089
04090
04091
04092
04093
04094
04095
04096
04097
04098
04099
04100
04101
04102
04103
04104
04105
04106
04107
04108
04109
04110 WandExport unsigned long MagickGetImageColors(MagickWand *wand)
04111 {
04112 assert(wand != (MagickWand *) NULL);
04113 assert(wand->signature == WandSignature);
04114 if (wand->debug != MagickFalse)
04115 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04116 if (wand->images == (Image *) NULL)
04117 {
04118 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04119 "ContainsNoImages","`%s'",wand->name);
04120 return(0);
04121 }
04122 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
04123 }
04124
04125
04126
04127
04128
04129
04130
04131
04132
04133
04134
04135
04136
04137
04138
04139
04140
04141
04142
04143
04144
04145
04146
04147 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
04148 {
04149 assert(wand != (MagickWand *) NULL);
04150 assert(wand->signature == WandSignature);
04151 if (wand->debug != MagickFalse)
04152 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04153 if (wand->images == (Image *) NULL)
04154 {
04155 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04156 "ContainsNoImages","`%s'",wand->name);
04157 return(UndefinedColorspace);
04158 }
04159 return(wand->images->colorspace);
04160 }
04161
04162
04163
04164
04165
04166
04167
04168
04169
04170
04171
04172
04173
04174
04175
04176
04177
04178
04179
04180
04181
04182
04183
04184
04185 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
04186 {
04187 assert(wand != (MagickWand *) NULL);
04188 assert(wand->signature == WandSignature);
04189 if (wand->debug != MagickFalse)
04190 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04191 if (wand->images == (Image *) NULL)
04192 {
04193 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04194 "ContainsNoImages","`%s'",wand->name);
04195 return(UndefinedCompositeOp);
04196 }
04197 return(wand->images->compose);
04198 }
04199
04200
04201
04202
04203
04204
04205
04206
04207
04208
04209
04210
04211
04212
04213
04214
04215
04216
04217
04218
04219
04220
04221
04222 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
04223 {
04224 assert(wand != (MagickWand *) NULL);
04225 assert(wand->signature == WandSignature);
04226 if (wand->debug != MagickFalse)
04227 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04228 if (wand->images == (Image *) NULL)
04229 {
04230 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04231 "ContainsNoImages","`%s'",wand->name);
04232 return(UndefinedCompression);
04233 }
04234 return(wand->images->compression);
04235 }
04236
04237
04238
04239
04240
04241
04242
04243
04244
04245
04246
04247
04248
04249
04250
04251
04252
04253
04254
04255
04256
04257
04258
04259 WandExport unsigned long MagickGetImageCompressionQuality(MagickWand *wand)
04260 {
04261 assert(wand != (MagickWand *) NULL);
04262 assert(wand->signature == WandSignature);
04263 if (wand->debug != MagickFalse)
04264 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04265 if (wand->images == (Image *) NULL)
04266 {
04267 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04268 "ContainsNoImages","`%s'",wand->name);
04269 return(0UL);
04270 }
04271 return(wand->images->quality);
04272 }
04273
04274
04275
04276
04277
04278
04279
04280
04281
04282
04283
04284
04285
04286
04287
04288
04289
04290
04291
04292
04293
04294
04295
04296 WandExport unsigned long MagickGetImageDelay(MagickWand *wand)
04297 {
04298 assert(wand != (MagickWand *) NULL);
04299 assert(wand->signature == WandSignature);
04300 if (wand->debug != MagickFalse)
04301 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04302 if (wand->images == (Image *) NULL)
04303 ThrowWandException(WandError,"ContainsNoImages",wand->name);
04304 return(wand->images->delay);
04305 }
04306
04307
04308
04309
04310
04311
04312
04313
04314
04315
04316
04317
04318
04319
04320
04321
04322
04323
04324
04325
04326
04327
04328
04329 WandExport unsigned long MagickGetImageDepth(MagickWand *wand)
04330 {
04331 assert(wand != (MagickWand *) NULL);
04332 assert(wand->signature == WandSignature);
04333 if (wand->debug != MagickFalse)
04334 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04335 if (wand->images == (Image *) NULL)
04336 ThrowWandException(WandError,"ContainsNoImages",wand->name);
04337 return(wand->images->depth);
04338 }
04339
04340
04341
04342
04343
04344
04345
04346
04347
04348
04349
04350
04351
04352
04353
04354
04355
04356
04357
04358
04359
04360
04361
04362
04363
04364
04365
04366
04367
04368
04369
04370
04371 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
04372 const MagickWand *reference,const MetricType metric,double *distortion)
04373 {
04374 MagickBooleanType
04375 status;
04376
04377
04378 assert(wand != (MagickWand *) NULL);
04379 assert(wand->signature == WandSignature);
04380 if (wand->debug != MagickFalse)
04381 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04382 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
04383 ThrowWandException(WandError,"ContainsNoImages",wand->name);
04384 status=GetImageDistortion(wand->images,reference->images,metric,distortion,
04385 &wand->images->exception);
04386 return(status);
04387 }
04388
04389
04390
04391
04392
04393
04394
04395
04396
04397
04398
04399
04400
04401
04402
04403
04404
04405
04406
04407
04408
04409
04410
04411 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
04412 {
04413 assert(wand != (MagickWand *) NULL);
04414 assert(wand->signature == WandSignature);
04415 if (wand->debug != MagickFalse)
04416 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04417 if (wand->images == (Image *) NULL)
04418 {
04419 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04420 "ContainsNoImages","`%s'",wand->name);
04421 return(UndefinedDispose);
04422 }
04423 return((DisposeType) wand->images->dispose);
04424 }
04425
04426
04427
04428
04429
04430
04431
04432
04433
04434
04435
04436
04437
04438
04439
04440
04441
04442
04443
04444
04445
04446
04447
04448
04449 WandExport char *MagickGetImageFilename(MagickWand *wand)
04450 {
04451 assert(wand != (MagickWand *) NULL);
04452 assert(wand->signature == WandSignature);
04453 if (wand->debug != MagickFalse)
04454 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04455 if (wand->images == (Image *) NULL)
04456 {
04457 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04458 "ContainsNoImages","`%s'",wand->name);
04459 return((char *) NULL);
04460 }
04461 return(AcquireString(wand->images->filename));
04462 }
04463
04464
04465
04466
04467
04468
04469
04470
04471
04472
04473
04474
04475
04476
04477
04478
04479
04480
04481
04482
04483
04484
04485
04486
04487 WandExport char *MagickGetImageFormat(MagickWand *wand)
04488 {
04489 assert(wand != (MagickWand *) NULL);
04490 assert(wand->signature == WandSignature);
04491 if (wand->debug != MagickFalse)
04492 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04493 if (wand->images == (Image *) NULL)
04494 {
04495 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04496 "ContainsNoImages","`%s'",wand->name);
04497 return((char *) NULL);
04498 }
04499 return(AcquireString(wand->images->magick));
04500 }
04501
04502
04503
04504
04505
04506
04507
04508
04509
04510
04511
04512
04513
04514
04515
04516
04517
04518
04519
04520
04521
04522
04523
04524 WandExport double MagickGetImageFuzz(MagickWand *wand)
04525 {
04526 assert(wand != (MagickWand *) NULL);
04527 assert(wand->signature == WandSignature);
04528 if (wand->debug != MagickFalse)
04529 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04530 if (wand->images == (Image *) NULL)
04531 {
04532 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04533 "ContainsNoImages","`%s'",wand->name);
04534 return(0.0);
04535 }
04536 return(wand->images->fuzz);
04537 }
04538
04539
04540
04541
04542
04543
04544
04545
04546
04547
04548
04549
04550
04551
04552
04553
04554
04555
04556
04557
04558
04559
04560
04561 WandExport double MagickGetImageGamma(MagickWand *wand)
04562 {
04563 assert(wand != (MagickWand *) NULL);
04564 assert(wand->signature == WandSignature);
04565 if (wand->debug != MagickFalse)
04566 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04567 if (wand->images == (Image *) NULL)
04568 {
04569 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04570 "ContainsNoImages","`%s'",wand->name);
04571 return(0.0);
04572 }
04573 return(wand->images->gamma);
04574 }
04575
04576
04577
04578
04579
04580
04581
04582
04583
04584
04585
04586
04587
04588
04589
04590
04591
04592
04593
04594
04595
04596
04597
04598 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
04599 {
04600 assert(wand != (MagickWand *) NULL);
04601 assert(wand->signature == WandSignature);
04602 if (wand->debug != MagickFalse)
04603 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04604 if (wand->images == (Image *) NULL)
04605 {
04606 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04607 "ContainsNoImages","`%s'",wand->name);
04608 return(UndefinedGravity);
04609 }
04610 return(wand->images->gravity);
04611 }
04612
04613
04614
04615
04616
04617
04618
04619
04620
04621
04622
04623
04624
04625
04626
04627
04628
04629
04630
04631
04632
04633
04634
04635
04636
04637
04638
04639
04640 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
04641 double *x,double *y)
04642 {
04643 assert(wand != (MagickWand *) NULL);
04644 assert(wand->signature == WandSignature);
04645 if (wand->debug != MagickFalse)
04646 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04647 if (wand->images == (Image *) NULL)
04648 ThrowWandException(WandError,"ContainsNoImages",wand->name);
04649 *x=wand->images->chromaticity.green_primary.x;
04650 *y=wand->images->chromaticity.green_primary.y;
04651 return(MagickTrue);
04652 }
04653
04654
04655
04656
04657
04658
04659
04660
04661
04662
04663
04664
04665
04666
04667
04668
04669
04670
04671
04672
04673
04674
04675
04676 WandExport unsigned long MagickGetImageHeight(MagickWand *wand)
04677 {
04678 assert(wand != (MagickWand *) NULL);
04679 assert(wand->signature == WandSignature);
04680 if (wand->debug != MagickFalse)
04681 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04682 if (wand->images == (Image *) NULL)
04683 ThrowWandException(WandError,"ContainsNoImages",wand->name);
04684 return(wand->images->rows);
04685 }
04686
04687
04688
04689
04690
04691
04692
04693
04694
04695
04696
04697
04698
04699
04700
04701
04702
04703
04704
04705
04706
04707
04708
04709
04710
04711
04712
04713
04714 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
04715 unsigned long *number_colors)
04716 {
04717 ColorPacket
04718 *histogram;
04719
04720 PixelWand
04721 **pixel_wands;
04722
04723 register long
04724 i;
04725
04726 assert(wand != (MagickWand *) NULL);
04727 assert(wand->signature == WandSignature);
04728 if (wand->debug != MagickFalse)
04729 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04730 if (wand->images == (Image *) NULL)
04731 {
04732 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04733 "ContainsNoImages","`%s'",wand->name);
04734 return((PixelWand **) NULL);
04735 }
04736 histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
04737 if (histogram == (ColorPacket *) NULL)
04738 return((PixelWand **) NULL);
04739 pixel_wands=NewPixelWands(*number_colors);
04740 for (i=0; i < (long) *number_colors; i++)
04741 {
04742 PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel);
04743 PixelSetIndex(pixel_wands[i],histogram[i].index);
04744 PixelSetColorCount(pixel_wands[i],(unsigned long) histogram[i].count);
04745 }
04746 histogram=(ColorPacket *) RelinquishMagickMemory(histogram);
04747 return(pixel_wands);
04748 }
04749
04750
04751
04752
04753
04754
04755
04756
04757
04758
04759
04760
04761
04762
04763
04764
04765
04766
04767
04768
04769
04770
04771
04772 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
04773 {
04774 assert(wand != (MagickWand *) NULL);
04775 assert(wand->signature == WandSignature);
04776 if (wand->debug != MagickFalse)
04777 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04778 if (wand->images == (Image *) NULL)
04779 {
04780 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04781 "ContainsNoImages","`%s'",wand->name);
04782 return(UndefinedInterlace);
04783 }
04784 return(wand->images->interlace);
04785 }
04786
04787
04788
04789
04790
04791
04792
04793
04794
04795
04796
04797
04798
04799
04800
04801
04802
04803
04804
04805
04806
04807
04808
04809
04810 WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
04811 MagickWand *wand)
04812 {
04813 assert(wand != (MagickWand *) NULL);
04814 assert(wand->signature == WandSignature);
04815 if (wand->debug != MagickFalse)
04816 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04817 if (wand->images == (Image *) NULL)
04818 {
04819 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04820 "ContainsNoImages","`%s'",wand->name);
04821 return(UndefinedInterpolatePixel);
04822 }
04823 return(wand->images->interpolate);
04824 }
04825
04826
04827
04828
04829
04830
04831
04832
04833
04834
04835
04836
04837
04838
04839
04840
04841
04842
04843
04844
04845
04846
04847
04848 WandExport unsigned long MagickGetImageIterations(MagickWand *wand)
04849 {
04850 assert(wand != (MagickWand *) NULL);
04851 assert(wand->signature == WandSignature);
04852 if (wand->debug != MagickFalse)
04853 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04854 if (wand->images == (Image *) NULL)
04855 ThrowWandException(WandError,"ContainsNoImages",wand->name);
04856 return(wand->images->iterations);
04857 }
04858
04859
04860
04861
04862
04863
04864
04865
04866
04867
04868
04869
04870
04871
04872
04873
04874
04875
04876
04877
04878
04879
04880
04881
04882
04883
04884 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
04885 MagickSizeType *length)
04886 {
04887 assert(wand != (MagickWand *) NULL);
04888 assert(wand->signature == WandSignature);
04889 if (wand->debug != MagickFalse)
04890 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04891 if (wand->images == (Image *) NULL)
04892 ThrowWandException(WandError,"ContainsNoImages",wand->name);
04893 *length=GetBlobSize(wand->images);
04894 return(MagickTrue);
04895 }
04896
04897
04898
04899
04900
04901
04902
04903
04904
04905
04906
04907
04908
04909
04910
04911
04912
04913
04914
04915
04916
04917
04918
04919
04920
04921
04922 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
04923 PixelWand *matte_color)
04924 {
04925 assert(wand != (MagickWand *) NULL);
04926 assert(wand->signature == WandSignature);
04927 if (wand->debug != MagickFalse)
04928 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04929 if (wand->images == (Image *) NULL)
04930 ThrowWandException(WandError,"ContainsNoImages",wand->name);
04931 PixelSetQuantumColor(matte_color,&wand->images->matte_color);
04932 return(MagickTrue);
04933 }
04934
04935
04936
04937
04938
04939
04940
04941
04942
04943
04944
04945
04946
04947
04948
04949
04950
04951
04952
04953
04954
04955
04956
04957 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
04958 {
04959 assert(wand != (MagickWand *) NULL);
04960 assert(wand->signature == WandSignature);
04961 if (wand->debug != MagickFalse)
04962 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04963 if (wand->images == (Image *) NULL)
04964 {
04965 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04966 "ContainsNoImages","`%s'",wand->name);
04967 return(UndefinedOrientation);
04968 }
04969 return(wand->images->orientation);
04970 }
04971
04972
04973
04974
04975
04976
04977
04978
04979
04980
04981
04982
04983
04984
04985
04986
04987
04988
04989
04990
04991
04992
04993
04994
04995
04996
04997
04998
04999
05000
05001
05002
05003 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
05004 unsigned long *width,unsigned long *height,long *x,long *y)
05005 {
05006 assert(wand != (const MagickWand *) NULL);
05007 assert(wand->signature == WandSignature);
05008 if (wand->debug != MagickFalse)
05009 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05010 if (wand->images == (Image *) NULL)
05011 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05012 *width=wand->images->page.width;
05013 *height=wand->images->page.height;
05014 *x=wand->images->page.x;
05015 *y=wand->images->page.y;
05016 return(MagickTrue);
05017 }
05018
05019
05020
05021
05022
05023
05024
05025
05026
05027
05028
05029
05030
05031
05032
05033
05034
05035
05036
05037
05038
05039
05040
05041
05042
05043
05044
05045
05046 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
05047 const long x,const long y,PixelWand *color)
05048 {
05049 IndexPacket
05050 *indexes;
05051
05052 register const PixelPacket
05053 *p;
05054
05055 ViewInfo
05056 *image_view;
05057
05058 assert(wand != (MagickWand *) NULL);
05059 assert(wand->signature == WandSignature);
05060 if (wand->debug != MagickFalse)
05061 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05062 if (wand->images == (Image *) NULL)
05063 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05064 image_view=AcquireCacheView(wand->images);
05065 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
05066 if (p == (const PixelPacket *) NULL)
05067 {
05068 image_view=DestroyCacheView(image_view);
05069 return(MagickFalse);
05070 }
05071 indexes=GetCacheViewAuthenticIndexQueue(image_view);
05072 PixelSetQuantumColor(color,p);
05073 if (GetCacheViewColorspace(image_view) == CMYKColorspace)
05074 PixelSetBlackQuantum(color,*indexes);
05075 else
05076 if (GetCacheViewStorageClass(image_view) == PseudoClass)
05077 PixelSetIndex(color,*indexes);
05078 image_view=DestroyCacheView(image_view);
05079 return(MagickTrue);
05080 }
05081
05082
05083
05084
05085
05086
05087
05088
05089
05090
05091
05092
05093
05094
05095
05096
05097
05098
05099
05100
05101
05102
05103
05104
05105
05106
05107
05108
05109 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
05110 double *minima,double *maxima)
05111 {
05112 MagickBooleanType
05113 status;
05114
05115 assert(wand != (MagickWand *) NULL);
05116 assert(wand->signature == WandSignature);
05117 if (wand->debug != MagickFalse)
05118 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05119 if (wand->images == (Image *) NULL)
05120 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05121 status=GetImageRange(wand->images,minima,maxima,wand->exception);
05122 return(status);
05123 }
05124
05125
05126
05127
05128
05129
05130
05131
05132
05133
05134
05135
05136
05137
05138
05139
05140
05141
05142
05143
05144
05145
05146
05147
05148
05149
05150
05151
05152 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
05153 double *x,double *y)
05154 {
05155 assert(wand != (MagickWand *) NULL);
05156 assert(wand->signature == WandSignature);
05157 if (wand->debug != MagickFalse)
05158 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05159 if (wand->images == (Image *) NULL)
05160 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05161 *x=wand->images->chromaticity.red_primary.x;
05162 *y=wand->images->chromaticity.red_primary.y;
05163 return(MagickTrue);
05164 }
05165
05166
05167
05168
05169
05170
05171
05172
05173
05174
05175
05176
05177
05178
05179
05180
05181
05182
05183
05184
05185
05186
05187
05188
05189
05190
05191
05192
05193
05194
05195
05196
05197
05198
05199 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
05200 const unsigned long width,const unsigned long height,const long x,
05201 const long y)
05202 {
05203 Image
05204 *region_image;
05205
05206 RectangleInfo
05207 region;
05208
05209 assert(wand != (MagickWand *) NULL);
05210 assert(wand->signature == WandSignature);
05211 if (wand->debug != MagickFalse)
05212 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05213 if (wand->images == (Image *) NULL)
05214 return((MagickWand *) NULL);
05215 region.width=width;
05216 region.height=height;
05217 region.x=x;
05218 region.y=y;
05219 region_image=CropImage(wand->images,®ion,wand->exception);
05220 if (region_image == (Image *) NULL)
05221 return((MagickWand *) NULL);
05222 return(CloneMagickWandFromImages(wand,region_image));
05223 }
05224
05225
05226
05227
05228
05229
05230
05231
05232
05233
05234
05235
05236
05237
05238
05239
05240
05241
05242
05243
05244
05245
05246
05247 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
05248 {
05249 assert(wand != (MagickWand *) NULL);
05250 assert(wand->signature == WandSignature);
05251 if (wand->debug != MagickFalse)
05252 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05253 if (wand->images == (Image *) NULL)
05254 {
05255 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05256 "ContainsNoImages","`%s'",wand->name);
05257 return(UndefinedIntent);
05258 }
05259 return((RenderingIntent) wand->images->rendering_intent);
05260 }
05261
05262
05263
05264
05265
05266
05267
05268
05269
05270
05271
05272
05273
05274
05275
05276
05277
05278
05279
05280
05281
05282
05283
05284
05285
05286
05287
05288
05289 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
05290 double *x,double *y)
05291 {
05292 assert(wand != (MagickWand *) NULL);
05293 assert(wand->signature == WandSignature);
05294 if (wand->debug != MagickFalse)
05295 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05296 if (wand->images == (Image *) NULL)
05297 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05298 *x=wand->images->x_resolution;
05299 *y=wand->images->y_resolution;
05300 return(MagickTrue);
05301 }
05302
05303
05304
05305
05306
05307
05308
05309
05310
05311
05312
05313
05314
05315
05316
05317
05318
05319
05320
05321
05322
05323
05324
05325 WandExport unsigned long MagickGetImageScene(MagickWand *wand)
05326 {
05327 assert(wand != (MagickWand *) NULL);
05328 assert(wand->signature == WandSignature);
05329 if (wand->debug != MagickFalse)
05330 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05331 if (wand->images == (Image *) NULL)
05332 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05333 return(wand->images->scene);
05334 }
05335
05336
05337
05338
05339
05340
05341
05342
05343
05344
05345
05346
05347
05348
05349
05350
05351
05352
05353
05354
05355
05356
05357
05358
05359 WandExport char *MagickGetImageSignature(MagickWand *wand)
05360 {
05361 const char
05362 *value;
05363
05364 MagickBooleanType
05365 status;
05366
05367 assert(wand != (MagickWand *) NULL);
05368 assert(wand->signature == WandSignature);
05369 if (wand->debug != MagickFalse)
05370 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05371 if (wand->images == (Image *) NULL)
05372 {
05373 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05374 "ContainsNoImages","`%s'",wand->name);
05375 return((char *) NULL);
05376 }
05377 status=SignatureImage(wand->images);
05378 if (status == MagickFalse)
05379 InheritException(wand->exception,&wand->images->exception);
05380 value=GetImageProperty(wand->images,"signature");
05381 if (value != (const char *) NULL)
05382 return(AcquireString(value));
05383 InheritException(wand->exception,&wand->images->exception);
05384 return((char *) NULL);
05385 }
05386
05387
05388
05389
05390
05391
05392
05393
05394
05395
05396
05397
05398
05399
05400
05401
05402
05403
05404
05405
05406
05407
05408
05409 WandExport unsigned long MagickGetImageTicksPerSecond(MagickWand *wand)
05410 {
05411 assert(wand != (MagickWand *) NULL);
05412 assert(wand->signature == WandSignature);
05413 if (wand->debug != MagickFalse)
05414 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05415 if (wand->images == (Image *) NULL)
05416 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05417 return((unsigned long) wand->images->ticks_per_second);
05418 }
05419
05420
05421
05422
05423
05424
05425
05426
05427
05428
05429
05430
05431
05432
05433
05434
05435
05436
05437
05438
05439
05440
05441
05442
05443
05444
05445
05446
05447
05448
05449
05450 WandExport ImageType MagickGetImageType(MagickWand *wand)
05451 {
05452 assert(wand != (MagickWand *) NULL);
05453 assert(wand->signature == WandSignature);
05454 if (wand->debug != MagickFalse)
05455 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05456 if (wand->images == (Image *) NULL)
05457 {
05458 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05459 "ContainsNoImages","`%s'",wand->name);
05460 return(UndefinedType);
05461 }
05462 return(GetImageType(wand->images,wand->exception));
05463 }
05464
05465
05466
05467
05468
05469
05470
05471
05472
05473
05474
05475
05476
05477
05478
05479
05480
05481
05482
05483
05484
05485
05486
05487 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
05488 {
05489 assert(wand != (MagickWand *) NULL);
05490 assert(wand->signature == WandSignature);
05491 if (wand->debug != MagickFalse)
05492 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05493 if (wand->images == (Image *) NULL)
05494 {
05495 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05496 "ContainsNoImages","`%s'",wand->name);
05497 return(UndefinedResolution);
05498 }
05499 return(wand->images->units);
05500 }
05501
05502
05503
05504
05505
05506
05507
05508
05509
05510
05511
05512
05513
05514
05515
05516
05517
05518
05519
05520
05521
05522
05523
05524
05525 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
05526 {
05527 assert(wand != (MagickWand *) NULL);
05528 assert(wand->signature == WandSignature);
05529 if (wand->debug != MagickFalse)
05530 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05531 if (wand->images == (Image *) NULL)
05532 {
05533 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05534 "ContainsNoImages","`%s'",wand->name);
05535 return(UndefinedVirtualPixelMethod);
05536 }
05537 return(GetImageVirtualPixelMethod(wand->images));
05538 }
05539
05540
05541
05542
05543
05544
05545
05546
05547
05548
05549
05550
05551
05552
05553
05554
05555
05556
05557
05558
05559
05560
05561
05562
05563
05564
05565
05566
05567 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
05568 double *x,double *y)
05569 {
05570 assert(wand != (MagickWand *) NULL);
05571 assert(wand->signature == WandSignature);
05572 if (wand->debug != MagickFalse)
05573 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05574 if (wand->images == (Image *) NULL)
05575 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05576 *x=wand->images->chromaticity.white_point.x;
05577 *y=wand->images->chromaticity.white_point.y;
05578 return(MagickTrue);
05579 }
05580
05581
05582
05583
05584
05585
05586
05587
05588
05589
05590
05591
05592
05593
05594
05595
05596
05597
05598
05599
05600
05601
05602
05603 WandExport unsigned long MagickGetImageWidth(MagickWand *wand)
05604 {
05605 assert(wand != (MagickWand *) NULL);
05606 assert(wand->signature == WandSignature);
05607 if (wand->debug != MagickFalse)
05608 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05609 if (wand->images == (Image *) NULL)
05610 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05611 return(wand->images->columns);
05612 }
05613
05614
05615
05616
05617
05618
05619
05620
05621
05622
05623
05624
05625
05626
05627
05628
05629
05630
05631
05632
05633
05634
05635
05636
05637 WandExport unsigned long MagickGetNumberImages(MagickWand *wand)
05638 {
05639 assert(wand != (MagickWand *) NULL);
05640 assert(wand->signature == WandSignature);
05641 if (wand->debug != MagickFalse)
05642 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05643 return(GetImageListLength(wand->images));
05644 }
05645
05646
05647
05648
05649
05650
05651
05652
05653
05654
05655
05656
05657
05658
05659
05660
05661
05662
05663
05664
05665
05666
05667
05668 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
05669 {
05670 assert(wand != (MagickWand *) NULL);
05671 assert(wand->signature == WandSignature);
05672 if (wand->debug != MagickFalse)
05673 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05674 if (wand->images == (Image *) NULL)
05675 {
05676 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05677 "ContainsNoImages","`%s'",wand->name);
05678 return(0.0);
05679 }
05680 return(GetImageTotalInkDensity(wand->images));
05681 }
05682
05683
05684
05685
05686
05687
05688
05689
05690
05691
05692
05693
05694
05695
05696
05697
05698
05699
05700
05701
05702
05703
05704
05705
05706
05707
05708
05709
05710
05711
05712
05713
05714
05715 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
05716 const MagickWand *hald_wand)
05717 {
05718 MagickBooleanType
05719 status;
05720
05721 status=MagickHaldClutImageChannel(wand,DefaultChannels,hald_wand);
05722 return(status);
05723 }
05724
05725 WandExport MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
05726 const ChannelType channel,const MagickWand *hald_wand)
05727 {
05728 MagickBooleanType
05729 status;
05730
05731 assert(wand != (MagickWand *) NULL);
05732 assert(wand->signature == WandSignature);
05733 if (wand->debug != MagickFalse)
05734 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05735 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
05736 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05737 status=HaldClutImageChannel(wand->images,channel,hald_wand->images);
05738 if (status == MagickFalse)
05739 InheritException(wand->exception,&wand->images->exception);
05740 return(status);
05741 }
05742
05743
05744
05745
05746
05747
05748
05749
05750
05751
05752
05753
05754
05755
05756
05757
05758
05759
05760
05761
05762
05763
05764
05765
05766 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
05767 {
05768 assert(wand != (MagickWand *) NULL);
05769 assert(wand->signature == WandSignature);
05770 if (wand->debug != MagickFalse)
05771 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05772 if (wand->images == (Image *) NULL)
05773 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05774 if (GetNextImageInList(wand->images) == (Image *) NULL)
05775 return(MagickFalse);
05776 return(MagickTrue);
05777 }
05778
05779
05780
05781
05782
05783
05784
05785
05786
05787
05788
05789
05790
05791
05792
05793
05794
05795
05796
05797
05798
05799
05800
05801
05802 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
05803 {
05804 assert(wand != (MagickWand *) NULL);
05805 assert(wand->signature == WandSignature);
05806 if (wand->debug != MagickFalse)
05807 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05808 if (wand->images == (Image *) NULL)
05809 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05810 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
05811 return(MagickFalse);
05812 return(MagickTrue);
05813 }
05814
05815
05816
05817
05818
05819
05820
05821
05822
05823
05824
05825
05826
05827
05828
05829
05830
05831
05832
05833
05834
05835
05836
05837
05838 WandExport char *MagickIdentifyImage(MagickWand *wand)
05839 {
05840 char
05841 *description,
05842 filename[MaxTextExtent];
05843
05844 FILE
05845 *file;
05846
05847 int
05848 unique_file;
05849
05850 assert(wand != (MagickWand *) NULL);
05851 assert(wand->signature == WandSignature);
05852 if (wand->debug != MagickFalse)
05853 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05854 if (wand->images == (Image *) NULL)
05855 {
05856 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05857 "ContainsNoImages","`%s'",wand->name);
05858 return((char *) NULL);
05859 }
05860 description=(char *) NULL;
05861 unique_file=AcquireUniqueFileResource(filename);
05862 file=(FILE *) NULL;
05863 if (unique_file != -1)
05864 file=fdopen(unique_file,"wb");
05865 if ((unique_file == -1) || (file == (FILE *) NULL))
05866 {
05867 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05868 "UnableToCreateTemporaryFile","`%s'",wand->name);
05869 return((char *) NULL);
05870 }
05871 (void) IdentifyImage(wand->images,file,MagickTrue);
05872 (void) fclose(file);
05873 description=FileToString(filename,~0,wand->exception);
05874 (void) RelinquishUniqueFileResource(filename);
05875 return(description);
05876 }
05877
05878
05879
05880
05881
05882
05883
05884
05885
05886
05887
05888
05889
05890
05891
05892
05893
05894
05895
05896
05897
05898
05899
05900
05901
05902
05903
05904
05905
05906 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
05907 const double amount)
05908 {
05909 Image
05910 *implode_image;
05911
05912 assert(wand != (MagickWand *) NULL);
05913 assert(wand->signature == WandSignature);
05914 if (wand->debug != MagickFalse)
05915 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05916 if (wand->images == (Image *) NULL)
05917 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05918 implode_image=ImplodeImage(wand->images,amount,wand->exception);
05919 if (implode_image == (Image *) NULL)
05920 return(MagickFalse);
05921 ReplaceImageInList(&wand->images,implode_image);
05922 return(MagickTrue);
05923 }
05924
05925
05926
05927
05928
05929
05930
05931
05932
05933
05934
05935
05936
05937
05938
05939
05940
05941
05942
05943
05944
05945
05946
05947
05948
05949
05950
05951
05952
05953
05954
05955
05956
05957
05958
05959
05960
05961
05962
05963
05964
05965
05966
05967
05968
05969
05970
05971
05972
05973
05974
05975
05976 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
05977 const long x,const long y,const unsigned long columns,
05978 const unsigned long rows,const char *map,const StorageType storage,
05979 const void *pixels)
05980 {
05981 MagickBooleanType
05982 status;
05983
05984 assert(wand != (MagickWand *) NULL);
05985 assert(wand->signature == WandSignature);
05986 if (wand->debug != MagickFalse)
05987 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05988 if (wand->images == (Image *) NULL)
05989 ThrowWandException(WandError,"ContainsNoImages",wand->name);
05990 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
05991 if (status == MagickFalse)
05992 InheritException(wand->exception,&wand->images->exception);
05993 return(status);
05994 }
05995
05996
05997
05998
05999
06000
06001
06002
06003
06004
06005
06006
06007
06008
06009
06010
06011
06012
06013
06014
06015
06016
06017
06018
06019
06020 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
06021 const char *label)
06022 {
06023 MagickBooleanType
06024 status;
06025
06026 assert(wand != (MagickWand *) NULL);
06027 assert(wand->signature == WandSignature);
06028 if (wand->debug != MagickFalse)
06029 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06030 if (wand->images == (Image *) NULL)
06031 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06032 status=SetImageProperty(wand->images,"label",label);
06033 if (status == MagickFalse)
06034 InheritException(wand->exception,&wand->images->exception);
06035 return(status);
06036 }
06037
06038
06039
06040
06041
06042
06043
06044
06045
06046
06047
06048
06049
06050
06051
06052
06053
06054
06055
06056
06057
06058
06059
06060
06061
06062
06063
06064
06065
06066
06067
06068
06069
06070
06071
06072
06073
06074
06075
06076
06077
06078
06079
06080 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
06081 const double black_point,const double gamma,const double white_point)
06082 {
06083 MagickBooleanType
06084 status;
06085
06086 status=MagickLevelImageChannel(wand,DefaultChannels,black_point,gamma,
06087 white_point);
06088 return(status);
06089 }
06090
06091 WandExport MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
06092 const ChannelType channel,const double black_point,const double gamma,
06093 const double white_point)
06094 {
06095 MagickBooleanType
06096 status;
06097
06098 assert(wand != (MagickWand *) NULL);
06099 assert(wand->signature == WandSignature);
06100 if (wand->debug != MagickFalse)
06101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06102 if (wand->images == (Image *) NULL)
06103 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06104 status=LevelImageChannel(wand->images,channel,black_point,white_point,gamma);
06105 if (status == MagickFalse)
06106 InheritException(wand->exception,&wand->images->exception);
06107 return(status);
06108 }
06109
06110
06111
06112
06113
06114
06115
06116
06117
06118
06119
06120
06121
06122
06123
06124
06125
06126
06127
06128
06129
06130
06131
06132
06133
06134
06135
06136
06137
06138
06139
06140 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
06141 const double black_point,const double white_point)
06142 {
06143 MagickBooleanType
06144 status;
06145
06146 assert(wand != (MagickWand *) NULL);
06147 assert(wand->signature == WandSignature);
06148 if (wand->debug != MagickFalse)
06149 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06150 if (wand->images == (Image *) NULL)
06151 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06152 status=LinearStretchImage(wand->images,black_point,white_point);
06153 if (status == MagickFalse)
06154 InheritException(wand->exception,&wand->images->exception);
06155 return(status);
06156 }
06157
06158
06159
06160
06161
06162
06163
06164
06165
06166
06167
06168
06169
06170
06171
06172
06173
06174
06175
06176
06177
06178
06179
06180
06181
06182
06183
06184
06185
06186
06187
06188 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
06189 const unsigned long columns,const unsigned long rows,const double delta_x,
06190 const double rigidity)
06191 {
06192 Image
06193 *rescale_image;
06194
06195 assert(wand != (MagickWand *) NULL);
06196 assert(wand->signature == WandSignature);
06197 if (wand->debug != MagickFalse)
06198 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06199 if (wand->images == (Image *) NULL)
06200 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06201 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
06202 rigidity,wand->exception);
06203 if (rescale_image == (Image *) NULL)
06204 return(MagickFalse);
06205 ReplaceImageInList(&wand->images,rescale_image);
06206 return(MagickTrue);
06207 }
06208
06209
06210
06211
06212
06213
06214
06215
06216
06217
06218
06219
06220
06221
06222
06223
06224
06225
06226
06227
06228
06229
06230
06231
06232 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
06233 {
06234 Image
06235 *magnify_image;
06236
06237 assert(wand != (MagickWand *) NULL);
06238 assert(wand->signature == WandSignature);
06239 if (wand->debug != MagickFalse)
06240 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06241 if (wand->images == (Image *) NULL)
06242 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06243 magnify_image=MagnifyImage(wand->images,wand->exception);
06244 if (magnify_image == (Image *) NULL)
06245 return(MagickFalse);
06246 ReplaceImageInList(&wand->images,magnify_image);
06247 return(MagickTrue);
06248 }
06249
06250
06251
06252
06253
06254
06255
06256
06257
06258
06259
06260
06261
06262
06263
06264
06265
06266
06267
06268
06269
06270
06271
06272
06273
06274
06275
06276
06277 WandExport MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
06278 const double radius)
06279 {
06280 Image
06281 *median_image;
06282
06283 assert(wand != (MagickWand *) NULL);
06284 assert(wand->signature == WandSignature);
06285 if (wand->debug != MagickFalse)
06286 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06287 if (wand->images == (Image *) NULL)
06288 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06289 median_image=MedianFilterImage(wand->images,radius,wand->exception);
06290 if (median_image == (Image *) NULL)
06291 return(MagickFalse);
06292 ReplaceImageInList(&wand->images,median_image);
06293 return(MagickTrue);
06294 }
06295
06296
06297
06298
06299
06300
06301
06302
06303
06304
06305
06306
06307
06308
06309
06310
06311
06312
06313
06314
06315
06316
06317
06318
06319
06320
06321
06322
06323
06324
06325
06326
06327
06328
06329
06330
06331
06332
06333
06334
06335
06336
06337
06338
06339 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
06340 const ImageLayerMethod method)
06341 {
06342 Image
06343 *mosaic_image;
06344
06345 assert(wand != (MagickWand *) NULL);
06346 assert(wand->signature == WandSignature);
06347 if (wand->debug != MagickFalse)
06348 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06349 if (wand->images == (Image *) NULL)
06350 return((MagickWand *) NULL);
06351 mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
06352 if (mosaic_image == (Image *) NULL)
06353 return((MagickWand *) NULL);
06354 return(CloneMagickWandFromImages(wand,mosaic_image));
06355 }
06356
06357
06358
06359
06360
06361
06362
06363
06364
06365
06366
06367
06368
06369
06370
06371
06372
06373
06374
06375
06376
06377
06378
06379
06380 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
06381 {
06382 Image
06383 *minify_image;
06384
06385 assert(wand != (MagickWand *) NULL);
06386 assert(wand->signature == WandSignature);
06387 if (wand->debug != MagickFalse)
06388 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06389 if (wand->images == (Image *) NULL)
06390 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06391 minify_image=MinifyImage(wand->images,wand->exception);
06392 if (minify_image == (Image *) NULL)
06393 return(MagickFalse);
06394 ReplaceImageInList(&wand->images,minify_image);
06395 return(MagickTrue);
06396 }
06397
06398
06399
06400
06401
06402
06403
06404
06405
06406
06407
06408
06409
06410
06411
06412
06413
06414
06415
06416
06417
06418
06419
06420
06421
06422
06423
06424
06425
06426
06427
06428
06429
06430
06431
06432
06433
06434 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
06435 const double brightness,const double saturation,const double hue)
06436 {
06437 char
06438 modulate[MaxTextExtent];
06439
06440 MagickBooleanType
06441 status;
06442
06443 assert(wand != (MagickWand *) NULL);
06444 assert(wand->signature == WandSignature);
06445 if (wand->debug != MagickFalse)
06446 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06447 if (wand->images == (Image *) NULL)
06448 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06449 (void) FormatMagickString(modulate,MaxTextExtent,"%g,%g,%g",brightness,
06450 saturation,hue);
06451 status=ModulateImage(wand->images,modulate);
06452 if (status == MagickFalse)
06453 InheritException(wand->exception,&wand->images->exception);
06454 return(status);
06455 }
06456
06457
06458
06459
06460
06461
06462
06463
06464
06465
06466
06467
06468
06469
06470
06471
06472
06473
06474
06475
06476
06477
06478
06479
06480
06481
06482
06483
06484
06485
06486
06487
06488
06489
06490
06491
06492
06493
06494
06495
06496
06497 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
06498 const DrawingWand *drawing_wand,const char *tile_geometry,
06499 const char *thumbnail_geometry,const MontageMode mode,const char *frame)
06500 {
06501 char
06502 *font;
06503
06504 Image
06505 *montage_image;
06506
06507 MontageInfo
06508 *montage_info;
06509
06510 PixelWand
06511 *pixel_wand;
06512
06513 assert(wand != (MagickWand *) NULL);
06514 assert(wand->signature == WandSignature);
06515 if (wand->debug != MagickFalse)
06516 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06517 if (wand->images == (Image *) NULL)
06518 return((MagickWand *) NULL);
06519 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
06520 switch (mode)
06521 {
06522 case FrameMode:
06523 {
06524 (void) CloneString(&montage_info->frame,"15x15+3+3");
06525 montage_info->shadow=MagickTrue;
06526 break;
06527 }
06528 case UnframeMode:
06529 {
06530 montage_info->frame=(char *) NULL;
06531 montage_info->shadow=MagickFalse;
06532 montage_info->border_width=0;
06533 break;
06534 }
06535 case ConcatenateMode:
06536 {
06537 montage_info->frame=(char *) NULL;
06538 montage_info->shadow=MagickFalse;
06539 (void) CloneString(&montage_info->geometry,"+0+0");
06540 montage_info->border_width=0;
06541 break;
06542 }
06543 default:
06544 break;
06545 }
06546 font=DrawGetFont(drawing_wand);
06547 if (font != (char *) NULL)
06548 (void) CloneString(&montage_info->font,font);
06549 if (frame != (char *) NULL)
06550 (void) CloneString(&montage_info->frame,frame);
06551 montage_info->pointsize=DrawGetFontSize(drawing_wand);
06552 pixel_wand=NewPixelWand();
06553 DrawGetFillColor(drawing_wand,pixel_wand);
06554 PixelGetQuantumColor(pixel_wand,&montage_info->fill);
06555 DrawGetStrokeColor(drawing_wand,pixel_wand);
06556 PixelGetQuantumColor(pixel_wand,&montage_info->stroke);
06557 pixel_wand=DestroyPixelWand(pixel_wand);
06558 if (thumbnail_geometry != (char *) NULL)
06559 (void) CloneString(&montage_info->geometry,thumbnail_geometry);
06560 if (tile_geometry != (char *) NULL)
06561 (void) CloneString(&montage_info->tile,tile_geometry);
06562 montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
06563 wand->exception);
06564 montage_info=DestroyMontageInfo(montage_info);
06565 if (montage_image == (Image *) NULL)
06566 return((MagickWand *) NULL);
06567 return(CloneMagickWandFromImages(wand,montage_image));
06568 }
06569
06570
06571
06572
06573
06574
06575
06576
06577
06578
06579
06580
06581
06582
06583
06584
06585
06586
06587
06588
06589
06590
06591
06592
06593
06594
06595
06596
06597 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
06598 const unsigned long number_frames)
06599 {
06600 Image
06601 *morph_image;
06602
06603 assert(wand != (MagickWand *) NULL);
06604 assert(wand->signature == WandSignature);
06605 if (wand->debug != MagickFalse)
06606 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06607 if (wand->images == (Image *) NULL)
06608 return((MagickWand *) NULL);
06609 morph_image=MorphImages(wand->images,number_frames,wand->exception);
06610 if (morph_image == (Image *) NULL)
06611 return((MagickWand *) NULL);
06612 return(CloneMagickWandFromImages(wand,morph_image));
06613 }
06614
06615
06616
06617
06618
06619
06620
06621
06622
06623
06624
06625
06626
06627
06628
06629
06630
06631
06632
06633
06634
06635
06636
06637
06638
06639
06640
06641
06642
06643
06644
06645
06646
06647
06648
06649
06650
06651
06652
06653
06654
06655 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
06656 const double radius,const double sigma,const double angle)
06657 {
06658 MagickBooleanType
06659 status;
06660
06661 status=MagickMotionBlurImageChannel(wand,DefaultChannels,radius,sigma,angle);
06662 return(status);
06663 }
06664
06665 WandExport MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
06666 const ChannelType channel,const double radius,const double sigma,
06667 const double angle)
06668 {
06669 Image
06670 *blur_image;
06671
06672 assert(wand != (MagickWand *) NULL);
06673 assert(wand->signature == WandSignature);
06674 if (wand->debug != MagickFalse)
06675 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06676 if (wand->images == (Image *) NULL)
06677 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06678 blur_image=MotionBlurImageChannel(wand->images,channel,radius,sigma,angle,
06679 wand->exception);
06680 if (blur_image == (Image *) NULL)
06681 return(MagickFalse);
06682 ReplaceImageInList(&wand->images,blur_image);
06683 return(MagickTrue);
06684 }
06685
06686
06687
06688
06689
06690
06691
06692
06693
06694
06695
06696
06697
06698
06699
06700
06701
06702
06703
06704
06705
06706
06707
06708
06709
06710
06711
06712
06713
06714
06715
06716
06717
06718
06719
06720
06721 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
06722 const MagickBooleanType gray)
06723 {
06724 MagickBooleanType
06725 status;
06726
06727 status=MagickNegateImageChannel(wand,DefaultChannels,gray);
06728 return(status);
06729 }
06730
06731 WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand,
06732 const ChannelType channel,const MagickBooleanType gray)
06733 {
06734 MagickBooleanType
06735 status;
06736
06737 assert(wand != (MagickWand *) NULL);
06738 assert(wand->signature == WandSignature);
06739 if (wand->debug != MagickFalse)
06740 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06741 if (wand->images == (Image *) NULL)
06742 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06743 status=NegateImageChannel(wand->images,channel,gray);
06744 if (status == MagickFalse)
06745 InheritException(wand->exception,&wand->images->exception);
06746 return(status);
06747 }
06748
06749
06750
06751
06752
06753
06754
06755
06756
06757
06758
06759
06760
06761
06762
06763
06764
06765
06766
06767
06768
06769
06770
06771
06772
06773
06774
06775
06776
06777
06778
06779
06780 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
06781 const unsigned long width,const unsigned long height,
06782 const PixelWand *background)
06783 {
06784 Image
06785 *images;
06786
06787 MagickPixelPacket
06788 pixel;
06789
06790 assert(wand != (MagickWand *) NULL);
06791 assert(wand->signature == WandSignature);
06792 if (wand->debug != MagickFalse)
06793 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06794 PixelGetMagickColor(background,&pixel);
06795 images=NewMagickImage(wand->image_info,width,height,&pixel);
06796 if (images == (Image *) NULL)
06797 return(MagickFalse);
06798 if (images->exception.severity != UndefinedException)
06799 InheritException(wand->exception,&images->exception);
06800 return(InsertImageInWand(wand,images));
06801 }
06802
06803
06804
06805
06806
06807
06808
06809
06810
06811
06812
06813
06814
06815
06816
06817
06818
06819
06820
06821
06822
06823
06824
06825
06826 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
06827 {
06828 assert(wand != (MagickWand *) NULL);
06829 assert(wand->signature == WandSignature);
06830 if (wand->debug != MagickFalse)
06831 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06832 if (wand->images == (Image *) NULL)
06833 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06834 if (wand->pend != MagickFalse)
06835 {
06836 wand->pend=MagickFalse;
06837 return(MagickTrue);
06838 }
06839 if (GetNextImageInList(wand->images) == (Image *) NULL)
06840 {
06841 wand->pend=MagickTrue;
06842 return(MagickFalse);
06843 }
06844 wand->images=GetNextImageInList(wand->images);
06845 return(MagickTrue);
06846 }
06847
06848
06849
06850
06851
06852
06853
06854
06855
06856
06857
06858
06859
06860
06861
06862
06863
06864
06865
06866
06867
06868
06869
06870
06871
06872
06873
06874
06875
06876
06877
06878
06879 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
06880 {
06881 MagickBooleanType
06882 status;
06883
06884 status=MagickNormalizeImageChannel(wand,DefaultChannels);
06885 return(status);
06886 }
06887
06888 WandExport MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
06889 const ChannelType channel)
06890 {
06891 MagickBooleanType
06892 status;
06893
06894 assert(wand != (MagickWand *) NULL);
06895 assert(wand->signature == WandSignature);
06896 if (wand->debug != MagickFalse)
06897 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06898 if (wand->images == (Image *) NULL)
06899 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06900 status=NormalizeImageChannel(wand->images,channel);
06901 if (status == MagickFalse)
06902 InheritException(wand->exception,&wand->images->exception);
06903 return(status);
06904 }
06905
06906
06907
06908
06909
06910
06911
06912
06913
06914
06915
06916
06917
06918
06919
06920
06921
06922
06923
06924
06925
06926
06927
06928
06929
06930
06931
06932
06933 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
06934 const double radius)
06935 {
06936 Image
06937 *paint_image;
06938
06939 assert(wand != (MagickWand *) NULL);
06940 assert(wand->signature == WandSignature);
06941 if (wand->debug != MagickFalse)
06942 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06943 if (wand->images == (Image *) NULL)
06944 ThrowWandException(WandError,"ContainsNoImages",wand->name);
06945 paint_image=OilPaintImage(wand->images,radius,wand->exception);
06946 if (paint_image == (Image *) NULL)
06947 return(MagickFalse);
06948 ReplaceImageInList(&wand->images,paint_image);
06949 return(MagickTrue);
06950 }
06951
06952
06953
06954
06955
06956
06957
06958
06959
06960
06961
06962
06963
06964
06965
06966
06967
06968
06969
06970
06971
06972
06973
06974
06975
06976
06977
06978
06979
06980
06981
06982
06983
06984
06985
06986
06987
06988
06989
06990
06991
06992
06993
06994
06995
06996 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
06997 const PixelWand *target,const PixelWand *fill,const double fuzz,
06998 const MagickBooleanType invert)
06999 {
07000 MagickBooleanType
07001 status;
07002
07003 status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz,
07004 invert);
07005 return(status);
07006 }
07007
07008 WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
07009 const ChannelType channel,const PixelWand *target,const PixelWand *fill,
07010 const double fuzz,const MagickBooleanType invert)
07011 {
07012 MagickBooleanType
07013 status;
07014
07015 MagickPixelPacket
07016 fill_pixel,
07017 target_pixel;
07018
07019 assert(wand != (MagickWand *) NULL);
07020 assert(wand->signature == WandSignature);
07021 if (wand->debug != MagickFalse)
07022 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07023 if (wand->images == (Image *) NULL)
07024 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07025 PixelGetMagickColor(target,&target_pixel);
07026 PixelGetMagickColor(fill,&fill_pixel);
07027 wand->images->fuzz=fuzz;
07028 status=OpaquePaintImageChannel(wand->images,channel,&target_pixel,
07029 &fill_pixel,invert);
07030 if (status == MagickFalse)
07031 InheritException(wand->exception,&wand->images->exception);
07032 return(status);
07033 }
07034
07035
07036
07037
07038
07039
07040
07041
07042
07043
07044
07045
07046
07047
07048
07049
07050
07051
07052
07053
07054
07055
07056
07057
07058
07059
07060 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
07061 {
07062 Image
07063 *optimize_image;
07064
07065 assert(wand != (MagickWand *) NULL);
07066 assert(wand->signature == WandSignature);
07067 if (wand->debug != MagickFalse)
07068 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07069 if (wand->images == (Image *) NULL)
07070 return((MagickWand *) NULL);
07071 optimize_image=OptimizeImageLayers(wand->images,wand->exception);
07072 if (optimize_image == (Image *) NULL)
07073 return((MagickWand *) NULL);
07074 return(CloneMagickWandFromImages(wand,optimize_image));
07075 }
07076
07077
07078
07079
07080
07081
07082
07083
07084
07085
07086
07087
07088
07089
07090
07091
07092
07093
07094
07095
07096
07097
07098
07099
07100
07101
07102
07103
07104
07105
07106
07107
07108
07109
07110
07111
07112
07113
07114
07115
07116
07117
07118
07119
07120
07121
07122
07123
07124
07125
07126
07127 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
07128 const char *threshold_map)
07129 {
07130 MagickBooleanType
07131 status;
07132
07133 status=MagickOrderedPosterizeImageChannel(wand,DefaultChannels,threshold_map);
07134 return(status);
07135 }
07136
07137 WandExport MagickBooleanType MagickOrderedPosterizeImageChannel(
07138 MagickWand *wand,const ChannelType channel,const char *threshold_map)
07139 {
07140 MagickBooleanType
07141 status;
07142
07143 assert(wand != (MagickWand *) NULL);
07144 assert(wand->signature == WandSignature);
07145 if (wand->debug != MagickFalse)
07146 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07147 if (wand->images == (Image *) NULL)
07148 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07149 status=OrderedPosterizeImageChannel(wand->images,channel,threshold_map,
07150 wand->exception);
07151 return(status);
07152 }
07153
07154
07155
07156
07157
07158
07159
07160
07161
07162
07163
07164
07165
07166
07167
07168
07169
07170
07171
07172
07173
07174
07175
07176
07177
07178
07179
07180
07181 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
07182 const char *filename)
07183 {
07184 Image
07185 *images;
07186
07187 ImageInfo
07188 *ping_info;
07189
07190 assert(wand != (MagickWand *) NULL);
07191 assert(wand->signature == WandSignature);
07192 if (wand->debug != MagickFalse)
07193 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07194 ping_info=CloneImageInfo(wand->image_info);
07195 if (filename != (const char *) NULL)
07196 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
07197 images=PingImage(ping_info,wand->exception);
07198 ping_info=DestroyImageInfo(ping_info);
07199 if (images == (Image *) NULL)
07200 return(MagickFalse);
07201 return(InsertImageInWand(wand,images));
07202 }
07203
07204
07205
07206
07207
07208
07209
07210
07211
07212
07213
07214
07215
07216
07217
07218
07219
07220
07221
07222
07223
07224
07225
07226
07227
07228
07229
07230
07231 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
07232 const void *blob,const size_t length)
07233 {
07234 Image
07235 *images;
07236
07237 ImageInfo
07238 *read_info;
07239
07240 assert(wand != (MagickWand *) NULL);
07241 assert(wand->signature == WandSignature);
07242 if (wand->debug != MagickFalse)
07243 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07244 read_info=CloneImageInfo(wand->image_info);
07245 SetImageInfoBlob(read_info,blob,length);
07246 images=PingImage(read_info,wand->exception);
07247 read_info=DestroyImageInfo(read_info);
07248 if (images == (Image *) NULL)
07249 return(MagickFalse);
07250 return(InsertImageInWand(wand,images));
07251 }
07252
07253
07254
07255
07256
07257
07258
07259
07260
07261
07262
07263
07264
07265
07266
07267
07268
07269
07270
07271
07272
07273
07274
07275
07276
07277
07278 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
07279 {
07280 Image
07281 *images;
07282
07283 ImageInfo
07284 *read_info;
07285
07286 assert(wand != (MagickWand *) NULL);
07287 assert(wand->signature == WandSignature);
07288 assert(file != (FILE *) NULL);
07289 if (wand->debug != MagickFalse)
07290 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07291 read_info=CloneImageInfo(wand->image_info);
07292 SetImageInfoFile(read_info,file);
07293 images=PingImage(read_info,wand->exception);
07294 read_info=DestroyImageInfo(read_info);
07295 if (images == (Image *) NULL)
07296 return(MagickFalse);
07297 return(InsertImageInWand(wand,images));
07298 }
07299
07300
07301
07302
07303
07304
07305
07306
07307
07308
07309
07310
07311
07312
07313
07314
07315
07316
07317
07318
07319
07320
07321
07322
07323
07324
07325
07326
07327 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
07328 const DrawingWand *drawing_wand,const double angle)
07329 {
07330 DrawInfo
07331 *draw_info;
07332
07333 Image
07334 *polaroid_image;
07335
07336 assert(wand != (MagickWand *) NULL);
07337 assert(wand->signature == WandSignature);
07338 if (wand->debug != MagickFalse)
07339 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07340 if (wand->images == (Image *) NULL)
07341 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07342 draw_info=PeekDrawingWand(drawing_wand);
07343 if (draw_info == (DrawInfo *) NULL)
07344 return(MagickFalse);
07345 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
07346 if (polaroid_image == (Image *) NULL)
07347 return(MagickFalse);
07348 ReplaceImageInList(&wand->images,polaroid_image);
07349 return(MagickTrue);
07350 }
07351
07352
07353
07354
07355
07356
07357
07358
07359
07360
07361
07362
07363
07364
07365
07366
07367
07368
07369
07370
07371
07372
07373
07374
07375
07376
07377
07378
07379
07380
07381 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
07382 const unsigned long levels,const MagickBooleanType dither)
07383 {
07384 MagickBooleanType
07385 status;
07386
07387 assert(wand != (MagickWand *) NULL);
07388 assert(wand->signature == WandSignature);
07389 if (wand->debug != MagickFalse)
07390 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07391 if (wand->images == (Image *) NULL)
07392 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07393 status=PosterizeImage(wand->images,levels,dither);
07394 if (status == MagickFalse)
07395 InheritException(wand->exception,&wand->images->exception);
07396 return(status);
07397 }
07398
07399
07400
07401
07402
07403
07404
07405
07406
07407
07408
07409
07410
07411
07412
07413
07414
07415
07416
07417
07418
07419
07420
07421
07422
07423
07424
07425
07426
07427 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
07428 const PreviewType preview)
07429 {
07430 Image
07431 *preview_image;
07432
07433 assert(wand != (MagickWand *) NULL);
07434 assert(wand->signature == WandSignature);
07435 if (wand->debug != MagickFalse)
07436 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07437 if (wand->images == (Image *) NULL)
07438 return((MagickWand *) NULL);
07439 preview_image=PreviewImage(wand->images,preview,wand->exception);
07440 if (preview_image == (Image *) NULL)
07441 return((MagickWand *) NULL);
07442 return(CloneMagickWandFromImages(wand,preview_image));
07443 }
07444
07445
07446
07447
07448
07449
07450
07451
07452
07453
07454
07455
07456
07457
07458
07459
07460
07461
07462
07463
07464
07465
07466
07467
07468 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
07469 {
07470 assert(wand != (MagickWand *) NULL);
07471 assert(wand->signature == WandSignature);
07472 if (wand->debug != MagickFalse)
07473 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07474 if (wand->images == (Image *) NULL)
07475 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07476 if (wand->pend != MagickFalse)
07477 {
07478 wand->pend=MagickFalse;
07479 return(MagickTrue);
07480 }
07481 if (GetPreviousImageInList(wand->images) == (Image *) NULL)
07482 {
07483 wand->pend=MagickTrue;
07484 return(MagickFalse);
07485 }
07486 wand->images=GetPreviousImageInList(wand->images);
07487 return(MagickTrue);
07488 }
07489
07490
07491
07492
07493
07494
07495
07496
07497
07498
07499
07500
07501
07502
07503
07504
07505
07506
07507
07508
07509
07510
07511
07512
07513
07514
07515
07516
07517
07518
07519
07520
07521
07522
07523
07524
07525
07526
07527
07528
07529
07530
07531
07532
07533
07534
07535
07536
07537
07538
07539
07540
07541 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
07542 const unsigned long number_colors,const ColorspaceType colorspace,
07543 const unsigned long treedepth,const MagickBooleanType dither,
07544 const MagickBooleanType measure_error)
07545 {
07546 MagickBooleanType
07547 status;
07548
07549 QuantizeInfo
07550 *quantize_info;
07551
07552 assert(wand != (MagickWand *) NULL);
07553 assert(wand->signature == WandSignature);
07554 if (wand->debug != MagickFalse)
07555 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07556 if (wand->images == (Image *) NULL)
07557 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07558 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
07559 quantize_info->number_colors=number_colors;
07560 quantize_info->dither=dither;
07561 quantize_info->tree_depth=treedepth;
07562 quantize_info->colorspace=colorspace;
07563 quantize_info->measure_error=measure_error;
07564 status=QuantizeImage(quantize_info,wand->images);
07565 if (status == MagickFalse)
07566 InheritException(wand->exception,&wand->images->exception);
07567 quantize_info=DestroyQuantizeInfo(quantize_info);
07568 return(status);
07569 }
07570
07571
07572
07573
07574
07575
07576
07577
07578
07579
07580
07581
07582
07583
07584
07585
07586
07587
07588
07589
07590
07591
07592
07593
07594
07595
07596
07597
07598
07599
07600
07601
07602
07603
07604
07605
07606
07607
07608
07609
07610
07611
07612
07613
07614
07615
07616
07617
07618
07619
07620
07621
07622 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
07623 const unsigned long number_colors,const ColorspaceType colorspace,
07624 const unsigned long treedepth,const MagickBooleanType dither,
07625 const MagickBooleanType measure_error)
07626 {
07627 MagickBooleanType
07628 status;
07629
07630 QuantizeInfo
07631 *quantize_info;
07632
07633 assert(wand != (MagickWand *) NULL);
07634 assert(wand->signature == WandSignature);
07635 if (wand->debug != MagickFalse)
07636 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07637 if (wand->images == (Image *) NULL)
07638 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07639 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
07640 quantize_info->number_colors=number_colors;
07641 quantize_info->dither=dither;
07642 quantize_info->tree_depth=treedepth;
07643 quantize_info->colorspace=colorspace;
07644 quantize_info->measure_error=measure_error;
07645 status=QuantizeImages(quantize_info,wand->images);
07646 if (status == MagickFalse)
07647 InheritException(wand->exception,&wand->images->exception);
07648 quantize_info=DestroyQuantizeInfo(quantize_info);
07649 return(status);
07650 }
07651
07652
07653
07654
07655
07656
07657
07658
07659
07660
07661
07662
07663
07664
07665
07666
07667
07668
07669
07670
07671
07672
07673
07674
07675
07676
07677
07678
07679
07680
07681 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
07682 const double angle)
07683 {
07684 MagickBooleanType
07685 status;
07686
07687 status=MagickRadialBlurImageChannel(wand,DefaultChannels,angle);
07688 return(status);
07689 }
07690
07691 WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
07692 const ChannelType channel,const double angle)
07693 {
07694 Image
07695 *blur_image;
07696
07697 assert(wand != (MagickWand *) NULL);
07698 assert(wand->signature == WandSignature);
07699 if (wand->debug != MagickFalse)
07700 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07701 if (wand->images == (Image *) NULL)
07702 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07703 blur_image=RadialBlurImageChannel(wand->images,channel,angle,
07704 wand->exception);
07705 if (blur_image == (Image *) NULL)
07706 return(MagickFalse);
07707 ReplaceImageInList(&wand->images,blur_image);
07708 return(MagickTrue);
07709 }
07710
07711
07712
07713
07714
07715
07716
07717
07718
07719
07720
07721
07722
07723
07724
07725
07726
07727
07728
07729
07730
07731
07732
07733
07734
07735
07736
07737
07738
07739
07740
07741
07742
07743 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
07744 const unsigned long width,const unsigned long height,const long x,
07745 const long y,const MagickBooleanType raise)
07746 {
07747 MagickBooleanType
07748 status;
07749
07750 RectangleInfo
07751 raise_info;
07752
07753 assert(wand != (MagickWand *) NULL);
07754 assert(wand->signature == WandSignature);
07755 if (wand->debug != MagickFalse)
07756 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07757 if (wand->images == (Image *) NULL)
07758 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07759 raise_info.width=width;
07760 raise_info.height=height;
07761 raise_info.x=x;
07762 raise_info.y=y;
07763 status=RaiseImage(wand->images,&raise_info,raise);
07764 if (status == MagickFalse)
07765 InheritException(wand->exception,&wand->images->exception);
07766 return(status);
07767 }
07768
07769
07770
07771
07772
07773
07774
07775
07776
07777
07778
07779
07780
07781
07782
07783
07784
07785
07786
07787
07788
07789
07790
07791
07792
07793
07794
07795
07796
07797
07798
07799
07800
07801
07802 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
07803 const double low,const double high)
07804 {
07805 MagickBooleanType
07806 status;
07807
07808 status=MagickRandomThresholdImageChannel(wand,DefaultChannels,low,high);
07809 return(status);
07810 }
07811
07812 WandExport MagickBooleanType MagickRandomThresholdImageChannel(
07813 MagickWand *wand,const ChannelType channel,const double low,
07814 const double high)
07815 {
07816 char
07817 threshold[MaxTextExtent];
07818
07819 MagickBooleanType
07820 status;
07821
07822 assert(wand != (MagickWand *) NULL);
07823 assert(wand->signature == WandSignature);
07824 if (wand->debug != MagickFalse)
07825 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07826 if (wand->images == (Image *) NULL)
07827 ThrowWandException(WandError,"ContainsNoImages",wand->name);
07828 (void) FormatMagickString(threshold,MaxTextExtent,"%gx%g",low,high);
07829 status=RandomThresholdImageChannel(wand->images,channel,threshold,
07830 wand->exception);
07831 if (status == MagickFalse)
07832 InheritException(wand->exception,&wand->images->exception);
07833 return(status);
07834 }
07835
07836
07837
07838
07839
07840
07841
07842
07843
07844
07845
07846
07847
07848
07849
07850
07851
07852
07853
07854
07855
07856
07857
07858
07859
07860
07861
07862
07863
07864 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
07865 const char *filename)
07866 {
07867 Image
07868 *images;
07869
07870 ImageInfo
07871 *read_info;
07872
07873 assert(wand != (MagickWand *) NULL);
07874 assert(wand->signature == WandSignature);
07875 if (wand->debug != MagickFalse)
07876 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07877 read_info=CloneImageInfo(wand->image_info);
07878 if (filename != (const char *) NULL)
07879 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
07880 images=ReadImage(read_info,wand->exception);
07881 read_info=DestroyImageInfo(read_info);
07882 if (images == (Image *) NULL)
07883 return(MagickFalse);
07884 return(InsertImageInWand(wand,images));
07885 }
07886
07887
07888
07889
07890
07891
07892
07893
07894
07895
07896
07897
07898
07899
07900
07901
07902
07903
07904
07905
07906
07907
07908
07909
07910
07911
07912
07913
07914 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
07915 const void *blob,const size_t length)
07916 {
07917 Image
07918 *images;
07919
07920 assert(wand != (MagickWand *) NULL);
07921 assert(wand->signature == WandSignature);
07922 if (wand->debug != MagickFalse)
07923 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07924 images=BlobToImage(wand->image_info,blob,length,wand->exception);
07925 if (images == (Image *) NULL)
07926 return(MagickFalse);
07927 return(InsertImageInWand(wand,images));
07928 }
07929
07930
07931
07932
07933
07934
07935
07936
07937
07938
07939
07940
07941
07942
07943
07944
07945
07946
07947
07948
07949
07950
07951
07952
07953
07954
07955 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
07956 {
07957 Image
07958 *images;
07959
07960 ImageInfo
07961 *read_info;
07962
07963 assert(wand != (MagickWand *) NULL);
07964 assert(wand->signature == WandSignature);
07965 assert(file != (FILE *) NULL);
07966 if (wand->debug != MagickFalse)
07967 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07968 read_info=CloneImageInfo(wand->image_info);
07969 SetImageInfoFile(read_info,file);
07970 images=ReadImage(read_info,wand->exception);
07971 read_info=DestroyImageInfo(read_info);
07972 if (images == (Image *) NULL)
07973 return(MagickFalse);
07974 return(InsertImageInWand(wand,images));
07975 }
07976
07977
07978
07979
07980
07981
07982
07983
07984
07985
07986
07987
07988
07989
07990
07991
07992
07993
07994
07995
07996
07997
07998
07999
08000
08001
08002
08003
08004
08005
08006
08007 WandExport MagickBooleanType MagickRecolorImage(MagickWand *wand,
08008 const unsigned long order,const double *color_matrix)
08009 {
08010 Image
08011 *transform_image;
08012
08013 assert(wand != (MagickWand *) NULL);
08014 assert(wand->signature == WandSignature);
08015 if (wand->debug != MagickFalse)
08016 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08017 if (color_matrix == (const double *) NULL)
08018 return(MagickFalse);
08019 if (wand->images == (Image *) NULL)
08020 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08021 transform_image=RecolorImage(wand->images,order,color_matrix,
08022 wand->exception);
08023 if (transform_image == (Image *) NULL)
08024 return(MagickFalse);
08025 ReplaceImageInList(&wand->images,transform_image);
08026 return(MagickTrue);
08027 }
08028
08029
08030
08031
08032
08033
08034
08035
08036
08037
08038
08039
08040
08041
08042
08043
08044
08045
08046
08047
08048
08049
08050
08051
08052
08053
08054
08055
08056
08057 WandExport MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
08058 const double radius)
08059 {
08060 Image
08061 *noise_image;
08062
08063 assert(wand != (MagickWand *) NULL);
08064 assert(wand->signature == WandSignature);
08065 if (wand->debug != MagickFalse)
08066 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08067 if (wand->images == (Image *) NULL)
08068 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08069 noise_image=ReduceNoiseImage(wand->images,radius,wand->exception);
08070 if (noise_image == (Image *) NULL)
08071 return(MagickFalse);
08072 ReplaceImageInList(&wand->images,noise_image);
08073 return(MagickTrue);
08074 }
08075
08076
08077
08078
08079
08080
08081
08082
08083
08084
08085
08086
08087
08088
08089
08090
08091
08092
08093
08094
08095
08096
08097
08098
08099
08100
08101
08102
08103
08104
08105 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
08106 const MagickWand *remap_wand,const DitherMethod method)
08107 {
08108 MagickBooleanType
08109 status;
08110
08111 QuantizeInfo
08112 *quantize_info;
08113
08114 assert(wand != (MagickWand *) NULL);
08115 assert(wand->signature == WandSignature);
08116 if (wand->debug != MagickFalse)
08117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08118 if ((wand->images == (Image *) NULL) ||
08119 (remap_wand->images == (Image *) NULL))
08120 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08121 quantize_info=AcquireQuantizeInfo(wand->image_info);
08122 quantize_info->dither_method=method;
08123 if (method == NoDitherMethod)
08124 quantize_info->dither=MagickFalse;
08125 status=RemapImage(quantize_info,wand->images,remap_wand->images);
08126 quantize_info=DestroyQuantizeInfo(quantize_info);
08127 if (status == MagickFalse)
08128 InheritException(wand->exception,&wand->images->exception);
08129 return(status);
08130 }
08131
08132
08133
08134
08135
08136
08137
08138
08139
08140
08141
08142
08143
08144
08145
08146
08147
08148
08149
08150
08151
08152
08153
08154
08155
08156 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
08157 {
08158 assert(wand != (MagickWand *) NULL);
08159 assert(wand->signature == WandSignature);
08160 if (wand->debug != MagickFalse)
08161 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08162 if (wand->images == (Image *) NULL)
08163 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08164 DeleteImageFromList(&wand->images);
08165 return(MagickTrue);
08166 }
08167
08168
08169
08170
08171
08172
08173
08174
08175
08176
08177
08178
08179
08180
08181
08182
08183
08184
08185
08186
08187
08188
08189
08190
08191
08192
08193
08194
08195
08196
08197
08198
08199
08200
08201
08202
08203
08204
08205
08206
08207
08208
08209
08210 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
08211 const double x_resolution,const double y_resolution,const FilterTypes filter,
08212 const double blur)
08213 {
08214 Image
08215 *resample_image;
08216
08217 assert(wand != (MagickWand *) NULL);
08218 assert(wand->signature == WandSignature);
08219 if (wand->debug != MagickFalse)
08220 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08221 if (wand->images == (Image *) NULL)
08222 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08223 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
08224 blur,wand->exception);
08225 if (resample_image == (Image *) NULL)
08226 return(MagickFalse);
08227 ReplaceImageInList(&wand->images,resample_image);
08228 return(MagickTrue);
08229 }
08230
08231
08232
08233
08234
08235
08236
08237
08238
08239
08240
08241
08242
08243
08244
08245
08246
08247
08248
08249
08250
08251
08252
08253
08254
08255
08256 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
08257 const char *page)
08258 {
08259 assert(wand != (MagickWand *) NULL);
08260 assert(wand->signature == WandSignature);
08261 if (wand->debug != MagickFalse)
08262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08263 if (wand->images == (Image *) NULL)
08264 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08265 if ((page == (char *) NULL) || (*page == '\0'))
08266 {
08267 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
08268 return(MagickTrue);
08269 }
08270 return(ResetImagePage(wand->images,page));
08271 }
08272
08273
08274
08275
08276
08277
08278
08279
08280
08281
08282
08283
08284
08285
08286
08287
08288
08289
08290
08291
08292
08293
08294
08295
08296
08297
08298
08299
08300
08301
08302
08303
08304
08305
08306
08307
08308
08309
08310
08311
08312
08313
08314
08315
08316 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
08317 const unsigned long columns,const unsigned long rows,const FilterTypes filter,
08318 const double blur)
08319 {
08320 Image
08321 *resize_image;
08322
08323 assert(wand != (MagickWand *) NULL);
08324 assert(wand->signature == WandSignature);
08325 if (wand->debug != MagickFalse)
08326 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08327 if (wand->images == (Image *) NULL)
08328 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08329 resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
08330 wand->exception);
08331 if (resize_image == (Image *) NULL)
08332 return(MagickFalse);
08333 ReplaceImageInList(&wand->images,resize_image);
08334 return(MagickTrue);
08335 }
08336
08337
08338
08339
08340
08341
08342
08343
08344
08345
08346
08347
08348
08349
08350
08351
08352
08353
08354
08355
08356
08357
08358
08359
08360
08361
08362
08363
08364
08365 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
08366 const long x,const long y)
08367 {
08368 Image
08369 *roll_image;
08370
08371 assert(wand != (MagickWand *) NULL);
08372 assert(wand->signature == WandSignature);
08373 if (wand->debug != MagickFalse)
08374 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08375 if (wand->images == (Image *) NULL)
08376 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08377 roll_image=RollImage(wand->images,x,y,wand->exception);
08378 if (roll_image == (Image *) NULL)
08379 return(MagickFalse);
08380 ReplaceImageInList(&wand->images,roll_image);
08381 return(MagickTrue);
08382 }
08383
08384
08385
08386
08387
08388
08389
08390
08391
08392
08393
08394
08395
08396
08397
08398
08399
08400
08401
08402
08403
08404
08405
08406
08407
08408
08409
08410
08411
08412
08413
08414 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
08415 const PixelWand *background,const double degrees)
08416 {
08417 Image
08418 *rotate_image;
08419
08420 assert(wand != (MagickWand *) NULL);
08421 assert(wand->signature == WandSignature);
08422 if (wand->debug != MagickFalse)
08423 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08424 if (wand->images == (Image *) NULL)
08425 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08426 PixelGetQuantumColor(background,&wand->images->background_color);
08427 rotate_image=RotateImage(wand->images,degrees,wand->exception);
08428 if (rotate_image == (Image *) NULL)
08429 return(MagickFalse);
08430 ReplaceImageInList(&wand->images,rotate_image);
08431 return(MagickTrue);
08432 }
08433
08434
08435
08436
08437
08438
08439
08440
08441
08442
08443
08444
08445
08446
08447
08448
08449
08450
08451
08452
08453
08454
08455
08456
08457
08458
08459
08460
08461
08462
08463
08464 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
08465 const unsigned long columns,const unsigned long rows)
08466 {
08467 Image
08468 *sample_image;
08469
08470 assert(wand != (MagickWand *) NULL);
08471 assert(wand->signature == WandSignature);
08472 if (wand->debug != MagickFalse)
08473 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08474 if (wand->images == (Image *) NULL)
08475 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08476 sample_image=SampleImage(wand->images,columns,rows,wand->exception);
08477 if (sample_image == (Image *) NULL)
08478 return(MagickFalse);
08479 ReplaceImageInList(&wand->images,sample_image);
08480 return(MagickTrue);
08481 }
08482
08483
08484
08485
08486
08487
08488
08489
08490
08491
08492
08493
08494
08495
08496
08497
08498
08499
08500
08501
08502
08503
08504
08505
08506
08507
08508
08509
08510
08511 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
08512 const unsigned long columns,const unsigned long rows)
08513 {
08514 Image
08515 *scale_image;
08516
08517 assert(wand != (MagickWand *) NULL);
08518 assert(wand->signature == WandSignature);
08519 if (wand->debug != MagickFalse)
08520 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08521 if (wand->images == (Image *) NULL)
08522 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08523 scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
08524 if (scale_image == (Image *) NULL)
08525 return(MagickFalse);
08526 ReplaceImageInList(&wand->images,scale_image);
08527 return(MagickTrue);
08528 }
08529
08530
08531
08532
08533
08534
08535
08536
08537
08538
08539
08540
08541
08542
08543
08544
08545
08546
08547
08548
08549
08550
08551
08552
08553
08554
08555
08556
08557
08558
08559
08560
08561
08562
08563
08564
08565
08566
08567
08568
08569 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
08570 const ColorspaceType colorspace,const MagickBooleanType verbose,
08571 const double cluster_threshold,const double smooth_threshold)
08572 {
08573 MagickBooleanType
08574 status;
08575
08576 assert(wand != (MagickWand *) NULL);
08577 assert(wand->signature == WandSignature);
08578 if (wand->debug != MagickFalse)
08579 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08580 if (wand->images == (Image *) NULL)
08581 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08582 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
08583 smooth_threshold);
08584 if (status == MagickFalse)
08585 InheritException(wand->exception,&wand->images->exception);
08586 return(status);
08587 }
08588
08589
08590
08591
08592
08593
08594
08595
08596
08597
08598
08599
08600
08601
08602
08603
08604
08605
08606
08607
08608
08609
08610
08611
08612
08613
08614
08615
08616
08617
08618
08619
08620
08621
08622
08623
08624
08625
08626
08627
08628 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
08629 const double radius,const double sigma,const double threshold)
08630 {
08631 MagickBooleanType
08632 status;
08633
08634 status=MagickSelectiveBlurImageChannel(wand,DefaultChannels,radius,sigma,
08635 threshold);
08636 return(status);
08637 }
08638
08639 WandExport MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
08640 const ChannelType channel,const double radius,const double sigma,
08641 const double threshold)
08642 {
08643 Image
08644 *blur_image;
08645
08646 assert(wand != (MagickWand *) NULL);
08647 assert(wand->signature == WandSignature);
08648 if (wand->debug != MagickFalse)
08649 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08650 if (wand->images == (Image *) NULL)
08651 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08652 blur_image=SelectiveBlurImageChannel(wand->images,channel,radius,sigma,
08653 threshold,wand->exception);
08654 if (blur_image == (Image *) NULL)
08655 return(MagickFalse);
08656 ReplaceImageInList(&wand->images,blur_image);
08657 return(MagickTrue);
08658 }
08659
08660
08661
08662
08663
08664
08665
08666
08667
08668
08669
08670
08671
08672
08673
08674
08675
08676
08677
08678
08679
08680
08681
08682
08683
08684
08685
08686
08687 WandExport MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
08688 const ChannelType channel)
08689 {
08690 MagickBooleanType
08691 status;
08692
08693 assert(wand != (MagickWand *) NULL);
08694 assert(wand->signature == WandSignature);
08695 if (wand->debug != MagickFalse)
08696 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08697 if (wand->images == (Image *) NULL)
08698 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08699 status=SeparateImageChannel(wand->images,channel);
08700 if (status == MagickFalse)
08701 InheritException(wand->exception,&wand->images->exception);
08702 return(status);
08703 }
08704
08705
08706
08707
08708
08709
08710
08711
08712
08713
08714
08715
08716
08717
08718
08719
08720
08721
08722
08723
08724
08725
08726
08727
08728
08729
08730
08731
08732
08733 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
08734 const double threshold)
08735 {
08736 Image
08737 *sepia_image;
08738
08739 assert(wand != (MagickWand *) NULL);
08740 assert(wand->signature == WandSignature);
08741 if (wand->debug != MagickFalse)
08742 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08743 if (wand->images == (Image *) NULL)
08744 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08745 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
08746 if (sepia_image == (Image *) NULL)
08747 return(MagickFalse);
08748 ReplaceImageInList(&wand->images,sepia_image);
08749 return(MagickTrue);
08750 }
08751
08752
08753
08754
08755
08756
08757
08758
08759
08760
08761
08762
08763
08764
08765
08766
08767
08768
08769
08770
08771
08772
08773
08774
08775
08776
08777
08778
08779 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
08780 const MagickWand *set_wand)
08781 {
08782 Image
08783 *images;
08784
08785 assert(wand != (MagickWand *) NULL);
08786 assert(wand->signature == WandSignature);
08787 if (wand->debug != MagickFalse)
08788 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08789 assert(set_wand != (MagickWand *) NULL);
08790 assert(set_wand->signature == WandSignature);
08791 if (wand->debug != MagickFalse)
08792 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
08793 if (set_wand->images == (Image *) NULL)
08794 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08795 images=CloneImageList(set_wand->images,wand->exception);
08796 if (images == (Image *) NULL)
08797 return(MagickFalse);
08798 ReplaceImageInList(&wand->images,images);
08799 return(MagickTrue);
08800 }
08801
08802
08803
08804
08805
08806
08807
08808
08809
08810
08811
08812
08813
08814
08815
08816
08817
08818
08819
08820
08821
08822
08823
08824
08825
08826
08827
08828
08829 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
08830 const AlphaChannelType alpha_type)
08831 {
08832 assert(wand != (MagickWand *) NULL);
08833 assert(wand->signature == WandSignature);
08834 if (wand->debug != MagickFalse)
08835 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08836 if (wand->images == (Image *) NULL)
08837 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08838 return(SetImageAlphaChannel(wand->images,alpha_type));
08839 }
08840
08841
08842
08843
08844
08845
08846
08847
08848
08849
08850
08851
08852
08853
08854
08855
08856
08857
08858
08859
08860
08861
08862
08863
08864
08865
08866 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
08867 const PixelWand *background)
08868 {
08869 assert(wand != (MagickWand *) NULL);
08870 assert(wand->signature == WandSignature);
08871 if (wand->debug != MagickFalse)
08872 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08873 if (wand->images == (Image *) NULL)
08874 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08875 PixelGetQuantumColor(background,&wand->images->background_color);
08876 return(MagickTrue);
08877 }
08878
08879
08880
08881
08882
08883
08884
08885
08886
08887
08888
08889
08890
08891
08892
08893
08894
08895
08896
08897
08898
08899
08900
08901
08902
08903
08904
08905 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
08906 const double bias)
08907 {
08908 assert(wand != (MagickWand *) NULL);
08909 assert(wand->signature == WandSignature);
08910 if (wand->debug != MagickFalse)
08911 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08912 if (wand->images == (Image *) NULL)
08913 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08914 wand->images->bias=bias;
08915 return(MagickTrue);
08916 }
08917
08918
08919
08920
08921
08922
08923
08924
08925
08926
08927
08928
08929
08930
08931
08932
08933
08934
08935
08936
08937
08938
08939
08940
08941
08942
08943
08944
08945 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
08946 const double x,const double y)
08947 {
08948 assert(wand != (MagickWand *) NULL);
08949 assert(wand->signature == WandSignature);
08950 if (wand->debug != MagickFalse)
08951 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08952 if (wand->images == (Image *) NULL)
08953 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08954 wand->images->chromaticity.blue_primary.x=x;
08955 wand->images->chromaticity.blue_primary.y=y;
08956 return(MagickTrue);
08957 }
08958
08959
08960
08961
08962
08963
08964
08965
08966
08967
08968
08969
08970
08971
08972
08973
08974
08975
08976
08977
08978
08979
08980
08981
08982
08983
08984 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
08985 const PixelWand *border)
08986 {
08987 assert(wand != (MagickWand *) NULL);
08988 assert(wand->signature == WandSignature);
08989 if (wand->debug != MagickFalse)
08990 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08991 if (wand->images == (Image *) NULL)
08992 ThrowWandException(WandError,"ContainsNoImages",wand->name);
08993 PixelGetQuantumColor(border,&wand->images->border_color);
08994 return(MagickTrue);
08995 }
08996
08997
08998
08999
09000
09001
09002
09003
09004
09005
09006
09007
09008
09009
09010
09011
09012
09013
09014
09015
09016
09017
09018
09019
09020
09021
09022
09023
09024 WandExport MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
09025 const ChannelType channel,const unsigned long depth)
09026 {
09027 assert(wand != (MagickWand *) NULL);
09028 assert(wand->signature == WandSignature);
09029 if (wand->debug != MagickFalse)
09030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09031 if (wand->images == (Image *) NULL)
09032 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09033 return(SetImageChannelDepth(wand->images,channel,depth));
09034 }
09035
09036
09037
09038
09039
09040
09041
09042
09043
09044
09045
09046
09047
09048
09049
09050
09051
09052
09053
09054
09055
09056
09057
09058
09059
09060
09061 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
09062 const MagickWand *clip_mask)
09063 {
09064 assert(wand != (MagickWand *) NULL);
09065 assert(wand->signature == WandSignature);
09066 if (wand->debug != MagickFalse)
09067 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09068 assert(clip_mask != (MagickWand *) NULL);
09069 assert(clip_mask->signature == WandSignature);
09070 if (wand->debug != MagickFalse)
09071 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
09072 if (clip_mask->images == (Image *) NULL)
09073 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09074 return(SetImageClipMask(wand->images,clip_mask->images));
09075 }
09076
09077
09078
09079
09080
09081
09082
09083
09084
09085
09086
09087
09088
09089
09090
09091
09092
09093
09094
09095
09096
09097
09098
09099
09100
09101
09102
09103
09104
09105 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
09106 const unsigned long index,const PixelWand *color)
09107 {
09108 assert(wand != (MagickWand *) NULL);
09109 assert(wand->signature == WandSignature);
09110 if (wand->debug != MagickFalse)
09111 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09112 if (wand->images == (Image *) NULL)
09113 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09114 if ((wand->images->colormap == (PixelPacket *) NULL) ||
09115 (index >= wand->images->colors))
09116 ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
09117 PixelGetQuantumColor(color,wand->images->colormap+index);
09118 return(SyncImage(wand->images));
09119 }
09120
09121
09122
09123
09124
09125
09126
09127
09128
09129
09130
09131
09132
09133
09134
09135
09136
09137
09138
09139
09140
09141
09142
09143
09144
09145
09146
09147
09148
09149
09150 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
09151 const ColorspaceType colorspace)
09152 {
09153 assert(wand != (MagickWand *) NULL);
09154 assert(wand->signature == WandSignature);
09155 if (wand->debug != MagickFalse)
09156 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09157 if (wand->images == (Image *) NULL)
09158 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09159 return(SetImageColorspace(wand->images,colorspace));
09160 }
09161
09162
09163
09164
09165
09166
09167
09168
09169
09170
09171
09172
09173
09174
09175
09176
09177
09178
09179
09180
09181
09182
09183
09184
09185
09186
09187
09188
09189 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
09190 const CompositeOperator compose)
09191 {
09192 assert(wand != (MagickWand *) NULL);
09193 assert(wand->signature == WandSignature);
09194 if (wand->debug != MagickFalse)
09195 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09196 if (wand->images == (Image *) NULL)
09197 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09198 wand->images->compose=compose;
09199 return(MagickTrue);
09200 }
09201
09202
09203
09204
09205
09206
09207
09208
09209
09210
09211
09212
09213
09214
09215
09216
09217
09218
09219
09220
09221
09222
09223
09224
09225
09226
09227 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
09228 const CompressionType compression)
09229 {
09230 assert(wand != (MagickWand *) NULL);
09231 assert(wand->signature == WandSignature);
09232 if (wand->debug != MagickFalse)
09233 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09234 if (wand->images == (Image *) NULL)
09235 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09236 wand->images->compression=compression;
09237 return(MagickTrue);
09238 }
09239
09240
09241
09242
09243
09244
09245
09246
09247
09248
09249
09250
09251
09252
09253
09254
09255
09256
09257
09258
09259
09260
09261
09262
09263
09264
09265 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
09266 const unsigned long quality)
09267 {
09268 assert(wand != (MagickWand *) NULL);
09269 assert(wand->signature == WandSignature);
09270 if (wand->debug != MagickFalse)
09271 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09272 if (wand->images == (Image *) NULL)
09273 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09274 wand->images->quality=quality;
09275 return(MagickTrue);
09276 }
09277
09278
09279
09280
09281
09282
09283
09284
09285
09286
09287
09288
09289
09290
09291
09292
09293
09294
09295
09296
09297
09298
09299
09300
09301
09302
09303 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
09304 const unsigned long delay)
09305 {
09306 assert(wand != (MagickWand *) NULL);
09307 assert(wand->signature == WandSignature);
09308 if (wand->debug != MagickFalse)
09309 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09310 if (wand->images == (Image *) NULL)
09311 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09312 wand->images->delay=delay;
09313 return(MagickTrue);
09314 }
09315
09316
09317
09318
09319
09320
09321
09322
09323
09324
09325
09326
09327
09328
09329
09330
09331
09332
09333
09334
09335
09336
09337
09338
09339
09340
09341 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
09342 const unsigned long depth)
09343 {
09344 assert(wand != (MagickWand *) NULL);
09345 assert(wand->signature == WandSignature);
09346 if (wand->debug != MagickFalse)
09347 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09348 if (wand->images == (Image *) NULL)
09349 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09350 wand->images->depth=depth;
09351 return(MagickTrue);
09352 }
09353
09354
09355
09356
09357
09358
09359
09360
09361
09362
09363
09364
09365
09366
09367
09368
09369
09370
09371
09372
09373
09374
09375
09376
09377
09378
09379 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
09380 const DisposeType dispose)
09381 {
09382 assert(wand != (MagickWand *) NULL);
09383 assert(wand->signature == WandSignature);
09384 if (wand->debug != MagickFalse)
09385 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09386 if (wand->images == (Image *) NULL)
09387 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09388 wand->images->dispose=dispose;
09389 return(MagickTrue);
09390 }
09391
09392
09393
09394
09395
09396
09397
09398
09399
09400
09401
09402
09403
09404
09405
09406
09407
09408
09409
09410
09411
09412
09413
09414
09415
09416
09417
09418
09419 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
09420 const unsigned long columns,const unsigned long rows)
09421 {
09422 assert(wand != (MagickWand *) NULL);
09423 assert(wand->signature == WandSignature);
09424 if (wand->debug != MagickFalse)
09425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09426 if (wand->images == (Image *) NULL)
09427 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09428 return(SetImageExtent(wand->images,columns,rows));
09429 }
09430
09431
09432
09433
09434
09435
09436
09437
09438
09439
09440
09441
09442
09443
09444
09445
09446
09447
09448
09449
09450
09451
09452
09453
09454
09455
09456
09457 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
09458 const char *filename)
09459 {
09460 assert(wand != (MagickWand *) NULL);
09461 assert(wand->signature == WandSignature);
09462 if (wand->debug != MagickFalse)
09463 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09464 if (wand->images == (Image *) NULL)
09465 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09466 if (filename != (const char *) NULL)
09467 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
09468 return(MagickTrue);
09469 }
09470
09471
09472
09473
09474
09475
09476
09477
09478
09479
09480
09481
09482
09483
09484
09485
09486
09487
09488
09489
09490
09491
09492
09493
09494
09495
09496
09497 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
09498 const char *format)
09499 {
09500 const MagickInfo
09501 *magick_info;
09502
09503 assert(wand != (MagickWand *) NULL);
09504 assert(wand->signature == WandSignature);
09505 if (wand->debug != MagickFalse)
09506 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09507 if (wand->images == (Image *) NULL)
09508 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09509 if ((format == (char *) NULL) || (*format == '\0'))
09510 {
09511 *wand->images->magick='\0';
09512 return(MagickTrue);
09513 }
09514 magick_info=GetMagickInfo(format,wand->exception);
09515 if (magick_info == (const MagickInfo *) NULL)
09516 return(MagickFalse);
09517 ClearMagickException(wand->exception);
09518 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
09519 return(MagickTrue);
09520 }
09521
09522
09523
09524
09525
09526
09527
09528
09529
09530
09531
09532
09533
09534
09535
09536
09537
09538
09539
09540
09541
09542
09543
09544
09545
09546
09547 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
09548 const double fuzz)
09549 {
09550 assert(wand != (MagickWand *) NULL);
09551 assert(wand->signature == WandSignature);
09552 if (wand->debug != MagickFalse)
09553 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09554 if (wand->images == (Image *) NULL)
09555 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09556 wand->images->fuzz=fuzz;
09557 return(MagickTrue);
09558 }
09559
09560
09561
09562
09563
09564
09565
09566
09567
09568
09569
09570
09571
09572
09573
09574
09575
09576
09577
09578
09579
09580
09581
09582
09583
09584
09585 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
09586 const double gamma)
09587 {
09588 assert(wand != (MagickWand *) NULL);
09589 assert(wand->signature == WandSignature);
09590 if (wand->debug != MagickFalse)
09591 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09592 if (wand->images == (Image *) NULL)
09593 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09594 wand->images->gamma=gamma;
09595 return(MagickTrue);
09596 }
09597
09598
09599
09600
09601
09602
09603
09604
09605
09606
09607
09608
09609
09610
09611
09612
09613
09614
09615
09616
09617
09618
09619
09620
09621
09622
09623
09624 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
09625 const GravityType gravity)
09626 {
09627 assert(wand != (MagickWand *) NULL);
09628 assert(wand->signature == WandSignature);
09629 if (wand->debug != MagickFalse)
09630 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09631 if (wand->images == (Image *) NULL)
09632 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09633 wand->images->gravity=gravity;
09634 return(MagickTrue);
09635 }
09636
09637
09638
09639
09640
09641
09642
09643
09644
09645
09646
09647
09648
09649
09650
09651
09652
09653
09654
09655
09656
09657
09658
09659
09660
09661
09662
09663
09664
09665
09666 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
09667 const double x,const double y)
09668 {
09669 assert(wand != (MagickWand *) NULL);
09670 assert(wand->signature == WandSignature);
09671 if (wand->debug != MagickFalse)
09672 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09673 if (wand->images == (Image *) NULL)
09674 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09675 wand->images->chromaticity.green_primary.x=x;
09676 wand->images->chromaticity.green_primary.y=y;
09677 return(MagickTrue);
09678 }
09679
09680
09681
09682
09683
09684
09685
09686
09687
09688
09689
09690
09691
09692
09693
09694
09695
09696
09697
09698
09699
09700
09701
09702
09703
09704
09705
09706 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
09707 const InterlaceType interlace)
09708 {
09709 assert(wand != (MagickWand *) NULL);
09710 assert(wand->signature == WandSignature);
09711 if (wand->debug != MagickFalse)
09712 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09713 if (wand->images == (Image *) NULL)
09714 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09715 wand->images->interlace=interlace;
09716 return(MagickTrue);
09717 }
09718
09719
09720
09721
09722
09723
09724
09725
09726
09727
09728
09729
09730
09731
09732
09733
09734
09735
09736
09737
09738
09739
09740
09741
09742
09743
09744
09745 WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
09746 const InterpolatePixelMethod method)
09747 {
09748 assert(wand != (MagickWand *) NULL);
09749 assert(wand->signature == WandSignature);
09750 if (wand->debug != MagickFalse)
09751 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09752 if (wand->images == (Image *) NULL)
09753 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09754 wand->images->interpolate=method;
09755 return(MagickTrue);
09756 }
09757
09758
09759
09760
09761
09762
09763
09764
09765
09766
09767
09768
09769
09770
09771
09772
09773
09774
09775
09776
09777
09778
09779
09780
09781
09782
09783 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
09784 const unsigned long iterations)
09785 {
09786 assert(wand != (MagickWand *) NULL);
09787 assert(wand->signature == WandSignature);
09788 if (wand->debug != MagickFalse)
09789 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09790 if (wand->images == (Image *) NULL)
09791 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09792 wand->images->iterations=iterations;
09793 return(MagickTrue);
09794 }
09795
09796
09797
09798
09799
09800
09801
09802
09803
09804
09805
09806
09807
09808
09809
09810
09811
09812
09813
09814
09815
09816
09817
09818
09819
09820
09821
09822 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
09823 const MagickBooleanType matte)
09824 {
09825 assert(wand != (MagickWand *) NULL);
09826 assert(wand->signature == WandSignature);
09827 if (wand->debug != MagickFalse)
09828 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09829 if (wand->images == (Image *) NULL)
09830 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09831 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
09832 (void) SetImageOpacity(wand->images,OpaqueOpacity);
09833 wand->images->matte=matte;
09834 return(MagickTrue);
09835 }
09836
09837
09838
09839
09840
09841
09842
09843
09844
09845
09846
09847
09848
09849
09850
09851
09852
09853
09854
09855
09856
09857
09858
09859
09860
09861
09862 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
09863 const PixelWand *matte)
09864 {
09865 assert(wand != (MagickWand *) NULL);
09866 assert(wand->signature == WandSignature);
09867 if (wand->debug != MagickFalse)
09868 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09869 if (wand->images == (Image *) NULL)
09870 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09871 PixelGetQuantumColor(matte,&wand->images->matte_color);
09872 return(MagickTrue);
09873 }
09874
09875
09876
09877
09878
09879
09880
09881
09882
09883
09884
09885
09886
09887
09888
09889
09890
09891
09892
09893
09894
09895
09896
09897
09898
09899
09900
09901 WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
09902 const double alpha)
09903 {
09904 MagickBooleanType
09905 status;
09906
09907 assert(wand != (MagickWand *) NULL);
09908 assert(wand->signature == WandSignature);
09909 if (wand->debug != MagickFalse)
09910 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09911 if (wand->images == (Image *) NULL)
09912 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09913 status=SetImageOpacity(wand->images,RoundToQuantum((MagickRealType)
09914 QuantumRange-QuantumRange*alpha));
09915 if (status == MagickFalse)
09916 InheritException(wand->exception,&wand->images->exception);
09917 return(status);
09918 }
09919
09920
09921
09922
09923
09924
09925
09926
09927
09928
09929
09930
09931
09932
09933
09934
09935
09936
09937
09938
09939
09940
09941
09942
09943
09944
09945 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
09946 const OrientationType orientation)
09947 {
09948 assert(wand != (MagickWand *) NULL);
09949 assert(wand->signature == WandSignature);
09950 if (wand->debug != MagickFalse)
09951 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09952 if (wand->images == (Image *) NULL)
09953 ThrowWandException(WandError,"ContainsNoImages",wand->name);
09954 wand->images->orientation=orientation;
09955 return(MagickTrue);
09956 }
09957
09958
09959
09960
09961
09962
09963
09964
09965
09966
09967
09968
09969
09970
09971
09972
09973
09974
09975
09976
09977
09978
09979
09980
09981
09982
09983
09984
09985
09986
09987
09988
09989
09990 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
09991 const unsigned long width,const unsigned long height,const long x,
09992 const long y)
09993 {
09994 assert(wand != (MagickWand *) NULL);
09995 assert(wand->signature == WandSignature);
09996 if (wand->debug != MagickFalse)
09997 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09998 if (wand->images == (Image *) NULL)
09999 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10000 wand->images->page.width=width;
10001 wand->images->page.height=height;
10002 wand->images->page.x=x;
10003 wand->images->page.y=y;
10004 return(MagickTrue);
10005 }
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
10045 const MagickProgressMonitor progress_monitor,void *client_data)
10046 {
10047 MagickProgressMonitor
10048 previous_monitor;
10049
10050 assert(wand != (MagickWand *) NULL);
10051 assert(wand->signature == WandSignature);
10052 if (wand->debug != MagickFalse)
10053 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10054 if (wand->images == (Image *) NULL)
10055 {
10056 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10057 "ContainsNoImages","`%s'",wand->name);
10058 return((MagickProgressMonitor) NULL);
10059 }
10060 previous_monitor=SetImageProgressMonitor(wand->images,
10061 progress_monitor,client_data);
10062 return(previous_monitor);
10063 }
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10093 const double x,const double y)
10094 {
10095 assert(wand != (MagickWand *) NULL);
10096 assert(wand->signature == WandSignature);
10097 if (wand->debug != MagickFalse)
10098 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10099 if (wand->images == (Image *) NULL)
10100 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10101 wand->images->chromaticity.red_primary.x=x;
10102 wand->images->chromaticity.red_primary.y=y;
10103 return(MagickTrue);
10104 }
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10133 const RenderingIntent rendering_intent)
10134 {
10135 assert(wand != (MagickWand *) NULL);
10136 assert(wand->signature == WandSignature);
10137 if (wand->debug != MagickFalse)
10138 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10139 if (wand->images == (Image *) NULL)
10140 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10141 wand->images->rendering_intent=rendering_intent;
10142 return(MagickTrue);
10143 }
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10173 const double x_resolution,const double y_resolution)
10174 {
10175 assert(wand != (MagickWand *) NULL);
10176 assert(wand->signature == WandSignature);
10177 if (wand->debug != MagickFalse)
10178 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10179 if (wand->images == (Image *) NULL)
10180 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10181 wand->images->x_resolution=x_resolution;
10182 wand->images->y_resolution=y_resolution;
10183 return(MagickTrue);
10184 }
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
10212 const unsigned long scene)
10213 {
10214 assert(wand != (MagickWand *) NULL);
10215 assert(wand->signature == WandSignature);
10216 if (wand->debug != MagickFalse)
10217 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10218 if (wand->images == (Image *) NULL)
10219 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10220 wand->images->scene=scene;
10221 return(MagickTrue);
10222 }
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10250 const long ticks_per_second)
10251 {
10252 assert(wand != (MagickWand *) NULL);
10253 assert(wand->signature == WandSignature);
10254 if (wand->debug != MagickFalse)
10255 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10256 if (wand->images == (Image *) NULL)
10257 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10258 wand->images->ticks_per_second=ticks_per_second;
10259 return(MagickTrue);
10260 }
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10291 const ImageType image_type)
10292 {
10293 assert(wand != (MagickWand *) NULL);
10294 assert(wand->signature == WandSignature);
10295 if (wand->debug != MagickFalse)
10296 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10297 if (wand->images == (Image *) NULL)
10298 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10299 return(SetImageType(wand->images,image_type));
10300 }
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10329 const ResolutionType units)
10330 {
10331 assert(wand != (MagickWand *) NULL);
10332 assert(wand->signature == WandSignature);
10333 if (wand->debug != MagickFalse)
10334 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10335 if (wand->images == (Image *) NULL)
10336 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10337 wand->images->units=units;
10338 return(MagickTrue);
10339 }
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10369 const VirtualPixelMethod method)
10370 {
10371 assert(wand != (MagickWand *) NULL);
10372 assert(wand->signature == WandSignature);
10373 if (wand->debug != MagickFalse)
10374 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10375 if (wand->images == (Image *) NULL)
10376 return(UndefinedVirtualPixelMethod);
10377 return(SetImageVirtualPixelMethod(wand->images,method));
10378 }
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10408 const double x,const double y)
10409 {
10410 assert(wand != (MagickWand *) NULL);
10411 assert(wand->signature == WandSignature);
10412 if (wand->debug != MagickFalse)
10413 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10414 if (wand->images == (Image *) NULL)
10415 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10416 wand->images->chromaticity.white_point.x=x;
10417 wand->images->chromaticity.white_point.y=y;
10418 return(MagickTrue);
10419 }
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10453 const MagickBooleanType gray,const double asimuth,const double elevation)
10454 {
10455 Image
10456 *shade_image;
10457
10458 assert(wand != (MagickWand *) NULL);
10459 assert(wand->signature == WandSignature);
10460 if (wand->debug != MagickFalse)
10461 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10462 if (wand->images == (Image *) NULL)
10463 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10464 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10465 if (shade_image == (Image *) NULL)
10466 return(MagickFalse);
10467 ReplaceImageInList(&wand->images,shade_image);
10468 return(MagickTrue);
10469 }
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10503 const double opacity,const double sigma,const long x,const long y)
10504 {
10505 Image
10506 *shadow_image;
10507
10508 assert(wand != (MagickWand *) NULL);
10509 assert(wand->signature == WandSignature);
10510 if (wand->debug != MagickFalse)
10511 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10512 if (wand->images == (Image *) NULL)
10513 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10514 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
10515 if (shadow_image == (Image *) NULL)
10516 return(MagickFalse);
10517 ReplaceImageInList(&wand->images,shadow_image);
10518 return(MagickTrue);
10519 }
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10558 const double radius,const double sigma)
10559 {
10560 MagickBooleanType
10561 status;
10562
10563 status=MagickSharpenImageChannel(wand,DefaultChannels,radius,sigma);
10564 return(status);
10565 }
10566
10567 WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
10568 const ChannelType channel,const double radius,const double sigma)
10569 {
10570 Image
10571 *sharp_image;
10572
10573 assert(wand != (MagickWand *) NULL);
10574 assert(wand->signature == WandSignature);
10575 if (wand->debug != MagickFalse)
10576 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10577 if (wand->images == (Image *) NULL)
10578 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10579 sharp_image=SharpenImageChannel(wand->images,channel,radius,sigma,
10580 wand->exception);
10581 if (sharp_image == (Image *) NULL)
10582 return(MagickFalse);
10583 ReplaceImageInList(&wand->images,sharp_image);
10584 return(MagickTrue);
10585 }
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10618 const unsigned long columns,const unsigned long rows)
10619 {
10620 Image
10621 *shave_image;
10622
10623 RectangleInfo
10624 shave_info;
10625
10626 assert(wand != (MagickWand *) NULL);
10627 assert(wand->signature == WandSignature);
10628 if (wand->debug != MagickFalse)
10629 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10630 if (wand->images == (Image *) NULL)
10631 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10632 shave_info.width=columns;
10633 shave_info.height=rows;
10634 shave_info.x=0;
10635 shave_info.y=0;
10636 shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10637 if (shave_image == (Image *) NULL)
10638 return(MagickFalse);
10639 ReplaceImageInList(&wand->images,shave_image);
10640 return(MagickTrue);
10641 }
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10679 const PixelWand *background,const double x_shear,const double y_shear)
10680 {
10681 Image
10682 *shear_image;
10683
10684 assert(wand != (MagickWand *) NULL);
10685 assert(wand->signature == WandSignature);
10686 if (wand->debug != MagickFalse)
10687 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10688 if (wand->images == (Image *) NULL)
10689 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10690 PixelGetQuantumColor(background,&wand->images->background_color);
10691 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10692 if (shear_image == (Image *) NULL)
10693 return(MagickFalse);
10694 ReplaceImageInList(&wand->images,shear_image);
10695 return(MagickTrue);
10696 }
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740 WandExport MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10741 const MagickBooleanType sharpen,const double alpha,const double beta)
10742 {
10743 MagickBooleanType
10744 status;
10745
10746 status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen,
10747 alpha,beta);
10748 return(status);
10749 }
10750
10751 WandExport MagickBooleanType MagickSigmoidalContrastImageChannel(
10752 MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen,
10753 const double alpha,const double beta)
10754 {
10755 MagickBooleanType
10756 status;
10757
10758 assert(wand != (MagickWand *) NULL);
10759 assert(wand->signature == WandSignature);
10760 if (wand->debug != MagickFalse)
10761 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10762 if (wand->images == (Image *) NULL)
10763 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10764 status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta);
10765 if (status == MagickFalse)
10766 InheritException(wand->exception,&wand->images->exception);
10767 return(status);
10768 }
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10803 const MagickWand *reference,RectangleInfo *offset,double *similarity)
10804 {
10805 Image
10806 *similarity_image;
10807
10808 assert(wand != (MagickWand *) NULL);
10809 assert(wand->signature == WandSignature);
10810 if (wand->debug != MagickFalse)
10811 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10812 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10813 {
10814 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10815 "ContainsNoImages","`%s'",wand->name);
10816 return((MagickWand *) NULL);
10817 }
10818 similarity_image=SimilarityImage(wand->images,reference->images,offset,
10819 similarity,&wand->images->exception);
10820 if (similarity_image == (Image *) NULL)
10821 return((MagickWand *) NULL);
10822 return(CloneMagickWandFromImages(wand,similarity_image));
10823 }
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10860 const double radius,const double sigma,const double angle)
10861 {
10862 Image
10863 *sketch_image;
10864
10865 assert(wand != (MagickWand *) NULL);
10866 assert(wand->signature == WandSignature);
10867 if (wand->debug != MagickFalse)
10868 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10869 if (wand->images == (Image *) NULL)
10870 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10871 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
10872 if (sketch_image == (Image *) NULL)
10873 return(MagickFalse);
10874 ReplaceImageInList(&wand->images,sketch_image);
10875 return(MagickTrue);
10876 }
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10907 const double threshold)
10908 {
10909 MagickBooleanType
10910 status;
10911
10912 assert(wand != (MagickWand *) NULL);
10913 assert(wand->signature == WandSignature);
10914 if (wand->debug != MagickFalse)
10915 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10916 if (wand->images == (Image *) NULL)
10917 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10918 status=SolarizeImage(wand->images,threshold);
10919 if (status == MagickFalse)
10920 InheritException(wand->exception,&wand->images->exception);
10921 return(status);
10922 }
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10976 const ChannelType channel,const SparseColorMethod method,
10977 const unsigned long number_arguments,const double *arguments)
10978 {
10979 Image
10980 *sparse_image;
10981
10982 assert(wand != (MagickWand *) NULL);
10983 assert(wand->signature == WandSignature);
10984 if (wand->debug != MagickFalse)
10985 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10986 if (wand->images == (Image *) NULL)
10987 ThrowWandException(WandError,"ContainsNoImages",wand->name);
10988 sparse_image=SparseColorImage(wand->images,channel,method,number_arguments,
10989 arguments,wand->exception);
10990 if (sparse_image == (Image *) NULL)
10991 return(MagickFalse);
10992 ReplaceImageInList(&wand->images,sparse_image);
10993 return(MagickTrue);
10994 }
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
11029 const unsigned long width,const unsigned long height,const long x,
11030 const long y)
11031 {
11032 Image
11033 *splice_image;
11034
11035 RectangleInfo
11036 splice;
11037
11038 assert(wand != (MagickWand *) NULL);
11039 assert(wand->signature == WandSignature);
11040 if (wand->debug != MagickFalse)
11041 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11042 if (wand->images == (Image *) NULL)
11043 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11044 splice.width=width;
11045 splice.height=height;
11046 splice.x=x;
11047 splice.y=y;
11048 splice_image=SpliceImage(wand->images,&splice,wand->exception);
11049 if (splice_image == (Image *) NULL)
11050 return(MagickFalse);
11051 ReplaceImageInList(&wand->images,splice_image);
11052 return(MagickTrue);
11053 }
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
11081 const double radius)
11082 {
11083 Image
11084 *spread_image;
11085
11086 assert(wand != (MagickWand *) NULL);
11087 assert(wand->signature == WandSignature);
11088 if (wand->debug != MagickFalse)
11089 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11090 if (wand->images == (Image *) NULL)
11091 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11092 spread_image=SpreadImage(wand->images,radius,wand->exception);
11093 if (spread_image == (Image *) NULL)
11094 return(MagickFalse);
11095 ReplaceImageInList(&wand->images,spread_image);
11096 return(MagickTrue);
11097 }
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
11130 const MagickWand *watermark_wand,const long offset)
11131 {
11132 Image
11133 *stegano_image;
11134
11135 assert(wand != (MagickWand *) NULL);
11136 assert(wand->signature == WandSignature);
11137 if (wand->debug != MagickFalse)
11138 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11139 if ((wand->images == (Image *) NULL) ||
11140 (watermark_wand->images == (Image *) NULL))
11141 {
11142 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11143 "ContainsNoImages","`%s'",wand->name);
11144 return((MagickWand *) NULL);
11145 }
11146 wand->images->offset=offset;
11147 stegano_image=SteganoImage(wand->images,watermark_wand->images,
11148 wand->exception);
11149 if (stegano_image == (Image *) NULL)
11150 return((MagickWand *) NULL);
11151 return(CloneMagickWandFromImages(wand,stegano_image));
11152 }
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11181 const MagickWand *offset_wand)
11182 {
11183 Image
11184 *stereo_image;
11185
11186 assert(wand != (MagickWand *) NULL);
11187 assert(wand->signature == WandSignature);
11188 if (wand->debug != MagickFalse)
11189 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11190 if ((wand->images == (Image *) NULL) ||
11191 (offset_wand->images == (Image *) NULL))
11192 {
11193 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11194 "ContainsNoImages","`%s'",wand->name);
11195 return((MagickWand *) NULL);
11196 }
11197 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11198 if (stereo_image == (Image *) NULL)
11199 return((MagickWand *) NULL);
11200 return(CloneMagickWandFromImages(wand,stereo_image));
11201 }
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11226 {
11227 MagickBooleanType
11228 status;
11229
11230 assert(wand != (MagickWand *) NULL);
11231 assert(wand->signature == WandSignature);
11232 if (wand->debug != MagickFalse)
11233 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11234 if (wand->images == (Image *) NULL)
11235 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11236 status=StripImage(wand->images);
11237 if (status == MagickFalse)
11238 InheritException(wand->exception,&wand->images->exception);
11239 return(status);
11240 }
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11269 const double degrees)
11270 {
11271 Image
11272 *swirl_image;
11273
11274 assert(wand != (MagickWand *) NULL);
11275 assert(wand->signature == WandSignature);
11276 if (wand->debug != MagickFalse)
11277 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11278 if (wand->images == (Image *) NULL)
11279 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11280 swirl_image=SwirlImage(wand->images,degrees,wand->exception);
11281 if (swirl_image == (Image *) NULL)
11282 return(MagickFalse);
11283 ReplaceImageInList(&wand->images,swirl_image);
11284 return(MagickTrue);
11285 }
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11314 const MagickWand *texture_wand)
11315 {
11316 Image
11317 *texture_image;
11318
11319 MagickBooleanType
11320 status;
11321
11322 assert(wand != (MagickWand *) NULL);
11323 assert(wand->signature == WandSignature);
11324 if (wand->debug != MagickFalse)
11325 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11326 if ((wand->images == (Image *) NULL) ||
11327 (texture_wand->images == (Image *) NULL))
11328 {
11329 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11330 "ContainsNoImages","`%s'",wand->name);
11331 return((MagickWand *) NULL);
11332 }
11333 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11334 if (texture_image == (Image *) NULL)
11335 return((MagickWand *) NULL);
11336 status=TextureImage(texture_image,texture_wand->images);
11337 if (status == MagickFalse)
11338 {
11339 InheritException(wand->exception,&texture_image->exception);
11340 texture_image=DestroyImage(texture_image);
11341 return((MagickWand *) NULL);
11342 }
11343 return(CloneMagickWandFromImages(wand,texture_image));
11344 }
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11378 const double threshold)
11379 {
11380 MagickBooleanType
11381 status;
11382
11383 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11384 return(status);
11385 }
11386
11387 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11388 const ChannelType channel,const double threshold)
11389 {
11390 MagickBooleanType
11391 status;
11392
11393 assert(wand != (MagickWand *) NULL);
11394 assert(wand->signature == WandSignature);
11395 if (wand->debug != MagickFalse)
11396 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11397 if (wand->images == (Image *) NULL)
11398 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11399 status=BilevelImageChannel(wand->images,channel,threshold);
11400 if (status == MagickFalse)
11401 InheritException(wand->exception,&wand->images->exception);
11402 return(status);
11403 }
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11435 const unsigned long columns,const unsigned long rows)
11436 {
11437 Image
11438 *thumbnail_image;
11439
11440 assert(wand != (MagickWand *) NULL);
11441 assert(wand->signature == WandSignature);
11442 if (wand->debug != MagickFalse)
11443 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11444 if (wand->images == (Image *) NULL)
11445 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11446 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11447 if (thumbnail_image == (Image *) NULL)
11448 return(MagickFalse);
11449 ReplaceImageInList(&wand->images,thumbnail_image);
11450 return(MagickTrue);
11451 }
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11484 const PixelWand *tint,const PixelWand *opacity)
11485 {
11486 char
11487 percent_opaque[MaxTextExtent];
11488
11489 Image
11490 *tint_image;
11491
11492 PixelPacket
11493 target;
11494
11495 assert(wand != (MagickWand *) NULL);
11496 assert(wand->signature == WandSignature);
11497 if (wand->debug != MagickFalse)
11498 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11499 if (wand->images == (Image *) NULL)
11500 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11501 (void) FormatMagickString(percent_opaque,MaxTextExtent,"%g,%g,%g,%g",
11502 (double) (100.0*QuantumScale*PixelGetRedQuantum(opacity)),
11503 (double) (100.0*QuantumScale*PixelGetGreenQuantum(opacity)),
11504 (double) (100.0*QuantumScale*PixelGetBlueQuantum(opacity)),
11505 (double) (100.0*QuantumScale*PixelGetOpacityQuantum(opacity)));
11506 PixelGetQuantumColor(tint,&target);
11507 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
11508 if (tint_image == (Image *) NULL)
11509 return(MagickFalse);
11510 ReplaceImageInList(&wand->images,tint_image);
11511 return(MagickTrue);
11512 }
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11547 const char *crop,const char *geometry)
11548 {
11549 Image
11550 *transform_image;
11551
11552 MagickBooleanType
11553 status;
11554
11555 assert(wand != (MagickWand *) NULL);
11556 assert(wand->signature == WandSignature);
11557 if (wand->debug != MagickFalse)
11558 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11559 if (wand->images == (Image *) NULL)
11560 return((MagickWand *) NULL);
11561 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11562 if (transform_image == (Image *) NULL)
11563 return((MagickWand *) NULL);
11564 status=TransformImage(&transform_image,crop,geometry);
11565 if (status == MagickFalse)
11566 {
11567 InheritException(wand->exception,&transform_image->exception);
11568 transform_image=DestroyImage(transform_image);
11569 return((MagickWand *) NULL);
11570 }
11571 return(CloneMagickWandFromImages(wand,transform_image));
11572 }
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11604 const ColorspaceType colorspace)
11605 {
11606 assert(wand != (MagickWand *) NULL);
11607 assert(wand->signature == WandSignature);
11608 if (wand->debug != MagickFalse)
11609 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11610 if (wand->images == (Image *) NULL)
11611 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11612 return(TransformImageColorspace(wand->images,colorspace));
11613 }
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11656 const PixelWand *target,const double alpha,const double fuzz,
11657 const MagickBooleanType invert)
11658 {
11659 MagickBooleanType
11660 status;
11661
11662 MagickPixelPacket
11663 target_pixel;
11664
11665 assert(wand != (MagickWand *) NULL);
11666 assert(wand->signature == WandSignature);
11667 if (wand->debug != MagickFalse)
11668 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11669 if (wand->images == (Image *) NULL)
11670 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11671 PixelGetMagickColor(target,&target_pixel);
11672 wand->images->fuzz=fuzz;
11673 status=TransparentPaintImage(wand->images,&target_pixel,RoundToQuantum(
11674 (MagickRealType) QuantumRange-QuantumRange*alpha),invert);
11675 if (status == MagickFalse)
11676 InheritException(wand->exception,&wand->images->exception);
11677 return(status);
11678 }
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11704 {
11705 Image
11706 *transpose_image;
11707
11708 assert(wand != (MagickWand *) NULL);
11709 assert(wand->signature == WandSignature);
11710 if (wand->debug != MagickFalse)
11711 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11712 if (wand->images == (Image *) NULL)
11713 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11714 transpose_image=TransposeImage(wand->images,wand->exception);
11715 if (transpose_image == (Image *) NULL)
11716 return(MagickFalse);
11717 ReplaceImageInList(&wand->images,transpose_image);
11718 return(MagickTrue);
11719 }
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11745 {
11746 Image
11747 *transverse_image;
11748
11749 assert(wand != (MagickWand *) NULL);
11750 assert(wand->signature == WandSignature);
11751 if (wand->debug != MagickFalse)
11752 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11753 if (wand->images == (Image *) NULL)
11754 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11755 transverse_image=TransverseImage(wand->images,wand->exception);
11756 if (transverse_image == (Image *) NULL)
11757 return(MagickFalse);
11758 ReplaceImageInList(&wand->images,transverse_image);
11759 return(MagickTrue);
11760 }
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11792 {
11793 Image
11794 *trim_image;
11795
11796 assert(wand != (MagickWand *) NULL);
11797 assert(wand->signature == WandSignature);
11798 if (wand->debug != MagickFalse)
11799 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11800 if (wand->images == (Image *) NULL)
11801 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11802 wand->images->fuzz=fuzz;
11803 trim_image=TrimImage(wand->images,wand->exception);
11804 if (trim_image == (Image *) NULL)
11805 return(MagickFalse);
11806 ReplaceImageInList(&wand->images,trim_image);
11807 return(MagickTrue);
11808 }
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11833 {
11834 Image
11835 *unique_image;
11836
11837 assert(wand != (MagickWand *) NULL);
11838 assert(wand->signature == WandSignature);
11839 if (wand->debug != MagickFalse)
11840 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11841 if (wand->images == (Image *) NULL)
11842 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11843 unique_image=UniqueImageColors(wand->images,wand->exception);
11844 if (unique_image == (Image *) NULL)
11845 return(MagickFalse);
11846 ReplaceImageInList(&wand->images,unique_image);
11847 return(MagickTrue);
11848 }
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11894 const double radius,const double sigma,const double amount,
11895 const double threshold)
11896 {
11897 MagickBooleanType
11898 status;
11899
11900 status=MagickUnsharpMaskImageChannel(wand,DefaultChannels,radius,sigma,
11901 amount,threshold);
11902 return(status);
11903 }
11904
11905 WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
11906 const ChannelType channel,const double radius,const double sigma,
11907 const double amount,const double threshold)
11908 {
11909 Image
11910 *unsharp_image;
11911
11912 assert(wand != (MagickWand *) NULL);
11913 assert(wand->signature == WandSignature);
11914 if (wand->debug != MagickFalse)
11915 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11916 if (wand->images == (Image *) NULL)
11917 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11918 unsharp_image=UnsharpMaskImageChannel(wand->images,channel,radius,sigma,
11919 amount,threshold,wand->exception);
11920 if (unsharp_image == (Image *) NULL)
11921 return(MagickFalse);
11922 ReplaceImageInList(&wand->images,unsharp_image);
11923 return(MagickTrue);
11924 }
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11957 const double black_point,const double white_point,const long x,const long y)
11958 {
11959 Image
11960 *vignette_image;
11961
11962 assert(wand != (MagickWand *) NULL);
11963 assert(wand->signature == WandSignature);
11964 if (wand->debug != MagickFalse)
11965 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11966 if (wand->images == (Image *) NULL)
11967 ThrowWandException(WandError,"ContainsNoImages",wand->name);
11968 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
11969 wand->exception);
11970 if (vignette_image == (Image *) NULL)
11971 return(MagickFalse);
11972 ReplaceImageInList(&wand->images,vignette_image);
11973 return(MagickTrue);
11974 }
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
12005 const double amplitude,const double wave_length)
12006 {
12007 Image
12008 *wave_image;
12009
12010 assert(wand != (MagickWand *) NULL);
12011 assert(wand->signature == WandSignature);
12012 if (wand->debug != MagickFalse)
12013 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12014 if (wand->images == (Image *) NULL)
12015 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12016 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
12017 if (wave_image == (Image *) NULL)
12018 return(MagickFalse);
12019 ReplaceImageInList(&wand->images,wave_image);
12020 return(MagickTrue);
12021 }
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12051 const PixelWand *threshold)
12052 {
12053 char
12054 thresholds[MaxTextExtent];
12055
12056 MagickBooleanType
12057 status;
12058
12059 assert(wand != (MagickWand *) NULL);
12060 assert(wand->signature == WandSignature);
12061 if (wand->debug != MagickFalse)
12062 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12063 if (wand->images == (Image *) NULL)
12064 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12065 (void) FormatMagickString(thresholds,MaxTextExtent,
12066 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
12067 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
12068 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
12069 status=WhiteThresholdImage(wand->images,thresholds);
12070 if (status == MagickFalse)
12071 InheritException(wand->exception,&wand->images->exception);
12072 return(status);
12073 }
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
12104 const char *filename)
12105 {
12106 Image
12107 *image;
12108
12109 ImageInfo
12110 *write_info;
12111
12112 MagickBooleanType
12113 status;
12114
12115 assert(wand != (MagickWand *) NULL);
12116 assert(wand->signature == WandSignature);
12117 if (wand->debug != MagickFalse)
12118 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12119 if (wand->images == (Image *) NULL)
12120 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12121 if (filename != (const char *) NULL)
12122 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
12123 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12124 if (image == (Image *) NULL)
12125 return(MagickFalse);
12126 write_info=CloneImageInfo(wand->image_info);
12127 write_info->adjoin=MagickTrue;
12128 status=WriteImage(write_info,image);
12129 if (status == MagickFalse)
12130 InheritException(wand->exception,&image->exception);
12131 image=DestroyImage(image);
12132 write_info=DestroyImageInfo(write_info);
12133 return(status);
12134 }
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12162 {
12163 Image
12164 *image;
12165
12166 ImageInfo
12167 *write_info;
12168
12169 MagickBooleanType
12170 status;
12171
12172 assert(wand != (MagickWand *) NULL);
12173 assert(wand->signature == WandSignature);
12174 assert(file != (FILE *) NULL);
12175 if (wand->debug != MagickFalse)
12176 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12177 if (wand->images == (Image *) NULL)
12178 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12179 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12180 if (image == (Image *) NULL)
12181 return(MagickFalse);
12182 write_info=CloneImageInfo(wand->image_info);
12183 SetImageInfoFile(write_info,file);
12184 write_info->adjoin=MagickTrue;
12185 status=WriteImage(write_info,image);
12186 write_info=DestroyImageInfo(write_info);
12187 if (status == MagickFalse)
12188 InheritException(wand->exception,&image->exception);
12189 image=DestroyImage(image);
12190 return(status);
12191 }
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12221 const char *filename,const MagickBooleanType adjoin)
12222 {
12223 ImageInfo
12224 *write_info;
12225
12226 MagickBooleanType
12227 status;
12228
12229 assert(wand != (MagickWand *) NULL);
12230 assert(wand->signature == WandSignature);
12231 if (wand->debug != MagickFalse)
12232 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12233 if (wand->images == (Image *) NULL)
12234 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12235 write_info=CloneImageInfo(wand->image_info);
12236 write_info->adjoin=adjoin;
12237 status=WriteImages(write_info,wand->images,filename,wand->exception);
12238 if (status == MagickFalse)
12239 InheritException(wand->exception,&wand->images->exception);
12240 write_info=DestroyImageInfo(write_info);
12241 return(status);
12242 }
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12269 {
12270 ImageInfo
12271 *write_info;
12272
12273 MagickBooleanType
12274 status;
12275
12276 assert(wand != (MagickWand *) NULL);
12277 assert(wand->signature == WandSignature);
12278 if (wand->debug != MagickFalse)
12279 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12280 if (wand->images == (Image *) NULL)
12281 ThrowWandException(WandError,"ContainsNoImages",wand->name);
12282 write_info=CloneImageInfo(wand->image_info);
12283 SetImageInfoFile(write_info,file);
12284 write_info->adjoin=MagickTrue;
12285 status=WriteImages(write_info,wand->images,(const char *) NULL,
12286 wand->exception);
12287 write_info=DestroyImageInfo(write_info);
12288 if (status == MagickFalse)
12289 InheritException(wand->exception,&wand->images->exception);
12290 return(status);
12291 }