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