magick-image.c revision 5e6be1e6a77c230e4a204fa9163d873104730c35
1/* 2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3% % 4% % 5% % 6% M M AAA GGGG IIIII CCCC K K % 7% MM MM A A G I C K K % 8% M M M AAAAA G GGG I C KKK % 9% M M A A G G I C K K % 10% M M A A GGGG IIIII CCCC K K % 11% % 12% IIIII M M AAA GGGG EEEEE % 13% I MM MM A A G E % 14% I M M M AAAAA G GG EEE % 15% I M M A A G G E % 16% IIIII M M A A GGGG EEEEE % 17% % 18% % 19% MagickWand Image Methods % 20% % 21% Software Design % 22% John Cristy % 23% August 2003 % 24% % 25% % 26% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization % 27% dedicated to making software imaging solutions freely available. % 28% % 29% You may not use this file except in compliance with the License. You may % 30% obtain a copy of the License at % 31% % 32% http://www.imagemagick.org/script/license.php % 33% % 34% Unless required by applicable law or agreed to in writing, software % 35% distributed under the License is distributed on an "AS IS" BASIS, % 36% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % 37% See the License for the specific language governing permissions and % 38% limitations under the License. % 39% % 40%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 41% 42% 43% 44*/ 45 46/* 47 Include declarations. 48*/ 49#include "MagickWand/studio.h" 50#include "MagickWand/MagickWand.h" 51#include "MagickWand/magick-wand-private.h" 52#include "MagickWand/wand.h" 53#include "MagickWand/pixel-wand-private.h" 54 55/* 56 Define declarations. 57*/ 58#define ThrowWandException(severity,tag,context) \ 59{ \ 60 (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \ 61 tag,"`%s'",context); \ 62 return(MagickFalse); \ 63} 64#define MagickWandId "MagickWand" 65 66/* 67%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 68% % 69% % 70% % 71+ C l o n e M a g i c k W a n d F r o m I m a g e s % 72% % 73% % 74% % 75%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 76% 77% CloneMagickWandFromImages() clones the magick wand and inserts a new image 78% list. 79% 80% The format of the CloneMagickWandFromImages method is: 81% 82% MagickWand *CloneMagickWandFromImages(const MagickWand *wand, 83% Image *images) 84% 85% A description of each parameter follows: 86% 87% o wand: the magick wand. 88% 89% o images: replace the image list with these image(s). 90% 91*/ 92static MagickWand *CloneMagickWandFromImages(const MagickWand *wand, 93 Image *images) 94{ 95 MagickWand 96 *clone_wand; 97 98 assert(wand != (MagickWand *) NULL); 99 assert(wand->signature == WandSignature); 100 if (wand->debug != MagickFalse) 101 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 102 clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand)); 103 if (clone_wand == (MagickWand *) NULL) 104 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", 105 images->filename); 106 (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand)); 107 clone_wand->id=AcquireWandId(); 108 (void) FormatLocaleString(clone_wand->name,MaxTextExtent,"%s-%.20g", 109 MagickWandId,(double) clone_wand->id); 110 clone_wand->exception=AcquireExceptionInfo(); 111 InheritException(clone_wand->exception,wand->exception); 112 clone_wand->image_info=CloneImageInfo(wand->image_info); 113 clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info); 114 clone_wand->images=images; 115 clone_wand->debug=IsEventLogging(); 116 if (clone_wand->debug != MagickFalse) 117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name); 118 clone_wand->signature=WandSignature; 119 return(clone_wand); 120} 121 122/* 123%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 124% % 125% % 126% % 127% G e t I m a g e F r o m M a g i c k W a n d % 128% % 129% % 130% % 131%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 132% 133% GetImageFromMagickWand() returns the current image from the magick wand. 134% 135% The format of the GetImageFromMagickWand method is: 136% 137% Image *GetImageFromMagickWand(const MagickWand *wand) 138% 139% A description of each parameter follows: 140% 141% o wand: the magick wand. 142% 143*/ 144WandExport Image *GetImageFromMagickWand(const MagickWand *wand) 145{ 146 assert(wand != (MagickWand *) NULL); 147 assert(wand->signature == WandSignature); 148 if (wand->debug != MagickFalse) 149 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 150 if (wand->images == (Image *) NULL) 151 { 152 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 153 "ContainsNoImages","`%s'",wand->name); 154 return((Image *) NULL); 155 } 156 return(wand->images); 157} 158 159/* 160%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 161% % 162% % 163% % 164% M a g i c k A d a p t i v e S h a r p e n I m a g e % 165% % 166% % 167% % 168%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 169% 170% MagickAdaptiveBlurImage() adaptively blurs the image by blurring 171% less intensely near image edges and more intensely far from edges. We 172% blur the image with a Gaussian operator of the given radius and standard 173% deviation (sigma). For reasonable results, radius should be larger than 174% sigma. Use a radius of 0 and MagickAdaptiveBlurImage() selects a 175% suitable radius for you. 176% 177% The format of the MagickAdaptiveBlurImage method is: 178% 179% MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand, 180% const double radius,const double sigma) 181% 182% A description of each parameter follows: 183% 184% o wand: the magick wand. 185% 186% o radius: the radius of the Gaussian, in pixels, not counting the center 187% pixel. 188% 189% o sigma: the standard deviation of the Gaussian, in pixels. 190% 191*/ 192WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand, 193 const double radius,const double sigma) 194{ 195 Image 196 *sharp_image; 197 198 assert(wand != (MagickWand *) NULL); 199 assert(wand->signature == WandSignature); 200 if (wand->debug != MagickFalse) 201 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 202 if (wand->images == (Image *) NULL) 203 ThrowWandException(WandError,"ContainsNoImages",wand->name); 204 sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,wand->exception); 205 if (sharp_image == (Image *) NULL) 206 return(MagickFalse); 207 ReplaceImageInList(&wand->images,sharp_image); 208 return(MagickTrue); 209} 210 211/* 212%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 213% % 214% % 215% % 216% M a g i c k A d a p t i v e R e s i z e I m a g e % 217% % 218% % 219% % 220%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 221% 222% MagickAdaptiveResizeImage() adaptively resize image with data dependent 223% triangulation. 224% 225% MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand, 226% const size_t columns,const size_t rows) 227% 228% A description of each parameter follows: 229% 230% o wand: the magick wand. 231% 232% o columns: the number of columns in the scaled image. 233% 234% o rows: the number of rows in the scaled image. 235% 236*/ 237WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand, 238 const size_t columns,const size_t rows) 239{ 240 Image 241 *resize_image; 242 243 assert(wand != (MagickWand *) NULL); 244 assert(wand->signature == WandSignature); 245 if (wand->debug != MagickFalse) 246 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 247 if (wand->images == (Image *) NULL) 248 ThrowWandException(WandError,"ContainsNoImages",wand->name); 249 resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception); 250 if (resize_image == (Image *) NULL) 251 return(MagickFalse); 252 ReplaceImageInList(&wand->images,resize_image); 253 return(MagickTrue); 254} 255 256/* 257%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 258% % 259% % 260% % 261% M a g i c k A d a p t i v e S h a r p e n I m a g e % 262% % 263% % 264% % 265%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 266% 267% MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening 268% more intensely near image edges and less intensely far from edges. We 269% sharpen the image with a Gaussian operator of the given radius and standard 270% deviation (sigma). For reasonable results, radius should be larger than 271% sigma. Use a radius of 0 and MagickAdaptiveSharpenImage() selects a 272% suitable radius for you. 273% 274% The format of the MagickAdaptiveSharpenImage method is: 275% 276% MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand, 277% const double radius,const double sigma) 278% 279% A description of each parameter follows: 280% 281% o wand: the magick wand. 282% 283% o radius: the radius of the Gaussian, in pixels, not counting the center 284% pixel. 285% 286% o sigma: the standard deviation of the Gaussian, in pixels. 287% 288*/ 289WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand, 290 const double radius,const double sigma) 291{ 292 Image 293 *sharp_image; 294 295 assert(wand != (MagickWand *) NULL); 296 assert(wand->signature == WandSignature); 297 if (wand->debug != MagickFalse) 298 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 299 if (wand->images == (Image *) NULL) 300 ThrowWandException(WandError,"ContainsNoImages",wand->name); 301 sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,wand->exception); 302 if (sharp_image == (Image *) NULL) 303 return(MagickFalse); 304 ReplaceImageInList(&wand->images,sharp_image); 305 return(MagickTrue); 306} 307 308/* 309%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 310% % 311% % 312% % 313% M a g i c k A d a p t i v e T h r e s h o l d I m a g e % 314% % 315% % 316% % 317%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 318% 319% MagickAdaptiveThresholdImage() selects an individual threshold for each pixel 320% based on the range of intensity values in its local neighborhood. This 321% allows for thresholding of an image whose global intensity histogram 322% doesn't contain distinctive peaks. 323% 324% The format of the AdaptiveThresholdImage method is: 325% 326% MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand, 327% const size_t width,const size_t height,const ssize_t offset) 328% 329% A description of each parameter follows: 330% 331% o wand: the magick wand. 332% 333% o width: the width of the local neighborhood. 334% 335% o height: the height of the local neighborhood. 336% 337% o offset: the mean offset. 338% 339*/ 340WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand, 341 const size_t width,const size_t height,const ssize_t offset) 342{ 343 Image 344 *threshold_image; 345 346 assert(wand != (MagickWand *) NULL); 347 assert(wand->signature == WandSignature); 348 if (wand->debug != MagickFalse) 349 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 350 if (wand->images == (Image *) NULL) 351 ThrowWandException(WandError,"ContainsNoImages",wand->name); 352 threshold_image=AdaptiveThresholdImage(wand->images,width,height,offset, 353 wand->exception); 354 if (threshold_image == (Image *) NULL) 355 return(MagickFalse); 356 ReplaceImageInList(&wand->images,threshold_image); 357 return(MagickTrue); 358} 359 360/* 361%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 362% % 363% % 364% % 365% M a g i c k A d d I m a g e % 366% % 367% % 368% % 369%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 370% 371% MagickAddImage() adds the specified images at the current image location. 372% 373% The format of the MagickAddImage method is: 374% 375% MagickBooleanType MagickAddImage(MagickWand *wand, 376% const MagickWand *add_wand) 377% 378% A description of each parameter follows: 379% 380% o wand: the magick wand. 381% 382% o add_wand: A wand that contains images to add at the current image 383% location. 384% 385*/ 386 387static inline MagickBooleanType InsertImageInWand(MagickWand *wand, 388 Image *images) 389{ 390 Image 391 *sentinel; 392 393 sentinel=wand->images; 394 if (sentinel == (Image *) NULL) 395 { 396 wand->images=GetFirstImageInList(images); 397 return(MagickTrue); 398 } 399 if (wand->active == MagickFalse) 400 { 401 if ((wand->pend != MagickFalse) && (sentinel->next == (Image *) NULL)) 402 { 403 AppendImageToList(&sentinel,images); 404 wand->images=GetLastImageInList(images); 405 return(MagickTrue); 406 } 407 if ((wand->pend != MagickFalse) && (sentinel->previous == (Image *) NULL)) 408 { 409 PrependImageToList(&sentinel,images); 410 wand->images=GetFirstImageInList(images); 411 return(MagickTrue); 412 } 413 } 414 if (sentinel->next == (Image *) NULL) 415 { 416 InsertImageInList(&sentinel,images); 417 wand->images=GetLastImageInList(images); 418 return(MagickTrue); 419 } 420 InsertImageInList(&sentinel,images); 421 wand->images=GetFirstImageInList(images); 422 return(MagickTrue); 423} 424 425WandExport MagickBooleanType MagickAddImage(MagickWand *wand, 426 const MagickWand *add_wand) 427{ 428 Image 429 *images; 430 431 assert(wand != (MagickWand *) NULL); 432 assert(wand->signature == WandSignature); 433 if (wand->debug != MagickFalse) 434 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 435 assert(add_wand != (MagickWand *) NULL); 436 assert(add_wand->signature == WandSignature); 437 if (add_wand->images == (Image *) NULL) 438 ThrowWandException(WandError,"ContainsNoImages",add_wand->name); 439 images=CloneImageList(add_wand->images,wand->exception); 440 if (images == (Image *) NULL) 441 return(MagickFalse); 442 return(InsertImageInWand(wand,images)); 443} 444 445/* 446%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 447% % 448% % 449% % 450% M a g i c k A d d N o i s e I m a g e % 451% % 452% % 453% % 454%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 455% 456% MagickAddNoiseImage() adds random noise to the image. 457% 458% The format of the MagickAddNoiseImage method is: 459% 460% MagickBooleanType MagickAddNoiseImage(MagickWand *wand, 461% const NoiseType noise_type) 462% 463% A description of each parameter follows: 464% 465% o wand: the magick wand. 466% 467% o noise_type: The type of noise: Uniform, Gaussian, Multiplicative, 468% Impulse, Laplacian, or Poisson. 469% 470*/ 471WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand, 472 const NoiseType noise_type) 473{ 474 Image 475 *noise_image; 476 477 assert(wand != (MagickWand *) NULL); 478 assert(wand->signature == WandSignature); 479 if (wand->debug != MagickFalse) 480 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 481 if (wand->images == (Image *) NULL) 482 ThrowWandException(WandError,"ContainsNoImages",wand->name); 483 noise_image=AddNoiseImage(wand->images,noise_type,wand->exception); 484 if (noise_image == (Image *) NULL) 485 return(MagickFalse); 486 ReplaceImageInList(&wand->images,noise_image); 487 return(MagickTrue); 488} 489 490/* 491%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 492% % 493% % 494% % 495% M a g i c k A f f i n e T r a n s f o r m I m a g e % 496% % 497% % 498% % 499%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 500% 501% MagickAffineTransformImage() transforms an image as dictated by the affine 502% matrix of the drawing wand. 503% 504% The format of the MagickAffineTransformImage method is: 505% 506% MagickBooleanType MagickAffineTransformImage(MagickWand *wand, 507% const DrawingWand *drawing_wand) 508% 509% A description of each parameter follows: 510% 511% o wand: the magick wand. 512% 513% o drawing_wand: the draw wand. 514% 515*/ 516WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand, 517 const DrawingWand *drawing_wand) 518{ 519 DrawInfo 520 *draw_info; 521 522 Image 523 *affine_image; 524 525 assert(wand != (MagickWand *) NULL); 526 assert(wand->signature == WandSignature); 527 if (wand->debug != MagickFalse) 528 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 529 if (wand->images == (Image *) NULL) 530 ThrowWandException(WandError,"ContainsNoImages",wand->name); 531 draw_info=PeekDrawingWand(drawing_wand); 532 if (draw_info == (DrawInfo *) NULL) 533 return(MagickFalse); 534 affine_image=AffineTransformImage(wand->images,&draw_info->affine, 535 wand->exception); 536 draw_info=DestroyDrawInfo(draw_info); 537 if (affine_image == (Image *) NULL) 538 return(MagickFalse); 539 ReplaceImageInList(&wand->images,affine_image); 540 return(MagickTrue); 541} 542 543/* 544%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 545% % 546% % 547% % 548% M a g i c k A n n o t a t e I m a g e % 549% % 550% % 551% % 552%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 553% 554% MagickAnnotateImage() annotates an image with text. 555% 556% The format of the MagickAnnotateImage method is: 557% 558% MagickBooleanType MagickAnnotateImage(MagickWand *wand, 559% const DrawingWand *drawing_wand,const double x,const double y, 560% const double angle,const char *text) 561% 562% A description of each parameter follows: 563% 564% o wand: the magick wand. 565% 566% o drawing_wand: the draw wand. 567% 568% o x: x ordinate to left of text 569% 570% o y: y ordinate to text baseline 571% 572% o angle: rotate text relative to this angle. 573% 574% o text: text to draw 575% 576*/ 577WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand, 578 const DrawingWand *drawing_wand,const double x,const double y, 579 const double angle,const char *text) 580{ 581 char 582 geometry[MaxTextExtent]; 583 584 DrawInfo 585 *draw_info; 586 587 MagickBooleanType 588 status; 589 590 assert(wand != (MagickWand *) NULL); 591 assert(wand->signature == WandSignature); 592 if (wand->debug != MagickFalse) 593 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 594 if (wand->images == (Image *) NULL) 595 ThrowWandException(WandError,"ContainsNoImages",wand->name); 596 draw_info=PeekDrawingWand(drawing_wand); 597 if (draw_info == (DrawInfo *) NULL) 598 return(MagickFalse); 599 (void) CloneString(&draw_info->text,text); 600 (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",x,y); 601 draw_info->affine.sx=cos(DegreesToRadians(fmod(angle,360.0))); 602 draw_info->affine.rx=sin(DegreesToRadians(fmod(angle,360.0))); 603 draw_info->affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0)))); 604 draw_info->affine.sy=cos(DegreesToRadians(fmod(angle,360.0))); 605 (void) CloneString(&draw_info->geometry,geometry); 606 status=AnnotateImage(wand->images,draw_info); 607 draw_info=DestroyDrawInfo(draw_info); 608 if (status == MagickFalse) 609 InheritException(wand->exception,&wand->images->exception); 610 return(status); 611} 612 613/* 614%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 615% % 616% % 617% % 618% M a g i c k A n i m a t e I m a g e s % 619% % 620% % 621% % 622%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 623% 624% MagickAnimateImages() animates an image or image sequence. 625% 626% The format of the MagickAnimateImages method is: 627% 628% MagickBooleanType MagickAnimateImages(MagickWand *wand, 629% const char *server_name) 630% 631% A description of each parameter follows: 632% 633% o wand: the magick wand. 634% 635% o server_name: the X server name. 636% 637*/ 638WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand, 639 const char *server_name) 640{ 641 MagickBooleanType 642 status; 643 644 assert(wand != (MagickWand *) NULL); 645 assert(wand->signature == WandSignature); 646 if (wand->debug != MagickFalse) 647 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 648 (void) CloneString(&wand->image_info->server_name,server_name); 649 status=AnimateImages(wand->image_info,wand->images); 650 if (status == MagickFalse) 651 InheritException(wand->exception,&wand->images->exception); 652 return(status); 653} 654 655/* 656%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 657% % 658% % 659% % 660% M a g i c k A p p e n d I m a g e s % 661% % 662% % 663% % 664%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 665% 666% MagickAppendImages() append a set of images. 667% 668% The format of the MagickAppendImages method is: 669% 670% MagickWand *MagickAppendImages(MagickWand *wand, 671% const MagickBooleanType stack) 672% 673% A description of each parameter follows: 674% 675% o wand: the magick wand. 676% 677% o stack: By default, images are stacked left-to-right. Set stack to 678% MagickTrue to stack them top-to-bottom. 679% 680*/ 681WandExport MagickWand *MagickAppendImages(MagickWand *wand, 682 const MagickBooleanType stack) 683{ 684 Image 685 *append_image; 686 687 assert(wand != (MagickWand *) NULL); 688 assert(wand->signature == WandSignature); 689 if (wand->debug != MagickFalse) 690 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 691 if (wand->images == (Image *) NULL) 692 return((MagickWand *) NULL); 693 append_image=AppendImages(wand->images,stack,wand->exception); 694 if (append_image == (Image *) NULL) 695 return((MagickWand *) NULL); 696 return(CloneMagickWandFromImages(wand,append_image)); 697} 698 699/* 700%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 701% % 702% % 703% % 704% M a g i c k A u t o G a m m a I m a g e % 705% % 706% % 707% % 708%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 709% 710% MagickAutoGammaImage() extracts the 'mean' from the image and adjust the 711% image to try make set its gamma appropriatally. 712% 713% The format of the MagickAutoGammaImage method is: 714% 715% MagickBooleanType MagickAutoGammaImage(MagickWand *wand) 716% 717% A description of each parameter follows: 718% 719% o wand: the magick wand. 720% 721*/ 722WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand) 723{ 724 MagickBooleanType 725 status; 726 727 assert(wand != (MagickWand *) NULL); 728 assert(wand->signature == WandSignature); 729 if (wand->debug != MagickFalse) 730 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 731 if (wand->images == (Image *) NULL) 732 ThrowWandException(WandError,"ContainsNoImages",wand->name); 733 status=AutoGammaImage(wand->images); 734 if (status == MagickFalse) 735 InheritException(wand->exception,&wand->images->exception); 736 return(status); 737} 738 739/* 740%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 741% % 742% % 743% % 744% M a g i c k A u t o L e v e l I m a g e % 745% % 746% % 747% % 748%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 749% 750% MagickAutoLevelImage() adjusts the levels of a particular image channel by 751% scaling the minimum and maximum values to the full quantum range. 752% 753% The format of the MagickAutoLevelImage method is: 754% 755% MagickBooleanType MagickAutoLevelImage(MagickWand *wand) 756% 757% A description of each parameter follows: 758% 759% o wand: the magick wand. 760% 761*/ 762WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand) 763{ 764 MagickBooleanType 765 status; 766 767 assert(wand != (MagickWand *) NULL); 768 assert(wand->signature == WandSignature); 769 if (wand->debug != MagickFalse) 770 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 771 if (wand->images == (Image *) NULL) 772 ThrowWandException(WandError,"ContainsNoImages",wand->name); 773 status=AutoLevelImage(wand->images); 774 if (status == MagickFalse) 775 InheritException(wand->exception,&wand->images->exception); 776 return(status); 777} 778 779/* 780%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 781% % 782% % 783% % 784% M a g i c k B l a c k T h r e s h o l d I m a g e % 785% % 786% % 787% % 788%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 789% 790% MagickBlackThresholdImage() is like MagickThresholdImage() but forces all 791% pixels below the threshold into black while leaving all pixels above the 792% threshold unchanged. 793% 794% The format of the MagickBlackThresholdImage method is: 795% 796% MagickBooleanType MagickBlackThresholdImage(MagickWand *wand, 797% const PixelWand *threshold) 798% 799% A description of each parameter follows: 800% 801% o wand: the magick wand. 802% 803% o threshold: the pixel wand. 804% 805*/ 806WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand, 807 const PixelWand *threshold) 808{ 809 char 810 thresholds[MaxTextExtent]; 811 812 MagickBooleanType 813 status; 814 815 assert(wand != (MagickWand *) NULL); 816 assert(wand->signature == WandSignature); 817 if (wand->debug != MagickFalse) 818 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 819 if (wand->images == (Image *) NULL) 820 ThrowWandException(WandError,"ContainsNoImages",wand->name); 821 (void) FormatLocaleString(thresholds,MaxTextExtent, 822 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat, 823 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold), 824 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold)); 825 status=BlackThresholdImage(wand->images,thresholds,&wand->images->exception); 826 if (status == MagickFalse) 827 InheritException(wand->exception,&wand->images->exception); 828 return(status); 829} 830 831/* 832%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 833% % 834% % 835% % 836% M a g i c k B l u e S h i f t I m a g e % 837% % 838% % 839% % 840%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 841% 842% MagickBlueShiftImage() mutes the colors of the image to simulate a scene at 843% nighttime in the moonlight. 844% 845% The format of the MagickBlueShiftImage method is: 846% 847% MagickBooleanType MagickBlueShiftImage(MagickWand *wand, 848% const double factor) 849% 850% A description of each parameter follows: 851% 852% o wand: the magick wand. 853% 854% o factor: the blue shift factor (default 1.5) 855% 856*/ 857WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand, 858 const double factor) 859{ 860 Image 861 *shift_image; 862 863 assert(wand != (MagickWand *) NULL); 864 assert(wand->signature == WandSignature); 865 if (wand->debug != MagickFalse) 866 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 867 if (wand->images == (Image *) NULL) 868 ThrowWandException(WandError,"ContainsNoImages",wand->name); 869 shift_image=BlueShiftImage(wand->images,factor,wand->exception); 870 if (shift_image == (Image *) NULL) 871 return(MagickFalse); 872 ReplaceImageInList(&wand->images,shift_image); 873 return(MagickTrue); 874} 875 876/* 877%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 878% % 879% % 880% % 881% M a g i c k B l u r I m a g e % 882% % 883% % 884% % 885%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 886% 887% MagickBlurImage() blurs an image. We convolve the image with a 888% gaussian operator of the given radius and standard deviation (sigma). 889% For reasonable results, the radius should be larger than sigma. Use a 890% radius of 0 and BlurImage() selects a suitable radius for you. 891% 892% The format of the MagickBlurImage method is: 893% 894% MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius, 895% const double sigma) 896% 897% A description of each parameter follows: 898% 899% o wand: the magick wand. 900% 901% o radius: the radius of the , in pixels, not counting the center 902% pixel. 903% 904% o sigma: the standard deviation of the , in pixels. 905% 906*/ 907WandExport MagickBooleanType MagickBlurImage(MagickWand *wand, 908 const double radius,const double sigma) 909{ 910 Image 911 *blur_image; 912 913 assert(wand != (MagickWand *) NULL); 914 assert(wand->signature == WandSignature); 915 if (wand->debug != MagickFalse) 916 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 917 if (wand->images == (Image *) NULL) 918 ThrowWandException(WandError,"ContainsNoImages",wand->name); 919 blur_image=BlurImage(wand->images,radius,sigma,wand->exception); 920 if (blur_image == (Image *) NULL) 921 return(MagickFalse); 922 ReplaceImageInList(&wand->images,blur_image); 923 return(MagickTrue); 924} 925 926/* 927%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 928% % 929% % 930% % 931% M a g i c k B o r d e r I m a g e % 932% % 933% % 934% % 935%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 936% 937% MagickBorderImage() surrounds the image with a border of the color defined 938% by the bordercolor pixel wand. 939% 940% The format of the MagickBorderImage method is: 941% 942% MagickBooleanType MagickBorderImage(MagickWand *wand, 943% const PixelWand *bordercolor,const size_t width, 944% const size_t height) 945% 946% A description of each parameter follows: 947% 948% o wand: the magick wand. 949% 950% o bordercolor: the border color pixel wand. 951% 952% o width: the border width. 953% 954% o height: the border height. 955% 956*/ 957WandExport MagickBooleanType MagickBorderImage(MagickWand *wand, 958 const PixelWand *bordercolor,const size_t width, 959 const size_t height) 960{ 961 Image 962 *border_image; 963 964 RectangleInfo 965 border_info; 966 967 assert(wand != (MagickWand *) NULL); 968 assert(wand->signature == WandSignature); 969 if (wand->debug != MagickFalse) 970 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 971 if (wand->images == (Image *) NULL) 972 ThrowWandException(WandError,"ContainsNoImages",wand->name); 973 border_info.width=width; 974 border_info.height=height; 975 border_info.x=0; 976 border_info.y=0; 977 PixelGetQuantumPacket(bordercolor,&wand->images->border_color); 978 border_image=BorderImage(wand->images,&border_info,wand->exception); 979 if (border_image == (Image *) NULL) 980 return(MagickFalse); 981 ReplaceImageInList(&wand->images,border_image); 982 return(MagickTrue); 983} 984 985/* 986%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 987% % 988% % 989% % 990% M a g i c k B r i g h t n e s s C o n t r a s t S t r e t c h I m a g e % 991% % 992% % 993% % 994%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 995% 996% Use MagickBrightnessContrastImage() to change the brightness and/or contrast 997% of an image. It converts the brightness and contrast parameters into slope 998% and intercept and calls a polynomical function to apply to the image. 999 1000% 1001% The format of the MagickBrightnessContrastImage method is: 1002% 1003% MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand, 1004% const double brightness,const double contrast) 1005% 1006% A description of each parameter follows: 1007% 1008% o wand: the magick wand. 1009% 1010% o brightness: the brightness percent (-100 .. 100). 1011% 1012% o contrast: the contrast percent (-100 .. 100). 1013% 1014*/ 1015WandExport MagickBooleanType MagickBrightnessContrastImage( 1016 MagickWand *wand,const double brightness,const double contrast) 1017{ 1018 MagickBooleanType 1019 status; 1020 1021 assert(wand != (MagickWand *) NULL); 1022 assert(wand->signature == WandSignature); 1023 if (wand->debug != MagickFalse) 1024 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1025 if (wand->images == (Image *) NULL) 1026 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1027 status=BrightnessContrastImage(wand->images,brightness,contrast); 1028 if (status == MagickFalse) 1029 InheritException(wand->exception,&wand->images->exception); 1030 return(status); 1031} 1032 1033/* 1034%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1035% % 1036% % 1037% % 1038% M a g i c k C h a r c o a l I m a g e % 1039% % 1040% % 1041% % 1042%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1043% 1044% MagickCharcoalImage() simulates a charcoal drawing. 1045% 1046% The format of the MagickCharcoalImage method is: 1047% 1048% MagickBooleanType MagickCharcoalImage(MagickWand *wand, 1049% const double radius,const double sigma) 1050% 1051% A description of each parameter follows: 1052% 1053% o wand: the magick wand. 1054% 1055% o radius: the radius of the Gaussian, in pixels, not counting the center 1056% pixel. 1057% 1058% o sigma: the standard deviation of the Gaussian, in pixels. 1059% 1060*/ 1061WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand, 1062 const double radius,const double sigma) 1063{ 1064 Image 1065 *charcoal_image; 1066 1067 assert(wand != (MagickWand *) NULL); 1068 assert(wand->signature == WandSignature); 1069 if (wand->debug != MagickFalse) 1070 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1071 if (wand->images == (Image *) NULL) 1072 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1073 charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception); 1074 if (charcoal_image == (Image *) NULL) 1075 return(MagickFalse); 1076 ReplaceImageInList(&wand->images,charcoal_image); 1077 return(MagickTrue); 1078} 1079 1080/* 1081%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1082% % 1083% % 1084% % 1085% M a g i c k C h o p I m a g e % 1086% % 1087% % 1088% % 1089%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1090% 1091% MagickChopImage() removes a region of an image and collapses the image to 1092% occupy the removed portion 1093% 1094% The format of the MagickChopImage method is: 1095% 1096% MagickBooleanType MagickChopImage(MagickWand *wand, 1097% const size_t width,const size_t height,const ssize_t x, 1098% const ssize_t y) 1099% 1100% A description of each parameter follows: 1101% 1102% o wand: the magick wand. 1103% 1104% o width: the region width. 1105% 1106% o height: the region height. 1107% 1108% o x: the region x offset. 1109% 1110% o y: the region y offset. 1111% 1112% 1113*/ 1114WandExport MagickBooleanType MagickChopImage(MagickWand *wand, 1115 const size_t width,const size_t height,const ssize_t x, 1116 const ssize_t y) 1117{ 1118 Image 1119 *chop_image; 1120 1121 RectangleInfo 1122 chop; 1123 1124 assert(wand != (MagickWand *) NULL); 1125 assert(wand->signature == WandSignature); 1126 if (wand->debug != MagickFalse) 1127 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1128 if (wand->images == (Image *) NULL) 1129 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1130 chop.width=width; 1131 chop.height=height; 1132 chop.x=x; 1133 chop.y=y; 1134 chop_image=ChopImage(wand->images,&chop,wand->exception); 1135 if (chop_image == (Image *) NULL) 1136 return(MagickFalse); 1137 ReplaceImageInList(&wand->images,chop_image); 1138 return(MagickTrue); 1139} 1140 1141/* 1142%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1143% % 1144% % 1145% % 1146% M a g i c k C l a m p I m a g e % 1147% % 1148% % 1149% % 1150%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1151% 1152% MagickClampImage() restricts the color range from 0 to the quantum depth. 1153% 1154% The format of the MagickClampImage method is: 1155% 1156% MagickBooleanType MagickClampImage(MagickWand *wand) 1157% 1158% A description of each parameter follows: 1159% 1160% o wand: the magick wand. 1161% 1162% o channel: the channel. 1163% 1164*/ 1165WandExport MagickBooleanType MagickClampImage(MagickWand *wand) 1166{ 1167 MagickBooleanType 1168 status; 1169 1170 assert(wand != (MagickWand *) NULL); 1171 assert(wand->signature == WandSignature); 1172 if (wand->debug != MagickFalse) 1173 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1174 if (wand->images == (Image *) NULL) 1175 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1176 status=ClampImage(wand->images); 1177 if (status == MagickFalse) 1178 InheritException(wand->exception,&wand->images->exception); 1179 return(status); 1180} 1181 1182/* 1183%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1184% % 1185% % 1186% % 1187% M a g i c k C l i p I m a g e % 1188% % 1189% % 1190% % 1191%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1192% 1193% MagickClipImage() clips along the first path from the 8BIM profile, if 1194% present. 1195% 1196% The format of the MagickClipImage method is: 1197% 1198% MagickBooleanType MagickClipImage(MagickWand *wand) 1199% 1200% A description of each parameter follows: 1201% 1202% o wand: the magick wand. 1203% 1204*/ 1205WandExport MagickBooleanType MagickClipImage(MagickWand *wand) 1206{ 1207 MagickBooleanType 1208 status; 1209 1210 assert(wand != (MagickWand *) NULL); 1211 assert(wand->signature == WandSignature); 1212 if (wand->debug != MagickFalse) 1213 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1214 if (wand->images == (Image *) NULL) 1215 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1216 status=ClipImage(wand->images); 1217 if (status == MagickFalse) 1218 InheritException(wand->exception,&wand->images->exception); 1219 return(status); 1220} 1221 1222/* 1223%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1224% % 1225% % 1226% % 1227% M a g i c k C l i p I m a g e P a t h % 1228% % 1229% % 1230% % 1231%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1232% 1233% MagickClipImagePath() clips along the named paths from the 8BIM profile, if 1234% present. Later operations take effect inside the path. Id may be a number 1235% if preceded with #, to work on a numbered path, e.g., "#1" to use the first 1236% path. 1237% 1238% The format of the MagickClipImagePath method is: 1239% 1240% MagickBooleanType MagickClipImagePath(MagickWand *wand, 1241% const char *pathname,const MagickBooleanType inside) 1242% 1243% A description of each parameter follows: 1244% 1245% o wand: the magick wand. 1246% 1247% o pathname: name of clipping path resource. If name is preceded by #, use 1248% clipping path numbered by name. 1249% 1250% o inside: if non-zero, later operations take effect inside clipping path. 1251% Otherwise later operations take effect outside clipping path. 1252% 1253*/ 1254WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand, 1255 const char *pathname,const MagickBooleanType inside) 1256{ 1257 MagickBooleanType 1258 status; 1259 1260 assert(wand != (MagickWand *) NULL); 1261 assert(wand->signature == WandSignature); 1262 if (wand->debug != MagickFalse) 1263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1264 if (wand->images == (Image *) NULL) 1265 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1266 status=ClipImagePath(wand->images,pathname,inside); 1267 if (status == MagickFalse) 1268 InheritException(wand->exception,&wand->images->exception); 1269 return(status); 1270} 1271 1272/* 1273%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1274% % 1275% % 1276% % 1277% M a g i c k C l u t I m a g e % 1278% % 1279% % 1280% % 1281%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1282% 1283% MagickClutImage() replaces colors in the image from a color lookup table. 1284% 1285% The format of the MagickClutImage method is: 1286% 1287% MagickBooleanType MagickClutImage(MagickWand *wand, 1288% const MagickWand *clut_wand) 1289% 1290% A description of each parameter follows: 1291% 1292% o wand: the magick wand. 1293% 1294% o clut_image: the clut image. 1295% 1296*/ 1297WandExport MagickBooleanType MagickClutImage(MagickWand *wand, 1298 const MagickWand *clut_wand) 1299{ 1300 MagickBooleanType 1301 status; 1302 1303 assert(wand != (MagickWand *) NULL); 1304 assert(wand->signature == WandSignature); 1305 if (wand->debug != MagickFalse) 1306 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1307 if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL)) 1308 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1309 status=ClutImage(wand->images,clut_wand->images); 1310 if (status == MagickFalse) 1311 InheritException(wand->exception,&wand->images->exception); 1312 return(status); 1313} 1314 1315/* 1316%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1317% % 1318% % 1319% % 1320% M a g i c k C o a l e s c e I m a g e s % 1321% % 1322% % 1323% % 1324%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1325% 1326% MagickCoalesceImages() composites a set of images while respecting any page 1327% offsets and disposal methods. GIF, MIFF, and MNG animation sequences 1328% typically start with an image background and each subsequent image 1329% varies in size and offset. MagickCoalesceImages() returns a new sequence 1330% where each image in the sequence is the same size as the first and 1331% composited with the next image in the sequence. 1332% 1333% The format of the MagickCoalesceImages method is: 1334% 1335% MagickWand *MagickCoalesceImages(MagickWand *wand) 1336% 1337% A description of each parameter follows: 1338% 1339% o wand: the magick wand. 1340% 1341*/ 1342WandExport MagickWand *MagickCoalesceImages(MagickWand *wand) 1343{ 1344 Image 1345 *coalesce_image; 1346 1347 assert(wand != (MagickWand *) NULL); 1348 assert(wand->signature == WandSignature); 1349 if (wand->debug != MagickFalse) 1350 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1351 if (wand->images == (Image *) NULL) 1352 return((MagickWand *) NULL); 1353 coalesce_image=CoalesceImages(wand->images,wand->exception); 1354 if (coalesce_image == (Image *) NULL) 1355 return((MagickWand *) NULL); 1356 return(CloneMagickWandFromImages(wand,coalesce_image)); 1357} 1358 1359/* 1360%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1361% % 1362% % 1363% % 1364% M a g i c k C o l o r D e c i s i o n I m a g e % 1365% % 1366% % 1367% % 1368%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1369% 1370% MagickColorDecisionListImage() accepts a lightweight Color Correction 1371% Collection (CCC) file which solely contains one or more color corrections 1372% and applies the color correction to the image. Here is a sample CCC file: 1373% 1374% <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2"> 1375% <ColorCorrection id="cc03345"> 1376% <SOPNode> 1377% <Slope> 0.9 1.2 0.5 </Slope> 1378% <Offset> 0.4 -0.5 0.6 </Offset> 1379% <Power> 1.0 0.8 1.5 </Power> 1380% </SOPNode> 1381% <SATNode> 1382% <Saturation> 0.85 </Saturation> 1383% </SATNode> 1384% </ColorCorrection> 1385% </ColorCorrectionCollection> 1386% 1387% which includes the offset, slope, and power for each of the RGB channels 1388% as well as the saturation. 1389% 1390% The format of the MagickColorDecisionListImage method is: 1391% 1392% MagickBooleanType MagickColorDecisionListImage(MagickWand *wand, 1393% const double gamma) 1394% 1395% A description of each parameter follows: 1396% 1397% o wand: the magick wand. 1398% 1399% o color_correction_collection: the color correction collection in XML. 1400% 1401*/ 1402WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand, 1403 const char *color_correction_collection) 1404{ 1405 MagickBooleanType 1406 status; 1407 1408 assert(wand != (MagickWand *) NULL); 1409 assert(wand->signature == WandSignature); 1410 if (wand->debug != MagickFalse) 1411 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1412 if (wand->images == (Image *) NULL) 1413 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1414 status=ColorDecisionListImage(wand->images,color_correction_collection); 1415 if (status == MagickFalse) 1416 InheritException(wand->exception,&wand->images->exception); 1417 return(status); 1418} 1419 1420/* 1421%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1422% % 1423% % 1424% % 1425% M a g i c k C o l o r i z e I m a g e % 1426% % 1427% % 1428% % 1429%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1430% 1431% MagickColorizeImage() blends the fill color with each pixel in the image. 1432% 1433% The format of the MagickColorizeImage method is: 1434% 1435% MagickBooleanType MagickColorizeImage(MagickWand *wand, 1436% const PixelWand *colorize,const PixelWand *opacity) 1437% 1438% A description of each parameter follows: 1439% 1440% o wand: the magick wand. 1441% 1442% o colorize: the colorize pixel wand. 1443% 1444% o opacity: the opacity pixel wand. 1445% 1446*/ 1447WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand, 1448 const PixelWand *colorize,const PixelWand *opacity) 1449{ 1450 char 1451 percent_opaque[MaxTextExtent]; 1452 1453 Image 1454 *colorize_image; 1455 1456 PixelPacket 1457 target; 1458 1459 assert(wand != (MagickWand *) NULL); 1460 assert(wand->signature == WandSignature); 1461 if (wand->debug != MagickFalse) 1462 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1463 if (wand->images == (Image *) NULL) 1464 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1465 (void) FormatLocaleString(percent_opaque,MaxTextExtent, 1466 "%g,%g,%g,%g",(double) (100.0*QuantumScale* 1467 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale* 1468 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale* 1469 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale* 1470 PixelGetOpacityQuantum(opacity))); 1471 PixelGetQuantumPacket(colorize,&target); 1472 colorize_image=ColorizeImage(wand->images,percent_opaque,target, 1473 wand->exception); 1474 if (colorize_image == (Image *) NULL) 1475 return(MagickFalse); 1476 ReplaceImageInList(&wand->images,colorize_image); 1477 return(MagickTrue); 1478} 1479 1480/* 1481%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1482% % 1483% % 1484% % 1485% M a g i c k C o l o r M a t r i x I m a g e % 1486% % 1487% % 1488% % 1489%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1490% 1491% MagickColorMatrixImage() apply color transformation to an image. The method 1492% permits saturation changes, hue rotation, luminance to alpha, and various 1493% other effects. Although variable-sized transformation matrices can be used, 1494% typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA 1495% (or RGBA with offsets). The matrix is similar to those used by Adobe Flash 1496% except offsets are in column 6 rather than 5 (in support of CMYKA images) 1497% and offsets are normalized (divide Flash offset by 255). 1498% 1499% The format of the MagickColorMatrixImage method is: 1500% 1501% MagickBooleanType MagickColorMatrixImage(MagickWand *wand, 1502% const KernelInfo *color_matrix) 1503% 1504% A description of each parameter follows: 1505% 1506% o wand: the magick wand. 1507% 1508% o color_matrix: the color matrix. 1509% 1510*/ 1511WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand, 1512 const KernelInfo *color_matrix) 1513{ 1514 Image 1515 *color_image; 1516 1517 assert(wand != (MagickWand *) NULL); 1518 assert(wand->signature == WandSignature); 1519 if (wand->debug != MagickFalse) 1520 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1521 if (color_matrix == (const KernelInfo *) NULL) 1522 return(MagickFalse); 1523 if (wand->images == (Image *) NULL) 1524 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1525 color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception); 1526 if (color_image == (Image *) NULL) 1527 return(MagickFalse); 1528 ReplaceImageInList(&wand->images,color_image); 1529 return(MagickTrue); 1530} 1531 1532/* 1533%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1534% % 1535% % 1536% % 1537% M a g i c k C o m b i n e I m a g e s % 1538% % 1539% % 1540% % 1541%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1542% 1543% MagickCombineImages() combines one or more images into a single image. The 1544% grayscale value of the pixels of each image in the sequence is assigned in 1545% order to the specified hannels of the combined image. The typical 1546% ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc. 1547% 1548% The format of the MagickCombineImages method is: 1549% 1550% MagickWand *MagickCombineImages(MagickWand *wand) 1551% 1552% A description of each parameter follows: 1553% 1554% o wand: the magick wand. 1555% 1556*/ 1557WandExport MagickWand *MagickCombineImages(MagickWand *wand) 1558{ 1559 Image 1560 *combine_image; 1561 1562 assert(wand != (MagickWand *) NULL); 1563 assert(wand->signature == WandSignature); 1564 if (wand->debug != MagickFalse) 1565 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1566 if (wand->images == (Image *) NULL) 1567 return((MagickWand *) NULL); 1568 combine_image=CombineImages(wand->images,wand->exception); 1569 if (combine_image == (Image *) NULL) 1570 return((MagickWand *) NULL); 1571 return(CloneMagickWandFromImages(wand,combine_image)); 1572} 1573 1574/* 1575%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1576% % 1577% % 1578% % 1579% M a g i c k C o m m e n t I m a g e % 1580% % 1581% % 1582% % 1583%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1584% 1585% MagickCommentImage() adds a comment to your image. 1586% 1587% The format of the MagickCommentImage method is: 1588% 1589% MagickBooleanType MagickCommentImage(MagickWand *wand, 1590% const char *comment) 1591% 1592% A description of each parameter follows: 1593% 1594% o wand: the magick wand. 1595% 1596% o comment: the image comment. 1597% 1598*/ 1599WandExport MagickBooleanType MagickCommentImage(MagickWand *wand, 1600 const char *comment) 1601{ 1602 MagickBooleanType 1603 status; 1604 1605 assert(wand != (MagickWand *) NULL); 1606 assert(wand->signature == WandSignature); 1607 if (wand->debug != MagickFalse) 1608 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1609 if (wand->images == (Image *) NULL) 1610 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1611 status=SetImageProperty(wand->images,"comment",comment); 1612 if (status == MagickFalse) 1613 InheritException(wand->exception,&wand->images->exception); 1614 return(status); 1615} 1616 1617/* 1618%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1619% % 1620% % 1621% % 1622% M a g i c k C o m p a r e I m a g e L a y e r s % 1623% % 1624% % 1625% % 1626%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1627% 1628% MagickCompareImagesLayers() compares each image with the next in a sequence 1629% and returns the maximum bounding region of any pixel differences it 1630% discovers. 1631% 1632% The format of the MagickCompareImagesLayers method is: 1633% 1634% MagickWand *MagickCompareImagesLayers(MagickWand *wand, 1635% const ImageLayerMethod method) 1636% 1637% A description of each parameter follows: 1638% 1639% o wand: the magick wand. 1640% 1641% o method: the compare method. 1642% 1643*/ 1644WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand, 1645 const ImageLayerMethod method) 1646{ 1647 Image 1648 *layers_image; 1649 1650 assert(wand != (MagickWand *) NULL); 1651 assert(wand->signature == WandSignature); 1652 if (wand->debug != MagickFalse) 1653 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1654 if (wand->images == (Image *) NULL) 1655 return((MagickWand *) NULL); 1656 layers_image=CompareImagesLayers(wand->images,method,wand->exception); 1657 if (layers_image == (Image *) NULL) 1658 return((MagickWand *) NULL); 1659 return(CloneMagickWandFromImages(wand,layers_image)); 1660} 1661 1662/* 1663%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1664% % 1665% % 1666% % 1667% M a g i c k C o m p a r e I m a g e s % 1668% % 1669% % 1670% % 1671%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1672% 1673% MagickCompareImages() compares an image to a reconstructed image and returns 1674% the specified difference image. 1675% 1676% The format of the MagickCompareImages method is: 1677% 1678% MagickWand *MagickCompareImages(MagickWand *wand, 1679% const MagickWand *reference,const MetricType metric, 1680% double *distortion) 1681% 1682% A description of each parameter follows: 1683% 1684% o wand: the magick wand. 1685% 1686% o reference: the reference wand. 1687% 1688% o metric: the metric. 1689% 1690% o distortion: the computed distortion between the images. 1691% 1692*/ 1693WandExport MagickWand *MagickCompareImages(MagickWand *wand, 1694 const MagickWand *reference,const MetricType metric,double *distortion) 1695{ 1696 Image 1697 *compare_image; 1698 1699 1700 assert(wand != (MagickWand *) NULL); 1701 assert(wand->signature == WandSignature); 1702 if (wand->debug != MagickFalse) 1703 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1704 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) 1705 { 1706 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 1707 "ContainsNoImages","`%s'",wand->name); 1708 return((MagickWand *) NULL); 1709 } 1710 compare_image=CompareImages(wand->images,reference->images,metric,distortion, 1711 &wand->images->exception); 1712 if (compare_image == (Image *) NULL) 1713 return((MagickWand *) NULL); 1714 return(CloneMagickWandFromImages(wand,compare_image)); 1715} 1716 1717/* 1718%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1719% % 1720% % 1721% % 1722% M a g i c k C o m p o s i t e I m a g e % 1723% % 1724% % 1725% % 1726%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1727% 1728% MagickCompositeImage() composite one image onto another at the specified 1729% offset. 1730% 1731% The format of the MagickCompositeImage method is: 1732% 1733% MagickBooleanType MagickCompositeImage(MagickWand *wand, 1734% const MagickWand *composite_wand,const CompositeOperator compose, 1735% const ssize_t x,const ssize_t y) 1736% 1737% A description of each parameter follows: 1738% 1739% o wand: the magick wand. 1740% 1741% o composite_image: the composite image. 1742% 1743% o compose: This operator affects how the composite is applied to the 1744% image. The default is Over. Choose from these operators: 1745% 1746% OverCompositeOp InCompositeOp OutCompositeOp 1747% AtopCompositeOp XorCompositeOp PlusCompositeOp 1748% MinusCompositeOp AddCompositeOp SubtractCompositeOp 1749% DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp 1750% DisplaceCompositeOp 1751% 1752% o x: the column offset of the composited image. 1753% 1754% o y: the row offset of the composited image. 1755% 1756*/ 1757WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand, 1758 const MagickWand *composite_wand,const CompositeOperator compose, 1759 const ssize_t x,const ssize_t y) 1760{ 1761 MagickBooleanType 1762 status; 1763 1764 assert(wand != (MagickWand *) NULL); 1765 assert(wand->signature == WandSignature); 1766 if (wand->debug != MagickFalse) 1767 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1768 if ((wand->images == (Image *) NULL) || 1769 (composite_wand->images == (Image *) NULL)) 1770 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1771 status=CompositeImage(wand->images,compose,composite_wand->images,x,y); 1772 if (status == MagickFalse) 1773 InheritException(wand->exception,&wand->images->exception); 1774 return(status); 1775} 1776 1777/* 1778%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1779% % 1780% % 1781% % 1782% M a g i c k C o n t r a s t I m a g e % 1783% % 1784% % 1785% % 1786%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1787% 1788% MagickContrastImage() enhances the intensity differences between the lighter 1789% and darker elements of the image. Set sharpen to a value other than 0 to 1790% increase the image contrast otherwise the contrast is reduced. 1791% 1792% The format of the MagickContrastImage method is: 1793% 1794% MagickBooleanType MagickContrastImage(MagickWand *wand, 1795% const MagickBooleanType sharpen) 1796% 1797% A description of each parameter follows: 1798% 1799% o wand: the magick wand. 1800% 1801% o sharpen: Increase or decrease image contrast. 1802% 1803% 1804*/ 1805WandExport MagickBooleanType MagickContrastImage(MagickWand *wand, 1806 const MagickBooleanType sharpen) 1807{ 1808 MagickBooleanType 1809 status; 1810 1811 assert(wand != (MagickWand *) NULL); 1812 assert(wand->signature == WandSignature); 1813 if (wand->debug != MagickFalse) 1814 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1815 if (wand->images == (Image *) NULL) 1816 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1817 status=ContrastImage(wand->images,sharpen); 1818 if (status == MagickFalse) 1819 InheritException(wand->exception,&wand->images->exception); 1820 return(status); 1821} 1822 1823/* 1824%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1825% % 1826% % 1827% % 1828% M a g i c k C o n t r a s t S t r e t c h I m a g e % 1829% % 1830% % 1831% % 1832%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1833% 1834% MagickContrastStretchImage() enhances the contrast of a color image by 1835% adjusting the pixels color to span the entire range of colors available. 1836% You can also reduce the influence of a particular channel with a gamma 1837% value of 0. 1838% 1839% The format of the MagickContrastStretchImage method is: 1840% 1841% MagickBooleanType MagickContrastStretchImage(MagickWand *wand, 1842% const double black_point,const double white_point) 1843% 1844% A description of each parameter follows: 1845% 1846% o wand: the magick wand. 1847% 1848% o black_point: the black point. 1849% 1850% o white_point: the white point. 1851% 1852*/ 1853WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand, 1854 const double black_point,const double white_point) 1855{ 1856 MagickBooleanType 1857 status; 1858 1859 assert(wand != (MagickWand *) NULL); 1860 assert(wand->signature == WandSignature); 1861 if (wand->debug != MagickFalse) 1862 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1863 if (wand->images == (Image *) NULL) 1864 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1865 status=ContrastStretchImage(wand->images,black_point,white_point); 1866 if (status == MagickFalse) 1867 InheritException(wand->exception,&wand->images->exception); 1868 return(status); 1869} 1870 1871/* 1872%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1873% % 1874% % 1875% % 1876% M a g i c k C o n v o l v e I m a g e % 1877% % 1878% % 1879% % 1880%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1881% 1882% MagickConvolveImage() applies a custom convolution kernel to the image. 1883% 1884% The format of the MagickConvolveImage method is: 1885% 1886% MagickBooleanType MagickConvolveImage(MagickWand *wand, 1887% const KernelInfo *kernel) 1888% 1889% A description of each parameter follows: 1890% 1891% o wand: the magick wand. 1892% 1893% o kernel: An array of doubles representing the convolution kernel. 1894% 1895*/ 1896WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand, 1897 const KernelInfo *kernel) 1898{ 1899 Image 1900 *filter_image; 1901 1902 assert(wand != (MagickWand *) NULL); 1903 assert(wand->signature == WandSignature); 1904 if (wand->debug != MagickFalse) 1905 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1906 if (kernel == (const KernelInfo *) NULL) 1907 return(MagickFalse); 1908 if (wand->images == (Image *) NULL) 1909 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1910 filter_image=ConvolveImage(wand->images,kernel,wand->exception); 1911 if (filter_image == (Image *) NULL) 1912 return(MagickFalse); 1913 ReplaceImageInList(&wand->images,filter_image); 1914 return(MagickTrue); 1915} 1916 1917/* 1918%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1919% % 1920% % 1921% % 1922% M a g i c k C r o p I m a g e % 1923% % 1924% % 1925% % 1926%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1927% 1928% MagickCropImage() extracts a region of the image. 1929% 1930% The format of the MagickCropImage method is: 1931% 1932% MagickBooleanType MagickCropImage(MagickWand *wand, 1933% const size_t width,const size_t height,const ssize_t x,const ssize_t y) 1934% 1935% A description of each parameter follows: 1936% 1937% o wand: the magick wand. 1938% 1939% o width: the region width. 1940% 1941% o height: the region height. 1942% 1943% o x: the region x-offset. 1944% 1945% o y: the region y-offset. 1946% 1947*/ 1948WandExport MagickBooleanType MagickCropImage(MagickWand *wand, 1949 const size_t width,const size_t height,const ssize_t x,const ssize_t y) 1950{ 1951 Image 1952 *crop_image; 1953 1954 RectangleInfo 1955 crop; 1956 1957 assert(wand != (MagickWand *) NULL); 1958 assert(wand->signature == WandSignature); 1959 if (wand->debug != MagickFalse) 1960 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 1961 if (wand->images == (Image *) NULL) 1962 ThrowWandException(WandError,"ContainsNoImages",wand->name); 1963 crop.width=width; 1964 crop.height=height; 1965 crop.x=x; 1966 crop.y=y; 1967 crop_image=CropImage(wand->images,&crop,wand->exception); 1968 if (crop_image == (Image *) NULL) 1969 return(MagickFalse); 1970 ReplaceImageInList(&wand->images,crop_image); 1971 return(MagickTrue); 1972} 1973 1974/* 1975%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1976% % 1977% % 1978% % 1979% M a g i c k C y c l e C o l o r m a p I m a g e % 1980% % 1981% % 1982% % 1983%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1984% 1985% MagickCycleColormapImage() displaces an image's colormap by a given number 1986% of positions. If you cycle the colormap a number of times you can produce 1987% a psychodelic effect. 1988% 1989% The format of the MagickCycleColormapImage method is: 1990% 1991% MagickBooleanType MagickCycleColormapImage(MagickWand *wand, 1992% const ssize_t displace) 1993% 1994% A description of each parameter follows: 1995% 1996% o wand: the magick wand. 1997% 1998% o pixel_wand: the pixel wand. 1999% 2000*/ 2001WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand, 2002 const ssize_t displace) 2003{ 2004 MagickBooleanType 2005 status; 2006 2007 assert(wand != (MagickWand *) NULL); 2008 assert(wand->signature == WandSignature); 2009 if (wand->debug != MagickFalse) 2010 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2011 if (wand->images == (Image *) NULL) 2012 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2013 status=CycleColormapImage(wand->images,displace); 2014 if (status == MagickFalse) 2015 InheritException(wand->exception,&wand->images->exception); 2016 return(status); 2017} 2018 2019/* 2020%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2021% % 2022% % 2023% % 2024% M a g i c k C o n s t i t u t e I m a g e % 2025% % 2026% % 2027% % 2028%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2029% 2030% MagickConstituteImage() adds an image to the wand comprised of the pixel 2031% data you supply. The pixel data must be in scanline order top-to-bottom. 2032% The data can be char, short int, int, float, or double. Float and double 2033% require the pixels to be normalized [0..1], otherwise [0..Max], where Max 2034% is the maximum value the type can accomodate (e.g. 255 for char). For 2035% example, to create a 640x480 image from unsigned red-green-blue character 2036% data, use 2037% 2038% MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels); 2039% 2040% The format of the MagickConstituteImage method is: 2041% 2042% MagickBooleanType MagickConstituteImage(MagickWand *wand, 2043% const size_t columns,const size_t rows,const char *map, 2044% const StorageType storage,void *pixels) 2045% 2046% A description of each parameter follows: 2047% 2048% o wand: the magick wand. 2049% 2050% o columns: width in pixels of the image. 2051% 2052% o rows: height in pixels of the image. 2053% 2054% o map: This string reflects the expected ordering of the pixel array. 2055% It can be any combination or order of R = red, G = green, B = blue, 2056% A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, 2057% Y = yellow, M = magenta, K = black, I = intensity (for grayscale), 2058% P = pad. 2059% 2060% o storage: Define the data type of the pixels. Float and double types are 2061% expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from 2062% these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel, 2063% LongPixel, QuantumPixel, or ShortPixel. 2064% 2065% o pixels: This array of values contain the pixel components as defined by 2066% map and type. You must preallocate this array where the expected 2067% length varies depending on the values of width, height, map, and type. 2068% 2069% 2070*/ 2071WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand, 2072 const size_t columns,const size_t rows,const char *map, 2073 const StorageType storage,const void *pixels) 2074{ 2075 Image 2076 *images; 2077 2078 assert(wand != (MagickWand *) NULL); 2079 assert(wand->signature == WandSignature); 2080 if (wand->debug != MagickFalse) 2081 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2082 images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception); 2083 if (images == (Image *) NULL) 2084 return(MagickFalse); 2085 return(InsertImageInWand(wand,images)); 2086} 2087 2088/* 2089%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2090% % 2091% % 2092% % 2093% M a g i c k D e c i p h e r I m a g e % 2094% % 2095% % 2096% % 2097%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2098% 2099% MagickDecipherImage() converts cipher pixels to plain pixels. 2100% 2101% The format of the MagickDecipherImage method is: 2102% 2103% MagickBooleanType MagickDecipherImage(MagickWand *wand, 2104% const char *passphrase) 2105% 2106% A description of each parameter follows: 2107% 2108% o wand: the magick wand. 2109% 2110% o passphrase: the passphrase. 2111% 2112*/ 2113WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand, 2114 const char *passphrase) 2115{ 2116 assert(wand != (MagickWand *) NULL); 2117 assert(wand->signature == WandSignature); 2118 if (wand->debug != MagickFalse) 2119 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2120 if (wand->images == (Image *) NULL) 2121 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2122 return(DecipherImage(wand->images,passphrase,&wand->images->exception)); 2123} 2124 2125/* 2126%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2127% % 2128% % 2129% % 2130% M a g i c k D e c o n s t r u c t I m a g e s % 2131% % 2132% % 2133% % 2134%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2135% 2136% MagickDeconstructImages() compares each image with the next in a sequence 2137% and returns the maximum bounding region of any pixel differences it 2138% discovers. 2139% 2140% The format of the MagickDeconstructImages method is: 2141% 2142% MagickWand *MagickDeconstructImages(MagickWand *wand) 2143% 2144% A description of each parameter follows: 2145% 2146% o wand: the magick wand. 2147% 2148*/ 2149WandExport MagickWand *MagickDeconstructImages(MagickWand *wand) 2150{ 2151 Image 2152 *deconstruct_image; 2153 2154 assert(wand != (MagickWand *) NULL); 2155 assert(wand->signature == WandSignature); 2156 if (wand->debug != MagickFalse) 2157 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2158 if (wand->images == (Image *) NULL) 2159 return((MagickWand *) NULL); 2160 deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer, 2161 wand->exception); 2162 if (deconstruct_image == (Image *) NULL) 2163 return((MagickWand *) NULL); 2164 return(CloneMagickWandFromImages(wand,deconstruct_image)); 2165} 2166 2167/* 2168%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2169% % 2170% % 2171% % 2172% M a g i c k D e s k e w I m a g e % 2173% % 2174% % 2175% % 2176%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2177% 2178% MagickDeskewImage() removes skew from the image. Skew is an artifact that 2179% occurs in scanned images because of the camera being misaligned, 2180% imperfections in the scanning or surface, or simply because the paper was 2181% not placed completely flat when scanned. 2182% 2183% The format of the MagickDeskewImage method is: 2184% 2185% MagickBooleanType MagickDeskewImage(MagickWand *wand, 2186% const double threshold) 2187% 2188% A description of each parameter follows: 2189% 2190% o wand: the magick wand. 2191% 2192% o threshold: separate background from foreground. 2193% 2194*/ 2195WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand, 2196 const double threshold) 2197{ 2198 Image 2199 *sepia_image; 2200 2201 assert(wand != (MagickWand *) NULL); 2202 assert(wand->signature == WandSignature); 2203 if (wand->debug != MagickFalse) 2204 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2205 if (wand->images == (Image *) NULL) 2206 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2207 sepia_image=DeskewImage(wand->images,threshold,wand->exception); 2208 if (sepia_image == (Image *) NULL) 2209 return(MagickFalse); 2210 ReplaceImageInList(&wand->images,sepia_image); 2211 return(MagickTrue); 2212} 2213 2214/* 2215%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2216% % 2217% % 2218% % 2219% M a g i c k D e s p e c k l e I m a g e % 2220% % 2221% % 2222% % 2223%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2224% 2225% MagickDespeckleImage() reduces the speckle noise in an image while 2226% perserving the edges of the original image. 2227% 2228% The format of the MagickDespeckleImage method is: 2229% 2230% MagickBooleanType MagickDespeckleImage(MagickWand *wand) 2231% 2232% A description of each parameter follows: 2233% 2234% o wand: the magick wand. 2235% 2236*/ 2237WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand) 2238{ 2239 Image 2240 *despeckle_image; 2241 2242 assert(wand != (MagickWand *) NULL); 2243 assert(wand->signature == WandSignature); 2244 if (wand->debug != MagickFalse) 2245 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2246 if (wand->images == (Image *) NULL) 2247 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2248 despeckle_image=DespeckleImage(wand->images,wand->exception); 2249 if (despeckle_image == (Image *) NULL) 2250 return(MagickFalse); 2251 ReplaceImageInList(&wand->images,despeckle_image); 2252 return(MagickTrue); 2253} 2254 2255/* 2256%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2257% % 2258% % 2259% % 2260% M a g i c k D e s t r o y I m a g e % 2261% % 2262% % 2263% % 2264%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2265% 2266% MagickDestroyImage() dereferences an image, deallocating memory associated 2267% with the image if the reference count becomes zero. 2268% 2269% The format of the MagickDestroyImage method is: 2270% 2271% Image *MagickDestroyImage(Image *image) 2272% 2273% A description of each parameter follows: 2274% 2275% o image: the image. 2276% 2277*/ 2278WandExport Image *MagickDestroyImage(Image *image) 2279{ 2280 return(DestroyImage(image)); 2281} 2282 2283/* 2284%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2285% % 2286% % 2287% % 2288% M a g i c k D i s p l a y I m a g e % 2289% % 2290% % 2291% % 2292%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2293% 2294% MagickDisplayImage() displays an image. 2295% 2296% The format of the MagickDisplayImage method is: 2297% 2298% MagickBooleanType MagickDisplayImage(MagickWand *wand, 2299% const char *server_name) 2300% 2301% A description of each parameter follows: 2302% 2303% o wand: the magick wand. 2304% 2305% o server_name: the X server name. 2306% 2307*/ 2308WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand, 2309 const char *server_name) 2310{ 2311 Image 2312 *image; 2313 2314 MagickBooleanType 2315 status; 2316 2317 assert(wand != (MagickWand *) NULL); 2318 assert(wand->signature == WandSignature); 2319 if (wand->debug != MagickFalse) 2320 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2321 if (wand->images == (Image *) NULL) 2322 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2323 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); 2324 if (image == (Image *) NULL) 2325 return(MagickFalse); 2326 (void) CloneString(&wand->image_info->server_name,server_name); 2327 status=DisplayImages(wand->image_info,image); 2328 if (status == MagickFalse) 2329 InheritException(wand->exception,&image->exception); 2330 image=DestroyImage(image); 2331 return(status); 2332} 2333 2334/* 2335%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2336% % 2337% % 2338% % 2339% M a g i c k D i s p l a y I m a g e s % 2340% % 2341% % 2342% % 2343%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2344% 2345% MagickDisplayImages() displays an image or image sequence. 2346% 2347% The format of the MagickDisplayImages method is: 2348% 2349% MagickBooleanType MagickDisplayImages(MagickWand *wand, 2350% const char *server_name) 2351% 2352% A description of each parameter follows: 2353% 2354% o wand: the magick wand. 2355% 2356% o server_name: the X server name. 2357% 2358*/ 2359WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand, 2360 const char *server_name) 2361{ 2362 MagickBooleanType 2363 status; 2364 2365 assert(wand != (MagickWand *) NULL); 2366 assert(wand->signature == WandSignature); 2367 if (wand->debug != MagickFalse) 2368 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2369 (void) CloneString(&wand->image_info->server_name,server_name); 2370 status=DisplayImages(wand->image_info,wand->images); 2371 if (status == MagickFalse) 2372 InheritException(wand->exception,&wand->images->exception); 2373 return(status); 2374} 2375 2376/* 2377%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2378% % 2379% % 2380% % 2381% M a g i c k D i s t o r t I m a g e % 2382% % 2383% % 2384% % 2385%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2386% 2387% MagickDistortImage() distorts an image using various distortion methods, by 2388% mapping color lookups of the source image to a new destination image 2389% usally of the same size as the source image, unless 'bestfit' is set to 2390% true. 2391% 2392% If 'bestfit' is enabled, and distortion allows it, the destination image is 2393% adjusted to ensure the whole source 'image' will just fit within the final 2394% destination image, which will be sized and offset accordingly. Also in 2395% many cases the virtual offset of the source image will be taken into 2396% account in the mapping. 2397% 2398% The format of the MagickDistortImage method is: 2399% 2400% MagickBooleanType MagickDistortImage(MagickWand *wand, 2401% const DistortImageMethod method,const size_t number_arguments, 2402% const double *arguments,const MagickBooleanType bestfit) 2403% 2404% A description of each parameter follows: 2405% 2406% o image: the image to be distorted. 2407% 2408% o method: the method of image distortion. 2409% 2410% ArcDistortion always ignores the source image offset, and always 2411% 'bestfit' the destination image with the top left corner offset 2412% relative to the polar mapping center. 2413% 2414% Bilinear has no simple inverse mapping so it does not allow 'bestfit' 2415% style of image distortion. 2416% 2417% Affine, Perspective, and Bilinear, do least squares fitting of the 2418% distortion when more than the minimum number of control point pairs 2419% are provided. 2420% 2421% Perspective, and Bilinear, falls back to a Affine distortion when less 2422% that 4 control point pairs are provided. While Affine distortions let 2423% you use any number of control point pairs, that is Zero pairs is a 2424% no-Op (viewport only) distrotion, one pair is a translation and two 2425% pairs of control points do a scale-rotate-translate, without any 2426% shearing. 2427% 2428% o number_arguments: the number of arguments given for this distortion 2429% method. 2430% 2431% o arguments: the arguments for this distortion method. 2432% 2433% o bestfit: Attempt to resize destination to fit distorted source. 2434% 2435*/ 2436WandExport MagickBooleanType MagickDistortImage(MagickWand *wand, 2437 const DistortImageMethod method,const size_t number_arguments, 2438 const double *arguments,const MagickBooleanType bestfit) 2439{ 2440 Image 2441 *distort_image; 2442 2443 assert(wand != (MagickWand *) NULL); 2444 assert(wand->signature == WandSignature); 2445 if (wand->debug != MagickFalse) 2446 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2447 if (wand->images == (Image *) NULL) 2448 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2449 distort_image=DistortImage(wand->images,method,number_arguments,arguments, 2450 bestfit,wand->exception); 2451 if (distort_image == (Image *) NULL) 2452 return(MagickFalse); 2453 ReplaceImageInList(&wand->images,distort_image); 2454 return(MagickTrue); 2455} 2456 2457/* 2458%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2459% % 2460% % 2461% % 2462% M a g i c k D r a w I m a g e % 2463% % 2464% % 2465% % 2466%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2467% 2468% MagickDrawImage() renders the drawing wand on the current image. 2469% 2470% The format of the MagickDrawImage method is: 2471% 2472% MagickBooleanType MagickDrawImage(MagickWand *wand, 2473% const DrawingWand *drawing_wand) 2474% 2475% A description of each parameter follows: 2476% 2477% o wand: the magick wand. 2478% 2479% o drawing_wand: the draw wand. 2480% 2481*/ 2482WandExport MagickBooleanType MagickDrawImage(MagickWand *wand, 2483 const DrawingWand *drawing_wand) 2484{ 2485 char 2486 *primitive; 2487 2488 DrawInfo 2489 *draw_info; 2490 2491 MagickBooleanType 2492 status; 2493 2494 assert(wand != (MagickWand *) NULL); 2495 assert(wand->signature == WandSignature); 2496 if (wand->debug != MagickFalse) 2497 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2498 if (wand->images == (Image *) NULL) 2499 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2500 draw_info=PeekDrawingWand(drawing_wand); 2501 if ((draw_info == (DrawInfo *) NULL) || 2502 (draw_info->primitive == (char *) NULL)) 2503 return(MagickFalse); 2504 primitive=AcquireString(draw_info->primitive); 2505 draw_info=DestroyDrawInfo(draw_info); 2506 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL); 2507 draw_info->primitive=primitive; 2508 status=DrawImage(wand->images,draw_info); 2509 if (status == MagickFalse) 2510 InheritException(wand->exception,&wand->images->exception); 2511 draw_info=DestroyDrawInfo(draw_info); 2512 return(status); 2513} 2514 2515/* 2516%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2517% % 2518% % 2519% % 2520% M a g i c k E d g e I m a g e % 2521% % 2522% % 2523% % 2524%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2525% 2526% MagickEdgeImage() enhance edges within the image with a convolution filter 2527% of the given radius. Use a radius of 0 and Edge() selects a suitable 2528% radius for you. 2529% 2530% The format of the MagickEdgeImage method is: 2531% 2532% MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius) 2533% 2534% A description of each parameter follows: 2535% 2536% o wand: the magick wand. 2537% 2538% o radius: the radius of the pixel neighborhood. 2539% 2540*/ 2541WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand, 2542 const double radius) 2543{ 2544 Image 2545 *edge_image; 2546 2547 assert(wand != (MagickWand *) NULL); 2548 assert(wand->signature == WandSignature); 2549 if (wand->debug != MagickFalse) 2550 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2551 if (wand->images == (Image *) NULL) 2552 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2553 edge_image=EdgeImage(wand->images,radius,wand->exception); 2554 if (edge_image == (Image *) NULL) 2555 return(MagickFalse); 2556 ReplaceImageInList(&wand->images,edge_image); 2557 return(MagickTrue); 2558} 2559 2560/* 2561%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2562% % 2563% % 2564% % 2565% M a g i c k E m b o s s I m a g e % 2566% % 2567% % 2568% % 2569%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2570% 2571% MagickEmbossImage() returns a grayscale image with a three-dimensional 2572% effect. We convolve the image with a Gaussian operator of the given radius 2573% and standard deviation (sigma). For reasonable results, radius should be 2574% larger than sigma. Use a radius of 0 and Emboss() selects a suitable 2575% radius for you. 2576% 2577% The format of the MagickEmbossImage method is: 2578% 2579% MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius, 2580% const double sigma) 2581% 2582% A description of each parameter follows: 2583% 2584% o wand: the magick wand. 2585% 2586% o radius: the radius of the Gaussian, in pixels, not counting the center 2587% pixel. 2588% 2589% o sigma: the standard deviation of the Gaussian, in pixels. 2590% 2591*/ 2592WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand, 2593 const double radius,const double sigma) 2594{ 2595 Image 2596 *emboss_image; 2597 2598 assert(wand != (MagickWand *) NULL); 2599 assert(wand->signature == WandSignature); 2600 if (wand->debug != MagickFalse) 2601 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2602 if (wand->images == (Image *) NULL) 2603 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2604 emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception); 2605 if (emboss_image == (Image *) NULL) 2606 return(MagickFalse); 2607 ReplaceImageInList(&wand->images,emboss_image); 2608 return(MagickTrue); 2609} 2610 2611/* 2612%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2613% % 2614% % 2615% % 2616% M a g i c k E n c i p h e r I m a g e % 2617% % 2618% % 2619% % 2620%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2621% 2622% MagickEncipherImage() converts plaint pixels to cipher pixels. 2623% 2624% The format of the MagickEncipherImage method is: 2625% 2626% MagickBooleanType MagickEncipherImage(MagickWand *wand, 2627% const char *passphrase) 2628% 2629% A description of each parameter follows: 2630% 2631% o wand: the magick wand. 2632% 2633% o passphrase: the passphrase. 2634% 2635*/ 2636WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand, 2637 const char *passphrase) 2638{ 2639 assert(wand != (MagickWand *) NULL); 2640 assert(wand->signature == WandSignature); 2641 if (wand->debug != MagickFalse) 2642 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2643 if (wand->images == (Image *) NULL) 2644 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2645 return(EncipherImage(wand->images,passphrase,&wand->images->exception)); 2646} 2647 2648/* 2649%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2650% % 2651% % 2652% % 2653% M a g i c k E n h a n c e I m a g e % 2654% % 2655% % 2656% % 2657%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2658% 2659% MagickEnhanceImage() applies a digital filter that improves the quality of a 2660% noisy image. 2661% 2662% The format of the MagickEnhanceImage method is: 2663% 2664% MagickBooleanType MagickEnhanceImage(MagickWand *wand) 2665% 2666% A description of each parameter follows: 2667% 2668% o wand: the magick wand. 2669% 2670*/ 2671WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand) 2672{ 2673 Image 2674 *enhance_image; 2675 2676 assert(wand != (MagickWand *) NULL); 2677 assert(wand->signature == WandSignature); 2678 if (wand->debug != MagickFalse) 2679 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2680 if (wand->images == (Image *) NULL) 2681 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2682 enhance_image=EnhanceImage(wand->images,wand->exception); 2683 if (enhance_image == (Image *) NULL) 2684 return(MagickFalse); 2685 ReplaceImageInList(&wand->images,enhance_image); 2686 return(MagickTrue); 2687} 2688 2689/* 2690%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2691% % 2692% % 2693% % 2694% M a g i c k E q u a l i z e I m a g e % 2695% % 2696% % 2697% % 2698%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2699% 2700% MagickEqualizeImage() equalizes the image histogram. 2701% 2702% The format of the MagickEqualizeImage method is: 2703% 2704% MagickBooleanType MagickEqualizeImage(MagickWand *wand) 2705% 2706% A description of each parameter follows: 2707% 2708% o wand: the magick wand. 2709% 2710% o channel: the image channel(s). 2711% 2712*/ 2713WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand) 2714{ 2715 MagickBooleanType 2716 status; 2717 2718 assert(wand != (MagickWand *) NULL); 2719 assert(wand->signature == WandSignature); 2720 if (wand->debug != MagickFalse) 2721 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2722 if (wand->images == (Image *) NULL) 2723 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2724 status=EqualizeImage(wand->images); 2725 if (status == MagickFalse) 2726 InheritException(wand->exception,&wand->images->exception); 2727 return(status); 2728} 2729 2730/* 2731%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2732% % 2733% % 2734% % 2735% M a g i c k E v a l u a t e I m a g e % 2736% % 2737% % 2738% % 2739%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2740% 2741% MagickEvaluateImage() applys an arithmetic, relational, or logical 2742% expression to an image. Use these operators to lighten or darken an image, 2743% to increase or decrease contrast in an image, or to produce the "negative" 2744% of an image. 2745% 2746% The format of the MagickEvaluateImage method is: 2747% 2748% MagickBooleanType MagickEvaluateImage(MagickWand *wand, 2749% const MagickEvaluateOperator operator,const double value) 2750% MagickBooleanType MagickEvaluateImages(MagickWand *wand, 2751% const MagickEvaluateOperator operator) 2752% 2753% A description of each parameter follows: 2754% 2755% o wand: the magick wand. 2756% 2757% o op: A channel operator. 2758% 2759% o value: A value value. 2760% 2761*/ 2762 2763WandExport MagickWand *MagickEvaluateImages(MagickWand *wand, 2764 const MagickEvaluateOperator op) 2765{ 2766 Image 2767 *evaluate_image; 2768 2769 assert(wand != (MagickWand *) NULL); 2770 assert(wand->signature == WandSignature); 2771 if (wand->debug != MagickFalse) 2772 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2773 if (wand->images == (Image *) NULL) 2774 return((MagickWand *) NULL); 2775 evaluate_image=EvaluateImages(wand->images,op,wand->exception); 2776 if (evaluate_image == (Image *) NULL) 2777 return((MagickWand *) NULL); 2778 return(CloneMagickWandFromImages(wand,evaluate_image)); 2779} 2780 2781WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand, 2782 const MagickEvaluateOperator op,const double value) 2783{ 2784 MagickBooleanType 2785 status; 2786 2787 assert(wand != (MagickWand *) NULL); 2788 assert(wand->signature == WandSignature); 2789 if (wand->debug != MagickFalse) 2790 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2791 if (wand->images == (Image *) NULL) 2792 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2793 status=EvaluateImage(wand->images,op,value,&wand->images->exception); 2794 return(status); 2795} 2796 2797/* 2798%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2799% % 2800% % 2801% % 2802% M a g i c k E x p o r t I m a g e P i x e l s % 2803% % 2804% % 2805% % 2806%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2807% 2808% MagickExportImagePixels() extracts pixel data from an image and returns it 2809% to you. The method returns MagickTrue on success otherwise MagickFalse if 2810% an error is encountered. The data is returned as char, short int, int, 2811% ssize_t, float, or double in the order specified by map. 2812% 2813% Suppose you want to extract the first scanline of a 640x480 image as 2814% character data in red-green-blue order: 2815% 2816% MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels); 2817% 2818% The format of the MagickExportImagePixels method is: 2819% 2820% MagickBooleanType MagickExportImagePixels(MagickWand *wand, 2821% const ssize_t x,const ssize_t y,const size_t columns, 2822% const size_t rows,const char *map,const StorageType storage, 2823% void *pixels) 2824% 2825% A description of each parameter follows: 2826% 2827% o wand: the magick wand. 2828% 2829% o x, y, columns, rows: These values define the perimeter 2830% of a region of pixels you want to extract. 2831% 2832% o map: This string reflects the expected ordering of the pixel array. 2833% It can be any combination or order of R = red, G = green, B = blue, 2834% A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, 2835% Y = yellow, M = magenta, K = black, I = intensity (for grayscale), 2836% P = pad. 2837% 2838% o storage: Define the data type of the pixels. Float and double types are 2839% expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from 2840% these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel, 2841% LongPixel, QuantumPixel, or ShortPixel. 2842% 2843% o pixels: This array of values contain the pixel components as defined by 2844% map and type. You must preallocate this array where the expected 2845% length varies depending on the values of width, height, map, and type. 2846% 2847*/ 2848WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand, 2849 const ssize_t x,const ssize_t y,const size_t columns, 2850 const size_t rows,const char *map,const StorageType storage, 2851 void *pixels) 2852{ 2853 MagickBooleanType 2854 status; 2855 2856 assert(wand != (MagickWand *) NULL); 2857 assert(wand->signature == WandSignature); 2858 if (wand->debug != MagickFalse) 2859 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2860 if (wand->images == (Image *) NULL) 2861 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2862 status=ExportImagePixels(wand->images,x,y,columns,rows,map, 2863 storage,pixels,wand->exception); 2864 if (status == MagickFalse) 2865 InheritException(wand->exception,&wand->images->exception); 2866 return(status); 2867} 2868 2869/* 2870%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2871% % 2872% % 2873% % 2874% M a g i c k E x t e n t I m a g e % 2875% % 2876% % 2877% % 2878%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2879% 2880% MagickExtentImage() extends the image as defined by the geometry, gravity, 2881% and wand background color. Set the (x,y) offset of the geometry to move 2882% the original wand relative to the extended wand. 2883% 2884% The format of the MagickExtentImage method is: 2885% 2886% MagickBooleanType MagickExtentImage(MagickWand *wand, 2887% const size_t width,const size_t height,const ssize_t x, 2888% const ssize_t y) 2889% 2890% A description of each parameter follows: 2891% 2892% o wand: the magick wand. 2893% 2894% o width: the region width. 2895% 2896% o height: the region height. 2897% 2898% o x: the region x offset. 2899% 2900% o y: the region y offset. 2901% 2902*/ 2903WandExport MagickBooleanType MagickExtentImage(MagickWand *wand, 2904 const size_t width,const size_t height,const ssize_t x, 2905 const ssize_t y) 2906{ 2907 Image 2908 *extent_image; 2909 2910 RectangleInfo 2911 extent; 2912 2913 assert(wand != (MagickWand *) NULL); 2914 assert(wand->signature == WandSignature); 2915 if (wand->debug != MagickFalse) 2916 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2917 if (wand->images == (Image *) NULL) 2918 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2919 extent.width=width; 2920 extent.height=height; 2921 extent.x=x; 2922 extent.y=y; 2923 extent_image=ExtentImage(wand->images,&extent,wand->exception); 2924 if (extent_image == (Image *) NULL) 2925 return(MagickFalse); 2926 ReplaceImageInList(&wand->images,extent_image); 2927 return(MagickTrue); 2928} 2929 2930/* 2931%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2932% % 2933% % 2934% % 2935% M a g i c k F l i p I m a g e % 2936% % 2937% % 2938% % 2939%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2940% 2941% MagickFlipImage() creates a vertical mirror image by reflecting the pixels 2942% around the central x-axis. 2943% 2944% The format of the MagickFlipImage method is: 2945% 2946% MagickBooleanType MagickFlipImage(MagickWand *wand) 2947% 2948% A description of each parameter follows: 2949% 2950% o wand: the magick wand. 2951% 2952*/ 2953WandExport MagickBooleanType MagickFlipImage(MagickWand *wand) 2954{ 2955 Image 2956 *flip_image; 2957 2958 assert(wand != (MagickWand *) NULL); 2959 assert(wand->signature == WandSignature); 2960 if (wand->debug != MagickFalse) 2961 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 2962 if (wand->images == (Image *) NULL) 2963 ThrowWandException(WandError,"ContainsNoImages",wand->name); 2964 flip_image=FlipImage(wand->images,wand->exception); 2965 if (flip_image == (Image *) NULL) 2966 return(MagickFalse); 2967 ReplaceImageInList(&wand->images,flip_image); 2968 return(MagickTrue); 2969} 2970 2971/* 2972%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2973% % 2974% % 2975% % 2976% M a g i c k F l o o d f i l l P a i n t I m a g e % 2977% % 2978% % 2979% % 2980%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2981% 2982% MagickFloodfillPaintImage() changes the color value of any pixel that matches 2983% target and is an immediate neighbor. If the method FillToBorderMethod is 2984% specified, the color value is changed for any neighbor pixel that does not 2985% match the bordercolor member of image. 2986% 2987% The format of the MagickFloodfillPaintImage method is: 2988% 2989% MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, 2990% const PixelWand *fill,const double fuzz,const PixelWand *bordercolor, 2991% const ssize_t x,const ssize_t y,const MagickBooleanType invert) 2992% 2993% A description of each parameter follows: 2994% 2995% o wand: the magick wand. 2996% 2997% o fill: the floodfill color pixel wand. 2998% 2999% o fuzz: By default target must match a particular pixel color 3000% exactly. However, in many cases two colors may differ by a small amount. 3001% The fuzz member of image defines how much tolerance is acceptable to 3002% consider two colors as the same. For example, set fuzz to 10 and the 3003% color red at intensities of 100 and 102 respectively are now interpreted 3004% as the same color for the purposes of the floodfill. 3005% 3006% o bordercolor: the border color pixel wand. 3007% 3008% o x,y: the starting location of the operation. 3009% 3010% o invert: paint any pixel that does not match the target color. 3011% 3012*/ 3013WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, 3014 const PixelWand *fill,const double fuzz,const PixelWand *bordercolor, 3015 const ssize_t x,const ssize_t y,const MagickBooleanType invert) 3016{ 3017 DrawInfo 3018 *draw_info; 3019 3020 MagickBooleanType 3021 status; 3022 3023 PixelInfo 3024 target; 3025 3026 assert(wand != (MagickWand *) NULL); 3027 assert(wand->signature == WandSignature); 3028 if (wand->debug != MagickFalse) 3029 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3030 if (wand->images == (Image *) NULL) 3031 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3032 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL); 3033 PixelGetQuantumPacket(fill,&draw_info->fill); 3034 (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns, 3035 y % wand->images->rows,&target,wand->exception); 3036 if (bordercolor != (PixelWand *) NULL) 3037 PixelGetMagickColor(bordercolor,&target); 3038 wand->images->fuzz=fuzz; 3039 status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert); 3040 if (status == MagickFalse) 3041 InheritException(wand->exception,&wand->images->exception); 3042 draw_info=DestroyDrawInfo(draw_info); 3043 return(status); 3044} 3045 3046/* 3047%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3048% % 3049% % 3050% % 3051% M a g i c k F l o p I m a g e % 3052% % 3053% % 3054% % 3055%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3056% 3057% MagickFlopImage() creates a horizontal mirror image by reflecting the pixels 3058% around the central y-axis. 3059% 3060% The format of the MagickFlopImage method is: 3061% 3062% MagickBooleanType MagickFlopImage(MagickWand *wand) 3063% 3064% A description of each parameter follows: 3065% 3066% o wand: the magick wand. 3067% 3068*/ 3069WandExport MagickBooleanType MagickFlopImage(MagickWand *wand) 3070{ 3071 Image 3072 *flop_image; 3073 3074 assert(wand != (MagickWand *) NULL); 3075 assert(wand->signature == WandSignature); 3076 if (wand->debug != MagickFalse) 3077 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3078 if (wand->images == (Image *) NULL) 3079 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3080 flop_image=FlopImage(wand->images,wand->exception); 3081 if (flop_image == (Image *) NULL) 3082 return(MagickFalse); 3083 ReplaceImageInList(&wand->images,flop_image); 3084 return(MagickTrue); 3085} 3086 3087/* 3088%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3089% % 3090% % 3091% % 3092% M a g i c k F o u r i e r T r a n s f o r m I m a g e % 3093% % 3094% % 3095% % 3096%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3097% 3098% MagickForwardFourierTransformImage() implements the discrete Fourier 3099% transform (DFT) of the image either as a magnitude / phase or real / 3100% imaginary image pair. 3101% 3102% The format of the MagickForwardFourierTransformImage method is: 3103% 3104% MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand, 3105% const MagickBooleanType magnitude) 3106% 3107% A description of each parameter follows: 3108% 3109% o wand: the magick wand. 3110% 3111% o magnitude: if true, return as magnitude / phase pair otherwise a real / 3112% imaginary image pair. 3113% 3114*/ 3115WandExport MagickBooleanType MagickForwardFourierTransformImage( 3116 MagickWand *wand,const MagickBooleanType magnitude) 3117{ 3118 Image 3119 *forward_image; 3120 3121 assert(wand != (MagickWand *) NULL); 3122 assert(wand->signature == WandSignature); 3123 if (wand->debug != MagickFalse) 3124 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3125 if (wand->images == (Image *) NULL) 3126 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3127 forward_image=ForwardFourierTransformImage(wand->images,magnitude, 3128 wand->exception); 3129 if (forward_image == (Image *) NULL) 3130 return(MagickFalse); 3131 ReplaceImageInList(&wand->images,forward_image); 3132 return(MagickTrue); 3133} 3134 3135/* 3136%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3137% % 3138% % 3139% % 3140% M a g i c k F r a m e I m a g e % 3141% % 3142% % 3143% % 3144%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3145% 3146% MagickFrameImage() adds a simulated three-dimensional border around the 3147% image. The width and height specify the border width of the vertical and 3148% horizontal sides of the frame. The inner and outer bevels indicate the 3149% width of the inner and outer shadows of the frame. 3150% 3151% The format of the MagickFrameImage method is: 3152% 3153% MagickBooleanType MagickFrameImage(MagickWand *wand, 3154% const PixelWand *matte_color,const size_t width, 3155% const size_t height,const ssize_t inner_bevel, 3156% const ssize_t outer_bevel) 3157% 3158% A description of each parameter follows: 3159% 3160% o wand: the magick wand. 3161% 3162% o matte_color: the frame color pixel wand. 3163% 3164% o width: the border width. 3165% 3166% o height: the border height. 3167% 3168% o inner_bevel: the inner bevel width. 3169% 3170% o outer_bevel: the outer bevel width. 3171% 3172*/ 3173WandExport MagickBooleanType MagickFrameImage(MagickWand *wand, 3174 const PixelWand *matte_color,const size_t width, 3175 const size_t height,const ssize_t inner_bevel,const ssize_t outer_bevel) 3176{ 3177 Image 3178 *frame_image; 3179 3180 FrameInfo 3181 frame_info; 3182 3183 assert(wand != (MagickWand *) NULL); 3184 assert(wand->signature == WandSignature); 3185 if (wand->debug != MagickFalse) 3186 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3187 if (wand->images == (Image *) NULL) 3188 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3189 (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info)); 3190 frame_info.width=wand->images->columns+2*width; 3191 frame_info.height=wand->images->rows+2*height; 3192 frame_info.x=(ssize_t) width; 3193 frame_info.y=(ssize_t) height; 3194 frame_info.inner_bevel=inner_bevel; 3195 frame_info.outer_bevel=outer_bevel; 3196 PixelGetQuantumPacket(matte_color,&wand->images->matte_color); 3197 frame_image=FrameImage(wand->images,&frame_info,wand->exception); 3198 if (frame_image == (Image *) NULL) 3199 return(MagickFalse); 3200 ReplaceImageInList(&wand->images,frame_image); 3201 return(MagickTrue); 3202} 3203 3204/* 3205%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3206% % 3207% % 3208% % 3209% M a g i c k F u n c t i o n I m a g e % 3210% % 3211% % 3212% % 3213%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3214% 3215% MagickFunctionImage() applys an arithmetic, relational, or logical 3216% expression to an image. Use these operators to lighten or darken an image, 3217% to increase or decrease contrast in an image, or to produce the "negative" 3218% of an image. 3219% 3220% The format of the MagickFunctionImage method is: 3221% 3222% MagickBooleanType MagickFunctionImage(MagickWand *wand, 3223% const MagickFunction function,const size_t number_arguments, 3224% const double *arguments) 3225% 3226% A description of each parameter follows: 3227% 3228% o wand: the magick wand. 3229% 3230% o function: the image function. 3231% 3232% o number_arguments: the number of function arguments. 3233% 3234% o arguments: the function arguments. 3235% 3236*/ 3237WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand, 3238 const MagickFunction function,const size_t number_arguments, 3239 const double *arguments) 3240{ 3241 MagickBooleanType 3242 status; 3243 3244 assert(wand != (MagickWand *) NULL); 3245 assert(wand->signature == WandSignature); 3246 if (wand->debug != MagickFalse) 3247 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3248 if (wand->images == (Image *) NULL) 3249 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3250 status=FunctionImage(wand->images,function,number_arguments,arguments, 3251 &wand->images->exception); 3252 return(status); 3253} 3254 3255/* 3256%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3257% % 3258% % 3259% % 3260% M a g i c k F x I m a g e % 3261% % 3262% % 3263% % 3264%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3265% 3266% MagickFxImage() evaluate expression for each pixel in the image. 3267% 3268% The format of the MagickFxImage method is: 3269% 3270% MagickWand *MagickFxImage(MagickWand *wand,const char *expression) 3271% 3272% A description of each parameter follows: 3273% 3274% o wand: the magick wand. 3275% 3276% o expression: the expression. 3277% 3278*/ 3279WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression) 3280{ 3281 Image 3282 *fx_image; 3283 3284 assert(wand != (MagickWand *) NULL); 3285 assert(wand->signature == WandSignature); 3286 if (wand->debug != MagickFalse) 3287 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3288 if (wand->images == (Image *) NULL) 3289 return((MagickWand *) NULL); 3290 fx_image=FxImage(wand->images,expression,wand->exception); 3291 if (fx_image == (Image *) NULL) 3292 return((MagickWand *) NULL); 3293 return(CloneMagickWandFromImages(wand,fx_image)); 3294} 3295 3296/* 3297%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3298% % 3299% % 3300% % 3301% M a g i c k G a m m a I m a g e % 3302% % 3303% % 3304% % 3305%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3306% 3307% MagickGammaImage() gamma-corrects an image. The same image viewed on 3308% different devices will have perceptual differences in the way the image's 3309% intensities are represented on the screen. Specify individual gamma levels 3310% for the red, green, and blue channels, or adjust all three with the gamma 3311% parameter. Values typically range from 0.8 to 2.3. 3312% 3313% You can also reduce the influence of a particular channel with a gamma 3314% value of 0. 3315% 3316% The format of the MagickGammaImage method is: 3317% 3318% MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma) 3319% 3320% A description of each parameter follows: 3321% 3322% o wand: the magick wand. 3323% 3324% o level: Define the level of gamma correction. 3325% 3326*/ 3327WandExport MagickBooleanType MagickGammaImage(MagickWand *wand, 3328 const double gamma) 3329{ 3330 MagickBooleanType 3331 status; 3332 3333 assert(wand != (MagickWand *) NULL); 3334 assert(wand->signature == WandSignature); 3335 if (wand->debug != MagickFalse) 3336 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3337 if (wand->images == (Image *) NULL) 3338 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3339 status=GammaImage(wand->images,gamma); 3340 if (status == MagickFalse) 3341 InheritException(wand->exception,&wand->images->exception); 3342 return(status); 3343} 3344 3345/* 3346%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3347% % 3348% % 3349% % 3350% M a g i c k G a u s s i a n B l u r I m a g e % 3351% % 3352% % 3353% % 3354%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3355% 3356% MagickGaussianBlurImage() blurs an image. We convolve the image with a 3357% Gaussian operator of the given radius and standard deviation (sigma). 3358% For reasonable results, the radius should be larger than sigma. Use a 3359% radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you. 3360% 3361% The format of the MagickGaussianBlurImage method is: 3362% 3363% MagickBooleanType MagickGaussianBlurImage(MagickWand *wand, 3364% const double radius,const double sigma) 3365% 3366% A description of each parameter follows: 3367% 3368% o wand: the magick wand. 3369% 3370% o radius: the radius of the Gaussian, in pixels, not counting the center 3371% pixel. 3372% 3373% o sigma: the standard deviation of the Gaussian, in pixels. 3374% 3375*/ 3376WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand, 3377 const double radius,const double sigma) 3378{ 3379 Image 3380 *blur_image; 3381 3382 assert(wand != (MagickWand *) NULL); 3383 assert(wand->signature == WandSignature); 3384 if (wand->debug != MagickFalse) 3385 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3386 if (wand->images == (Image *) NULL) 3387 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3388 blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception); 3389 if (blur_image == (Image *) NULL) 3390 return(MagickFalse); 3391 ReplaceImageInList(&wand->images,blur_image); 3392 return(MagickTrue); 3393} 3394 3395/* 3396%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3397% % 3398% % 3399% % 3400% M a g i c k G e t I m a g e % 3401% % 3402% % 3403% % 3404%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3405% 3406% MagickGetImage() gets the image at the current image index. 3407% 3408% The format of the MagickGetImage method is: 3409% 3410% MagickWand *MagickGetImage(MagickWand *wand) 3411% 3412% A description of each parameter follows: 3413% 3414% o wand: the magick wand. 3415% 3416*/ 3417WandExport MagickWand *MagickGetImage(MagickWand *wand) 3418{ 3419 Image 3420 *image; 3421 3422 assert(wand != (MagickWand *) NULL); 3423 assert(wand->signature == WandSignature); 3424 if (wand->debug != MagickFalse) 3425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3426 if (wand->images == (Image *) NULL) 3427 { 3428 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 3429 "ContainsNoImages","`%s'",wand->name); 3430 return((MagickWand *) NULL); 3431 } 3432 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); 3433 if (image == (Image *) NULL) 3434 return((MagickWand *) NULL); 3435 return(CloneMagickWandFromImages(wand,image)); 3436} 3437 3438/* 3439%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3440% % 3441% % 3442% % 3443% M a g i c k G e t I m a g e A l p h a C h a n n e l % 3444% % 3445% % 3446% % 3447%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3448% 3449% MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel 3450% is not activated. That is, the image is RGB rather than RGBA or CMYK rather 3451% than CMYKA. 3452% 3453% The format of the MagickGetImageAlphaChannel method is: 3454% 3455% size_t MagickGetImageAlphaChannel(MagickWand *wand) 3456% 3457% A description of each parameter follows: 3458% 3459% o wand: the magick wand. 3460% 3461*/ 3462WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand) 3463{ 3464 assert(wand != (MagickWand *) NULL); 3465 assert(wand->signature == WandSignature); 3466 if (wand->debug != MagickFalse) 3467 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3468 if (wand->images == (Image *) NULL) 3469 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3470 return(GetImageAlphaChannel(wand->images)); 3471} 3472 3473/* 3474%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3475% % 3476% % 3477% % 3478% M a g i c k G e t I m a g e C l i p M a s k % 3479% % 3480% % 3481% % 3482%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3483% 3484% MagickGetImageClipMask() gets the image clip mask at the current image index. 3485% 3486% The format of the MagickGetImageClipMask method is: 3487% 3488% MagickWand *MagickGetImageClipMask(MagickWand *wand) 3489% 3490% A description of each parameter follows: 3491% 3492% o wand: the magick wand. 3493% 3494*/ 3495WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand) 3496{ 3497 Image 3498 *image; 3499 3500 assert(wand != (MagickWand *) NULL); 3501 assert(wand->signature == WandSignature); 3502 if (wand->debug != MagickFalse) 3503 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3504 if (wand->images == (Image *) NULL) 3505 { 3506 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 3507 "ContainsNoImages","`%s'",wand->name); 3508 return((MagickWand *) NULL); 3509 } 3510 image=GetImageClipMask(wand->images,wand->exception); 3511 if (image == (Image *) NULL) 3512 return((MagickWand *) NULL); 3513 return(CloneMagickWandFromImages(wand,image)); 3514} 3515 3516/* 3517%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3518% % 3519% % 3520% % 3521% M a g i c k G e t I m a g e B a c k g r o u n d C o l o r % 3522% % 3523% % 3524% % 3525%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3526% 3527% MagickGetImageBackgroundColor() returns the image background color. 3528% 3529% The format of the MagickGetImageBackgroundColor method is: 3530% 3531% MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand, 3532% PixelWand *background_color) 3533% 3534% A description of each parameter follows: 3535% 3536% o wand: the magick wand. 3537% 3538% o background_color: Return the background color. 3539% 3540*/ 3541WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand, 3542 PixelWand *background_color) 3543{ 3544 assert(wand != (MagickWand *) NULL); 3545 assert(wand->signature == WandSignature); 3546 if (wand->debug != MagickFalse) 3547 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3548 if (wand->images == (Image *) NULL) 3549 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3550 PixelSetQuantumPacket(background_color,&wand->images->background_color); 3551 return(MagickTrue); 3552} 3553 3554/* 3555%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3556% % 3557% % 3558% % 3559% M a g i c k G e t I m a g e B l o b % 3560% % 3561% % 3562% % 3563%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3564% 3565% MagickGetImageBlob() implements direct to memory image formats. It returns 3566% the image as a blob (a formatted "file" in memory) and its length, starting 3567% from the current position in the image sequence. Use MagickSetImageFormat() 3568% to set the format to write to the blob (GIF, JPEG, PNG, etc.). 3569% 3570% Utilize MagickResetIterator() to ensure the write is from the beginning of 3571% the image sequence. 3572% 3573% Use MagickRelinquishMemory() to free the blob when you are done with it. 3574% 3575% The format of the MagickGetImageBlob method is: 3576% 3577% unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length) 3578% 3579% A description of each parameter follows: 3580% 3581% o wand: the magick wand. 3582% 3583% o length: the length of the blob. 3584% 3585*/ 3586WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length) 3587{ 3588 assert(wand != (MagickWand *) NULL); 3589 assert(wand->signature == WandSignature); 3590 if (wand->debug != MagickFalse) 3591 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3592 if (wand->images == (Image *) NULL) 3593 { 3594 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 3595 "ContainsNoImages","`%s'",wand->name); 3596 return((unsigned char *) NULL); 3597 } 3598 return(ImageToBlob(wand->image_info,wand->images,length,wand->exception)); 3599} 3600 3601/* 3602%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3603% % 3604% % 3605% % 3606% M a g i c k G e t I m a g e s B l o b % 3607% % 3608% % 3609% % 3610%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3611% 3612% MagickGetImageBlob() implements direct to memory image formats. It 3613% returns the image sequence as a blob and its length. The format of the image 3614% determines the format of the returned blob (GIF, JPEG, PNG, etc.). To 3615% return a different image format, use MagickSetImageFormat(). 3616% 3617% Note, some image formats do not permit multiple images to the same image 3618% stream (e.g. JPEG). in this instance, just the first image of the 3619% sequence is returned as a blob. 3620% 3621% The format of the MagickGetImagesBlob method is: 3622% 3623% unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length) 3624% 3625% A description of each parameter follows: 3626% 3627% o wand: the magick wand. 3628% 3629% o length: the length of the blob. 3630% 3631*/ 3632WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length) 3633{ 3634 unsigned char 3635 *blob; 3636 3637 assert(wand != (MagickWand *) NULL); 3638 assert(wand->signature == WandSignature); 3639 if (wand->debug != MagickFalse) 3640 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3641 if (wand->images == (Image *) NULL) 3642 { 3643 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 3644 "ContainsNoImages","`%s'",wand->name); 3645 return((unsigned char *) NULL); 3646 } 3647 blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length, 3648 wand->exception); 3649 return(blob); 3650} 3651 3652/* 3653%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3654% % 3655% % 3656% % 3657% M a g i c k G e t I m a g e B l u e P r i m a r y % 3658% % 3659% % 3660% % 3661%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3662% 3663% MagickGetImageBluePrimary() returns the chromaticy blue primary point for the 3664% image. 3665% 3666% The format of the MagickGetImageBluePrimary method is: 3667% 3668% MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x, 3669% double *y) 3670% 3671% A description of each parameter follows: 3672% 3673% o wand: the magick wand. 3674% 3675% o x: the chromaticity blue primary x-point. 3676% 3677% o y: the chromaticity blue primary y-point. 3678% 3679*/ 3680WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand, 3681 double *x,double *y) 3682{ 3683 assert(wand != (MagickWand *) NULL); 3684 assert(wand->signature == WandSignature); 3685 if (wand->debug != MagickFalse) 3686 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3687 if (wand->images == (Image *) NULL) 3688 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3689 *x=wand->images->chromaticity.blue_primary.x; 3690 *y=wand->images->chromaticity.blue_primary.y; 3691 return(MagickTrue); 3692} 3693 3694/* 3695%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3696% % 3697% % 3698% % 3699% M a g i c k G e t I m a g e B o r d e r C o l o r % 3700% % 3701% % 3702% % 3703%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3704% 3705% MagickGetImageBorderColor() returns the image border color. 3706% 3707% The format of the MagickGetImageBorderColor method is: 3708% 3709% MagickBooleanType MagickGetImageBorderColor(MagickWand *wand, 3710% PixelWand *border_color) 3711% 3712% A description of each parameter follows: 3713% 3714% o wand: the magick wand. 3715% 3716% o border_color: Return the border color. 3717% 3718*/ 3719WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand, 3720 PixelWand *border_color) 3721{ 3722 assert(wand != (MagickWand *) NULL); 3723 assert(wand->signature == WandSignature); 3724 if (wand->debug != MagickFalse) 3725 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3726 if (wand->images == (Image *) NULL) 3727 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3728 PixelSetQuantumPacket(border_color,&wand->images->border_color); 3729 return(MagickTrue); 3730} 3731 3732/* 3733%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3734% % 3735% % 3736% % 3737% M a g i c k G e t I m a g e F e a t u r e s % 3738% % 3739% % 3740% % 3741%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3742% 3743% MagickGetImageFeatures() returns features for each channel in the 3744% image in each of four directions (horizontal, vertical, left and right 3745% diagonals) for the specified distance. The features include the angular 3746% second moment, contrast, correlation, sum of squares: variance, inverse 3747% difference moment, sum average, sum varience, sum entropy, entropy, 3748% difference variance, difference entropy, information measures of 3749% correlation 1, information measures of correlation 2, and maximum 3750% correlation coefficient. You can access the red channel contrast, for 3751% example, like this: 3752% 3753% channel_features=MagickGetImageFeatures(wand,1); 3754% contrast=channel_features[RedChannel].contrast[0]; 3755% 3756% Use MagickRelinquishMemory() to free the statistics buffer. 3757% 3758% The format of the MagickGetImageFeatures method is: 3759% 3760% ChannelFeatures *MagickGetImageFeatures(MagickWand *wand, 3761% const size_t distance) 3762% 3763% A description of each parameter follows: 3764% 3765% o wand: the magick wand. 3766% 3767% o distance: the distance. 3768% 3769*/ 3770WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand, 3771 const size_t distance) 3772{ 3773 assert(wand != (MagickWand *) NULL); 3774 assert(wand->signature == WandSignature); 3775 if (wand->debug != MagickFalse) 3776 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3777 if (wand->images == (Image *) NULL) 3778 { 3779 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 3780 "ContainsNoImages","`%s'",wand->name); 3781 return((ChannelFeatures *) NULL); 3782 } 3783 return(GetImageFeatures(wand->images,distance,wand->exception)); 3784} 3785 3786/* 3787%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3788% % 3789% % 3790% % 3791% M a g i c k G e t I m a g e K u r t o s i s % 3792% % 3793% % 3794% % 3795%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3796% 3797% MagickGetImageKurtosis() gets the kurtosis and skewness of one or 3798% more image channels. 3799% 3800% The format of the MagickGetImageKurtosis method is: 3801% 3802% MagickBooleanType MagickGetImageKurtosis(MagickWand *wand, 3803% double *kurtosis,double *skewness) 3804% 3805% A description of each parameter follows: 3806% 3807% o wand: the magick wand. 3808% 3809% o kurtosis: The kurtosis for the specified channel(s). 3810% 3811% o skewness: The skewness for the specified channel(s). 3812% 3813*/ 3814WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand, 3815 double *kurtosis,double *skewness) 3816{ 3817 MagickBooleanType 3818 status; 3819 3820 assert(wand != (MagickWand *) NULL); 3821 assert(wand->signature == WandSignature); 3822 if (wand->debug != MagickFalse) 3823 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3824 if (wand->images == (Image *) NULL) 3825 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3826 status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception); 3827 return(status); 3828} 3829 3830/* 3831%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3832% % 3833% % 3834% % 3835% M a g i c k G e t I m a g e M e a n % 3836% % 3837% % 3838% % 3839%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3840% 3841% MagickGetImageMean() gets the mean and standard deviation of one or more 3842% image channels. 3843% 3844% The format of the MagickGetImageMean method is: 3845% 3846% MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean, 3847% double *standard_deviation) 3848% 3849% A description of each parameter follows: 3850% 3851% o wand: the magick wand. 3852% 3853% o channel: the image channel(s). 3854% 3855% o mean: The mean pixel value for the specified channel(s). 3856% 3857% o standard_deviation: The standard deviation for the specified channel(s). 3858% 3859*/ 3860WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean, 3861 double *standard_deviation) 3862{ 3863 MagickBooleanType 3864 status; 3865 3866 assert(wand != (MagickWand *) NULL); 3867 assert(wand->signature == WandSignature); 3868 if (wand->debug != MagickFalse) 3869 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3870 if (wand->images == (Image *) NULL) 3871 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3872 status=GetImageMean(wand->images,mean,standard_deviation,wand->exception); 3873 return(status); 3874} 3875 3876/* 3877%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3878% % 3879% % 3880% % 3881% M a g i c k G e t I m a g e R a n g e % 3882% % 3883% % 3884% % 3885%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3886% 3887% MagickGetImageRange() gets the range for one or more image channels. 3888% 3889% The format of the MagickGetImageRange method is: 3890% 3891% MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima, 3892% double *maxima) 3893% 3894% A description of each parameter follows: 3895% 3896% o wand: the magick wand. 3897% 3898% o minima: The minimum pixel value for the specified channel(s). 3899% 3900% o maxima: The maximum pixel value for the specified channel(s). 3901% 3902*/ 3903WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand, 3904 double *minima,double *maxima) 3905{ 3906 MagickBooleanType 3907 status; 3908 3909 assert(wand != (MagickWand *) NULL); 3910 assert(wand->signature == WandSignature); 3911 if (wand->debug != MagickFalse) 3912 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3913 if (wand->images == (Image *) NULL) 3914 ThrowWandException(WandError,"ContainsNoImages",wand->name); 3915 status=GetImageRange(wand->images,minima,maxima,wand->exception); 3916 return(status); 3917} 3918 3919/* 3920%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3921% % 3922% % 3923% % 3924% M a g i c k G e t I m a g e S t a t i s t i c s % 3925% % 3926% % 3927% % 3928%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3929% 3930% MagickGetImageStatistics() returns statistics for each channel in the 3931% image. The statistics include the channel depth, its minima and 3932% maxima, the mean, the standard deviation, the kurtosis and the skewness. 3933% You can access the red channel mean, for example, like this: 3934% 3935% channel_statistics=MagickGetImageStatistics(wand); 3936% red_mean=channel_statistics[RedChannel].mean; 3937% 3938% Use MagickRelinquishMemory() to free the statistics buffer. 3939% 3940% The format of the MagickGetImageStatistics method is: 3941% 3942% ChannelStatistics *MagickGetImageStatistics(MagickWand *wand) 3943% 3944% A description of each parameter follows: 3945% 3946% o wand: the magick wand. 3947% 3948*/ 3949WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand) 3950{ 3951 assert(wand != (MagickWand *) NULL); 3952 assert(wand->signature == WandSignature); 3953 if (wand->debug != MagickFalse) 3954 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3955 if (wand->images == (Image *) NULL) 3956 { 3957 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 3958 "ContainsNoImages","`%s'",wand->name); 3959 return((ChannelStatistics *) NULL); 3960 } 3961 return(GetImageStatistics(wand->images,wand->exception)); 3962} 3963 3964/* 3965%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3966% % 3967% % 3968% % 3969% M a g i c k G e t I m a g e C o l o r m a p C o l o r % 3970% % 3971% % 3972% % 3973%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3974% 3975% MagickGetImageColormapColor() returns the color of the specified colormap 3976% index. 3977% 3978% The format of the MagickGetImageColormapColor method is: 3979% 3980% MagickBooleanType MagickGetImageColormapColor(MagickWand *wand, 3981% const size_t index,PixelWand *color) 3982% 3983% A description of each parameter follows: 3984% 3985% o wand: the magick wand. 3986% 3987% o index: the offset into the image colormap. 3988% 3989% o color: Return the colormap color in this wand. 3990% 3991*/ 3992WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand, 3993 const size_t index,PixelWand *color) 3994{ 3995 assert(wand != (MagickWand *) NULL); 3996 assert(wand->signature == WandSignature); 3997 if (wand->debug != MagickFalse) 3998 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 3999 if (wand->images == (Image *) NULL) 4000 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4001 if ((wand->images->colormap == (PixelPacket *) NULL) || 4002 (index >= wand->images->colors)) 4003 { 4004 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4005 "InvalidColormapIndex","`%s'",wand->name); 4006 return(MagickFalse); 4007 } 4008 PixelSetQuantumPacket(color,wand->images->colormap+index); 4009 return(MagickTrue); 4010} 4011 4012/* 4013%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4014% % 4015% % 4016% % 4017% M a g i c k G e t I m a g e C o l o r s % 4018% % 4019% % 4020% % 4021%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4022% 4023% MagickGetImageColors() gets the number of unique colors in the image. 4024% 4025% The format of the MagickGetImageColors method is: 4026% 4027% size_t MagickGetImageColors(MagickWand *wand) 4028% 4029% A description of each parameter follows: 4030% 4031% o wand: the magick wand. 4032% 4033*/ 4034WandExport size_t MagickGetImageColors(MagickWand *wand) 4035{ 4036 assert(wand != (MagickWand *) NULL); 4037 assert(wand->signature == WandSignature); 4038 if (wand->debug != MagickFalse) 4039 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4040 if (wand->images == (Image *) NULL) 4041 { 4042 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4043 "ContainsNoImages","`%s'",wand->name); 4044 return(0); 4045 } 4046 return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception)); 4047} 4048 4049/* 4050%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4051% % 4052% % 4053% % 4054% M a g i c k G e t I m a g e C o l o r s p a c e % 4055% % 4056% % 4057% % 4058%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4059% 4060% MagickGetImageColorspace() gets the image colorspace. 4061% 4062% The format of the MagickGetImageColorspace method is: 4063% 4064% ColorspaceType MagickGetImageColorspace(MagickWand *wand) 4065% 4066% A description of each parameter follows: 4067% 4068% o wand: the magick wand. 4069% 4070*/ 4071WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand) 4072{ 4073 assert(wand != (MagickWand *) NULL); 4074 assert(wand->signature == WandSignature); 4075 if (wand->debug != MagickFalse) 4076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4077 if (wand->images == (Image *) NULL) 4078 { 4079 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4080 "ContainsNoImages","`%s'",wand->name); 4081 return(UndefinedColorspace); 4082 } 4083 return(wand->images->colorspace); 4084} 4085 4086/* 4087%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4088% % 4089% % 4090% % 4091% M a g i c k G e t I m a g e C o m p o s e % 4092% % 4093% % 4094% % 4095%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4096% 4097% MagickGetImageCompose() returns the composite operator associated with the 4098% image. 4099% 4100% The format of the MagickGetImageCompose method is: 4101% 4102% CompositeOperator MagickGetImageCompose(MagickWand *wand) 4103% 4104% A description of each parameter follows: 4105% 4106% o wand: the magick wand. 4107% 4108*/ 4109WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand) 4110{ 4111 assert(wand != (MagickWand *) NULL); 4112 assert(wand->signature == WandSignature); 4113 if (wand->debug != MagickFalse) 4114 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4115 if (wand->images == (Image *) NULL) 4116 { 4117 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4118 "ContainsNoImages","`%s'",wand->name); 4119 return(UndefinedCompositeOp); 4120 } 4121 return(wand->images->compose); 4122} 4123 4124/* 4125%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4126% % 4127% % 4128% % 4129% M a g i c k G e t I m a g e C o m p r e s s i o n % 4130% % 4131% % 4132% % 4133%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4134% 4135% MagickGetImageCompression() gets the image compression. 4136% 4137% The format of the MagickGetImageCompression method is: 4138% 4139% CompressionType MagickGetImageCompression(MagickWand *wand) 4140% 4141% A description of each parameter follows: 4142% 4143% o wand: the magick wand. 4144% 4145*/ 4146WandExport CompressionType MagickGetImageCompression(MagickWand *wand) 4147{ 4148 assert(wand != (MagickWand *) NULL); 4149 assert(wand->signature == WandSignature); 4150 if (wand->debug != MagickFalse) 4151 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4152 if (wand->images == (Image *) NULL) 4153 { 4154 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4155 "ContainsNoImages","`%s'",wand->name); 4156 return(UndefinedCompression); 4157 } 4158 return(wand->images->compression); 4159} 4160 4161/* 4162%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4163% % 4164% % 4165% % 4166% M a g i c k G e t I m a g e C o m p r e s s i o n Q u a l i t y % 4167% % 4168% % 4169% % 4170%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4171% 4172% MagickGetImageCompression() gets the image compression quality. 4173% 4174% The format of the MagickGetImageCompression method is: 4175% 4176% size_t MagickGetImageCompression(MagickWand *wand) 4177% 4178% A description of each parameter follows: 4179% 4180% o wand: the magick wand. 4181% 4182*/ 4183WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand) 4184{ 4185 assert(wand != (MagickWand *) NULL); 4186 assert(wand->signature == WandSignature); 4187 if (wand->debug != MagickFalse) 4188 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4189 if (wand->images == (Image *) NULL) 4190 { 4191 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4192 "ContainsNoImages","`%s'",wand->name); 4193 return(0UL); 4194 } 4195 return(wand->images->quality); 4196} 4197 4198/* 4199%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4200% % 4201% % 4202% % 4203% M a g i c k G e t I m a g e D e l a y % 4204% % 4205% % 4206% % 4207%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4208% 4209% MagickGetImageDelay() gets the image delay. 4210% 4211% The format of the MagickGetImageDelay method is: 4212% 4213% size_t MagickGetImageDelay(MagickWand *wand) 4214% 4215% A description of each parameter follows: 4216% 4217% o wand: the magick wand. 4218% 4219*/ 4220WandExport size_t MagickGetImageDelay(MagickWand *wand) 4221{ 4222 assert(wand != (MagickWand *) NULL); 4223 assert(wand->signature == WandSignature); 4224 if (wand->debug != MagickFalse) 4225 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4226 if (wand->images == (Image *) NULL) 4227 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4228 return(wand->images->delay); 4229} 4230 4231/* 4232%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4233% % 4234% % 4235% % 4236% M a g i c k G e t I m a g e D e p t h % 4237% % 4238% % 4239% % 4240%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4241% 4242% MagickGetImageDepth() gets the image depth. 4243% 4244% The format of the MagickGetImageDepth method is: 4245% 4246% size_t MagickGetImageDepth(MagickWand *wand) 4247% 4248% A description of each parameter follows: 4249% 4250% o wand: the magick wand. 4251% 4252*/ 4253WandExport size_t MagickGetImageDepth(MagickWand *wand) 4254{ 4255 assert(wand != (MagickWand *) NULL); 4256 assert(wand->signature == WandSignature); 4257 if (wand->debug != MagickFalse) 4258 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4259 if (wand->images == (Image *) NULL) 4260 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4261 return(GetImageDepth(wand->images,wand->exception)); 4262} 4263 4264/* 4265%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4266% % 4267% % 4268% % 4269% M a g i c k G e t I m a g e D i s p o s e % 4270% % 4271% % 4272% % 4273%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4274% 4275% MagickGetImageDispose() gets the image disposal method. 4276% 4277% The format of the MagickGetImageDispose method is: 4278% 4279% DisposeType MagickGetImageDispose(MagickWand *wand) 4280% 4281% A description of each parameter follows: 4282% 4283% o wand: the magick wand. 4284% 4285*/ 4286WandExport DisposeType MagickGetImageDispose(MagickWand *wand) 4287{ 4288 assert(wand != (MagickWand *) NULL); 4289 assert(wand->signature == WandSignature); 4290 if (wand->debug != MagickFalse) 4291 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4292 if (wand->images == (Image *) NULL) 4293 { 4294 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4295 "ContainsNoImages","`%s'",wand->name); 4296 return(UndefinedDispose); 4297 } 4298 return((DisposeType) wand->images->dispose); 4299} 4300 4301/* 4302%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4303% % 4304% % 4305% % 4306% M a g i c k G e t I m a g e D i s t o r t i o n % 4307% % 4308% % 4309% % 4310%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4311% 4312% MagickGetImageDistortion() compares an image to a reconstructed image and 4313% returns the specified distortion metric. 4314% 4315% The format of the MagickGetImageDistortion method is: 4316% 4317% MagickBooleanType MagickGetImageDistortion(MagickWand *wand, 4318% const MagickWand *reference,const MetricType metric, 4319% double *distortion) 4320% 4321% A description of each parameter follows: 4322% 4323% o wand: the magick wand. 4324% 4325% o reference: the reference wand. 4326% 4327% o metric: the metric. 4328% 4329% o distortion: the computed distortion between the images. 4330% 4331*/ 4332WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand, 4333 const MagickWand *reference,const MetricType metric,double *distortion) 4334{ 4335 MagickBooleanType 4336 status; 4337 4338 assert(wand != (MagickWand *) NULL); 4339 assert(wand->signature == WandSignature); 4340 if (wand->debug != MagickFalse) 4341 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4342 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) 4343 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4344 status=GetImageDistortion(wand->images,reference->images,metric,distortion, 4345 &wand->images->exception); 4346 return(status); 4347} 4348 4349/* 4350%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4351% % 4352% % 4353% % 4354% M a g i c k G e t I m a g e D i s t o r t i o n s % 4355% % 4356% % 4357% % 4358%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4359% 4360% MagickGetImageDistortions() compares one or more pixel channels of an 4361% image to a reconstructed image and returns the specified distortion metrics. 4362% 4363% Use MagickRelinquishMemory() to free the metrics when you are done with them. 4364% 4365% The format of the MagickGetImageDistortion method is: 4366% 4367% double *MagickGetImageDistortion(MagickWand *wand, 4368% const MagickWand *reference,const MetricType metric) 4369% 4370% A description of each parameter follows: 4371% 4372% o wand: the magick wand. 4373% 4374% o reference: the reference wand. 4375% 4376% o metric: the metric. 4377% 4378*/ 4379WandExport double *MagickGetImageDistortions(MagickWand *wand, 4380 const MagickWand *reference,const MetricType metric) 4381{ 4382 double 4383 *channel_distortion; 4384 4385 assert(wand != (MagickWand *) NULL); 4386 assert(wand->signature == WandSignature); 4387 if (wand->debug != MagickFalse) 4388 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4389 assert(reference != (MagickWand *) NULL); 4390 assert(reference->signature == WandSignature); 4391 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) 4392 { 4393 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4394 "ContainsNoImages","`%s'",wand->name); 4395 return((double *) NULL); 4396 } 4397 channel_distortion=GetImageDistortions(wand->images,reference->images, 4398 metric,&wand->images->exception); 4399 return(channel_distortion); 4400} 4401 4402/* 4403%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4404% % 4405% % 4406% % 4407% M a g i c k G e t I m a g e F i l e n a m e % 4408% % 4409% % 4410% % 4411%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4412% 4413% MagickGetImageFilename() returns the filename of a particular image in a 4414% sequence. 4415% 4416% The format of the MagickGetImageFilename method is: 4417% 4418% char *MagickGetImageFilename(MagickWand *wand) 4419% 4420% A description of each parameter follows: 4421% 4422% o wand: the magick wand. 4423% 4424*/ 4425WandExport char *MagickGetImageFilename(MagickWand *wand) 4426{ 4427 assert(wand != (MagickWand *) NULL); 4428 assert(wand->signature == WandSignature); 4429 if (wand->debug != MagickFalse) 4430 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4431 if (wand->images == (Image *) NULL) 4432 { 4433 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4434 "ContainsNoImages","`%s'",wand->name); 4435 return((char *) NULL); 4436 } 4437 return(AcquireString(wand->images->filename)); 4438} 4439 4440/* 4441%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4442% % 4443% % 4444% % 4445% M a g i c k G e t I m a g e F o r m a t % 4446% % 4447% % 4448% % 4449%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4450% 4451% MagickGetImageFormat() returns the format of a particular image in a 4452% sequence. 4453% 4454% The format of the MagickGetImageFormat method is: 4455% 4456% const char *MagickGetImageFormat(MagickWand *wand) 4457% 4458% A description of each parameter follows: 4459% 4460% o wand: the magick wand. 4461% 4462*/ 4463WandExport char *MagickGetImageFormat(MagickWand *wand) 4464{ 4465 assert(wand != (MagickWand *) NULL); 4466 assert(wand->signature == WandSignature); 4467 if (wand->debug != MagickFalse) 4468 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4469 if (wand->images == (Image *) NULL) 4470 { 4471 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4472 "ContainsNoImages","`%s'",wand->name); 4473 return((char *) NULL); 4474 } 4475 return(AcquireString(wand->images->magick)); 4476} 4477 4478/* 4479%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4480% % 4481% % 4482% % 4483% M a g i c k G e t I m a g e F u z z % 4484% % 4485% % 4486% % 4487%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4488% 4489% MagickGetImageFuzz() gets the image fuzz. 4490% 4491% The format of the MagickGetImageFuzz method is: 4492% 4493% double MagickGetImageFuzz(MagickWand *wand) 4494% 4495% A description of each parameter follows: 4496% 4497% o wand: the magick wand. 4498% 4499*/ 4500WandExport double MagickGetImageFuzz(MagickWand *wand) 4501{ 4502 assert(wand != (MagickWand *) NULL); 4503 assert(wand->signature == WandSignature); 4504 if (wand->debug != MagickFalse) 4505 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4506 if (wand->images == (Image *) NULL) 4507 { 4508 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4509 "ContainsNoImages","`%s'",wand->name); 4510 return(0.0); 4511 } 4512 return(wand->images->fuzz); 4513} 4514 4515/* 4516%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4517% % 4518% % 4519% % 4520% M a g i c k G e t I m a g e G a m m a % 4521% % 4522% % 4523% % 4524%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4525% 4526% MagickGetImageGamma() gets the image gamma. 4527% 4528% The format of the MagickGetImageGamma method is: 4529% 4530% double MagickGetImageGamma(MagickWand *wand) 4531% 4532% A description of each parameter follows: 4533% 4534% o wand: the magick wand. 4535% 4536*/ 4537WandExport double MagickGetImageGamma(MagickWand *wand) 4538{ 4539 assert(wand != (MagickWand *) NULL); 4540 assert(wand->signature == WandSignature); 4541 if (wand->debug != MagickFalse) 4542 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4543 if (wand->images == (Image *) NULL) 4544 { 4545 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4546 "ContainsNoImages","`%s'",wand->name); 4547 return(0.0); 4548 } 4549 return(wand->images->gamma); 4550} 4551 4552/* 4553%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4554% % 4555% % 4556% % 4557% M a g i c k G e t I m a g e I n t e r l a c e S c h e m e % 4558% % 4559% % 4560% % 4561%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4562% 4563% MagickGetImageGravity() gets the image gravity. 4564% 4565% The format of the MagickGetImageGravity method is: 4566% 4567% GravityType MagickGetImageGravity(MagickWand *wand) 4568% 4569% A description of each parameter follows: 4570% 4571% o wand: the magick wand. 4572% 4573*/ 4574WandExport GravityType MagickGetImageGravity(MagickWand *wand) 4575{ 4576 assert(wand != (MagickWand *) NULL); 4577 assert(wand->signature == WandSignature); 4578 if (wand->debug != MagickFalse) 4579 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4580 if (wand->images == (Image *) NULL) 4581 { 4582 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4583 "ContainsNoImages","`%s'",wand->name); 4584 return(UndefinedGravity); 4585 } 4586 return(wand->images->gravity); 4587} 4588 4589/* 4590%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4591% % 4592% % 4593% % 4594% M a g i c k G e t I m a g e G r e e n P r i m a r y % 4595% % 4596% % 4597% % 4598%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4599% 4600% MagickGetImageGreenPrimary() returns the chromaticy green primary point. 4601% 4602% The format of the MagickGetImageGreenPrimary method is: 4603% 4604% MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x, 4605% double *y) 4606% 4607% A description of each parameter follows: 4608% 4609% o wand: the magick wand. 4610% 4611% o x: the chromaticity green primary x-point. 4612% 4613% o y: the chromaticity green primary y-point. 4614% 4615*/ 4616WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand, 4617 double *x,double *y) 4618{ 4619 assert(wand != (MagickWand *) NULL); 4620 assert(wand->signature == WandSignature); 4621 if (wand->debug != MagickFalse) 4622 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4623 if (wand->images == (Image *) NULL) 4624 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4625 *x=wand->images->chromaticity.green_primary.x; 4626 *y=wand->images->chromaticity.green_primary.y; 4627 return(MagickTrue); 4628} 4629 4630/* 4631%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4632% % 4633% % 4634% % 4635% M a g i c k G e t I m a g e H e i g h t % 4636% % 4637% % 4638% % 4639%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4640% 4641% MagickGetImageHeight() returns the image height. 4642% 4643% The format of the MagickGetImageHeight method is: 4644% 4645% size_t MagickGetImageHeight(MagickWand *wand) 4646% 4647% A description of each parameter follows: 4648% 4649% o wand: the magick wand. 4650% 4651*/ 4652WandExport size_t MagickGetImageHeight(MagickWand *wand) 4653{ 4654 assert(wand != (MagickWand *) NULL); 4655 assert(wand->signature == WandSignature); 4656 if (wand->debug != MagickFalse) 4657 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4658 if (wand->images == (Image *) NULL) 4659 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4660 return(wand->images->rows); 4661} 4662 4663/* 4664%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4665% % 4666% % 4667% % 4668% M a g i c k G e t I m a g e H i s t o g r a m % 4669% % 4670% % 4671% % 4672%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4673% 4674% MagickGetImageHistogram() returns the image histogram as an array of 4675% PixelWand wands. 4676% 4677% The format of the MagickGetImageHistogram method is: 4678% 4679% PixelWand **MagickGetImageHistogram(MagickWand *wand, 4680% size_t *number_colors) 4681% 4682% A description of each parameter follows: 4683% 4684% o wand: the magick wand. 4685% 4686% o number_colors: the number of unique colors in the image and the number 4687% of pixel wands returned. 4688% 4689*/ 4690WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand, 4691 size_t *number_colors) 4692{ 4693 PixelPacket 4694 *histogram; 4695 4696 PixelWand 4697 **pixel_wands; 4698 4699 register ssize_t 4700 i; 4701 4702 assert(wand != (MagickWand *) NULL); 4703 assert(wand->signature == WandSignature); 4704 if (wand->debug != MagickFalse) 4705 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4706 if (wand->images == (Image *) NULL) 4707 { 4708 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4709 "ContainsNoImages","`%s'",wand->name); 4710 return((PixelWand **) NULL); 4711 } 4712 histogram=GetImageHistogram(wand->images,number_colors,wand->exception); 4713 if (histogram == (PixelPacket *) NULL) 4714 return((PixelWand **) NULL); 4715 pixel_wands=NewPixelWands(*number_colors); 4716 for (i=0; i < (ssize_t) *number_colors; i++) 4717 { 4718 PixelSetQuantumPacket(pixel_wands[i],&histogram[i]); 4719 PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count); 4720 } 4721 histogram=(PixelPacket *) RelinquishMagickMemory(histogram); 4722 return(pixel_wands); 4723} 4724 4725/* 4726%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4727% % 4728% % 4729% % 4730% M a g i c k G e t I m a g e I n t e r l a c e S c h e m e % 4731% % 4732% % 4733% % 4734%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4735% 4736% MagickGetImageInterlaceScheme() gets the image interlace scheme. 4737% 4738% The format of the MagickGetImageInterlaceScheme method is: 4739% 4740% InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand) 4741% 4742% A description of each parameter follows: 4743% 4744% o wand: the magick wand. 4745% 4746*/ 4747WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand) 4748{ 4749 assert(wand != (MagickWand *) NULL); 4750 assert(wand->signature == WandSignature); 4751 if (wand->debug != MagickFalse) 4752 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4753 if (wand->images == (Image *) NULL) 4754 { 4755 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4756 "ContainsNoImages","`%s'",wand->name); 4757 return(UndefinedInterlace); 4758 } 4759 return(wand->images->interlace); 4760} 4761 4762/* 4763%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4764% % 4765% % 4766% % 4767% M a g i c k G e t I m a g e I n t e r p o l a t e M e t h o d % 4768% % 4769% % 4770% % 4771%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4772% 4773% MagickGetImageInterpolateMethod() returns the interpolation method for the 4774% sepcified image. 4775% 4776% The format of the MagickGetImageInterpolateMethod method is: 4777% 4778% InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand) 4779% 4780% A description of each parameter follows: 4781% 4782% o wand: the magick wand. 4783% 4784*/ 4785WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod( 4786 MagickWand *wand) 4787{ 4788 assert(wand != (MagickWand *) NULL); 4789 assert(wand->signature == WandSignature); 4790 if (wand->debug != MagickFalse) 4791 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4792 if (wand->images == (Image *) NULL) 4793 { 4794 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4795 "ContainsNoImages","`%s'",wand->name); 4796 return(UndefinedInterpolatePixel); 4797 } 4798 return(wand->images->interpolate); 4799} 4800 4801/* 4802%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4803% % 4804% % 4805% % 4806% M a g i c k G e t I m a g e I t e r a t i o n s % 4807% % 4808% % 4809% % 4810%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4811% 4812% MagickGetImageIterations() gets the image iterations. 4813% 4814% The format of the MagickGetImageIterations method is: 4815% 4816% size_t MagickGetImageIterations(MagickWand *wand) 4817% 4818% A description of each parameter follows: 4819% 4820% o wand: the magick wand. 4821% 4822*/ 4823WandExport size_t MagickGetImageIterations(MagickWand *wand) 4824{ 4825 assert(wand != (MagickWand *) NULL); 4826 assert(wand->signature == WandSignature); 4827 if (wand->debug != MagickFalse) 4828 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4829 if (wand->images == (Image *) NULL) 4830 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4831 return(wand->images->iterations); 4832} 4833 4834/* 4835%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4836% % 4837% % 4838% % 4839% M a g i c k G e t I m a g e L e n g t h % 4840% % 4841% % 4842% % 4843%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4844% 4845% MagickGetImageLength() returns the image length in bytes. 4846% 4847% The format of the MagickGetImageLength method is: 4848% 4849% MagickBooleanType MagickGetImageLength(MagickWand *wand, 4850% MagickSizeType *length) 4851% 4852% A description of each parameter follows: 4853% 4854% o wand: the magick wand. 4855% 4856% o length: the image length in bytes. 4857% 4858*/ 4859WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand, 4860 MagickSizeType *length) 4861{ 4862 assert(wand != (MagickWand *) NULL); 4863 assert(wand->signature == WandSignature); 4864 if (wand->debug != MagickFalse) 4865 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4866 if (wand->images == (Image *) NULL) 4867 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4868 *length=GetBlobSize(wand->images); 4869 return(MagickTrue); 4870} 4871 4872/* 4873%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4874% % 4875% % 4876% % 4877% M a g i c k G e t I m a g e M a t t e C o l o r % 4878% % 4879% % 4880% % 4881%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4882% 4883% MagickGetImageMatteColor() returns the image matte color. 4884% 4885% The format of the MagickGetImageMatteColor method is: 4886% 4887% MagickBooleanType MagickGetImagematteColor(MagickWand *wand, 4888% PixelWand *matte_color) 4889% 4890% A description of each parameter follows: 4891% 4892% o wand: the magick wand. 4893% 4894% o matte_color: Return the matte color. 4895% 4896*/ 4897WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand, 4898 PixelWand *matte_color) 4899{ 4900 assert(wand != (MagickWand *) NULL); 4901 assert(wand->signature == WandSignature); 4902 if (wand->debug != MagickFalse) 4903 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4904 if (wand->images == (Image *) NULL) 4905 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4906 PixelSetQuantumPacket(matte_color,&wand->images->matte_color); 4907 return(MagickTrue); 4908} 4909 4910/* 4911%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4912% % 4913% % 4914% % 4915% M a g i c k G e t I m a g e O r i e n t a t i o n % 4916% % 4917% % 4918% % 4919%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4920% 4921% MagickGetImageOrientation() returns the image orientation. 4922% 4923% The format of the MagickGetImageOrientation method is: 4924% 4925% OrientationType MagickGetImageOrientation(MagickWand *wand) 4926% 4927% A description of each parameter follows: 4928% 4929% o wand: the magick wand. 4930% 4931*/ 4932WandExport OrientationType MagickGetImageOrientation(MagickWand *wand) 4933{ 4934 assert(wand != (MagickWand *) NULL); 4935 assert(wand->signature == WandSignature); 4936 if (wand->debug != MagickFalse) 4937 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4938 if (wand->images == (Image *) NULL) 4939 { 4940 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 4941 "ContainsNoImages","`%s'",wand->name); 4942 return(UndefinedOrientation); 4943 } 4944 return(wand->images->orientation); 4945} 4946 4947/* 4948%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4949% % 4950% % 4951% % 4952% M a g i c k G e t I m a g e P a g e % 4953% % 4954% % 4955% % 4956%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4957% 4958% MagickGetImagePage() returns the page geometry associated with the image. 4959% 4960% The format of the MagickGetImagePage method is: 4961% 4962% MagickBooleanType MagickGetImagePage(MagickWand *wand, 4963% size_t *width,size_t *height,ssize_t *x,ssize_t *y) 4964% 4965% A description of each parameter follows: 4966% 4967% o wand: the magick wand. 4968% 4969% o width: the page width. 4970% 4971% o height: the page height. 4972% 4973% o x: the page x-offset. 4974% 4975% o y: the page y-offset. 4976% 4977*/ 4978WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand, 4979 size_t *width,size_t *height,ssize_t *x,ssize_t *y) 4980{ 4981 assert(wand != (const MagickWand *) NULL); 4982 assert(wand->signature == WandSignature); 4983 if (wand->debug != MagickFalse) 4984 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 4985 if (wand->images == (Image *) NULL) 4986 ThrowWandException(WandError,"ContainsNoImages",wand->name); 4987 *width=wand->images->page.width; 4988 *height=wand->images->page.height; 4989 *x=wand->images->page.x; 4990 *y=wand->images->page.y; 4991 return(MagickTrue); 4992} 4993 4994/* 4995%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4996% % 4997% % 4998% % 4999% M a g i c k G e t I m a g e P i x e l C o l o r % 5000% % 5001% % 5002% % 5003%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5004% 5005% MagickGetImagePixelColor() returns the color of the specified pixel. 5006% 5007% The format of the MagickGetImagePixelColor method is: 5008% 5009% MagickBooleanType MagickGetImagePixelColor(MagickWand *wand, 5010% const ssize_t x,const ssize_t y,PixelWand *color) 5011% 5012% A description of each parameter follows: 5013% 5014% o wand: the magick wand. 5015% 5016% o x,y: the pixel offset into the image. 5017% 5018% o color: Return the colormap color in this wand. 5019% 5020*/ 5021WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand, 5022 const ssize_t x,const ssize_t y,PixelWand *color) 5023{ 5024 register const Quantum 5025 *p; 5026 5027 CacheView 5028 *image_view; 5029 5030 assert(wand != (MagickWand *) NULL); 5031 assert(wand->signature == WandSignature); 5032 if (wand->debug != MagickFalse) 5033 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5034 if (wand->images == (Image *) NULL) 5035 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5036 image_view=AcquireCacheView(wand->images); 5037 p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception); 5038 if (p == (const Quantum *) NULL) 5039 { 5040 image_view=DestroyCacheView(image_view); 5041 return(MagickFalse); 5042 } 5043 PixelSetQuantumPixel(wand->images,p,color); 5044 image_view=DestroyCacheView(image_view); 5045 return(MagickTrue); 5046} 5047 5048/* 5049%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5050% % 5051% % 5052% % 5053% M a g i c k G e t I m a g e R e d P r i m a r y % 5054% % 5055% % 5056% % 5057%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5058% 5059% MagickGetImageRedPrimary() returns the chromaticy red primary point. 5060% 5061% The format of the MagickGetImageRedPrimary method is: 5062% 5063% MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x, 5064% double *y) 5065% 5066% A description of each parameter follows: 5067% 5068% o wand: the magick wand. 5069% 5070% o x: the chromaticity red primary x-point. 5071% 5072% o y: the chromaticity red primary y-point. 5073% 5074*/ 5075WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand, 5076 double *x,double *y) 5077{ 5078 assert(wand != (MagickWand *) NULL); 5079 assert(wand->signature == WandSignature); 5080 if (wand->debug != MagickFalse) 5081 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5082 if (wand->images == (Image *) NULL) 5083 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5084 *x=wand->images->chromaticity.red_primary.x; 5085 *y=wand->images->chromaticity.red_primary.y; 5086 return(MagickTrue); 5087} 5088 5089/* 5090%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5091% % 5092% % 5093% % 5094% M a g i c k G e t I m a g e R e g i o n % 5095% % 5096% % 5097% % 5098%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5099% 5100% MagickGetImageRegion() extracts a region of the image and returns it as a 5101% a new wand. 5102% 5103% The format of the MagickGetImageRegion method is: 5104% 5105% MagickWand *MagickGetImageRegion(MagickWand *wand, 5106% const size_t width,const size_t height,const ssize_t x, 5107% const ssize_t y) 5108% 5109% A description of each parameter follows: 5110% 5111% o wand: the magick wand. 5112% 5113% o width: the region width. 5114% 5115% o height: the region height. 5116% 5117% o x: the region x offset. 5118% 5119% o y: the region y offset. 5120% 5121*/ 5122WandExport MagickWand *MagickGetImageRegion(MagickWand *wand, 5123 const size_t width,const size_t height,const ssize_t x, 5124 const ssize_t y) 5125{ 5126 Image 5127 *region_image; 5128 5129 RectangleInfo 5130 region; 5131 5132 assert(wand != (MagickWand *) NULL); 5133 assert(wand->signature == WandSignature); 5134 if (wand->debug != MagickFalse) 5135 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5136 if (wand->images == (Image *) NULL) 5137 return((MagickWand *) NULL); 5138 region.width=width; 5139 region.height=height; 5140 region.x=x; 5141 region.y=y; 5142 region_image=CropImage(wand->images,®ion,wand->exception); 5143 if (region_image == (Image *) NULL) 5144 return((MagickWand *) NULL); 5145 return(CloneMagickWandFromImages(wand,region_image)); 5146} 5147 5148/* 5149%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5150% % 5151% % 5152% % 5153% M a g i c k G e t I m a g e R e n d e r i n g I n t e n t % 5154% % 5155% % 5156% % 5157%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5158% 5159% MagickGetImageRenderingIntent() gets the image rendering intent. 5160% 5161% The format of the MagickGetImageRenderingIntent method is: 5162% 5163% RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand) 5164% 5165% A description of each parameter follows: 5166% 5167% o wand: the magick wand. 5168% 5169*/ 5170WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand) 5171{ 5172 assert(wand != (MagickWand *) NULL); 5173 assert(wand->signature == WandSignature); 5174 if (wand->debug != MagickFalse) 5175 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5176 if (wand->images == (Image *) NULL) 5177 { 5178 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 5179 "ContainsNoImages","`%s'",wand->name); 5180 return(UndefinedIntent); 5181 } 5182 return((RenderingIntent) wand->images->rendering_intent); 5183} 5184 5185/* 5186%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5187% % 5188% % 5189% % 5190% M a g i c k G e t I m a g e R e s o l u t i o n % 5191% % 5192% % 5193% % 5194%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5195% 5196% MagickGetImageResolution() gets the image X and Y resolution. 5197% 5198% The format of the MagickGetImageResolution method is: 5199% 5200% MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x, 5201% double *y) 5202% 5203% A description of each parameter follows: 5204% 5205% o wand: the magick wand. 5206% 5207% o x: the image x-resolution. 5208% 5209% o y: the image y-resolution. 5210% 5211*/ 5212WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand, 5213 double *x,double *y) 5214{ 5215 assert(wand != (MagickWand *) NULL); 5216 assert(wand->signature == WandSignature); 5217 if (wand->debug != MagickFalse) 5218 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5219 if (wand->images == (Image *) NULL) 5220 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5221 *x=wand->images->x_resolution; 5222 *y=wand->images->y_resolution; 5223 return(MagickTrue); 5224} 5225 5226/* 5227%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5228% % 5229% % 5230% % 5231% M a g i c k G e t I m a g e S c e n e % 5232% % 5233% % 5234% % 5235%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5236% 5237% MagickGetImageScene() gets the image scene. 5238% 5239% The format of the MagickGetImageScene method is: 5240% 5241% size_t MagickGetImageScene(MagickWand *wand) 5242% 5243% A description of each parameter follows: 5244% 5245% o wand: the magick wand. 5246% 5247*/ 5248WandExport size_t MagickGetImageScene(MagickWand *wand) 5249{ 5250 assert(wand != (MagickWand *) NULL); 5251 assert(wand->signature == WandSignature); 5252 if (wand->debug != MagickFalse) 5253 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5254 if (wand->images == (Image *) NULL) 5255 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5256 return(wand->images->scene); 5257} 5258 5259/* 5260%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5261% % 5262% % 5263% % 5264% M a g i c k G e t I m a g e S i g n a t u r e % 5265% % 5266% % 5267% % 5268%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5269% 5270% MagickGetImageSignature() generates an SHA-256 message digest for the image 5271% pixel stream. 5272% 5273% The format of the MagickGetImageSignature method is: 5274% 5275% const char MagickGetImageSignature(MagickWand *wand) 5276% 5277% A description of each parameter follows: 5278% 5279% o wand: the magick wand. 5280% 5281*/ 5282WandExport char *MagickGetImageSignature(MagickWand *wand) 5283{ 5284 const char 5285 *value; 5286 5287 MagickBooleanType 5288 status; 5289 5290 assert(wand != (MagickWand *) NULL); 5291 assert(wand->signature == WandSignature); 5292 if (wand->debug != MagickFalse) 5293 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5294 if (wand->images == (Image *) NULL) 5295 { 5296 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 5297 "ContainsNoImages","`%s'",wand->name); 5298 return((char *) NULL); 5299 } 5300 status=SignatureImage(wand->images); 5301 if (status == MagickFalse) 5302 InheritException(wand->exception,&wand->images->exception); 5303 value=GetImageProperty(wand->images,"signature"); 5304 if (value != (const char *) NULL) 5305 return(AcquireString(value)); 5306 InheritException(wand->exception,&wand->images->exception); 5307 return((char *) NULL); 5308} 5309 5310/* 5311%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5312% % 5313% % 5314% % 5315% M a g i c k G e t I m a g e T i c k s P e r S e c o n d % 5316% % 5317% % 5318% % 5319%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5320% 5321% MagickGetImageTicksPerSecond() gets the image ticks-per-second. 5322% 5323% The format of the MagickGetImageTicksPerSecond method is: 5324% 5325% size_t MagickGetImageTicksPerSecond(MagickWand *wand) 5326% 5327% A description of each parameter follows: 5328% 5329% o wand: the magick wand. 5330% 5331*/ 5332WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand) 5333{ 5334 assert(wand != (MagickWand *) NULL); 5335 assert(wand->signature == WandSignature); 5336 if (wand->debug != MagickFalse) 5337 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5338 if (wand->images == (Image *) NULL) 5339 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5340 return((size_t) wand->images->ticks_per_second); 5341} 5342 5343/* 5344%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5345% % 5346% % 5347% % 5348% M a g i c k G e t I m a g e T y p e % 5349% % 5350% % 5351% % 5352%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5353% 5354% MagickGetImageType() gets the potential image type: 5355% 5356% Bilevel Grayscale GrayscaleMatte 5357% Palette PaletteMatte TrueColor 5358% TrueColorMatte ColorSeparation ColorSeparationMatte 5359% 5360% To ensure the image type matches its potential, use MagickSetImageType(): 5361% 5362% (void) MagickSetImageType(wand,MagickGetImageType(wand)); 5363% 5364% The format of the MagickGetImageType method is: 5365% 5366% ImageType MagickGetImageType(MagickWand *wand) 5367% 5368% A description of each parameter follows: 5369% 5370% o wand: the magick wand. 5371% 5372*/ 5373WandExport ImageType MagickGetImageType(MagickWand *wand) 5374{ 5375 assert(wand != (MagickWand *) NULL); 5376 assert(wand->signature == WandSignature); 5377 if (wand->debug != MagickFalse) 5378 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5379 if (wand->images == (Image *) NULL) 5380 { 5381 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 5382 "ContainsNoImages","`%s'",wand->name); 5383 return(UndefinedType); 5384 } 5385 return(GetImageType(wand->images,wand->exception)); 5386} 5387 5388/* 5389%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5390% % 5391% % 5392% % 5393% M a g i c k G e t I m a g e U n i t s % 5394% % 5395% % 5396% % 5397%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5398% 5399% MagickGetImageUnits() gets the image units of resolution. 5400% 5401% The format of the MagickGetImageUnits method is: 5402% 5403% ResolutionType MagickGetImageUnits(MagickWand *wand) 5404% 5405% A description of each parameter follows: 5406% 5407% o wand: the magick wand. 5408% 5409*/ 5410WandExport ResolutionType MagickGetImageUnits(MagickWand *wand) 5411{ 5412 assert(wand != (MagickWand *) NULL); 5413 assert(wand->signature == WandSignature); 5414 if (wand->debug != MagickFalse) 5415 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5416 if (wand->images == (Image *) NULL) 5417 { 5418 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 5419 "ContainsNoImages","`%s'",wand->name); 5420 return(UndefinedResolution); 5421 } 5422 return(wand->images->units); 5423} 5424 5425/* 5426%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5427% % 5428% % 5429% % 5430% M a g i c k G e t I m a g e V i r t u a l P i x e l M e t h o d % 5431% % 5432% % 5433% % 5434%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5435% 5436% MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the 5437% sepcified image. 5438% 5439% The format of the MagickGetImageVirtualPixelMethod method is: 5440% 5441% VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand) 5442% 5443% A description of each parameter follows: 5444% 5445% o wand: the magick wand. 5446% 5447*/ 5448WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand) 5449{ 5450 assert(wand != (MagickWand *) NULL); 5451 assert(wand->signature == WandSignature); 5452 if (wand->debug != MagickFalse) 5453 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5454 if (wand->images == (Image *) NULL) 5455 { 5456 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 5457 "ContainsNoImages","`%s'",wand->name); 5458 return(UndefinedVirtualPixelMethod); 5459 } 5460 return(GetImageVirtualPixelMethod(wand->images)); 5461} 5462 5463/* 5464%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5465% % 5466% % 5467% % 5468% M a g i c k G e t I m a g e W h i t e P o i n t % 5469% % 5470% % 5471% % 5472%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5473% 5474% MagickGetImageWhitePoint() returns the chromaticy white point. 5475% 5476% The format of the MagickGetImageWhitePoint method is: 5477% 5478% MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x, 5479% double *y) 5480% 5481% A description of each parameter follows: 5482% 5483% o wand: the magick wand. 5484% 5485% o x: the chromaticity white x-point. 5486% 5487% o y: the chromaticity white y-point. 5488% 5489*/ 5490WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand, 5491 double *x,double *y) 5492{ 5493 assert(wand != (MagickWand *) NULL); 5494 assert(wand->signature == WandSignature); 5495 if (wand->debug != MagickFalse) 5496 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5497 if (wand->images == (Image *) NULL) 5498 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5499 *x=wand->images->chromaticity.white_point.x; 5500 *y=wand->images->chromaticity.white_point.y; 5501 return(MagickTrue); 5502} 5503 5504/* 5505%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5506% % 5507% % 5508% % 5509% M a g i c k G e t I m a g e W i d t h % 5510% % 5511% % 5512% % 5513%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5514% 5515% MagickGetImageWidth() returns the image width. 5516% 5517% The format of the MagickGetImageWidth method is: 5518% 5519% size_t MagickGetImageWidth(MagickWand *wand) 5520% 5521% A description of each parameter follows: 5522% 5523% o wand: the magick wand. 5524% 5525*/ 5526WandExport size_t MagickGetImageWidth(MagickWand *wand) 5527{ 5528 assert(wand != (MagickWand *) NULL); 5529 assert(wand->signature == WandSignature); 5530 if (wand->debug != MagickFalse) 5531 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5532 if (wand->images == (Image *) NULL) 5533 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5534 return(wand->images->columns); 5535} 5536 5537/* 5538%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5539% % 5540% % 5541% % 5542% M a g i c k G e t N u m b e r I m a g e s % 5543% % 5544% % 5545% % 5546%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5547% 5548% MagickGetNumberImages() returns the number of images associated with a 5549% magick wand. 5550% 5551% The format of the MagickGetNumberImages method is: 5552% 5553% size_t MagickGetNumberImages(MagickWand *wand) 5554% 5555% A description of each parameter follows: 5556% 5557% o wand: the magick wand. 5558% 5559*/ 5560WandExport size_t MagickGetNumberImages(MagickWand *wand) 5561{ 5562 assert(wand != (MagickWand *) NULL); 5563 assert(wand->signature == WandSignature); 5564 if (wand->debug != MagickFalse) 5565 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5566 return(GetImageListLength(wand->images)); 5567} 5568 5569/* 5570%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5571% % 5572% % 5573% % 5574% M a g i c k I m a g e G e t T o t a l I n k D e n s i t y % 5575% % 5576% % 5577% % 5578%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5579% 5580% MagickGetImageTotalInkDensity() gets the image total ink density. 5581% 5582% The format of the MagickGetImageTotalInkDensity method is: 5583% 5584% double MagickGetImageTotalInkDensity(MagickWand *wand) 5585% 5586% A description of each parameter follows: 5587% 5588% o wand: the magick wand. 5589% 5590*/ 5591WandExport double MagickGetImageTotalInkDensity(MagickWand *wand) 5592{ 5593 assert(wand != (MagickWand *) NULL); 5594 assert(wand->signature == WandSignature); 5595 if (wand->debug != MagickFalse) 5596 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5597 if (wand->images == (Image *) NULL) 5598 { 5599 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 5600 "ContainsNoImages","`%s'",wand->name); 5601 return(0.0); 5602 } 5603 return(GetImageTotalInkDensity(wand->images)); 5604} 5605 5606/* 5607%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5608% % 5609% % 5610% % 5611% M a g i c k H a l d C l u t I m a g e % 5612% % 5613% % 5614% % 5615%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5616% 5617% MagickHaldClutImage() replaces colors in the image from a Hald color lookup 5618% table. A Hald color lookup table is a 3-dimensional color cube mapped to 2 5619% dimensions. Create it with the HALD coder. You can apply any color 5620% transformation to the Hald image and then use this method to apply the 5621% transform to the image. 5622% 5623% The format of the MagickHaldClutImage method is: 5624% 5625% MagickBooleanType MagickHaldClutImage(MagickWand *wand, 5626% const MagickWand *hald_wand) 5627% 5628% A description of each parameter follows: 5629% 5630% o wand: the magick wand. 5631% 5632% o hald_image: the hald CLUT image. 5633% 5634*/ 5635WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand, 5636 const MagickWand *hald_wand) 5637{ 5638 MagickBooleanType 5639 status; 5640 5641 assert(wand != (MagickWand *) NULL); 5642 assert(wand->signature == WandSignature); 5643 if (wand->debug != MagickFalse) 5644 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5645 if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL)) 5646 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5647 status=HaldClutImage(wand->images,hald_wand->images); 5648 if (status == MagickFalse) 5649 InheritException(wand->exception,&wand->images->exception); 5650 return(status); 5651} 5652 5653/* 5654%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5655% % 5656% % 5657% % 5658% M a g i c k H a s N e x t I m a g e % 5659% % 5660% % 5661% % 5662%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5663% 5664% MagickHasNextImage() returns MagickTrue if the wand has more images when 5665% traversing the list in the forward direction 5666% 5667% The format of the MagickHasNextImage method is: 5668% 5669% MagickBooleanType MagickHasNextImage(MagickWand *wand) 5670% 5671% A description of each parameter follows: 5672% 5673% o wand: the magick wand. 5674% 5675*/ 5676WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand) 5677{ 5678 assert(wand != (MagickWand *) NULL); 5679 assert(wand->signature == WandSignature); 5680 if (wand->debug != MagickFalse) 5681 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5682 if (wand->images == (Image *) NULL) 5683 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5684 if (GetNextImageInList(wand->images) == (Image *) NULL) 5685 return(MagickFalse); 5686 return(MagickTrue); 5687} 5688 5689/* 5690%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5691% % 5692% % 5693% % 5694% M a g i c k H a s P r e v i o u s I m a g e % 5695% % 5696% % 5697% % 5698%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5699% 5700% MagickHasPreviousImage() returns MagickTrue if the wand has more images when 5701% traversing the list in the reverse direction 5702% 5703% The format of the MagickHasPreviousImage method is: 5704% 5705% MagickBooleanType MagickHasPreviousImage(MagickWand *wand) 5706% 5707% A description of each parameter follows: 5708% 5709% o wand: the magick wand. 5710% 5711*/ 5712WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand) 5713{ 5714 assert(wand != (MagickWand *) NULL); 5715 assert(wand->signature == WandSignature); 5716 if (wand->debug != MagickFalse) 5717 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5718 if (wand->images == (Image *) NULL) 5719 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5720 if (GetPreviousImageInList(wand->images) == (Image *) NULL) 5721 return(MagickFalse); 5722 return(MagickTrue); 5723} 5724 5725/* 5726%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5727% % 5728% % 5729% % 5730% M a g i c k I d e n t i f y I m a g e % 5731% % 5732% % 5733% % 5734%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5735% 5736% MagickIdentifyImage() identifies an image by printing its attributes to the 5737% file. Attributes include the image width, height, size, and others. 5738% 5739% The format of the MagickIdentifyImage method is: 5740% 5741% const char *MagickIdentifyImage(MagickWand *wand) 5742% 5743% A description of each parameter follows: 5744% 5745% o wand: the magick wand. 5746% 5747*/ 5748WandExport char *MagickIdentifyImage(MagickWand *wand) 5749{ 5750 char 5751 *description, 5752 filename[MaxTextExtent]; 5753 5754 FILE 5755 *file; 5756 5757 int 5758 unique_file; 5759 5760 assert(wand != (MagickWand *) NULL); 5761 assert(wand->signature == WandSignature); 5762 if (wand->debug != MagickFalse) 5763 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5764 if (wand->images == (Image *) NULL) 5765 { 5766 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 5767 "ContainsNoImages","`%s'",wand->name); 5768 return((char *) NULL); 5769 } 5770 description=(char *) NULL; 5771 unique_file=AcquireUniqueFileResource(filename); 5772 file=(FILE *) NULL; 5773 if (unique_file != -1) 5774 file=fdopen(unique_file,"wb"); 5775 if ((unique_file == -1) || (file == (FILE *) NULL)) 5776 { 5777 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 5778 "UnableToCreateTemporaryFile","`%s'",wand->name); 5779 return((char *) NULL); 5780 } 5781 (void) IdentifyImage(wand->images,file,MagickTrue); 5782 (void) fclose(file); 5783 description=FileToString(filename,~0,wand->exception); 5784 (void) RelinquishUniqueFileResource(filename); 5785 return(description); 5786} 5787 5788/* 5789%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5790% % 5791% % 5792% % 5793% M a g i c k I m p l o d e I m a g e % 5794% % 5795% % 5796% % 5797%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5798% 5799% MagickImplodeImage() creates a new image that is a copy of an existing 5800% one with the image pixels "implode" by the specified percentage. It 5801% allocates the memory necessary for the new Image structure and returns a 5802% pointer to the new image. 5803% 5804% The format of the MagickImplodeImage method is: 5805% 5806% MagickBooleanType MagickImplodeImage(MagickWand *wand, 5807% const double radius) 5808% 5809% A description of each parameter follows: 5810% 5811% o wand: the magick wand. 5812% 5813% o amount: Define the extent of the implosion. 5814% 5815*/ 5816WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand, 5817 const double amount) 5818{ 5819 Image 5820 *implode_image; 5821 5822 assert(wand != (MagickWand *) NULL); 5823 assert(wand->signature == WandSignature); 5824 if (wand->debug != MagickFalse) 5825 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5826 if (wand->images == (Image *) NULL) 5827 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5828 implode_image=ImplodeImage(wand->images,amount,wand->exception); 5829 if (implode_image == (Image *) NULL) 5830 return(MagickFalse); 5831 ReplaceImageInList(&wand->images,implode_image); 5832 return(MagickTrue); 5833} 5834 5835/* 5836%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5837% % 5838% % 5839% % 5840% M a g i c k I m p o r t I m a g e P i x e l s % 5841% % 5842% % 5843% % 5844%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5845% 5846% MagickImportImagePixels() accepts pixel datand stores it in the image at the 5847% location you specify. The method returns MagickFalse on success otherwise 5848% MagickTrue if an error is encountered. The pixel data can be either char, 5849% short int, int, ssize_t, float, or double in the order specified by map. 5850% 5851% Suppose your want to upload the first scanline of a 640x480 image from 5852% character data in red-green-blue order: 5853% 5854% MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels); 5855% 5856% The format of the MagickImportImagePixels method is: 5857% 5858% MagickBooleanType MagickImportImagePixels(MagickWand *wand, 5859% const ssize_t x,const ssize_t y,const size_t columns, 5860% const size_t rows,const char *map,const StorageType storage, 5861% const void *pixels) 5862% 5863% A description of each parameter follows: 5864% 5865% o wand: the magick wand. 5866% 5867% o x, y, columns, rows: These values define the perimeter of a region 5868% of pixels you want to define. 5869% 5870% o map: This string reflects the expected ordering of the pixel array. 5871% It can be any combination or order of R = red, G = green, B = blue, 5872% A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, 5873% Y = yellow, M = magenta, K = black, I = intensity (for grayscale), 5874% P = pad. 5875% 5876% o storage: Define the data type of the pixels. Float and double types are 5877% expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from 5878% these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel, 5879% or DoublePixel. 5880% 5881% o pixels: This array of values contain the pixel components as defined by 5882% map and type. You must preallocate this array where the expected 5883% length varies depending on the values of width, height, map, and type. 5884% 5885*/ 5886WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand, 5887 const ssize_t x,const ssize_t y,const size_t columns, 5888 const size_t rows,const char *map,const StorageType storage, 5889 const void *pixels) 5890{ 5891 MagickBooleanType 5892 status; 5893 5894 assert(wand != (MagickWand *) NULL); 5895 assert(wand->signature == WandSignature); 5896 if (wand->debug != MagickFalse) 5897 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 5898 if (wand->images == (Image *) NULL) 5899 ThrowWandException(WandError,"ContainsNoImages",wand->name); 5900 status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels); 5901 if (status == MagickFalse) 5902 InheritException(wand->exception,&wand->images->exception); 5903 return(status); 5904} 5905 5906/* 5907%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5908% % 5909% % 5910% % 5911% M a g i c k I n v e r s e F o u r i e r T r a n s f o r m I m a g e % 5912% % 5913% % 5914% % 5915%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5916% 5917% MagickInverseFourierTransformImage() implements the inverse discrete 5918% Fourier transform (DFT) of the image either as a magnitude / phase or real / 5919% imaginary image pair. 5920% 5921% The format of the MagickInverseFourierTransformImage method is: 5922% 5923% MagickBooleanType MagickInverseFourierTransformImage( 5924% MagickWand *magnitude_wand,MagickWand *phase_wand, 5925% const MagickBooleanType magnitude) 5926% 5927% A description of each parameter follows: 5928% 5929% o magnitude_wand: the magnitude or real wand. 5930% 5931% o phase_wand: the phase or imaginary wand. 5932% 5933% o magnitude: if true, return as magnitude / phase pair otherwise a real / 5934% imaginary image pair. 5935% 5936*/ 5937WandExport MagickBooleanType MagickInverseFourierTransformImage( 5938 MagickWand *magnitude_wand,MagickWand *phase_wand, 5939 const MagickBooleanType magnitude) 5940{ 5941 Image 5942 *inverse_image; 5943 5944 MagickWand 5945 *wand; 5946 5947 assert(magnitude_wand != (MagickWand *) NULL); 5948 assert(magnitude_wand->signature == WandSignature); 5949 if (magnitude_wand->debug != MagickFalse) 5950 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s", 5951 magnitude_wand->name); 5952 wand=magnitude_wand; 5953 if (magnitude_wand->images == (Image *) NULL) 5954 ThrowWandException(WandError,"ContainsNoImages", 5955 magnitude_wand->name); 5956 assert(phase_wand != (MagickWand *) NULL); 5957 assert(phase_wand->signature == WandSignature); 5958 inverse_image=InverseFourierTransformImage(magnitude_wand->images, 5959 phase_wand->images,magnitude,wand->exception); 5960 if (inverse_image == (Image *) NULL) 5961 return(MagickFalse); 5962 ReplaceImageInList(&wand->images,inverse_image); 5963 return(MagickTrue); 5964} 5965 5966/* 5967%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5968% % 5969% % 5970% % 5971% M a g i c k L a b e l I m a g e % 5972% % 5973% % 5974% % 5975%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5976% 5977% MagickLabelImage() adds a label to your image. 5978% 5979% The format of the MagickLabelImage method is: 5980% 5981% MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label) 5982% 5983% A description of each parameter follows: 5984% 5985% o wand: the magick wand. 5986% 5987% o label: the image label. 5988% 5989*/ 5990WandExport MagickBooleanType MagickLabelImage(MagickWand *wand, 5991 const char *label) 5992{ 5993 MagickBooleanType 5994 status; 5995 5996 assert(wand != (MagickWand *) NULL); 5997 assert(wand->signature == WandSignature); 5998 if (wand->debug != MagickFalse) 5999 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6000 if (wand->images == (Image *) NULL) 6001 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6002 status=SetImageProperty(wand->images,"label",label); 6003 if (status == MagickFalse) 6004 InheritException(wand->exception,&wand->images->exception); 6005 return(status); 6006} 6007 6008/* 6009%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6010% % 6011% % 6012% % 6013% M a g i c k L e v e l I m a g e % 6014% % 6015% % 6016% % 6017%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6018% 6019% MagickLevelImage() adjusts the levels of an image by scaling the colors 6020% falling between specified white and black points to the full available 6021% quantum range. The parameters provided represent the black, mid, and white 6022% points. The black point specifies the darkest color in the image. Colors 6023% darker than the black point are set to zero. Mid point specifies a gamma 6024% correction to apply to the image. White point specifies the lightest color 6025% in the image. Colors brighter than the white point are set to the maximum 6026% quantum value. 6027% 6028% The format of the MagickLevelImage method is: 6029% 6030% MagickBooleanType MagickLevelImage(MagickWand *wand, 6031% const double black_point,const double gamma,const double white_point) 6032% MagickBooleanType MagickLevelImage(MagickWand *wand, 6033% const ChannelType channel,const double black_point,const double gamma, 6034% const double white_point) 6035% 6036% A description of each parameter follows: 6037% 6038% o wand: the magick wand. 6039% 6040% o channel: Identify which channel to level: RedChannel, GreenChannel, 6041% 6042% o black_point: the black point. 6043% 6044% o gamma: the gamma. 6045% 6046% o white_point: the white point. 6047% 6048*/ 6049WandExport MagickBooleanType MagickLevelImage(MagickWand *wand, 6050 const double black_point,const double gamma,const double white_point) 6051{ 6052 MagickBooleanType 6053 status; 6054 6055 assert(wand != (MagickWand *) NULL); 6056 assert(wand->signature == WandSignature); 6057 if (wand->debug != MagickFalse) 6058 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6059 if (wand->images == (Image *) NULL) 6060 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6061 status=LevelImage(wand->images,black_point,white_point,gamma); 6062 if (status == MagickFalse) 6063 InheritException(wand->exception,&wand->images->exception); 6064 return(status); 6065} 6066 6067/* 6068%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6069% % 6070% % 6071% % 6072% M a g i c k L i n e a r S t r e t c h I m a g e % 6073% % 6074% % 6075% % 6076%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6077% 6078% MagickLinearStretchImage() stretches with saturation the image intensity. 6079% 6080% You can also reduce the influence of a particular channel with a gamma 6081% value of 0. 6082% 6083% The format of the MagickLinearStretchImage method is: 6084% 6085% MagickBooleanType MagickLinearStretchImage(MagickWand *wand, 6086% const double black_point,const double white_point) 6087% 6088% A description of each parameter follows: 6089% 6090% o wand: the magick wand. 6091% 6092% o black_point: the black point. 6093% 6094% o white_point: the white point. 6095% 6096*/ 6097WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand, 6098 const double black_point,const double white_point) 6099{ 6100 MagickBooleanType 6101 status; 6102 6103 assert(wand != (MagickWand *) NULL); 6104 assert(wand->signature == WandSignature); 6105 if (wand->debug != MagickFalse) 6106 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6107 if (wand->images == (Image *) NULL) 6108 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6109 status=LinearStretchImage(wand->images,black_point,white_point); 6110 if (status == MagickFalse) 6111 InheritException(wand->exception,&wand->images->exception); 6112 return(status); 6113} 6114 6115/* 6116%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6117% % 6118% % 6119% % 6120% M a g i c k L i q u i d R e s c a l e I m a g e % 6121% % 6122% % 6123% % 6124%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6125% 6126% MagickLiquidRescaleImage() rescales image with seam carving. 6127% 6128% MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand, 6129% const size_t columns,const size_t rows, 6130% const double delta_x,const double rigidity) 6131% 6132% A description of each parameter follows: 6133% 6134% o wand: the magick wand. 6135% 6136% o columns: the number of columns in the scaled image. 6137% 6138% o rows: the number of rows in the scaled image. 6139% 6140% o delta_x: maximum seam transversal step (0 means straight seams). 6141% 6142% o rigidity: introduce a bias for non-straight seams (typically 0). 6143% 6144*/ 6145WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand, 6146 const size_t columns,const size_t rows,const double delta_x, 6147 const double rigidity) 6148{ 6149 Image 6150 *rescale_image; 6151 6152 assert(wand != (MagickWand *) NULL); 6153 assert(wand->signature == WandSignature); 6154 if (wand->debug != MagickFalse) 6155 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6156 if (wand->images == (Image *) NULL) 6157 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6158 rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x, 6159 rigidity,wand->exception); 6160 if (rescale_image == (Image *) NULL) 6161 return(MagickFalse); 6162 ReplaceImageInList(&wand->images,rescale_image); 6163 return(MagickTrue); 6164} 6165 6166/* 6167%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6168% % 6169% % 6170% % 6171% M a g i c k M a g n i f y I m a g e % 6172% % 6173% % 6174% % 6175%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6176% 6177% MagickMagnifyImage() is a convenience method that scales an image 6178% proportionally to twice its original size. 6179% 6180% The format of the MagickMagnifyImage method is: 6181% 6182% MagickBooleanType MagickMagnifyImage(MagickWand *wand) 6183% 6184% A description of each parameter follows: 6185% 6186% o wand: the magick wand. 6187% 6188*/ 6189WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand) 6190{ 6191 Image 6192 *magnify_image; 6193 6194 assert(wand != (MagickWand *) NULL); 6195 assert(wand->signature == WandSignature); 6196 if (wand->debug != MagickFalse) 6197 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6198 if (wand->images == (Image *) NULL) 6199 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6200 magnify_image=MagnifyImage(wand->images,wand->exception); 6201 if (magnify_image == (Image *) NULL) 6202 return(MagickFalse); 6203 ReplaceImageInList(&wand->images,magnify_image); 6204 return(MagickTrue); 6205} 6206 6207/* 6208%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6209% % 6210% % 6211% % 6212% M a g i c k M e r g e I m a g e L a y e r s % 6213% % 6214% % 6215% % 6216%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6217% 6218% MagickMergeImageLayers() composes all the image layers from the current 6219% given image onward to produce a single image of the merged layers. 6220% 6221% The inital canvas's size depends on the given ImageLayerMethod, and is 6222% initialized using the first images background color. The images 6223% are then compositied onto that image in sequence using the given 6224% composition that has been assigned to each individual image. 6225% 6226% The format of the MagickMergeImageLayers method is: 6227% 6228% MagickWand *MagickMergeImageLayers(MagickWand *wand, 6229% const ImageLayerMethod method) 6230% 6231% A description of each parameter follows: 6232% 6233% o wand: the magick wand. 6234% 6235% o method: the method of selecting the size of the initial canvas. 6236% 6237% MergeLayer: Merge all layers onto a canvas just large enough 6238% to hold all the actual images. The virtual canvas of the 6239% first image is preserved but otherwise ignored. 6240% 6241% FlattenLayer: Use the virtual canvas size of first image. 6242% Images which fall outside this canvas is clipped. 6243% This can be used to 'fill out' a given virtual canvas. 6244% 6245% MosaicLayer: Start with the virtual canvas of the first image, 6246% enlarging left and right edges to contain all images. 6247% Images with negative offsets will be clipped. 6248% 6249*/ 6250WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand, 6251 const ImageLayerMethod method) 6252{ 6253 Image 6254 *mosaic_image; 6255 6256 assert(wand != (MagickWand *) NULL); 6257 assert(wand->signature == WandSignature); 6258 if (wand->debug != MagickFalse) 6259 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6260 if (wand->images == (Image *) NULL) 6261 return((MagickWand *) NULL); 6262 mosaic_image=MergeImageLayers(wand->images,method,wand->exception); 6263 if (mosaic_image == (Image *) NULL) 6264 return((MagickWand *) NULL); 6265 return(CloneMagickWandFromImages(wand,mosaic_image)); 6266} 6267 6268/* 6269%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6270% % 6271% % 6272% % 6273% M a g i c k M i n i f y I m a g e % 6274% % 6275% % 6276% % 6277%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6278% 6279% MagickMinifyImage() is a convenience method that scales an image 6280% proportionally to one-half its original size 6281% 6282% The format of the MagickMinifyImage method is: 6283% 6284% MagickBooleanType MagickMinifyImage(MagickWand *wand) 6285% 6286% A description of each parameter follows: 6287% 6288% o wand: the magick wand. 6289% 6290*/ 6291WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand) 6292{ 6293 Image 6294 *minify_image; 6295 6296 assert(wand != (MagickWand *) NULL); 6297 assert(wand->signature == WandSignature); 6298 if (wand->debug != MagickFalse) 6299 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6300 if (wand->images == (Image *) NULL) 6301 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6302 minify_image=MinifyImage(wand->images,wand->exception); 6303 if (minify_image == (Image *) NULL) 6304 return(MagickFalse); 6305 ReplaceImageInList(&wand->images,minify_image); 6306 return(MagickTrue); 6307} 6308 6309/* 6310%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6311% % 6312% % 6313% % 6314% M a g i c k M o d u l a t e I m a g e % 6315% % 6316% % 6317% % 6318%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6319% 6320% MagickModulateImage() lets you control the brightness, saturation, and hue 6321% of an image. Hue is the percentage of absolute rotation from the current 6322% position. For example 50 results in a counter-clockwise rotation of 90 6323% degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200 6324% both resulting in a rotation of 180 degrees. 6325% 6326% To increase the color brightness by 20% and decrease the color saturation by 6327% 10% and leave the hue unchanged, use: 120,90,100. 6328% 6329% The format of the MagickModulateImage method is: 6330% 6331% MagickBooleanType MagickModulateImage(MagickWand *wand, 6332% const double brightness,const double saturation,const double hue) 6333% 6334% A description of each parameter follows: 6335% 6336% o wand: the magick wand. 6337% 6338% o brightness: the percent change in brighness. 6339% 6340% o saturation: the percent change in saturation. 6341% 6342% o hue: the percent change in hue. 6343% 6344*/ 6345WandExport MagickBooleanType MagickModulateImage(MagickWand *wand, 6346 const double brightness,const double saturation,const double hue) 6347{ 6348 char 6349 modulate[MaxTextExtent]; 6350 6351 MagickBooleanType 6352 status; 6353 6354 assert(wand != (MagickWand *) NULL); 6355 assert(wand->signature == WandSignature); 6356 if (wand->debug != MagickFalse) 6357 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6358 if (wand->images == (Image *) NULL) 6359 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6360 (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g", 6361 brightness,saturation,hue); 6362 status=ModulateImage(wand->images,modulate); 6363 if (status == MagickFalse) 6364 InheritException(wand->exception,&wand->images->exception); 6365 return(status); 6366} 6367 6368/* 6369%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6370% % 6371% % 6372% % 6373% M a g i c k M o n t a g e I m a g e % 6374% % 6375% % 6376% % 6377%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6378% 6379% MagickMontageImage() creates a composite image by combining several 6380% separate images. The images are tiled on the composite image with the name 6381% of the image optionally appearing just below the individual tile. 6382% 6383% The format of the MagickMontageImage method is: 6384% 6385% MagickWand *MagickMontageImage(MagickWand *wand, 6386% const DrawingWand drawing_wand,const char *tile_geometry, 6387% const char *thumbnail_geometry,const MontageMode mode, 6388% const char *frame) 6389% 6390% A description of each parameter follows: 6391% 6392% o wand: the magick wand. 6393% 6394% o drawing_wand: the drawing wand. The font name, size, and color are 6395% obtained from this wand. 6396% 6397% o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0). 6398% 6399% o thumbnail_geometry: Preferred image size and border size of each 6400% thumbnail (e.g. 120x120+4+3>). 6401% 6402% o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate. 6403% 6404% o frame: Surround the image with an ornamental border (e.g. 15x15+3+3). 6405% The frame color is that of the thumbnail's matte color. 6406% 6407*/ 6408WandExport MagickWand *MagickMontageImage(MagickWand *wand, 6409 const DrawingWand *drawing_wand,const char *tile_geometry, 6410 const char *thumbnail_geometry,const MontageMode mode,const char *frame) 6411{ 6412 char 6413 *font; 6414 6415 Image 6416 *montage_image; 6417 6418 MontageInfo 6419 *montage_info; 6420 6421 PixelWand 6422 *pixel_wand; 6423 6424 assert(wand != (MagickWand *) NULL); 6425 assert(wand->signature == WandSignature); 6426 if (wand->debug != MagickFalse) 6427 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6428 if (wand->images == (Image *) NULL) 6429 return((MagickWand *) NULL); 6430 montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL); 6431 switch (mode) 6432 { 6433 case FrameMode: 6434 { 6435 (void) CloneString(&montage_info->frame,"15x15+3+3"); 6436 montage_info->shadow=MagickTrue; 6437 break; 6438 } 6439 case UnframeMode: 6440 { 6441 montage_info->frame=(char *) NULL; 6442 montage_info->shadow=MagickFalse; 6443 montage_info->border_width=0; 6444 break; 6445 } 6446 case ConcatenateMode: 6447 { 6448 montage_info->frame=(char *) NULL; 6449 montage_info->shadow=MagickFalse; 6450 (void) CloneString(&montage_info->geometry,"+0+0"); 6451 montage_info->border_width=0; 6452 break; 6453 } 6454 default: 6455 break; 6456 } 6457 font=DrawGetFont(drawing_wand); 6458 if (font != (char *) NULL) 6459 (void) CloneString(&montage_info->font,font); 6460 if (frame != (char *) NULL) 6461 (void) CloneString(&montage_info->frame,frame); 6462 montage_info->pointsize=DrawGetFontSize(drawing_wand); 6463 pixel_wand=NewPixelWand(); 6464 DrawGetFillColor(drawing_wand,pixel_wand); 6465 PixelGetQuantumPacket(pixel_wand,&montage_info->fill); 6466 DrawGetStrokeColor(drawing_wand,pixel_wand); 6467 PixelGetQuantumPacket(pixel_wand,&montage_info->stroke); 6468 pixel_wand=DestroyPixelWand(pixel_wand); 6469 if (thumbnail_geometry != (char *) NULL) 6470 (void) CloneString(&montage_info->geometry,thumbnail_geometry); 6471 if (tile_geometry != (char *) NULL) 6472 (void) CloneString(&montage_info->tile,tile_geometry); 6473 montage_image=MontageImageList(wand->image_info,montage_info,wand->images, 6474 wand->exception); 6475 montage_info=DestroyMontageInfo(montage_info); 6476 if (montage_image == (Image *) NULL) 6477 return((MagickWand *) NULL); 6478 return(CloneMagickWandFromImages(wand,montage_image)); 6479} 6480 6481/* 6482%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6483% % 6484% % 6485% % 6486% M a g i c k M o r p h I m a g e s % 6487% % 6488% % 6489% % 6490%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6491% 6492% MagickMorphImages() method morphs a set of images. Both the image pixels 6493% and size are linearly interpolated to give the appearance of a 6494% meta-morphosis from one image to the next. 6495% 6496% The format of the MagickMorphImages method is: 6497% 6498% MagickWand *MagickMorphImages(MagickWand *wand, 6499% const size_t number_frames) 6500% 6501% A description of each parameter follows: 6502% 6503% o wand: the magick wand. 6504% 6505% o number_frames: the number of in-between images to generate. 6506% 6507*/ 6508WandExport MagickWand *MagickMorphImages(MagickWand *wand, 6509 const size_t number_frames) 6510{ 6511 Image 6512 *morph_image; 6513 6514 assert(wand != (MagickWand *) NULL); 6515 assert(wand->signature == WandSignature); 6516 if (wand->debug != MagickFalse) 6517 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6518 if (wand->images == (Image *) NULL) 6519 return((MagickWand *) NULL); 6520 morph_image=MorphImages(wand->images,number_frames,wand->exception); 6521 if (morph_image == (Image *) NULL) 6522 return((MagickWand *) NULL); 6523 return(CloneMagickWandFromImages(wand,morph_image)); 6524} 6525 6526/* 6527%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6528% % 6529% % 6530% % 6531% M a g i c k M o r p h o l o g y I m a g e % 6532% % 6533% % 6534% % 6535%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6536% 6537% MagickMorphologyImage() applies a user supplied kernel to the image 6538% according to the given mophology method. 6539% 6540% The format of the MagickMorphologyImage method is: 6541% 6542% MagickBooleanType MagickMorphologyImage(MagickWand *wand, 6543% MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel) 6544% 6545% A description of each parameter follows: 6546% 6547% o wand: the magick wand. 6548% 6549% o method: the morphology method to be applied. 6550% 6551% o iterations: apply the operation this many times (or no change). 6552% A value of -1 means loop until no change found. How this is applied 6553% may depend on the morphology method. Typically this is a value of 1. 6554% 6555% o kernel: An array of doubles representing the morphology kernel. 6556% 6557*/ 6558WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand, 6559 MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel) 6560{ 6561 Image 6562 *morphology_image; 6563 6564 assert(wand != (MagickWand *) NULL); 6565 assert(wand->signature == WandSignature); 6566 if (wand->debug != MagickFalse) 6567 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6568 if (kernel == (const KernelInfo *) NULL) 6569 return(MagickFalse); 6570 if (wand->images == (Image *) NULL) 6571 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6572 morphology_image=MorphologyImage(wand->images,method,iterations,kernel, 6573 wand->exception); 6574 if (morphology_image == (Image *) NULL) 6575 return(MagickFalse); 6576 ReplaceImageInList(&wand->images,morphology_image); 6577 return(MagickTrue); 6578} 6579 6580/* 6581%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6582% % 6583% % 6584% % 6585% M a g i c k M o t i o n B l u r I m a g e % 6586% % 6587% % 6588% % 6589%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6590% 6591% MagickMotionBlurImage() simulates motion blur. We convolve the image with a 6592% Gaussian operator of the given radius and standard deviation (sigma). 6593% For reasonable results, radius should be larger than sigma. Use a 6594% radius of 0 and MotionBlurImage() selects a suitable radius for you. 6595% Angle gives the angle of the blurring motion. 6596% 6597% The format of the MagickMotionBlurImage method is: 6598% 6599% MagickBooleanType MagickMotionBlurImage(MagickWand *wand, 6600% const double radius,const double sigma,const double angle) 6601% 6602% A description of each parameter follows: 6603% 6604% o wand: the magick wand. 6605% 6606% o radius: the radius of the Gaussian, in pixels, not counting 6607% the center pixel. 6608% 6609% o sigma: the standard deviation of the Gaussian, in pixels. 6610% 6611% o angle: Apply the effect along this angle. 6612% 6613*/ 6614WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand, 6615 const double radius,const double sigma,const double angle) 6616{ 6617 Image 6618 *blur_image; 6619 6620 assert(wand != (MagickWand *) NULL); 6621 assert(wand->signature == WandSignature); 6622 if (wand->debug != MagickFalse) 6623 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6624 if (wand->images == (Image *) NULL) 6625 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6626 blur_image=MotionBlurImage(wand->images,radius,sigma,angle,wand->exception); 6627 if (blur_image == (Image *) NULL) 6628 return(MagickFalse); 6629 ReplaceImageInList(&wand->images,blur_image); 6630 return(MagickTrue); 6631} 6632 6633/* 6634%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6635% % 6636% % 6637% % 6638% M a g i c k N e g a t e I m a g e % 6639% % 6640% % 6641% % 6642%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6643% 6644% MagickNegateImage() negates the colors in the reference image. The 6645% Grayscale option means that only grayscale values within the image are 6646% negated. 6647% 6648% You can also reduce the influence of a particular channel with a gamma 6649% value of 0. 6650% 6651% The format of the MagickNegateImage method is: 6652% 6653% MagickBooleanType MagickNegateImage(MagickWand *wand, 6654% const MagickBooleanType gray) 6655% 6656% A description of each parameter follows: 6657% 6658% o wand: the magick wand. 6659% 6660% o gray: If MagickTrue, only negate grayscale pixels within the image. 6661% 6662*/ 6663WandExport MagickBooleanType MagickNegateImage(MagickWand *wand, 6664 const MagickBooleanType gray) 6665{ 6666 MagickBooleanType 6667 status; 6668 6669 assert(wand != (MagickWand *) NULL); 6670 assert(wand->signature == WandSignature); 6671 if (wand->debug != MagickFalse) 6672 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6673 if (wand->images == (Image *) NULL) 6674 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6675 status=NegateImage(wand->images,gray); 6676 if (status == MagickFalse) 6677 InheritException(wand->exception,&wand->images->exception); 6678 return(status); 6679} 6680 6681/* 6682%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6683% % 6684% % 6685% % 6686% M a g i c k N e w I m a g e % 6687% % 6688% % 6689% % 6690%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6691% 6692% MagickNewImage() adds a blank image canvas of the specified size and 6693% background color to the wand. 6694% 6695% The format of the MagickNewImage method is: 6696% 6697% MagickBooleanType MagickNewImage(MagickWand *wand, 6698% const size_t columns,const size_t rows, 6699% const PixelWand *background) 6700% 6701% A description of each parameter follows: 6702% 6703% o wand: the magick wand. 6704% 6705% o width: the image width. 6706% 6707% o height: the image height. 6708% 6709% o background: the image color. 6710% 6711*/ 6712WandExport MagickBooleanType MagickNewImage(MagickWand *wand, 6713 const size_t width,const size_t height, 6714 const PixelWand *background) 6715{ 6716 Image 6717 *images; 6718 6719 PixelInfo 6720 pixel; 6721 6722 assert(wand != (MagickWand *) NULL); 6723 assert(wand->signature == WandSignature); 6724 if (wand->debug != MagickFalse) 6725 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6726 PixelGetMagickColor(background,&pixel); 6727 images=NewMagickImage(wand->image_info,width,height,&pixel); 6728 if (images == (Image *) NULL) 6729 return(MagickFalse); 6730 if (images->exception.severity != UndefinedException) 6731 InheritException(wand->exception,&images->exception); 6732 return(InsertImageInWand(wand,images)); 6733} 6734 6735/* 6736%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6737% % 6738% % 6739% % 6740% M a g i c k N e x t I m a g e % 6741% % 6742% % 6743% % 6744%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6745% 6746% MagickNextImage() associates the next image in the image list with a magick 6747% wand. 6748% 6749% The format of the MagickNextImage method is: 6750% 6751% MagickBooleanType MagickNextImage(MagickWand *wand) 6752% 6753% A description of each parameter follows: 6754% 6755% o wand: the magick wand. 6756% 6757*/ 6758WandExport MagickBooleanType MagickNextImage(MagickWand *wand) 6759{ 6760 assert(wand != (MagickWand *) NULL); 6761 assert(wand->signature == WandSignature); 6762 if (wand->debug != MagickFalse) 6763 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6764 if (wand->images == (Image *) NULL) 6765 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6766 if (wand->pend != MagickFalse) 6767 { 6768 wand->pend=MagickFalse; 6769 return(MagickTrue); 6770 } 6771 if (GetNextImageInList(wand->images) == (Image *) NULL) 6772 { 6773 wand->pend=MagickTrue; 6774 return(MagickFalse); 6775 } 6776 wand->images=GetNextImageInList(wand->images); 6777 return(MagickTrue); 6778} 6779 6780/* 6781%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6782% % 6783% % 6784% % 6785% M a g i c k N o r m a l i z e I m a g e % 6786% % 6787% % 6788% % 6789%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6790% 6791% MagickNormalizeImage() enhances the contrast of a color image by adjusting 6792% the pixels color to span the entire range of colors available 6793% 6794% You can also reduce the influence of a particular channel with a gamma 6795% value of 0. 6796% 6797% The format of the MagickNormalizeImage method is: 6798% 6799% MagickBooleanType MagickNormalizeImage(MagickWand *wand) 6800% 6801% A description of each parameter follows: 6802% 6803% o wand: the magick wand. 6804% 6805*/ 6806WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand) 6807{ 6808 MagickBooleanType 6809 status; 6810 6811 assert(wand != (MagickWand *) NULL); 6812 assert(wand->signature == WandSignature); 6813 if (wand->debug != MagickFalse) 6814 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6815 if (wand->images == (Image *) NULL) 6816 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6817 status=NormalizeImage(wand->images); 6818 if (status == MagickFalse) 6819 InheritException(wand->exception,&wand->images->exception); 6820 return(status); 6821} 6822 6823/* 6824%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6825% % 6826% % 6827% % 6828% M a g i c k O i l P a i n t I m a g e % 6829% % 6830% % 6831% % 6832%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6833% 6834% MagickOilPaintImage() applies a special effect filter that simulates an oil 6835% painting. Each pixel is replaced by the most frequent color occurring 6836% in a circular region defined by radius. 6837% 6838% The format of the MagickOilPaintImage method is: 6839% 6840% MagickBooleanType MagickOilPaintImage(MagickWand *wand, 6841% const double radius) 6842% 6843% A description of each parameter follows: 6844% 6845% o wand: the magick wand. 6846% 6847% o radius: the radius of the circular neighborhood. 6848% 6849*/ 6850WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand, 6851 const double radius) 6852{ 6853 Image 6854 *paint_image; 6855 6856 assert(wand != (MagickWand *) NULL); 6857 assert(wand->signature == WandSignature); 6858 if (wand->debug != MagickFalse) 6859 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6860 if (wand->images == (Image *) NULL) 6861 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6862 paint_image=OilPaintImage(wand->images,radius,wand->exception); 6863 if (paint_image == (Image *) NULL) 6864 return(MagickFalse); 6865 ReplaceImageInList(&wand->images,paint_image); 6866 return(MagickTrue); 6867} 6868 6869/* 6870%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6871% % 6872% % 6873% % 6874% M a g i c k O p a q u e P a i n t I m a g e % 6875% % 6876% % 6877% % 6878%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6879% 6880% MagickOpaquePaintImage() changes any pixel that matches color with the color 6881% defined by fill. 6882% 6883% The format of the MagickOpaquePaintImage method is: 6884% 6885% MagickBooleanType MagickOpaquePaintImage(MagickWand *wand, 6886% const PixelWand *target,const PixelWand *fill,const double fuzz, 6887% const MagickBooleanType invert) 6888% 6889% A description of each parameter follows: 6890% 6891% o wand: the magick wand. 6892% 6893% o target: Change this target color to the fill color within the image. 6894% 6895% o fill: the fill pixel wand. 6896% 6897% o fuzz: By default target must match a particular pixel color 6898% exactly. However, in many cases two colors may differ by a small amount. 6899% The fuzz member of image defines how much tolerance is acceptable to 6900% consider two colors as the same. For example, set fuzz to 10 and the 6901% color red at intensities of 100 and 102 respectively are now interpreted 6902% as the same color for the purposes of the floodfill. 6903% 6904% o invert: paint any pixel that does not match the target color. 6905% 6906*/ 6907WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand, 6908 const PixelWand *target,const PixelWand *fill,const double fuzz, 6909 const MagickBooleanType invert) 6910{ 6911 MagickBooleanType 6912 status; 6913 6914 PixelInfo 6915 fill_pixel, 6916 target_pixel; 6917 6918 assert(wand != (MagickWand *) NULL); 6919 assert(wand->signature == WandSignature); 6920 if (wand->debug != MagickFalse) 6921 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6922 if (wand->images == (Image *) NULL) 6923 ThrowWandException(WandError,"ContainsNoImages",wand->name); 6924 PixelGetMagickColor(target,&target_pixel); 6925 PixelGetMagickColor(fill,&fill_pixel); 6926 wand->images->fuzz=fuzz; 6927 status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert); 6928 if (status == MagickFalse) 6929 InheritException(wand->exception,&wand->images->exception); 6930 return(status); 6931} 6932 6933/* 6934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6935% % 6936% % 6937% % 6938% M a g i c k O p t i m i z e I m a g e L a y e r s % 6939% % 6940% % 6941% % 6942%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6943% 6944% MagickOptimizeImageLayers() compares each image the GIF disposed forms of the 6945% previous image in the sequence. From this it attempts to select the 6946% smallest cropped image to replace each frame, while preserving the results 6947% of the animation. 6948% 6949% The format of the MagickOptimizeImageLayers method is: 6950% 6951% MagickWand *MagickOptimizeImageLayers(MagickWand *wand) 6952% 6953% A description of each parameter follows: 6954% 6955% o wand: the magick wand. 6956% 6957*/ 6958WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand) 6959{ 6960 Image 6961 *optimize_image; 6962 6963 assert(wand != (MagickWand *) NULL); 6964 assert(wand->signature == WandSignature); 6965 if (wand->debug != MagickFalse) 6966 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 6967 if (wand->images == (Image *) NULL) 6968 return((MagickWand *) NULL); 6969 optimize_image=OptimizeImageLayers(wand->images,wand->exception); 6970 if (optimize_image == (Image *) NULL) 6971 return((MagickWand *) NULL); 6972 return(CloneMagickWandFromImages(wand,optimize_image)); 6973} 6974 6975/* 6976%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6977% % 6978% % 6979% % 6980% M a g i c k O r d e r e d P o s t e r i z e I m a g e % 6981% % 6982% % 6983% % 6984%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6985% 6986% MagickOrderedPosterizeImage() performs an ordered dither based on a number 6987% of pre-defined dithering threshold maps, but over multiple intensity levels, 6988% which can be different for different channels, according to the input 6989% arguments. 6990% 6991% The format of the MagickOrderedPosterizeImage method is: 6992% 6993% MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand, 6994% const char *threshold_map) 6995% 6996% A description of each parameter follows: 6997% 6998% o image: the image. 6999% 7000% o threshold_map: A string containing the name of the threshold dither 7001% map to use, followed by zero or more numbers representing the number of 7002% color levels tho dither between. 7003% 7004% Any level number less than 2 is equivalent to 2, and means only binary 7005% dithering will be applied to each color channel. 7006% 7007% No numbers also means a 2 level (bitmap) dither will be applied to all 7008% channels, while a single number is the number of levels applied to each 7009% channel in sequence. More numbers will be applied in turn to each of 7010% the color channels. 7011% 7012% For example: "o3x3,6" generates a 6 level posterization of the image 7013% with a ordered 3x3 diffused pixel dither being applied between each 7014% level. While checker,8,8,4 will produce a 332 colormaped image with 7015% only a single checkerboard hash pattern (50% grey) between each color 7016% level, to basically double the number of color levels with a bare 7017% minimim of dithering. 7018% 7019*/ 7020WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand, 7021 const char *threshold_map) 7022{ 7023 MagickBooleanType 7024 status; 7025 7026 assert(wand != (MagickWand *) NULL); 7027 assert(wand->signature == WandSignature); 7028 if (wand->debug != MagickFalse) 7029 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7030 if (wand->images == (Image *) NULL) 7031 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7032 status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception); 7033 return(status); 7034} 7035 7036/* 7037%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7038% % 7039% % 7040% % 7041% M a g i c k P i n g I m a g e % 7042% % 7043% % 7044% % 7045%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7046% 7047% MagickPingImage() is like MagickReadImage() except the only valid 7048% information returned is the image width, height, size, and format. It 7049% is designed to efficiently obtain this information from a file without 7050% reading the entire image sequence into memory. 7051% 7052% The format of the MagickPingImage method is: 7053% 7054% MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename) 7055% 7056% A description of each parameter follows: 7057% 7058% o wand: the magick wand. 7059% 7060% o filename: the image filename. 7061% 7062*/ 7063WandExport MagickBooleanType MagickPingImage(MagickWand *wand, 7064 const char *filename) 7065{ 7066 Image 7067 *images; 7068 7069 ImageInfo 7070 *ping_info; 7071 7072 assert(wand != (MagickWand *) NULL); 7073 assert(wand->signature == WandSignature); 7074 if (wand->debug != MagickFalse) 7075 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7076 ping_info=CloneImageInfo(wand->image_info); 7077 if (filename != (const char *) NULL) 7078 (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent); 7079 images=PingImage(ping_info,wand->exception); 7080 ping_info=DestroyImageInfo(ping_info); 7081 if (images == (Image *) NULL) 7082 return(MagickFalse); 7083 return(InsertImageInWand(wand,images)); 7084} 7085 7086/* 7087%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7088% % 7089% % 7090% % 7091% M a g i c k P i n g I m a g e B l o b % 7092% % 7093% % 7094% % 7095%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7096% 7097% MagickPingImageBlob() pings an image or image sequence from a blob. 7098% 7099% The format of the MagickPingImageBlob method is: 7100% 7101% MagickBooleanType MagickPingImageBlob(MagickWand *wand, 7102% const void *blob,const size_t length) 7103% 7104% A description of each parameter follows: 7105% 7106% o wand: the magick wand. 7107% 7108% o blob: the blob. 7109% 7110% o length: the blob length. 7111% 7112*/ 7113WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand, 7114 const void *blob,const size_t length) 7115{ 7116 Image 7117 *images; 7118 7119 ImageInfo 7120 *read_info; 7121 7122 assert(wand != (MagickWand *) NULL); 7123 assert(wand->signature == WandSignature); 7124 if (wand->debug != MagickFalse) 7125 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7126 read_info=CloneImageInfo(wand->image_info); 7127 SetImageInfoBlob(read_info,blob,length); 7128 images=PingImage(read_info,wand->exception); 7129 read_info=DestroyImageInfo(read_info); 7130 if (images == (Image *) NULL) 7131 return(MagickFalse); 7132 return(InsertImageInWand(wand,images)); 7133} 7134 7135/* 7136%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7137% % 7138% % 7139% % 7140% M a g i c k P i n g I m a g e F i l e % 7141% % 7142% % 7143% % 7144%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7145% 7146% MagickPingImageFile() pings an image or image sequence from an open file 7147% descriptor. 7148% 7149% The format of the MagickPingImageFile method is: 7150% 7151% MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file) 7152% 7153% A description of each parameter follows: 7154% 7155% o wand: the magick wand. 7156% 7157% o file: the file descriptor. 7158% 7159*/ 7160WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file) 7161{ 7162 Image 7163 *images; 7164 7165 ImageInfo 7166 *read_info; 7167 7168 assert(wand != (MagickWand *) NULL); 7169 assert(wand->signature == WandSignature); 7170 assert(file != (FILE *) NULL); 7171 if (wand->debug != MagickFalse) 7172 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7173 read_info=CloneImageInfo(wand->image_info); 7174 SetImageInfoFile(read_info,file); 7175 images=PingImage(read_info,wand->exception); 7176 read_info=DestroyImageInfo(read_info); 7177 if (images == (Image *) NULL) 7178 return(MagickFalse); 7179 return(InsertImageInWand(wand,images)); 7180} 7181 7182/* 7183%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7184% % 7185% % 7186% % 7187% M a g i c k P o l a r o i d I m a g e % 7188% % 7189% % 7190% % 7191%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7192% 7193% MagickPolaroidImage() simulates a Polaroid picture. 7194% 7195% The format of the MagickPolaroidImage method is: 7196% 7197% MagickBooleanType MagickPolaroidImage(MagickWand *wand, 7198% const DrawingWand *drawing_wand,const double angle) 7199% 7200% A description of each parameter follows: 7201% 7202% o wand: the magick wand. 7203% 7204% o drawing_wand: the draw wand. 7205% 7206% o angle: Apply the effect along this angle. 7207% 7208*/ 7209WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand, 7210 const DrawingWand *drawing_wand,const double angle) 7211{ 7212 DrawInfo 7213 *draw_info; 7214 7215 Image 7216 *polaroid_image; 7217 7218 assert(wand != (MagickWand *) NULL); 7219 assert(wand->signature == WandSignature); 7220 if (wand->debug != MagickFalse) 7221 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7222 if (wand->images == (Image *) NULL) 7223 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7224 draw_info=PeekDrawingWand(drawing_wand); 7225 if (draw_info == (DrawInfo *) NULL) 7226 return(MagickFalse); 7227 polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception); 7228 if (polaroid_image == (Image *) NULL) 7229 return(MagickFalse); 7230 ReplaceImageInList(&wand->images,polaroid_image); 7231 return(MagickTrue); 7232} 7233 7234/* 7235%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7236% % 7237% % 7238% % 7239% M a g i c k P o s t e r i z e I m a g e % 7240% % 7241% % 7242% % 7243%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7244% 7245% MagickPosterizeImage() reduces the image to a limited number of color level. 7246% 7247% The format of the MagickPosterizeImage method is: 7248% 7249% MagickBooleanType MagickPosterizeImage(MagickWand *wand, 7250% const unsigned levels,const MagickBooleanType dither) 7251% 7252% A description of each parameter follows: 7253% 7254% o wand: the magick wand. 7255% 7256% o levels: Number of color levels allowed in each channel. Very low values 7257% (2, 3, or 4) have the most visible effect. 7258% 7259% o dither: Set this integer value to something other than zero to dither 7260% the mapped image. 7261% 7262*/ 7263WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand, 7264 const size_t levels,const MagickBooleanType dither) 7265{ 7266 MagickBooleanType 7267 status; 7268 7269 assert(wand != (MagickWand *) NULL); 7270 assert(wand->signature == WandSignature); 7271 if (wand->debug != MagickFalse) 7272 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7273 if (wand->images == (Image *) NULL) 7274 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7275 status=PosterizeImage(wand->images,levels,dither); 7276 if (status == MagickFalse) 7277 InheritException(wand->exception,&wand->images->exception); 7278 return(status); 7279} 7280 7281/* 7282%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7283% % 7284% % 7285% % 7286% M a g i c k P r e v i e w I m a g e s % 7287% % 7288% % 7289% % 7290%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7291% 7292% MagickPreviewImages() tiles 9 thumbnails of the specified image with an 7293% image processing operation applied at varying strengths. This helpful 7294% to quickly pin-point an appropriate parameter for an image processing 7295% operation. 7296% 7297% The format of the MagickPreviewImages method is: 7298% 7299% MagickWand *MagickPreviewImages(MagickWand *wand, 7300% const PreviewType preview) 7301% 7302% A description of each parameter follows: 7303% 7304% o wand: the magick wand. 7305% 7306% o preview: the preview type. 7307% 7308*/ 7309WandExport MagickWand *MagickPreviewImages(MagickWand *wand, 7310 const PreviewType preview) 7311{ 7312 Image 7313 *preview_image; 7314 7315 assert(wand != (MagickWand *) NULL); 7316 assert(wand->signature == WandSignature); 7317 if (wand->debug != MagickFalse) 7318 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7319 if (wand->images == (Image *) NULL) 7320 return((MagickWand *) NULL); 7321 preview_image=PreviewImage(wand->images,preview,wand->exception); 7322 if (preview_image == (Image *) NULL) 7323 return((MagickWand *) NULL); 7324 return(CloneMagickWandFromImages(wand,preview_image)); 7325} 7326 7327/* 7328%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7329% % 7330% % 7331% % 7332% M a g i c k P r e v i o u s I m a g e % 7333% % 7334% % 7335% % 7336%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7337% 7338% MagickPreviousImage() assocates the previous image in an image list with 7339% the magick wand. 7340% 7341% The format of the MagickPreviousImage method is: 7342% 7343% MagickBooleanType MagickPreviousImage(MagickWand *wand) 7344% 7345% A description of each parameter follows: 7346% 7347% o wand: the magick wand. 7348% 7349*/ 7350WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand) 7351{ 7352 assert(wand != (MagickWand *) NULL); 7353 assert(wand->signature == WandSignature); 7354 if (wand->debug != MagickFalse) 7355 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7356 if (wand->images == (Image *) NULL) 7357 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7358 if (wand->pend != MagickFalse) 7359 { 7360 wand->pend=MagickFalse; 7361 return(MagickTrue); 7362 } 7363 if (GetPreviousImageInList(wand->images) == (Image *) NULL) 7364 { 7365 wand->pend=MagickTrue; 7366 return(MagickFalse); 7367 } 7368 wand->images=GetPreviousImageInList(wand->images); 7369 return(MagickTrue); 7370} 7371 7372/* 7373%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7374% % 7375% % 7376% % 7377% M a g i c k Q u a n t i z e I m a g e % 7378% % 7379% % 7380% % 7381%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7382% 7383% MagickQuantizeImage() analyzes the colors within a reference image and 7384% chooses a fixed number of colors to represent the image. The goal of the 7385% algorithm is to minimize the color difference between the input and output 7386% image while minimizing the processing time. 7387% 7388% The format of the MagickQuantizeImage method is: 7389% 7390% MagickBooleanType MagickQuantizeImage(MagickWand *wand, 7391% const size_t number_colors,const ColorspaceType colorspace, 7392% const size_t treedepth,const MagickBooleanType dither, 7393% const MagickBooleanType measure_error) 7394% 7395% A description of each parameter follows: 7396% 7397% o wand: the magick wand. 7398% 7399% o number_colors: the number of colors. 7400% 7401% o colorspace: Perform color reduction in this colorspace, typically 7402% RGBColorspace. 7403% 7404% o treedepth: Normally, this integer value is zero or one. A zero or 7405% one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the 7406% reference image with the least amount of memory and the fastest 7407% computational speed. In some cases, such as an image with low color 7408% dispersion (a few number of colors), a value other than 7409% Log4(number_colors) is required. To expand the color tree completely, 7410% use a value of 8. 7411% 7412% o dither: A value other than zero distributes the difference between an 7413% original image and the corresponding color reduced image to 7414% neighboring pixels along a Hilbert curve. 7415% 7416% o measure_error: A value other than zero measures the difference between 7417% the original and quantized images. This difference is the total 7418% quantization error. The error is computed by summing over all pixels 7419% in an image the distance squared in RGB space between each reference 7420% pixel value and its quantized value. 7421% 7422*/ 7423WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand, 7424 const size_t number_colors,const ColorspaceType colorspace, 7425 const size_t treedepth,const MagickBooleanType dither, 7426 const MagickBooleanType measure_error) 7427{ 7428 MagickBooleanType 7429 status; 7430 7431 QuantizeInfo 7432 *quantize_info; 7433 7434 assert(wand != (MagickWand *) NULL); 7435 assert(wand->signature == WandSignature); 7436 if (wand->debug != MagickFalse) 7437 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7438 if (wand->images == (Image *) NULL) 7439 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7440 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL); 7441 quantize_info->number_colors=number_colors; 7442 quantize_info->dither=dither; 7443 quantize_info->tree_depth=treedepth; 7444 quantize_info->colorspace=colorspace; 7445 quantize_info->measure_error=measure_error; 7446 status=QuantizeImage(quantize_info,wand->images); 7447 if (status == MagickFalse) 7448 InheritException(wand->exception,&wand->images->exception); 7449 quantize_info=DestroyQuantizeInfo(quantize_info); 7450 return(status); 7451} 7452 7453/* 7454%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7455% % 7456% % 7457% % 7458% M a g i c k Q u a n t i z e I m a g e s % 7459% % 7460% % 7461% % 7462%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7463% 7464% MagickQuantizeImages() analyzes the colors within a sequence of images and 7465% chooses a fixed number of colors to represent the image. The goal of the 7466% algorithm is to minimize the color difference between the input and output 7467% image while minimizing the processing time. 7468% 7469% The format of the MagickQuantizeImages method is: 7470% 7471% MagickBooleanType MagickQuantizeImages(MagickWand *wand, 7472% const size_t number_colors,const ColorspaceType colorspace, 7473% const size_t treedepth,const MagickBooleanType dither, 7474% const MagickBooleanType measure_error) 7475% 7476% A description of each parameter follows: 7477% 7478% o wand: the magick wand. 7479% 7480% o number_colors: the number of colors. 7481% 7482% o colorspace: Perform color reduction in this colorspace, typically 7483% RGBColorspace. 7484% 7485% o treedepth: Normally, this integer value is zero or one. A zero or 7486% one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the 7487% reference image with the least amount of memory and the fastest 7488% computational speed. In some cases, such as an image with low color 7489% dispersion (a few number of colors), a value other than 7490% Log4(number_colors) is required. To expand the color tree completely, 7491% use a value of 8. 7492% 7493% o dither: A value other than zero distributes the difference between an 7494% original image and the corresponding color reduced algorithm to 7495% neighboring pixels along a Hilbert curve. 7496% 7497% o measure_error: A value other than zero measures the difference between 7498% the original and quantized images. This difference is the total 7499% quantization error. The error is computed by summing over all pixels 7500% in an image the distance squared in RGB space between each reference 7501% pixel value and its quantized value. 7502% 7503*/ 7504WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand, 7505 const size_t number_colors,const ColorspaceType colorspace, 7506 const size_t treedepth,const MagickBooleanType dither, 7507 const MagickBooleanType measure_error) 7508{ 7509 MagickBooleanType 7510 status; 7511 7512 QuantizeInfo 7513 *quantize_info; 7514 7515 assert(wand != (MagickWand *) NULL); 7516 assert(wand->signature == WandSignature); 7517 if (wand->debug != MagickFalse) 7518 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7519 if (wand->images == (Image *) NULL) 7520 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7521 quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL); 7522 quantize_info->number_colors=number_colors; 7523 quantize_info->dither=dither; 7524 quantize_info->tree_depth=treedepth; 7525 quantize_info->colorspace=colorspace; 7526 quantize_info->measure_error=measure_error; 7527 status=QuantizeImages(quantize_info,wand->images); 7528 if (status == MagickFalse) 7529 InheritException(wand->exception,&wand->images->exception); 7530 quantize_info=DestroyQuantizeInfo(quantize_info); 7531 return(status); 7532} 7533 7534/* 7535%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7536% % 7537% % 7538% % 7539% M a g i c k R a d i a l B l u r I m a g e % 7540% % 7541% % 7542% % 7543%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7544% 7545% MagickRadialBlurImage() radial blurs an image. 7546% 7547% The format of the MagickRadialBlurImage method is: 7548% 7549% MagickBooleanType MagickRadialBlurImage(MagickWand *wand, 7550% const double angle) 7551% 7552% A description of each parameter follows: 7553% 7554% o wand: the magick wand. 7555% 7556% o angle: the angle of the blur in degrees. 7557% 7558*/ 7559WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand, 7560 const double angle) 7561{ 7562 Image 7563 *blur_image; 7564 7565 assert(wand != (MagickWand *) NULL); 7566 assert(wand->signature == WandSignature); 7567 if (wand->debug != MagickFalse) 7568 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7569 if (wand->images == (Image *) NULL) 7570 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7571 blur_image=RadialBlurImage(wand->images,angle,wand->exception); 7572 if (blur_image == (Image *) NULL) 7573 return(MagickFalse); 7574 ReplaceImageInList(&wand->images,blur_image); 7575 return(MagickTrue); 7576} 7577 7578/* 7579%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7580% % 7581% % 7582% % 7583% M a g i c k R a i s e I m a g e % 7584% % 7585% % 7586% % 7587%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7588% 7589% MagickRaiseImage() creates a simulated three-dimensional button-like effect 7590% by lightening and darkening the edges of the image. Members width and 7591% height of raise_info define the width of the vertical and horizontal 7592% edge of the effect. 7593% 7594% The format of the MagickRaiseImage method is: 7595% 7596% MagickBooleanType MagickRaiseImage(MagickWand *wand, 7597% const size_t width,const size_t height,const ssize_t x, 7598% const ssize_t y,const MagickBooleanType raise) 7599% 7600% A description of each parameter follows: 7601% 7602% o wand: the magick wand. 7603% 7604% o width,height,x,y: Define the dimensions of the area to raise. 7605% 7606% o raise: A value other than zero creates a 3-D raise effect, 7607% otherwise it has a lowered effect. 7608% 7609*/ 7610WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand, 7611 const size_t width,const size_t height,const ssize_t x, 7612 const ssize_t y,const MagickBooleanType raise) 7613{ 7614 MagickBooleanType 7615 status; 7616 7617 RectangleInfo 7618 raise_info; 7619 7620 assert(wand != (MagickWand *) NULL); 7621 assert(wand->signature == WandSignature); 7622 if (wand->debug != MagickFalse) 7623 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7624 if (wand->images == (Image *) NULL) 7625 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7626 raise_info.width=width; 7627 raise_info.height=height; 7628 raise_info.x=x; 7629 raise_info.y=y; 7630 status=RaiseImage(wand->images,&raise_info,raise); 7631 if (status == MagickFalse) 7632 InheritException(wand->exception,&wand->images->exception); 7633 return(status); 7634} 7635 7636/* 7637%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7638% % 7639% % 7640% % 7641% M a g i c k R a n d o m T h r e s h o l d I m a g e % 7642% % 7643% % 7644% % 7645%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7646% 7647% MagickRandomThresholdImage() changes the value of individual pixels based on 7648% the intensity of each pixel compared to threshold. The result is a 7649% high-contrast, two color image. 7650% 7651% The format of the MagickRandomThresholdImage method is: 7652% 7653% MagickBooleanType MagickRandomThresholdImage(MagickWand *wand, 7654% const double low,const double high) 7655% 7656% A description of each parameter follows: 7657% 7658% o wand: the magick wand. 7659% 7660% o low,high: Specify the high and low thresholds. These values range from 7661% 0 to QuantumRange. 7662% 7663*/ 7664WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand, 7665 const double low,const double high) 7666{ 7667 char 7668 threshold[MaxTextExtent]; 7669 7670 MagickBooleanType 7671 status; 7672 7673 assert(wand != (MagickWand *) NULL); 7674 assert(wand->signature == WandSignature); 7675 if (wand->debug != MagickFalse) 7676 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7677 if (wand->images == (Image *) NULL) 7678 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7679 (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high); 7680 status=RandomThresholdImage(wand->images,threshold,wand->exception); 7681 if (status == MagickFalse) 7682 InheritException(wand->exception,&wand->images->exception); 7683 return(status); 7684} 7685 7686/* 7687%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7688% % 7689% % 7690% % 7691% M a g i c k R e a d I m a g e % 7692% % 7693% % 7694% % 7695%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7696% 7697% MagickReadImage() reads an image or image sequence. The images are inserted 7698% at the current image pointer position. Use MagickSetFirstIterator(), 7699% MagickSetLastIterator, or MagickSetImageIndex() to specify the current 7700% image pointer position at the beginning of the image list, the end, or 7701% anywhere in-between respectively. 7702% 7703% The format of the MagickReadImage method is: 7704% 7705% MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename) 7706% 7707% A description of each parameter follows: 7708% 7709% o wand: the magick wand. 7710% 7711% o filename: the image filename. 7712% 7713*/ 7714WandExport MagickBooleanType MagickReadImage(MagickWand *wand, 7715 const char *filename) 7716{ 7717 Image 7718 *images; 7719 7720 ImageInfo 7721 *read_info; 7722 7723 assert(wand != (MagickWand *) NULL); 7724 assert(wand->signature == WandSignature); 7725 if (wand->debug != MagickFalse) 7726 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7727 read_info=CloneImageInfo(wand->image_info); 7728 if (filename != (const char *) NULL) 7729 (void) CopyMagickString(read_info->filename,filename,MaxTextExtent); 7730 images=ReadImage(read_info,wand->exception); 7731 read_info=DestroyImageInfo(read_info); 7732 if (images == (Image *) NULL) 7733 return(MagickFalse); 7734 return(InsertImageInWand(wand,images)); 7735} 7736 7737/* 7738%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7739% % 7740% % 7741% % 7742% M a g i c k R e a d I m a g e B l o b % 7743% % 7744% % 7745% % 7746%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7747% 7748% MagickReadImageBlob() reads an image or image sequence from a blob. 7749% 7750% The format of the MagickReadImageBlob method is: 7751% 7752% MagickBooleanType MagickReadImageBlob(MagickWand *wand, 7753% const void *blob,const size_t length) 7754% 7755% A description of each parameter follows: 7756% 7757% o wand: the magick wand. 7758% 7759% o blob: the blob. 7760% 7761% o length: the blob length. 7762% 7763*/ 7764WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand, 7765 const void *blob,const size_t length) 7766{ 7767 Image 7768 *images; 7769 7770 assert(wand != (MagickWand *) NULL); 7771 assert(wand->signature == WandSignature); 7772 if (wand->debug != MagickFalse) 7773 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7774 images=BlobToImage(wand->image_info,blob,length,wand->exception); 7775 if (images == (Image *) NULL) 7776 return(MagickFalse); 7777 return(InsertImageInWand(wand,images)); 7778} 7779 7780/* 7781%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7782% % 7783% % 7784% % 7785% M a g i c k R e a d I m a g e F i l e % 7786% % 7787% % 7788% % 7789%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7790% 7791% MagickReadImageFile() reads an image or image sequence from an open file 7792% descriptor. 7793% 7794% The format of the MagickReadImageFile method is: 7795% 7796% MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file) 7797% 7798% A description of each parameter follows: 7799% 7800% o wand: the magick wand. 7801% 7802% o file: the file descriptor. 7803% 7804*/ 7805WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file) 7806{ 7807 Image 7808 *images; 7809 7810 ImageInfo 7811 *read_info; 7812 7813 assert(wand != (MagickWand *) NULL); 7814 assert(wand->signature == WandSignature); 7815 assert(file != (FILE *) NULL); 7816 if (wand->debug != MagickFalse) 7817 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7818 read_info=CloneImageInfo(wand->image_info); 7819 SetImageInfoFile(read_info,file); 7820 images=ReadImage(read_info,wand->exception); 7821 read_info=DestroyImageInfo(read_info); 7822 if (images == (Image *) NULL) 7823 return(MagickFalse); 7824 return(InsertImageInWand(wand,images)); 7825} 7826 7827/* 7828%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7829% % 7830% % 7831% % 7832% M a g i c k R e m a p I m a g e % 7833% % 7834% % 7835% % 7836%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7837% 7838% MagickRemapImage() replaces the colors of an image with the closest color 7839% from a reference image. 7840% 7841% The format of the MagickRemapImage method is: 7842% 7843% MagickBooleanType MagickRemapImage(MagickWand *wand, 7844% const MagickWand *remap_wand,const DitherMethod method) 7845% 7846% A description of each parameter follows: 7847% 7848% o wand: the magick wand. 7849% 7850% o affinity: the affinity wand. 7851% 7852% o method: choose from these dither methods: NoDitherMethod, 7853% RiemersmaDitherMethod, or FloydSteinbergDitherMethod. 7854% 7855*/ 7856WandExport MagickBooleanType MagickRemapImage(MagickWand *wand, 7857 const MagickWand *remap_wand,const DitherMethod method) 7858{ 7859 MagickBooleanType 7860 status; 7861 7862 QuantizeInfo 7863 *quantize_info; 7864 7865 assert(wand != (MagickWand *) NULL); 7866 assert(wand->signature == WandSignature); 7867 if (wand->debug != MagickFalse) 7868 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7869 if ((wand->images == (Image *) NULL) || 7870 (remap_wand->images == (Image *) NULL)) 7871 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7872 quantize_info=AcquireQuantizeInfo(wand->image_info); 7873 quantize_info->dither_method=method; 7874 if (method == NoDitherMethod) 7875 quantize_info->dither=MagickFalse; 7876 status=RemapImage(quantize_info,wand->images,remap_wand->images); 7877 quantize_info=DestroyQuantizeInfo(quantize_info); 7878 if (status == MagickFalse) 7879 InheritException(wand->exception,&wand->images->exception); 7880 return(status); 7881} 7882 7883/* 7884%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7885% % 7886% % 7887% % 7888% M a g i c k R e m o v e I m a g e % 7889% % 7890% % 7891% % 7892%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7893% 7894% MagickRemoveImage() removes an image from the image list. 7895% 7896% The format of the MagickRemoveImage method is: 7897% 7898% MagickBooleanType MagickRemoveImage(MagickWand *wand) 7899% 7900% A description of each parameter follows: 7901% 7902% o wand: the magick wand. 7903% 7904% o insert: the splice wand. 7905% 7906*/ 7907WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand) 7908{ 7909 assert(wand != (MagickWand *) NULL); 7910 assert(wand->signature == WandSignature); 7911 if (wand->debug != MagickFalse) 7912 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7913 if (wand->images == (Image *) NULL) 7914 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7915 DeleteImageFromList(&wand->images); 7916 return(MagickTrue); 7917} 7918 7919/* 7920%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7921% % 7922% % 7923% % 7924% M a g i c k R e s a m p l e I m a g e % 7925% % 7926% % 7927% % 7928%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7929% 7930% MagickResampleImage() resample image to desired resolution. 7931% 7932% Bessel Blackman Box 7933% Catrom Cubic Gaussian 7934% Hanning Hermite Lanczos 7935% Mitchell Point Quandratic 7936% Sinc Triangle 7937% 7938% Most of the filters are FIR (finite impulse response), however, Bessel, 7939% Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc 7940% are windowed (brought down to zero) with the Blackman filter. 7941% 7942% The format of the MagickResampleImage method is: 7943% 7944% MagickBooleanType MagickResampleImage(MagickWand *wand, 7945% const double x_resolution,const double y_resolution, 7946% const FilterTypes filter,const double blur) 7947% 7948% A description of each parameter follows: 7949% 7950% o wand: the magick wand. 7951% 7952% o x_resolution: the new image x resolution. 7953% 7954% o y_resolution: the new image y resolution. 7955% 7956% o filter: Image filter to use. 7957% 7958% o blur: the blur factor where > 1 is blurry, < 1 is sharp. 7959% 7960*/ 7961WandExport MagickBooleanType MagickResampleImage(MagickWand *wand, 7962 const double x_resolution,const double y_resolution,const FilterTypes filter, 7963 const double blur) 7964{ 7965 Image 7966 *resample_image; 7967 7968 assert(wand != (MagickWand *) NULL); 7969 assert(wand->signature == WandSignature); 7970 if (wand->debug != MagickFalse) 7971 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 7972 if (wand->images == (Image *) NULL) 7973 ThrowWandException(WandError,"ContainsNoImages",wand->name); 7974 resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter, 7975 blur,wand->exception); 7976 if (resample_image == (Image *) NULL) 7977 return(MagickFalse); 7978 ReplaceImageInList(&wand->images,resample_image); 7979 return(MagickTrue); 7980} 7981 7982/* 7983%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7984% % 7985% % 7986% % 7987% M a g i c k R e s e t I m a g e P a g e % 7988% % 7989% % 7990% % 7991%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7992% 7993% MagickResetImagePage() resets the Wand page canvas and position. 7994% 7995% The format of the MagickResetImagePage method is: 7996% 7997% MagickBooleanType MagickResetImagePage(MagickWand *wand, 7998% const char *page) 7999% 8000% A description of each parameter follows: 8001% 8002% o wand: the magick wand. 8003% 8004% o page: the relative page specification. 8005% 8006*/ 8007WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand, 8008 const char *page) 8009{ 8010 assert(wand != (MagickWand *) NULL); 8011 assert(wand->signature == WandSignature); 8012 if (wand->debug != MagickFalse) 8013 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8014 if (wand->images == (Image *) NULL) 8015 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8016 if ((page == (char *) NULL) || (*page == '\0')) 8017 { 8018 (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page); 8019 return(MagickTrue); 8020 } 8021 return(ResetImagePage(wand->images,page)); 8022} 8023 8024/* 8025%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8026% % 8027% % 8028% % 8029% M a g i c k R e s i z e I m a g e % 8030% % 8031% % 8032% % 8033%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8034% 8035% MagickResizeImage() scales an image to the desired dimensions with one of 8036% these filters: 8037% 8038% Bessel Blackman Box 8039% Catrom Cubic Gaussian 8040% Hanning Hermite Lanczos 8041% Mitchell Point Quandratic 8042% Sinc Triangle 8043% 8044% Most of the filters are FIR (finite impulse response), however, Bessel, 8045% Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc 8046% are windowed (brought down to zero) with the Blackman filter. 8047% 8048% The format of the MagickResizeImage method is: 8049% 8050% MagickBooleanType MagickResizeImage(MagickWand *wand, 8051% const size_t columns,const size_t rows, 8052% const FilterTypes filter,const double blur) 8053% 8054% A description of each parameter follows: 8055% 8056% o wand: the magick wand. 8057% 8058% o columns: the number of columns in the scaled image. 8059% 8060% o rows: the number of rows in the scaled image. 8061% 8062% o filter: Image filter to use. 8063% 8064% o blur: the blur factor where > 1 is blurry, < 1 is sharp. 8065% 8066*/ 8067WandExport MagickBooleanType MagickResizeImage(MagickWand *wand, 8068 const size_t columns,const size_t rows,const FilterTypes filter, 8069 const double blur) 8070{ 8071 Image 8072 *resize_image; 8073 8074 assert(wand != (MagickWand *) NULL); 8075 assert(wand->signature == WandSignature); 8076 if (wand->debug != MagickFalse) 8077 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8078 if (wand->images == (Image *) NULL) 8079 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8080 resize_image=ResizeImage(wand->images,columns,rows,filter,blur, 8081 wand->exception); 8082 if (resize_image == (Image *) NULL) 8083 return(MagickFalse); 8084 ReplaceImageInList(&wand->images,resize_image); 8085 return(MagickTrue); 8086} 8087 8088/* 8089%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8090% % 8091% % 8092% % 8093% M a g i c k R o l l I m a g e % 8094% % 8095% % 8096% % 8097%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8098% 8099% MagickRollImage() offsets an image as defined by x and y. 8100% 8101% The format of the MagickRollImage method is: 8102% 8103% MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x, 8104% const size_t y) 8105% 8106% A description of each parameter follows: 8107% 8108% o wand: the magick wand. 8109% 8110% o x: the x offset. 8111% 8112% o y: the y offset. 8113% 8114% 8115*/ 8116WandExport MagickBooleanType MagickRollImage(MagickWand *wand, 8117 const ssize_t x,const ssize_t y) 8118{ 8119 Image 8120 *roll_image; 8121 8122 assert(wand != (MagickWand *) NULL); 8123 assert(wand->signature == WandSignature); 8124 if (wand->debug != MagickFalse) 8125 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8126 if (wand->images == (Image *) NULL) 8127 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8128 roll_image=RollImage(wand->images,x,y,wand->exception); 8129 if (roll_image == (Image *) NULL) 8130 return(MagickFalse); 8131 ReplaceImageInList(&wand->images,roll_image); 8132 return(MagickTrue); 8133} 8134 8135/* 8136%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8137% % 8138% % 8139% % 8140% M a g i c k R o t a t e I m a g e % 8141% % 8142% % 8143% % 8144%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8145% 8146% MagickRotateImage() rotates an image the specified number of degrees. Empty 8147% triangles left over from rotating the image are filled with the 8148% background color. 8149% 8150% The format of the MagickRotateImage method is: 8151% 8152% MagickBooleanType MagickRotateImage(MagickWand *wand, 8153% const PixelWand *background,const double degrees) 8154% 8155% A description of each parameter follows: 8156% 8157% o wand: the magick wand. 8158% 8159% o background: the background pixel wand. 8160% 8161% o degrees: the number of degrees to rotate the image. 8162% 8163% 8164*/ 8165WandExport MagickBooleanType MagickRotateImage(MagickWand *wand, 8166 const PixelWand *background,const double degrees) 8167{ 8168 Image 8169 *rotate_image; 8170 8171 assert(wand != (MagickWand *) NULL); 8172 assert(wand->signature == WandSignature); 8173 if (wand->debug != MagickFalse) 8174 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8175 if (wand->images == (Image *) NULL) 8176 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8177 PixelGetQuantumPacket(background,&wand->images->background_color); 8178 rotate_image=RotateImage(wand->images,degrees,wand->exception); 8179 if (rotate_image == (Image *) NULL) 8180 return(MagickFalse); 8181 ReplaceImageInList(&wand->images,rotate_image); 8182 return(MagickTrue); 8183} 8184 8185/* 8186%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8187% % 8188% % 8189% % 8190% M a g i c k S a m p l e I m a g e % 8191% % 8192% % 8193% % 8194%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8195% 8196% MagickSampleImage() scales an image to the desired dimensions with pixel 8197% sampling. Unlike other scaling methods, this method does not introduce 8198% any additional color into the scaled image. 8199% 8200% The format of the MagickSampleImage method is: 8201% 8202% MagickBooleanType MagickSampleImage(MagickWand *wand, 8203% const size_t columns,const size_t rows) 8204% 8205% A description of each parameter follows: 8206% 8207% o wand: the magick wand. 8208% 8209% o columns: the number of columns in the scaled image. 8210% 8211% o rows: the number of rows in the scaled image. 8212% 8213% 8214*/ 8215WandExport MagickBooleanType MagickSampleImage(MagickWand *wand, 8216 const size_t columns,const size_t rows) 8217{ 8218 Image 8219 *sample_image; 8220 8221 assert(wand != (MagickWand *) NULL); 8222 assert(wand->signature == WandSignature); 8223 if (wand->debug != MagickFalse) 8224 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8225 if (wand->images == (Image *) NULL) 8226 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8227 sample_image=SampleImage(wand->images,columns,rows,wand->exception); 8228 if (sample_image == (Image *) NULL) 8229 return(MagickFalse); 8230 ReplaceImageInList(&wand->images,sample_image); 8231 return(MagickTrue); 8232} 8233 8234/* 8235%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8236% % 8237% % 8238% % 8239% M a g i c k S c a l e I m a g e % 8240% % 8241% % 8242% % 8243%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8244% 8245% MagickScaleImage() scales the size of an image to the given dimensions. 8246% 8247% The format of the MagickScaleImage method is: 8248% 8249% MagickBooleanType MagickScaleImage(MagickWand *wand, 8250% const size_t columns,const size_t rows) 8251% 8252% A description of each parameter follows: 8253% 8254% o wand: the magick wand. 8255% 8256% o columns: the number of columns in the scaled image. 8257% 8258% o rows: the number of rows in the scaled image. 8259% 8260% 8261*/ 8262WandExport MagickBooleanType MagickScaleImage(MagickWand *wand, 8263 const size_t columns,const size_t rows) 8264{ 8265 Image 8266 *scale_image; 8267 8268 assert(wand != (MagickWand *) NULL); 8269 assert(wand->signature == WandSignature); 8270 if (wand->debug != MagickFalse) 8271 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8272 if (wand->images == (Image *) NULL) 8273 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8274 scale_image=ScaleImage(wand->images,columns,rows,wand->exception); 8275 if (scale_image == (Image *) NULL) 8276 return(MagickFalse); 8277 ReplaceImageInList(&wand->images,scale_image); 8278 return(MagickTrue); 8279} 8280 8281/* 8282%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8283% % 8284% % 8285% % 8286% M a g i c k S e g m e n t I m a g e % 8287% % 8288% % 8289% % 8290%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8291% 8292% MagickSegmentImage() segments an image by analyzing the histograms of the 8293% color components and identifying units that are homogeneous with the fuzzy 8294% C-means technique. 8295% 8296% The format of the SegmentImage method is: 8297% 8298% MagickBooleanType MagickSegmentImage(MagickWand *wand, 8299% const ColorspaceType colorspace,const MagickBooleanType verbose, 8300% const double cluster_threshold,const double smooth_threshold) 8301% 8302% A description of each parameter follows. 8303% 8304% o wand: the wand. 8305% 8306% o colorspace: the image colorspace. 8307% 8308% o verbose: Set to MagickTrue to print detailed information about the 8309% identified classes. 8310% 8311% o cluster_threshold: This represents the minimum number of pixels 8312% contained in a hexahedra before it can be considered valid (expressed as 8313% a percentage). 8314% 8315% o smooth_threshold: the smoothing threshold eliminates noise in the second 8316% derivative of the histogram. As the value is increased, you can expect a 8317% smoother second derivative. 8318% 8319*/ 8320MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand, 8321 const ColorspaceType colorspace,const MagickBooleanType verbose, 8322 const double cluster_threshold,const double smooth_threshold) 8323{ 8324 MagickBooleanType 8325 status; 8326 8327 assert(wand != (MagickWand *) NULL); 8328 assert(wand->signature == WandSignature); 8329 if (wand->debug != MagickFalse) 8330 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8331 if (wand->images == (Image *) NULL) 8332 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8333 status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold, 8334 smooth_threshold); 8335 if (status == MagickFalse) 8336 InheritException(wand->exception,&wand->images->exception); 8337 return(status); 8338} 8339 8340/* 8341%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8342% % 8343% % 8344% % 8345% M a g i c k S e l e c t i v e B l u r I m a g e % 8346% % 8347% % 8348% % 8349%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8350% 8351% MagickSelectiveBlurImage() selectively blur an image within a contrast 8352% threshold. It is similar to the unsharpen mask that sharpens everything with 8353% contrast above a certain threshold. 8354% 8355% The format of the MagickSelectiveBlurImage method is: 8356% 8357% MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand, 8358% const double radius,const double sigma,const double threshold) 8359% 8360% A description of each parameter follows: 8361% 8362% o wand: the magick wand. 8363% 8364% o radius: the radius of the gaussian, in pixels, not counting the center 8365% pixel. 8366% 8367% o sigma: the standard deviation of the gaussian, in pixels. 8368% 8369% o threshold: only pixels within this contrast threshold are included 8370% in the blur operation. 8371% 8372*/ 8373WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand, 8374 const double radius,const double sigma,const double threshold) 8375{ 8376 Image 8377 *blur_image; 8378 8379 assert(wand != (MagickWand *) NULL); 8380 assert(wand->signature == WandSignature); 8381 if (wand->debug != MagickFalse) 8382 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8383 if (wand->images == (Image *) NULL) 8384 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8385 blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold, 8386 wand->exception); 8387 if (blur_image == (Image *) NULL) 8388 return(MagickFalse); 8389 ReplaceImageInList(&wand->images,blur_image); 8390 return(MagickTrue); 8391} 8392 8393/* 8394%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8395% % 8396% % 8397% % 8398% M a g i c k S e p a r a t e I m a g e C h a n n e l % 8399% % 8400% % 8401% % 8402%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8403% 8404% MagickSeparateImage() separates a channel from the image and returns a 8405% grayscale image. A channel is a particular color component of each pixel 8406% in the image. 8407% 8408% The format of the MagickSeparateImage method is: 8409% 8410% MagickBooleanType MagickSeparateImage(MagickWand *wand) 8411% 8412% A description of each parameter follows: 8413% 8414% o wand: the magick wand. 8415% 8416*/ 8417WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand) 8418{ 8419 MagickBooleanType 8420 status; 8421 8422 assert(wand != (MagickWand *) NULL); 8423 assert(wand->signature == WandSignature); 8424 if (wand->debug != MagickFalse) 8425 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8426 if (wand->images == (Image *) NULL) 8427 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8428 status=SeparateImage(wand->images); 8429 if (status == MagickFalse) 8430 InheritException(wand->exception,&wand->images->exception); 8431 return(status); 8432} 8433 8434/* 8435%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8436% % 8437% % 8438% % 8439% M a g i c k S e p i a T o n e I m a g e % 8440% % 8441% % 8442% % 8443%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8444% 8445% MagickSepiaToneImage() applies a special effect to the image, similar to the 8446% effect achieved in a photo darkroom by sepia toning. Threshold ranges from 8447% 0 to QuantumRange and is a measure of the extent of the sepia toning. A 8448% threshold of 80% is a good starting point for a reasonable tone. 8449% 8450% The format of the MagickSepiaToneImage method is: 8451% 8452% MagickBooleanType MagickSepiaToneImage(MagickWand *wand, 8453% const double threshold) 8454% 8455% A description of each parameter follows: 8456% 8457% o wand: the magick wand. 8458% 8459% o threshold: Define the extent of the sepia toning. 8460% 8461*/ 8462WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand, 8463 const double threshold) 8464{ 8465 Image 8466 *sepia_image; 8467 8468 assert(wand != (MagickWand *) NULL); 8469 assert(wand->signature == WandSignature); 8470 if (wand->debug != MagickFalse) 8471 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8472 if (wand->images == (Image *) NULL) 8473 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8474 sepia_image=SepiaToneImage(wand->images,threshold,wand->exception); 8475 if (sepia_image == (Image *) NULL) 8476 return(MagickFalse); 8477 ReplaceImageInList(&wand->images,sepia_image); 8478 return(MagickTrue); 8479} 8480 8481/* 8482%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8483% % 8484% % 8485% % 8486% M a g i c k S e t I m a g e % 8487% % 8488% % 8489% % 8490%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8491% 8492% MagickSetImage() replaces the last image returned by MagickSetImageIndex(), 8493% MagickNextImage(), MagickPreviousImage() with the images from the specified 8494% wand. 8495% 8496% The format of the MagickSetImage method is: 8497% 8498% MagickBooleanType MagickSetImage(MagickWand *wand, 8499% const MagickWand *set_wand) 8500% 8501% A description of each parameter follows: 8502% 8503% o wand: the magick wand. 8504% 8505% o set_wand: the set_wand wand. 8506% 8507*/ 8508WandExport MagickBooleanType MagickSetImage(MagickWand *wand, 8509 const MagickWand *set_wand) 8510{ 8511 Image 8512 *images; 8513 8514 assert(wand != (MagickWand *) NULL); 8515 assert(wand->signature == WandSignature); 8516 if (wand->debug != MagickFalse) 8517 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8518 assert(set_wand != (MagickWand *) NULL); 8519 assert(set_wand->signature == WandSignature); 8520 if (wand->debug != MagickFalse) 8521 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name); 8522 if (set_wand->images == (Image *) NULL) 8523 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8524 images=CloneImageList(set_wand->images,wand->exception); 8525 if (images == (Image *) NULL) 8526 return(MagickFalse); 8527 ReplaceImageInList(&wand->images,images); 8528 return(MagickTrue); 8529} 8530 8531/* 8532%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8533% % 8534% % 8535% % 8536% M a g i c k S e t I m a g e A l p h a C h a n n e l % 8537% % 8538% % 8539% % 8540%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8541% 8542% MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the 8543% alpha channel. 8544% 8545% The format of the MagickSetImageAlphaChannel method is: 8546% 8547% MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand, 8548% const AlphaChannelType alpha_type) 8549% 8550% A description of each parameter follows: 8551% 8552% o wand: the magick wand. 8553% 8554% o alpha_type: the alpha channel type: ActivateAlphaChannel, 8555% DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel. 8556% 8557*/ 8558WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand, 8559 const AlphaChannelType alpha_type) 8560{ 8561 assert(wand != (MagickWand *) NULL); 8562 assert(wand->signature == WandSignature); 8563 if (wand->debug != MagickFalse) 8564 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8565 if (wand->images == (Image *) NULL) 8566 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8567 return(SetImageAlphaChannel(wand->images,alpha_type)); 8568} 8569 8570/* 8571%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8572% % 8573% % 8574% % 8575% M a g i c k S e t I m a g e B a c k g r o u n d C o l o r % 8576% % 8577% % 8578% % 8579%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8580% 8581% MagickSetImageBackgroundColor() sets the image background color. 8582% 8583% The format of the MagickSetImageBackgroundColor method is: 8584% 8585% MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand, 8586% const PixelWand *background) 8587% 8588% A description of each parameter follows: 8589% 8590% o wand: the magick wand. 8591% 8592% o background: the background pixel wand. 8593% 8594*/ 8595WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand, 8596 const PixelWand *background) 8597{ 8598 assert(wand != (MagickWand *) NULL); 8599 assert(wand->signature == WandSignature); 8600 if (wand->debug != MagickFalse) 8601 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8602 if (wand->images == (Image *) NULL) 8603 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8604 PixelGetQuantumPacket(background,&wand->images->background_color); 8605 return(MagickTrue); 8606} 8607 8608/* 8609%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8610% % 8611% % 8612% % 8613% M a g i c k S e t I m a g e B i a s % 8614% % 8615% % 8616% % 8617%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8618% 8619% MagickSetImageBias() sets the image bias for any method that convolves an 8620% image (e.g. MagickConvolveImage()). 8621% 8622% The format of the MagickSetImageBias method is: 8623% 8624% MagickBooleanType MagickSetImageBias(MagickWand *wand, 8625% const double bias) 8626% 8627% A description of each parameter follows: 8628% 8629% o wand: the magick wand. 8630% 8631% o bias: the image bias. 8632% 8633*/ 8634WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand, 8635 const double bias) 8636{ 8637 assert(wand != (MagickWand *) NULL); 8638 assert(wand->signature == WandSignature); 8639 if (wand->debug != MagickFalse) 8640 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8641 if (wand->images == (Image *) NULL) 8642 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8643 wand->images->bias=bias; 8644 return(MagickTrue); 8645} 8646 8647/* 8648%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8649% % 8650% % 8651% % 8652% M a g i c k S e t I m a g e B l u e P r i m a r y % 8653% % 8654% % 8655% % 8656%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8657% 8658% MagickSetImageBluePrimary() sets the image chromaticity blue primary point. 8659% 8660% The format of the MagickSetImageBluePrimary method is: 8661% 8662% MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand, 8663% const double x,const double y) 8664% 8665% A description of each parameter follows: 8666% 8667% o wand: the magick wand. 8668% 8669% o x: the blue primary x-point. 8670% 8671% o y: the blue primary y-point. 8672% 8673*/ 8674WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand, 8675 const double x,const double y) 8676{ 8677 assert(wand != (MagickWand *) NULL); 8678 assert(wand->signature == WandSignature); 8679 if (wand->debug != MagickFalse) 8680 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8681 if (wand->images == (Image *) NULL) 8682 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8683 wand->images->chromaticity.blue_primary.x=x; 8684 wand->images->chromaticity.blue_primary.y=y; 8685 return(MagickTrue); 8686} 8687 8688/* 8689%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8690% % 8691% % 8692% % 8693% M a g i c k S e t I m a g e B o r d e r C o l o r % 8694% % 8695% % 8696% % 8697%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8698% 8699% MagickSetImageBorderColor() sets the image border color. 8700% 8701% The format of the MagickSetImageBorderColor method is: 8702% 8703% MagickBooleanType MagickSetImageBorderColor(MagickWand *wand, 8704% const PixelWand *border) 8705% 8706% A description of each parameter follows: 8707% 8708% o wand: the magick wand. 8709% 8710% o border: the border pixel wand. 8711% 8712*/ 8713WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand, 8714 const PixelWand *border) 8715{ 8716 assert(wand != (MagickWand *) NULL); 8717 assert(wand->signature == WandSignature); 8718 if (wand->debug != MagickFalse) 8719 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8720 if (wand->images == (Image *) NULL) 8721 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8722 PixelGetQuantumPacket(border,&wand->images->border_color); 8723 return(MagickTrue); 8724} 8725 8726/* 8727%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8728% % 8729% % 8730% % 8731% M a g i c k S e t I m a g e C l i p M a s k % 8732% % 8733% % 8734% % 8735%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8736% 8737% MagickSetImageClipMask() sets image clip mask. 8738% 8739% The format of the MagickSetImageClipMask method is: 8740% 8741% MagickBooleanType MagickSetImageClipMask(MagickWand *wand, 8742% const MagickWand *clip_mask) 8743% 8744% A description of each parameter follows: 8745% 8746% o wand: the magick wand. 8747% 8748% o clip_mask: the clip_mask wand. 8749% 8750*/ 8751WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand, 8752 const MagickWand *clip_mask) 8753{ 8754 assert(wand != (MagickWand *) NULL); 8755 assert(wand->signature == WandSignature); 8756 if (wand->debug != MagickFalse) 8757 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8758 assert(clip_mask != (MagickWand *) NULL); 8759 assert(clip_mask->signature == WandSignature); 8760 if (wand->debug != MagickFalse) 8761 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name); 8762 if (clip_mask->images == (Image *) NULL) 8763 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8764 return(SetImageClipMask(wand->images,clip_mask->images)); 8765} 8766 8767/* 8768%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8769% % 8770% % 8771% % 8772% M a g i c k S e t I m a g e C o l o r % 8773% % 8774% % 8775% % 8776%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8777% 8778% MagickSetImageColor() set the entire wand canvas to the specified color. 8779% 8780% The format of the MagickSetImageColor method is: 8781% 8782% MagickBooleanType MagickSetImageColor(MagickWand *wand, 8783% const PixelWand *color) 8784% 8785% A description of each parameter follows: 8786% 8787% o wand: the magick wand. 8788% 8789% o background: the image color. 8790% 8791*/ 8792WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand, 8793 const PixelWand *color) 8794{ 8795 MagickBooleanType 8796 status; 8797 8798 PixelInfo 8799 pixel; 8800 8801 assert(wand != (MagickWand *) NULL); 8802 assert(wand->signature == WandSignature); 8803 if (wand->debug != MagickFalse) 8804 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8805 PixelGetMagickColor(color,&pixel); 8806 status=SetImageColor(wand->images,&pixel); 8807 if (status == MagickFalse) 8808 InheritException(wand->exception,&wand->images->exception); 8809 return(status); 8810} 8811 8812/* 8813%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8814% % 8815% % 8816% % 8817% M a g i c k S e t I m a g e C o l o r m a p C o l o r % 8818% % 8819% % 8820% % 8821%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8822% 8823% MagickSetImageColormapColor() sets the color of the specified colormap 8824% index. 8825% 8826% The format of the MagickSetImageColormapColor method is: 8827% 8828% MagickBooleanType MagickSetImageColormapColor(MagickWand *wand, 8829% const size_t index,const PixelWand *color) 8830% 8831% A description of each parameter follows: 8832% 8833% o wand: the magick wand. 8834% 8835% o index: the offset into the image colormap. 8836% 8837% o color: Return the colormap color in this wand. 8838% 8839*/ 8840WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand, 8841 const size_t index,const PixelWand *color) 8842{ 8843 assert(wand != (MagickWand *) NULL); 8844 assert(wand->signature == WandSignature); 8845 if (wand->debug != MagickFalse) 8846 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8847 if (wand->images == (Image *) NULL) 8848 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8849 if ((wand->images->colormap == (PixelPacket *) NULL) || 8850 (index >= wand->images->colors)) 8851 ThrowWandException(WandError,"InvalidColormapIndex",wand->name); 8852 PixelGetQuantumPacket(color,wand->images->colormap+index); 8853 return(SyncImage(wand->images)); 8854} 8855 8856/* 8857%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8858% % 8859% % 8860% % 8861% M a g i c k S e t I m a g e C o l o r s p a c e % 8862% % 8863% % 8864% % 8865%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8866% 8867% MagickSetImageColorspace() sets the image colorspace. 8868% 8869% The format of the MagickSetImageColorspace method is: 8870% 8871% MagickBooleanType MagickSetImageColorspace(MagickWand *wand, 8872% const ColorspaceType colorspace) 8873% 8874% A description of each parameter follows: 8875% 8876% o wand: the magick wand. 8877% 8878% o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace, 8879% GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace, 8880% YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace, 8881% YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace, 8882% HSLColorspace, or HWBColorspace. 8883% 8884*/ 8885WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand, 8886 const ColorspaceType colorspace) 8887{ 8888 assert(wand != (MagickWand *) NULL); 8889 assert(wand->signature == WandSignature); 8890 if (wand->debug != MagickFalse) 8891 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8892 if (wand->images == (Image *) NULL) 8893 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8894 return(SetImageColorspace(wand->images,colorspace)); 8895} 8896 8897/* 8898%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8899% % 8900% % 8901% % 8902% M a g i c k S e t I m a g e C o m p o s e % 8903% % 8904% % 8905% % 8906%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8907% 8908% MagickSetImageCompose() sets the image composite operator, useful for 8909% specifying how to composite the image thumbnail when using the 8910% MagickMontageImage() method. 8911% 8912% The format of the MagickSetImageCompose method is: 8913% 8914% MagickBooleanType MagickSetImageCompose(MagickWand *wand, 8915% const CompositeOperator compose) 8916% 8917% A description of each parameter follows: 8918% 8919% o wand: the magick wand. 8920% 8921% o compose: the image composite operator. 8922% 8923*/ 8924WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand, 8925 const CompositeOperator compose) 8926{ 8927 assert(wand != (MagickWand *) NULL); 8928 assert(wand->signature == WandSignature); 8929 if (wand->debug != MagickFalse) 8930 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8931 if (wand->images == (Image *) NULL) 8932 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8933 wand->images->compose=compose; 8934 return(MagickTrue); 8935} 8936 8937/* 8938%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8939% % 8940% % 8941% % 8942% M a g i c k S e t I m a g e C o m p r e s s i o n % 8943% % 8944% % 8945% % 8946%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8947% 8948% MagickSetImageCompression() sets the image compression. 8949% 8950% The format of the MagickSetImageCompression method is: 8951% 8952% MagickBooleanType MagickSetImageCompression(MagickWand *wand, 8953% const CompressionType compression) 8954% 8955% A description of each parameter follows: 8956% 8957% o wand: the magick wand. 8958% 8959% o compression: the image compression type. 8960% 8961*/ 8962WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand, 8963 const CompressionType compression) 8964{ 8965 assert(wand != (MagickWand *) NULL); 8966 assert(wand->signature == WandSignature); 8967 if (wand->debug != MagickFalse) 8968 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 8969 if (wand->images == (Image *) NULL) 8970 ThrowWandException(WandError,"ContainsNoImages",wand->name); 8971 wand->images->compression=compression; 8972 return(MagickTrue); 8973} 8974 8975/* 8976%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8977% % 8978% % 8979% % 8980% M a g i c k S e t I m a g e C o m p r e s s i o n Q u a l i t y % 8981% % 8982% % 8983% % 8984%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8985% 8986% MagickSetImageCompressionQuality() sets the image compression quality. 8987% 8988% The format of the MagickSetImageCompressionQuality method is: 8989% 8990% MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand, 8991% const size_t quality) 8992% 8993% A description of each parameter follows: 8994% 8995% o wand: the magick wand. 8996% 8997% o quality: the image compression tlityype. 8998% 8999*/ 9000WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand, 9001 const size_t quality) 9002{ 9003 assert(wand != (MagickWand *) NULL); 9004 assert(wand->signature == WandSignature); 9005 if (wand->debug != MagickFalse) 9006 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9007 if (wand->images == (Image *) NULL) 9008 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9009 wand->images->quality=quality; 9010 return(MagickTrue); 9011} 9012 9013/* 9014%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9015% % 9016% % 9017% % 9018% M a g i c k S e t I m a g e D e l a y % 9019% % 9020% % 9021% % 9022%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9023% 9024% MagickSetImageDelay() sets the image delay. 9025% 9026% The format of the MagickSetImageDelay method is: 9027% 9028% MagickBooleanType MagickSetImageDelay(MagickWand *wand, 9029% const size_t delay) 9030% 9031% A description of each parameter follows: 9032% 9033% o wand: the magick wand. 9034% 9035% o delay: the image delay in ticks-per-second units. 9036% 9037*/ 9038WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand, 9039 const size_t delay) 9040{ 9041 assert(wand != (MagickWand *) NULL); 9042 assert(wand->signature == WandSignature); 9043 if (wand->debug != MagickFalse) 9044 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9045 if (wand->images == (Image *) NULL) 9046 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9047 wand->images->delay=delay; 9048 return(MagickTrue); 9049} 9050 9051/* 9052%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9053% % 9054% % 9055% % 9056% M a g i c k S e t I m a g e D e p t h % 9057% % 9058% % 9059% % 9060%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9061% 9062% MagickSetImageDepth() sets the image depth. 9063% 9064% The format of the MagickSetImageDepth method is: 9065% 9066% MagickBooleanType MagickSetImageDepth(MagickWand *wand, 9067% const size_t depth) 9068% 9069% A description of each parameter follows: 9070% 9071% o wand: the magick wand. 9072% 9073% o depth: the image depth in bits: 8, 16, or 32. 9074% 9075*/ 9076WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand, 9077 const size_t depth) 9078{ 9079 assert(wand != (MagickWand *) NULL); 9080 assert(wand->signature == WandSignature); 9081 if (wand->debug != MagickFalse) 9082 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9083 if (wand->images == (Image *) NULL) 9084 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9085 return(SetImageDepth(wand->images,depth)); 9086} 9087 9088/* 9089%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9090% % 9091% % 9092% % 9093% M a g i c k S e t I m a g e D i s p o s e % 9094% % 9095% % 9096% % 9097%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9098% 9099% MagickSetImageDispose() sets the image disposal method. 9100% 9101% The format of the MagickSetImageDispose method is: 9102% 9103% MagickBooleanType MagickSetImageDispose(MagickWand *wand, 9104% const DisposeType dispose) 9105% 9106% A description of each parameter follows: 9107% 9108% o wand: the magick wand. 9109% 9110% o dispose: the image disposeal type. 9111% 9112*/ 9113WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand, 9114 const DisposeType dispose) 9115{ 9116 assert(wand != (MagickWand *) NULL); 9117 assert(wand->signature == WandSignature); 9118 if (wand->debug != MagickFalse) 9119 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9120 if (wand->images == (Image *) NULL) 9121 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9122 wand->images->dispose=dispose; 9123 return(MagickTrue); 9124} 9125 9126/* 9127%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9128% % 9129% % 9130% % 9131% M a g i c k S e t I m a g e E x t e n t % 9132% % 9133% % 9134% % 9135%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9136% 9137% MagickSetImageExtent() sets the image size (i.e. columns & rows). 9138% 9139% The format of the MagickSetImageExtent method is: 9140% 9141% MagickBooleanType MagickSetImageExtent(MagickWand *wand, 9142% const size_t columns,const unsigned rows) 9143% 9144% A description of each parameter follows: 9145% 9146% o wand: the magick wand. 9147% 9148% o columns: The image width in pixels. 9149% 9150% o rows: The image height in pixels. 9151% 9152*/ 9153WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand, 9154 const size_t columns,const size_t rows) 9155{ 9156 assert(wand != (MagickWand *) NULL); 9157 assert(wand->signature == WandSignature); 9158 if (wand->debug != MagickFalse) 9159 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9160 if (wand->images == (Image *) NULL) 9161 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9162 return(SetImageExtent(wand->images,columns,rows)); 9163} 9164 9165/* 9166%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9167% % 9168% % 9169% % 9170% M a g i c k S e t I m a g e F i l e n a m e % 9171% % 9172% % 9173% % 9174%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9175% 9176% MagickSetImageFilename() sets the filename of a particular image in a 9177% sequence. 9178% 9179% The format of the MagickSetImageFilename method is: 9180% 9181% MagickBooleanType MagickSetImageFilename(MagickWand *wand, 9182% const char *filename) 9183% 9184% A description of each parameter follows: 9185% 9186% o wand: the magick wand. 9187% 9188% o filename: the image filename. 9189% 9190*/ 9191WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand, 9192 const char *filename) 9193{ 9194 assert(wand != (MagickWand *) NULL); 9195 assert(wand->signature == WandSignature); 9196 if (wand->debug != MagickFalse) 9197 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9198 if (wand->images == (Image *) NULL) 9199 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9200 if (filename != (const char *) NULL) 9201 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent); 9202 return(MagickTrue); 9203} 9204 9205/* 9206%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9207% % 9208% % 9209% % 9210% M a g i c k S e t I m a g e F o r m a t % 9211% % 9212% % 9213% % 9214%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9215% 9216% MagickSetImageFormat() sets the format of a particular image in a 9217% sequence. 9218% 9219% The format of the MagickSetImageFormat method is: 9220% 9221% MagickBooleanType MagickSetImageFormat(MagickWand *wand, 9222% const char *format) 9223% 9224% A description of each parameter follows: 9225% 9226% o wand: the magick wand. 9227% 9228% o format: the image format. 9229% 9230*/ 9231WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand, 9232 const char *format) 9233{ 9234 const MagickInfo 9235 *magick_info; 9236 9237 assert(wand != (MagickWand *) NULL); 9238 assert(wand->signature == WandSignature); 9239 if (wand->debug != MagickFalse) 9240 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9241 if (wand->images == (Image *) NULL) 9242 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9243 if ((format == (char *) NULL) || (*format == '\0')) 9244 { 9245 *wand->images->magick='\0'; 9246 return(MagickTrue); 9247 } 9248 magick_info=GetMagickInfo(format,wand->exception); 9249 if (magick_info == (const MagickInfo *) NULL) 9250 return(MagickFalse); 9251 ClearMagickException(wand->exception); 9252 (void) CopyMagickString(wand->images->magick,format,MaxTextExtent); 9253 return(MagickTrue); 9254} 9255 9256/* 9257%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9258% % 9259% % 9260% % 9261% M a g i c k S e t I m a g e F u z z % 9262% % 9263% % 9264% % 9265%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9266% 9267% MagickSetImageFuzz() sets the image fuzz. 9268% 9269% The format of the MagickSetImageFuzz method is: 9270% 9271% MagickBooleanType MagickSetImageFuzz(MagickWand *wand, 9272% const double fuzz) 9273% 9274% A description of each parameter follows: 9275% 9276% o wand: the magick wand. 9277% 9278% o fuzz: the image fuzz. 9279% 9280*/ 9281WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand, 9282 const double fuzz) 9283{ 9284 assert(wand != (MagickWand *) NULL); 9285 assert(wand->signature == WandSignature); 9286 if (wand->debug != MagickFalse) 9287 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9288 if (wand->images == (Image *) NULL) 9289 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9290 wand->images->fuzz=fuzz; 9291 return(MagickTrue); 9292} 9293 9294/* 9295%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9296% % 9297% % 9298% % 9299% M a g i c k S e t I m a g e G a m m a % 9300% % 9301% % 9302% % 9303%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9304% 9305% MagickSetImageGamma() sets the image gamma. 9306% 9307% The format of the MagickSetImageGamma method is: 9308% 9309% MagickBooleanType MagickSetImageGamma(MagickWand *wand, 9310% const double gamma) 9311% 9312% A description of each parameter follows: 9313% 9314% o wand: the magick wand. 9315% 9316% o gamma: the image gamma. 9317% 9318*/ 9319WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand, 9320 const double gamma) 9321{ 9322 assert(wand != (MagickWand *) NULL); 9323 assert(wand->signature == WandSignature); 9324 if (wand->debug != MagickFalse) 9325 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9326 if (wand->images == (Image *) NULL) 9327 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9328 wand->images->gamma=gamma; 9329 return(MagickTrue); 9330} 9331 9332/* 9333%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9334% % 9335% % 9336% % 9337% M a g i c k S e t I m a g e G r a v i t y % 9338% % 9339% % 9340% % 9341%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9342% 9343% MagickSetImageGravity() sets the image gravity type. 9344% 9345% The format of the MagickSetImageGravity method is: 9346% 9347% MagickBooleanType MagickSetImageGravity(MagickWand *wand, 9348% const GravityType gravity) 9349% 9350% A description of each parameter follows: 9351% 9352% o wand: the magick wand. 9353% 9354% o gravity: the image interlace scheme: NoInterlace, LineInterlace, 9355% PlaneInterlace, PartitionInterlace. 9356% 9357*/ 9358WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand, 9359 const GravityType gravity) 9360{ 9361 assert(wand != (MagickWand *) NULL); 9362 assert(wand->signature == WandSignature); 9363 if (wand->debug != MagickFalse) 9364 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9365 if (wand->images == (Image *) NULL) 9366 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9367 wand->images->gravity=gravity; 9368 return(MagickTrue); 9369} 9370 9371/* 9372%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9373% % 9374% % 9375% % 9376% M a g i c k S e t I m a g e G r e e n P r i m a r y % 9377% % 9378% % 9379% % 9380%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9381% 9382% MagickSetImageGreenPrimary() sets the image chromaticity green primary 9383% point. 9384% 9385% The format of the MagickSetImageGreenPrimary method is: 9386% 9387% MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand, 9388% const double x,const double y) 9389% 9390% A description of each parameter follows: 9391% 9392% o wand: the magick wand. 9393% 9394% o x: the green primary x-point. 9395% 9396% o y: the green primary y-point. 9397% 9398% 9399*/ 9400WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand, 9401 const double x,const double y) 9402{ 9403 assert(wand != (MagickWand *) NULL); 9404 assert(wand->signature == WandSignature); 9405 if (wand->debug != MagickFalse) 9406 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9407 if (wand->images == (Image *) NULL) 9408 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9409 wand->images->chromaticity.green_primary.x=x; 9410 wand->images->chromaticity.green_primary.y=y; 9411 return(MagickTrue); 9412} 9413 9414/* 9415%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9416% % 9417% % 9418% % 9419% M a g i c k S e t I m a g e I n t e r l a c e S c h e m e % 9420% % 9421% % 9422% % 9423%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9424% 9425% MagickSetImageInterlaceScheme() sets the image interlace scheme. 9426% 9427% The format of the MagickSetImageInterlaceScheme method is: 9428% 9429% MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand, 9430% const InterlaceType interlace) 9431% 9432% A description of each parameter follows: 9433% 9434% o wand: the magick wand. 9435% 9436% o interlace: the image interlace scheme: NoInterlace, LineInterlace, 9437% PlaneInterlace, PartitionInterlace. 9438% 9439*/ 9440WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand, 9441 const InterlaceType interlace) 9442{ 9443 assert(wand != (MagickWand *) NULL); 9444 assert(wand->signature == WandSignature); 9445 if (wand->debug != MagickFalse) 9446 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9447 if (wand->images == (Image *) NULL) 9448 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9449 wand->images->interlace=interlace; 9450 return(MagickTrue); 9451} 9452 9453/* 9454%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9455% % 9456% % 9457% % 9458% M a g i c k S e t I m a g e I n t e r p o l a t e M e t h o d % 9459% % 9460% % 9461% % 9462%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9463% 9464% MagickSetImageInterpolateMethod() sets the image interpolate pixel method. 9465% 9466% The format of the MagickSetImageInterpolateMethod method is: 9467% 9468% MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand, 9469% const InterpolatePixelMethod method) 9470% 9471% A description of each parameter follows: 9472% 9473% o wand: the magick wand. 9474% 9475% o method: the image interpole pixel methods: choose from Undefined, 9476% Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor. 9477% 9478*/ 9479WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand, 9480 const InterpolatePixelMethod method) 9481{ 9482 assert(wand != (MagickWand *) NULL); 9483 assert(wand->signature == WandSignature); 9484 if (wand->debug != MagickFalse) 9485 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9486 if (wand->images == (Image *) NULL) 9487 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9488 wand->images->interpolate=method; 9489 return(MagickTrue); 9490} 9491 9492/* 9493%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9494% % 9495% % 9496% % 9497% M a g i c k S e t I m a g e I t e r a t i o n s % 9498% % 9499% % 9500% % 9501%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9502% 9503% MagickSetImageIterations() sets the image iterations. 9504% 9505% The format of the MagickSetImageIterations method is: 9506% 9507% MagickBooleanType MagickSetImageIterations(MagickWand *wand, 9508% const size_t iterations) 9509% 9510% A description of each parameter follows: 9511% 9512% o wand: the magick wand. 9513% 9514% o delay: the image delay in 1/100th of a second. 9515% 9516*/ 9517WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand, 9518 const size_t iterations) 9519{ 9520 assert(wand != (MagickWand *) NULL); 9521 assert(wand->signature == WandSignature); 9522 if (wand->debug != MagickFalse) 9523 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9524 if (wand->images == (Image *) NULL) 9525 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9526 wand->images->iterations=iterations; 9527 return(MagickTrue); 9528} 9529 9530/* 9531%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9532% % 9533% % 9534% % 9535% M a g i c k S e t I m a g e M a t t e % 9536% % 9537% % 9538% % 9539%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9540% 9541% MagickSetImageMatte() sets the image matte channel. 9542% 9543% The format of the MagickSetImageMatteColor method is: 9544% 9545% MagickBooleanType MagickSetImageMatteColor(MagickWand *wand, 9546% const MagickBooleanType *matte) 9547% 9548% A description of each parameter follows: 9549% 9550% o wand: the magick wand. 9551% 9552% o matte: Set to MagickTrue to enable the image matte channel otherwise 9553% MagickFalse. 9554% 9555*/ 9556WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand, 9557 const MagickBooleanType matte) 9558{ 9559 assert(wand != (MagickWand *) NULL); 9560 assert(wand->signature == WandSignature); 9561 if (wand->debug != MagickFalse) 9562 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9563 if (wand->images == (Image *) NULL) 9564 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9565 if ((wand->images->matte == MagickFalse) && (matte != MagickFalse)) 9566 (void) SetImageOpacity(wand->images,OpaqueAlpha); 9567 wand->images->matte=matte; 9568 return(MagickTrue); 9569} 9570 9571/* 9572%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9573% % 9574% % 9575% % 9576% M a g i c k S e t I m a g e M a t t e C o l o r % 9577% % 9578% % 9579% % 9580%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9581% 9582% MagickSetImageMatteColor() sets the image matte color. 9583% 9584% The format of the MagickSetImageMatteColor method is: 9585% 9586% MagickBooleanType MagickSetImageMatteColor(MagickWand *wand, 9587% const PixelWand *matte) 9588% 9589% A description of each parameter follows: 9590% 9591% o wand: the magick wand. 9592% 9593% o matte: the matte pixel wand. 9594% 9595*/ 9596WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand, 9597 const PixelWand *matte) 9598{ 9599 assert(wand != (MagickWand *) NULL); 9600 assert(wand->signature == WandSignature); 9601 if (wand->debug != MagickFalse) 9602 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9603 if (wand->images == (Image *) NULL) 9604 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9605 PixelGetQuantumPacket(matte,&wand->images->matte_color); 9606 return(MagickTrue); 9607} 9608 9609/* 9610%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9611% % 9612% % 9613% % 9614% M a g i c k S e t I m a g e O p a c i t y % 9615% % 9616% % 9617% % 9618%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9619% 9620% MagickSetImageOpacity() sets the image to the specified opacity level. 9621% 9622% The format of the MagickSetImageOpacity method is: 9623% 9624% MagickBooleanType MagickSetImageOpacity(MagickWand *wand, 9625% const double alpha) 9626% 9627% A description of each parameter follows: 9628% 9629% o wand: the magick wand. 9630% 9631% o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully 9632% transparent. 9633% 9634*/ 9635WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand, 9636 const double alpha) 9637{ 9638 MagickBooleanType 9639 status; 9640 9641 assert(wand != (MagickWand *) NULL); 9642 assert(wand->signature == WandSignature); 9643 if (wand->debug != MagickFalse) 9644 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9645 if (wand->images == (Image *) NULL) 9646 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9647 status=SetImageOpacity(wand->images,ClampToQuantum(QuantumRange*alpha)); 9648 if (status == MagickFalse) 9649 InheritException(wand->exception,&wand->images->exception); 9650 return(status); 9651} 9652 9653/* 9654%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9655% % 9656% % 9657% % 9658% M a g i c k S e t I m a g e O r i e n t a t i o n % 9659% % 9660% % 9661% % 9662%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9663% 9664% MagickSetImageOrientation() sets the image orientation. 9665% 9666% The format of the MagickSetImageOrientation method is: 9667% 9668% MagickBooleanType MagickSetImageOrientation(MagickWand *wand, 9669% const OrientationType orientation) 9670% 9671% A description of each parameter follows: 9672% 9673% o wand: the magick wand. 9674% 9675% o orientation: the image orientation type. 9676% 9677*/ 9678WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand, 9679 const OrientationType orientation) 9680{ 9681 assert(wand != (MagickWand *) NULL); 9682 assert(wand->signature == WandSignature); 9683 if (wand->debug != MagickFalse) 9684 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9685 if (wand->images == (Image *) NULL) 9686 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9687 wand->images->orientation=orientation; 9688 return(MagickTrue); 9689} 9690 9691/* 9692%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9693% % 9694% % 9695% % 9696% M a g i c k S e t I m a g e P a g e % 9697% % 9698% % 9699% % 9700%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9701% 9702% MagickSetImagePage() sets the page geometry of the image. 9703% 9704% The format of the MagickSetImagePage method is: 9705% 9706% MagickBooleanType MagickSetImagePage(MagickWand *wand, 9707% const size_t width,const size_t height,const ssize_t x, 9708% const ssize_t y) 9709% 9710% A description of each parameter follows: 9711% 9712% o wand: the magick wand. 9713% 9714% o width: the page width. 9715% 9716% o height: the page height. 9717% 9718% o x: the page x-offset. 9719% 9720% o y: the page y-offset. 9721% 9722*/ 9723WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand, 9724 const size_t width,const size_t height,const ssize_t x, 9725 const ssize_t y) 9726{ 9727 assert(wand != (MagickWand *) NULL); 9728 assert(wand->signature == WandSignature); 9729 if (wand->debug != MagickFalse) 9730 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9731 if (wand->images == (Image *) NULL) 9732 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9733 wand->images->page.width=width; 9734 wand->images->page.height=height; 9735 wand->images->page.x=x; 9736 wand->images->page.y=y; 9737 return(MagickTrue); 9738} 9739 9740/* 9741%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9742% % 9743% % 9744% % 9745% M a g i c k S e t I m a g e P r o g r e s s M o n i t o r % 9746% % 9747% % 9748% % 9749%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9750% 9751% MagickSetImageProgressMonitor() sets the wand image progress monitor to the 9752% specified method and returns the previous progress monitor if any. The 9753% progress monitor method looks like this: 9754% 9755% MagickBooleanType MagickProgressMonitor(const char *text, 9756% const MagickOffsetType offset,const MagickSizeType span, 9757% void *client_data) 9758% 9759% If the progress monitor returns MagickFalse, the current operation is 9760% interrupted. 9761% 9762% The format of the MagickSetImageProgressMonitor method is: 9763% 9764% MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand 9765% const MagickProgressMonitor progress_monitor,void *client_data) 9766% 9767% A description of each parameter follows: 9768% 9769% o wand: the magick wand. 9770% 9771% o progress_monitor: Specifies a pointer to a method to monitor progress 9772% of an image operation. 9773% 9774% o client_data: Specifies a pointer to any client data. 9775% 9776*/ 9777WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand, 9778 const MagickProgressMonitor progress_monitor,void *client_data) 9779{ 9780 MagickProgressMonitor 9781 previous_monitor; 9782 9783 assert(wand != (MagickWand *) NULL); 9784 assert(wand->signature == WandSignature); 9785 if (wand->debug != MagickFalse) 9786 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9787 if (wand->images == (Image *) NULL) 9788 { 9789 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 9790 "ContainsNoImages","`%s'",wand->name); 9791 return((MagickProgressMonitor) NULL); 9792 } 9793 previous_monitor=SetImageProgressMonitor(wand->images, 9794 progress_monitor,client_data); 9795 return(previous_monitor); 9796} 9797 9798/* 9799%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9800% % 9801% % 9802% % 9803% M a g i c k S e t I m a g e R e d P r i m a r y % 9804% % 9805% % 9806% % 9807%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9808% 9809% MagickSetImageRedPrimary() sets the image chromaticity red primary point. 9810% 9811% The format of the MagickSetImageRedPrimary method is: 9812% 9813% MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand, 9814% const double x,const double y) 9815% 9816% A description of each parameter follows: 9817% 9818% o wand: the magick wand. 9819% 9820% o x: the red primary x-point. 9821% 9822% o y: the red primary y-point. 9823% 9824*/ 9825WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand, 9826 const double x,const double y) 9827{ 9828 assert(wand != (MagickWand *) NULL); 9829 assert(wand->signature == WandSignature); 9830 if (wand->debug != MagickFalse) 9831 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9832 if (wand->images == (Image *) NULL) 9833 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9834 wand->images->chromaticity.red_primary.x=x; 9835 wand->images->chromaticity.red_primary.y=y; 9836 return(MagickTrue); 9837} 9838 9839/* 9840%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9841% % 9842% % 9843% % 9844% M a g i c k S e t I m a g e R e n d e r i n g I n t e n t % 9845% % 9846% % 9847% % 9848%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9849% 9850% MagickSetImageRenderingIntent() sets the image rendering intent. 9851% 9852% The format of the MagickSetImageRenderingIntent method is: 9853% 9854% MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand, 9855% const RenderingIntent rendering_intent) 9856% 9857% A description of each parameter follows: 9858% 9859% o wand: the magick wand. 9860% 9861% o rendering_intent: the image rendering intent: UndefinedIntent, 9862% SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent. 9863% 9864*/ 9865WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand, 9866 const RenderingIntent rendering_intent) 9867{ 9868 assert(wand != (MagickWand *) NULL); 9869 assert(wand->signature == WandSignature); 9870 if (wand->debug != MagickFalse) 9871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9872 if (wand->images == (Image *) NULL) 9873 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9874 wand->images->rendering_intent=rendering_intent; 9875 return(MagickTrue); 9876} 9877 9878/* 9879%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9880% % 9881% % 9882% % 9883% M a g i c k S e t I m a g e R e s o l u t i o n % 9884% % 9885% % 9886% % 9887%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9888% 9889% MagickSetImageResolution() sets the image resolution. 9890% 9891% The format of the MagickSetImageResolution method is: 9892% 9893% MagickBooleanType MagickSetImageResolution(MagickWand *wand, 9894% const double x_resolution,const doubtl y_resolution) 9895% 9896% A description of each parameter follows: 9897% 9898% o wand: the magick wand. 9899% 9900% o x_resolution: the image x resolution. 9901% 9902% o y_resolution: the image y resolution. 9903% 9904*/ 9905WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand, 9906 const double x_resolution,const double y_resolution) 9907{ 9908 assert(wand != (MagickWand *) NULL); 9909 assert(wand->signature == WandSignature); 9910 if (wand->debug != MagickFalse) 9911 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9912 if (wand->images == (Image *) NULL) 9913 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9914 wand->images->x_resolution=x_resolution; 9915 wand->images->y_resolution=y_resolution; 9916 return(MagickTrue); 9917} 9918 9919/* 9920%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9921% % 9922% % 9923% % 9924% M a g i c k S e t I m a g e S c e n e % 9925% % 9926% % 9927% % 9928%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9929% 9930% MagickSetImageScene() sets the image scene. 9931% 9932% The format of the MagickSetImageScene method is: 9933% 9934% MagickBooleanType MagickSetImageScene(MagickWand *wand, 9935% const size_t scene) 9936% 9937% A description of each parameter follows: 9938% 9939% o wand: the magick wand. 9940% 9941% o delay: the image scene number. 9942% 9943*/ 9944WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand, 9945 const size_t scene) 9946{ 9947 assert(wand != (MagickWand *) NULL); 9948 assert(wand->signature == WandSignature); 9949 if (wand->debug != MagickFalse) 9950 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9951 if (wand->images == (Image *) NULL) 9952 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9953 wand->images->scene=scene; 9954 return(MagickTrue); 9955} 9956 9957/* 9958%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9959% % 9960% % 9961% % 9962% M a g i c k S e t I m a g e T i c k s P e r S e c o n d % 9963% % 9964% % 9965% % 9966%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9967% 9968% MagickSetImageTicksPerSecond() sets the image ticks-per-second. 9969% 9970% The format of the MagickSetImageTicksPerSecond method is: 9971% 9972% MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand, 9973% const ssize_t ticks_per-second) 9974% 9975% A description of each parameter follows: 9976% 9977% o wand: the magick wand. 9978% 9979% o ticks_per_second: the units to use for the image delay. 9980% 9981*/ 9982WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand, 9983 const ssize_t ticks_per_second) 9984{ 9985 assert(wand != (MagickWand *) NULL); 9986 assert(wand->signature == WandSignature); 9987 if (wand->debug != MagickFalse) 9988 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 9989 if (wand->images == (Image *) NULL) 9990 ThrowWandException(WandError,"ContainsNoImages",wand->name); 9991 wand->images->ticks_per_second=ticks_per_second; 9992 return(MagickTrue); 9993} 9994 9995/* 9996%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9997% % 9998% % 9999% % 10000% M a g i c k S e t I m a g e T y p e % 10001% % 10002% % 10003% % 10004%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10005% 10006% MagickSetImageType() sets the image type. 10007% 10008% The format of the MagickSetImageType method is: 10009% 10010% MagickBooleanType MagickSetImageType(MagickWand *wand, 10011% const ImageType image_type) 10012% 10013% A description of each parameter follows: 10014% 10015% o wand: the magick wand. 10016% 10017% o image_type: the image type: UndefinedType, BilevelType, GrayscaleType, 10018% GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType, 10019% TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType, 10020% or OptimizeType. 10021% 10022*/ 10023WandExport MagickBooleanType MagickSetImageType(MagickWand *wand, 10024 const ImageType image_type) 10025{ 10026 assert(wand != (MagickWand *) NULL); 10027 assert(wand->signature == WandSignature); 10028 if (wand->debug != MagickFalse) 10029 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10030 if (wand->images == (Image *) NULL) 10031 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10032 return(SetImageType(wand->images,image_type)); 10033} 10034 10035/* 10036%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10037% % 10038% % 10039% % 10040% M a g i c k S e t I m a g e U n i t s % 10041% % 10042% % 10043% % 10044%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10045% 10046% MagickSetImageUnits() sets the image units of resolution. 10047% 10048% The format of the MagickSetImageUnits method is: 10049% 10050% MagickBooleanType MagickSetImageUnits(MagickWand *wand, 10051% const ResolutionType units) 10052% 10053% A description of each parameter follows: 10054% 10055% o wand: the magick wand. 10056% 10057% o units: the image units of resolution : UndefinedResolution, 10058% PixelsPerInchResolution, or PixelsPerCentimeterResolution. 10059% 10060*/ 10061WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand, 10062 const ResolutionType units) 10063{ 10064 assert(wand != (MagickWand *) NULL); 10065 assert(wand->signature == WandSignature); 10066 if (wand->debug != MagickFalse) 10067 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10068 if (wand->images == (Image *) NULL) 10069 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10070 wand->images->units=units; 10071 return(MagickTrue); 10072} 10073 10074/* 10075%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10076% % 10077% % 10078% % 10079% M a g i c k S e t I m a g e V i r t u a l P i x e l M e t h o d % 10080% % 10081% % 10082% % 10083%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10084% 10085% MagickSetImageVirtualPixelMethod() sets the image virtual pixel method. 10086% 10087% The format of the MagickSetImageVirtualPixelMethod method is: 10088% 10089% VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand, 10090% const VirtualPixelMethod method) 10091% 10092% A description of each parameter follows: 10093% 10094% o wand: the magick wand. 10095% 10096% o method: the image virtual pixel method : UndefinedVirtualPixelMethod, 10097% ConstantVirtualPixelMethod, EdgeVirtualPixelMethod, 10098% MirrorVirtualPixelMethod, or TileVirtualPixelMethod. 10099% 10100*/ 10101WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand, 10102 const VirtualPixelMethod method) 10103{ 10104 assert(wand != (MagickWand *) NULL); 10105 assert(wand->signature == WandSignature); 10106 if (wand->debug != MagickFalse) 10107 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10108 if (wand->images == (Image *) NULL) 10109 return(UndefinedVirtualPixelMethod); 10110 return(SetImageVirtualPixelMethod(wand->images,method)); 10111} 10112 10113/* 10114%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10115% % 10116% % 10117% % 10118% M a g i c k S e t I m a g e W h i t e P o i n t % 10119% % 10120% % 10121% % 10122%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10123% 10124% MagickSetImageWhitePoint() sets the image chromaticity white point. 10125% 10126% The format of the MagickSetImageWhitePoint method is: 10127% 10128% MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand, 10129% const double x,const double y) 10130% 10131% A description of each parameter follows: 10132% 10133% o wand: the magick wand. 10134% 10135% o x: the white x-point. 10136% 10137% o y: the white y-point. 10138% 10139*/ 10140WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand, 10141 const double x,const double y) 10142{ 10143 assert(wand != (MagickWand *) NULL); 10144 assert(wand->signature == WandSignature); 10145 if (wand->debug != MagickFalse) 10146 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10147 if (wand->images == (Image *) NULL) 10148 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10149 wand->images->chromaticity.white_point.x=x; 10150 wand->images->chromaticity.white_point.y=y; 10151 return(MagickTrue); 10152} 10153 10154/* 10155%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10156% % 10157% % 10158% % 10159% M a g i c k S h a d e I m a g e C h a n n e l % 10160% % 10161% % 10162% % 10163%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10164% 10165% MagickShadeImage() shines a distant light on an image to create a 10166% three-dimensional effect. You control the positioning of the light with 10167% azimuth and elevation; azimuth is measured in degrees off the x axis 10168% and elevation is measured in pixels above the Z axis. 10169% 10170% The format of the MagickShadeImage method is: 10171% 10172% MagickBooleanType MagickShadeImage(MagickWand *wand, 10173% const MagickBooleanType gray,const double azimuth, 10174% const double elevation) 10175% 10176% A description of each parameter follows: 10177% 10178% o wand: the magick wand. 10179% 10180% o gray: A value other than zero shades the intensity of each pixel. 10181% 10182% o azimuth, elevation: Define the light source direction. 10183% 10184*/ 10185WandExport MagickBooleanType MagickShadeImage(MagickWand *wand, 10186 const MagickBooleanType gray,const double asimuth,const double elevation) 10187{ 10188 Image 10189 *shade_image; 10190 10191 assert(wand != (MagickWand *) NULL); 10192 assert(wand->signature == WandSignature); 10193 if (wand->debug != MagickFalse) 10194 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10195 if (wand->images == (Image *) NULL) 10196 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10197 shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception); 10198 if (shade_image == (Image *) NULL) 10199 return(MagickFalse); 10200 ReplaceImageInList(&wand->images,shade_image); 10201 return(MagickTrue); 10202} 10203 10204/* 10205%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10206% % 10207% % 10208% % 10209% M a g i c k S h a d o w I m a g e % 10210% % 10211% % 10212% % 10213%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10214% 10215% MagickShadowImage() simulates an image shadow. 10216% 10217% The format of the MagickShadowImage method is: 10218% 10219% MagickBooleanType MagickShadowImage(MagickWand *wand, 10220% const double opacity,const double sigma,const ssize_t x,const ssize_t y) 10221% 10222% A description of each parameter follows: 10223% 10224% o wand: the magick wand. 10225% 10226% o opacity: percentage transparency. 10227% 10228% o sigma: the standard deviation of the Gaussian, in pixels. 10229% 10230% o x: the shadow x-offset. 10231% 10232% o y: the shadow y-offset. 10233% 10234*/ 10235WandExport MagickBooleanType MagickShadowImage(MagickWand *wand, 10236 const double opacity,const double sigma,const ssize_t x,const ssize_t y) 10237{ 10238 Image 10239 *shadow_image; 10240 10241 assert(wand != (MagickWand *) NULL); 10242 assert(wand->signature == WandSignature); 10243 if (wand->debug != MagickFalse) 10244 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10245 if (wand->images == (Image *) NULL) 10246 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10247 shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception); 10248 if (shadow_image == (Image *) NULL) 10249 return(MagickFalse); 10250 ReplaceImageInList(&wand->images,shadow_image); 10251 return(MagickTrue); 10252} 10253 10254/* 10255%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10256% % 10257% % 10258% % 10259% M a g i c k S h a r p e n I m a g e % 10260% % 10261% % 10262% % 10263%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10264% 10265% MagickSharpenImage() sharpens an image. We convolve the image with a 10266% Gaussian operator of the given radius and standard deviation (sigma). 10267% For reasonable results, the radius should be larger than sigma. Use a 10268% radius of 0 and MagickSharpenImage() selects a suitable radius for you. 10269% 10270% The format of the MagickSharpenImage method is: 10271% 10272% MagickBooleanType MagickSharpenImage(MagickWand *wand, 10273% const double radius,const double sigma) 10274% 10275% A description of each parameter follows: 10276% 10277% o wand: the magick wand. 10278% 10279% o radius: the radius of the Gaussian, in pixels, not counting the center 10280% pixel. 10281% 10282% o sigma: the standard deviation of the Gaussian, in pixels. 10283% 10284*/ 10285WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand, 10286 const double radius,const double sigma) 10287{ 10288 Image 10289 *sharp_image; 10290 10291 assert(wand != (MagickWand *) NULL); 10292 assert(wand->signature == WandSignature); 10293 if (wand->debug != MagickFalse) 10294 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10295 if (wand->images == (Image *) NULL) 10296 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10297 sharp_image=SharpenImage(wand->images,radius,sigma,wand->exception); 10298 if (sharp_image == (Image *) NULL) 10299 return(MagickFalse); 10300 ReplaceImageInList(&wand->images,sharp_image); 10301 return(MagickTrue); 10302} 10303 10304/* 10305%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10306% % 10307% % 10308% % 10309% M a g i c k S h a v e I m a g e % 10310% % 10311% % 10312% % 10313%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10314% 10315% MagickShaveImage() shaves pixels from the image edges. It allocates the 10316% memory necessary for the new Image structure and returns a pointer to the 10317% new image. 10318% 10319% The format of the MagickShaveImage method is: 10320% 10321% MagickBooleanType MagickShaveImage(MagickWand *wand, 10322% const size_t columns,const size_t rows) 10323% 10324% A description of each parameter follows: 10325% 10326% o wand: the magick wand. 10327% 10328% o columns: the number of columns in the scaled image. 10329% 10330% o rows: the number of rows in the scaled image. 10331% 10332% 10333*/ 10334WandExport MagickBooleanType MagickShaveImage(MagickWand *wand, 10335 const size_t columns,const size_t rows) 10336{ 10337 Image 10338 *shave_image; 10339 10340 RectangleInfo 10341 shave_info; 10342 10343 assert(wand != (MagickWand *) NULL); 10344 assert(wand->signature == WandSignature); 10345 if (wand->debug != MagickFalse) 10346 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10347 if (wand->images == (Image *) NULL) 10348 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10349 shave_info.width=columns; 10350 shave_info.height=rows; 10351 shave_info.x=0; 10352 shave_info.y=0; 10353 shave_image=ShaveImage(wand->images,&shave_info,wand->exception); 10354 if (shave_image == (Image *) NULL) 10355 return(MagickFalse); 10356 ReplaceImageInList(&wand->images,shave_image); 10357 return(MagickTrue); 10358} 10359 10360/* 10361%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10362% % 10363% % 10364% % 10365% M a g i c k S h e a r I m a g e % 10366% % 10367% % 10368% % 10369%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10370% 10371% MagickShearImage() slides one edge of an image along the X or Y axis, 10372% creating a parallelogram. An X direction shear slides an edge along the X 10373% axis, while a Y direction shear slides an edge along the Y axis. The amount 10374% of the shear is controlled by a shear angle. For X direction shears, x_shear 10375% is measured relative to the Y axis, and similarly, for Y direction shears 10376% y_shear is measured relative to the X axis. Empty triangles left over from 10377% shearing the image are filled with the background color. 10378% 10379% The format of the MagickShearImage method is: 10380% 10381% MagickBooleanType MagickShearImage(MagickWand *wand, 10382% const PixelWand *background,const double x_shear,onst double y_shear) 10383% 10384% A description of each parameter follows: 10385% 10386% o wand: the magick wand. 10387% 10388% o background: the background pixel wand. 10389% 10390% o x_shear: the number of degrees to shear the image. 10391% 10392% o y_shear: the number of degrees to shear the image. 10393% 10394*/ 10395WandExport MagickBooleanType MagickShearImage(MagickWand *wand, 10396 const PixelWand *background,const double x_shear,const double y_shear) 10397{ 10398 Image 10399 *shear_image; 10400 10401 assert(wand != (MagickWand *) NULL); 10402 assert(wand->signature == WandSignature); 10403 if (wand->debug != MagickFalse) 10404 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10405 if (wand->images == (Image *) NULL) 10406 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10407 PixelGetQuantumPacket(background,&wand->images->background_color); 10408 shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception); 10409 if (shear_image == (Image *) NULL) 10410 return(MagickFalse); 10411 ReplaceImageInList(&wand->images,shear_image); 10412 return(MagickTrue); 10413} 10414 10415/* 10416%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10417% % 10418% % 10419% % 10420% M a g i c k S i g m o i d a l C o n t r a s t I m a g e % 10421% % 10422% % 10423% % 10424%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10425% 10426% MagickSigmoidalContrastImage() adjusts the contrast of an image with a 10427% non-linear sigmoidal contrast algorithm. Increase the contrast of the 10428% image using a sigmoidal transfer function without saturating highlights or 10429% shadows. Contrast indicates how much to increase the contrast (0 is none; 10430% 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in 10431% the resultant image (0 is white; 50% is middle-gray; 100% is black). Set 10432% sharpen to MagickTrue to increase the image contrast otherwise the contrast 10433% is reduced. 10434% 10435% The format of the MagickSigmoidalContrastImage method is: 10436% 10437% MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand, 10438% const MagickBooleanType sharpen,const double alpha,const double beta) 10439% 10440% A description of each parameter follows: 10441% 10442% o wand: the magick wand. 10443% 10444% o sharpen: Increase or decrease image contrast. 10445% 10446% o alpha: strength of the contrast, the larger the number the more 10447% 'threshold-like' it becomes. 10448% 10449% o beta: midpoint of the function as a color value 0 to QuantumRange. 10450% 10451*/ 10452WandExport MagickBooleanType MagickSigmoidalContrastImage( 10453 MagickWand *wand,const MagickBooleanType sharpen,const double alpha, 10454 const double beta) 10455{ 10456 MagickBooleanType 10457 status; 10458 10459 assert(wand != (MagickWand *) NULL); 10460 assert(wand->signature == WandSignature); 10461 if (wand->debug != MagickFalse) 10462 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10463 if (wand->images == (Image *) NULL) 10464 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10465 status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta); 10466 if (status == MagickFalse) 10467 InheritException(wand->exception,&wand->images->exception); 10468 return(status); 10469} 10470 10471/* 10472%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10473% % 10474% % 10475% % 10476% M a g i c k S i m i l a r i t y I m a g e % 10477% % 10478% % 10479% % 10480%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10481% 10482% MagickSimilarityImage() compares the reference image of the image and 10483% returns the best match offset. In addition, it returns a similarity image 10484% such that an exact match location is completely white and if none of the 10485% pixels match, black, otherwise some gray level in-between. 10486% 10487% The format of the MagickSimilarityImage method is: 10488% 10489% MagickWand *MagickSimilarityImage(MagickWand *wand, 10490% const MagickWand *reference,RectangeInfo *offset,double *similarity) 10491% 10492% A description of each parameter follows: 10493% 10494% o wand: the magick wand. 10495% 10496% o reference: the reference wand. 10497% 10498% o offset: the best match offset of the reference image within the image. 10499% 10500% o similarity: the computed similarity between the images. 10501% 10502*/ 10503WandExport MagickWand *MagickSimilarityImage(MagickWand *wand, 10504 const MagickWand *reference,RectangleInfo *offset,double *similarity) 10505{ 10506 Image 10507 *similarity_image; 10508 10509 assert(wand != (MagickWand *) NULL); 10510 assert(wand->signature == WandSignature); 10511 if (wand->debug != MagickFalse) 10512 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10513 if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) 10514 { 10515 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 10516 "ContainsNoImages","`%s'",wand->name); 10517 return((MagickWand *) NULL); 10518 } 10519 similarity_image=SimilarityImage(wand->images,reference->images,offset, 10520 similarity,&wand->images->exception); 10521 if (similarity_image == (Image *) NULL) 10522 return((MagickWand *) NULL); 10523 return(CloneMagickWandFromImages(wand,similarity_image)); 10524} 10525 10526/* 10527%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10528% % 10529% % 10530% % 10531% M a g i c k S k e t c h I m a g e % 10532% % 10533% % 10534% % 10535%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10536% 10537% MagickSketchImage() simulates a pencil sketch. We convolve the image with 10538% a Gaussian operator of the given radius and standard deviation (sigma). 10539% For reasonable results, radius should be larger than sigma. Use a 10540% radius of 0 and SketchImage() selects a suitable radius for you. 10541% Angle gives the angle of the blurring motion. 10542% 10543% The format of the MagickSketchImage method is: 10544% 10545% MagickBooleanType MagickSketchImage(MagickWand *wand, 10546% const double radius,const double sigma,const double angle) 10547% 10548% A description of each parameter follows: 10549% 10550% o wand: the magick wand. 10551% 10552% o radius: the radius of the Gaussian, in pixels, not counting 10553% the center pixel. 10554% 10555% o sigma: the standard deviation of the Gaussian, in pixels. 10556% 10557% o angle: Apply the effect along this angle. 10558% 10559*/ 10560WandExport MagickBooleanType MagickSketchImage(MagickWand *wand, 10561 const double radius,const double sigma,const double angle) 10562{ 10563 Image 10564 *sketch_image; 10565 10566 assert(wand != (MagickWand *) NULL); 10567 assert(wand->signature == WandSignature); 10568 if (wand->debug != MagickFalse) 10569 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10570 if (wand->images == (Image *) NULL) 10571 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10572 sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception); 10573 if (sketch_image == (Image *) NULL) 10574 return(MagickFalse); 10575 ReplaceImageInList(&wand->images,sketch_image); 10576 return(MagickTrue); 10577} 10578 10579/* 10580%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10581% % 10582% % 10583% % 10584% M a g i c k S m u s h I m a g e s % 10585% % 10586% % 10587% % 10588%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10589% 10590% MagickSmushImages() takes all images from the current image pointer to the 10591% end of the image list and smushs them to each other top-to-bottom if the 10592% stack parameter is true, otherwise left-to-right. 10593% 10594% The format of the MagickSmushImages method is: 10595% 10596% MagickWand *MagickSmushImages(MagickWand *wand, 10597% const MagickBooleanType stack,const ssize_t offset) 10598% 10599% A description of each parameter follows: 10600% 10601% o wand: the magick wand. 10602% 10603% o stack: By default, images are stacked left-to-right. Set stack to 10604% MagickTrue to stack them top-to-bottom. 10605% 10606% o offset: minimum distance in pixels between images. 10607% 10608*/ 10609WandExport MagickWand *MagickSmushImages(MagickWand *wand, 10610 const MagickBooleanType stack,const ssize_t offset) 10611{ 10612 Image 10613 *smush_image; 10614 10615 assert(wand != (MagickWand *) NULL); 10616 assert(wand->signature == WandSignature); 10617 if (wand->debug != MagickFalse) 10618 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10619 if (wand->images == (Image *) NULL) 10620 return((MagickWand *) NULL); 10621 smush_image=SmushImages(wand->images,stack,offset,wand->exception); 10622 if (smush_image == (Image *) NULL) 10623 return((MagickWand *) NULL); 10624 return(CloneMagickWandFromImages(wand,smush_image)); 10625} 10626 10627/* 10628%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10629% % 10630% % 10631% % 10632% M a g i c k S o l a r i z e I m a g e % 10633% % 10634% % 10635% % 10636%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10637% 10638% MagickSolarizeImage() applies a special effect to the image, similar to the 10639% effect achieved in a photo darkroom by selectively exposing areas of photo 10640% sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a 10641% measure of the extent of the solarization. 10642% 10643% The format of the MagickSolarizeImage method is: 10644% 10645% MagickBooleanType MagickSolarizeImage(MagickWand *wand, 10646% const double threshold) 10647% 10648% A description of each parameter follows: 10649% 10650% o wand: the magick wand. 10651% 10652% o threshold: Define the extent of the solarization. 10653% 10654*/ 10655WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand, 10656 const double threshold) 10657{ 10658 MagickBooleanType 10659 status; 10660 10661 assert(wand != (MagickWand *) NULL); 10662 assert(wand->signature == WandSignature); 10663 if (wand->debug != MagickFalse) 10664 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10665 if (wand->images == (Image *) NULL) 10666 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10667 status=SolarizeImage(wand->images,threshold); 10668 if (status == MagickFalse) 10669 InheritException(wand->exception,&wand->images->exception); 10670 return(status); 10671} 10672 10673/* 10674%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10675% % 10676% % 10677% % 10678% M a g i c k S p a r s e C o l o r I m a g e % 10679% % 10680% % 10681% % 10682%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10683% 10684% MagickSparseColorImage(), given a set of coordinates, interpolates the 10685% colors found at those coordinates, across the whole image, using various 10686% methods. 10687% 10688% The format of the MagickSparseColorImage method is: 10689% 10690% MagickBooleanType MagickSparseColorImage(MagickWand *wand, 10691% const SparseColorMethod method,const size_t number_arguments, 10692% const double *arguments) 10693% 10694% A description of each parameter follows: 10695% 10696% o image: the image to be sparseed. 10697% 10698% o method: the method of image sparseion. 10699% 10700% ArcSparseColorion will always ignore source image offset, and always 10701% 'bestfit' the destination image with the top left corner offset 10702% relative to the polar mapping center. 10703% 10704% Bilinear has no simple inverse mapping so will not allow 'bestfit' 10705% style of image sparseion. 10706% 10707% Affine, Perspective, and Bilinear, will do least squares fitting of 10708% the distrotion when more than the minimum number of control point 10709% pairs are provided. 10710% 10711% Perspective, and Bilinear, will fall back to a Affine sparseion when 10712% less than 4 control point pairs are provided. While Affine sparseions 10713% will let you use any number of control point pairs, that is Zero pairs 10714% is a No-Op (viewport only) distrotion, one pair is a translation and 10715% two pairs of control points will do a scale-rotate-translate, without 10716% any shearing. 10717% 10718% o number_arguments: the number of arguments given for this sparseion 10719% method. 10720% 10721% o arguments: the arguments for this sparseion method. 10722% 10723*/ 10724WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand, 10725 const SparseColorMethod method,const size_t number_arguments, 10726 const double *arguments) 10727{ 10728 Image 10729 *sparse_image; 10730 10731 assert(wand != (MagickWand *) NULL); 10732 assert(wand->signature == WandSignature); 10733 if (wand->debug != MagickFalse) 10734 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10735 if (wand->images == (Image *) NULL) 10736 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10737 sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments, 10738 wand->exception); 10739 if (sparse_image == (Image *) NULL) 10740 return(MagickFalse); 10741 ReplaceImageInList(&wand->images,sparse_image); 10742 return(MagickTrue); 10743} 10744 10745/* 10746%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10747% % 10748% % 10749% % 10750% M a g i c k S p l i c e I m a g e % 10751% % 10752% % 10753% % 10754%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10755% 10756% MagickSpliceImage() splices a solid color into the image. 10757% 10758% The format of the MagickSpliceImage method is: 10759% 10760% MagickBooleanType MagickSpliceImage(MagickWand *wand, 10761% const size_t width,const size_t height,const ssize_t x, 10762% const ssize_t y) 10763% 10764% A description of each parameter follows: 10765% 10766% o wand: the magick wand. 10767% 10768% o width: the region width. 10769% 10770% o height: the region height. 10771% 10772% o x: the region x offset. 10773% 10774% o y: the region y offset. 10775% 10776*/ 10777WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand, 10778 const size_t width,const size_t height,const ssize_t x, 10779 const ssize_t y) 10780{ 10781 Image 10782 *splice_image; 10783 10784 RectangleInfo 10785 splice; 10786 10787 assert(wand != (MagickWand *) NULL); 10788 assert(wand->signature == WandSignature); 10789 if (wand->debug != MagickFalse) 10790 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10791 if (wand->images == (Image *) NULL) 10792 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10793 splice.width=width; 10794 splice.height=height; 10795 splice.x=x; 10796 splice.y=y; 10797 splice_image=SpliceImage(wand->images,&splice,wand->exception); 10798 if (splice_image == (Image *) NULL) 10799 return(MagickFalse); 10800 ReplaceImageInList(&wand->images,splice_image); 10801 return(MagickTrue); 10802} 10803 10804/* 10805%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10806% % 10807% % 10808% % 10809% M a g i c k S p r e a d I m a g e % 10810% % 10811% % 10812% % 10813%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10814% 10815% MagickSpreadImage() is a special effects method that randomly displaces each 10816% pixel in a block defined by the radius parameter. 10817% 10818% The format of the MagickSpreadImage method is: 10819% 10820% MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius) 10821% 10822% A description of each parameter follows: 10823% 10824% o wand: the magick wand. 10825% 10826% o radius: Choose a random pixel in a neighborhood of this extent. 10827% 10828*/ 10829WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand, 10830 const double radius) 10831{ 10832 Image 10833 *spread_image; 10834 10835 assert(wand != (MagickWand *) NULL); 10836 assert(wand->signature == WandSignature); 10837 if (wand->debug != MagickFalse) 10838 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10839 if (wand->images == (Image *) NULL) 10840 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10841 spread_image=SpreadImage(wand->images,radius,wand->exception); 10842 if (spread_image == (Image *) NULL) 10843 return(MagickFalse); 10844 ReplaceImageInList(&wand->images,spread_image); 10845 return(MagickTrue); 10846} 10847 10848/* 10849%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10850% % 10851% % 10852% % 10853% M a g i c k S t a t i s t i c I m a g e % 10854% % 10855% % 10856% % 10857%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10858% 10859% MagickStatisticImage() replace each pixel with corresponding statistic from 10860% the neighborhood of the specified width and height. 10861% 10862% The format of the MagickStatisticImage method is: 10863% 10864% MagickBooleanType MagickStatisticImage(MagickWand *wand, 10865% const StatisticType type,const double width,const size_t height) 10866% 10867% A description of each parameter follows: 10868% 10869% o wand: the magick wand. 10870% 10871% o type: the statistic type (e.g. median, mode, etc.). 10872% 10873% o width: the width of the pixel neighborhood. 10874% 10875% o height: the height of the pixel neighborhood. 10876% 10877*/ 10878WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand, 10879 const StatisticType type,const size_t width,const size_t height) 10880{ 10881 Image 10882 *statistic_image; 10883 10884 assert(wand != (MagickWand *) NULL); 10885 assert(wand->signature == WandSignature); 10886 if (wand->debug != MagickFalse) 10887 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10888 if (wand->images == (Image *) NULL) 10889 ThrowWandException(WandError,"ContainsNoImages",wand->name); 10890 statistic_image=StatisticImage(wand->images,type,width,height, 10891 wand->exception); 10892 if (statistic_image == (Image *) NULL) 10893 return(MagickFalse); 10894 ReplaceImageInList(&wand->images,statistic_image); 10895 return(MagickTrue); 10896} 10897 10898/* 10899%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10900% % 10901% % 10902% % 10903% M a g i c k S t e g a n o I m a g e % 10904% % 10905% % 10906% % 10907%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10908% 10909% MagickSteganoImage() hides a digital watermark within the image. 10910% Recover the hidden watermark later to prove that the authenticity of 10911% an image. Offset defines the start position within the image to hide 10912% the watermark. 10913% 10914% The format of the MagickSteganoImage method is: 10915% 10916% MagickWand *MagickSteganoImage(MagickWand *wand, 10917% const MagickWand *watermark_wand,const ssize_t offset) 10918% 10919% A description of each parameter follows: 10920% 10921% o wand: the magick wand. 10922% 10923% o watermark_wand: the watermark wand. 10924% 10925% o offset: Start hiding at this offset into the image. 10926% 10927*/ 10928WandExport MagickWand *MagickSteganoImage(MagickWand *wand, 10929 const MagickWand *watermark_wand,const ssize_t offset) 10930{ 10931 Image 10932 *stegano_image; 10933 10934 assert(wand != (MagickWand *) NULL); 10935 assert(wand->signature == WandSignature); 10936 if (wand->debug != MagickFalse) 10937 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10938 if ((wand->images == (Image *) NULL) || 10939 (watermark_wand->images == (Image *) NULL)) 10940 { 10941 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 10942 "ContainsNoImages","`%s'",wand->name); 10943 return((MagickWand *) NULL); 10944 } 10945 wand->images->offset=offset; 10946 stegano_image=SteganoImage(wand->images,watermark_wand->images, 10947 wand->exception); 10948 if (stegano_image == (Image *) NULL) 10949 return((MagickWand *) NULL); 10950 return(CloneMagickWandFromImages(wand,stegano_image)); 10951} 10952 10953/* 10954%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10955% % 10956% % 10957% % 10958% M a g i c k S t e r e o I m a g e % 10959% % 10960% % 10961% % 10962%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10963% 10964% MagickStereoImage() composites two images and produces a single image that 10965% is the composite of a left and right image of a stereo pair 10966% 10967% The format of the MagickStereoImage method is: 10968% 10969% MagickWand *MagickStereoImage(MagickWand *wand, 10970% const MagickWand *offset_wand) 10971% 10972% A description of each parameter follows: 10973% 10974% o wand: the magick wand. 10975% 10976% o offset_wand: Another image wand. 10977% 10978*/ 10979WandExport MagickWand *MagickStereoImage(MagickWand *wand, 10980 const MagickWand *offset_wand) 10981{ 10982 Image 10983 *stereo_image; 10984 10985 assert(wand != (MagickWand *) NULL); 10986 assert(wand->signature == WandSignature); 10987 if (wand->debug != MagickFalse) 10988 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 10989 if ((wand->images == (Image *) NULL) || 10990 (offset_wand->images == (Image *) NULL)) 10991 { 10992 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 10993 "ContainsNoImages","`%s'",wand->name); 10994 return((MagickWand *) NULL); 10995 } 10996 stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception); 10997 if (stereo_image == (Image *) NULL) 10998 return((MagickWand *) NULL); 10999 return(CloneMagickWandFromImages(wand,stereo_image)); 11000} 11001 11002/* 11003%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11004% % 11005% % 11006% % 11007% M a g i c k S t r i p I m a g e % 11008% % 11009% % 11010% % 11011%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11012% 11013% MagickStripImage() strips an image of all profiles and comments. 11014% 11015% The format of the MagickStripImage method is: 11016% 11017% MagickBooleanType MagickStripImage(MagickWand *wand) 11018% 11019% A description of each parameter follows: 11020% 11021% o wand: the magick wand. 11022% 11023*/ 11024WandExport MagickBooleanType MagickStripImage(MagickWand *wand) 11025{ 11026 MagickBooleanType 11027 status; 11028 11029 assert(wand != (MagickWand *) NULL); 11030 assert(wand->signature == WandSignature); 11031 if (wand->debug != MagickFalse) 11032 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11033 if (wand->images == (Image *) NULL) 11034 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11035 status=StripImage(wand->images); 11036 if (status == MagickFalse) 11037 InheritException(wand->exception,&wand->images->exception); 11038 return(status); 11039} 11040 11041/* 11042%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11043% % 11044% % 11045% % 11046% M a g i c k S w i r l I m a g e % 11047% % 11048% % 11049% % 11050%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11051% 11052% MagickSwirlImage() swirls the pixels about the center of the image, where 11053% degrees indicates the sweep of the arc through which each pixel is moved. 11054% You get a more dramatic effect as the degrees move from 1 to 360. 11055% 11056% The format of the MagickSwirlImage method is: 11057% 11058% MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees) 11059% 11060% A description of each parameter follows: 11061% 11062% o wand: the magick wand. 11063% 11064% o degrees: Define the tightness of the swirling effect. 11065% 11066*/ 11067WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand, 11068 const double degrees) 11069{ 11070 Image 11071 *swirl_image; 11072 11073 assert(wand != (MagickWand *) NULL); 11074 assert(wand->signature == WandSignature); 11075 if (wand->debug != MagickFalse) 11076 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11077 if (wand->images == (Image *) NULL) 11078 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11079 swirl_image=SwirlImage(wand->images,degrees,wand->exception); 11080 if (swirl_image == (Image *) NULL) 11081 return(MagickFalse); 11082 ReplaceImageInList(&wand->images,swirl_image); 11083 return(MagickTrue); 11084} 11085 11086/* 11087%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11088% % 11089% % 11090% % 11091% M a g i c k T e x t u r e I m a g e % 11092% % 11093% % 11094% % 11095%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11096% 11097% MagickTextureImage() repeatedly tiles the texture image across and down the 11098% image canvas. 11099% 11100% The format of the MagickTextureImage method is: 11101% 11102% MagickWand *MagickTextureImage(MagickWand *wand, 11103% const MagickWand *texture_wand) 11104% 11105% A description of each parameter follows: 11106% 11107% o wand: the magick wand. 11108% 11109% o texture_wand: the texture wand 11110% 11111*/ 11112WandExport MagickWand *MagickTextureImage(MagickWand *wand, 11113 const MagickWand *texture_wand) 11114{ 11115 Image 11116 *texture_image; 11117 11118 MagickBooleanType 11119 status; 11120 11121 assert(wand != (MagickWand *) NULL); 11122 assert(wand->signature == WandSignature); 11123 if (wand->debug != MagickFalse) 11124 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11125 if ((wand->images == (Image *) NULL) || 11126 (texture_wand->images == (Image *) NULL)) 11127 { 11128 (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, 11129 "ContainsNoImages","`%s'",wand->name); 11130 return((MagickWand *) NULL); 11131 } 11132 texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); 11133 if (texture_image == (Image *) NULL) 11134 return((MagickWand *) NULL); 11135 status=TextureImage(texture_image,texture_wand->images); 11136 if (status == MagickFalse) 11137 { 11138 InheritException(wand->exception,&texture_image->exception); 11139 texture_image=DestroyImage(texture_image); 11140 return((MagickWand *) NULL); 11141 } 11142 return(CloneMagickWandFromImages(wand,texture_image)); 11143} 11144 11145/* 11146%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11147% % 11148% % 11149% % 11150% M a g i c k T h r e s h o l d I m a g e % 11151% % 11152% % 11153% % 11154%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11155% 11156% MagickThresholdImage() changes the value of individual pixels based on 11157% the intensity of each pixel compared to threshold. The result is a 11158% high-contrast, two color image. 11159% 11160% The format of the MagickThresholdImage method is: 11161% 11162% MagickBooleanType MagickThresholdImage(MagickWand *wand, 11163% const double threshold) 11164% MagickBooleanType MagickThresholdImageChannel(MagickWand *wand, 11165% const ChannelType channel,const double threshold) 11166% 11167% A description of each parameter follows: 11168% 11169% o wand: the magick wand. 11170% 11171% o channel: the image channel(s). 11172% 11173% o threshold: Define the threshold value. 11174% 11175*/ 11176WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand, 11177 const double threshold) 11178{ 11179 MagickBooleanType 11180 status; 11181 11182 status=MagickThresholdImageChannel(wand,DefaultChannels,threshold); 11183 return(status); 11184} 11185 11186WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand, 11187 const ChannelType channel,const double threshold) 11188{ 11189 MagickBooleanType 11190 status; 11191 11192 assert(wand != (MagickWand *) NULL); 11193 assert(wand->signature == WandSignature); 11194 if (wand->debug != MagickFalse) 11195 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11196 if (wand->images == (Image *) NULL) 11197 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11198 status=BilevelImage(wand->images,threshold); 11199 if (status == MagickFalse) 11200 InheritException(wand->exception,&wand->images->exception); 11201 return(status); 11202} 11203 11204/* 11205%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11206% % 11207% % 11208% % 11209% M a g i c k T h u m b n a i l I m a g e % 11210% % 11211% % 11212% % 11213%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11214% 11215% MagickThumbnailImage() changes the size of an image to the given dimensions 11216% and removes any associated profiles. The goal is to produce small low cost 11217% thumbnail images suited for display on the Web. 11218% 11219% The format of the MagickThumbnailImage method is: 11220% 11221% MagickBooleanType MagickThumbnailImage(MagickWand *wand, 11222% const size_t columns,const size_t rows) 11223% 11224% A description of each parameter follows: 11225% 11226% o wand: the magick wand. 11227% 11228% o columns: the number of columns in the scaled image. 11229% 11230% o rows: the number of rows in the scaled image. 11231% 11232*/ 11233WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand, 11234 const size_t columns,const size_t rows) 11235{ 11236 Image 11237 *thumbnail_image; 11238 11239 assert(wand != (MagickWand *) NULL); 11240 assert(wand->signature == WandSignature); 11241 if (wand->debug != MagickFalse) 11242 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11243 if (wand->images == (Image *) NULL) 11244 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11245 thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception); 11246 if (thumbnail_image == (Image *) NULL) 11247 return(MagickFalse); 11248 ReplaceImageInList(&wand->images,thumbnail_image); 11249 return(MagickTrue); 11250} 11251 11252/* 11253%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11254% % 11255% % 11256% % 11257% M a g i c k T i n t I m a g e % 11258% % 11259% % 11260% % 11261%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11262% 11263% MagickTintImage() applies a color vector to each pixel in the image. The 11264% length of the vector is 0 for black and white and at its maximum for the 11265% midtones. The vector weighting function is 11266% f(x)=(1-(4.0*((x-0.5)*(x-0.5)))). 11267% 11268% The format of the MagickTintImage method is: 11269% 11270% MagickBooleanType MagickTintImage(MagickWand *wand, 11271% const PixelWand *tint,const PixelWand *opacity) 11272% 11273% A description of each parameter follows: 11274% 11275% o wand: the magick wand. 11276% 11277% o tint: the tint pixel wand. 11278% 11279% o opacity: the opacity pixel wand. 11280% 11281*/ 11282WandExport MagickBooleanType MagickTintImage(MagickWand *wand, 11283 const PixelWand *tint,const PixelWand *opacity) 11284{ 11285 char 11286 percent_opaque[MaxTextExtent]; 11287 11288 Image 11289 *tint_image; 11290 11291 PixelPacket 11292 target; 11293 11294 assert(wand != (MagickWand *) NULL); 11295 assert(wand->signature == WandSignature); 11296 if (wand->debug != MagickFalse) 11297 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11298 if (wand->images == (Image *) NULL) 11299 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11300 (void) FormatLocaleString(percent_opaque,MaxTextExtent, 11301 "%g,%g,%g,%g",(double) (100.0*QuantumScale* 11302 PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale* 11303 PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale* 11304 PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale* 11305 PixelGetOpacityQuantum(opacity))); 11306 PixelGetQuantumPacket(tint,&target); 11307 tint_image=TintImage(wand->images,percent_opaque,target,wand->exception); 11308 if (tint_image == (Image *) NULL) 11309 return(MagickFalse); 11310 ReplaceImageInList(&wand->images,tint_image); 11311 return(MagickTrue); 11312} 11313 11314/* 11315%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11316% % 11317% % 11318% % 11319% M a g i c k T r a n s f o r m I m a g e % 11320% % 11321% % 11322% % 11323%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11324% 11325% MagickTransformImage() is a convenience method that behaves like 11326% MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping 11327% information as a region geometry specification. If the operation fails, 11328% a NULL image handle is returned. 11329% 11330% The format of the MagickTransformImage method is: 11331% 11332% MagickWand *MagickTransformImage(MagickWand *wand,const char *crop, 11333% const char *geometry) 11334% 11335% A description of each parameter follows: 11336% 11337% o wand: the magick wand. 11338% 11339% o crop: A crop geometry string. This geometry defines a subregion of the 11340% image to crop. 11341% 11342% o geometry: An image geometry string. This geometry defines the final 11343% size of the image. 11344% 11345*/ 11346WandExport MagickWand *MagickTransformImage(MagickWand *wand, 11347 const char *crop,const char *geometry) 11348{ 11349 Image 11350 *transform_image; 11351 11352 MagickBooleanType 11353 status; 11354 11355 assert(wand != (MagickWand *) NULL); 11356 assert(wand->signature == WandSignature); 11357 if (wand->debug != MagickFalse) 11358 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11359 if (wand->images == (Image *) NULL) 11360 return((MagickWand *) NULL); 11361 transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); 11362 if (transform_image == (Image *) NULL) 11363 return((MagickWand *) NULL); 11364 status=TransformImage(&transform_image,crop,geometry); 11365 if (status == MagickFalse) 11366 { 11367 InheritException(wand->exception,&transform_image->exception); 11368 transform_image=DestroyImage(transform_image); 11369 return((MagickWand *) NULL); 11370 } 11371 return(CloneMagickWandFromImages(wand,transform_image)); 11372} 11373 11374/* 11375%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11376% % 11377% % 11378% % 11379% M a g i c k T r a n s f o r m I m a g e C o l o r s p a c e % 11380% % 11381% % 11382% % 11383%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11384% 11385% MagickTransformImageColorspace() transform the image colorspace. 11386% 11387% The format of the MagickTransformImageColorspace method is: 11388% 11389% MagickBooleanType MagickTransformImageColorspace(MagickWand *wand, 11390% const ColorspaceType colorspace) 11391% 11392% A description of each parameter follows: 11393% 11394% o wand: the magick wand. 11395% 11396% o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace, 11397% GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace, 11398% YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace, 11399% YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace, 11400% HSLColorspace, or HWBColorspace. 11401% 11402*/ 11403WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand, 11404 const ColorspaceType colorspace) 11405{ 11406 assert(wand != (MagickWand *) NULL); 11407 assert(wand->signature == WandSignature); 11408 if (wand->debug != MagickFalse) 11409 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11410 if (wand->images == (Image *) NULL) 11411 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11412 return(TransformImageColorspace(wand->images,colorspace)); 11413} 11414 11415/* 11416%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11417% % 11418% % 11419% % 11420% M a g i c k T r a n s p a r e n t P a i n t I m a g e % 11421% % 11422% % 11423% % 11424%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11425% 11426% MagickTransparentPaintImage() changes any pixel that matches color with the 11427% color defined by fill. 11428% 11429% The format of the MagickTransparentPaintImage method is: 11430% 11431% MagickBooleanType MagickTransparentPaintImage(MagickWand *wand, 11432% const PixelWand *target,const double alpha,const double fuzz, 11433% const MagickBooleanType invert) 11434% 11435% A description of each parameter follows: 11436% 11437% o wand: the magick wand. 11438% 11439% o target: Change this target color to specified opacity value within 11440% the image. 11441% 11442% o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully 11443% transparent. 11444% 11445% o fuzz: By default target must match a particular pixel color 11446% exactly. However, in many cases two colors may differ by a small amount. 11447% The fuzz member of image defines how much tolerance is acceptable to 11448% consider two colors as the same. For example, set fuzz to 10 and the 11449% color red at intensities of 100 and 102 respectively are now interpreted 11450% as the same color for the purposes of the floodfill. 11451% 11452% o invert: paint any pixel that does not match the target color. 11453% 11454*/ 11455WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand, 11456 const PixelWand *target,const double alpha,const double fuzz, 11457 const MagickBooleanType invert) 11458{ 11459 MagickBooleanType 11460 status; 11461 11462 PixelInfo 11463 target_pixel; 11464 11465 assert(wand != (MagickWand *) NULL); 11466 assert(wand->signature == WandSignature); 11467 if (wand->debug != MagickFalse) 11468 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11469 if (wand->images == (Image *) NULL) 11470 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11471 PixelGetMagickColor(target,&target_pixel); 11472 wand->images->fuzz=fuzz; 11473 status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum( 11474 QuantumRange*alpha),invert); 11475 if (status == MagickFalse) 11476 InheritException(wand->exception,&wand->images->exception); 11477 return(status); 11478} 11479 11480/* 11481%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11482% % 11483% % 11484% % 11485% M a g i c k T r a n s p o s e I m a g e % 11486% % 11487% % 11488% % 11489%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11490% 11491% MagickTransposeImage() creates a vertical mirror image by reflecting the 11492% pixels around the central x-axis while rotating them 90-degrees. 11493% 11494% The format of the MagickTransposeImage method is: 11495% 11496% MagickBooleanType MagickTransposeImage(MagickWand *wand) 11497% 11498% A description of each parameter follows: 11499% 11500% o wand: the magick wand. 11501% 11502*/ 11503WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand) 11504{ 11505 Image 11506 *transpose_image; 11507 11508 assert(wand != (MagickWand *) NULL); 11509 assert(wand->signature == WandSignature); 11510 if (wand->debug != MagickFalse) 11511 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11512 if (wand->images == (Image *) NULL) 11513 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11514 transpose_image=TransposeImage(wand->images,wand->exception); 11515 if (transpose_image == (Image *) NULL) 11516 return(MagickFalse); 11517 ReplaceImageInList(&wand->images,transpose_image); 11518 return(MagickTrue); 11519} 11520 11521/* 11522%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11523% % 11524% % 11525% % 11526% M a g i c k T r a n s v e r s e I m a g e % 11527% % 11528% % 11529% % 11530%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11531% 11532% MagickTransverseImage() creates a horizontal mirror image by reflecting the 11533% pixels around the central y-axis while rotating them 270-degrees. 11534% 11535% The format of the MagickTransverseImage method is: 11536% 11537% MagickBooleanType MagickTransverseImage(MagickWand *wand) 11538% 11539% A description of each parameter follows: 11540% 11541% o wand: the magick wand. 11542% 11543*/ 11544WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand) 11545{ 11546 Image 11547 *transverse_image; 11548 11549 assert(wand != (MagickWand *) NULL); 11550 assert(wand->signature == WandSignature); 11551 if (wand->debug != MagickFalse) 11552 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11553 if (wand->images == (Image *) NULL) 11554 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11555 transverse_image=TransverseImage(wand->images,wand->exception); 11556 if (transverse_image == (Image *) NULL) 11557 return(MagickFalse); 11558 ReplaceImageInList(&wand->images,transverse_image); 11559 return(MagickTrue); 11560} 11561 11562/* 11563%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11564% % 11565% % 11566% % 11567% M a g i c k T r i m I m a g e % 11568% % 11569% % 11570% % 11571%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11572% 11573% MagickTrimImage() remove edges that are the background color from the image. 11574% 11575% The format of the MagickTrimImage method is: 11576% 11577% MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz) 11578% 11579% A description of each parameter follows: 11580% 11581% o wand: the magick wand. 11582% 11583% o fuzz: By default target must match a particular pixel color 11584% exactly. However, in many cases two colors may differ by a small amount. 11585% The fuzz member of image defines how much tolerance is acceptable to 11586% consider two colors as the same. For example, set fuzz to 10 and the 11587% color red at intensities of 100 and 102 respectively are now interpreted 11588% as the same color for the purposes of the floodfill. 11589% 11590*/ 11591WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz) 11592{ 11593 Image 11594 *trim_image; 11595 11596 assert(wand != (MagickWand *) NULL); 11597 assert(wand->signature == WandSignature); 11598 if (wand->debug != MagickFalse) 11599 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11600 if (wand->images == (Image *) NULL) 11601 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11602 wand->images->fuzz=fuzz; 11603 trim_image=TrimImage(wand->images,wand->exception); 11604 if (trim_image == (Image *) NULL) 11605 return(MagickFalse); 11606 ReplaceImageInList(&wand->images,trim_image); 11607 return(MagickTrue); 11608} 11609 11610/* 11611%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11612% % 11613% % 11614% % 11615% M a g i c k U n i q u e I m a g e C o l o r s % 11616% % 11617% % 11618% % 11619%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11620% 11621% MagickUniqueImageColors() discards all but one of any pixel color. 11622% 11623% The format of the MagickUniqueImageColors method is: 11624% 11625% MagickBooleanType MagickUniqueImageColors(MagickWand *wand) 11626% 11627% A description of each parameter follows: 11628% 11629% o wand: the magick wand. 11630% 11631*/ 11632WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand) 11633{ 11634 Image 11635 *unique_image; 11636 11637 assert(wand != (MagickWand *) NULL); 11638 assert(wand->signature == WandSignature); 11639 if (wand->debug != MagickFalse) 11640 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11641 if (wand->images == (Image *) NULL) 11642 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11643 unique_image=UniqueImageColors(wand->images,wand->exception); 11644 if (unique_image == (Image *) NULL) 11645 return(MagickFalse); 11646 ReplaceImageInList(&wand->images,unique_image); 11647 return(MagickTrue); 11648} 11649 11650/* 11651%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11652% % 11653% % 11654% % 11655% M a g i c k U n s h a r p M a s k I m a g e % 11656% % 11657% % 11658% % 11659%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11660% 11661% MagickUnsharpMaskImage() sharpens an image. We convolve the image with a 11662% Gaussian operator of the given radius and standard deviation (sigma). 11663% For reasonable results, radius should be larger than sigma. Use a radius 11664% of 0 and UnsharpMaskImage() selects a suitable radius for you. 11665% 11666% The format of the MagickUnsharpMaskImage method is: 11667% 11668% MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand, 11669% const double radius,const double sigma,const double amount, 11670% const double threshold) 11671% 11672% A description of each parameter follows: 11673% 11674% o wand: the magick wand. 11675% 11676% o radius: the radius of the Gaussian, in pixels, not counting the center 11677% pixel. 11678% 11679% o sigma: the standard deviation of the Gaussian, in pixels. 11680% 11681% o amount: the percentage of the difference between the original and the 11682% blur image that is added back into the original. 11683% 11684% o threshold: the threshold in pixels needed to apply the diffence amount. 11685% 11686*/ 11687WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand, 11688 const double radius,const double sigma,const double amount, 11689 const double threshold) 11690{ 11691 Image 11692 *unsharp_image; 11693 11694 assert(wand != (MagickWand *) NULL); 11695 assert(wand->signature == WandSignature); 11696 if (wand->debug != MagickFalse) 11697 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11698 if (wand->images == (Image *) NULL) 11699 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11700 unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,amount,threshold, 11701 wand->exception); 11702 if (unsharp_image == (Image *) NULL) 11703 return(MagickFalse); 11704 ReplaceImageInList(&wand->images,unsharp_image); 11705 return(MagickTrue); 11706} 11707 11708/* 11709%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11710% % 11711% % 11712% % 11713% M a g i c k V i g n e t t e I m a g e % 11714% % 11715% % 11716% % 11717%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11718% 11719% MagickVignetteImage() softens the edges of the image in vignette style. 11720% 11721% The format of the MagickVignetteImage method is: 11722% 11723% MagickBooleanType MagickVignetteImage(MagickWand *wand, 11724% const double black_point,const double white_point,const ssize_t x, 11725% const ssize_t y) 11726% 11727% A description of each parameter follows: 11728% 11729% o wand: the magick wand. 11730% 11731% o black_point: the black point. 11732% 11733% o white_point: the white point. 11734% 11735% o x, y: Define the x and y ellipse offset. 11736% 11737*/ 11738WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand, 11739 const double black_point,const double white_point,const ssize_t x,const ssize_t y) 11740{ 11741 Image 11742 *vignette_image; 11743 11744 assert(wand != (MagickWand *) NULL); 11745 assert(wand->signature == WandSignature); 11746 if (wand->debug != MagickFalse) 11747 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11748 if (wand->images == (Image *) NULL) 11749 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11750 vignette_image=VignetteImage(wand->images,black_point,white_point,x,y, 11751 wand->exception); 11752 if (vignette_image == (Image *) NULL) 11753 return(MagickFalse); 11754 ReplaceImageInList(&wand->images,vignette_image); 11755 return(MagickTrue); 11756} 11757 11758/* 11759%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11760% % 11761% % 11762% % 11763% M a g i c k W a v e I m a g e % 11764% % 11765% % 11766% % 11767%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11768% 11769% MagickWaveImage() creates a "ripple" effect in the image by shifting 11770% the pixels vertically along a sine wave whose amplitude and wavelength 11771% is specified by the given parameters. 11772% 11773% The format of the MagickWaveImage method is: 11774% 11775% MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude, 11776% const double wave_length) 11777% 11778% A description of each parameter follows: 11779% 11780% o wand: the magick wand. 11781% 11782% o amplitude, wave_length: Define the amplitude and wave length of the 11783% sine wave. 11784% 11785*/ 11786WandExport MagickBooleanType MagickWaveImage(MagickWand *wand, 11787 const double amplitude,const double wave_length) 11788{ 11789 Image 11790 *wave_image; 11791 11792 assert(wand != (MagickWand *) NULL); 11793 assert(wand->signature == WandSignature); 11794 if (wand->debug != MagickFalse) 11795 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11796 if (wand->images == (Image *) NULL) 11797 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11798 wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception); 11799 if (wave_image == (Image *) NULL) 11800 return(MagickFalse); 11801 ReplaceImageInList(&wand->images,wave_image); 11802 return(MagickTrue); 11803} 11804 11805/* 11806%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11807% % 11808% % 11809% % 11810% M a g i c k W h i t e T h r e s h o l d I m a g e % 11811% % 11812% % 11813% % 11814%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11815% 11816% MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels 11817% above the threshold into white while leaving all pixels below the threshold 11818% unchanged. 11819% 11820% The format of the MagickWhiteThresholdImage method is: 11821% 11822% MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand, 11823% const PixelWand *threshold) 11824% 11825% A description of each parameter follows: 11826% 11827% o wand: the magick wand. 11828% 11829% o threshold: the pixel wand. 11830% 11831*/ 11832WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand, 11833 const PixelWand *threshold) 11834{ 11835 char 11836 thresholds[MaxTextExtent]; 11837 11838 MagickBooleanType 11839 status; 11840 11841 assert(wand != (MagickWand *) NULL); 11842 assert(wand->signature == WandSignature); 11843 if (wand->debug != MagickFalse) 11844 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11845 if (wand->images == (Image *) NULL) 11846 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11847 (void) FormatLocaleString(thresholds,MaxTextExtent, 11848 QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat, 11849 PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold), 11850 PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold)); 11851 status=WhiteThresholdImage(wand->images,thresholds,&wand->images->exception); 11852 if (status == MagickFalse) 11853 InheritException(wand->exception,&wand->images->exception); 11854 return(status); 11855} 11856 11857/* 11858%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11859% % 11860% % 11861% % 11862% M a g i c k W r i t e I m a g e % 11863% % 11864% % 11865% % 11866%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11867% 11868% MagickWriteImage() writes an image to the specified filename. If the 11869% filename parameter is NULL, the image is written to the filename set 11870% by MagickReadImage() or MagickSetImageFilename(). 11871% 11872% The format of the MagickWriteImage method is: 11873% 11874% MagickBooleanType MagickWriteImage(MagickWand *wand, 11875% const char *filename) 11876% 11877% A description of each parameter follows: 11878% 11879% o wand: the magick wand. 11880% 11881% o filename: the image filename. 11882% 11883% 11884*/ 11885WandExport MagickBooleanType MagickWriteImage(MagickWand *wand, 11886 const char *filename) 11887{ 11888 Image 11889 *image; 11890 11891 ImageInfo 11892 *write_info; 11893 11894 MagickBooleanType 11895 status; 11896 11897 assert(wand != (MagickWand *) NULL); 11898 assert(wand->signature == WandSignature); 11899 if (wand->debug != MagickFalse) 11900 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11901 if (wand->images == (Image *) NULL) 11902 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11903 if (filename != (const char *) NULL) 11904 (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent); 11905 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); 11906 if (image == (Image *) NULL) 11907 return(MagickFalse); 11908 write_info=CloneImageInfo(wand->image_info); 11909 write_info->adjoin=MagickTrue; 11910 status=WriteImage(write_info,image); 11911 if (status == MagickFalse) 11912 InheritException(wand->exception,&image->exception); 11913 image=DestroyImage(image); 11914 write_info=DestroyImageInfo(write_info); 11915 return(status); 11916} 11917 11918/* 11919%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11920% % 11921% % 11922% % 11923% M a g i c k W r i t e I m a g e F i l e % 11924% % 11925% % 11926% % 11927%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11928% 11929% MagickWriteImageFile() writes an image to an open file descriptor. 11930% 11931% The format of the MagickWriteImageFile method is: 11932% 11933% MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file) 11934% 11935% A description of each parameter follows: 11936% 11937% o wand: the magick wand. 11938% 11939% o file: the file descriptor. 11940% 11941*/ 11942WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file) 11943{ 11944 Image 11945 *image; 11946 11947 ImageInfo 11948 *write_info; 11949 11950 MagickBooleanType 11951 status; 11952 11953 assert(wand != (MagickWand *) NULL); 11954 assert(wand->signature == WandSignature); 11955 assert(file != (FILE *) NULL); 11956 if (wand->debug != MagickFalse) 11957 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 11958 if (wand->images == (Image *) NULL) 11959 ThrowWandException(WandError,"ContainsNoImages",wand->name); 11960 image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); 11961 if (image == (Image *) NULL) 11962 return(MagickFalse); 11963 write_info=CloneImageInfo(wand->image_info); 11964 SetImageInfoFile(write_info,file); 11965 write_info->adjoin=MagickTrue; 11966 status=WriteImage(write_info,image); 11967 write_info=DestroyImageInfo(write_info); 11968 if (status == MagickFalse) 11969 InheritException(wand->exception,&image->exception); 11970 image=DestroyImage(image); 11971 return(status); 11972} 11973 11974/* 11975%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11976% % 11977% % 11978% % 11979% M a g i c k W r i t e I m a g e s % 11980% % 11981% % 11982% % 11983%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11984% 11985% MagickWriteImages() writes an image or image sequence. 11986% 11987% The format of the MagickWriteImages method is: 11988% 11989% MagickBooleanType MagickWriteImages(MagickWand *wand, 11990% const char *filename,const MagickBooleanType adjoin) 11991% 11992% A description of each parameter follows: 11993% 11994% o wand: the magick wand. 11995% 11996% o filename: the image filename. 11997% 11998% o adjoin: join images into a single multi-image file. 11999% 12000*/ 12001WandExport MagickBooleanType MagickWriteImages(MagickWand *wand, 12002 const char *filename,const MagickBooleanType adjoin) 12003{ 12004 ImageInfo 12005 *write_info; 12006 12007 MagickBooleanType 12008 status; 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 write_info=CloneImageInfo(wand->image_info); 12017 write_info->adjoin=adjoin; 12018 status=WriteImages(write_info,wand->images,filename,wand->exception); 12019 if (status == MagickFalse) 12020 InheritException(wand->exception,&wand->images->exception); 12021 write_info=DestroyImageInfo(write_info); 12022 return(status); 12023} 12024 12025/* 12026%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12027% % 12028% % 12029% % 12030% M a g i c k W r i t e I m a g e s F i l e % 12031% % 12032% % 12033% % 12034%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12035% 12036% MagickWriteImagesFile() writes an image sequence to an open file descriptor. 12037% 12038% The format of the MagickWriteImagesFile method is: 12039% 12040% MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file) 12041% 12042% A description of each parameter follows: 12043% 12044% o wand: the magick wand. 12045% 12046% o file: the file descriptor. 12047% 12048*/ 12049WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file) 12050{ 12051 ImageInfo 12052 *write_info; 12053 12054 MagickBooleanType 12055 status; 12056 12057 assert(wand != (MagickWand *) NULL); 12058 assert(wand->signature == WandSignature); 12059 if (wand->debug != MagickFalse) 12060 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 12061 if (wand->images == (Image *) NULL) 12062 ThrowWandException(WandError,"ContainsNoImages",wand->name); 12063 write_info=CloneImageInfo(wand->image_info); 12064 SetImageInfoFile(write_info,file); 12065 write_info->adjoin=MagickTrue; 12066 status=WriteImages(write_info,wand->images,(const char *) NULL, 12067 wand->exception); 12068 write_info=DestroyImageInfo(write_info); 12069 if (status == MagickFalse) 12070 InheritException(wand->exception,&wand->images->exception); 12071 return(status); 12072} 12073