MagickWand  6.7.5
magick-image.c
Go to the documentation of this file.
00001 /*
00002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00003 %                                                                             %
00004 %                                                                             %
00005 %                                                                             %
00006 %                 M   M   AAA    GGGG  IIIII   CCCC  K   K                    %
00007 %                 MM MM  A   A  G        I    C      K  K                     %
00008 %                 M M M  AAAAA  G GGG    I    C      KKK                      %
00009 %                 M   M  A   A  G   G    I    C      K  K                     %
00010 %                 M   M  A   A   GGGG  IIIII   CCCC  K   K                    %
00011 %                                                                             %
00012 %                     IIIII  M   M   AAA    GGGG  EEEEE                       %
00013 %                       I    MM MM  A   A  G      E                           %
00014 %                       I    M M M  AAAAA  G  GG  EEE                         %
00015 %                       I    M   M  A   A  G   G  E                           %
00016 %                     IIIII  M   M  A   A   GGGG  EEEEE                       %
00017 %                                                                             %
00018 %                                                                             %
00019 %                          MagickWand Image Methods                           %
00020 %                                                                             %
00021 %                               Software Design                               %
00022 %                                 John Cristy                                 %
00023 %                                 August 2003                                 %
00024 %                                                                             %
00025 %                                                                             %
00026 %  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
00027 %  dedicated to making software imaging solutions freely available.           %
00028 %                                                                             %
00029 %  You may not use this file except in compliance with the License.  You may  %
00030 %  obtain a copy of the License at                                            %
00031 %                                                                             %
00032 %    http://www.imagemagick.org/script/license.php                            %
00033 %                                                                             %
00034 %  Unless required by applicable law or agreed to in writing, software        %
00035 %  distributed under the License is distributed on an "AS IS" BASIS,          %
00036 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
00037 %  See the License for the specific language governing permissions and        %
00038 %  limitations under the License.                                             %
00039 %                                                                             %
00040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00041 %
00042 %
00043 %
00044 */
00045 
00046 /*
00047   Include declarations.
00048 */
00049 #include "MagickWand/studio.h"
00050 #include "MagickWand/MagickWand.h"
00051 #include "MagickWand/magick-wand-private.h"
00052 #include "MagickWand/wand.h"
00053 #include "MagickWand/pixel-wand-private.h"
00054 
00055 /*
00056   Define declarations.
00057 */
00058 #define ThrowWandException(severity,tag,context) \
00059 { \
00060   (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
00061     tag,"`%s'",context); \
00062   return(MagickFalse); \
00063 }
00064 #define MagickWandId  "MagickWand"
00065 
00066 /*
00067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00068 %                                                                             %
00069 %                                                                             %
00070 %                                                                             %
00071 +   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                         %
00072 %                                                                             %
00073 %                                                                             %
00074 %                                                                             %
00075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00076 %
00077 %  CloneMagickWandFromImages() clones the magick wand and inserts a new image
00078 %  list.
00079 %
00080 %  The format of the CloneMagickWandFromImages method is:
00081 %
00082 %      MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
00083 %        Image *images)
00084 %
00085 %  A description of each parameter follows:
00086 %
00087 %    o wand: the magick wand.
00088 %
00089 %    o images: replace the image list with these image(s).
00090 %
00091 */
00092 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
00093   Image *images)
00094 {
00095   MagickWand
00096     *clone_wand;
00097 
00098   assert(wand != (MagickWand *) NULL);
00099   assert(wand->signature == WandSignature);
00100   if (wand->debug != MagickFalse)
00101     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00102   clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
00103   if (clone_wand == (MagickWand *) NULL)
00104     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
00105       images->filename);
00106   (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
00107   clone_wand->id=AcquireWandId();
00108   (void) FormatLocaleString(clone_wand->name,MaxTextExtent,"%s-%.20g",
00109     MagickWandId,(double) clone_wand->id);
00110   clone_wand->exception=AcquireExceptionInfo();
00111   InheritException(clone_wand->exception,wand->exception);
00112   clone_wand->image_info=CloneImageInfo(wand->image_info);
00113   clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
00114   clone_wand->images=images;
00115   clone_wand->debug=IsEventLogging();
00116   if (clone_wand->debug != MagickFalse)
00117     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
00118   clone_wand->signature=WandSignature;
00119   return(clone_wand);
00120 }
00121 
00122 /*
00123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00124 %                                                                             %
00125 %                                                                             %
00126 %                                                                             %
00127 %   G e t I m a g e F r o m M a g i c k W a n d                               %
00128 %                                                                             %
00129 %                                                                             %
00130 %                                                                             %
00131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00132 %
00133 %  GetImageFromMagickWand() returns the current image from the magick wand.
00134 %
00135 %  The format of the GetImageFromMagickWand method is:
00136 %
00137 %      Image *GetImageFromMagickWand(const MagickWand *wand)
00138 %
00139 %  A description of each parameter follows:
00140 %
00141 %    o wand: the magick wand.
00142 %
00143 */
00144 WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
00145 {
00146   assert(wand != (MagickWand *) NULL);
00147   assert(wand->signature == WandSignature);
00148   if (wand->debug != MagickFalse)
00149     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00150   if (wand->images == (Image *) NULL)
00151     {
00152       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00153         "ContainsNoImages","`%s'",wand->name);
00154       return((Image *) NULL);
00155     }
00156   return(wand->images);
00157 }
00158 
00159 /*
00160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00161 %                                                                             %
00162 %                                                                             %
00163 %                                                                             %
00164 %   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                       %
00165 %                                                                             %
00166 %                                                                             %
00167 %                                                                             %
00168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00169 %
00170 %  MagickAdaptiveBlurImage() adaptively blurs the image by blurring
00171 %  less intensely near image edges and more intensely far from edges. We
00172 %  blur the image with a Gaussian operator of the given radius and standard
00173 %  deviation (sigma).  For reasonable results, radius should be larger than
00174 %  sigma.  Use a radius of 0 and MagickAdaptiveBlurImage() selects a
00175 %  suitable radius for you.
00176 %
00177 %  The format of the MagickAdaptiveBlurImage method is:
00178 %
00179 %      MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
00180 %        const double radius,const double sigma,const double bias)
00181 %
00182 %  A description of each parameter follows:
00183 %
00184 %    o wand: the magick wand.
00185 %
00186 %    o radius: the radius of the Gaussian, in pixels, not counting the center
00187 %      pixel.
00188 %
00189 %    o sigma: the standard deviation of the Gaussian, in pixels.
00190 %
00191 %    o bias: the bias.
00192 %
00193 */
00194 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
00195   const double radius,const double sigma,const double bias)
00196 {
00197   Image
00198     *sharp_image;
00199 
00200   assert(wand != (MagickWand *) NULL);
00201   assert(wand->signature == WandSignature);
00202   if (wand->debug != MagickFalse)
00203     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00204   if (wand->images == (Image *) NULL)
00205     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00206   sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,bias,wand->exception);
00207   if (sharp_image == (Image *) NULL)
00208     return(MagickFalse);
00209   ReplaceImageInList(&wand->images,sharp_image);
00210   return(MagickTrue);
00211 }
00212 
00213 /*
00214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00215 %                                                                             %
00216 %                                                                             %
00217 %                                                                             %
00218 %   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                         %
00219 %                                                                             %
00220 %                                                                             %
00221 %                                                                             %
00222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00223 %
00224 %  MagickAdaptiveResizeImage() adaptively resize image with data dependent
00225 %  triangulation.
00226 %
00227 %      MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
00228 %        const size_t columns,const size_t rows)
00229 %
00230 %  A description of each parameter follows:
00231 %
00232 %    o wand: the magick wand.
00233 %
00234 %    o columns: the number of columns in the scaled image.
00235 %
00236 %    o rows: the number of rows in the scaled image.
00237 %
00238 */
00239 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
00240   const size_t columns,const size_t rows)
00241 {
00242   Image
00243     *resize_image;
00244 
00245   assert(wand != (MagickWand *) NULL);
00246   assert(wand->signature == WandSignature);
00247   if (wand->debug != MagickFalse)
00248     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00249   if (wand->images == (Image *) NULL)
00250     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00251   resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
00252   if (resize_image == (Image *) NULL)
00253     return(MagickFalse);
00254   ReplaceImageInList(&wand->images,resize_image);
00255   return(MagickTrue);
00256 }
00257 
00258 /*
00259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00260 %                                                                             %
00261 %                                                                             %
00262 %                                                                             %
00263 %   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                       %
00264 %                                                                             %
00265 %                                                                             %
00266 %                                                                             %
00267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00268 %
00269 %  MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening
00270 %  more intensely near image edges and less intensely far from edges. We
00271 %  sharpen the image with a Gaussian operator of the given radius and standard
00272 %  deviation (sigma).  For reasonable results, radius should be larger than
00273 %  sigma.  Use a radius of 0 and MagickAdaptiveSharpenImage() selects a
00274 %  suitable radius for you.
00275 %
00276 %  The format of the MagickAdaptiveSharpenImage method is:
00277 %
00278 %      MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
00279 %        const double radius,const double sigma,const double bias)
00280 %
00281 %  A description of each parameter follows:
00282 %
00283 %    o wand: the magick wand.
00284 %
00285 %    o radius: the radius of the Gaussian, in pixels, not counting the center
00286 %      pixel.
00287 %
00288 %    o sigma: the standard deviation of the Gaussian, in pixels.
00289 %
00290 %    o bias: the bias.
00291 %
00292 */
00293 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
00294   const double radius,const double sigma,const double bias)
00295 {
00296   Image
00297     *sharp_image;
00298 
00299   assert(wand != (MagickWand *) NULL);
00300   assert(wand->signature == WandSignature);
00301   if (wand->debug != MagickFalse)
00302     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00303   if (wand->images == (Image *) NULL)
00304     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00305   sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,bias,
00306     wand->exception);
00307   if (sharp_image == (Image *) NULL)
00308     return(MagickFalse);
00309   ReplaceImageInList(&wand->images,sharp_image);
00310   return(MagickTrue);
00311 }
00312 
00313 /*
00314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00315 %                                                                             %
00316 %                                                                             %
00317 %                                                                             %
00318 %   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                   %
00319 %                                                                             %
00320 %                                                                             %
00321 %                                                                             %
00322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00323 %
00324 %  MagickAdaptiveThresholdImage() selects an individual threshold for each pixel
00325 %  based on the range of intensity values in its local neighborhood.  This
00326 %  allows for thresholding of an image whose global intensity histogram
00327 %  doesn't contain distinctive peaks.
00328 %
00329 %  The format of the AdaptiveThresholdImage method is:
00330 %
00331 %      MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
00332 %        const size_t width,const size_t height,const double bias)
00333 %
00334 %  A description of each parameter follows:
00335 %
00336 %    o wand: the magick wand.
00337 %
00338 %    o width: the width of the local neighborhood.
00339 %
00340 %    o height: the height of the local neighborhood.
00341 %
00342 %    o offset: the mean bias.
00343 %
00344 */
00345 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
00346   const size_t width,const size_t height,const double bias)
00347 {
00348   Image
00349     *threshold_image;
00350 
00351   assert(wand != (MagickWand *) NULL);
00352   assert(wand->signature == WandSignature);
00353   if (wand->debug != MagickFalse)
00354     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00355   if (wand->images == (Image *) NULL)
00356     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00357   threshold_image=AdaptiveThresholdImage(wand->images,width,height,bias,
00358     wand->exception);
00359   if (threshold_image == (Image *) NULL)
00360     return(MagickFalse);
00361   ReplaceImageInList(&wand->images,threshold_image);
00362   return(MagickTrue);
00363 }
00364 
00365 /*
00366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00367 %                                                                             %
00368 %                                                                             %
00369 %                                                                             %
00370 %   M a g i c k A d d I m a g e                                               %
00371 %                                                                             %
00372 %                                                                             %
00373 %                                                                             %
00374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00375 %
00376 %  MagickAddImage() adds a clone of the images in the second wand and
00377 %  inserts them into the first wand, at the current image location.
00378 %
00379 %  Use MagickSetFirstIterator(), to insert new images before all the current
00380 %  images in the wand, otherwise image is placed after the current image.
00381 %
00382 %  The format of the MagickAddImage method is:
00383 %
00384 %      MagickBooleanType MagickAddImage(MagickWand *wand,
00385 %        const MagickWand *add_wand)
00386 %
00387 %  A description of each parameter follows:
00388 %
00389 %    o wand: the magick wand.
00390 %
00391 %    o add_wand: A wand that contains images to add at the current image
00392 %      location.
00393 %
00394 */
00395 
00396 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
00397   Image *images)
00398 {
00399   Image
00400     *current;
00401 
00402   current=wand->images;  /* note the current image */
00403 
00404   /* if no images in wand, just add them and set first image as current */
00405   if (current == (Image *) NULL)
00406     {
00407       wand->images=GetFirstImageInList(images);
00408       return(MagickTrue);
00409     }
00410 
00411   /* user jumped to first image, so prepend new images - remain active */
00412   if ((wand->set_first != MagickFalse) &&
00413        (current->previous == (Image *) NULL) )
00414     {
00415       PrependImageToList(&current,images);
00416       wand->images=GetFirstImageInList(images);
00417       return(MagickTrue);
00418     }
00419   wand->set_first = MagickFalse; /* flag no longer valid */
00420 
00421   /* Current image was flagged as 'pending' iterative processing. */
00422   if (wand->image_pending != MagickFalse)
00423     {
00424       /* current pending image is the last, append new images */
00425       if (current->next == (Image *) NULL)
00426         {
00427           AppendImageToList(&current,images);
00428           wand->images=GetLastImageInList(images);
00429           return(MagickTrue);
00430         }
00431       /* current pending image is the first image, prepend it */
00432       if (current->previous == (Image *) NULL)
00433         {
00434           PrependImageToList(&current,images);
00435           wand->images=GetFirstImageInList(images);
00436           return(MagickTrue);
00437         }
00438     }
00439 
00440   /* if at last image append new images */
00441   if (current->next == (Image *) NULL)
00442     {
00443       InsertImageInList(&current,images);
00444       wand->images=GetLastImageInList(images);
00445       return(MagickTrue);
00446     }
00447   /* otherwise just insert image, just after the current image */
00448   InsertImageInList(&current,images);
00449   wand->images=GetFirstImageInList(images);
00450   return(MagickTrue);
00451 }
00452 
00453 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
00454   const MagickWand *add_wand)
00455 {
00456   Image
00457     *images;
00458 
00459   assert(wand != (MagickWand *) NULL);
00460   assert(wand->signature == WandSignature);
00461   if (wand->debug != MagickFalse)
00462     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00463   assert(add_wand != (MagickWand *) NULL);
00464   assert(add_wand->signature == WandSignature);
00465   if (add_wand->images == (Image *) NULL)
00466     ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
00467 
00468   /* clone images in second wand, and insert into first */
00469   images=CloneImageList(add_wand->images,wand->exception);
00470   if (images == (Image *) NULL)
00471     return(MagickFalse);
00472   return(InsertImageInWand(wand,images));
00473 }
00474 
00475 /*
00476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00477 %                                                                             %
00478 %                                                                             %
00479 %                                                                             %
00480 %     M a g i c k A d d N o i s e I m a g e                                   %
00481 %                                                                             %
00482 %                                                                             %
00483 %                                                                             %
00484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00485 %
00486 %  MagickAddNoiseImage() adds random noise to the image.
00487 %
00488 %  The format of the MagickAddNoiseImage method is:
00489 %
00490 %      MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
00491 %        const NoiseType noise_type,const double attenuate)
00492 %
00493 %  A description of each parameter follows:
00494 %
00495 %    o wand: the magick wand.
00496 %
00497 %    o noise_type:  The type of noise: Uniform, Gaussian, Multiplicative,
00498 %      Impulse, Laplacian, or Poisson.
00499 %
00500 %    o attenuate:  attenuate the random distribution.
00501 %
00502 */
00503 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
00504   const NoiseType noise_type,const double attenuate)
00505 {
00506   Image
00507     *noise_image;
00508 
00509   assert(wand != (MagickWand *) NULL);
00510   assert(wand->signature == WandSignature);
00511   if (wand->debug != MagickFalse)
00512     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00513   if (wand->images == (Image *) NULL)
00514     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00515   noise_image=AddNoiseImage(wand->images,noise_type,attenuate,wand->exception);
00516   if (noise_image == (Image *) NULL)
00517     return(MagickFalse);
00518   ReplaceImageInList(&wand->images,noise_image);
00519   return(MagickTrue);
00520 }
00521 
00522 /*
00523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00524 %                                                                             %
00525 %                                                                             %
00526 %                                                                             %
00527 %   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                       %
00528 %                                                                             %
00529 %                                                                             %
00530 %                                                                             %
00531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00532 %
00533 %  MagickAffineTransformImage() transforms an image as dictated by the affine
00534 %  matrix of the drawing wand.
00535 %
00536 %  The format of the MagickAffineTransformImage method is:
00537 %
00538 %      MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
00539 %        const DrawingWand *drawing_wand)
00540 %
00541 %  A description of each parameter follows:
00542 %
00543 %    o wand: the magick wand.
00544 %
00545 %    o drawing_wand: the draw wand.
00546 %
00547 */
00548 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
00549   const DrawingWand *drawing_wand)
00550 {
00551   DrawInfo
00552     *draw_info;
00553 
00554   Image
00555     *affine_image;
00556 
00557   assert(wand != (MagickWand *) NULL);
00558   assert(wand->signature == WandSignature);
00559   if (wand->debug != MagickFalse)
00560     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00561   if (wand->images == (Image *) NULL)
00562     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00563   draw_info=PeekDrawingWand(drawing_wand);
00564   if (draw_info == (DrawInfo *) NULL)
00565     return(MagickFalse);
00566   affine_image=AffineTransformImage(wand->images,&draw_info->affine,
00567     wand->exception);
00568   draw_info=DestroyDrawInfo(draw_info);
00569   if (affine_image == (Image *) NULL)
00570     return(MagickFalse);
00571   ReplaceImageInList(&wand->images,affine_image);
00572   return(MagickTrue);
00573 }
00574 
00575 /*
00576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00577 %                                                                             %
00578 %                                                                             %
00579 %                                                                             %
00580 %   M a g i c k A n n o t a t e I m a g e                                     %
00581 %                                                                             %
00582 %                                                                             %
00583 %                                                                             %
00584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00585 %
00586 %  MagickAnnotateImage() annotates an image with text.
00587 %
00588 %  The format of the MagickAnnotateImage method is:
00589 %
00590 %      MagickBooleanType MagickAnnotateImage(MagickWand *wand,
00591 %        const DrawingWand *drawing_wand,const double x,const double y,
00592 %        const double angle,const char *text)
00593 %
00594 %  A description of each parameter follows:
00595 %
00596 %    o wand: the magick wand.
00597 %
00598 %    o drawing_wand: the draw wand.
00599 %
00600 %    o x: x ordinate to left of text
00601 %
00602 %    o y: y ordinate to text baseline
00603 %
00604 %    o angle: rotate text relative to this angle.
00605 %
00606 %    o text: text to draw
00607 %
00608 */
00609 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
00610   const DrawingWand *drawing_wand,const double x,const double y,
00611   const double angle,const char *text)
00612 {
00613   char
00614     geometry[MaxTextExtent];
00615 
00616   DrawInfo
00617     *draw_info;
00618 
00619   MagickBooleanType
00620     status;
00621 
00622   assert(wand != (MagickWand *) NULL);
00623   assert(wand->signature == WandSignature);
00624   if (wand->debug != MagickFalse)
00625     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00626   if (wand->images == (Image *) NULL)
00627     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00628   draw_info=PeekDrawingWand(drawing_wand);
00629   if (draw_info == (DrawInfo *) NULL)
00630     return(MagickFalse);
00631   (void) CloneString(&draw_info->text,text);
00632   (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",x,y);
00633   draw_info->affine.sx=cos((double) DegreesToRadians(fmod(angle,360.0)));
00634   draw_info->affine.rx=sin((double) DegreesToRadians(fmod(angle,360.0)));
00635   draw_info->affine.ry=(-sin((double) DegreesToRadians(fmod(angle,360.0))));
00636   draw_info->affine.sy=cos((double) DegreesToRadians(fmod(angle,360.0)));
00637   (void) CloneString(&draw_info->geometry,geometry);
00638   status=AnnotateImage(wand->images,draw_info,wand->exception);
00639   draw_info=DestroyDrawInfo(draw_info);
00640   return(status);
00641 }
00642 
00643 /*
00644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00645 %                                                                             %
00646 %                                                                             %
00647 %                                                                             %
00648 %   M a g i c k A n i m a t e I m a g e s                                     %
00649 %                                                                             %
00650 %                                                                             %
00651 %                                                                             %
00652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00653 %
00654 %  MagickAnimateImages() animates an image or image sequence.
00655 %
00656 %  The format of the MagickAnimateImages method is:
00657 %
00658 %      MagickBooleanType MagickAnimateImages(MagickWand *wand,
00659 %        const char *server_name)
00660 %
00661 %  A description of each parameter follows:
00662 %
00663 %    o wand: the magick wand.
00664 %
00665 %    o server_name: the X server name.
00666 %
00667 */
00668 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
00669   const char *server_name)
00670 {
00671   MagickBooleanType
00672     status;
00673 
00674   assert(wand != (MagickWand *) NULL);
00675   assert(wand->signature == WandSignature);
00676   if (wand->debug != MagickFalse)
00677     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00678   (void) CloneString(&wand->image_info->server_name,server_name);
00679   status=AnimateImages(wand->image_info,wand->images,wand->exception);
00680   return(status);
00681 }
00682 
00683 /*
00684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00685 %                                                                             %
00686 %                                                                             %
00687 %                                                                             %
00688 %   M a g i c k A p p e n d I m a g e s                                       %
00689 %                                                                             %
00690 %                                                                             %
00691 %                                                                             %
00692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00693 %
00694 %  MagickAppendImages() append a set of images.
00695 %
00696 %  The format of the MagickAppendImages method is:
00697 %
00698 %      MagickWand *MagickAppendImages(MagickWand *wand,
00699 %        const MagickBooleanType stack)
00700 %
00701 %  A description of each parameter follows:
00702 %
00703 %    o wand: the magick wand.
00704 %
00705 %    o stack: By default, images are stacked left-to-right. Set stack to
00706 %      MagickTrue to stack them top-to-bottom.
00707 %
00708 */
00709 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
00710   const MagickBooleanType stack)
00711 {
00712   Image
00713     *append_image;
00714 
00715   assert(wand != (MagickWand *) NULL);
00716   assert(wand->signature == WandSignature);
00717   if (wand->debug != MagickFalse)
00718     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00719   if (wand->images == (Image *) NULL)
00720     return((MagickWand *) NULL);
00721   append_image=AppendImages(wand->images,stack,wand->exception);
00722   if (append_image == (Image *) NULL)
00723     return((MagickWand *) NULL);
00724   return(CloneMagickWandFromImages(wand,append_image));
00725 }
00726 
00727 /*
00728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00729 %                                                                             %
00730 %                                                                             %
00731 %                                                                             %
00732 %   M a g i c k A u t o G a m m a I m a g e                                   %
00733 %                                                                             %
00734 %                                                                             %
00735 %                                                                             %
00736 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00737 %
00738 %  MagickAutoGammaImage() extracts the 'mean' from the image and adjust the
00739 %  image to try make set its gamma appropriatally.
00740 %
00741 %  The format of the MagickAutoGammaImage method is:
00742 %
00743 %      MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
00744 %
00745 %  A description of each parameter follows:
00746 %
00747 %    o wand: the magick wand.
00748 %
00749 */
00750 WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand)
00751 {
00752   MagickBooleanType
00753     status;
00754 
00755   assert(wand != (MagickWand *) NULL);
00756   assert(wand->signature == WandSignature);
00757   if (wand->debug != MagickFalse)
00758     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00759   if (wand->images == (Image *) NULL)
00760     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00761   status=AutoGammaImage(wand->images,wand->exception);
00762   return(status);
00763 }
00764 
00765 /*
00766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00767 %                                                                             %
00768 %                                                                             %
00769 %                                                                             %
00770 %   M a g i c k A u t o L e v e l I m a g e                                   %
00771 %                                                                             %
00772 %                                                                             %
00773 %                                                                             %
00774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00775 %
00776 %  MagickAutoLevelImage() adjusts the levels of a particular image channel by
00777 %  scaling the minimum and maximum values to the full quantum range.
00778 %
00779 %  The format of the MagickAutoLevelImage method is:
00780 %
00781 %      MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
00782 %
00783 %  A description of each parameter follows:
00784 %
00785 %    o wand: the magick wand.
00786 %
00787 */
00788 WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand)
00789 {
00790   MagickBooleanType
00791     status;
00792 
00793   assert(wand != (MagickWand *) NULL);
00794   assert(wand->signature == WandSignature);
00795   if (wand->debug != MagickFalse)
00796     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00797   if (wand->images == (Image *) NULL)
00798     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00799   status=AutoLevelImage(wand->images,wand->exception);
00800   return(status);
00801 }
00802 
00803 /*
00804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00805 %                                                                             %
00806 %                                                                             %
00807 %                                                                             %
00808 %   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                         %
00809 %                                                                             %
00810 %                                                                             %
00811 %                                                                             %
00812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00813 %
00814 %  MagickBlackThresholdImage() is like MagickThresholdImage() but  forces all
00815 %  pixels below the threshold into black while leaving all pixels above the
00816 %  threshold unchanged.
00817 %
00818 %  The format of the MagickBlackThresholdImage method is:
00819 %
00820 %      MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
00821 %        const PixelWand *threshold)
00822 %
00823 %  A description of each parameter follows:
00824 %
00825 %    o wand: the magick wand.
00826 %
00827 %    o threshold: the pixel wand.
00828 %
00829 */
00830 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
00831   const PixelWand *threshold)
00832 {
00833   char
00834     thresholds[MaxTextExtent];
00835 
00836   MagickBooleanType
00837     status;
00838 
00839   assert(wand != (MagickWand *) NULL);
00840   assert(wand->signature == WandSignature);
00841   if (wand->debug != MagickFalse)
00842     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00843   if (wand->images == (Image *) NULL)
00844     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00845   (void) FormatLocaleString(thresholds,MaxTextExtent,
00846     QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
00847     PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
00848     PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold));
00849   status=BlackThresholdImage(wand->images,thresholds,wand->exception);
00850   return(status);
00851 }
00852 
00853 /*
00854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00855 %                                                                             %
00856 %                                                                             %
00857 %                                                                             %
00858 %   M a g i c k B l u e S h i f t I m a g e                                   %
00859 %                                                                             %
00860 %                                                                             %
00861 %                                                                             %
00862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00863 %
00864 %  MagickBlueShiftImage() mutes the colors of the image to simulate a scene at
00865 %  nighttime in the moonlight.
00866 %
00867 %  The format of the MagickBlueShiftImage method is:
00868 %
00869 %      MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
00870 %        const double factor)
00871 %
00872 %  A description of each parameter follows:
00873 %
00874 %    o wand: the magick wand.
00875 %
00876 %    o factor: the blue shift factor (default 1.5)
00877 %
00878 */
00879 WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand,
00880   const double factor)
00881 {
00882   Image
00883     *shift_image;
00884 
00885   assert(wand != (MagickWand *) NULL);
00886   assert(wand->signature == WandSignature);
00887   if (wand->debug != MagickFalse)
00888     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00889   if (wand->images == (Image *) NULL)
00890     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00891   shift_image=BlueShiftImage(wand->images,factor,wand->exception);
00892   if (shift_image == (Image *) NULL)
00893     return(MagickFalse);
00894   ReplaceImageInList(&wand->images,shift_image);
00895   return(MagickTrue);
00896 }
00897 
00898 /*
00899 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00900 %                                                                             %
00901 %                                                                             %
00902 %                                                                             %
00903 %   M a g i c k B l u r I m a g e                                             %
00904 %                                                                             %
00905 %                                                                             %
00906 %                                                                             %
00907 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00908 %
00909 %  MagickBlurImage() blurs an image.  We convolve the image with a
00910 %  gaussian operator of the given radius and standard deviation (sigma).
00911 %  For reasonable results, the radius should be larger than sigma.  Use a
00912 %  radius of 0 and BlurImage() selects a suitable radius for you.
00913 %
00914 %  The format of the MagickBlurImage method is:
00915 %
00916 %      MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
00917 %        const double sigmaconst double bias)
00918 %
00919 %  A description of each parameter follows:
00920 %
00921 %    o wand: the magick wand.
00922 %
00923 %    o radius: the radius of the , in pixels, not counting the center
00924 %      pixel.
00925 %
00926 %    o sigma: the standard deviation of the , in pixels.
00927 %
00928 %    o bias: the bias.
00929 %
00930 */
00931 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
00932   const double radius,const double sigma,const double bias)
00933 {
00934   Image
00935     *blur_image;
00936 
00937   assert(wand != (MagickWand *) NULL);
00938   assert(wand->signature == WandSignature);
00939   if (wand->debug != MagickFalse)
00940     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00941   if (wand->images == (Image *) NULL)
00942     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00943   blur_image=BlurImage(wand->images,radius,sigma,bias,wand->exception);
00944   if (blur_image == (Image *) NULL)
00945     return(MagickFalse);
00946   ReplaceImageInList(&wand->images,blur_image);
00947   return(MagickTrue);
00948 }
00949 
00950 /*
00951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00952 %                                                                             %
00953 %                                                                             %
00954 %                                                                             %
00955 %   M a g i c k B o r d e r I m a g e                                         %
00956 %                                                                             %
00957 %                                                                             %
00958 %                                                                             %
00959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00960 %
00961 %  MagickBorderImage() surrounds the image with a border of the color defined
00962 %  by the bordercolor pixel wand.
00963 %
00964 %  The format of the MagickBorderImage method is:
00965 %
00966 %      MagickBooleanType MagickBorderImage(MagickWand *wand,
00967 %        const PixelWand *bordercolor,const size_t width,
00968 %        const size_t height,const CompositeOperator compose)
00969 %
00970 %  A description of each parameter follows:
00971 %
00972 %    o wand: the magick wand.
00973 %
00974 %    o bordercolor: the border color pixel wand.
00975 %
00976 %    o width: the border width.
00977 %
00978 %    o height: the border height.
00979 %
00980 %    o compose: the composite operator.
00981 %
00982 */
00983 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
00984   const PixelWand *bordercolor,const size_t width,const size_t height,
00985   const CompositeOperator compose)
00986 {
00987   Image
00988     *border_image;
00989 
00990   RectangleInfo
00991     border_info;
00992 
00993   assert(wand != (MagickWand *) NULL);
00994   assert(wand->signature == WandSignature);
00995   if (wand->debug != MagickFalse)
00996     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00997   if (wand->images == (Image *) NULL)
00998     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00999   border_info.width=width;
01000   border_info.height=height;
01001   border_info.x=0;
01002   border_info.y=0;
01003   PixelGetQuantumPacket(bordercolor,&wand->images->border_color);
01004   border_image=BorderImage(wand->images,&border_info,compose,wand->exception);
01005   if (border_image == (Image *) NULL)
01006     return(MagickFalse);
01007   ReplaceImageInList(&wand->images,border_image);
01008   return(MagickTrue);
01009 }
01010 
01011 /*
01012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01013 %                                                                             %
01014 %                                                                             %
01015 %                                                                             %
01016 %   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   %
01017 %                                                                             %
01018 %                                                                             %
01019 %                                                                             %
01020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01021 %
01022 %  Use MagickBrightnessContrastImage() to change the brightness and/or contrast
01023 %  of an image.  It converts the brightness and contrast parameters into slope
01024 %  and intercept and calls a polynomical function to apply to the image.
01025 
01026 %
01027 %  The format of the MagickBrightnessContrastImage method is:
01028 %
01029 %      MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
01030 %        const double brightness,const double contrast)
01031 %
01032 %  A description of each parameter follows:
01033 %
01034 %    o wand: the magick wand.
01035 %
01036 %    o brightness: the brightness percent (-100 .. 100).
01037 %
01038 %    o contrast: the contrast percent (-100 .. 100).
01039 %
01040 */
01041 WandExport MagickBooleanType MagickBrightnessContrastImage(
01042   MagickWand *wand,const double brightness,const double contrast)
01043 {
01044   MagickBooleanType
01045     status;
01046 
01047   assert(wand != (MagickWand *) NULL);
01048   assert(wand->signature == WandSignature);
01049   if (wand->debug != MagickFalse)
01050     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01051   if (wand->images == (Image *) NULL)
01052     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01053   status=BrightnessContrastImage(wand->images,brightness,contrast,
01054     wand->exception);
01055   return(status);
01056 }
01057 
01058 /*
01059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01060 %                                                                             %
01061 %                                                                             %
01062 %                                                                             %
01063 %   M a g i c k C h a r c o a l I m a g e                                     %
01064 %                                                                             %
01065 %                                                                             %
01066 %                                                                             %
01067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01068 %
01069 %  MagickCharcoalImage() simulates a charcoal drawing.
01070 %
01071 %  The format of the MagickCharcoalImage method is:
01072 %
01073 %      MagickBooleanType MagickCharcoalImage(MagickWand *wand,
01074 %        const double radius,const double sigma,const double bias)
01075 %
01076 %  A description of each parameter follows:
01077 %
01078 %    o wand: the magick wand.
01079 %
01080 %    o radius: the radius of the Gaussian, in pixels, not counting the center
01081 %      pixel.
01082 %
01083 %    o sigma: the standard deviation of the Gaussian, in pixels.
01084 %
01085 %    o bias: the bias.
01086 %
01087 */
01088 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
01089   const double radius,const double sigma,const double bias)
01090 {
01091   Image
01092     *charcoal_image;
01093 
01094   assert(wand != (MagickWand *) NULL);
01095   assert(wand->signature == WandSignature);
01096   if (wand->debug != MagickFalse)
01097     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01098   if (wand->images == (Image *) NULL)
01099     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01100   charcoal_image=CharcoalImage(wand->images,radius,sigma,bias,wand->exception);
01101   if (charcoal_image == (Image *) NULL)
01102     return(MagickFalse);
01103   ReplaceImageInList(&wand->images,charcoal_image);
01104   return(MagickTrue);
01105 }
01106 
01107 /*
01108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01109 %                                                                             %
01110 %                                                                             %
01111 %                                                                             %
01112 %   M a g i c k C h o p I m a g e                                             %
01113 %                                                                             %
01114 %                                                                             %
01115 %                                                                             %
01116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01117 %
01118 %  MagickChopImage() removes a region of an image and collapses the image to
01119 %  occupy the removed portion
01120 %
01121 %  The format of the MagickChopImage method is:
01122 %
01123 %      MagickBooleanType MagickChopImage(MagickWand *wand,
01124 %        const size_t width,const size_t height,const ssize_t x,
01125 %        const ssize_t y)
01126 %
01127 %  A description of each parameter follows:
01128 %
01129 %    o wand: the magick wand.
01130 %
01131 %    o width: the region width.
01132 %
01133 %    o height: the region height.
01134 %
01135 %    o x: the region x offset.
01136 %
01137 %    o y: the region y offset.
01138 %
01139 %
01140 */
01141 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
01142   const size_t width,const size_t height,const ssize_t x,
01143   const ssize_t y)
01144 {
01145   Image
01146     *chop_image;
01147 
01148   RectangleInfo
01149     chop;
01150 
01151   assert(wand != (MagickWand *) NULL);
01152   assert(wand->signature == WandSignature);
01153   if (wand->debug != MagickFalse)
01154     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01155   if (wand->images == (Image *) NULL)
01156     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01157   chop.width=width;
01158   chop.height=height;
01159   chop.x=x;
01160   chop.y=y;
01161   chop_image=ChopImage(wand->images,&chop,wand->exception);
01162   if (chop_image == (Image *) NULL)
01163     return(MagickFalse);
01164   ReplaceImageInList(&wand->images,chop_image);
01165   return(MagickTrue);
01166 }
01167 
01168 /*
01169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01170 %                                                                             %
01171 %                                                                             %
01172 %                                                                             %
01173 %   M a g i c k C l a m p I m a g e                                           %
01174 %                                                                             %
01175 %                                                                             %
01176 %                                                                             %
01177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01178 %
01179 %  MagickClampImage() restricts the color range from 0 to the quantum depth.
01180 %
01181 %  The format of the MagickClampImage method is:
01182 %
01183 %      MagickBooleanType MagickClampImage(MagickWand *wand)
01184 %
01185 %  A description of each parameter follows:
01186 %
01187 %    o wand: the magick wand.
01188 %
01189 %    o channel: the channel.
01190 %
01191 */
01192 WandExport MagickBooleanType MagickClampImage(MagickWand *wand)
01193 {
01194   assert(wand != (MagickWand *) NULL);
01195   assert(wand->signature == WandSignature);
01196   if (wand->debug != MagickFalse)
01197     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01198   if (wand->images == (Image *) NULL)
01199     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01200   return(ClampImage(wand->images,wand->exception));
01201 }
01202 
01203 /*
01204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01205 %                                                                             %
01206 %                                                                             %
01207 %                                                                             %
01208 %   M a g i c k C l i p I m a g e                                             %
01209 %                                                                             %
01210 %                                                                             %
01211 %                                                                             %
01212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01213 %
01214 %  MagickClipImage() clips along the first path from the 8BIM profile, if
01215 %  present.
01216 %
01217 %  The format of the MagickClipImage method is:
01218 %
01219 %      MagickBooleanType MagickClipImage(MagickWand *wand)
01220 %
01221 %  A description of each parameter follows:
01222 %
01223 %    o wand: the magick wand.
01224 %
01225 */
01226 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
01227 {
01228   MagickBooleanType
01229     status;
01230 
01231   assert(wand != (MagickWand *) NULL);
01232   assert(wand->signature == WandSignature);
01233   if (wand->debug != MagickFalse)
01234     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01235   if (wand->images == (Image *) NULL)
01236     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01237   status=ClipImage(wand->images,wand->exception);
01238   return(status);
01239 }
01240 
01241 /*
01242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01243 %                                                                             %
01244 %                                                                             %
01245 %                                                                             %
01246 %   M a g i c k C l i p I m a g e P a t h                                     %
01247 %                                                                             %
01248 %                                                                             %
01249 %                                                                             %
01250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01251 %
01252 %  MagickClipImagePath() clips along the named paths from the 8BIM profile, if
01253 %  present. Later operations take effect inside the path.  Id may be a number
01254 %  if preceded with #, to work on a numbered path, e.g., "#1" to use the first
01255 %  path.
01256 %
01257 %  The format of the MagickClipImagePath method is:
01258 %
01259 %      MagickBooleanType MagickClipImagePath(MagickWand *wand,
01260 %        const char *pathname,const MagickBooleanType inside)
01261 %
01262 %  A description of each parameter follows:
01263 %
01264 %    o wand: the magick wand.
01265 %
01266 %    o pathname: name of clipping path resource. If name is preceded by #, use
01267 %      clipping path numbered by name.
01268 %
01269 %    o inside: if non-zero, later operations take effect inside clipping path.
01270 %      Otherwise later operations take effect outside clipping path.
01271 %
01272 */
01273 WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand,
01274   const char *pathname,const MagickBooleanType inside)
01275 {
01276   MagickBooleanType
01277     status;
01278 
01279   assert(wand != (MagickWand *) NULL);
01280   assert(wand->signature == WandSignature);
01281   if (wand->debug != MagickFalse)
01282     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01283   if (wand->images == (Image *) NULL)
01284     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01285   status=ClipImagePath(wand->images,pathname,inside,wand->exception);
01286   return(status);
01287 }
01288 
01289 /*
01290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01291 %                                                                             %
01292 %                                                                             %
01293 %                                                                             %
01294 %   M a g i c k C l u t I m a g e                                             %
01295 %                                                                             %
01296 %                                                                             %
01297 %                                                                             %
01298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01299 %
01300 %  MagickClutImage() replaces colors in the image from a color lookup table.
01301 %
01302 %  The format of the MagickClutImage method is:
01303 %
01304 %      MagickBooleanType MagickClutImage(MagickWand *wand,
01305 %        const MagickWand *clut_wand,const PixelInterpolateMethod method)
01306 %
01307 %  A description of each parameter follows:
01308 %
01309 %    o wand: the magick wand.
01310 %
01311 %    o clut_image: the clut image.
01312 %
01313 %    o method: the pixel interpolation method.
01314 %
01315 */
01316 WandExport MagickBooleanType MagickClutImage(MagickWand *wand,
01317   const MagickWand *clut_wand,const PixelInterpolateMethod method)
01318 {
01319   MagickBooleanType
01320     status;
01321 
01322   assert(wand != (MagickWand *) NULL);
01323   assert(wand->signature == WandSignature);
01324   if (wand->debug != MagickFalse)
01325     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01326   if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL))
01327     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01328   status=ClutImage(wand->images,clut_wand->images,method,wand->exception);
01329   return(status);
01330 }
01331 
01332 /*
01333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01334 %                                                                             %
01335 %                                                                             %
01336 %                                                                             %
01337 %   M a g i c k C o a l e s c e I m a g e s                                   %
01338 %                                                                             %
01339 %                                                                             %
01340 %                                                                             %
01341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01342 %
01343 %  MagickCoalesceImages() composites a set of images while respecting any page
01344 %  offsets and disposal methods.  GIF, MIFF, and MNG animation sequences
01345 %  typically start with an image background and each subsequent image
01346 %  varies in size and offset.  MagickCoalesceImages() returns a new sequence
01347 %  where each image in the sequence is the same size as the first and
01348 %  composited with the next image in the sequence.
01349 %
01350 %  The format of the MagickCoalesceImages method is:
01351 %
01352 %      MagickWand *MagickCoalesceImages(MagickWand *wand)
01353 %
01354 %  A description of each parameter follows:
01355 %
01356 %    o wand: the magick wand.
01357 %
01358 */
01359 WandExport MagickWand *MagickCoalesceImages(MagickWand *wand)
01360 {
01361   Image
01362     *coalesce_image;
01363 
01364   assert(wand != (MagickWand *) NULL);
01365   assert(wand->signature == WandSignature);
01366   if (wand->debug != MagickFalse)
01367     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01368   if (wand->images == (Image *) NULL)
01369     return((MagickWand *) NULL);
01370   coalesce_image=CoalesceImages(wand->images,wand->exception);
01371   if (coalesce_image == (Image *) NULL)
01372     return((MagickWand *) NULL);
01373   return(CloneMagickWandFromImages(wand,coalesce_image));
01374 }
01375 
01376 /*
01377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01378 %                                                                             %
01379 %                                                                             %
01380 %                                                                             %
01381 %   M a g i c k C o l o r D e c i s i o n I m a g e                           %
01382 %                                                                             %
01383 %                                                                             %
01384 %                                                                             %
01385 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01386 %
01387 %  MagickColorDecisionListImage() accepts a lightweight Color Correction
01388 %  Collection (CCC) file which solely contains one or more color corrections
01389 %  and applies the color correction to the image.  Here is a sample CCC file:
01390 %
01391 %    <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
01392 %          <ColorCorrection id="cc03345">
01393 %                <SOPNode>
01394 %                     <Slope> 0.9 1.2 0.5 </Slope>
01395 %                     <Offset> 0.4 -0.5 0.6 </Offset>
01396 %                     <Power> 1.0 0.8 1.5 </Power>
01397 %                </SOPNode>
01398 %                <SATNode>
01399 %                     <Saturation> 0.85 </Saturation>
01400 %                </SATNode>
01401 %          </ColorCorrection>
01402 %    </ColorCorrectionCollection>
01403 %
01404 %  which includes the offset, slope, and power for each of the RGB channels
01405 %  as well as the saturation.
01406 %
01407 %  The format of the MagickColorDecisionListImage method is:
01408 %
01409 %      MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
01410 %        const double gamma)
01411 %
01412 %  A description of each parameter follows:
01413 %
01414 %    o wand: the magick wand.
01415 %
01416 %    o color_correction_collection: the color correction collection in XML.
01417 %
01418 */
01419 WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
01420   const char *color_correction_collection)
01421 {
01422   MagickBooleanType
01423     status;
01424 
01425   assert(wand != (MagickWand *) NULL);
01426   assert(wand->signature == WandSignature);
01427   if (wand->debug != MagickFalse)
01428     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01429   if (wand->images == (Image *) NULL)
01430     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01431   status=ColorDecisionListImage(wand->images,color_correction_collection,
01432     wand->exception);
01433   return(status);
01434 }
01435 
01436 /*
01437 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01438 %                                                                             %
01439 %                                                                             %
01440 %                                                                             %
01441 %   M a g i c k C o l o r i z e I m a g e                                     %
01442 %                                                                             %
01443 %                                                                             %
01444 %                                                                             %
01445 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01446 %
01447 %  MagickColorizeImage() blends the fill color with each pixel in the image.
01448 %
01449 %  The format of the MagickColorizeImage method is:
01450 %
01451 %      MagickBooleanType MagickColorizeImage(MagickWand *wand,
01452 %        const PixelWand *colorize,const PixelWand *blend)
01453 %
01454 %  A description of each parameter follows:
01455 %
01456 %    o wand: the magick wand.
01457 %
01458 %    o colorize: the colorize pixel wand.
01459 %
01460 %    o alpha: the alpha pixel wand.
01461 %
01462 */
01463 WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
01464   const PixelWand *colorize,const PixelWand *blend)
01465 {
01466   char
01467     percent_blend[MaxTextExtent];
01468 
01469   Image
01470     *colorize_image;
01471 
01472   PixelInfo
01473     target;
01474 
01475   assert(wand != (MagickWand *) NULL);
01476   assert(wand->signature == WandSignature);
01477   if (wand->debug != MagickFalse)
01478     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01479   if (wand->images == (Image *) NULL)
01480     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01481   GetPixelInfo(wand->images,&target);
01482   if (target.colorspace != CMYKColorspace)
01483     (void) FormatLocaleString(percent_blend,MaxTextExtent,
01484       "%g,%g,%g,%g",(double) (100.0*QuantumScale*
01485       PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
01486       PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
01487       PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
01488       PixelGetAlphaQuantum(blend)));
01489   else
01490     (void) FormatLocaleString(percent_blend,MaxTextExtent,
01491       "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
01492       PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
01493       PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
01494       PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
01495       PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
01496       PixelGetAlphaQuantum(blend)));
01497   target=PixelGetPixel(colorize);
01498   colorize_image=ColorizeImage(wand->images,percent_blend,&target,
01499     wand->exception);
01500   if (colorize_image == (Image *) NULL)
01501     return(MagickFalse);
01502   ReplaceImageInList(&wand->images,colorize_image);
01503   return(MagickTrue);
01504 }
01505 
01506 /*
01507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01508 %                                                                             %
01509 %                                                                             %
01510 %                                                                             %
01511 %   M a g i c k C o l o r M a t r i x I m a g e                               %
01512 %                                                                             %
01513 %                                                                             %
01514 %                                                                             %
01515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01516 %
01517 %  MagickColorMatrixImage() apply color transformation to an image. The method
01518 %  permits saturation changes, hue rotation, luminance to alpha, and various
01519 %  other effects.  Although variable-sized transformation matrices can be used,
01520 %  typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
01521 %  (or RGBA with offsets).  The matrix is similar to those used by Adobe Flash
01522 %  except offsets are in column 6 rather than 5 (in support of CMYKA images)
01523 %  and offsets are normalized (divide Flash offset by 255).
01524 %
01525 %  The format of the MagickColorMatrixImage method is:
01526 %
01527 %      MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
01528 %        const KernelInfo *color_matrix)
01529 %
01530 %  A description of each parameter follows:
01531 %
01532 %    o wand: the magick wand.
01533 %
01534 %    o color_matrix:  the color matrix.
01535 %
01536 */
01537 WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
01538   const KernelInfo *color_matrix)
01539 {
01540   Image
01541     *color_image;
01542 
01543   assert(wand != (MagickWand *) NULL);
01544   assert(wand->signature == WandSignature);
01545   if (wand->debug != MagickFalse)
01546     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01547   if (color_matrix == (const KernelInfo *) NULL)
01548     return(MagickFalse);
01549   if (wand->images == (Image *) NULL)
01550     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01551   color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
01552   if (color_image == (Image *) NULL)
01553     return(MagickFalse);
01554   ReplaceImageInList(&wand->images,color_image);
01555   return(MagickTrue);
01556 }
01557 
01558 /*
01559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01560 %                                                                             %
01561 %                                                                             %
01562 %                                                                             %
01563 %   M a g i c k C o m b i n e I m a g e s                                     %
01564 %                                                                             %
01565 %                                                                             %
01566 %                                                                             %
01567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01568 %
01569 %  MagickCombineImages() combines one or more images into a single image.  The
01570 %  grayscale value of the pixels of each image in the sequence is assigned in
01571 %  order to the specified  hannels of the combined image.   The typical
01572 %  ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
01573 %
01574 %  The format of the MagickCombineImages method is:
01575 %
01576 %      MagickWand *MagickCombineImages(MagickWand *wand)
01577 %
01578 %  A description of each parameter follows:
01579 %
01580 %    o wand: the magick wand.
01581 %
01582 */
01583 WandExport MagickWand *MagickCombineImages(MagickWand *wand)
01584 {
01585   Image
01586     *combine_image;
01587 
01588   assert(wand != (MagickWand *) NULL);
01589   assert(wand->signature == WandSignature);
01590   if (wand->debug != MagickFalse)
01591     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01592   if (wand->images == (Image *) NULL)
01593     return((MagickWand *) NULL);
01594   combine_image=CombineImages(wand->images,wand->exception);
01595   if (combine_image == (Image *) NULL)
01596     return((MagickWand *) NULL);
01597   return(CloneMagickWandFromImages(wand,combine_image));
01598 }
01599 
01600 /*
01601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01602 %                                                                             %
01603 %                                                                             %
01604 %                                                                             %
01605 %   M a g i c k C o m m e n t I m a g e                                       %
01606 %                                                                             %
01607 %                                                                             %
01608 %                                                                             %
01609 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01610 %
01611 %  MagickCommentImage() adds a comment to your image.
01612 %
01613 %  The format of the MagickCommentImage method is:
01614 %
01615 %      MagickBooleanType MagickCommentImage(MagickWand *wand,
01616 %        const char *comment)
01617 %
01618 %  A description of each parameter follows:
01619 %
01620 %    o wand: the magick wand.
01621 %
01622 %    o comment: the image comment.
01623 %
01624 */
01625 WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
01626   const char *comment)
01627 {
01628   MagickBooleanType
01629     status;
01630 
01631   assert(wand != (MagickWand *) NULL);
01632   assert(wand->signature == WandSignature);
01633   if (wand->debug != MagickFalse)
01634     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01635   if (wand->images == (Image *) NULL)
01636     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01637   status=SetImageProperty(wand->images,"comment",comment,wand->exception);
01638   return(status);
01639 }
01640 
01641 /*
01642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01643 %                                                                             %
01644 %                                                                             %
01645 %                                                                             %
01646 %   M a g i c k C o m p a r e I m a g e L a y e r s                           %
01647 %                                                                             %
01648 %                                                                             %
01649 %                                                                             %
01650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01651 %
01652 %  MagickCompareImagesLayers() compares each image with the next in a sequence
01653 %  and returns the maximum bounding region of any pixel differences it
01654 %  discovers.
01655 %
01656 %  The format of the MagickCompareImagesLayers method is:
01657 %
01658 %      MagickWand *MagickCompareImagesLayers(MagickWand *wand,
01659 %        const ImageLayerMethod method)
01660 %
01661 %  A description of each parameter follows:
01662 %
01663 %    o wand: the magick wand.
01664 %
01665 %    o method: the compare method.
01666 %
01667 */
01668 WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
01669   const ImageLayerMethod method)
01670 {
01671   Image
01672     *layers_image;
01673 
01674   assert(wand != (MagickWand *) NULL);
01675   assert(wand->signature == WandSignature);
01676   if (wand->debug != MagickFalse)
01677     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01678   if (wand->images == (Image *) NULL)
01679     return((MagickWand *) NULL);
01680   layers_image=CompareImagesLayers(wand->images,method,wand->exception);
01681   if (layers_image == (Image *) NULL)
01682     return((MagickWand *) NULL);
01683   return(CloneMagickWandFromImages(wand,layers_image));
01684 }
01685 
01686 /*
01687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01688 %                                                                             %
01689 %                                                                             %
01690 %                                                                             %
01691 %   M a g i c k C o m p a r e I m a g e s                                     %
01692 %                                                                             %
01693 %                                                                             %
01694 %                                                                             %
01695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01696 %
01697 %  MagickCompareImages() compares an image to a reconstructed image and returns
01698 %  the specified difference image.
01699 %
01700 %  The format of the MagickCompareImages method is:
01701 %
01702 %      MagickWand *MagickCompareImages(MagickWand *wand,
01703 %        const MagickWand *reference,const MetricType metric,
01704 %        double *distortion)
01705 %
01706 %  A description of each parameter follows:
01707 %
01708 %    o wand: the magick wand.
01709 %
01710 %    o reference: the reference wand.
01711 %
01712 %    o metric: the metric.
01713 %
01714 %    o distortion: the computed distortion between the images.
01715 %
01716 */
01717 WandExport MagickWand *MagickCompareImages(MagickWand *wand,
01718   const MagickWand *reference,const MetricType metric,double *distortion)
01719 {
01720   Image
01721     *compare_image;
01722 
01723 
01724   assert(wand != (MagickWand *) NULL);
01725   assert(wand->signature == WandSignature);
01726   if (wand->debug != MagickFalse)
01727     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01728   if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
01729     {
01730       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
01731         "ContainsNoImages","`%s'",wand->name);
01732       return((MagickWand *) NULL);
01733     }
01734   compare_image=CompareImages(wand->images,reference->images,metric,distortion,
01735     wand->exception);
01736   if (compare_image == (Image *) NULL)
01737     return((MagickWand *) NULL);
01738   return(CloneMagickWandFromImages(wand,compare_image));
01739 }
01740 
01741 /*
01742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01743 %                                                                             %
01744 %                                                                             %
01745 %                                                                             %
01746 %   M a g i c k C o m p o s i t e I m a g e                                   %
01747 %                                                                             %
01748 %                                                                             %
01749 %                                                                             %
01750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01751 %
01752 %  MagickCompositeImage() composite one image onto another at the specified
01753 %  offset.
01754 %
01755 %  The format of the MagickCompositeImage method is:
01756 %
01757 %      MagickBooleanType MagickCompositeImage(MagickWand *wand,
01758 %        const MagickWand *composite_wand,const CompositeOperator compose,
01759 %        const ssize_t x,const ssize_t y)
01760 %
01761 %  A description of each parameter follows:
01762 %
01763 %    o wand: the magick wand.
01764 %
01765 %    o composite_image: the composite image.
01766 %
01767 %    o compose: This operator affects how the composite is applied to the
01768 %      image.  The default is Over.  Choose from these operators:
01769 %
01770 %        OverCompositeOp       InCompositeOp         OutCompositeOp
01771 %        AtopCompositeOp       XorCompositeOp        PlusCompositeOp
01772 %        MinusCompositeOp      AddCompositeOp        SubtractCompositeOp
01773 %        DifferenceCompositeOp BumpmapCompositeOp    CopyCompositeOp
01774 %        DisplaceCompositeOp
01775 %
01776 %    o x: the column offset of the composited image.
01777 %
01778 %    o y: the row offset of the composited image.
01779 %
01780 */
01781 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
01782   const MagickWand *composite_wand,const CompositeOperator compose,
01783   const ssize_t x,const ssize_t y)
01784 {
01785   MagickBooleanType
01786     status;
01787 
01788   assert(wand != (MagickWand *) NULL);
01789   assert(wand->signature == WandSignature);
01790   if (wand->debug != MagickFalse)
01791     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01792   if ((wand->images == (Image *) NULL) ||
01793       (composite_wand->images == (Image *) NULL))
01794     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01795   status=CompositeImage(wand->images,compose,composite_wand->images,x,y,
01796     wand->exception);
01797   return(status);
01798 }
01799 
01800 /*
01801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01802 %                                                                             %
01803 %                                                                             %
01804 %                                                                             %
01805 %   M a g i c k C o n t r a s t I m a g e                                     %
01806 %                                                                             %
01807 %                                                                             %
01808 %                                                                             %
01809 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01810 %
01811 %  MagickContrastImage() enhances the intensity differences between the lighter
01812 %  and darker elements of the image.  Set sharpen to a value other than 0 to
01813 %  increase the image contrast otherwise the contrast is reduced.
01814 %
01815 %  The format of the MagickContrastImage method is:
01816 %
01817 %      MagickBooleanType MagickContrastImage(MagickWand *wand,
01818 %        const MagickBooleanType sharpen)
01819 %
01820 %  A description of each parameter follows:
01821 %
01822 %    o wand: the magick wand.
01823 %
01824 %    o sharpen: Increase or decrease image contrast.
01825 %
01826 %
01827 */
01828 WandExport MagickBooleanType MagickContrastImage(MagickWand *wand,
01829   const MagickBooleanType sharpen)
01830 {
01831   MagickBooleanType
01832     status;
01833 
01834   assert(wand != (MagickWand *) NULL);
01835   assert(wand->signature == WandSignature);
01836   if (wand->debug != MagickFalse)
01837     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01838   if (wand->images == (Image *) NULL)
01839     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01840   status=ContrastImage(wand->images,sharpen,wand->exception);
01841   return(status);
01842 }
01843 
01844 /*
01845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01846 %                                                                             %
01847 %                                                                             %
01848 %                                                                             %
01849 %   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                       %
01850 %                                                                             %
01851 %                                                                             %
01852 %                                                                             %
01853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01854 %
01855 %  MagickContrastStretchImage() enhances the contrast of a color image by
01856 %  adjusting the pixels color to span the entire range of colors available.
01857 %  You can also reduce the influence of a particular channel with a gamma
01858 %  value of 0.
01859 %
01860 %  The format of the MagickContrastStretchImage method is:
01861 %
01862 %      MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
01863 %        const double black_point,const double white_point)
01864 %
01865 %  A description of each parameter follows:
01866 %
01867 %    o wand: the magick wand.
01868 %
01869 %    o black_point: the black point.
01870 %
01871 %    o white_point: the white point.
01872 %
01873 */
01874 WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand,
01875   const double black_point,const double white_point)
01876 {
01877   MagickBooleanType
01878     status;
01879 
01880   assert(wand != (MagickWand *) NULL);
01881   assert(wand->signature == WandSignature);
01882   if (wand->debug != MagickFalse)
01883     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01884   if (wand->images == (Image *) NULL)
01885     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01886   status=ContrastStretchImage(wand->images,black_point,white_point,
01887     wand->exception);
01888   return(status);
01889 }
01890 
01891 /*
01892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01893 %                                                                             %
01894 %                                                                             %
01895 %                                                                             %
01896 %   M a g i c k C o n v o l v e I m a g e                                     %
01897 %                                                                             %
01898 %                                                                             %
01899 %                                                                             %
01900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01901 %
01902 %  MagickConvolveImage() applies a custom convolution kernel to the image.
01903 %
01904 %  The format of the MagickConvolveImage method is:
01905 %
01906 %      MagickBooleanType MagickConvolveImage(MagickWand *wand,
01907 %        const KernelInfo *kernel)
01908 %
01909 %  A description of each parameter follows:
01910 %
01911 %    o wand: the magick wand.
01912 %
01913 %    o kernel: An array of doubles representing the convolution kernel.
01914 %
01915 */
01916 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
01917   const KernelInfo *kernel)
01918 {
01919   Image
01920     *filter_image;
01921 
01922   assert(wand != (MagickWand *) NULL);
01923   assert(wand->signature == WandSignature);
01924   if (wand->debug != MagickFalse)
01925     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01926   if (kernel == (const KernelInfo *) NULL)
01927     return(MagickFalse);
01928   if (wand->images == (Image *) NULL)
01929     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01930   filter_image=ConvolveImage(wand->images,kernel,wand->exception);
01931   if (filter_image == (Image *) NULL)
01932     return(MagickFalse);
01933   ReplaceImageInList(&wand->images,filter_image);
01934   return(MagickTrue);
01935 }
01936 
01937 /*
01938 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01939 %                                                                             %
01940 %                                                                             %
01941 %                                                                             %
01942 %   M a g i c k C r o p I m a g e                                             %
01943 %                                                                             %
01944 %                                                                             %
01945 %                                                                             %
01946 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01947 %
01948 %  MagickCropImage() extracts a region of the image.
01949 %
01950 %  The format of the MagickCropImage method is:
01951 %
01952 %      MagickBooleanType MagickCropImage(MagickWand *wand,
01953 %        const size_t width,const size_t height,const ssize_t x,const ssize_t y)
01954 %
01955 %  A description of each parameter follows:
01956 %
01957 %    o wand: the magick wand.
01958 %
01959 %    o width: the region width.
01960 %
01961 %    o height: the region height.
01962 %
01963 %    o x: the region x-offset.
01964 %
01965 %    o y: the region y-offset.
01966 %
01967 */
01968 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
01969   const size_t width,const size_t height,const ssize_t x,const ssize_t y)
01970 {
01971   Image
01972     *crop_image;
01973 
01974   RectangleInfo
01975     crop;
01976 
01977   assert(wand != (MagickWand *) NULL);
01978   assert(wand->signature == WandSignature);
01979   if (wand->debug != MagickFalse)
01980     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01981   if (wand->images == (Image *) NULL)
01982     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01983   crop.width=width;
01984   crop.height=height;
01985   crop.x=x;
01986   crop.y=y;
01987   crop_image=CropImage(wand->images,&crop,wand->exception);
01988   if (crop_image == (Image *) NULL)
01989     return(MagickFalse);
01990   ReplaceImageInList(&wand->images,crop_image);
01991   return(MagickTrue);
01992 }
01993 
01994 /*
01995 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01996 %                                                                             %
01997 %                                                                             %
01998 %                                                                             %
01999 %   M a g i c k C y c l e C o l o r m a p I m a g e                           %
02000 %                                                                             %
02001 %                                                                             %
02002 %                                                                             %
02003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02004 %
02005 %  MagickCycleColormapImage() displaces an image's colormap by a given number
02006 %  of positions.  If you cycle the colormap a number of times you can produce
02007 %  a psychodelic effect.
02008 %
02009 %  The format of the MagickCycleColormapImage method is:
02010 %
02011 %      MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
02012 %        const ssize_t displace)
02013 %
02014 %  A description of each parameter follows:
02015 %
02016 %    o wand: the magick wand.
02017 %
02018 %    o pixel_wand: the pixel wand.
02019 %
02020 */
02021 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
02022   const ssize_t displace)
02023 {
02024   MagickBooleanType
02025     status;
02026 
02027   assert(wand != (MagickWand *) NULL);
02028   assert(wand->signature == WandSignature);
02029   if (wand->debug != MagickFalse)
02030     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02031   if (wand->images == (Image *) NULL)
02032     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02033   status=CycleColormapImage(wand->images,displace,wand->exception);
02034   return(status);
02035 }
02036 
02037 /*
02038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02039 %                                                                             %
02040 %                                                                             %
02041 %                                                                             %
02042 %   M a g i c k C o n s t i t u t e I m a g e                                 %
02043 %                                                                             %
02044 %                                                                             %
02045 %                                                                             %
02046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02047 %
02048 %  MagickConstituteImage() adds an image to the wand comprised of the pixel
02049 %  data you supply.  The pixel data must be in scanline order top-to-bottom.
02050 %  The data can be char, short int, int, float, or double.  Float and double
02051 %  require the pixels to be normalized [0..1], otherwise [0..Max],  where Max
02052 %  is the maximum value the type can accomodate (e.g. 255 for char).  For
02053 %  example, to create a 640x480 image from unsigned red-green-blue character
02054 %  data, use
02055 %
02056 %      MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels);
02057 %
02058 %  The format of the MagickConstituteImage method is:
02059 %
02060 %      MagickBooleanType MagickConstituteImage(MagickWand *wand,
02061 %        const size_t columns,const size_t rows,const char *map,
02062 %        const StorageType storage,void *pixels)
02063 %
02064 %  A description of each parameter follows:
02065 %
02066 %    o wand: the magick wand.
02067 %
02068 %    o columns: width in pixels of the image.
02069 %
02070 %    o rows: height in pixels of the image.
02071 %
02072 %    o map:  This string reflects the expected ordering of the pixel array.
02073 %      It can be any combination or order of R = red, G = green, B = blue,
02074 %      A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
02075 %      Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
02076 %      P = pad.
02077 %
02078 %    o storage: Define the data type of the pixels.  Float and double types are
02079 %      expected to be normalized [0..1] otherwise [0..QuantumRange].  Choose from
02080 %      these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
02081 %      LongPixel, QuantumPixel, or ShortPixel.
02082 %
02083 %    o pixels: This array of values contain the pixel components as defined by
02084 %      map and type.  You must preallocate this array where the expected
02085 %      length varies depending on the values of width, height, map, and type.
02086 %
02087 %
02088 */
02089 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
02090   const size_t columns,const size_t rows,const char *map,
02091   const StorageType storage,const void *pixels)
02092 {
02093   Image
02094     *images;
02095 
02096   assert(wand != (MagickWand *) NULL);
02097   assert(wand->signature == WandSignature);
02098   if (wand->debug != MagickFalse)
02099     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02100   images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception);
02101   if (images == (Image *) NULL)
02102     return(MagickFalse);
02103   return(InsertImageInWand(wand,images));
02104 }
02105 
02106 /*
02107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02108 %                                                                             %
02109 %                                                                             %
02110 %                                                                             %
02111 %   M a g i c k D e c i p h e r I m a g e                                     %
02112 %                                                                             %
02113 %                                                                             %
02114 %                                                                             %
02115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02116 %
02117 %  MagickDecipherImage() converts cipher pixels to plain pixels.
02118 %
02119 %  The format of the MagickDecipherImage method is:
02120 %
02121 %      MagickBooleanType MagickDecipherImage(MagickWand *wand,
02122 %        const char *passphrase)
02123 %
02124 %  A description of each parameter follows:
02125 %
02126 %    o wand: the magick wand.
02127 %
02128 %    o passphrase: the passphrase.
02129 %
02130 */
02131 WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand,
02132   const char *passphrase)
02133 {
02134   assert(wand != (MagickWand *) NULL);
02135   assert(wand->signature == WandSignature);
02136   if (wand->debug != MagickFalse)
02137     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02138   if (wand->images == (Image *) NULL)
02139     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02140   return(DecipherImage(wand->images,passphrase,wand->exception));
02141 }
02142 
02143 /*
02144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02145 %                                                                             %
02146 %                                                                             %
02147 %                                                                             %
02148 %   M a g i c k D e c o n s t r u c t I m a g e s                             %
02149 %                                                                             %
02150 %                                                                             %
02151 %                                                                             %
02152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02153 %
02154 %  MagickDeconstructImages() compares each image with the next in a sequence
02155 %  and returns the maximum bounding region of any pixel differences it
02156 %  discovers.
02157 %
02158 %  The format of the MagickDeconstructImages method is:
02159 %
02160 %      MagickWand *MagickDeconstructImages(MagickWand *wand)
02161 %
02162 %  A description of each parameter follows:
02163 %
02164 %    o wand: the magick wand.
02165 %
02166 */
02167 WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
02168 {
02169   Image
02170     *deconstruct_image;
02171 
02172   assert(wand != (MagickWand *) NULL);
02173   assert(wand->signature == WandSignature);
02174   if (wand->debug != MagickFalse)
02175     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02176   if (wand->images == (Image *) NULL)
02177     return((MagickWand *) NULL);
02178   deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
02179     wand->exception);
02180   if (deconstruct_image == (Image *) NULL)
02181     return((MagickWand *) NULL);
02182   return(CloneMagickWandFromImages(wand,deconstruct_image));
02183 }
02184 
02185 /*
02186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02187 %                                                                             %
02188 %                                                                             %
02189 %                                                                             %
02190 %     M a g i c k D e s k e w I m a g e                                       %
02191 %                                                                             %
02192 %                                                                             %
02193 %                                                                             %
02194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02195 %
02196 %  MagickDeskewImage() removes skew from the image.  Skew is an artifact that
02197 %  occurs in scanned images because of the camera being misaligned,
02198 %  imperfections in the scanning or surface, or simply because the paper was
02199 %  not placed completely flat when scanned.
02200 %
02201 %  The format of the MagickDeskewImage method is:
02202 %
02203 %      MagickBooleanType MagickDeskewImage(MagickWand *wand,
02204 %        const double threshold)
02205 %
02206 %  A description of each parameter follows:
02207 %
02208 %    o wand: the magick wand.
02209 %
02210 %    o threshold: separate background from foreground.
02211 %
02212 */
02213 WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand,
02214   const double threshold)
02215 {
02216   Image
02217     *sepia_image;
02218 
02219   assert(wand != (MagickWand *) NULL);
02220   assert(wand->signature == WandSignature);
02221   if (wand->debug != MagickFalse)
02222     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02223   if (wand->images == (Image *) NULL)
02224     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02225   sepia_image=DeskewImage(wand->images,threshold,wand->exception);
02226   if (sepia_image == (Image *) NULL)
02227     return(MagickFalse);
02228   ReplaceImageInList(&wand->images,sepia_image);
02229   return(MagickTrue);
02230 }
02231 
02232 /*
02233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02234 %                                                                             %
02235 %                                                                             %
02236 %                                                                             %
02237 %     M a g i c k D e s p e c k l e I m a g e                                 %
02238 %                                                                             %
02239 %                                                                             %
02240 %                                                                             %
02241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02242 %
02243 %  MagickDespeckleImage() reduces the speckle noise in an image while
02244 %  perserving the edges of the original image.
02245 %
02246 %  The format of the MagickDespeckleImage method is:
02247 %
02248 %      MagickBooleanType MagickDespeckleImage(MagickWand *wand)
02249 %
02250 %  A description of each parameter follows:
02251 %
02252 %    o wand: the magick wand.
02253 %
02254 */
02255 WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand)
02256 {
02257   Image
02258     *despeckle_image;
02259 
02260   assert(wand != (MagickWand *) NULL);
02261   assert(wand->signature == WandSignature);
02262   if (wand->debug != MagickFalse)
02263     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02264   if (wand->images == (Image *) NULL)
02265     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02266   despeckle_image=DespeckleImage(wand->images,wand->exception);
02267   if (despeckle_image == (Image *) NULL)
02268     return(MagickFalse);
02269   ReplaceImageInList(&wand->images,despeckle_image);
02270   return(MagickTrue);
02271 }
02272 
02273 /*
02274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02275 %                                                                             %
02276 %                                                                             %
02277 %                                                                             %
02278 %   M a g i c k D e s t r o y I m a g e                                       %
02279 %                                                                             %
02280 %                                                                             %
02281 %                                                                             %
02282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02283 %
02284 %  MagickDestroyImage() dereferences an image, deallocating memory associated
02285 %  with the image if the reference count becomes zero.
02286 %
02287 %  The format of the MagickDestroyImage method is:
02288 %
02289 %      Image *MagickDestroyImage(Image *image)
02290 %
02291 %  A description of each parameter follows:
02292 %
02293 %    o image: the image.
02294 %
02295 */
02296 WandExport Image *MagickDestroyImage(Image *image)
02297 {
02298   return(DestroyImage(image));
02299 }
02300 
02301 /*
02302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02303 %                                                                             %
02304 %                                                                             %
02305 %                                                                             %
02306 %   M a g i c k D i s p l a y I m a g e                                       %
02307 %                                                                             %
02308 %                                                                             %
02309 %                                                                             %
02310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02311 %
02312 %  MagickDisplayImage() displays an image.
02313 %
02314 %  The format of the MagickDisplayImage method is:
02315 %
02316 %      MagickBooleanType MagickDisplayImage(MagickWand *wand,
02317 %        const char *server_name)
02318 %
02319 %  A description of each parameter follows:
02320 %
02321 %    o wand: the magick wand.
02322 %
02323 %    o server_name: the X server name.
02324 %
02325 */
02326 WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand,
02327   const char *server_name)
02328 {
02329   Image
02330     *image;
02331 
02332   MagickBooleanType
02333     status;
02334 
02335   assert(wand != (MagickWand *) NULL);
02336   assert(wand->signature == WandSignature);
02337   if (wand->debug != MagickFalse)
02338     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02339   if (wand->images == (Image *) NULL)
02340     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02341   image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
02342   if (image == (Image *) NULL)
02343     return(MagickFalse);
02344   (void) CloneString(&wand->image_info->server_name,server_name);
02345   status=DisplayImages(wand->image_info,image,wand->exception);
02346   image=DestroyImage(image);
02347   return(status);
02348 }
02349 
02350 /*
02351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02352 %                                                                             %
02353 %                                                                             %
02354 %                                                                             %
02355 %   M a g i c k D i s p l a y I m a g e s                                     %
02356 %                                                                             %
02357 %                                                                             %
02358 %                                                                             %
02359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02360 %
02361 %  MagickDisplayImages() displays an image or image sequence.
02362 %
02363 %  The format of the MagickDisplayImages method is:
02364 %
02365 %      MagickBooleanType MagickDisplayImages(MagickWand *wand,
02366 %        const char *server_name)
02367 %
02368 %  A description of each parameter follows:
02369 %
02370 %    o wand: the magick wand.
02371 %
02372 %    o server_name: the X server name.
02373 %
02374 */
02375 WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
02376   const char *server_name)
02377 {
02378   MagickBooleanType
02379     status;
02380 
02381   assert(wand != (MagickWand *) NULL);
02382   assert(wand->signature == WandSignature);
02383   if (wand->debug != MagickFalse)
02384     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02385   (void) CloneString(&wand->image_info->server_name,server_name);
02386   status=DisplayImages(wand->image_info,wand->images,wand->exception);
02387   return(status);
02388 }
02389 
02390 /*
02391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02392 %                                                                             %
02393 %                                                                             %
02394 %                                                                             %
02395 %   M a g i c k D i s t o r t I m a g e                                       %
02396 %                                                                             %
02397 %                                                                             %
02398 %                                                                             %
02399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02400 %
02401 %  MagickDistortImage() distorts an image using various distortion methods, by
02402 %  mapping color lookups of the source image to a new destination image
02403 %  usally of the same size as the source image, unless 'bestfit' is set to
02404 %  true.
02405 %
02406 %  If 'bestfit' is enabled, and distortion allows it, the destination image is
02407 %  adjusted to ensure the whole source 'image' will just fit within the final
02408 %  destination image, which will be sized and offset accordingly.  Also in
02409 %  many cases the virtual offset of the source image will be taken into
02410 %  account in the mapping.
02411 %
02412 %  The format of the MagickDistortImage method is:
02413 %
02414 %      MagickBooleanType MagickDistortImage(MagickWand *wand,
02415 %        const DistortImageMethod method,const size_t number_arguments,
02416 %        const double *arguments,const MagickBooleanType bestfit)
02417 %
02418 %  A description of each parameter follows:
02419 %
02420 %    o image: the image to be distorted.
02421 %
02422 %    o method: the method of image distortion.
02423 %
02424 %        ArcDistortion always ignores the source image offset, and always
02425 %        'bestfit' the destination image with the top left corner offset
02426 %        relative to the polar mapping center.
02427 %
02428 %        Bilinear has no simple inverse mapping so it does not allow 'bestfit'
02429 %        style of image distortion.
02430 %
02431 %        Affine, Perspective, and Bilinear, do least squares fitting of the
02432 %        distortion when more than the minimum number of control point pairs
02433 %        are provided.
02434 %
02435 %        Perspective, and Bilinear, falls back to a Affine distortion when less
02436 %        that 4 control point pairs are provided. While Affine distortions let
02437 %        you use any number of control point pairs, that is Zero pairs is a
02438 %        no-Op (viewport only) distrotion, one pair is a translation and two
02439 %        pairs of control points do a scale-rotate-translate, without any
02440 %        shearing.
02441 %
02442 %    o number_arguments: the number of arguments given for this distortion
02443 %      method.
02444 %
02445 %    o arguments: the arguments for this distortion method.
02446 %
02447 %    o bestfit: Attempt to resize destination to fit distorted source.
02448 %
02449 */
02450 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
02451   const DistortImageMethod method,const size_t number_arguments,
02452   const double *arguments,const MagickBooleanType bestfit)
02453 {
02454   Image
02455     *distort_image;
02456 
02457   assert(wand != (MagickWand *) NULL);
02458   assert(wand->signature == WandSignature);
02459   if (wand->debug != MagickFalse)
02460     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02461   if (wand->images == (Image *) NULL)
02462     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02463   distort_image=DistortImage(wand->images,method,number_arguments,arguments,
02464     bestfit,wand->exception);
02465   if (distort_image == (Image *) NULL)
02466     return(MagickFalse);
02467   ReplaceImageInList(&wand->images,distort_image);
02468   return(MagickTrue);
02469 }
02470 
02471 /*
02472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02473 %                                                                             %
02474 %                                                                             %
02475 %                                                                             %
02476 %   M a g i c k D r a w I m a g e                                             %
02477 %                                                                             %
02478 %                                                                             %
02479 %                                                                             %
02480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02481 %
02482 %  MagickDrawImage() renders the drawing wand on the current image.
02483 %
02484 %  The format of the MagickDrawImage method is:
02485 %
02486 %      MagickBooleanType MagickDrawImage(MagickWand *wand,
02487 %        const DrawingWand *drawing_wand)
02488 %
02489 %  A description of each parameter follows:
02490 %
02491 %    o wand: the magick wand.
02492 %
02493 %    o drawing_wand: the draw wand.
02494 %
02495 */
02496 WandExport MagickBooleanType MagickDrawImage(MagickWand *wand,
02497   const DrawingWand *drawing_wand)
02498 {
02499   char
02500     *primitive;
02501 
02502   DrawInfo
02503     *draw_info;
02504 
02505   MagickBooleanType
02506     status;
02507 
02508   assert(wand != (MagickWand *) NULL);
02509   assert(wand->signature == WandSignature);
02510   if (wand->debug != MagickFalse)
02511     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02512   if (wand->images == (Image *) NULL)
02513     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02514   draw_info=PeekDrawingWand(drawing_wand);
02515   if ((draw_info == (DrawInfo *) NULL) ||
02516       (draw_info->primitive == (char *) NULL))
02517     return(MagickFalse);
02518   primitive=AcquireString(draw_info->primitive);
02519   draw_info=DestroyDrawInfo(draw_info);
02520   draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
02521   draw_info->primitive=primitive;
02522   status=DrawImage(wand->images,draw_info,wand->exception);
02523   draw_info=DestroyDrawInfo(draw_info);
02524   return(status);
02525 }
02526 
02527 /*
02528 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02529 %                                                                             %
02530 %                                                                             %
02531 %                                                                             %
02532 %   M a g i c k E d g e I m a g e                                             %
02533 %                                                                             %
02534 %                                                                             %
02535 %                                                                             %
02536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02537 %
02538 %  MagickEdgeImage() enhance edges within the image with a convolution filter
02539 %  of the given radius.  Use a radius of 0 and Edge() selects a suitable
02540 %  radius for you.
02541 %
02542 %  The format of the MagickEdgeImage method is:
02543 %
02544 %      MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius,
02545 %        const double sigma)
02546 %
02547 %  A description of each parameter follows:
02548 %
02549 %    o wand: the magick wand.
02550 %
02551 %    o radius: the radius of the pixel neighborhood.
02552 %
02553 %    o sigma: the standard deviation of the Gaussian, in pixels.
02554 %
02555 */
02556 WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand,
02557   const double radius,const double sigma)
02558 {
02559   Image
02560     *edge_image;
02561 
02562   assert(wand != (MagickWand *) NULL);
02563   assert(wand->signature == WandSignature);
02564   if (wand->debug != MagickFalse)
02565     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02566   if (wand->images == (Image *) NULL)
02567     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02568   edge_image=EdgeImage(wand->images,radius,sigma,wand->exception);
02569   if (edge_image == (Image *) NULL)
02570     return(MagickFalse);
02571   ReplaceImageInList(&wand->images,edge_image);
02572   return(MagickTrue);
02573 }
02574 
02575 /*
02576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02577 %                                                                             %
02578 %                                                                             %
02579 %                                                                             %
02580 %   M a g i c k E m b o s s I m a g e                                         %
02581 %                                                                             %
02582 %                                                                             %
02583 %                                                                             %
02584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02585 %
02586 %  MagickEmbossImage() returns a grayscale image with a three-dimensional
02587 %  effect.  We convolve the image with a Gaussian operator of the given radius
02588 %  and standard deviation (sigma).  For reasonable results, radius should be
02589 %  larger than sigma.  Use a radius of 0 and Emboss() selects a suitable
02590 %  radius for you.
02591 %
02592 %  The format of the MagickEmbossImage method is:
02593 %
02594 %      MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius,
02595 %        const double sigma)
02596 %
02597 %  A description of each parameter follows:
02598 %
02599 %    o wand: the magick wand.
02600 %
02601 %    o radius: the radius of the Gaussian, in pixels, not counting the center
02602 %      pixel.
02603 %
02604 %    o sigma: the standard deviation of the Gaussian, in pixels.
02605 %
02606 */
02607 WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand,
02608   const double radius,const double sigma)
02609 {
02610   Image
02611     *emboss_image;
02612 
02613   assert(wand != (MagickWand *) NULL);
02614   assert(wand->signature == WandSignature);
02615   if (wand->debug != MagickFalse)
02616     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02617   if (wand->images == (Image *) NULL)
02618     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02619   emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception);
02620   if (emboss_image == (Image *) NULL)
02621     return(MagickFalse);
02622   ReplaceImageInList(&wand->images,emboss_image);
02623   return(MagickTrue);
02624 }
02625 
02626 /*
02627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02628 %                                                                             %
02629 %                                                                             %
02630 %                                                                             %
02631 %   M a g i c k E n c i p h e r I m a g e                                     %
02632 %                                                                             %
02633 %                                                                             %
02634 %                                                                             %
02635 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02636 %
02637 %  MagickEncipherImage() converts plaint pixels to cipher pixels.
02638 %
02639 %  The format of the MagickEncipherImage method is:
02640 %
02641 %      MagickBooleanType MagickEncipherImage(MagickWand *wand,
02642 %        const char *passphrase)
02643 %
02644 %  A description of each parameter follows:
02645 %
02646 %    o wand: the magick wand.
02647 %
02648 %    o passphrase: the passphrase.
02649 %
02650 */
02651 WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand,
02652   const char *passphrase)
02653 {
02654   assert(wand != (MagickWand *) NULL);
02655   assert(wand->signature == WandSignature);
02656   if (wand->debug != MagickFalse)
02657     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02658   if (wand->images == (Image *) NULL)
02659     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02660   return(EncipherImage(wand->images,passphrase,wand->exception));
02661 }
02662 
02663 /*
02664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02665 %                                                                             %
02666 %                                                                             %
02667 %                                                                             %
02668 %   M a g i c k E n h a n c e I m a g e                                       %
02669 %                                                                             %
02670 %                                                                             %
02671 %                                                                             %
02672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02673 %
02674 %  MagickEnhanceImage() applies a digital filter that improves the quality of a
02675 %  noisy image.
02676 %
02677 %  The format of the MagickEnhanceImage method is:
02678 %
02679 %      MagickBooleanType MagickEnhanceImage(MagickWand *wand)
02680 %
02681 %  A description of each parameter follows:
02682 %
02683 %    o wand: the magick wand.
02684 %
02685 */
02686 WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand)
02687 {
02688   Image
02689     *enhance_image;
02690 
02691   assert(wand != (MagickWand *) NULL);
02692   assert(wand->signature == WandSignature);
02693   if (wand->debug != MagickFalse)
02694     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02695   if (wand->images == (Image *) NULL)
02696     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02697   enhance_image=EnhanceImage(wand->images,wand->exception);
02698   if (enhance_image == (Image *) NULL)
02699     return(MagickFalse);
02700   ReplaceImageInList(&wand->images,enhance_image);
02701   return(MagickTrue);
02702 }
02703 
02704 /*
02705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02706 %                                                                             %
02707 %                                                                             %
02708 %                                                                             %
02709 %   M a g i c k E q u a l i z e I m a g e                                     %
02710 %                                                                             %
02711 %                                                                             %
02712 %                                                                             %
02713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02714 %
02715 %  MagickEqualizeImage() equalizes the image histogram.
02716 %
02717 %  The format of the MagickEqualizeImage method is:
02718 %
02719 %      MagickBooleanType MagickEqualizeImage(MagickWand *wand)
02720 %
02721 %  A description of each parameter follows:
02722 %
02723 %    o wand: the magick wand.
02724 %
02725 %    o channel: the image channel(s).
02726 %
02727 */
02728 WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand)
02729 {
02730   MagickBooleanType
02731     status;
02732 
02733   assert(wand != (MagickWand *) NULL);
02734   assert(wand->signature == WandSignature);
02735   if (wand->debug != MagickFalse)
02736     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02737   if (wand->images == (Image *) NULL)
02738     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02739   status=EqualizeImage(wand->images,wand->exception);
02740   return(status);
02741 }
02742 
02743 /*
02744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02745 %                                                                             %
02746 %                                                                             %
02747 %                                                                             %
02748 %   M a g i c k E v a l u a t e I m a g e                                     %
02749 %                                                                             %
02750 %                                                                             %
02751 %                                                                             %
02752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02753 %
02754 %  MagickEvaluateImage() applys an arithmetic, relational, or logical
02755 %  expression to an image.  Use these operators to lighten or darken an image,
02756 %  to increase or decrease contrast in an image, or to produce the "negative"
02757 %  of an image.
02758 %
02759 %  The format of the MagickEvaluateImage method is:
02760 %
02761 %      MagickBooleanType MagickEvaluateImage(MagickWand *wand,
02762 %        const MagickEvaluateOperator operator,const double value)
02763 %      MagickBooleanType MagickEvaluateImages(MagickWand *wand,
02764 %        const MagickEvaluateOperator operator)
02765 %
02766 %  A description of each parameter follows:
02767 %
02768 %    o wand: the magick wand.
02769 %
02770 %    o op: A channel operator.
02771 %
02772 %    o value: A value value.
02773 %
02774 */
02775 
02776 WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
02777   const MagickEvaluateOperator op)
02778 {
02779   Image
02780     *evaluate_image;
02781 
02782   assert(wand != (MagickWand *) NULL);
02783   assert(wand->signature == WandSignature);
02784   if (wand->debug != MagickFalse)
02785     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02786   if (wand->images == (Image *) NULL)
02787     return((MagickWand *) NULL);
02788   evaluate_image=EvaluateImages(wand->images,op,wand->exception);
02789   if (evaluate_image == (Image *) NULL)
02790     return((MagickWand *) NULL);
02791   return(CloneMagickWandFromImages(wand,evaluate_image));
02792 }
02793 
02794 WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
02795   const MagickEvaluateOperator op,const double value)
02796 {
02797   MagickBooleanType
02798     status;
02799 
02800   assert(wand != (MagickWand *) NULL);
02801   assert(wand->signature == WandSignature);
02802   if (wand->debug != MagickFalse)
02803     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02804   if (wand->images == (Image *) NULL)
02805     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02806   status=EvaluateImage(wand->images,op,value,wand->exception);
02807   return(status);
02808 }
02809 
02810 /*
02811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02812 %                                                                             %
02813 %                                                                             %
02814 %                                                                             %
02815 %   M a g i c k E x p o r t I m a g e P i x e l s                             %
02816 %                                                                             %
02817 %                                                                             %
02818 %                                                                             %
02819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02820 %
02821 %  MagickExportImagePixels() extracts pixel data from an image and returns it
02822 %  to you.  The method returns MagickTrue on success otherwise MagickFalse if
02823 %  an error is encountered.  The data is returned as char, short int, int,
02824 %  ssize_t, float, or double in the order specified by map.
02825 %
02826 %  Suppose you want to extract the first scanline of a 640x480 image as
02827 %  character data in red-green-blue order:
02828 %
02829 %      MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
02830 %
02831 %  The format of the MagickExportImagePixels method is:
02832 %
02833 %      MagickBooleanType MagickExportImagePixels(MagickWand *wand,
02834 %        const ssize_t x,const ssize_t y,const size_t columns,
02835 %        const size_t rows,const char *map,const StorageType storage,
02836 %        void *pixels)
02837 %
02838 %  A description of each parameter follows:
02839 %
02840 %    o wand: the magick wand.
02841 %
02842 %    o x, y, columns, rows:  These values define the perimeter
02843 %      of a region of pixels you want to extract.
02844 %
02845 %    o map:  This string reflects the expected ordering of the pixel array.
02846 %      It can be any combination or order of R = red, G = green, B = blue,
02847 %      A = alpha (0 is transparent), O = alpha (0 is opaque), C = cyan,
02848 %      Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
02849 %      P = pad.
02850 %
02851 %    o storage: Define the data type of the pixels.  Float and double types are
02852 %      expected to be normalized [0..1] otherwise [0..QuantumRange].  Choose from
02853 %      these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
02854 %      LongPixel, QuantumPixel, or ShortPixel.
02855 %
02856 %    o pixels: This array of values contain the pixel components as defined by
02857 %      map and type.  You must preallocate this array where the expected
02858 %      length varies depending on the values of width, height, map, and type.
02859 %
02860 */
02861 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
02862   const ssize_t x,const ssize_t y,const size_t columns,
02863   const size_t rows,const char *map,const StorageType storage,
02864   void *pixels)
02865 {
02866   MagickBooleanType
02867     status;
02868 
02869   assert(wand != (MagickWand *) NULL);
02870   assert(wand->signature == WandSignature);
02871   if (wand->debug != MagickFalse)
02872     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02873   if (wand->images == (Image *) NULL)
02874     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02875   status=ExportImagePixels(wand->images,x,y,columns,rows,map,
02876     storage,pixels,wand->exception);
02877   return(status);
02878 }
02879 
02880 /*
02881 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02882 %                                                                             %
02883 %                                                                             %
02884 %                                                                             %
02885 %   M a g i c k E x t e n t I m a g e                                         %
02886 %                                                                             %
02887 %                                                                             %
02888 %                                                                             %
02889 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02890 %
02891 %  MagickExtentImage() extends the image as defined by the geometry, gravity,
02892 %  and wand background color.  Set the (x,y) offset of the geometry to move
02893 %  the original wand relative to the extended wand.
02894 %
02895 %  The format of the MagickExtentImage method is:
02896 %
02897 %      MagickBooleanType MagickExtentImage(MagickWand *wand,const size_t width,
02898 %        const size_t height,const ssize_t x,const ssize_t y)
02899 %
02900 %  A description of each parameter follows:
02901 %
02902 %    o wand: the magick wand.
02903 %
02904 %    o width: the region width.
02905 %
02906 %    o height: the region height.
02907 %
02908 %    o x: the region x offset.
02909 %
02910 %    o y: the region y offset.
02911 %
02912 */
02913 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
02914   const size_t width,const size_t height,const ssize_t x,const ssize_t y)
02915 {
02916   Image
02917     *extent_image;
02918 
02919   RectangleInfo
02920     extent;
02921 
02922   assert(wand != (MagickWand *) NULL);
02923   assert(wand->signature == WandSignature);
02924   if (wand->debug != MagickFalse)
02925     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02926   if (wand->images == (Image *) NULL)
02927     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02928   extent.width=width;
02929   extent.height=height;
02930   extent.x=x;
02931   extent.y=y;
02932   extent_image=ExtentImage(wand->images,&extent,wand->exception);
02933   if (extent_image == (Image *) NULL)
02934     return(MagickFalse);
02935   ReplaceImageInList(&wand->images,extent_image);
02936   return(MagickTrue);
02937 }
02938 
02939 /*
02940 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02941 %                                                                             %
02942 %                                                                             %
02943 %                                                                             %
02944 %   M a g i c k F l i p I m a g e                                             %
02945 %                                                                             %
02946 %                                                                             %
02947 %                                                                             %
02948 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02949 %
02950 %  MagickFlipImage() creates a vertical mirror image by reflecting the pixels
02951 %  around the central x-axis.
02952 %
02953 %  The format of the MagickFlipImage method is:
02954 %
02955 %      MagickBooleanType MagickFlipImage(MagickWand *wand)
02956 %
02957 %  A description of each parameter follows:
02958 %
02959 %    o wand: the magick wand.
02960 %
02961 */
02962 WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
02963 {
02964   Image
02965     *flip_image;
02966 
02967   assert(wand != (MagickWand *) NULL);
02968   assert(wand->signature == WandSignature);
02969   if (wand->debug != MagickFalse)
02970     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02971   if (wand->images == (Image *) NULL)
02972     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02973   flip_image=FlipImage(wand->images,wand->exception);
02974   if (flip_image == (Image *) NULL)
02975     return(MagickFalse);
02976   ReplaceImageInList(&wand->images,flip_image);
02977   return(MagickTrue);
02978 }
02979 
02980 /*
02981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02982 %                                                                             %
02983 %                                                                             %
02984 %                                                                             %
02985 %   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                         %
02986 %                                                                             %
02987 %                                                                             %
02988 %                                                                             %
02989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02990 %
02991 %  MagickFloodfillPaintImage() changes the color value of any pixel that matches
02992 %  target and is an immediate neighbor.  If the method FillToBorderMethod is
02993 %  specified, the color value is changed for any neighbor pixel that does not
02994 %  match the bordercolor member of image.
02995 %
02996 %  The format of the MagickFloodfillPaintImage method is:
02997 %
02998 %      MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
02999 %        const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
03000 %        const ssize_t x,const ssize_t y,const MagickBooleanType invert)
03001 %
03002 %  A description of each parameter follows:
03003 %
03004 %    o wand: the magick wand.
03005 %
03006 %    o fill: the floodfill color pixel wand.
03007 %
03008 %    o fuzz: By default target must match a particular pixel color
03009 %      exactly.  However, in many cases two colors may differ by a small amount.
03010 %      The fuzz member of image defines how much tolerance is acceptable to
03011 %      consider two colors as the same.  For example, set fuzz to 10 and the
03012 %      color red at intensities of 100 and 102 respectively are now interpreted
03013 %      as the same color for the purposes of the floodfill.
03014 %
03015 %    o bordercolor: the border color pixel wand.
03016 %
03017 %    o x,y: the starting location of the operation.
03018 %
03019 %    o invert: paint any pixel that does not match the target color.
03020 %
03021 */
03022 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
03023   const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
03024   const ssize_t x,const ssize_t y,const MagickBooleanType invert)
03025 {
03026   DrawInfo
03027     *draw_info;
03028 
03029   MagickBooleanType
03030     status;
03031 
03032   PixelInfo
03033     target;
03034 
03035   assert(wand != (MagickWand *) NULL);
03036   assert(wand->signature == WandSignature);
03037   if (wand->debug != MagickFalse)
03038     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03039   if (wand->images == (Image *) NULL)
03040     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03041   draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
03042   PixelGetQuantumPacket(fill,&draw_info->fill);
03043   (void) GetOneVirtualPixelInfo(wand->images,TileVirtualPixelMethod,x %
03044     wand->images->columns,y % wand->images->rows,&target,wand->exception);
03045   if (bordercolor != (PixelWand *) NULL)
03046     PixelGetMagickColor(bordercolor,&target);
03047   wand->images->fuzz=fuzz;
03048   status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert,
03049     wand->exception);
03050   draw_info=DestroyDrawInfo(draw_info);
03051   return(status);
03052 }
03053 
03054 /*
03055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03056 %                                                                             %
03057 %                                                                             %
03058 %                                                                             %
03059 %   M a g i c k F l o p I m a g e                                             %
03060 %                                                                             %
03061 %                                                                             %
03062 %                                                                             %
03063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03064 %
03065 %  MagickFlopImage() creates a horizontal mirror image by reflecting the pixels
03066 %  around the central y-axis.
03067 %
03068 %  The format of the MagickFlopImage method is:
03069 %
03070 %      MagickBooleanType MagickFlopImage(MagickWand *wand)
03071 %
03072 %  A description of each parameter follows:
03073 %
03074 %    o wand: the magick wand.
03075 %
03076 */
03077 WandExport MagickBooleanType MagickFlopImage(MagickWand *wand)
03078 {
03079   Image
03080     *flop_image;
03081 
03082   assert(wand != (MagickWand *) NULL);
03083   assert(wand->signature == WandSignature);
03084   if (wand->debug != MagickFalse)
03085     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03086   if (wand->images == (Image *) NULL)
03087     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03088   flop_image=FlopImage(wand->images,wand->exception);
03089   if (flop_image == (Image *) NULL)
03090     return(MagickFalse);
03091   ReplaceImageInList(&wand->images,flop_image);
03092   return(MagickTrue);
03093 }
03094 
03095 /*
03096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03097 %                                                                             %
03098 %                                                                             %
03099 %                                                                             %
03100 %   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                     %
03101 %                                                                             %
03102 %                                                                             %
03103 %                                                                             %
03104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03105 %
03106 %  MagickForwardFourierTransformImage() implements the discrete Fourier
03107 %  transform (DFT) of the image either as a magnitude / phase or real /
03108 %  imaginary image pair.
03109 %
03110 %  The format of the MagickForwardFourierTransformImage method is:
03111 %
03112 %      MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand,
03113 %        const MagickBooleanType magnitude)
03114 %
03115 %  A description of each parameter follows:
03116 %
03117 %    o wand: the magick wand.
03118 %
03119 %    o magnitude: if true, return as magnitude / phase pair otherwise a real /
03120 %      imaginary image pair.
03121 %
03122 */
03123 WandExport MagickBooleanType MagickForwardFourierTransformImage(
03124   MagickWand *wand,const MagickBooleanType magnitude)
03125 {
03126   Image
03127     *forward_image;
03128 
03129   assert(wand != (MagickWand *) NULL);
03130   assert(wand->signature == WandSignature);
03131   if (wand->debug != MagickFalse)
03132     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03133   if (wand->images == (Image *) NULL)
03134     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03135   forward_image=ForwardFourierTransformImage(wand->images,magnitude,
03136     wand->exception);
03137   if (forward_image == (Image *) NULL)
03138     return(MagickFalse);
03139   ReplaceImageInList(&wand->images,forward_image);
03140   return(MagickTrue);
03141 }
03142 
03143 /*
03144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03145 %                                                                             %
03146 %                                                                             %
03147 %                                                                             %
03148 %   M a g i c k F r a m e I m a g e                                           %
03149 %                                                                             %
03150 %                                                                             %
03151 %                                                                             %
03152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03153 %
03154 %  MagickFrameImage() adds a simulated three-dimensional border around the
03155 %  image.  The width and height specify the border width of the vertical and
03156 %  horizontal sides of the frame.  The inner and outer bevels indicate the
03157 %  width of the inner and outer shadows of the frame.
03158 %
03159 %  The format of the MagickFrameImage method is:
03160 %
03161 %      MagickBooleanType MagickFrameImage(MagickWand *wand,
03162 %        const PixelWand *matte_color,const size_t width,
03163 %        const size_t height,const ssize_t inner_bevel,
03164 %        const ssize_t outer_bevel,const CompositeOperator compose)
03165 %
03166 %  A description of each parameter follows:
03167 %
03168 %    o wand: the magick wand.
03169 %
03170 %    o matte_color: the frame color pixel wand.
03171 %
03172 %    o width: the border width.
03173 %
03174 %    o height: the border height.
03175 %
03176 %    o inner_bevel: the inner bevel width.
03177 %
03178 %    o outer_bevel: the outer bevel width.
03179 %
03180 %    o compose: the composite operator.
03181 %
03182 */
03183 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
03184   const PixelWand *matte_color,const size_t width,const size_t height,
03185   const ssize_t inner_bevel,const ssize_t outer_bevel,
03186   const CompositeOperator compose)
03187 {
03188   Image
03189     *frame_image;
03190 
03191   FrameInfo
03192     frame_info;
03193 
03194   assert(wand != (MagickWand *) NULL);
03195   assert(wand->signature == WandSignature);
03196   if (wand->debug != MagickFalse)
03197     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03198   if (wand->images == (Image *) NULL)
03199     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03200   (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
03201   frame_info.width=wand->images->columns+2*width;
03202   frame_info.height=wand->images->rows+2*height;
03203   frame_info.x=(ssize_t) width;
03204   frame_info.y=(ssize_t) height;
03205   frame_info.inner_bevel=inner_bevel;
03206   frame_info.outer_bevel=outer_bevel;
03207   PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
03208   frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
03209   if (frame_image == (Image *) NULL)
03210     return(MagickFalse);
03211   ReplaceImageInList(&wand->images,frame_image);
03212   return(MagickTrue);
03213 }
03214 
03215 /*
03216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03217 %                                                                             %
03218 %                                                                             %
03219 %                                                                             %
03220 %   M a g i c k F u n c t i o n I m a g e                                     %
03221 %                                                                             %
03222 %                                                                             %
03223 %                                                                             %
03224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03225 %
03226 %  MagickFunctionImage() applys an arithmetic, relational, or logical
03227 %  expression to an image.  Use these operators to lighten or darken an image,
03228 %  to increase or decrease contrast in an image, or to produce the "negative"
03229 %  of an image.
03230 %
03231 %  The format of the MagickFunctionImage method is:
03232 %
03233 %      MagickBooleanType MagickFunctionImage(MagickWand *wand,
03234 %        const MagickFunction function,const size_t number_arguments,
03235 %        const double *arguments)
03236 %
03237 %  A description of each parameter follows:
03238 %
03239 %    o wand: the magick wand.
03240 %
03241 %    o function: the image function.
03242 %
03243 %    o number_arguments: the number of function arguments.
03244 %
03245 %    o arguments: the function arguments.
03246 %
03247 */
03248 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
03249   const MagickFunction function,const size_t number_arguments,
03250   const double *arguments)
03251 {
03252   MagickBooleanType
03253     status;
03254 
03255   assert(wand != (MagickWand *) NULL);
03256   assert(wand->signature == WandSignature);
03257   if (wand->debug != MagickFalse)
03258     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03259   if (wand->images == (Image *) NULL)
03260     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03261   status=FunctionImage(wand->images,function,number_arguments,arguments,
03262     wand->exception);
03263   return(status);
03264 }
03265 
03266 /*
03267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03268 %                                                                             %
03269 %                                                                             %
03270 %                                                                             %
03271 %   M a g i c k F x I m a g e                                                 %
03272 %                                                                             %
03273 %                                                                             %
03274 %                                                                             %
03275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03276 %
03277 %  MagickFxImage() evaluate expression for each pixel in the image.
03278 %
03279 %  The format of the MagickFxImage method is:
03280 %
03281 %      MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
03282 %
03283 %  A description of each parameter follows:
03284 %
03285 %    o wand: the magick wand.
03286 %
03287 %    o expression: the expression.
03288 %
03289 */
03290 WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression)
03291 {
03292   Image
03293     *fx_image;
03294 
03295   assert(wand != (MagickWand *) NULL);
03296   assert(wand->signature == WandSignature);
03297   if (wand->debug != MagickFalse)
03298     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03299   if (wand->images == (Image *) NULL)
03300     return((MagickWand *) NULL);
03301   fx_image=FxImage(wand->images,expression,wand->exception);
03302   if (fx_image == (Image *) NULL)
03303     return((MagickWand *) NULL);
03304   return(CloneMagickWandFromImages(wand,fx_image));
03305 }
03306 
03307 /*
03308 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03309 %                                                                             %
03310 %                                                                             %
03311 %                                                                             %
03312 %   M a g i c k G a m m a I m a g e                                           %
03313 %                                                                             %
03314 %                                                                             %
03315 %                                                                             %
03316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03317 %
03318 %  MagickGammaImage() gamma-corrects an image.  The same image viewed on
03319 %  different devices will have perceptual differences in the way the image's
03320 %  intensities are represented on the screen.  Specify individual gamma levels
03321 %  for the red, green, and blue channels, or adjust all three with the gamma
03322 %  parameter.  Values typically range from 0.8 to 2.3.
03323 %
03324 %  You can also reduce the influence of a particular channel with a gamma
03325 %  value of 0.
03326 %
03327 %  The format of the MagickGammaImage method is:
03328 %
03329 %      MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma)
03330 %
03331 %  A description of each parameter follows:
03332 %
03333 %    o wand: the magick wand.
03334 %
03335 %    o level: Define the level of gamma correction.
03336 %
03337 */
03338 WandExport MagickBooleanType MagickGammaImage(MagickWand *wand,
03339   const double gamma)
03340 {
03341   MagickBooleanType
03342     status;
03343 
03344   assert(wand != (MagickWand *) NULL);
03345   assert(wand->signature == WandSignature);
03346   if (wand->debug != MagickFalse)
03347     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03348   if (wand->images == (Image *) NULL)
03349     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03350   status=GammaImage(wand->images,gamma,wand->exception);
03351   return(status);
03352 }
03353 
03354 /*
03355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03356 %                                                                             %
03357 %                                                                             %
03358 %                                                                             %
03359 %   M a g i c k G a u s s i a n B l u r I m a g e                             %
03360 %                                                                             %
03361 %                                                                             %
03362 %                                                                             %
03363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03364 %
03365 %  MagickGaussianBlurImage() blurs an image.  We convolve the image with a
03366 %  Gaussian operator of the given radius and standard deviation (sigma).
03367 %  For reasonable results, the radius should be larger than sigma.  Use a
03368 %  radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
03369 %
03370 %  The format of the MagickGaussianBlurImage method is:
03371 %
03372 %      MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
03373 %        const double radius,const double sigma)
03374 %
03375 %  A description of each parameter follows:
03376 %
03377 %    o wand: the magick wand.
03378 %
03379 %    o radius: the radius of the Gaussian, in pixels, not counting the center
03380 %      pixel.
03381 %
03382 %    o sigma: the standard deviation of the Gaussian, in pixels.
03383 %
03384 */
03385 WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand,
03386   const double radius,const double sigma)
03387 {
03388   Image
03389     *blur_image;
03390 
03391   assert(wand != (MagickWand *) NULL);
03392   assert(wand->signature == WandSignature);
03393   if (wand->debug != MagickFalse)
03394     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03395   if (wand->images == (Image *) NULL)
03396     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03397   blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception);
03398   if (blur_image == (Image *) NULL)
03399     return(MagickFalse);
03400   ReplaceImageInList(&wand->images,blur_image);
03401   return(MagickTrue);
03402 }
03403 
03404 /*
03405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03406 %                                                                             %
03407 %                                                                             %
03408 %                                                                             %
03409 %   M a g i c k G e t I m a g e                                               %
03410 %                                                                             %
03411 %                                                                             %
03412 %                                                                             %
03413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03414 %
03415 %  MagickGetImage() gets the image at the current image index.
03416 %
03417 %  The format of the MagickGetImage method is:
03418 %
03419 %      MagickWand *MagickGetImage(MagickWand *wand)
03420 %
03421 %  A description of each parameter follows:
03422 %
03423 %    o wand: the magick wand.
03424 %
03425 */
03426 WandExport MagickWand *MagickGetImage(MagickWand *wand)
03427 {
03428   Image
03429     *image;
03430 
03431   assert(wand != (MagickWand *) NULL);
03432   assert(wand->signature == WandSignature);
03433   if (wand->debug != MagickFalse)
03434     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03435   if (wand->images == (Image *) NULL)
03436     {
03437       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03438         "ContainsNoImages","`%s'",wand->name);
03439       return((MagickWand *) NULL);
03440     }
03441   image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
03442   if (image == (Image *) NULL)
03443     return((MagickWand *) NULL);
03444   return(CloneMagickWandFromImages(wand,image));
03445 }
03446 
03447 /*
03448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03449 %                                                                             %
03450 %                                                                             %
03451 %                                                                             %
03452 %   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                       %
03453 %                                                                             %
03454 %                                                                             %
03455 %                                                                             %
03456 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03457 %
03458 %  MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel
03459 %  is not activated.  That is, the image is RGB rather than RGBA or CMYK rather
03460 %  than CMYKA.
03461 %
03462 %  The format of the MagickGetImageAlphaChannel method is:
03463 %
03464 %      size_t MagickGetImageAlphaChannel(MagickWand *wand)
03465 %
03466 %  A description of each parameter follows:
03467 %
03468 %    o wand: the magick wand.
03469 %
03470 */
03471 WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand)
03472 {
03473   assert(wand != (MagickWand *) NULL);
03474   assert(wand->signature == WandSignature);
03475   if (wand->debug != MagickFalse)
03476     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03477   if (wand->images == (Image *) NULL)
03478     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03479   return(GetImageAlphaChannel(wand->images));
03480 }
03481 
03482 /*
03483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03484 %                                                                             %
03485 %                                                                             %
03486 %                                                                             %
03487 %   M a g i c k G e t I m a g e C l i p M a s k                               %
03488 %                                                                             %
03489 %                                                                             %
03490 %                                                                             %
03491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03492 %
03493 %  MagickGetImageMask() gets the image clip mask at the current image index.
03494 %
03495 %  The format of the MagickGetImageMask method is:
03496 %
03497 %      MagickWand *MagickGetImageMask(MagickWand *wand)
03498 %
03499 %  A description of each parameter follows:
03500 %
03501 %    o wand: the magick wand.
03502 %
03503 */
03504 WandExport MagickWand *MagickGetImageMask(MagickWand *wand)
03505 {
03506   Image
03507     *image;
03508 
03509   assert(wand != (MagickWand *) NULL);
03510   assert(wand->signature == WandSignature);
03511   if (wand->debug != MagickFalse)
03512     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03513   if (wand->images == (Image *) NULL)
03514     {
03515       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03516         "ContainsNoImages","`%s'",wand->name);
03517       return((MagickWand *) NULL);
03518     }
03519   image=GetImageMask(wand->images,wand->exception);
03520   if (image == (Image *) NULL)
03521     return((MagickWand *) NULL);
03522   return(CloneMagickWandFromImages(wand,image));
03523 }
03524 
03525 /*
03526 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03527 %                                                                             %
03528 %                                                                             %
03529 %                                                                             %
03530 %   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                 %
03531 %                                                                             %
03532 %                                                                             %
03533 %                                                                             %
03534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03535 %
03536 %  MagickGetImageBackgroundColor() returns the image background color.
03537 %
03538 %  The format of the MagickGetImageBackgroundColor method is:
03539 %
03540 %      MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
03541 %        PixelWand *background_color)
03542 %
03543 %  A description of each parameter follows:
03544 %
03545 %    o wand: the magick wand.
03546 %
03547 %    o background_color: Return the background color.
03548 %
03549 */
03550 WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand,
03551   PixelWand *background_color)
03552 {
03553   assert(wand != (MagickWand *) NULL);
03554   assert(wand->signature == WandSignature);
03555   if (wand->debug != MagickFalse)
03556     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03557   if (wand->images == (Image *) NULL)
03558     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03559   PixelSetPixelColor(background_color,&wand->images->background_color);
03560   return(MagickTrue);
03561 }
03562 
03563 /*
03564 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03565 %                                                                             %
03566 %                                                                             %
03567 %                                                                             %
03568 %   M a g i c k G e t I m a g e B l o b                                       %
03569 %                                                                             %
03570 %                                                                             %
03571 %                                                                             %
03572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03573 %
03574 %  MagickGetImageBlob() implements direct to memory image formats.  It returns
03575 %  the image as a blob (a formatted "file" in memory) and its length, starting
03576 %  from the current position in the image sequence.  Use MagickSetImageFormat()
03577 %  to set the format to write to the blob (GIF, JPEG,  PNG, etc.).
03578 %
03579 %  Utilize MagickResetIterator() to ensure the write is from the beginning of
03580 %  the image sequence.
03581 %
03582 %  Use MagickRelinquishMemory() to free the blob when you are done with it.
03583 %
03584 %  The format of the MagickGetImageBlob method is:
03585 %
03586 %      unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
03587 %
03588 %  A description of each parameter follows:
03589 %
03590 %    o wand: the magick wand.
03591 %
03592 %    o length: the length of the blob.
03593 %
03594 */
03595 WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length)
03596 {
03597   assert(wand != (MagickWand *) NULL);
03598   assert(wand->signature == WandSignature);
03599   if (wand->debug != MagickFalse)
03600     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03601   if (wand->images == (Image *) NULL)
03602     {
03603       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03604         "ContainsNoImages","`%s'",wand->name);
03605       return((unsigned char *) NULL);
03606     }
03607   return(ImageToBlob(wand->image_info,wand->images,length,wand->exception));
03608 }
03609 
03610 /*
03611 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03612 %                                                                             %
03613 %                                                                             %
03614 %                                                                             %
03615 %   M a g i c k G e t I m a g e s B l o b                                     %
03616 %                                                                             %
03617 %                                                                             %
03618 %                                                                             %
03619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03620 %
03621 %  MagickGetImageBlob() implements direct to memory image formats.  It
03622 %  returns the image sequence as a blob and its length.  The format of the image
03623 %  determines the format of the returned blob (GIF, JPEG,  PNG, etc.).  To
03624 %  return a different image format, use MagickSetImageFormat().
03625 %
03626 %  Note, some image formats do not permit multiple images to the same image
03627 %  stream (e.g. JPEG).  in this instance, just the first image of the
03628 %  sequence is returned as a blob.
03629 %
03630 %  The format of the MagickGetImagesBlob method is:
03631 %
03632 %      unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
03633 %
03634 %  A description of each parameter follows:
03635 %
03636 %    o wand: the magick wand.
03637 %
03638 %    o length: the length of the blob.
03639 %
03640 */
03641 WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length)
03642 {
03643   unsigned char
03644     *blob;
03645 
03646   assert(wand != (MagickWand *) NULL);
03647   assert(wand->signature == WandSignature);
03648   if (wand->debug != MagickFalse)
03649     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03650   if (wand->images == (Image *) NULL)
03651     {
03652       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03653         "ContainsNoImages","`%s'",wand->name);
03654       return((unsigned char *) NULL);
03655     }
03656   blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length,
03657     wand->exception);
03658   return(blob);
03659 }
03660 
03661 /*
03662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03663 %                                                                             %
03664 %                                                                             %
03665 %                                                                             %
03666 %   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                         %
03667 %                                                                             %
03668 %                                                                             %
03669 %                                                                             %
03670 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03671 %
03672 %  MagickGetImageBluePrimary() returns the chromaticy blue primary point for the
03673 %  image.
03674 %
03675 %  The format of the MagickGetImageBluePrimary method is:
03676 %
03677 %      MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x,
03678 %        double *y)
03679 %
03680 %  A description of each parameter follows:
03681 %
03682 %    o wand: the magick wand.
03683 %
03684 %    o x: the chromaticity blue primary x-point.
03685 %
03686 %    o y: the chromaticity blue primary y-point.
03687 %
03688 */
03689 WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,
03690   double *x,double *y)
03691 {
03692   assert(wand != (MagickWand *) NULL);
03693   assert(wand->signature == WandSignature);
03694   if (wand->debug != MagickFalse)
03695     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03696   if (wand->images == (Image *) NULL)
03697     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03698   *x=wand->images->chromaticity.blue_primary.x;
03699   *y=wand->images->chromaticity.blue_primary.y;
03700   return(MagickTrue);
03701 }
03702 
03703 /*
03704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03705 %                                                                             %
03706 %                                                                             %
03707 %                                                                             %
03708 %   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                         %
03709 %                                                                             %
03710 %                                                                             %
03711 %                                                                             %
03712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03713 %
03714 %  MagickGetImageBorderColor() returns the image border color.
03715 %
03716 %  The format of the MagickGetImageBorderColor method is:
03717 %
03718 %      MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
03719 %        PixelWand *border_color)
03720 %
03721 %  A description of each parameter follows:
03722 %
03723 %    o wand: the magick wand.
03724 %
03725 %    o border_color: Return the border color.
03726 %
03727 */
03728 WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
03729   PixelWand *border_color)
03730 {
03731   assert(wand != (MagickWand *) NULL);
03732   assert(wand->signature == WandSignature);
03733   if (wand->debug != MagickFalse)
03734     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03735   if (wand->images == (Image *) NULL)
03736     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03737   PixelSetPixelColor(border_color,&wand->images->border_color);
03738   return(MagickTrue);
03739 }
03740 
03741 /*
03742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03743 %                                                                             %
03744 %                                                                             %
03745 %                                                                             %
03746 %   M a g i c k G e t I m a g e F e a t u r e s                               %
03747 %                                                                             %
03748 %                                                                             %
03749 %                                                                             %
03750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03751 %
03752 %  MagickGetImageFeatures() returns features for each channel in the
03753 %  image in each of four directions (horizontal, vertical, left and right
03754 %  diagonals) for the specified distance.  The features include the angular
03755 %  second moment, contrast, correlation, sum of squares: variance, inverse
03756 %  difference moment, sum average, sum varience, sum entropy, entropy,
03757 %  difference variance, difference entropy, information measures of
03758 %  correlation 1, information measures of correlation 2, and maximum
03759 %  correlation coefficient.  You can access the red channel contrast, for
03760 %  example, like this:
03761 %
03762 %      channel_features=MagickGetImageFeatures(wand,1);
03763 %      contrast=channel_features[RedPixelChannel].contrast[0];
03764 %
03765 %  Use MagickRelinquishMemory() to free the statistics buffer.
03766 %
03767 %  The format of the MagickGetImageFeatures method is:
03768 %
03769 %      ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
03770 %        const size_t distance)
03771 %
03772 %  A description of each parameter follows:
03773 %
03774 %    o wand: the magick wand.
03775 %
03776 %    o distance: the distance.
03777 %
03778 */
03779 WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand,
03780   const size_t distance)
03781 {
03782   assert(wand != (MagickWand *) NULL);
03783   assert(wand->signature == WandSignature);
03784   if (wand->debug != MagickFalse)
03785     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03786   if (wand->images == (Image *) NULL)
03787     {
03788       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03789         "ContainsNoImages","`%s'",wand->name);
03790       return((ChannelFeatures *) NULL);
03791     }
03792   return(GetImageFeatures(wand->images,distance,wand->exception));
03793 }
03794 
03795 /*
03796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03797 %                                                                             %
03798 %                                                                             %
03799 %                                                                             %
03800 %   M a g i c k G e t I m a g e K u r t o s i s                               %
03801 %                                                                             %
03802 %                                                                             %
03803 %                                                                             %
03804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03805 %
03806 %  MagickGetImageKurtosis() gets the kurtosis and skewness of one or
03807 %  more image channels.
03808 %
03809 %  The format of the MagickGetImageKurtosis method is:
03810 %
03811 %      MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
03812 %        double *kurtosis,double *skewness)
03813 %
03814 %  A description of each parameter follows:
03815 %
03816 %    o wand: the magick wand.
03817 %
03818 %    o kurtosis:  The kurtosis for the specified channel(s).
03819 %
03820 %    o skewness:  The skewness for the specified channel(s).
03821 %
03822 */
03823 WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand,
03824   double *kurtosis,double *skewness)
03825 {
03826   MagickBooleanType
03827     status;
03828 
03829   assert(wand != (MagickWand *) NULL);
03830   assert(wand->signature == WandSignature);
03831   if (wand->debug != MagickFalse)
03832     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03833   if (wand->images == (Image *) NULL)
03834     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03835   status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception);
03836   return(status);
03837 }
03838 
03839 /*
03840 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03841 %                                                                             %
03842 %                                                                             %
03843 %                                                                             %
03844 %   M a g i c k G e t I m a g e M e a n                                       %
03845 %                                                                             %
03846 %                                                                             %
03847 %                                                                             %
03848 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03849 %
03850 %  MagickGetImageMean() gets the mean and standard deviation of one or more
03851 %  image channels.
03852 %
03853 %  The format of the MagickGetImageMean method is:
03854 %
03855 %      MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
03856 %        double *standard_deviation)
03857 %
03858 %  A description of each parameter follows:
03859 %
03860 %    o wand: the magick wand.
03861 %
03862 %    o channel: the image channel(s).
03863 %
03864 %    o mean:  The mean pixel value for the specified channel(s).
03865 %
03866 %    o standard_deviation:  The standard deviation for the specified channel(s).
03867 %
03868 */
03869 WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean,
03870   double *standard_deviation)
03871 {
03872   MagickBooleanType
03873     status;
03874 
03875   assert(wand != (MagickWand *) NULL);
03876   assert(wand->signature == WandSignature);
03877   if (wand->debug != MagickFalse)
03878     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03879   if (wand->images == (Image *) NULL)
03880     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03881   status=GetImageMean(wand->images,mean,standard_deviation,wand->exception);
03882   return(status);
03883 }
03884 
03885 /*
03886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03887 %                                                                             %
03888 %                                                                             %
03889 %                                                                             %
03890 %   M a g i c k G e t I m a g e R a n g e                                     %
03891 %                                                                             %
03892 %                                                                             %
03893 %                                                                             %
03894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03895 %
03896 %  MagickGetImageRange() gets the range for one or more image channels.
03897 %
03898 %  The format of the MagickGetImageRange method is:
03899 %
03900 %      MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
03901 %        double *maxima)
03902 %
03903 %  A description of each parameter follows:
03904 %
03905 %    o wand: the magick wand.
03906 %
03907 %    o minima:  The minimum pixel value for the specified channel(s).
03908 %
03909 %    o maxima:  The maximum pixel value for the specified channel(s).
03910 %
03911 */
03912 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
03913   double *minima,double *maxima)
03914 {
03915   MagickBooleanType
03916     status;
03917 
03918   assert(wand != (MagickWand *) NULL);
03919   assert(wand->signature == WandSignature);
03920   if (wand->debug != MagickFalse)
03921     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03922   if (wand->images == (Image *) NULL)
03923     ThrowWandException(WandError,"ContainsNoImages",wand->name);
03924   status=GetImageRange(wand->images,minima,maxima,wand->exception);
03925   return(status);
03926 }
03927 
03928 /*
03929 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03930 %                                                                             %
03931 %                                                                             %
03932 %                                                                             %
03933 %   M a g i c k G e t I m a g e S t a t i s t i c s                           %
03934 %                                                                             %
03935 %                                                                             %
03936 %                                                                             %
03937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03938 %
03939 %  MagickGetImageStatistics() returns statistics for each channel in the
03940 %  image.  The statistics include the channel depth, its minima and
03941 %  maxima, the mean, the standard deviation, the kurtosis and the skewness.
03942 %  You can access the red channel mean, for example, like this:
03943 %
03944 %      channel_statistics=MagickGetImageStatistics(wand);
03945 %      red_mean=channel_statistics[RedPixelChannel].mean;
03946 %
03947 %  Use MagickRelinquishMemory() to free the statistics buffer.
03948 %
03949 %  The format of the MagickGetImageStatistics method is:
03950 %
03951 %      ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
03952 %
03953 %  A description of each parameter follows:
03954 %
03955 %    o wand: the magick wand.
03956 %
03957 */
03958 WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand)
03959 {
03960   assert(wand != (MagickWand *) NULL);
03961   assert(wand->signature == WandSignature);
03962   if (wand->debug != MagickFalse)
03963     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
03964   if (wand->images == (Image *) NULL)
03965     {
03966       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
03967         "ContainsNoImages","`%s'",wand->name);
03968       return((ChannelStatistics *) NULL);
03969     }
03970   return(GetImageStatistics(wand->images,wand->exception));
03971 }
03972 
03973 /*
03974 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03975 %                                                                             %
03976 %                                                                             %
03977 %                                                                             %
03978 %   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                     %
03979 %                                                                             %
03980 %                                                                             %
03981 %                                                                             %
03982 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03983 %
03984 %  MagickGetImageColormapColor() returns the color of the specified colormap
03985 %  index.
03986 %
03987 %  The format of the MagickGetImageColormapColor method is:
03988 %
03989 %      MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
03990 %        const size_t index,PixelWand *color)
03991 %
03992 %  A description of each parameter follows:
03993 %
03994 %    o wand: the magick wand.
03995 %
03996 %    o index: the offset into the image colormap.
03997 %
03998 %    o color: Return the colormap color in this wand.
03999 %
04000 */
04001 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
04002   const size_t index,PixelWand *color)
04003 {
04004   assert(wand != (MagickWand *) NULL);
04005   assert(wand->signature == WandSignature);
04006   if (wand->debug != MagickFalse)
04007     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04008   if (wand->images == (Image *) NULL)
04009     ThrowWandException(WandError,"ContainsNoImages",wand->name);
04010   if ((wand->images->colormap == (PixelInfo *) NULL) ||
04011       (index >= wand->images->colors))
04012     {
04013       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04014         "InvalidColormapIndex","`%s'",wand->name);
04015       return(MagickFalse);
04016     }
04017   PixelSetPixelColor(color,wand->images->colormap+index);
04018   return(MagickTrue);
04019 }
04020 
04021 /*
04022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04023 %                                                                             %
04024 %                                                                             %
04025 %                                                                             %
04026 %   M a g i c k G e t I m a g e C o l o r s                                   %
04027 %                                                                             %
04028 %                                                                             %
04029 %                                                                             %
04030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04031 %
04032 %  MagickGetImageColors() gets the number of unique colors in the image.
04033 %
04034 %  The format of the MagickGetImageColors method is:
04035 %
04036 %      size_t MagickGetImageColors(MagickWand *wand)
04037 %
04038 %  A description of each parameter follows:
04039 %
04040 %    o wand: the magick wand.
04041 %
04042 */
04043 WandExport size_t MagickGetImageColors(MagickWand *wand)
04044 {
04045   assert(wand != (MagickWand *) NULL);
04046   assert(wand->signature == WandSignature);
04047   if (wand->debug != MagickFalse)
04048     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04049   if (wand->images == (Image *) NULL)
04050     {
04051       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04052         "ContainsNoImages","`%s'",wand->name);
04053       return(0);
04054     }
04055   return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception));
04056 }
04057 
04058 /*
04059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04060 %                                                                             %
04061 %                                                                             %
04062 %                                                                             %
04063 %   M a g i c k G e t I m a g e C o l o r s p a c e                           %
04064 %                                                                             %
04065 %                                                                             %
04066 %                                                                             %
04067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04068 %
04069 %  MagickGetImageColorspace() gets the image colorspace.
04070 %
04071 %  The format of the MagickGetImageColorspace method is:
04072 %
04073 %      ColorspaceType MagickGetImageColorspace(MagickWand *wand)
04074 %
04075 %  A description of each parameter follows:
04076 %
04077 %    o wand: the magick wand.
04078 %
04079 */
04080 WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand)
04081 {
04082   assert(wand != (MagickWand *) NULL);
04083   assert(wand->signature == WandSignature);
04084   if (wand->debug != MagickFalse)
04085     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04086   if (wand->images == (Image *) NULL)
04087     {
04088       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04089         "ContainsNoImages","`%s'",wand->name);
04090       return(UndefinedColorspace);
04091     }
04092   return(wand->images->colorspace);
04093 }
04094 
04095 /*
04096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04097 %                                                                             %
04098 %                                                                             %
04099 %                                                                             %
04100 %   M a g i c k G e t I m a g e C o m p o s e                                 %
04101 %                                                                             %
04102 %                                                                             %
04103 %                                                                             %
04104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04105 %
04106 %  MagickGetImageCompose() returns the composite operator associated with the
04107 %  image.
04108 %
04109 %  The format of the MagickGetImageCompose method is:
04110 %
04111 %      CompositeOperator MagickGetImageCompose(MagickWand *wand)
04112 %
04113 %  A description of each parameter follows:
04114 %
04115 %    o wand: the magick wand.
04116 %
04117 */
04118 WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand)
04119 {
04120   assert(wand != (MagickWand *) NULL);
04121   assert(wand->signature == WandSignature);
04122   if (wand->debug != MagickFalse)
04123     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04124   if (wand->images == (Image *) NULL)
04125     {
04126       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04127         "ContainsNoImages","`%s'",wand->name);
04128       return(UndefinedCompositeOp);
04129     }
04130   return(wand->images->compose);
04131 }
04132 
04133 /*
04134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04135 %                                                                             %
04136 %                                                                             %
04137 %                                                                             %
04138 %   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                         %
04139 %                                                                             %
04140 %                                                                             %
04141 %                                                                             %
04142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04143 %
04144 %  MagickGetImageCompression() gets the image compression.
04145 %
04146 %  The format of the MagickGetImageCompression method is:
04147 %
04148 %      CompressionType MagickGetImageCompression(MagickWand *wand)
04149 %
04150 %  A description of each parameter follows:
04151 %
04152 %    o wand: the magick wand.
04153 %
04154 */
04155 WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
04156 {
04157   assert(wand != (MagickWand *) NULL);
04158   assert(wand->signature == WandSignature);
04159   if (wand->debug != MagickFalse)
04160     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04161   if (wand->images == (Image *) NULL)
04162     {
04163       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04164         "ContainsNoImages","`%s'",wand->name);
04165       return(UndefinedCompression);
04166     }
04167   return(wand->images->compression);
04168 }
04169 
04170 /*
04171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04172 %                                                                             %
04173 %                                                                             %
04174 %                                                                             %
04175 %   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           %
04176 %                                                                             %
04177 %                                                                             %
04178 %                                                                             %
04179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04180 %
04181 %  MagickGetImageCompression() gets the image compression quality.
04182 %
04183 %  The format of the MagickGetImageCompression method is:
04184 %
04185 %      size_t MagickGetImageCompression(MagickWand *wand)
04186 %
04187 %  A description of each parameter follows:
04188 %
04189 %    o wand: the magick wand.
04190 %
04191 */
04192 WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
04193 {
04194   assert(wand != (MagickWand *) NULL);
04195   assert(wand->signature == WandSignature);
04196   if (wand->debug != MagickFalse)
04197     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04198   if (wand->images == (Image *) NULL)
04199     {
04200       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04201         "ContainsNoImages","`%s'",wand->name);
04202       return(0UL);
04203     }
04204   return(wand->images->quality);
04205 }
04206 
04207 /*
04208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04209 %                                                                             %
04210 %                                                                             %
04211 %                                                                             %
04212 %   M a g i c k G e t I m a g e D e l a y                                     %
04213 %                                                                             %
04214 %                                                                             %
04215 %                                                                             %
04216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04217 %
04218 %  MagickGetImageDelay() gets the image delay.
04219 %
04220 %  The format of the MagickGetImageDelay method is:
04221 %
04222 %      size_t MagickGetImageDelay(MagickWand *wand)
04223 %
04224 %  A description of each parameter follows:
04225 %
04226 %    o wand: the magick wand.
04227 %
04228 */
04229 WandExport size_t MagickGetImageDelay(MagickWand *wand)
04230 {
04231   assert(wand != (MagickWand *) NULL);
04232   assert(wand->signature == WandSignature);
04233   if (wand->debug != MagickFalse)
04234     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04235   if (wand->images == (Image *) NULL)
04236     ThrowWandException(WandError,"ContainsNoImages",wand->name);
04237   return(wand->images->delay);
04238 }
04239 
04240 /*
04241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04242 %                                                                             %
04243 %                                                                             %
04244 %                                                                             %
04245 %   M a g i c k G e t I m a g e D e p t h                                     %
04246 %                                                                             %
04247 %                                                                             %
04248 %                                                                             %
04249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04250 %
04251 %  MagickGetImageDepth() gets the image depth.
04252 %
04253 %  The format of the MagickGetImageDepth method is:
04254 %
04255 %      size_t MagickGetImageDepth(MagickWand *wand)
04256 %
04257 %  A description of each parameter follows:
04258 %
04259 %    o wand: the magick wand.
04260 %
04261 */
04262 WandExport size_t MagickGetImageDepth(MagickWand *wand)
04263 {
04264   assert(wand != (MagickWand *) NULL);
04265   assert(wand->signature == WandSignature);
04266   if (wand->debug != MagickFalse)
04267     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04268   if (wand->images == (Image *) NULL)
04269     ThrowWandException(WandError,"ContainsNoImages",wand->name);
04270   return(wand->images->depth);
04271 }
04272 
04273 /*
04274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04275 %                                                                             %
04276 %                                                                             %
04277 %                                                                             %
04278 %   M a g i c k G e t I m a g e D i s p o s e                                 %
04279 %                                                                             %
04280 %                                                                             %
04281 %                                                                             %
04282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04283 %
04284 %  MagickGetImageDispose() gets the image disposal method.
04285 %
04286 %  The format of the MagickGetImageDispose method is:
04287 %
04288 %      DisposeType MagickGetImageDispose(MagickWand *wand)
04289 %
04290 %  A description of each parameter follows:
04291 %
04292 %    o wand: the magick wand.
04293 %
04294 */
04295 WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
04296 {
04297   assert(wand != (MagickWand *) NULL);
04298   assert(wand->signature == WandSignature);
04299   if (wand->debug != MagickFalse)
04300     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04301   if (wand->images == (Image *) NULL)
04302     {
04303       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04304         "ContainsNoImages","`%s'",wand->name);
04305       return(UndefinedDispose);
04306     }
04307   return((DisposeType) wand->images->dispose);
04308 }
04309 
04310 /*
04311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04312 %                                                                             %
04313 %                                                                             %
04314 %                                                                             %
04315 %   M a g i c k G e t I m a g e D i s t o r t i o n                           %
04316 %                                                                             %
04317 %                                                                             %
04318 %                                                                             %
04319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04320 %
04321 %  MagickGetImageDistortion() compares an image to a reconstructed image and
04322 %  returns the specified distortion metric.
04323 %
04324 %  The format of the MagickGetImageDistortion method is:
04325 %
04326 %      MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
04327 %        const MagickWand *reference,const MetricType metric,
04328 %        double *distortion)
04329 %
04330 %  A description of each parameter follows:
04331 %
04332 %    o wand: the magick wand.
04333 %
04334 %    o reference: the reference wand.
04335 %
04336 %    o metric: the metric.
04337 %
04338 %    o distortion: the computed distortion between the images.
04339 %
04340 */
04341 WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
04342   const MagickWand *reference,const MetricType metric,double *distortion)
04343 {
04344   MagickBooleanType
04345     status;
04346 
04347   assert(wand != (MagickWand *) NULL);
04348   assert(wand->signature == WandSignature);
04349   if (wand->debug != MagickFalse)
04350     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04351   if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
04352     ThrowWandException(WandError,"ContainsNoImages",wand->name);
04353   status=GetImageDistortion(wand->images,reference->images,metric,distortion,
04354     wand->exception);
04355   return(status);
04356 }
04357 
04358 /*
04359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04360 %                                                                             %
04361 %                                                                             %
04362 %                                                                             %
04363 %   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                         %
04364 %                                                                             %
04365 %                                                                             %
04366 %                                                                             %
04367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04368 %
04369 %  MagickGetImageDistortions() compares one or more pixel channels of an
04370 %  image to a reconstructed image and returns the specified distortion metrics.
04371 %
04372 %  Use MagickRelinquishMemory() to free the metrics when you are done with them.
04373 %
04374 %  The format of the MagickGetImageDistortion method is:
04375 %
04376 %      double *MagickGetImageDistortion(MagickWand *wand,
04377 %        const MagickWand *reference,const MetricType metric)
04378 %
04379 %  A description of each parameter follows:
04380 %
04381 %    o wand: the magick wand.
04382 %
04383 %    o reference: the reference wand.
04384 %
04385 %    o metric: the metric.
04386 %
04387 */
04388 WandExport double *MagickGetImageDistortions(MagickWand *wand,
04389   const MagickWand *reference,const MetricType metric)
04390 {
04391   double
04392     *channel_distortion;
04393 
04394   assert(wand != (MagickWand *) NULL);
04395   assert(wand->signature == WandSignature);
04396   if (wand->debug != MagickFalse)
04397     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04398   assert(reference != (MagickWand *) NULL);
04399   assert(reference->signature == WandSignature);
04400   if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
04401     {
04402       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04403         "ContainsNoImages","`%s'",wand->name);
04404       return((double *) NULL);
04405     }
04406   channel_distortion=GetImageDistortions(wand->images,reference->images,
04407     metric,wand->exception);
04408   return(channel_distortion);
04409 }
04410 
04411 /*
04412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04413 %                                                                             %
04414 %                                                                             %
04415 %                                                                             %
04416 %   M a g i c k G e t I m a g e F i l e n a m e                               %
04417 %                                                                             %
04418 %                                                                             %
04419 %                                                                             %
04420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04421 %
04422 %  MagickGetImageFilename() returns the filename of a particular image in a
04423 %  sequence.
04424 %
04425 %  The format of the MagickGetImageFilename method is:
04426 %
04427 %      char *MagickGetImageFilename(MagickWand *wand)
04428 %
04429 %  A description of each parameter follows:
04430 %
04431 %    o wand: the magick wand.
04432 %
04433 */
04434 WandExport char *MagickGetImageFilename(MagickWand *wand)
04435 {
04436   assert(wand != (MagickWand *) NULL);
04437   assert(wand->signature == WandSignature);
04438   if (wand->debug != MagickFalse)
04439     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04440   if (wand->images == (Image *) NULL)
04441     {
04442       (void) ThrowMagickException(wand->exception,GetMagickModule(),Wa