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-2010 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 %  A description of each parameter follows:
04483 %
04484 %    o wand: the magick wand.
04485 %
04486 */
04487 WandExport char *MagickGetImageFormat(MagickWand *wand)
04488 {
04489   assert(wand != (MagickWand *) NULL);
04490   assert(wand->signature == WandSignature);
04491   if (wand->debug != MagickFalse)
04492     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04493   if (wand->images == (Image *) NULL)
04494     {
04495       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04496         "ContainsNoImages","`%s'",wand->name);
04497       return((char *) NULL);
04498     }
04499   return(AcquireString(wand->images->magick));
04500 }
04501 
04502 /*
04503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04504 %                                                                             %
04505 %                                                                             %
04506 %                                                                             %
04507 %   M a g i c k G e t I m a g e F u z z                                       %
04508 %                                                                             %
04509 %                                                                             %
04510 %                                                                             %
04511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04512 %
04513 %  MagickGetImageFuzz() gets the image fuzz.
04514 %
04515 %  The format of the MagickGetImageFuzz method is:
04516 %
04517 %      double MagickGetImageFuzz(MagickWand *wand)
04518 %
04519 %  A description of each parameter follows:
04520 %
04521 %    o wand: the magick wand.
04522 %
04523 */
04524 WandExport double MagickGetImageFuzz(MagickWand *wand)
04525 {
04526   assert(wand != (MagickWand *) NULL);
04527   assert(wand->signature == WandSignature);
04528   if (wand->debug != MagickFalse)
04529     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04530   if (wand->images == (Image *) NULL)
04531     {
04532       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04533         "ContainsNoImages","`%s'",wand->name);
04534       return(0.0);
04535     }
04536   return(wand->images->fuzz);
04537 }
04538 
04539 /*
04540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04541 %                                                                             %
04542 %                                                                             %
04543 %                                                                             %
04544 %   M a g i c k G e t I m a g e G a m m a                                     %
04545 %                                                                             %
04546 %                                                                             %
04547 %                                                                             %
04548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04549 %
04550 %  MagickGetImageGamma() gets the image gamma.
04551 %
04552 %  The format of the MagickGetImageGamma method is:
04553 %
04554 %      double MagickGetImageGamma(MagickWand *wand)
04555 %
04556 %  A description of each parameter follows:
04557 %
04558 %    o wand: the magick wand.
04559 %
04560 */
04561 WandExport double MagickGetImageGamma(MagickWand *wand)
04562 {
04563   assert(wand != (MagickWand *) NULL);
04564   assert(wand->signature == WandSignature);
04565   if (wand->debug != MagickFalse)
04566     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04567   if (wand->images == (Image *) NULL)
04568     {
04569       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04570         "ContainsNoImages","`%s'",wand->name);
04571       return(0.0);
04572     }
04573   return(wand->images->gamma);
04574 }
04575 
04576 /*
04577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04578 %                                                                             %
04579 %                                                                             %
04580 %                                                                             %
04581 %   M a g i c k G e t I m a g e I n t e r l a c e S c h e m e                 %
04582 %                                                                             %
04583 %                                                                             %
04584 %                                                                             %
04585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04586 %
04587 %  MagickGetImageGravity() gets the image gravity.
04588 %
04589 %  The format of the MagickGetImageGravity method is:
04590 %
04591 %      GravityType MagickGetImageGravity(MagickWand *wand)
04592 %
04593 %  A description of each parameter follows:
04594 %
04595 %    o wand: the magick wand.
04596 %
04597 */
04598 WandExport GravityType MagickGetImageGravity(MagickWand *wand)
04599 {
04600   assert(wand != (MagickWand *) NULL);
04601   assert(wand->signature == WandSignature);
04602   if (wand->debug != MagickFalse)
04603     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04604   if (wand->images == (Image *) NULL)
04605     {
04606       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04607         "ContainsNoImages","`%s'",wand->name);
04608       return(UndefinedGravity);
04609     }
04610   return(wand->images->gravity);
04611 }
04612 
04613 /*
04614 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04615 %                                                                             %
04616 %                                                                             %
04617 %                                                                             %
04618 %   M a g i c k G e t I m a g e G r e e n P r i m a r y                       %
04619 %                                                                             %
04620 %                                                                             %
04621 %                                                                             %
04622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04623 %
04624 %  MagickGetImageGreenPrimary() returns the chromaticy green primary point.
04625 %
04626 %  The format of the MagickGetImageGreenPrimary method is:
04627 %
04628 %      MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x,
04629 %        double *y)
04630 %
04631 %  A description of each parameter follows:
04632 %
04633 %    o wand: the magick wand.
04634 %
04635 %    o x: the chromaticity green primary x-point.
04636 %
04637 %    o y: the chromaticity green primary y-point.
04638 %
04639 */
04640 WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
04641   double *x,double *y)
04642 {
04643   assert(wand != (MagickWand *) NULL);
04644   assert(wand->signature == WandSignature);
04645   if (wand->debug != MagickFalse)
04646     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04647   if (wand->images == (Image *) NULL)
04648     ThrowWandException(WandError,"ContainsNoImages",wand->name);
04649   *x=wand->images->chromaticity.green_primary.x;
04650   *y=wand->images->chromaticity.green_primary.y;
04651   return(MagickTrue);
04652 }
04653 
04654 /*
04655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04656 %                                                                             %
04657 %                                                                             %
04658 %                                                                             %
04659 %   M a g i c k G e t I m a g e H e i g h t                                   %
04660 %                                                                             %
04661 %                                                                             %
04662 %                                                                             %
04663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04664 %
04665 %  MagickGetImageHeight() returns the image height.
04666 %
04667 %  The format of the MagickGetImageHeight method is:
04668 %
04669 %      unsigned long MagickGetImageHeight(MagickWand *wand)
04670 %
04671 %  A description of each parameter follows:
04672 %
04673 %    o wand: the magick wand.
04674 %
04675 */
04676 WandExport unsigned long MagickGetImageHeight(MagickWand *wand)
04677 {
04678   assert(wand != (MagickWand *) NULL);
04679   assert(wand->signature == WandSignature);
04680   if (wand->debug != MagickFalse)
04681     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04682   if (wand->images == (Image *) NULL)
04683     ThrowWandException(WandError,"ContainsNoImages",wand->name);
04684   return(wand->images->rows);
04685 }
04686 
04687 /*
04688 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04689 %                                                                             %
04690 %                                                                             %
04691 %                                                                             %
04692 %   M a g i c k G e t I m a g e H i s t o g r a m                             %
04693 %                                                                             %
04694 %                                                                             %
04695 %                                                                             %
04696 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04697 %
04698 %  MagickGetImageHistogram() returns the image histogram as an array of
04699 %  PixelWand wands.
04700 %
04701 %  The format of the MagickGetImageHistogram method is:
04702 %
04703 %      PixelWand **MagickGetImageHistogram(MagickWand *wand,
04704 %        unsigned long *number_colors)
04705 %
04706 %  A description of each parameter follows:
04707 %
04708 %    o wand: the magick wand.
04709 %
04710 %    o number_colors: the number of unique colors in the image and the number
04711 %      of pixel wands returned.
04712 %
04713 */
04714 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
04715   unsigned long *number_colors)
04716 {
04717   ColorPacket
04718     *histogram;
04719 
04720   PixelWand
04721     **pixel_wands;
04722 
04723   register long
04724     i;
04725 
04726   assert(wand != (MagickWand *) NULL);
04727   assert(wand->signature == WandSignature);
04728   if (wand->debug != MagickFalse)
04729     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04730   if (wand->images == (Image *) NULL)
04731     {
04732       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04733         "ContainsNoImages","`%s'",wand->name);
04734       return((PixelWand **) NULL);
04735     }
04736   histogram=GetImageHistogram(wand->images,number_colors,wand->exception);
04737   if (histogram == (ColorPacket *) NULL)
04738     return((PixelWand **) NULL);
04739   pixel_wands=NewPixelWands(*number_colors);
04740   for (i=0; i < (long) *number_colors; i++)
04741   {
04742     PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel);
04743     PixelSetIndex(pixel_wands[i],histogram[i].index);
04744     PixelSetColorCount(pixel_wands[i],(unsigned long) histogram[i].count);
04745   }
04746   histogram=(ColorPacket *) RelinquishMagickMemory(histogram);
04747   return(pixel_wands);
04748 }
04749 
04750 /*
04751 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04752 %                                                                             %
04753 %                                                                             %
04754 %                                                                             %
04755 %   M a g i c k G e t I m a g e I n t e r l a c e S c h e m e                 %
04756 %                                                                             %
04757 %                                                                             %
04758 %                                                                             %
04759 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04760 %
04761 %  MagickGetImageInterlaceScheme() gets the image interlace scheme.
04762 %
04763 %  The format of the MagickGetImageInterlaceScheme method is:
04764 %
04765 %      InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
04766 %
04767 %  A description of each parameter follows:
04768 %
04769 %    o wand: the magick wand.
04770 %
04771 */
04772 WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand)
04773 {
04774   assert(wand != (MagickWand *) NULL);
04775   assert(wand->signature == WandSignature);
04776   if (wand->debug != MagickFalse)
04777     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04778   if (wand->images == (Image *) NULL)
04779     {
04780       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04781         "ContainsNoImages","`%s'",wand->name);
04782       return(UndefinedInterlace);
04783     }
04784   return(wand->images->interlace);
04785 }
04786 
04787 /*
04788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04789 %                                                                             %
04790 %                                                                             %
04791 %                                                                             %
04792 %   M a g i c k G e t I m a g e I n t e r p o l a t e M e t h o d             %
04793 %                                                                             %
04794 %                                                                             %
04795 %                                                                             %
04796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04797 %
04798 %  MagickGetImageInterpolateMethod() returns the interpolation method for the
04799 %  sepcified image.
04800 %
04801 %  The format of the MagickGetImageInterpolateMethod method is:
04802 %
04803 %      InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand)
04804 %
04805 %  A description of each parameter follows:
04806 %
04807 %    o wand: the magick wand.
04808 %
04809 */
04810 WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
04811   MagickWand *wand)
04812 {
04813   assert(wand != (MagickWand *) NULL);
04814   assert(wand->signature == WandSignature);
04815   if (wand->debug != MagickFalse)
04816     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04817   if (wand->images == (Image *) NULL)
04818     {
04819       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04820         "ContainsNoImages","`%s'",wand->name);
04821       return(UndefinedInterpolatePixel);
04822     }
04823   return(wand->images->interpolate);
04824 }
04825 
04826 /*
04827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04828 %                                                                             %
04829 %                                                                             %
04830 %                                                                             %
04831 %   M a g i c k G e t I m a g e I t e r a t i o n s                           %
04832 %                                                                             %
04833 %                                                                             %
04834 %                                                                             %
04835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04836 %
04837 %  MagickGetImageIterations() gets the image iterations.
04838 %
04839 %  The format of the MagickGetImageIterations method is:
04840 %
04841 %      unsigned long MagickGetImageIterations(MagickWand *wand)
04842 %
04843 %  A description of each parameter follows:
04844 %
04845 %    o wand: the magick wand.
04846 %
04847 */
04848 WandExport unsigned long MagickGetImageIterations(MagickWand *wand)
04849 {
04850   assert(wand != (MagickWand *) NULL);
04851   assert(wand->signature == WandSignature);
04852   if (wand->debug != MagickFalse)
04853     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04854   if (wand->images == (Image *) NULL)
04855     ThrowWandException(WandError,"ContainsNoImages",wand->name);
04856   return(wand->images->iterations);
04857 }
04858 
04859 /*
04860 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04861 %                                                                             %
04862 %                                                                             %
04863 %                                                                             %
04864 %   M a g i c k G e t I m a g e L e n g t h                                   %
04865 %                                                                             %
04866 %                                                                             %
04867 %                                                                             %
04868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04869 %
04870 %  MagickGetImageLength() returns the image length in bytes.
04871 %
04872 %  The format of the MagickGetImageLength method is:
04873 %
04874 %      MagickBooleanType MagickGetImageLength(MagickWand *wand,
04875 %        MagickSizeType *length)
04876 %
04877 %  A description of each parameter follows:
04878 %
04879 %    o wand: the magick wand.
04880 %
04881 %    o length: the image length in bytes.
04882 %
04883 */
04884 WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand,
04885   MagickSizeType *length)
04886 {
04887   assert(wand != (MagickWand *) NULL);
04888   assert(wand->signature == WandSignature);
04889   if (wand->debug != MagickFalse)
04890     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04891   if (wand->images == (Image *) NULL)
04892     ThrowWandException(WandError,"ContainsNoImages",wand->name);
04893   *length=GetBlobSize(wand->images);
04894   return(MagickTrue);
04895 }
04896 
04897 /*
04898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04899 %                                                                             %
04900 %                                                                             %
04901 %                                                                             %
04902 %   M a g i c k G e t I m a g e M a t t e C o l o r                           %
04903 %                                                                             %
04904 %                                                                             %
04905 %                                                                             %
04906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04907 %
04908 %  MagickGetImageMatteColor() returns the image matte color.
04909 %
04910 %  The format of the MagickGetImageMatteColor method is:
04911 %
04912 %      MagickBooleanType MagickGetImagematteColor(MagickWand *wand,
04913 %        PixelWand *matte_color)
04914 %
04915 %  A description of each parameter follows:
04916 %
04917 %    o wand: the magick wand.
04918 %
04919 %    o matte_color: Return the matte color.
04920 %
04921 */
04922 WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
04923   PixelWand *matte_color)
04924 {
04925   assert(wand != (MagickWand *) NULL);
04926   assert(wand->signature == WandSignature);
04927   if (wand->debug != MagickFalse)
04928     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04929   if (wand->images == (Image *) NULL)
04930     ThrowWandException(WandError,"ContainsNoImages",wand->name);
04931   PixelSetQuantumColor(matte_color,&wand->images->matte_color);
04932   return(MagickTrue);
04933 }
04934 
04935 /*
04936 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04937 %                                                                             %
04938 %                                                                             %
04939 %                                                                             %
04940 %   M a g i c k G e t I m a g e O r i e n t a t i o n                         %
04941 %                                                                             %
04942 %                                                                             %
04943 %                                                                             %
04944 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04945 %
04946 %  MagickGetImageOrientation() returns the image orientation.
04947 %
04948 %  The format of the MagickGetImageOrientation method is:
04949 %
04950 %      OrientationType MagickGetImageOrientation(MagickWand *wand)
04951 %
04952 %  A description of each parameter follows:
04953 %
04954 %    o wand: the magick wand.
04955 %
04956 */
04957 WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
04958 {
04959   assert(wand != (MagickWand *) NULL);
04960   assert(wand->signature == WandSignature);
04961   if (wand->debug != MagickFalse)
04962     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
04963   if (wand->images == (Image *) NULL)
04964     {
04965       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
04966         "ContainsNoImages","`%s'",wand->name);
04967       return(UndefinedOrientation);
04968     }
04969   return(wand->images->orientation);
04970 }
04971 
04972 /*
04973 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04974 %                                                                             %
04975 %                                                                             %
04976 %                                                                             %
04977 %   M a g i c k G e t I m a g e P a g e                                       %
04978 %                                                                             %
04979 %                                                                             %
04980 %                                                                             %
04981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
04982 %
04983 %  MagickGetImagePage() returns the page geometry associated with the image.
04984 %
04985 %  The format of the MagickGetImagePage method is:
04986 %
04987 %      MagickBooleanType MagickGetImagePage(MagickWand *wand,
04988 %        unsigned long *width,unsigned long *height,long *x,long *y)
04989 %
04990 %  A description of each parameter follows:
04991 %
04992 %    o wand: the magick wand.
04993 %
04994 %    o width: the page width.
04995 %
04996 %    o height: the page height.
04997 %
04998 %    o x: the page x-offset.
04999 %
05000 %    o y: the page y-offset.
05001 %
05002 */
05003 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
05004   unsigned long *width,unsigned long *height,long *x,long *y)
05005 {
05006   assert(wand != (const MagickWand *) NULL);
05007   assert(wand->signature == WandSignature);
05008   if (wand->debug != MagickFalse)
05009     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05010   if (wand->images == (Image *) NULL)
05011     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05012   *width=wand->images->page.width;
05013   *height=wand->images->page.height;
05014   *x=wand->images->page.x;
05015   *y=wand->images->page.y;
05016   return(MagickTrue);
05017 }
05018 
05019 /*
05020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05021 %                                                                             %
05022 %                                                                             %
05023 %                                                                             %
05024 %   M a g i c k G e t I m a g e P i x e l C o l o r                           %
05025 %                                                                             %
05026 %                                                                             %
05027 %                                                                             %
05028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05029 %
05030 %  MagickGetImagePixelColor() returns the color of the specified pixel.
05031 %
05032 %  The format of the MagickGetImagePixelColor method is:
05033 %
05034 %      MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
05035 %        const long x,const long y,PixelWand *color)
05036 %
05037 %  A description of each parameter follows:
05038 %
05039 %    o wand: the magick wand.
05040 %
05041 %    o x,y: the pixel offset into the image.
05042 %
05043 %    o color: Return the colormap color in this wand.
05044 %
05045 */
05046 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
05047   const long x,const long y,PixelWand *color)
05048 {
05049   IndexPacket
05050     *indexes;
05051 
05052   register const PixelPacket
05053     *p;
05054 
05055   ViewInfo
05056     *image_view;
05057 
05058   assert(wand != (MagickWand *) NULL);
05059   assert(wand->signature == WandSignature);
05060   if (wand->debug != MagickFalse)
05061     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05062   if (wand->images == (Image *) NULL)
05063     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05064   image_view=AcquireCacheView(wand->images);
05065   p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception);
05066   if (p == (const PixelPacket *) NULL)
05067     {
05068       image_view=DestroyCacheView(image_view);
05069       return(MagickFalse);
05070     }
05071   indexes=GetCacheViewAuthenticIndexQueue(image_view);
05072   PixelSetQuantumColor(color,p);
05073   if (GetCacheViewColorspace(image_view) == CMYKColorspace)
05074     PixelSetBlackQuantum(color,*indexes);
05075   else
05076     if (GetCacheViewStorageClass(image_view) == PseudoClass)
05077       PixelSetIndex(color,*indexes);
05078   image_view=DestroyCacheView(image_view);
05079   return(MagickTrue);
05080 }
05081 
05082 /*
05083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05084 %                                                                             %
05085 %                                                                             %
05086 %                                                                             %
05087 +   M a g i c k G e t I m a g e R a n g e                                     %
05088 %                                                                             %
05089 %                                                                             %
05090 %                                                                             %
05091 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05092 %
05093 %  MagickGetImageRange() gets the pixel range for the image.
05094 %
05095 %  The format of the MagickGetImageRange method is:
05096 %
05097 %      MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima,
05098 %        double *maxima)
05099 %
05100 %  A description of each parameter follows:
05101 %
05102 %    o wand: the magick wand.
05103 %
05104 %    o minima:  The minimum pixel value for the specified channel(s).
05105 %
05106 %    o maxima:  The maximum pixel value for the specified channel(s).
05107 %
05108 */
05109 WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand,
05110   double *minima,double *maxima)
05111 {
05112   MagickBooleanType
05113     status;
05114 
05115   assert(wand != (MagickWand *) NULL);
05116   assert(wand->signature == WandSignature);
05117   if (wand->debug != MagickFalse)
05118     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05119   if (wand->images == (Image *) NULL)
05120     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05121   status=GetImageRange(wand->images,minima,maxima,wand->exception);
05122   return(status);
05123 }
05124 
05125 /*
05126 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05127 %                                                                             %
05128 %                                                                             %
05129 %                                                                             %
05130 %   M a g i c k G e t I m a g e R e d P r i m a r y                           %
05131 %                                                                             %
05132 %                                                                             %
05133 %                                                                             %
05134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05135 %
05136 %  MagickGetImageRedPrimary() returns the chromaticy red primary point.
05137 %
05138 %  The format of the MagickGetImageRedPrimary method is:
05139 %
05140 %      MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x,
05141 %        double *y)
05142 %
05143 %  A description of each parameter follows:
05144 %
05145 %    o wand: the magick wand.
05146 %
05147 %    o x: the chromaticity red primary x-point.
05148 %
05149 %    o y: the chromaticity red primary y-point.
05150 %
05151 */
05152 WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
05153   double *x,double *y)
05154 {
05155   assert(wand != (MagickWand *) NULL);
05156   assert(wand->signature == WandSignature);
05157   if (wand->debug != MagickFalse)
05158     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05159   if (wand->images == (Image *) NULL)
05160     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05161   *x=wand->images->chromaticity.red_primary.x;
05162   *y=wand->images->chromaticity.red_primary.y;
05163   return(MagickTrue);
05164 }
05165 
05166 /*
05167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05168 %                                                                             %
05169 %                                                                             %
05170 %                                                                             %
05171 %   M a g i c k G e t I m a g e R e g i o n                                   %
05172 %                                                                             %
05173 %                                                                             %
05174 %                                                                             %
05175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05176 %
05177 %  MagickGetImageRegion() extracts a region of the image and returns it as a
05178 %  a new wand.
05179 %
05180 %  The format of the MagickGetImageRegion method is:
05181 %
05182 %      MagickWand *MagickGetImageRegion(MagickWand *wand,
05183 %        const unsigned long width,const unsigned long height,const long x,
05184 %        const long y)
05185 %
05186 %  A description of each parameter follows:
05187 %
05188 %    o wand: the magick wand.
05189 %
05190 %    o width: the region width.
05191 %
05192 %    o height: the region height.
05193 %
05194 %    o x: the region x offset.
05195 %
05196 %    o y: the region y offset.
05197 %
05198 */
05199 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
05200   const unsigned long width,const unsigned long height,const long x,
05201   const long y)
05202 {
05203   Image
05204     *region_image;
05205 
05206   RectangleInfo
05207     region;
05208 
05209   assert(wand != (MagickWand *) NULL);
05210   assert(wand->signature == WandSignature);
05211   if (wand->debug != MagickFalse)
05212     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05213   if (wand->images == (Image *) NULL)
05214     return((MagickWand *) NULL);
05215   region.width=width;
05216   region.height=height;
05217   region.x=x;
05218   region.y=y;
05219   region_image=CropImage(wand->images,&region,wand->exception);
05220   if (region_image == (Image *) NULL)
05221     return((MagickWand *) NULL);
05222   return(CloneMagickWandFromImages(wand,region_image));
05223 }
05224 
05225 /*
05226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05227 %                                                                             %
05228 %                                                                             %
05229 %                                                                             %
05230 %   M a g i c k G e t I m a g e R e n d e r i n g I n t e n t                 %
05231 %                                                                             %
05232 %                                                                             %
05233 %                                                                             %
05234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05235 %
05236 %  MagickGetImageRenderingIntent() gets the image rendering intent.
05237 %
05238 %  The format of the MagickGetImageRenderingIntent method is:
05239 %
05240 %      RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
05241 %
05242 %  A description of each parameter follows:
05243 %
05244 %    o wand: the magick wand.
05245 %
05246 */
05247 WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand)
05248 {
05249   assert(wand != (MagickWand *) NULL);
05250   assert(wand->signature == WandSignature);
05251   if (wand->debug != MagickFalse)
05252     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05253   if (wand->images == (Image *) NULL)
05254     {
05255       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05256         "ContainsNoImages","`%s'",wand->name);
05257       return(UndefinedIntent);
05258     }
05259   return((RenderingIntent) wand->images->rendering_intent);
05260 }
05261 
05262 /*
05263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05264 %                                                                             %
05265 %                                                                             %
05266 %                                                                             %
05267 %   M a g i c k G e t I m a g e R e s o l u t i o n                           %
05268 %                                                                             %
05269 %                                                                             %
05270 %                                                                             %
05271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05272 %
05273 %  MagickGetImageResolution() gets the image X and Y resolution.
05274 %
05275 %  The format of the MagickGetImageResolution method is:
05276 %
05277 %      MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x,
05278 %        double *y)
05279 %
05280 %  A description of each parameter follows:
05281 %
05282 %    o wand: the magick wand.
05283 %
05284 %    o x: the image x-resolution.
05285 %
05286 %    o y: the image y-resolution.
05287 %
05288 */
05289 WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
05290   double *x,double *y)
05291 {
05292   assert(wand != (MagickWand *) NULL);
05293   assert(wand->signature == WandSignature);
05294   if (wand->debug != MagickFalse)
05295     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05296   if (wand->images == (Image *) NULL)
05297     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05298   *x=wand->images->x_resolution;
05299   *y=wand->images->y_resolution;
05300   return(MagickTrue);
05301 }
05302 
05303 /*
05304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05305 %                                                                             %
05306 %                                                                             %
05307 %                                                                             %
05308 %   M a g i c k G e t I m a g e S c e n e                                     %
05309 %                                                                             %
05310 %                                                                             %
05311 %                                                                             %
05312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05313 %
05314 %  MagickGetImageScene() gets the image scene.
05315 %
05316 %  The format of the MagickGetImageScene method is:
05317 %
05318 %      unsigned long MagickGetImageScene(MagickWand *wand)
05319 %
05320 %  A description of each parameter follows:
05321 %
05322 %    o wand: the magick wand.
05323 %
05324 */
05325 WandExport unsigned long MagickGetImageScene(MagickWand *wand)
05326 {
05327   assert(wand != (MagickWand *) NULL);
05328   assert(wand->signature == WandSignature);
05329   if (wand->debug != MagickFalse)
05330     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05331   if (wand->images == (Image *) NULL)
05332     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05333   return(wand->images->scene);
05334 }
05335 
05336 /*
05337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05338 %                                                                             %
05339 %                                                                             %
05340 %                                                                             %
05341 %   M a g i c k G e t I m a g e S i g n a t u r e                             %
05342 %                                                                             %
05343 %                                                                             %
05344 %                                                                             %
05345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05346 %
05347 %  MagickGetImageSignature() generates an SHA-256 message digest for the image
05348 %  pixel stream.
05349 %
05350 %  The format of the MagickGetImageSignature method is:
05351 %
05352 %      const char MagickGetImageSignature(MagickWand *wand)
05353 %
05354 %  A description of each parameter follows:
05355 %
05356 %    o wand: the magick wand.
05357 %
05358 */
05359 WandExport char *MagickGetImageSignature(MagickWand *wand)
05360 {
05361   const char
05362     *value;
05363 
05364   MagickBooleanType
05365     status;
05366 
05367   assert(wand != (MagickWand *) NULL);
05368   assert(wand->signature == WandSignature);
05369   if (wand->debug != MagickFalse)
05370     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05371   if (wand->images == (Image *) NULL)
05372     {
05373       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05374         "ContainsNoImages","`%s'",wand->name);
05375       return((char *) NULL);
05376     }
05377   status=SignatureImage(wand->images);
05378   if (status == MagickFalse)
05379     InheritException(wand->exception,&wand->images->exception);
05380   value=GetImageProperty(wand->images,"signature");
05381   if (value != (const char *) NULL)
05382     return(AcquireString(value));
05383   InheritException(wand->exception,&wand->images->exception);
05384   return((char *) NULL);
05385 }
05386 
05387 /*
05388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05389 %                                                                             %
05390 %                                                                             %
05391 %                                                                             %
05392 %   M a g i c k G e t I m a g e T i c k s P e r S e c o n d                   %
05393 %                                                                             %
05394 %                                                                             %
05395 %                                                                             %
05396 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05397 %
05398 %  MagickGetImageTicksPerSecond() gets the image ticks-per-second.
05399 %
05400 %  The format of the MagickGetImageTicksPerSecond method is:
05401 %
05402 %      unsigned long MagickGetImageTicksPerSecond(MagickWand *wand)
05403 %
05404 %  A description of each parameter follows:
05405 %
05406 %    o wand: the magick wand.
05407 %
05408 */
05409 WandExport unsigned long MagickGetImageTicksPerSecond(MagickWand *wand)
05410 {
05411   assert(wand != (MagickWand *) NULL);
05412   assert(wand->signature == WandSignature);
05413   if (wand->debug != MagickFalse)
05414     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05415   if (wand->images == (Image *) NULL)
05416     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05417   return((unsigned long) wand->images->ticks_per_second);
05418 }
05419 
05420 /*
05421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05422 %                                                                             %
05423 %                                                                             %
05424 %                                                                             %
05425 %   M a g i c k G e t I m a g e T y p e                                       %
05426 %                                                                             %
05427 %                                                                             %
05428 %                                                                             %
05429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05430 %
05431 %  MagickGetImageType() gets the potential image type:
05432 %
05433 %        Bilevel        Grayscale       GrayscaleMatte
05434 %        Palette        PaletteMatte    TrueColor
05435 %        TrueColorMatte ColorSeparation ColorSeparationMatte
05436 %
05437 %  To ensure the image type matches its potential, use MagickSetImageType():
05438 %
05439 %    (void) MagickSetImageType(wand,MagickGetImageType(wand));
05440 %
05441 %  The format of the MagickGetImageType method is:
05442 %
05443 %      ImageType MagickGetImageType(MagickWand *wand)
05444 %
05445 %  A description of each parameter follows:
05446 %
05447 %    o wand: the magick wand.
05448 %
05449 */
05450 WandExport ImageType MagickGetImageType(MagickWand *wand)
05451 {
05452   assert(wand != (MagickWand *) NULL);
05453   assert(wand->signature == WandSignature);
05454   if (wand->debug != MagickFalse)
05455     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05456   if (wand->images == (Image *) NULL)
05457     {
05458       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05459         "ContainsNoImages","`%s'",wand->name);
05460       return(UndefinedType);
05461     }
05462   return(GetImageType(wand->images,wand->exception));
05463 }
05464 
05465 /*
05466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05467 %                                                                             %
05468 %                                                                             %
05469 %                                                                             %
05470 %   M a g i c k G e t I m a g e U n i t s                                     %
05471 %                                                                             %
05472 %                                                                             %
05473 %                                                                             %
05474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05475 %
05476 %  MagickGetImageUnits() gets the image units of resolution.
05477 %
05478 %  The format of the MagickGetImageUnits method is:
05479 %
05480 %      ResolutionType MagickGetImageUnits(MagickWand *wand)
05481 %
05482 %  A description of each parameter follows:
05483 %
05484 %    o wand: the magick wand.
05485 %
05486 */
05487 WandExport ResolutionType MagickGetImageUnits(MagickWand *wand)
05488 {
05489   assert(wand != (MagickWand *) NULL);
05490   assert(wand->signature == WandSignature);
05491   if (wand->debug != MagickFalse)
05492     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05493   if (wand->images == (Image *) NULL)
05494     {
05495       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05496         "ContainsNoImages","`%s'",wand->name);
05497       return(UndefinedResolution);
05498     }
05499   return(wand->images->units);
05500 }
05501 
05502 /*
05503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05504 %                                                                             %
05505 %                                                                             %
05506 %                                                                             %
05507 %   M a g i c k G e t I m a g e V i r t u a l P i x e l M e t h o d           %
05508 %                                                                             %
05509 %                                                                             %
05510 %                                                                             %
05511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05512 %
05513 %  MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the
05514 %  sepcified image.
05515 %
05516 %  The format of the MagickGetImageVirtualPixelMethod method is:
05517 %
05518 %      VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
05519 %
05520 %  A description of each parameter follows:
05521 %
05522 %    o wand: the magick wand.
05523 %
05524 */
05525 WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand)
05526 {
05527   assert(wand != (MagickWand *) NULL);
05528   assert(wand->signature == WandSignature);
05529   if (wand->debug != MagickFalse)
05530     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05531   if (wand->images == (Image *) NULL)
05532     {
05533       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05534         "ContainsNoImages","`%s'",wand->name);
05535       return(UndefinedVirtualPixelMethod);
05536     }
05537   return(GetImageVirtualPixelMethod(wand->images));
05538 }
05539 
05540 /*
05541 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05542 %                                                                             %
05543 %                                                                             %
05544 %                                                                             %
05545 %   M a g i c k G e t I m a g e W h i t e P o i n t                           %
05546 %                                                                             %
05547 %                                                                             %
05548 %                                                                             %
05549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05550 %
05551 %  MagickGetImageWhitePoint() returns the chromaticy white point.
05552 %
05553 %  The format of the MagickGetImageWhitePoint method is:
05554 %
05555 %      MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x,
05556 %        double *y)
05557 %
05558 %  A description of each parameter follows:
05559 %
05560 %    o wand: the magick wand.
05561 %
05562 %    o x: the chromaticity white x-point.
05563 %
05564 %    o y: the chromaticity white y-point.
05565 %
05566 */
05567 WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
05568   double *x,double *y)
05569 {
05570   assert(wand != (MagickWand *) NULL);
05571   assert(wand->signature == WandSignature);
05572   if (wand->debug != MagickFalse)
05573     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05574   if (wand->images == (Image *) NULL)
05575     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05576   *x=wand->images->chromaticity.white_point.x;
05577   *y=wand->images->chromaticity.white_point.y;
05578   return(MagickTrue);
05579 }
05580 
05581 /*
05582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05583 %                                                                             %
05584 %                                                                             %
05585 %                                                                             %
05586 %   M a g i c k G e t I m a g e W i d t h                                     %
05587 %                                                                             %
05588 %                                                                             %
05589 %                                                                             %
05590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05591 %
05592 %  MagickGetImageWidth() returns the image width.
05593 %
05594 %  The format of the MagickGetImageWidth method is:
05595 %
05596 %      unsigned long MagickGetImageWidth(MagickWand *wand)
05597 %
05598 %  A description of each parameter follows:
05599 %
05600 %    o wand: the magick wand.
05601 %
05602 */
05603 WandExport unsigned long MagickGetImageWidth(MagickWand *wand)
05604 {
05605   assert(wand != (MagickWand *) NULL);
05606   assert(wand->signature == WandSignature);
05607   if (wand->debug != MagickFalse)
05608     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05609   if (wand->images == (Image *) NULL)
05610     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05611   return(wand->images->columns);
05612 }
05613 
05614 /*
05615 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05616 %                                                                             %
05617 %                                                                             %
05618 %                                                                             %
05619 %   M a g i c k G e t N u m b e r I m a g e s                                 %
05620 %                                                                             %
05621 %                                                                             %
05622 %                                                                             %
05623 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05624 %
05625 %  MagickGetNumberImages() returns the number of images associated with a
05626 %  magick wand.
05627 %
05628 %  The format of the MagickGetNumberImages method is:
05629 %
05630 %      unsigned long MagickGetNumberImages(MagickWand *wand)
05631 %
05632 %  A description of each parameter follows:
05633 %
05634 %    o wand: the magick wand.
05635 %
05636 */
05637 WandExport unsigned long MagickGetNumberImages(MagickWand *wand)
05638 {
05639   assert(wand != (MagickWand *) NULL);
05640   assert(wand->signature == WandSignature);
05641   if (wand->debug != MagickFalse)
05642     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05643   return(GetImageListLength(wand->images));
05644 }
05645 
05646 /*
05647 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05648 %                                                                             %
05649 %                                                                             %
05650 %                                                                             %
05651 %   M a g i c k I m a g e G e t T o t a l I n k D e n s i t y                 %
05652 %                                                                             %
05653 %                                                                             %
05654 %                                                                             %
05655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05656 %
05657 %  MagickGetImageTotalInkDensity() gets the image total ink density.
05658 %
05659 %  The format of the MagickGetImageTotalInkDensity method is:
05660 %
05661 %      double MagickGetImageTotalInkDensity(MagickWand *wand)
05662 %
05663 %  A description of each parameter follows:
05664 %
05665 %    o wand: the magick wand.
05666 %
05667 */
05668 WandExport double MagickGetImageTotalInkDensity(MagickWand *wand)
05669 {
05670   assert(wand != (MagickWand *) NULL);
05671   assert(wand->signature == WandSignature);
05672   if (wand->debug != MagickFalse)
05673     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05674   if (wand->images == (Image *) NULL)
05675     {
05676       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05677         "ContainsNoImages","`%s'",wand->name);
05678       return(0.0);
05679     }
05680   return(GetImageTotalInkDensity(wand->images));
05681 }
05682 
05683 /*
05684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05685 %                                                                             %
05686 %                                                                             %
05687 %                                                                             %
05688 %   M a g i c k H a l d C l u t I m a g e                                     %
05689 %                                                                             %
05690 %                                                                             %
05691 %                                                                             %
05692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05693 %
05694 %  MagickHaldClutImage() replaces colors in the image from a Hald color lookup
05695 %  table.   A Hald color lookup table is a 3-dimensional color cube mapped to 2
05696 %  dimensions.  Create it with the HALD coder.  You can apply any color
05697 %  transformation to the Hald image and then use this method to apply the
05698 %  transform to the image.
05699 %
05700 %  The format of the MagickHaldClutImage method is:
05701 %
05702 %      MagickBooleanType MagickHaldClutImage(MagickWand *wand,
05703 %        const MagickWand *hald_wand)
05704 %      MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
05705 %        const ChannelType channel,const MagickWand *hald_wand)
05706 %
05707 %  A description of each parameter follows:
05708 %
05709 %    o wand: the magick wand.
05710 %
05711 %    o hald_image: the hald CLUT image.
05712 %
05713 */
05714 
05715 WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand,
05716   const MagickWand *hald_wand)
05717 {
05718   MagickBooleanType
05719     status;
05720 
05721   status=MagickHaldClutImageChannel(wand,DefaultChannels,hald_wand);
05722   return(status);
05723 }
05724 
05725 WandExport MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand,
05726   const ChannelType channel,const MagickWand *hald_wand)
05727 {
05728   MagickBooleanType
05729     status;
05730 
05731   assert(wand != (MagickWand *) NULL);
05732   assert(wand->signature == WandSignature);
05733   if (wand->debug != MagickFalse)
05734     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05735   if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL))
05736     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05737   status=HaldClutImageChannel(wand->images,channel,hald_wand->images);
05738   if (status == MagickFalse)
05739     InheritException(wand->exception,&wand->images->exception);
05740   return(status);
05741 }
05742 
05743 /*
05744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05745 %                                                                             %
05746 %                                                                             %
05747 %                                                                             %
05748 %   M a g i c k H a s N e x t I m a g e                                       %
05749 %                                                                             %
05750 %                                                                             %
05751 %                                                                             %
05752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05753 %
05754 %  MagickHasNextImage() returns MagickTrue if the wand has more images when
05755 %  traversing the list in the forward direction
05756 %
05757 %  The format of the MagickHasNextImage method is:
05758 %
05759 %      MagickBooleanType MagickHasNextImage(MagickWand *wand)
05760 %
05761 %  A description of each parameter follows:
05762 %
05763 %    o wand: the magick wand.
05764 %
05765 */
05766 WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand)
05767 {
05768   assert(wand != (MagickWand *) NULL);
05769   assert(wand->signature == WandSignature);
05770   if (wand->debug != MagickFalse)
05771     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05772   if (wand->images == (Image *) NULL)
05773     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05774   if (GetNextImageInList(wand->images) == (Image *) NULL)
05775     return(MagickFalse);
05776   return(MagickTrue);
05777 }
05778 
05779 /*
05780 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05781 %                                                                             %
05782 %                                                                             %
05783 %                                                                             %
05784 %   M a g i c k H a s P r e v i o u s I m a g e                               %
05785 %                                                                             %
05786 %                                                                             %
05787 %                                                                             %
05788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05789 %
05790 %  MagickHasPreviousImage() returns MagickTrue if the wand has more images when
05791 %  traversing the list in the reverse direction
05792 %
05793 %  The format of the MagickHasPreviousImage method is:
05794 %
05795 %      MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
05796 %
05797 %  A description of each parameter follows:
05798 %
05799 %    o wand: the magick wand.
05800 %
05801 */
05802 WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand)
05803 {
05804   assert(wand != (MagickWand *) NULL);
05805   assert(wand->signature == WandSignature);
05806   if (wand->debug != MagickFalse)
05807     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05808   if (wand->images == (Image *) NULL)
05809     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05810   if (GetPreviousImageInList(wand->images) == (Image *) NULL)
05811     return(MagickFalse);
05812   return(MagickTrue);
05813 }
05814 
05815 /*
05816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05817 %                                                                             %
05818 %                                                                             %
05819 %                                                                             %
05820 %   M a g i c k I d e n t i f y I m a g e                                     %
05821 %                                                                             %
05822 %                                                                             %
05823 %                                                                             %
05824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05825 %
05826 %  MagickIdentifyImage() identifies an image by printing its attributes to the
05827 %  file.  Attributes include the image width, height, size, and others.
05828 %
05829 %  The format of the MagickIdentifyImage method is:
05830 %
05831 %      const char *MagickIdentifyImage(MagickWand *wand)
05832 %
05833 %  A description of each parameter follows:
05834 %
05835 %    o wand: the magick wand.
05836 %
05837 */
05838 WandExport char *MagickIdentifyImage(MagickWand *wand)
05839 {
05840   char
05841     *description,
05842     filename[MaxTextExtent];
05843 
05844   FILE
05845     *file;
05846 
05847   int
05848     unique_file;
05849 
05850   assert(wand != (MagickWand *) NULL);
05851   assert(wand->signature == WandSignature);
05852   if (wand->debug != MagickFalse)
05853     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05854   if (wand->images == (Image *) NULL)
05855     {
05856       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05857         "ContainsNoImages","`%s'",wand->name);
05858       return((char *) NULL);
05859     }
05860   description=(char *) NULL;
05861   unique_file=AcquireUniqueFileResource(filename);
05862   file=(FILE *) NULL;
05863   if (unique_file != -1)
05864     file=fdopen(unique_file,"wb");
05865   if ((unique_file == -1) || (file == (FILE *) NULL))
05866     {
05867       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
05868         "UnableToCreateTemporaryFile","`%s'",wand->name);
05869       return((char *) NULL);
05870     }
05871   (void) IdentifyImage(wand->images,file,MagickTrue);
05872   (void) fclose(file);
05873   description=FileToString(filename,~0,wand->exception);
05874   (void) RelinquishUniqueFileResource(filename);
05875   return(description);
05876 }
05877 
05878 /*
05879 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05880 %                                                                             %
05881 %                                                                             %
05882 %                                                                             %
05883 %   M a g i c k I m p l o d e I m a g e                                       %
05884 %                                                                             %
05885 %                                                                             %
05886 %                                                                             %
05887 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05888 %
05889 %  MagickImplodeImage() creates a new image that is a copy of an existing
05890 %  one with the image pixels "implode" by the specified percentage.  It
05891 %  allocates the memory necessary for the new Image structure and returns a
05892 %  pointer to the new image.
05893 %
05894 %  The format of the MagickImplodeImage method is:
05895 %
05896 %      MagickBooleanType MagickImplodeImage(MagickWand *wand,
05897 %        const double radius)
05898 %
05899 %  A description of each parameter follows:
05900 %
05901 %    o wand: the magick wand.
05902 %
05903 %    o amount: Define the extent of the implosion.
05904 %
05905 */
05906 WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
05907   const double amount)
05908 {
05909   Image
05910     *implode_image;
05911 
05912   assert(wand != (MagickWand *) NULL);
05913   assert(wand->signature == WandSignature);
05914   if (wand->debug != MagickFalse)
05915     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05916   if (wand->images == (Image *) NULL)
05917     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05918   implode_image=ImplodeImage(wand->images,amount,wand->exception);
05919   if (implode_image == (Image *) NULL)
05920     return(MagickFalse);
05921   ReplaceImageInList(&wand->images,implode_image);
05922   return(MagickTrue);
05923 }
05924 
05925 /*
05926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05927 %                                                                             %
05928 %                                                                             %
05929 %                                                                             %
05930 %   M a g i c k I m p o r t I m a g e P i x e l s                             %
05931 %                                                                             %
05932 %                                                                             %
05933 %                                                                             %
05934 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05935 %
05936 %  MagickImportImagePixels() accepts pixel datand stores it in the image at the
05937 %  location you specify.  The method returns MagickFalse on success otherwise
05938 %  MagickTrue if an error is encountered.  The pixel data can be either char,
05939 %  short int, int, long, float, or double in the order specified by map.
05940 %
05941 %  Suppose your want to upload the first scanline of a 640x480 image from
05942 %  character data in red-green-blue order:
05943 %
05944 %      MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
05945 %
05946 %  The format of the MagickImportImagePixels method is:
05947 %
05948 %      MagickBooleanType MagickImportImagePixels(MagickWand *wand,
05949 %        const long x,const long y,const unsigned long columns,
05950 %        const unsigned long rows,const char *map,const StorageType storage,
05951 %        const void *pixels)
05952 %
05953 %  A description of each parameter follows:
05954 %
05955 %    o wand: the magick wand.
05956 %
05957 %    o x, y, columns, rows:  These values define the perimeter of a region
05958 %      of pixels you want to define.
05959 %
05960 %    o map:  This string reflects the expected ordering of the pixel array.
05961 %      It can be any combination or order of R = red, G = green, B = blue,
05962 %      A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
05963 %      Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
05964 %      P = pad.
05965 %
05966 %    o storage: Define the data type of the pixels.  Float and double types are
05967 %      expected to be normalized [0..1] otherwise [0..QuantumRange].  Choose from
05968 %      these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
05969 %      or DoublePixel.
05970 %
05971 %    o pixels: This array of values contain the pixel components as defined by
05972 %      map and type.  You must preallocate this array where the expected
05973 %      length varies depending on the values of width, height, map, and type.
05974 %
05975 */
05976 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
05977   const long x,const long y,const unsigned long columns,
05978   const unsigned long rows,const char *map,const StorageType storage,
05979   const void *pixels)
05980 {
05981   MagickBooleanType
05982     status;
05983 
05984   assert(wand != (MagickWand *) NULL);
05985   assert(wand->signature == WandSignature);
05986   if (wand->debug != MagickFalse)
05987     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
05988   if (wand->images == (Image *) NULL)
05989     ThrowWandException(WandError,"ContainsNoImages",wand->name);
05990   status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels);
05991   if (status == MagickFalse)
05992     InheritException(wand->exception,&wand->images->exception);
05993   return(status);
05994 }
05995 
05996 /*
05997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
05998 %                                                                             %
05999 %                                                                             %
06000 %                                                                             %
06001 %   M a g i c k L a b e l I m a g e                                           %
06002 %                                                                             %
06003 %                                                                             %
06004 %                                                                             %
06005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06006 %
06007 %  MagickLabelImage() adds a label to your image.
06008 %
06009 %  The format of the MagickLabelImage method is:
06010 %
06011 %      MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label)
06012 %
06013 %  A description of each parameter follows:
06014 %
06015 %    o wand: the magick wand.
06016 %
06017 %    o label: the image label.
06018 %
06019 */
06020 WandExport MagickBooleanType MagickLabelImage(MagickWand *wand,
06021   const char *label)
06022 {
06023   MagickBooleanType
06024     status;
06025 
06026   assert(wand != (MagickWand *) NULL);
06027   assert(wand->signature == WandSignature);
06028   if (wand->debug != MagickFalse)
06029     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06030   if (wand->images == (Image *) NULL)
06031     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06032   status=SetImageProperty(wand->images,"label",label);
06033   if (status == MagickFalse)
06034     InheritException(wand->exception,&wand->images->exception);
06035   return(status);
06036 }
06037 
06038 /*
06039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06040 %                                                                             %
06041 %                                                                             %
06042 %                                                                             %
06043 %   M a g i c k L e v e l I m a g e                                           %
06044 %                                                                             %
06045 %                                                                             %
06046 %                                                                             %
06047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06048 %
06049 %  MagickLevelImage() adjusts the levels of an image by scaling the colors
06050 %  falling between specified white and black points to the full available
06051 %  quantum range. The parameters provided represent the black, mid, and white
06052 %  points. The black point specifies the darkest color in the image. Colors
06053 %  darker than the black point are set to zero. Mid point specifies a gamma
06054 %  correction to apply to the image.  White point specifies the lightest color
06055 %  in the image. Colors brighter than the white point are set to the maximum
06056 %  quantum value.
06057 %
06058 %  The format of the MagickLevelImage method is:
06059 %
06060 %      MagickBooleanType MagickLevelImage(MagickWand *wand,
06061 %        const double black_point,const double gamma,const double white_point)
06062 %      MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
06063 %        const ChannelType channel,const double black_point,const double gamma,
06064 %        const double white_point)
06065 %
06066 %  A description of each parameter follows:
06067 %
06068 %    o wand: the magick wand.
06069 %
06070 %    o channel: Identify which channel to level: RedChannel, GreenChannel,
06071 %
06072 %    o black_point: the black point.
06073 %
06074 %    o gamma: the gamma.
06075 %
06076 %    o white_point: the white point.
06077 %
06078 */
06079 
06080 WandExport MagickBooleanType MagickLevelImage(MagickWand *wand,
06081   const double black_point,const double gamma,const double white_point)
06082 {
06083   MagickBooleanType
06084     status;
06085 
06086   status=MagickLevelImageChannel(wand,DefaultChannels,black_point,gamma,
06087     white_point);
06088   return(status);
06089 }
06090 
06091 WandExport MagickBooleanType MagickLevelImageChannel(MagickWand *wand,
06092   const ChannelType channel,const double black_point,const double gamma,
06093   const double white_point)
06094 {
06095   MagickBooleanType
06096     status;
06097 
06098   assert(wand != (MagickWand *) NULL);
06099   assert(wand->signature == WandSignature);
06100   if (wand->debug != MagickFalse)
06101     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06102   if (wand->images == (Image *) NULL)
06103     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06104   status=LevelImageChannel(wand->images,channel,black_point,white_point,gamma);
06105   if (status == MagickFalse)
06106     InheritException(wand->exception,&wand->images->exception);
06107   return(status);
06108 }
06109 
06110 /*
06111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06112 %                                                                             %
06113 %                                                                             %
06114 %                                                                             %
06115 %   M a g i c k L i n e a r S t r e t c h I m a g e                           %
06116 %                                                                             %
06117 %                                                                             %
06118 %                                                                             %
06119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06120 %
06121 %  MagickLinearStretchImage() stretches with saturation the image intensity.
06122 %
06123 %  You can also reduce the influence of a particular channel with a gamma
06124 %  value of 0.
06125 %
06126 %  The format of the MagickLinearStretchImage method is:
06127 %
06128 %      MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
06129 %        const double black_point,const double white_point)
06130 %
06131 %  A description of each parameter follows:
06132 %
06133 %    o wand: the magick wand.
06134 %
06135 %    o black_point: the black point.
06136 %
06137 %    o white_point: the white point.
06138 %
06139 */
06140 WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
06141   const double black_point,const double white_point)
06142 {
06143   MagickBooleanType
06144     status;
06145 
06146   assert(wand != (MagickWand *) NULL);
06147   assert(wand->signature == WandSignature);
06148   if (wand->debug != MagickFalse)
06149     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06150   if (wand->images == (Image *) NULL)
06151     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06152   status=LinearStretchImage(wand->images,black_point,white_point);
06153   if (status == MagickFalse)
06154     InheritException(wand->exception,&wand->images->exception);
06155   return(status);
06156 }
06157 
06158 /*
06159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06160 %                                                                             %
06161 %                                                                             %
06162 %                                                                             %
06163 %   M a g i c k L i q u i d R e s c a l e I m a g e                           %
06164 %                                                                             %
06165 %                                                                             %
06166 %                                                                             %
06167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06168 %
06169 %  MagickLiquidRescaleImage() rescales image with seam carving.
06170 %
06171 %      MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
06172 %        const unsigned long columns,const unsigned long rows,
06173 %        const double delta_x,const double rigidity)
06174 %
06175 %  A description of each parameter follows:
06176 %
06177 %    o wand: the magick wand.
06178 %
06179 %    o columns: the number of columns in the scaled image.
06180 %
06181 %    o rows: the number of rows in the scaled image.
06182 %
06183 %    o delta_x: maximum seam transversal step (0 means straight seams).
06184 %
06185 %    o rigidity: introduce a bias for non-straight seams (typically 0).
06186 %
06187 */
06188 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
06189   const unsigned long columns,const unsigned long rows,const double delta_x,
06190   const double rigidity)
06191 {
06192   Image
06193     *rescale_image;
06194 
06195   assert(wand != (MagickWand *) NULL);
06196   assert(wand->signature == WandSignature);
06197   if (wand->debug != MagickFalse)
06198     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06199   if (wand->images == (Image *) NULL)
06200     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06201   rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x,
06202     rigidity,wand->exception);
06203   if (rescale_image == (Image *) NULL)
06204     return(MagickFalse);
06205   ReplaceImageInList(&wand->images,rescale_image);
06206   return(MagickTrue);
06207 }
06208 
06209 /*
06210 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06211 %                                                                             %
06212 %                                                                             %
06213 %                                                                             %
06214 %   M a g i c k M a g n i f y I m a g e                                       %
06215 %                                                                             %
06216 %                                                                             %
06217 %                                                                             %
06218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06219 %
06220 %  MagickMagnifyImage() is a convenience method that scales an image
06221 %  proportionally to twice its original size.
06222 %
06223 %  The format of the MagickMagnifyImage method is:
06224 %
06225 %      MagickBooleanType MagickMagnifyImage(MagickWand *wand)
06226 %
06227 %  A description of each parameter follows:
06228 %
06229 %    o wand: the magick wand.
06230 %
06231 */
06232 WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
06233 {
06234   Image
06235     *magnify_image;
06236 
06237   assert(wand != (MagickWand *) NULL);
06238   assert(wand->signature == WandSignature);
06239   if (wand->debug != MagickFalse)
06240     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06241   if (wand->images == (Image *) NULL)
06242     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06243   magnify_image=MagnifyImage(wand->images,wand->exception);
06244   if (magnify_image == (Image *) NULL)
06245     return(MagickFalse);
06246   ReplaceImageInList(&wand->images,magnify_image);
06247   return(MagickTrue);
06248 }
06249 
06250 /*
06251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06252 %                                                                             %
06253 %                                                                             %
06254 %                                                                             %
06255 %   M a g i c k M e d i a n F i l t e r I m a g e                             %
06256 %                                                                             %
06257 %                                                                             %
06258 %                                                                             %
06259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06260 %
06261 %  MagickMedianFilterImage() applies a digital filter that improves the quality
06262 %  of a noisy image.  Each pixel is replaced by the median in a set of
06263 %  neighboring pixels as defined by radius.
06264 %
06265 %  The format of the MagickMedianFilterImage method is:
06266 %
06267 %      MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
06268 %        const double radius)
06269 %
06270 %  A description of each parameter follows:
06271 %
06272 %    o wand: the magick wand.
06273 %
06274 %    o radius: the radius of the pixel neighborhood.
06275 %
06276 */
06277 WandExport MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
06278   const double radius)
06279 {
06280   Image
06281     *median_image;
06282 
06283   assert(wand != (MagickWand *) NULL);
06284   assert(wand->signature == WandSignature);
06285   if (wand->debug != MagickFalse)
06286     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06287   if (wand->images == (Image *) NULL)
06288     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06289   median_image=MedianFilterImage(wand->images,radius,wand->exception);
06290   if (median_image == (Image *) NULL)
06291     return(MagickFalse);
06292   ReplaceImageInList(&wand->images,median_image);
06293   return(MagickTrue);
06294 }
06295 
06296 /*
06297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06298 %                                                                             %
06299 %                                                                             %
06300 %                                                                             %
06301 %   M a g i c k M e r g e I m a g e L a y e r s                               %
06302 %                                                                             %
06303 %                                                                             %
06304 %                                                                             %
06305 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06306 %
06307 %  MagickMergeImageLayers() composes all the image layers from the current given
06308 %  image onward to produce a single image of the merged layers.
06309 %
06310 %  The inital canvas's size depends on the given ImageLayerMethod, and is
06311 %  initialized using the first images background color.  The images
06312 %  are then compositied onto that image in sequence using the given
06313 %  composition that has been assigned to each individual image.
06314 %
06315 %  The format of the MagickMergeImageLayers method is:
06316 %
06317 %      MagickWand *MagickMergeImageLayers(MagickWand *wand,
06318 %        const ImageLayerMethod method)
06319 %
06320 %  A description of each parameter follows:
06321 %
06322 %    o wand: the magick wand.
06323 %
06324 %    o method: the method of selecting the size of the initial canvas.
06325 %
06326 %        MergeLayer: Merge all layers onto a canvas just large enough
06327 %           to hold all the actual images. The virtual canvas of the
06328 %           first image is preserved but otherwise ignored.
06329 %
06330 %        FlattenLayer: Use the virtual canvas size of first image.
06331 %           Images which fall outside this canvas is clipped.
06332 %           This can be used to 'fill out' a given virtual canvas.
06333 %
06334 %        MosaicLayer: Start with the virtual canvas of the first image,
06335 %           enlarging left and right edges to contain all images.
06336 %           Images with negative offsets will be clipped.
06337 %
06338 */
06339 WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
06340   const ImageLayerMethod method)
06341 {
06342   Image
06343     *mosaic_image;
06344 
06345   assert(wand != (MagickWand *) NULL);
06346   assert(wand->signature == WandSignature);
06347   if (wand->debug != MagickFalse)
06348     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06349   if (wand->images == (Image *) NULL)
06350     return((MagickWand *) NULL);
06351   mosaic_image=MergeImageLayers(wand->images,method,wand->exception);
06352   if (mosaic_image == (Image *) NULL)
06353     return((MagickWand *) NULL);
06354   return(CloneMagickWandFromImages(wand,mosaic_image));
06355 }
06356 
06357 /*
06358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06359 %                                                                             %
06360 %                                                                             %
06361 %                                                                             %
06362 %   M a g i c k M i n i f y I m a g e                                         %
06363 %                                                                             %
06364 %                                                                             %
06365 %                                                                             %
06366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06367 %
06368 %  MagickMinifyImage() is a convenience method that scales an image
06369 %  proportionally to one-half its original size
06370 %
06371 %  The format of the MagickMinifyImage method is:
06372 %
06373 %      MagickBooleanType MagickMinifyImage(MagickWand *wand)
06374 %
06375 %  A description of each parameter follows:
06376 %
06377 %    o wand: the magick wand.
06378 %
06379 */
06380 WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand)
06381 {
06382   Image
06383     *minify_image;
06384 
06385   assert(wand != (MagickWand *) NULL);
06386   assert(wand->signature == WandSignature);
06387   if (wand->debug != MagickFalse)
06388     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06389   if (wand->images == (Image *) NULL)
06390     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06391   minify_image=MinifyImage(wand->images,wand->exception);
06392   if (minify_image == (Image *) NULL)
06393     return(MagickFalse);
06394   ReplaceImageInList(&wand->images,minify_image);
06395   return(MagickTrue);
06396 }
06397 
06398 /*
06399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06400 %                                                                             %
06401 %                                                                             %
06402 %                                                                             %
06403 %   M a g i c k M o d u l a t e I m a g e                                     %
06404 %                                                                             %
06405 %                                                                             %
06406 %                                                                             %
06407 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06408 %
06409 %  MagickModulateImage() lets you control the brightness, saturation, and hue
06410 %  of an image.  Hue is the percentage of absolute rotation from the current
06411 %  position.  For example 50 results in a counter-clockwise rotation of 90
06412 %  degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200
06413 %  both resulting in a rotation of 180 degrees.
06414 %
06415 %  To increase the color brightness by 20% and decrease the color saturation by
06416 %  10% and leave the hue unchanged, use: 120,90,100.
06417 %
06418 %  The format of the MagickModulateImage method is:
06419 %
06420 %      MagickBooleanType MagickModulateImage(MagickWand *wand,
06421 %        const double brightness,const double saturation,const double hue)
06422 %
06423 %  A description of each parameter follows:
06424 %
06425 %    o wand: the magick wand.
06426 %
06427 %    o brightness: the percent change in brighness.
06428 %
06429 %    o saturation: the percent change in saturation.
06430 %
06431 %    o hue: the percent change in hue.
06432 %
06433 */
06434 WandExport MagickBooleanType MagickModulateImage(MagickWand *wand,
06435   const double brightness,const double saturation,const double hue)
06436 {
06437   char
06438     modulate[MaxTextExtent];
06439 
06440   MagickBooleanType
06441     status;
06442 
06443   assert(wand != (MagickWand *) NULL);
06444   assert(wand->signature == WandSignature);
06445   if (wand->debug != MagickFalse)
06446     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06447   if (wand->images == (Image *) NULL)
06448     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06449   (void) FormatMagickString(modulate,MaxTextExtent,"%g,%g,%g",brightness,
06450     saturation,hue);
06451   status=ModulateImage(wand->images,modulate);
06452   if (status == MagickFalse)
06453     InheritException(wand->exception,&wand->images->exception);
06454   return(status);
06455 }
06456 
06457 /*
06458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06459 %                                                                             %
06460 %                                                                             %
06461 %                                                                             %
06462 %   M a g i c k M o n t a g e I m a g e                                       %
06463 %                                                                             %
06464 %                                                                             %
06465 %                                                                             %
06466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06467 %
06468 %  MagickMontageImage() creates a composite image by combining several
06469 %  separate images. The images are tiled on the composite image with the name
06470 %  of the image optionally appearing just below the individual tile.
06471 %
06472 %  The format of the MagickMontageImage method is:
06473 %
06474 %      MagickWand *MagickMontageImage(MagickWand *wand,
06475 %        const DrawingWand drawing_wand,const char *tile_geometry,
06476 %        const char *thumbnail_geometry,const MontageMode mode,
06477 %        const char *frame)
06478 %
06479 %  A description of each parameter follows:
06480 %
06481 %    o wand: the magick wand.
06482 %
06483 %    o drawing_wand: the drawing wand.  The font name, size, and color are
06484 %      obtained from this wand.
06485 %
06486 %    o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0).
06487 %
06488 %    o thumbnail_geometry: Preferred image size and border size of each
06489 %      thumbnail (e.g. 120x120+4+3>).
06490 %
06491 %    o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate.
06492 %
06493 %    o frame: Surround the image with an ornamental border (e.g. 15x15+3+3).
06494 %      The frame color is that of the thumbnail's matte color.
06495 %
06496 */
06497 WandExport MagickWand *MagickMontageImage(MagickWand *wand,
06498   const DrawingWand *drawing_wand,const char *tile_geometry,
06499   const char *thumbnail_geometry,const MontageMode mode,const char *frame)
06500 {
06501   char
06502     *font;
06503 
06504   Image
06505     *montage_image;
06506 
06507   MontageInfo
06508     *montage_info;
06509 
06510   PixelWand
06511     *pixel_wand;
06512 
06513   assert(wand != (MagickWand *) NULL);
06514   assert(wand->signature == WandSignature);
06515   if (wand->debug != MagickFalse)
06516     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06517   if (wand->images == (Image *) NULL)
06518     return((MagickWand *) NULL);
06519   montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL);
06520   switch (mode)
06521   {
06522     case FrameMode:
06523     {
06524       (void) CloneString(&montage_info->frame,"15x15+3+3");
06525       montage_info->shadow=MagickTrue;
06526       break;
06527     }
06528     case UnframeMode:
06529     {
06530       montage_info->frame=(char *) NULL;
06531       montage_info->shadow=MagickFalse;
06532       montage_info->border_width=0;
06533       break;
06534     }
06535     case ConcatenateMode:
06536     {
06537       montage_info->frame=(char *) NULL;
06538       montage_info->shadow=MagickFalse;
06539       (void) CloneString(&montage_info->geometry,"+0+0");
06540       montage_info->border_width=0;
06541       break;
06542     }
06543     default:
06544       break;
06545   }
06546   font=DrawGetFont(drawing_wand);
06547   if (font != (char *) NULL)
06548     (void) CloneString(&montage_info->font,font);
06549   if (frame != (char *) NULL)
06550     (void) CloneString(&montage_info->frame,frame);
06551   montage_info->pointsize=DrawGetFontSize(drawing_wand);
06552   pixel_wand=NewPixelWand();
06553   DrawGetFillColor(drawing_wand,pixel_wand);
06554   PixelGetQuantumColor(pixel_wand,&montage_info->fill);
06555   DrawGetStrokeColor(drawing_wand,pixel_wand);
06556   PixelGetQuantumColor(pixel_wand,&montage_info->stroke);
06557   pixel_wand=DestroyPixelWand(pixel_wand);
06558   if (thumbnail_geometry != (char *) NULL)
06559     (void) CloneString(&montage_info->geometry,thumbnail_geometry);
06560   if (tile_geometry != (char *) NULL)
06561     (void) CloneString(&montage_info->tile,tile_geometry);
06562   montage_image=MontageImageList(wand->image_info,montage_info,wand->images,
06563     wand->exception);
06564   montage_info=DestroyMontageInfo(montage_info);
06565   if (montage_image == (Image *) NULL)
06566     return((MagickWand *) NULL);
06567   return(CloneMagickWandFromImages(wand,montage_image));
06568 }
06569 
06570 /*
06571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06572 %                                                                             %
06573 %                                                                             %
06574 %                                                                             %
06575 %   M a g i c k M o r p h I m a g e s                                         %
06576 %                                                                             %
06577 %                                                                             %
06578 %                                                                             %
06579 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06580 %
06581 %  MagickMorphImages() method morphs a set of images.  Both the image pixels
06582 %  and size are linearly interpolated to give the appearance of a
06583 %  meta-morphosis from one image to the next.
06584 %
06585 %  The format of the MagickMorphImages method is:
06586 %
06587 %      MagickWand *MagickMorphImages(MagickWand *wand,
06588 %        const unsigned long number_frames)
06589 %
06590 %  A description of each parameter follows:
06591 %
06592 %    o wand: the magick wand.
06593 %
06594 %    o number_frames: the number of in-between images to generate.
06595 %
06596 */
06597 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
06598   const unsigned long number_frames)
06599 {
06600   Image
06601     *morph_image;
06602 
06603   assert(wand != (MagickWand *) NULL);
06604   assert(wand->signature == WandSignature);
06605   if (wand->debug != MagickFalse)
06606     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06607   if (wand->images == (Image *) NULL)
06608     return((MagickWand *) NULL);
06609   morph_image=MorphImages(wand->images,number_frames,wand->exception);
06610   if (morph_image == (Image *) NULL)
06611     return((MagickWand *) NULL);
06612   return(CloneMagickWandFromImages(wand,morph_image));
06613 }
06614 
06615 /*
06616 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06617 %                                                                             %
06618 %                                                                             %
06619 %                                                                             %
06620 %   M a g i c k M o t i o n B l u r I m a g e                                 %
06621 %                                                                             %
06622 %                                                                             %
06623 %                                                                             %
06624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06625 %
06626 %  MagickMotionBlurImage() simulates motion blur.  We convolve the image with a
06627 %  Gaussian operator of the given radius and standard deviation (sigma).
06628 %  For reasonable results, radius should be larger than sigma.  Use a
06629 %  radius of 0 and MotionBlurImage() selects a suitable radius for you.
06630 %  Angle gives the angle of the blurring motion.
06631 %
06632 %  The format of the MagickMotionBlurImage method is:
06633 %
06634 %      MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
06635 %        const double radius,const double sigma,const double angle)
06636 %      MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
06637 %        const ChannelType channel,const double radius,const double sigma,
06638 %        const double angle)
06639 %
06640 %  A description of each parameter follows:
06641 %
06642 %    o wand: the magick wand.
06643 %
06644 %    o channel: the image channel(s).
06645 %
06646 %    o radius: the radius of the Gaussian, in pixels, not counting
06647 %      the center pixel.
06648 %
06649 %    o sigma: the standard deviation of the Gaussian, in pixels.
06650 %
06651 %    o angle: Apply the effect along this angle.
06652 %
06653 */
06654 
06655 WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
06656   const double radius,const double sigma,const double angle)
06657 {
06658   MagickBooleanType
06659     status;
06660 
06661   status=MagickMotionBlurImageChannel(wand,DefaultChannels,radius,sigma,angle);
06662   return(status);
06663 }
06664 
06665 WandExport MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand,
06666   const ChannelType channel,const double radius,const double sigma,
06667   const double angle)
06668 {
06669   Image
06670     *blur_image;
06671 
06672   assert(wand != (MagickWand *) NULL);
06673   assert(wand->signature == WandSignature);
06674   if (wand->debug != MagickFalse)
06675     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06676   if (wand->images == (Image *) NULL)
06677     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06678   blur_image=MotionBlurImageChannel(wand->images,channel,radius,sigma,angle,
06679     wand->exception);
06680   if (blur_image == (Image *) NULL)
06681     return(MagickFalse);
06682   ReplaceImageInList(&wand->images,blur_image);
06683   return(MagickTrue);
06684 }
06685 
06686 /*
06687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06688 %                                                                             %
06689 %                                                                             %
06690 %                                                                             %
06691 %   M a g i c k N e g a t e I m a g e                                         %
06692 %                                                                             %
06693 %                                                                             %
06694 %                                                                             %
06695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06696 %
06697 %  MagickNegateImage() negates the colors in the reference image.  The
06698 %  Grayscale option means that only grayscale values within the image are
06699 %  negated.
06700 %
06701 %  You can also reduce the influence of a particular channel with a gamma
06702 %  value of 0.
06703 %
06704 %  The format of the MagickNegateImage method is:
06705 %
06706 %      MagickBooleanType MagickNegateImage(MagickWand *wand,
06707 %        const MagickBooleanType gray)
06708 %      MagickBooleanType MagickNegateImage(MagickWand *wand,
06709 %        const ChannelType channel,const MagickBooleanType gray)
06710 %
06711 %  A description of each parameter follows:
06712 %
06713 %    o wand: the magick wand.
06714 %
06715 %    o channel: the image channel(s).
06716 %
06717 %    o gray: If MagickTrue, only negate grayscale pixels within the image.
06718 %
06719 */
06720 
06721 WandExport MagickBooleanType MagickNegateImage(MagickWand *wand,
06722   const MagickBooleanType gray)
06723 {
06724   MagickBooleanType
06725     status;
06726 
06727   status=MagickNegateImageChannel(wand,DefaultChannels,gray);
06728   return(status);
06729 }
06730 
06731 WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand,
06732   const ChannelType channel,const MagickBooleanType gray)
06733 {
06734   MagickBooleanType
06735     status;
06736 
06737   assert(wand != (MagickWand *) NULL);
06738   assert(wand->signature == WandSignature);
06739   if (wand->debug != MagickFalse)
06740     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06741   if (wand->images == (Image *) NULL)
06742     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06743   status=NegateImageChannel(wand->images,channel,gray);
06744   if (status == MagickFalse)
06745     InheritException(wand->exception,&wand->images->exception);
06746   return(status);
06747 }
06748 
06749 /*
06750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06751 %                                                                             %
06752 %                                                                             %
06753 %                                                                             %
06754 %   M a g i c k N e w I m a g e                                               %
06755 %                                                                             %
06756 %                                                                             %
06757 %                                                                             %
06758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06759 %
06760 %  MagickNewImage() adds a blank image canvas of the specified size and
06761 %  background color to the wand.
06762 %
06763 %  The format of the MagickNewImage method is:
06764 %
06765 %      MagickBooleanType MagickNewImage(MagickWand *wand,
06766 %        const unsigned long columns,const unsigned long rows,
06767 %        const PixelWand *background)
06768 %
06769 %  A description of each parameter follows:
06770 %
06771 %    o wand: the magick wand.
06772 %
06773 %    o width: the image width.
06774 %
06775 %    o height: the image height.
06776 %
06777 %    o background: the image color.
06778 %
06779 */
06780 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
06781   const unsigned long width,const unsigned long height,
06782   const PixelWand *background)
06783 {
06784   Image
06785     *images;
06786 
06787   MagickPixelPacket
06788     pixel;
06789 
06790   assert(wand != (MagickWand *) NULL);
06791   assert(wand->signature == WandSignature);
06792   if (wand->debug != MagickFalse)
06793     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06794   PixelGetMagickColor(background,&pixel);
06795   images=NewMagickImage(wand->image_info,width,height,&pixel);
06796   if (images == (Image *) NULL)
06797     return(MagickFalse);
06798   if (images->exception.severity != UndefinedException)
06799     InheritException(wand->exception,&images->exception);
06800   return(InsertImageInWand(wand,images));
06801 }
06802 
06803 /*
06804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06805 %                                                                             %
06806 %                                                                             %
06807 %                                                                             %
06808 %   M a g i c k N e x t I m a g e                                             %
06809 %                                                                             %
06810 %                                                                             %
06811 %                                                                             %
06812 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06813 %
06814 %  MagickNextImage() associates the next image in the image list with a magick
06815 %  wand.
06816 %
06817 %  The format of the MagickNextImage method is:
06818 %
06819 %      MagickBooleanType MagickNextImage(MagickWand *wand)
06820 %
06821 %  A description of each parameter follows:
06822 %
06823 %    o wand: the magick wand.
06824 %
06825 */
06826 WandExport MagickBooleanType MagickNextImage(MagickWand *wand)
06827 {
06828   assert(wand != (MagickWand *) NULL);
06829   assert(wand->signature == WandSignature);
06830   if (wand->debug != MagickFalse)
06831     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06832   if (wand->images == (Image *) NULL)
06833     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06834   if (wand->pend != MagickFalse)
06835     {
06836       wand->pend=MagickFalse;
06837       return(MagickTrue);
06838     }
06839   if (GetNextImageInList(wand->images) == (Image *) NULL)
06840     {
06841       wand->pend=MagickTrue;
06842       return(MagickFalse);
06843     }
06844   wand->images=GetNextImageInList(wand->images);
06845   return(MagickTrue);
06846 }
06847 
06848 /*
06849 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06850 %                                                                             %
06851 %                                                                             %
06852 %                                                                             %
06853 %   M a g i c k N o r m a l i z e I m a g e                                   %
06854 %                                                                             %
06855 %                                                                             %
06856 %                                                                             %
06857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06858 %
06859 %  MagickNormalizeImage() enhances the contrast of a color image by adjusting
06860 %  the pixels color to span the entire range of colors available
06861 %
06862 %  You can also reduce the influence of a particular channel with a gamma
06863 %  value of 0.
06864 %
06865 %  The format of the MagickNormalizeImage method is:
06866 %
06867 %      MagickBooleanType MagickNormalizeImage(MagickWand *wand)
06868 %      MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
06869 %        const ChannelType channel)
06870 %
06871 %  A description of each parameter follows:
06872 %
06873 %    o wand: the magick wand.
06874 %
06875 %    o channel: the image channel(s).
06876 %
06877 */
06878 
06879 WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand)
06880 {
06881   MagickBooleanType
06882     status;
06883 
06884   status=MagickNormalizeImageChannel(wand,DefaultChannels);
06885   return(status);
06886 }
06887 
06888 WandExport MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand,
06889   const ChannelType channel)
06890 {
06891   MagickBooleanType
06892     status;
06893 
06894   assert(wand != (MagickWand *) NULL);
06895   assert(wand->signature == WandSignature);
06896   if (wand->debug != MagickFalse)
06897     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06898   if (wand->images == (Image *) NULL)
06899     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06900   status=NormalizeImageChannel(wand->images,channel);
06901   if (status == MagickFalse)
06902     InheritException(wand->exception,&wand->images->exception);
06903   return(status);
06904 }
06905 
06906 /*
06907 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06908 %                                                                             %
06909 %                                                                             %
06910 %                                                                             %
06911 %   M a g i c k O i l P a i n t I m a g e                                     %
06912 %                                                                             %
06913 %                                                                             %
06914 %                                                                             %
06915 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06916 %
06917 %  MagickOilPaintImage() applies a special effect filter that simulates an oil
06918 %  painting.  Each pixel is replaced by the most frequent color occurring
06919 %  in a circular region defined by radius.
06920 %
06921 %  The format of the MagickOilPaintImage method is:
06922 %
06923 %      MagickBooleanType MagickOilPaintImage(MagickWand *wand,
06924 %        const double radius)
06925 %
06926 %  A description of each parameter follows:
06927 %
06928 %    o wand: the magick wand.
06929 %
06930 %    o radius: the radius of the circular neighborhood.
06931 %
06932 */
06933 WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand,
06934   const double radius)
06935 {
06936   Image
06937     *paint_image;
06938 
06939   assert(wand != (MagickWand *) NULL);
06940   assert(wand->signature == WandSignature);
06941   if (wand->debug != MagickFalse)
06942     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
06943   if (wand->images == (Image *) NULL)
06944     ThrowWandException(WandError,"ContainsNoImages",wand->name);
06945   paint_image=OilPaintImage(wand->images,radius,wand->exception);
06946   if (paint_image == (Image *) NULL)
06947     return(MagickFalse);
06948   ReplaceImageInList(&wand->images,paint_image);
06949   return(MagickTrue);
06950 }
06951 
06952 /*
06953 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06954 %                                                                             %
06955 %                                                                             %
06956 %                                                                             %
06957 %   M a g i c k O p a q u e P a i n t I m a g e                               %
06958 %                                                                             %
06959 %                                                                             %
06960 %                                                                             %
06961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
06962 %
06963 %  MagickOpaquePaintImage() changes any pixel that matches color with the color
06964 %  defined by fill.
06965 %
06966 %  The format of the MagickOpaquePaintImage method is:
06967 %
06968 %      MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
06969 %        const PixelWand *target,const PixelWand *fill,const double fuzz,
06970 %        const MagickBooleanType invert)
06971 %      MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
06972 %        const ChannelType channel,const PixelWand *target,
06973 %        const PixelWand *fill,const double fuzz,const MagickBooleanType invert)
06974 %
06975 %  A description of each parameter follows:
06976 %
06977 %    o wand: the magick wand.
06978 %
06979 %    o channel: the channel(s).
06980 %
06981 %    o target: Change this target color to the fill color within the image.
06982 %
06983 %    o fill: the fill pixel wand.
06984 %
06985 %    o fuzz: By default target must match a particular pixel color
06986 %      exactly.  However, in many cases two colors may differ by a small amount.
06987 %      The fuzz member of image defines how much tolerance is acceptable to
06988 %      consider two colors as the same.  For example, set fuzz to 10 and the
06989 %      color red at intensities of 100 and 102 respectively are now interpreted
06990 %      as the same color for the purposes of the floodfill.
06991 %
06992 %    o invert: paint any pixel that does not match the target color.
06993 %
06994 */
06995 
06996 WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand,
06997   const PixelWand *target,const PixelWand *fill,const double fuzz,
06998   const MagickBooleanType invert)
06999 {
07000   MagickBooleanType
07001     status;
07002 
07003   status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz,
07004     invert);
07005   return(status);
07006 }
07007 
07008 WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand,
07009   const ChannelType channel,const PixelWand *target,const PixelWand *fill,
07010   const double fuzz,const MagickBooleanType invert)
07011 {
07012   MagickBooleanType
07013     status;
07014 
07015   MagickPixelPacket
07016     fill_pixel,
07017     target_pixel;
07018 
07019   assert(wand != (MagickWand *) NULL);
07020   assert(wand->signature == WandSignature);
07021   if (wand->debug != MagickFalse)
07022     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07023   if (wand->images == (Image *) NULL)
07024     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07025   PixelGetMagickColor(target,&target_pixel);
07026   PixelGetMagickColor(fill,&fill_pixel);
07027   wand->images->fuzz=fuzz;
07028   status=OpaquePaintImageChannel(wand->images,channel,&target_pixel,
07029     &fill_pixel,invert);
07030   if (status == MagickFalse)
07031     InheritException(wand->exception,&wand->images->exception);
07032   return(status);
07033 }
07034 
07035 /*
07036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07037 %                                                                             %
07038 %                                                                             %
07039 %                                                                             %
07040 %   M a g i c k O p t i m i z e I m a g e L a y e r s                         %
07041 %                                                                             %
07042 %                                                                             %
07043 %                                                                             %
07044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07045 %
07046 %  MagickOptimizeImageLayers() compares each image the GIF disposed forms of the
07047 %  previous image in the sequence.  From this it attempts to select the
07048 %  smallest cropped image to replace each frame, while preserving the results
07049 %  of the animation.
07050 %
07051 %  The format of the MagickOptimizeImageLayers method is:
07052 %
07053 %      MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
07054 %
07055 %  A description of each parameter follows:
07056 %
07057 %    o wand: the magick wand.
07058 %
07059 */
07060 WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand)
07061 {
07062   Image
07063     *optimize_image;
07064 
07065   assert(wand != (MagickWand *) NULL);
07066   assert(wand->signature == WandSignature);
07067   if (wand->debug != MagickFalse)
07068     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07069   if (wand->images == (Image *) NULL)
07070     return((MagickWand *) NULL);
07071   optimize_image=OptimizeImageLayers(wand->images,wand->exception);
07072   if (optimize_image == (Image *) NULL)
07073     return((MagickWand *) NULL);
07074   return(CloneMagickWandFromImages(wand,optimize_image));
07075 }
07076 
07077 /*
07078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07079 %                                                                             %
07080 %                                                                             %
07081 %                                                                             %
07082 %     M a g i c k O r d e r e d P o s t e r i z e I m a g e                   %
07083 %                                                                             %
07084 %                                                                             %
07085 %                                                                             %
07086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07087 %
07088 %  MagickOrderedPosterizeImage() performs an ordered dither based on a number
07089 %  of pre-defined dithering threshold maps, but over multiple intensity levels,
07090 %  which can be different for different channels, according to the input
07091 %  arguments.
07092 %
07093 %  The format of the MagickOrderedPosterizeImage method is:
07094 %
07095 %      MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
07096 %        const char *threshold_map)
07097 %      MagickBooleanType MagickOrderedPosterizeImageChannel(MagickWand *wand,
07098 %        const ChannelType channel,const char *threshold_map)
07099 %
07100 %  A description of each parameter follows:
07101 %
07102 %    o image: the image.
07103 %
07104 %    o channel: the channel or channels to be thresholded.
07105 %
07106 %    o threshold_map: A string containing the name of the threshold dither
07107 %      map to use, followed by zero or more numbers representing the number of
07108 %      color levels tho dither between.
07109 %
07110 %      Any level number less than 2 is equivelent to 2, and means only binary
07111 %      dithering will be applied to each color channel.
07112 %
07113 %      No numbers also means a 2 level (bitmap) dither will be applied to all
07114 %      channels, while a single number is the number of levels applied to each
07115 %      channel in sequence.  More numbers will be applied in turn to each of
07116 %      the color channels.
07117 %
07118 %      For example: "o3x3,6" generates a 6 level posterization of the image
07119 %      with a ordered 3x3 diffused pixel dither being applied between each
07120 %      level. While checker,8,8,4 will produce a 332 colormaped image with
07121 %      only a single checkerboard hash pattern (50% grey) between each color
07122 %      level, to basically double the number of color levels with a bare
07123 %      minimim of dithering.
07124 %
07125 */
07126 
07127 WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand,
07128   const char *threshold_map)
07129 {
07130   MagickBooleanType
07131     status;
07132 
07133   status=MagickOrderedPosterizeImageChannel(wand,DefaultChannels,threshold_map);
07134   return(status);
07135 }
07136 
07137 WandExport MagickBooleanType MagickOrderedPosterizeImageChannel(
07138   MagickWand *wand,const ChannelType channel,const char *threshold_map)
07139 {
07140   MagickBooleanType
07141     status;
07142 
07143   assert(wand != (MagickWand *) NULL);
07144   assert(wand->signature == WandSignature);
07145   if (wand->debug != MagickFalse)
07146     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07147   if (wand->images == (Image *) NULL)
07148     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07149   status=OrderedPosterizeImageChannel(wand->images,channel,threshold_map,
07150     wand->exception);
07151   return(status);
07152 }
07153 
07154 /*
07155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07156 %                                                                             %
07157 %                                                                             %
07158 %                                                                             %
07159 %   M a g i c k P i n g I m a g e                                             %
07160 %                                                                             %
07161 %                                                                             %
07162 %                                                                             %
07163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07164 %
07165 %  MagickPingImage() is like MagickReadImage() except the only valid
07166 %  information returned is the image width, height, size, and format.  It
07167 %  is designed to efficiently obtain this information from a file without
07168 %  reading the entire image sequence into memory.
07169 %
07170 %  The format of the MagickPingImage method is:
07171 %
07172 %      MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename)
07173 %
07174 %  A description of each parameter follows:
07175 %
07176 %    o wand: the magick wand.
07177 %
07178 %    o filename: the image filename.
07179 %
07180 */
07181 WandExport MagickBooleanType MagickPingImage(MagickWand *wand,
07182   const char *filename)
07183 {
07184   Image
07185     *images;
07186 
07187   ImageInfo
07188     *ping_info;
07189 
07190   assert(wand != (MagickWand *) NULL);
07191   assert(wand->signature == WandSignature);
07192   if (wand->debug != MagickFalse)
07193     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07194   ping_info=CloneImageInfo(wand->image_info);
07195   if (filename != (const char *) NULL)
07196     (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent);
07197   images=PingImage(ping_info,wand->exception);
07198   ping_info=DestroyImageInfo(ping_info);
07199   if (images == (Image *) NULL)
07200     return(MagickFalse);
07201   return(InsertImageInWand(wand,images));
07202 }
07203 
07204 /*
07205 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07206 %                                                                             %
07207 %                                                                             %
07208 %                                                                             %
07209 %   M a g i c k P i n g I m a g e B l o b                                     %
07210 %                                                                             %
07211 %                                                                             %
07212 %                                                                             %
07213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07214 %
07215 %  MagickPingImageBlob() pings an image or image sequence from a blob.
07216 %
07217 %  The format of the MagickPingImageBlob method is:
07218 %
07219 %      MagickBooleanType MagickPingImageBlob(MagickWand *wand,
07220 %        const void *blob,const size_t length)
07221 %
07222 %  A description of each parameter follows:
07223 %
07224 %    o wand: the magick wand.
07225 %
07226 %    o blob: the blob.
07227 %
07228 %    o length: the blob length.
07229 %
07230 */
07231 WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand,
07232   const void *blob,const size_t length)
07233 {
07234   Image
07235     *images;
07236 
07237   ImageInfo
07238     *read_info;
07239 
07240   assert(wand != (MagickWand *) NULL);
07241   assert(wand->signature == WandSignature);
07242   if (wand->debug != MagickFalse)
07243     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07244   read_info=CloneImageInfo(wand->image_info);
07245   SetImageInfoBlob(read_info,blob,length);
07246   images=PingImage(read_info,wand->exception);
07247   read_info=DestroyImageInfo(read_info);
07248   if (images == (Image *) NULL)
07249     return(MagickFalse);
07250   return(InsertImageInWand(wand,images));
07251 }
07252 
07253 /*
07254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07255 %                                                                             %
07256 %                                                                             %
07257 %                                                                             %
07258 %   M a g i c k P i n g I m a g e F i l e                                     %
07259 %                                                                             %
07260 %                                                                             %
07261 %                                                                             %
07262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07263 %
07264 %  MagickPingImageFile() pings an image or image sequence from an open file
07265 %  descriptor.
07266 %
07267 %  The format of the MagickPingImageFile method is:
07268 %
07269 %      MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
07270 %
07271 %  A description of each parameter follows:
07272 %
07273 %    o wand: the magick wand.
07274 %
07275 %    o file: the file descriptor.
07276 %
07277 */
07278 WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file)
07279 {
07280   Image
07281     *images;
07282 
07283   ImageInfo
07284     *read_info;
07285 
07286   assert(wand != (MagickWand *) NULL);
07287   assert(wand->signature == WandSignature);
07288   assert(file != (FILE *) NULL);
07289   if (wand->debug != MagickFalse)
07290     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07291   read_info=CloneImageInfo(wand->image_info);
07292   SetImageInfoFile(read_info,file);
07293   images=PingImage(read_info,wand->exception);
07294   read_info=DestroyImageInfo(read_info);
07295   if (images == (Image *) NULL)
07296     return(MagickFalse);
07297   return(InsertImageInWand(wand,images));
07298 }
07299 
07300 /*
07301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07302 %                                                                             %
07303 %                                                                             %
07304 %                                                                             %
07305 %   M a g i c k P o l a r o i d I m a g e                                     %
07306 %                                                                             %
07307 %                                                                             %
07308 %                                                                             %
07309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07310 %
07311 %  MagickPolaroidImage() simulates a Polaroid picture.
07312 %
07313 %  The format of the MagickPolaroidImage method is:
07314 %
07315 %      MagickBooleanType MagickPolaroidImage(MagickWand *wand,
07316 %        const DrawingWand *drawing_wand,const double angle)
07317 %
07318 %  A description of each parameter follows:
07319 %
07320 %    o wand: the magick wand.
07321 %
07322 %    o drawing_wand: the draw wand.
07323 %
07324 %    o angle: Apply the effect along this angle.
07325 %
07326 */
07327 WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
07328   const DrawingWand *drawing_wand,const double angle)
07329 {
07330   DrawInfo
07331     *draw_info;
07332 
07333   Image
07334     *polaroid_image;
07335 
07336   assert(wand != (MagickWand *) NULL);
07337   assert(wand->signature == WandSignature);
07338   if (wand->debug != MagickFalse)
07339     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07340   if (wand->images == (Image *) NULL)
07341     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07342   draw_info=PeekDrawingWand(drawing_wand);
07343   if (draw_info == (DrawInfo *) NULL)
07344     return(MagickFalse);
07345   polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception);
07346   if (polaroid_image == (Image *) NULL)
07347     return(MagickFalse);
07348   ReplaceImageInList(&wand->images,polaroid_image);
07349   return(MagickTrue);
07350 }
07351 
07352 /*
07353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07354 %                                                                             %
07355 %                                                                             %
07356 %                                                                             %
07357 %   M a g i c k P o s t e r i z e I m a g e                                   %
07358 %                                                                             %
07359 %                                                                             %
07360 %                                                                             %
07361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07362 %
07363 %  MagickPosterizeImage() reduces the image to a limited number of color level.
07364 %
07365 %  The format of the MagickPosterizeImage method is:
07366 %
07367 %      MagickBooleanType MagickPosterizeImage(MagickWand *wand,
07368 %        const unsigned levels,const MagickBooleanType dither)
07369 %
07370 %  A description of each parameter follows:
07371 %
07372 %    o wand: the magick wand.
07373 %
07374 %    o levels: Number of color levels allowed in each channel.  Very low values
07375 %      (2, 3, or 4) have the most visible effect.
07376 %
07377 %    o dither: Set this integer value to something other than zero to dither
07378 %      the mapped image.
07379 %
07380 */
07381 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
07382   const unsigned long levels,const MagickBooleanType dither)
07383 {
07384   MagickBooleanType
07385     status;
07386 
07387   assert(wand != (MagickWand *) NULL);
07388   assert(wand->signature == WandSignature);
07389   if (wand->debug != MagickFalse)
07390     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07391   if (wand->images == (Image *) NULL)
07392     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07393   status=PosterizeImage(wand->images,levels,dither);
07394   if (status == MagickFalse)
07395     InheritException(wand->exception,&wand->images->exception);
07396   return(status);
07397 }
07398 
07399 /*
07400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07401 %                                                                             %
07402 %                                                                             %
07403 %                                                                             %
07404 %   M a g i c k P r e v i e w I m a g e s                                     %
07405 %                                                                             %
07406 %                                                                             %
07407 %                                                                             %
07408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07409 %
07410 %  MagickPreviewImages() tiles 9 thumbnails of the specified image with an
07411 %  image processing operation applied at varying strengths.  This helpful
07412 %  to quickly pin-point an appropriate parameter for an image processing
07413 %  operation.
07414 %
07415 %  The format of the MagickPreviewImages method is:
07416 %
07417 %      MagickWand *MagickPreviewImages(MagickWand *wand,
07418 %        const PreviewType preview)
07419 %
07420 %  A description of each parameter follows:
07421 %
07422 %    o wand: the magick wand.
07423 %
07424 %    o preview: the preview type.
07425 %
07426 */
07427 WandExport MagickWand *MagickPreviewImages(MagickWand *wand,
07428   const PreviewType preview)
07429 {
07430   Image
07431     *preview_image;
07432 
07433   assert(wand != (MagickWand *) NULL);
07434   assert(wand->signature == WandSignature);
07435   if (wand->debug != MagickFalse)
07436     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07437   if (wand->images == (Image *) NULL)
07438     return((MagickWand *) NULL);
07439   preview_image=PreviewImage(wand->images,preview,wand->exception);
07440   if (preview_image == (Image *) NULL)
07441     return((MagickWand *) NULL);
07442   return(CloneMagickWandFromImages(wand,preview_image));
07443 }
07444 
07445 /*
07446 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07447 %                                                                             %
07448 %                                                                             %
07449 %                                                                             %
07450 %   M a g i c k P r e v i o u s I m a g e                                     %
07451 %                                                                             %
07452 %                                                                             %
07453 %                                                                             %
07454 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07455 %
07456 %  MagickPreviousImage() assocates the previous image in an image list with
07457 %  the magick wand.
07458 %
07459 %  The format of the MagickPreviousImage method is:
07460 %
07461 %      MagickBooleanType MagickPreviousImage(MagickWand *wand)
07462 %
07463 %  A description of each parameter follows:
07464 %
07465 %    o wand: the magick wand.
07466 %
07467 */
07468 WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
07469 {
07470   assert(wand != (MagickWand *) NULL);
07471   assert(wand->signature == WandSignature);
07472   if (wand->debug != MagickFalse)
07473     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07474   if (wand->images == (Image *) NULL)
07475     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07476   if (wand->pend != MagickFalse)
07477     {
07478       wand->pend=MagickFalse;
07479       return(MagickTrue);
07480     }
07481   if (GetPreviousImageInList(wand->images) == (Image *) NULL)
07482     {
07483       wand->pend=MagickTrue;
07484       return(MagickFalse);
07485     }
07486   wand->images=GetPreviousImageInList(wand->images);
07487   return(MagickTrue);
07488 }
07489 
07490 /*
07491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07492 %                                                                             %
07493 %                                                                             %
07494 %                                                                             %
07495 %   M a g i c k Q u a n t i z e I m a g e                                     %
07496 %                                                                             %
07497 %                                                                             %
07498 %                                                                             %
07499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07500 %
07501 %  MagickQuantizeImage() analyzes the colors within a reference image and
07502 %  chooses a fixed number of colors to represent the image.  The goal of the
07503 %  algorithm is to minimize the color difference between the input and output
07504 %  image while minimizing the processing time.
07505 %
07506 %  The format of the MagickQuantizeImage method is:
07507 %
07508 %      MagickBooleanType MagickQuantizeImage(MagickWand *wand,
07509 %        const unsigned long number_colors,const ColorspaceType colorspace,
07510 %        const unsigned long treedepth,const MagickBooleanType dither,
07511 %        const MagickBooleanType measure_error)
07512 %
07513 %  A description of each parameter follows:
07514 %
07515 %    o wand: the magick wand.
07516 %
07517 %    o number_colors: the number of colors.
07518 %
07519 %    o colorspace: Perform color reduction in this colorspace, typically
07520 %      RGBColorspace.
07521 %
07522 %    o treedepth: Normally, this integer value is zero or one.  A zero or
07523 %      one tells Quantize to choose a optimal tree depth of Log4(number_colors).%      A tree of this depth generally allows the best representation of the
07524 %      reference image with the least amount of memory and the fastest
07525 %      computational speed.  In some cases, such as an image with low color
07526 %      dispersion (a few number of colors), a value other than
07527 %      Log4(number_colors) is required.  To expand the color tree completely,
07528 %      use a value of 8.
07529 %
07530 %    o dither: A value other than zero distributes the difference between an
07531 %      original image and the corresponding color reduced image to
07532 %      neighboring pixels along a Hilbert curve.
07533 %
07534 %    o measure_error: A value other than zero measures the difference between
07535 %      the original and quantized images.  This difference is the total
07536 %      quantization error.  The error is computed by summing over all pixels
07537 %      in an image the distance squared in RGB space between each reference
07538 %      pixel value and its quantized value.
07539 %
07540 */
07541 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
07542   const unsigned long number_colors,const ColorspaceType colorspace,
07543   const unsigned long treedepth,const MagickBooleanType dither,
07544   const MagickBooleanType measure_error)
07545 {
07546   MagickBooleanType
07547     status;
07548 
07549   QuantizeInfo
07550     *quantize_info;
07551 
07552   assert(wand != (MagickWand *) NULL);
07553   assert(wand->signature == WandSignature);
07554   if (wand->debug != MagickFalse)
07555     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07556   if (wand->images == (Image *) NULL)
07557     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07558   quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
07559   quantize_info->number_colors=number_colors;
07560   quantize_info->dither=dither;
07561   quantize_info->tree_depth=treedepth;
07562   quantize_info->colorspace=colorspace;
07563   quantize_info->measure_error=measure_error;
07564   status=QuantizeImage(quantize_info,wand->images);
07565   if (status == MagickFalse)
07566     InheritException(wand->exception,&wand->images->exception);
07567   quantize_info=DestroyQuantizeInfo(quantize_info);
07568   return(status);
07569 }
07570 
07571 /*
07572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07573 %                                                                             %
07574 %                                                                             %
07575 %                                                                             %
07576 %   M a g i c k Q u a n t i z e I m a g e s                                   %
07577 %                                                                             %
07578 %                                                                             %
07579 %                                                                             %
07580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07581 %
07582 %  MagickQuantizeImages() analyzes the colors within a sequence of images and
07583 %  chooses a fixed number of colors to represent the image.  The goal of the
07584 %  algorithm is to minimize the color difference between the input and output
07585 %  image while minimizing the processing time.
07586 %
07587 %  The format of the MagickQuantizeImages method is:
07588 %
07589 %      MagickBooleanType MagickQuantizeImages(MagickWand *wand,
07590 %        const unsigned long number_colors,const ColorspaceType colorspace,
07591 %        const unsigned long treedepth,const MagickBooleanType dither,
07592 %        const MagickBooleanType measure_error)
07593 %
07594 %  A description of each parameter follows:
07595 %
07596 %    o wand: the magick wand.
07597 %
07598 %    o number_colors: the number of colors.
07599 %
07600 %    o colorspace: Perform color reduction in this colorspace, typically
07601 %      RGBColorspace.
07602 %
07603 %    o treedepth: Normally, this integer value is zero or one.  A zero or
07604 %      one tells Quantize to choose a optimal tree depth of Log4(number_colors).%      A tree of this depth generally allows the best representation of the
07605 %      reference image with the least amount of memory and the fastest
07606 %      computational speed.  In some cases, such as an image with low color
07607 %      dispersion (a few number of colors), a value other than
07608 %      Log4(number_colors) is required.  To expand the color tree completely,
07609 %      use a value of 8.
07610 %
07611 %    o dither: A value other than zero distributes the difference between an
07612 %      original image and the corresponding color reduced algorithm to
07613 %      neighboring pixels along a Hilbert curve.
07614 %
07615 %    o measure_error: A value other than zero measures the difference between
07616 %      the original and quantized images.  This difference is the total
07617 %      quantization error.  The error is computed by summing over all pixels
07618 %      in an image the distance squared in RGB space between each reference
07619 %      pixel value and its quantized value.
07620 %
07621 */
07622 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
07623   const unsigned long number_colors,const ColorspaceType colorspace,
07624   const unsigned long treedepth,const MagickBooleanType dither,
07625   const MagickBooleanType measure_error)
07626 {
07627   MagickBooleanType
07628     status;
07629 
07630   QuantizeInfo
07631     *quantize_info;
07632 
07633   assert(wand != (MagickWand *) NULL);
07634   assert(wand->signature == WandSignature);
07635   if (wand->debug != MagickFalse)
07636     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07637   if (wand->images == (Image *) NULL)
07638     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07639   quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
07640   quantize_info->number_colors=number_colors;
07641   quantize_info->dither=dither;
07642   quantize_info->tree_depth=treedepth;
07643   quantize_info->colorspace=colorspace;
07644   quantize_info->measure_error=measure_error;
07645   status=QuantizeImages(quantize_info,wand->images);
07646   if (status == MagickFalse)
07647     InheritException(wand->exception,&wand->images->exception);
07648   quantize_info=DestroyQuantizeInfo(quantize_info);
07649   return(status);
07650 }
07651 
07652 /*
07653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07654 %                                                                             %
07655 %                                                                             %
07656 %                                                                             %
07657 %   M a g i c k R a d i a l B l u r I m a g e                                 %
07658 %                                                                             %
07659 %                                                                             %
07660 %                                                                             %
07661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07662 %
07663 %  MagickRadialBlurImage() radial blurs an image.
07664 %
07665 %  The format of the MagickRadialBlurImage method is:
07666 %
07667 %      MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
07668 %        const double angle)
07669 %      MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
07670 %        const ChannelType channel,const double angle)
07671 %
07672 %  A description of each parameter follows:
07673 %
07674 %    o wand: the magick wand.
07675 %
07676 %    o channel: the image channel(s).
07677 %
07678 %    o angle: the angle of the blur in degrees.
07679 %
07680 */
07681 WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
07682   const double angle)
07683 {
07684   MagickBooleanType
07685     status;
07686 
07687   status=MagickRadialBlurImageChannel(wand,DefaultChannels,angle);
07688   return(status);
07689 }
07690 
07691 WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
07692   const ChannelType channel,const double angle)
07693 {
07694   Image
07695     *blur_image;
07696 
07697   assert(wand != (MagickWand *) NULL);
07698   assert(wand->signature == WandSignature);
07699   if (wand->debug != MagickFalse)
07700     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07701   if (wand->images == (Image *) NULL)
07702     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07703   blur_image=RadialBlurImageChannel(wand->images,channel,angle,
07704     wand->exception);
07705   if (blur_image == (Image *) NULL)
07706     return(MagickFalse);
07707   ReplaceImageInList(&wand->images,blur_image);
07708   return(MagickTrue);
07709 }
07710 
07711 /*
07712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07713 %                                                                             %
07714 %                                                                             %
07715 %                                                                             %
07716 %   M a g i c k R a i s e I m a g e                                           %
07717 %                                                                             %
07718 %                                                                             %
07719 %                                                                             %
07720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07721 %
07722 %  MagickRaiseImage() creates a simulated three-dimensional button-like effect
07723 %  by lightening and darkening the edges of the image.  Members width and
07724 %  height of raise_info define the width of the vertical and horizontal
07725 %  edge of the effect.
07726 %
07727 %  The format of the MagickRaiseImage method is:
07728 %
07729 %      MagickBooleanType MagickRaiseImage(MagickWand *wand,
07730 %        const unsigned long width,const unsigned long height,const long x,
07731 %        const long y,const MagickBooleanType raise)
07732 %
07733 %  A description of each parameter follows:
07734 %
07735 %    o wand: the magick wand.
07736 %
07737 %    o width,height,x,y:  Define the dimensions of the area to raise.
07738 %
07739 %    o raise: A value other than zero creates a 3-D raise effect,
07740 %      otherwise it has a lowered effect.
07741 %
07742 */
07743 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
07744   const unsigned long width,const unsigned long height,const long x,
07745   const long y,const MagickBooleanType raise)
07746 {
07747   MagickBooleanType
07748     status;
07749 
07750   RectangleInfo
07751     raise_info;
07752 
07753   assert(wand != (MagickWand *) NULL);
07754   assert(wand->signature == WandSignature);
07755   if (wand->debug != MagickFalse)
07756     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07757   if (wand->images == (Image *) NULL)
07758     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07759   raise_info.width=width;
07760   raise_info.height=height;
07761   raise_info.x=x;
07762   raise_info.y=y;
07763   status=RaiseImage(wand->images,&raise_info,raise);
07764   if (status == MagickFalse)
07765     InheritException(wand->exception,&wand->images->exception);
07766   return(status);
07767 }
07768 
07769 /*
07770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07771 %                                                                             %
07772 %                                                                             %
07773 %                                                                             %
07774 %   M a g i c k R a n d o m T h r e s h o l d I m a g e                       %
07775 %                                                                             %
07776 %                                                                             %
07777 %                                                                             %
07778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07779 %
07780 %  MagickRandomThresholdImage() changes the value of individual pixels based on
07781 %  the intensity of each pixel compared to threshold.  The result is a
07782 %  high-contrast, two color image.
07783 %
07784 %  The format of the MagickRandomThresholdImage method is:
07785 %
07786 %      MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
07787 %        const double low,const double high)
07788 %      MagickBooleanType MagickRandomThresholdImageChannel(MagickWand *wand,
07789 %        const ChannelType channel,const double low,const double high)
07790 %
07791 %  A description of each parameter follows:
07792 %
07793 %    o wand: the magick wand.
07794 %
07795 %    o channel: the image channel(s).
07796 %
07797 %    o low,high: Specify the high and low thresholds.  These values range from
07798 %      0 to QuantumRange.
07799 %
07800 */
07801 
07802 WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand,
07803   const double low,const double high)
07804 {
07805   MagickBooleanType
07806     status;
07807 
07808   status=MagickRandomThresholdImageChannel(wand,DefaultChannels,low,high);
07809   return(status);
07810 }
07811 
07812 WandExport MagickBooleanType MagickRandomThresholdImageChannel(
07813   MagickWand *wand,const ChannelType channel,const double low,
07814   const double high)
07815 {
07816   char
07817     threshold[MaxTextExtent];
07818 
07819   MagickBooleanType
07820     status;
07821 
07822   assert(wand != (MagickWand *) NULL);
07823   assert(wand->signature == WandSignature);
07824   if (wand->debug != MagickFalse)
07825     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07826   if (wand->images == (Image *) NULL)
07827     ThrowWandException(WandError,"ContainsNoImages",wand->name);
07828   (void) FormatMagickString(threshold,MaxTextExtent,"%gx%g",low,high);
07829   status=RandomThresholdImageChannel(wand->images,channel,threshold,
07830     wand->exception);
07831   if (status == MagickFalse)
07832     InheritException(wand->exception,&wand->images->exception);
07833   return(status);
07834 }
07835 
07836 /*
07837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07838 %                                                                             %
07839 %                                                                             %
07840 %                                                                             %
07841 %   M a g i c k R e a d I m a g e                                             %
07842 %                                                                             %
07843 %                                                                             %
07844 %                                                                             %
07845 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07846 %
07847 %  MagickReadImage() reads an image or image sequence.  The images are inserted
07848 %  at the current image pointer position.   Use MagickSetFirstIterator(),
07849 %  MagickSetLastIterator, or MagickSetImageIndex() to specify the current
07850 %  image pointer position at the beginning of the image list, the end, or
07851 %  anywhere in-between respectively.
07852 %
07853 %  The format of the MagickReadImage method is:
07854 %
07855 %      MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename)
07856 %
07857 %  A description of each parameter follows:
07858 %
07859 %    o wand: the magick wand.
07860 %
07861 %    o filename: the image filename.
07862 %
07863 */
07864 WandExport MagickBooleanType MagickReadImage(MagickWand *wand,
07865   const char *filename)
07866 {
07867   Image
07868     *images;
07869 
07870   ImageInfo
07871     *read_info;
07872 
07873   assert(wand != (MagickWand *) NULL);
07874   assert(wand->signature == WandSignature);
07875   if (wand->debug != MagickFalse)
07876     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07877   read_info=CloneImageInfo(wand->image_info);
07878   if (filename != (const char *) NULL)
07879     (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
07880   images=ReadImage(read_info,wand->exception);
07881   read_info=DestroyImageInfo(read_info);
07882   if (images == (Image *) NULL)
07883     return(MagickFalse);
07884   return(InsertImageInWand(wand,images));
07885 }
07886 
07887 /*
07888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07889 %                                                                             %
07890 %                                                                             %
07891 %                                                                             %
07892 %   M a g i c k R e a d I m a g e B l o b                                     %
07893 %                                                                             %
07894 %                                                                             %
07895 %                                                                             %
07896 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07897 %
07898 %  MagickReadImageBlob() reads an image or image sequence from a blob.
07899 %
07900 %  The format of the MagickReadImageBlob method is:
07901 %
07902 %      MagickBooleanType MagickReadImageBlob(MagickWand *wand,
07903 %        const void *blob,const size_t length)
07904 %
07905 %  A description of each parameter follows:
07906 %
07907 %    o wand: the magick wand.
07908 %
07909 %    o blob: the blob.
07910 %
07911 %    o length: the blob length.
07912 %
07913 */
07914 WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand,
07915   const void *blob,const size_t length)
07916 {
07917   Image
07918     *images;
07919 
07920   assert(wand != (MagickWand *) NULL);
07921   assert(wand->signature == WandSignature);
07922   if (wand->debug != MagickFalse)
07923     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07924   images=BlobToImage(wand->image_info,blob,length,wand->exception);
07925   if (images == (Image *) NULL)
07926     return(MagickFalse);
07927   return(InsertImageInWand(wand,images));
07928 }
07929 
07930 /*
07931 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07932 %                                                                             %
07933 %                                                                             %
07934 %                                                                             %
07935 %   M a g i c k R e a d I m a g e F i l e                                     %
07936 %                                                                             %
07937 %                                                                             %
07938 %                                                                             %
07939 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07940 %
07941 %  MagickReadImageFile() reads an image or image sequence from an open file
07942 %  descriptor.
07943 %
07944 %  The format of the MagickReadImageFile method is:
07945 %
07946 %      MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
07947 %
07948 %  A description of each parameter follows:
07949 %
07950 %    o wand: the magick wand.
07951 %
07952 %    o file: the file descriptor.
07953 %
07954 */
07955 WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
07956 {
07957   Image
07958     *images;
07959 
07960   ImageInfo
07961     *read_info;
07962 
07963   assert(wand != (MagickWand *) NULL);
07964   assert(wand->signature == WandSignature);
07965   assert(file != (FILE *) NULL);
07966   if (wand->debug != MagickFalse)
07967     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
07968   read_info=CloneImageInfo(wand->image_info);
07969   SetImageInfoFile(read_info,file);
07970   images=ReadImage(read_info,wand->exception);
07971   read_info=DestroyImageInfo(read_info);
07972   if (images == (Image *) NULL)
07973     return(MagickFalse);
07974   return(InsertImageInWand(wand,images));
07975 }
07976 
07977 /*
07978 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07979 %                                                                             %
07980 %                                                                             %
07981 %                                                                             %
07982 %   M a g i c k R e c o l o r I m a g e                                       %
07983 %                                                                             %
07984 %                                                                             %
07985 %                                                                             %
07986 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
07987 %
07988 %  MagickRecolorImage() translate, scale, shear, or rotate image colors.
07989 %  Although you can use variable sized matrices, typically you use a 5 x 5 for
07990 %  an RGBA image and a 6x6 for CMYKA.  Populate the last row with normalized
07991 %  values to translate.
07992 %
07993 %  The format of the MagickRecolorImage method is:
07994 %
07995 %      MagickBooleanType MagickRecolorImage(MagickWand *wand,
07996 %        const unsigned long order,const double *color_matrix)
07997 %
07998 %  A description of each parameter follows:
07999 %
08000 %    o wand: the magick wand.
08001 %
08002 %    o order: the number of columns and rows in the color matrix.
08003 %
08004 %    o color_matrix: An array of doubles representing the color matrix.
08005 %
08006 */
08007 WandExport MagickBooleanType MagickRecolorImage(MagickWand *wand,
08008   const unsigned long order,const double *color_matrix)
08009 {
08010   Image
08011     *transform_image;
08012 
08013   assert(wand != (MagickWand *) NULL);
08014   assert(wand->signature == WandSignature);
08015   if (wand->debug != MagickFalse)
08016     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08017   if (color_matrix == (const double *) NULL)
08018     return(MagickFalse);
08019   if (wand->images == (Image *) NULL)
08020     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08021   transform_image=RecolorImage(wand->images,order,color_matrix,
08022     wand->exception);
08023   if (transform_image == (Image *) NULL)
08024     return(MagickFalse);
08025   ReplaceImageInList(&wand->images,transform_image);
08026   return(MagickTrue);
08027 }
08028 
08029 /*
08030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08031 %                                                                             %
08032 %                                                                             %
08033 %                                                                             %
08034 %     M a g i c k R e d u c e N o i s e I m a g e                             %
08035 %                                                                             %
08036 %                                                                             %
08037 %                                                                             %
08038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08039 %
08040 %  MagickReduceNoiseImage() smooths the contours of an image while still
08041 %  preserving edge information.  The algorithm works by replacing each pixel
08042 %  with its neighbor closest in value.  A neighbor is defined by radius.  Use
08043 %  a radius of 0 and ReduceNoise() selects a suitable radius for you.
08044 %
08045 %  The format of the MagickReduceNoiseImage method is:
08046 %
08047 %      MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
08048 %        const double radius)
08049 %
08050 %  A description of each parameter follows:
08051 %
08052 %    o wand: the magick wand.
08053 %
08054 %    o radius: the radius of the pixel neighborhood.
08055 %
08056 */
08057 WandExport MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
08058   const double radius)
08059 {
08060   Image
08061     *noise_image;
08062 
08063   assert(wand != (MagickWand *) NULL);
08064   assert(wand->signature == WandSignature);
08065   if (wand->debug != MagickFalse)
08066     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08067   if (wand->images == (Image *) NULL)
08068     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08069   noise_image=ReduceNoiseImage(wand->images,radius,wand->exception);
08070   if (noise_image == (Image *) NULL)
08071     return(MagickFalse);
08072   ReplaceImageInList(&wand->images,noise_image);
08073   return(MagickTrue);
08074 }
08075 
08076 /*
08077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08078 %                                                                             %
08079 %                                                                             %
08080 %                                                                             %
08081 %   M a g i c k R e m a p I m a g e                                           %
08082 %                                                                             %
08083 %                                                                             %
08084 %                                                                             %
08085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08086 %
08087 %  MagickRemapImage() replaces the colors of an image with the closest color
08088 %  from a reference image.
08089 %
08090 %  The format of the MagickRemapImage method is:
08091 %
08092 %      MagickBooleanType MagickRemapImage(MagickWand *wand,
08093 %        const MagickWand *remap_wand,const DitherMethod method)
08094 %
08095 %  A description of each parameter follows:
08096 %
08097 %    o wand: the magick wand.
08098 %
08099 %    o affinity: the affinity wand.
08100 %
08101 %    o method: choose from these dither methods: NoDitherMethod,
08102 %      RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
08103 %
08104 */
08105 WandExport MagickBooleanType MagickRemapImage(MagickWand *wand,
08106   const MagickWand *remap_wand,const DitherMethod method)
08107 {
08108   MagickBooleanType
08109     status;
08110 
08111   QuantizeInfo
08112     *quantize_info;
08113 
08114   assert(wand != (MagickWand *) NULL);
08115   assert(wand->signature == WandSignature);
08116   if (wand->debug != MagickFalse)
08117     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08118   if ((wand->images == (Image *) NULL) ||
08119       (remap_wand->images == (Image *) NULL))
08120     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08121   quantize_info=AcquireQuantizeInfo(wand->image_info);
08122   quantize_info->dither_method=method;
08123   if (method == NoDitherMethod)
08124     quantize_info->dither=MagickFalse;
08125   status=RemapImage(quantize_info,wand->images,remap_wand->images);
08126   quantize_info=DestroyQuantizeInfo(quantize_info);
08127   if (status == MagickFalse)
08128     InheritException(wand->exception,&wand->images->exception);
08129   return(status);
08130 }
08131 
08132 /*
08133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08134 %                                                                             %
08135 %                                                                             %
08136 %                                                                             %
08137 %   M a g i c k R e m o v e I m a g e                                         %
08138 %                                                                             %
08139 %                                                                             %
08140 %                                                                             %
08141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08142 %
08143 %  MagickRemoveImage() removes an image from the image list.
08144 %
08145 %  The format of the MagickRemoveImage method is:
08146 %
08147 %      MagickBooleanType MagickRemoveImage(MagickWand *wand)
08148 %
08149 %  A description of each parameter follows:
08150 %
08151 %    o wand: the magick wand.
08152 %
08153 %    o insert: the splice wand.
08154 %
08155 */
08156 WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand)
08157 {
08158   assert(wand != (MagickWand *) NULL);
08159   assert(wand->signature == WandSignature);
08160   if (wand->debug != MagickFalse)
08161     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08162   if (wand->images == (Image *) NULL)
08163     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08164   DeleteImageFromList(&wand->images);
08165   return(MagickTrue);
08166 }
08167 
08168 /*
08169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08170 %                                                                             %
08171 %                                                                             %
08172 %                                                                             %
08173 %   M a g i c k R e s a m p l e I m a g e                                     %
08174 %                                                                             %
08175 %                                                                             %
08176 %                                                                             %
08177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08178 %
08179 %  MagickResampleImage() resample image to desired resolution.
08180 %
08181 %    Bessel   Blackman   Box
08182 %    Catrom   Cubic      Gaussian
08183 %    Hanning  Hermite    Lanczos
08184 %    Mitchell Point      Quandratic
08185 %    Sinc     Triangle
08186 %
08187 %  Most of the filters are FIR (finite impulse response), however, Bessel,
08188 %  Gaussian, and Sinc are IIR (infinite impulse response).  Bessel and Sinc
08189 %  are windowed (brought down to zero) with the Blackman filter.
08190 %
08191 %  The format of the MagickResampleImage method is:
08192 %
08193 %      MagickBooleanType MagickResampleImage(MagickWand *wand,
08194 %        const double x_resolution,const double y_resolution,
08195 %        const FilterTypes filter,const double blur)
08196 %
08197 %  A description of each parameter follows:
08198 %
08199 %    o wand: the magick wand.
08200 %
08201 %    o x_resolution: the new image x resolution.
08202 %
08203 %    o y_resolution: the new image y resolution.
08204 %
08205 %    o filter: Image filter to use.
08206 %
08207 %    o blur: the blur factor where > 1 is blurry, < 1 is sharp.
08208 %
08209 */
08210 WandExport MagickBooleanType MagickResampleImage(MagickWand *wand,
08211   const double x_resolution,const double y_resolution,const FilterTypes filter,
08212   const double blur)
08213 {
08214   Image
08215     *resample_image;
08216 
08217   assert(wand != (MagickWand *) NULL);
08218   assert(wand->signature == WandSignature);
08219   if (wand->debug != MagickFalse)
08220     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08221   if (wand->images == (Image *) NULL)
08222     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08223   resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter,
08224     blur,wand->exception);
08225   if (resample_image == (Image *) NULL)
08226     return(MagickFalse);
08227   ReplaceImageInList(&wand->images,resample_image);
08228   return(MagickTrue);
08229 }
08230 
08231 /*
08232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08233 %                                                                             %
08234 %                                                                             %
08235 %                                                                             %
08236 %   M a g i c k R e s e t I m a g e P a g e                                   %
08237 %                                                                             %
08238 %                                                                             %
08239 %                                                                             %
08240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08241 %
08242 %  MagickResetImagePage() resets the Wand page canvas and position.
08243 %
08244 %  The format of the MagickResetImagePage method is:
08245 %
08246 %      MagickBooleanType MagickResetImagePage(MagickWand *wand,
08247 %        const char *page)
08248 %
08249 %  A description of each parameter follows:
08250 %
08251 %    o wand: the magick wand.
08252 %
08253 %    o page: the relative page specification.
08254 %
08255 */
08256 WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
08257   const char *page)
08258 {
08259   assert(wand != (MagickWand *) NULL);
08260   assert(wand->signature == WandSignature);
08261   if (wand->debug != MagickFalse)
08262     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08263   if (wand->images == (Image *) NULL)
08264     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08265   if ((page == (char *) NULL) || (*page == '\0'))
08266     {
08267       (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page);
08268       return(MagickTrue);
08269     }
08270   return(ResetImagePage(wand->images,page));
08271 }
08272 
08273 /*
08274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08275 %                                                                             %
08276 %                                                                             %
08277 %                                                                             %
08278 %   M a g i c k R e s i z e I m a g e                                         %
08279 %                                                                             %
08280 %                                                                             %
08281 %                                                                             %
08282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08283 %
08284 %  MagickResizeImage() scales an image to the desired dimensions with one of
08285 %  these filters:
08286 %
08287 %    Bessel   Blackman   Box
08288 %    Catrom   Cubic      Gaussian
08289 %    Hanning  Hermite    Lanczos
08290 %    Mitchell Point      Quandratic
08291 %    Sinc     Triangle
08292 %
08293 %  Most of the filters are FIR (finite impulse response), however, Bessel,
08294 %  Gaussian, and Sinc are IIR (infinite impulse response).  Bessel and Sinc
08295 %  are windowed (brought down to zero) with the Blackman filter.
08296 %
08297 %  The format of the MagickResizeImage method is:
08298 %
08299 %      MagickBooleanType MagickResizeImage(MagickWand *wand,
08300 %        const unsigned long columns,const unsigned long rows,
08301 %        const FilterTypes filter,const double blur)
08302 %
08303 %  A description of each parameter follows:
08304 %
08305 %    o wand: the magick wand.
08306 %
08307 %    o columns: the number of columns in the scaled image.
08308 %
08309 %    o rows: the number of rows in the scaled image.
08310 %
08311 %    o filter: Image filter to use.
08312 %
08313 %    o blur: the blur factor where > 1 is blurry, < 1 is sharp.
08314 %
08315 */
08316 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
08317   const unsigned long columns,const unsigned long rows,const FilterTypes filter,
08318   const double blur)
08319 {
08320   Image
08321     *resize_image;
08322 
08323   assert(wand != (MagickWand *) NULL);
08324   assert(wand->signature == WandSignature);
08325   if (wand->debug != MagickFalse)
08326     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08327   if (wand->images == (Image *) NULL)
08328     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08329   resize_image=ResizeImage(wand->images,columns,rows,filter,blur,
08330     wand->exception);
08331   if (resize_image == (Image *) NULL)
08332     return(MagickFalse);
08333   ReplaceImageInList(&wand->images,resize_image);
08334   return(MagickTrue);
08335 }
08336 
08337 /*
08338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08339 %                                                                             %
08340 %                                                                             %
08341 %                                                                             %
08342 %   M a g i c k R o l l I m a g e                                             %
08343 %                                                                             %
08344 %                                                                             %
08345 %                                                                             %
08346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08347 %
08348 %  MagickRollImage() offsets an image as defined by x and y.
08349 %
08350 %  The format of the MagickRollImage method is:
08351 %
08352 %      MagickBooleanType MagickRollImage(MagickWand *wand,const long x,
08353 %        const unsigned long y)
08354 %
08355 %  A description of each parameter follows:
08356 %
08357 %    o wand: the magick wand.
08358 %
08359 %    o x: the x offset.
08360 %
08361 %    o y: the y offset.
08362 %
08363 %
08364 */
08365 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
08366   const long x,const long y)
08367 {
08368   Image
08369     *roll_image;
08370 
08371   assert(wand != (MagickWand *) NULL);
08372   assert(wand->signature == WandSignature);
08373   if (wand->debug != MagickFalse)
08374     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08375   if (wand->images == (Image *) NULL)
08376     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08377   roll_image=RollImage(wand->images,x,y,wand->exception);
08378   if (roll_image == (Image *) NULL)
08379     return(MagickFalse);
08380   ReplaceImageInList(&wand->images,roll_image);
08381   return(MagickTrue);
08382 }
08383 
08384 /*
08385 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08386 %                                                                             %
08387 %                                                                             %
08388 %                                                                             %
08389 %   M a g i c k R o t a t e I m a g e                                         %
08390 %                                                                             %
08391 %                                                                             %
08392 %                                                                             %
08393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08394 %
08395 %  MagickRotateImage() rotates an image the specified number of degrees. Empty
08396 %  triangles left over from rotating the image are filled with the
08397 %  background color.
08398 %
08399 %  The format of the MagickRotateImage method is:
08400 %
08401 %      MagickBooleanType MagickRotateImage(MagickWand *wand,
08402 %        const PixelWand *background,const double degrees)
08403 %
08404 %  A description of each parameter follows:
08405 %
08406 %    o wand: the magick wand.
08407 %
08408 %    o background: the background pixel wand.
08409 %
08410 %    o degrees: the number of degrees to rotate the image.
08411 %
08412 %
08413 */
08414 WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
08415   const PixelWand *background,const double degrees)
08416 {
08417   Image
08418     *rotate_image;
08419 
08420   assert(wand != (MagickWand *) NULL);
08421   assert(wand->signature == WandSignature);
08422   if (wand->debug != MagickFalse)
08423     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08424   if (wand->images == (Image *) NULL)
08425     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08426   PixelGetQuantumColor(background,&wand->images->background_color);
08427   rotate_image=RotateImage(wand->images,degrees,wand->exception);
08428   if (rotate_image == (Image *) NULL)
08429     return(MagickFalse);
08430   ReplaceImageInList(&wand->images,rotate_image);
08431   return(MagickTrue);
08432 }
08433 
08434 /*
08435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08436 %                                                                             %
08437 %                                                                             %
08438 %                                                                             %
08439 %   M a g i c k S a m p l e I m a g e                                         %
08440 %                                                                             %
08441 %                                                                             %
08442 %                                                                             %
08443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08444 %
08445 %  MagickSampleImage() scales an image to the desired dimensions with pixel
08446 %  sampling.  Unlike other scaling methods, this method does not introduce
08447 %  any additional color into the scaled image.
08448 %
08449 %  The format of the MagickSampleImage method is:
08450 %
08451 %      MagickBooleanType MagickSampleImage(MagickWand *wand,
08452 %        const unsigned long columns,const unsigned long rows)
08453 %
08454 %  A description of each parameter follows:
08455 %
08456 %    o wand: the magick wand.
08457 %
08458 %    o columns: the number of columns in the scaled image.
08459 %
08460 %    o rows: the number of rows in the scaled image.
08461 %
08462 %
08463 */
08464 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
08465   const unsigned long columns,const unsigned long rows)
08466 {
08467   Image
08468     *sample_image;
08469 
08470   assert(wand != (MagickWand *) NULL);
08471   assert(wand->signature == WandSignature);
08472   if (wand->debug != MagickFalse)
08473     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08474   if (wand->images == (Image *) NULL)
08475     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08476   sample_image=SampleImage(wand->images,columns,rows,wand->exception);
08477   if (sample_image == (Image *) NULL)
08478     return(MagickFalse);
08479   ReplaceImageInList(&wand->images,sample_image);
08480   return(MagickTrue);
08481 }
08482 
08483 /*
08484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08485 %                                                                             %
08486 %                                                                             %
08487 %                                                                             %
08488 %   M a g i c k S c a l e I m a g e                                           %
08489 %                                                                             %
08490 %                                                                             %
08491 %                                                                             %
08492 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08493 %
08494 %  MagickScaleImage() scales the size of an image to the given dimensions.
08495 %
08496 %  The format of the MagickScaleImage method is:
08497 %
08498 %      MagickBooleanType MagickScaleImage(MagickWand *wand,
08499 %        const unsigned long columns,const unsigned long rows)
08500 %
08501 %  A description of each parameter follows:
08502 %
08503 %    o wand: the magick wand.
08504 %
08505 %    o columns: the number of columns in the scaled image.
08506 %
08507 %    o rows: the number of rows in the scaled image.
08508 %
08509 %
08510 */
08511 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
08512   const unsigned long columns,const unsigned long rows)
08513 {
08514   Image
08515     *scale_image;
08516 
08517   assert(wand != (MagickWand *) NULL);
08518   assert(wand->signature == WandSignature);
08519   if (wand->debug != MagickFalse)
08520     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08521   if (wand->images == (Image *) NULL)
08522     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08523   scale_image=ScaleImage(wand->images,columns,rows,wand->exception);
08524   if (scale_image == (Image *) NULL)
08525     return(MagickFalse);
08526   ReplaceImageInList(&wand->images,scale_image);
08527   return(MagickTrue);
08528 }
08529 
08530 /*
08531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08532 %                                                                             %
08533 %                                                                             %
08534 %                                                                             %
08535 %   M a g i c k S e g m e n t I m a g e                                       %
08536 %                                                                             %
08537 %                                                                             %
08538 %                                                                             %
08539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08540 %
08541 %  MagickSegmentImage() segments an image by analyzing the histograms of the
08542 %  color components and identifying units that are homogeneous with the fuzzy
08543 %  C-means technique.
08544 %
08545 %  The format of the SegmentImage method is:
08546 %
08547 %      MagickBooleanType MagickSegmentImage(MagickWand *wand,
08548 %        const ColorspaceType colorspace,const MagickBooleanType verbose,
08549 %        const double cluster_threshold,const double smooth_threshold)
08550 %
08551 %  A description of each parameter follows.
08552 %
08553 %    o wand: the wand.
08554 %
08555 %    o colorspace: the image colorspace.
08556 %
08557 %    o verbose:  Set to MagickTrue to print detailed information about the
08558 %      identified classes.
08559 %
08560 %    o cluster_threshold:  This represents the minimum number of pixels
08561 %      contained in a hexahedra before it can be considered valid (expressed as
08562 %      a percentage).
08563 %
08564 %    o smooth_threshold: the smoothing threshold eliminates noise in the second
08565 %      derivative of the histogram.  As the value is increased, you can expect a
08566 %      smoother second derivative.
08567 %
08568 */
08569 MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand,
08570   const ColorspaceType colorspace,const MagickBooleanType verbose,
08571   const double cluster_threshold,const double smooth_threshold)
08572 {
08573   MagickBooleanType
08574     status;
08575 
08576   assert(wand != (MagickWand *) NULL);
08577   assert(wand->signature == WandSignature);
08578   if (wand->debug != MagickFalse)
08579     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08580   if (wand->images == (Image *) NULL)
08581     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08582   status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold,
08583     smooth_threshold);
08584   if (status == MagickFalse)
08585     InheritException(wand->exception,&wand->images->exception);
08586   return(status);
08587 }
08588 
08589 /*
08590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08591 %                                                                             %
08592 %                                                                             %
08593 %                                                                             %
08594 %   M a g i c k S e l e c t i v e B l u r I m a g e                           %
08595 %                                                                             %
08596 %                                                                             %
08597 %                                                                             %
08598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08599 %
08600 %  MagickSelectiveBlurImage() selectively blur an image within a contrast
08601 %  threshold. It is similar to the unsharpen mask that sharpens everything with
08602 %  contrast above a certain threshold.
08603 %
08604 %  The format of the MagickSelectiveBlurImage method is:
08605 %
08606 %      MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
08607 %        const double radius,const double sigma,const double threshold)
08608 %      MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
08609 %        const ChannelType channel,const double radius,const double sigma,
08610 %        const double threshold)
08611 %
08612 %  A description of each parameter follows:
08613 %
08614 %    o wand: the magick wand.
08615 %
08616 %    o channel: the image channel(s).
08617 %
08618 %    o radius: the radius of the gaussian, in pixels, not counting the center
08619 %      pixel.
08620 %
08621 %    o sigma: the standard deviation of the gaussian, in pixels.
08622 %
08623 %    o threshold: only pixels within this contrast threshold are included
08624 %      in the blur operation 
08625 %
08626 */
08627 
08628 WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand,
08629   const double radius,const double sigma,const double threshold)
08630 {
08631   MagickBooleanType
08632     status;
08633 
08634   status=MagickSelectiveBlurImageChannel(wand,DefaultChannels,radius,sigma,
08635     threshold);
08636   return(status);
08637 }
08638 
08639 WandExport MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand,
08640   const ChannelType channel,const double radius,const double sigma,
08641   const double threshold)
08642 {
08643   Image
08644     *blur_image;
08645 
08646   assert(wand != (MagickWand *) NULL);
08647   assert(wand->signature == WandSignature);
08648   if (wand->debug != MagickFalse)
08649     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08650   if (wand->images == (Image *) NULL)
08651     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08652   blur_image=SelectiveBlurImageChannel(wand->images,channel,radius,sigma,
08653     threshold,wand->exception);
08654   if (blur_image == (Image *) NULL)
08655     return(MagickFalse);
08656   ReplaceImageInList(&wand->images,blur_image);
08657   return(MagickTrue);
08658 }
08659 
08660 /*
08661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08662 %                                                                             %
08663 %                                                                             %
08664 %                                                                             %
08665 %   M a g i c k S e p a r a t e I m a g e C h a n n e l                       %
08666 %                                                                             %
08667 %                                                                             %
08668 %                                                                             %
08669 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08670 %
08671 %  MagickSeparateImageChannel() separates a channel from the image and returns a
08672 %  grayscale image.  A channel is a particular color component of each pixel
08673 %  in the image.
08674 %
08675 %  The format of the MagickSeparateImageChannel method is:
08676 %
08677 %      MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
08678 %        const ChannelType channel)
08679 %
08680 %  A description of each parameter follows:
08681 %
08682 %    o wand: the magick wand.
08683 %
08684 %    o channel: the image channel(s).
08685 %
08686 */
08687 WandExport MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,
08688   const ChannelType channel)
08689 {
08690   MagickBooleanType
08691     status;
08692 
08693   assert(wand != (MagickWand *) NULL);
08694   assert(wand->signature == WandSignature);
08695   if (wand->debug != MagickFalse)
08696     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08697   if (wand->images == (Image *) NULL)
08698     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08699   status=SeparateImageChannel(wand->images,channel);
08700   if (status == MagickFalse)
08701     InheritException(wand->exception,&wand->images->exception);
08702   return(status);
08703 }
08704 
08705 /*
08706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08707 %                                                                             %
08708 %                                                                             %
08709 %                                                                             %
08710 %     M a g i c k S e p i a T o n e I m a g e                                 %
08711 %                                                                             %
08712 %                                                                             %
08713 %                                                                             %
08714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08715 %
08716 %  MagickSepiaToneImage() applies a special effect to the image, similar to the
08717 %  effect achieved in a photo darkroom by sepia toning.  Threshold ranges from
08718 %  0 to QuantumRange and is a measure of the extent of the sepia toning.  A
08719 %  threshold of 80% is a good starting point for a reasonable tone.
08720 %
08721 %  The format of the MagickSepiaToneImage method is:
08722 %
08723 %      MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
08724 %        const double threshold)
08725 %
08726 %  A description of each parameter follows:
08727 %
08728 %    o wand: the magick wand.
08729 %
08730 %    o threshold:  Define the extent of the sepia toning.
08731 %
08732 */
08733 WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand,
08734   const double threshold)
08735 {
08736   Image
08737     *sepia_image;
08738 
08739   assert(wand != (MagickWand *) NULL);
08740   assert(wand->signature == WandSignature);
08741   if (wand->debug != MagickFalse)
08742     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08743   if (wand->images == (Image *) NULL)
08744     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08745   sepia_image=SepiaToneImage(wand->images,threshold,wand->exception);
08746   if (sepia_image == (Image *) NULL)
08747     return(MagickFalse);
08748   ReplaceImageInList(&wand->images,sepia_image);
08749   return(MagickTrue);
08750 }
08751 
08752 /*
08753 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08754 %                                                                             %
08755 %                                                                             %
08756 %                                                                             %
08757 %   M a g i c k S e t I m a g e                                               %
08758 %                                                                             %
08759 %                                                                             %
08760 %                                                                             %
08761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08762 %
08763 %  MagickSetImage() replaces the last image returned by MagickSetImageIndex(),
08764 %  MagickNextImage(), MagickPreviousImage() with the images from the specified
08765 %  wand.
08766 %
08767 %  The format of the MagickSetImage method is:
08768 %
08769 %      MagickBooleanType MagickSetImage(MagickWand *wand,
08770 %        const MagickWand *set_wand)
08771 %
08772 %  A description of each parameter follows:
08773 %
08774 %    o wand: the magick wand.
08775 %
08776 %    o set_wand: the set_wand wand.
08777 %
08778 */
08779 WandExport MagickBooleanType MagickSetImage(MagickWand *wand,
08780   const MagickWand *set_wand)
08781 {
08782   Image
08783     *images;
08784 
08785   assert(wand != (MagickWand *) NULL);
08786   assert(wand->signature == WandSignature);
08787   if (wand->debug != MagickFalse)
08788     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08789   assert(set_wand != (MagickWand *) NULL);
08790   assert(set_wand->signature == WandSignature);
08791   if (wand->debug != MagickFalse)
08792     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name);
08793   if (set_wand->images == (Image *) NULL)
08794     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08795   images=CloneImageList(set_wand->images,wand->exception);
08796   if (images == (Image *) NULL)
08797     return(MagickFalse);
08798   ReplaceImageInList(&wand->images,images);
08799   return(MagickTrue);
08800 }
08801 
08802 /*
08803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08804 %                                                                             %
08805 %                                                                             %
08806 %                                                                             %
08807 %   M a g i c k S e t I m a g e A l p h a C h a n n e l                       %
08808 %                                                                             %
08809 %                                                                             %
08810 %                                                                             %
08811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08812 %
08813 %  MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the
08814 %  alpha channel.
08815 %
08816 %  The format of the MagickSetImageAlphaChannel method is:
08817 %
08818 %      MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
08819 %        const AlphaChannelType alpha_type)
08820 %
08821 %  A description of each parameter follows:
08822 %
08823 %    o wand: the magick wand.
08824 %
08825 %    o alpha_type: the alpha channel type: ActivateAlphaChannel,
08826 %      DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel.
08827 %
08828 */
08829 WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand,
08830   const AlphaChannelType alpha_type)
08831 {
08832   assert(wand != (MagickWand *) NULL);
08833   assert(wand->signature == WandSignature);
08834   if (wand->debug != MagickFalse)
08835     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08836   if (wand->images == (Image *) NULL)
08837     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08838   return(SetImageAlphaChannel(wand->images,alpha_type));
08839 }
08840 
08841 /*
08842 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08843 %                                                                             %
08844 %                                                                             %
08845 %                                                                             %
08846 %   M a g i c k S e t I m a g e B a c k g r o u n d C o l o r                 %
08847 %                                                                             %
08848 %                                                                             %
08849 %                                                                             %
08850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08851 %
08852 %  MagickSetImageBackgroundColor() sets the image background color.
08853 %
08854 %  The format of the MagickSetImageBackgroundColor method is:
08855 %
08856 %      MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
08857 %        const PixelWand *background)
08858 %
08859 %  A description of each parameter follows:
08860 %
08861 %    o wand: the magick wand.
08862 %
08863 %    o background: the background pixel wand.
08864 %
08865 */
08866 WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand,
08867   const PixelWand *background)
08868 {
08869   assert(wand != (MagickWand *) NULL);
08870   assert(wand->signature == WandSignature);
08871   if (wand->debug != MagickFalse)
08872     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08873   if (wand->images == (Image *) NULL)
08874     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08875   PixelGetQuantumColor(background,&wand->images->background_color);
08876   return(MagickTrue);
08877 }
08878 
08879 /*
08880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08881 %                                                                             %
08882 %                                                                             %
08883 %                                                                             %
08884 %   M a g i c k S e t I m a g e B i a s                                       %
08885 %                                                                             %
08886 %                                                                             %
08887 %                                                                             %
08888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08889 %
08890 %  MagickSetImageBias() sets the image bias for any method that convolves an
08891 %  image (e.g. MagickConvolveImage()).
08892 %
08893 %  The format of the MagickSetImageBias method is:
08894 %
08895 %      MagickBooleanType MagickSetImageBias(MagickWand *wand,
08896 %        const double bias)
08897 %
08898 %  A description of each parameter follows:
08899 %
08900 %    o wand: the magick wand.
08901 %
08902 %    o bias: the image bias.
08903 %
08904 */
08905 WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand,
08906   const double bias)
08907 {
08908   assert(wand != (MagickWand *) NULL);
08909   assert(wand->signature == WandSignature);
08910   if (wand->debug != MagickFalse)
08911     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08912   if (wand->images == (Image *) NULL)
08913     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08914   wand->images->bias=bias;
08915   return(MagickTrue);
08916 }
08917 
08918 /*
08919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08920 %                                                                             %
08921 %                                                                             %
08922 %                                                                             %
08923 %   M a g i c k S e t I m a g e B l u e P r i m a r y                         %
08924 %                                                                             %
08925 %                                                                             %
08926 %                                                                             %
08927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08928 %
08929 %  MagickSetImageBluePrimary() sets the image chromaticity blue primary point.
08930 %
08931 %  The format of the MagickSetImageBluePrimary method is:
08932 %
08933 %      MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
08934 %        const double x,const double y)
08935 %
08936 %  A description of each parameter follows:
08937 %
08938 %    o wand: the magick wand.
08939 %
08940 %    o x: the blue primary x-point.
08941 %
08942 %    o y: the blue primary y-point.
08943 %
08944 */
08945 WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand,
08946   const double x,const double y)
08947 {
08948   assert(wand != (MagickWand *) NULL);
08949   assert(wand->signature == WandSignature);
08950   if (wand->debug != MagickFalse)
08951     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08952   if (wand->images == (Image *) NULL)
08953     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08954   wand->images->chromaticity.blue_primary.x=x;
08955   wand->images->chromaticity.blue_primary.y=y;
08956   return(MagickTrue);
08957 }
08958 
08959 /*
08960 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08961 %                                                                             %
08962 %                                                                             %
08963 %                                                                             %
08964 %   M a g i c k S e t I m a g e B o r d e r C o l o r                         %
08965 %                                                                             %
08966 %                                                                             %
08967 %                                                                             %
08968 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08969 %
08970 %  MagickSetImageBorderColor() sets the image border color.
08971 %
08972 %  The format of the MagickSetImageBorderColor method is:
08973 %
08974 %      MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
08975 %        const PixelWand *border)
08976 %
08977 %  A description of each parameter follows:
08978 %
08979 %    o wand: the magick wand.
08980 %
08981 %    o border: the border pixel wand.
08982 %
08983 */
08984 WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
08985   const PixelWand *border)
08986 {
08987   assert(wand != (MagickWand *) NULL);
08988   assert(wand->signature == WandSignature);
08989   if (wand->debug != MagickFalse)
08990     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
08991   if (wand->images == (Image *) NULL)
08992     ThrowWandException(WandError,"ContainsNoImages",wand->name);
08993   PixelGetQuantumColor(border,&wand->images->border_color);
08994   return(MagickTrue);
08995 }
08996 
08997 /*
08998 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
08999 %                                                                             %
09000 %                                                                             %
09001 %                                                                             %
09002 %   M a g i c k S e t I m a g e C h a n n e l D e p t h                       %
09003 %                                                                             %
09004 %                                                                             %
09005 %                                                                             %
09006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09007 %
09008 %  MagickSetImageChannelDepth() sets the depth of a particular image channel.
09009 %
09010 %  The format of the MagickSetImageChannelDepth method is:
09011 %
09012 %      MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
09013 %        const ChannelType channel,const unsigned long depth)
09014 %
09015 %  A description of each parameter follows:
09016 %
09017 %    o wand: the magick wand.
09018 %
09019 %    o channel: the image channel(s).
09020 %
09021 %    o depth: the image depth in bits.
09022 %
09023 */
09024 WandExport MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
09025   const ChannelType channel,const unsigned long depth)
09026 {
09027   assert(wand != (MagickWand *) NULL);
09028   assert(wand->signature == WandSignature);
09029   if (wand->debug != MagickFalse)
09030     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09031   if (wand->images == (Image *) NULL)
09032     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09033   return(SetImageChannelDepth(wand->images,channel,depth));
09034 }
09035 
09036 /*
09037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09038 %                                                                             %
09039 %                                                                             %
09040 %                                                                             %
09041 %   M a g i c k S e t I m a g e C l i p M a s k                               %
09042 %                                                                             %
09043 %                                                                             %
09044 %                                                                             %
09045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09046 %
09047 %  MagickSetImageClipMask() sets image clip mask.
09048 %
09049 %  The format of the MagickSetImageClipMask method is:
09050 %
09051 %      MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
09052 %        const MagickWand *clip_mask)
09053 %
09054 %  A description of each parameter follows:
09055 %
09056 %    o wand: the magick wand.
09057 %
09058 %    o clip_mask: the clip_mask wand.
09059 %
09060 */
09061 WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
09062   const MagickWand *clip_mask)
09063 {
09064   assert(wand != (MagickWand *) NULL);
09065   assert(wand->signature == WandSignature);
09066   if (wand->debug != MagickFalse)
09067     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09068   assert(clip_mask != (MagickWand *) NULL);
09069   assert(clip_mask->signature == WandSignature);
09070   if (wand->debug != MagickFalse)
09071     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
09072   if (clip_mask->images == (Image *) NULL)
09073     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09074   return(SetImageClipMask(wand->images,clip_mask->images));
09075 }
09076 
09077 /*
09078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09079 %                                                                             %
09080 %                                                                             %
09081 %                                                                             %
09082 %   M a g i c k S e t I m a g e C o l o r m a p C o l o r                     %
09083 %                                                                             %
09084 %                                                                             %
09085 %                                                                             %
09086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09087 %
09088 %  MagickSetImageColormapColor() sets the color of the specified colormap
09089 %  index.
09090 %
09091 %  The format of the MagickSetImageColormapColor method is:
09092 %
09093 %      MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
09094 %        const unsigned long index,const PixelWand *color)
09095 %
09096 %  A description of each parameter follows:
09097 %
09098 %    o wand: the magick wand.
09099 %
09100 %    o index: the offset into the image colormap.
09101 %
09102 %    o color: Return the colormap color in this wand.
09103 %
09104 */
09105 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
09106   const unsigned long index,const PixelWand *color)
09107 {
09108   assert(wand != (MagickWand *) NULL);
09109   assert(wand->signature == WandSignature);
09110   if (wand->debug != MagickFalse)
09111     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09112   if (wand->images == (Image *) NULL)
09113     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09114   if ((wand->images->colormap == (PixelPacket *) NULL) ||
09115       (index >= wand->images->colors))
09116     ThrowWandException(WandError,"InvalidColormapIndex",wand->name);
09117   PixelGetQuantumColor(color,wand->images->colormap+index);
09118   return(SyncImage(wand->images));
09119 }
09120 
09121 /*
09122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09123 %                                                                             %
09124 %                                                                             %
09125 %                                                                             %
09126 %   M a g i c k S e t I m a g e C o l o r s p a c e                           %
09127 %                                                                             %
09128 %                                                                             %
09129 %                                                                             %
09130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09131 %
09132 %  MagickSetImageColorspace() sets the image colorspace.
09133 %
09134 %  The format of the MagickSetImageColorspace method is:
09135 %
09136 %      MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
09137 %        const ColorspaceType colorspace)
09138 %
09139 %  A description of each parameter follows:
09140 %
09141 %    o wand: the magick wand.
09142 %
09143 %    o colorspace: the image colorspace:   UndefinedColorspace, RGBColorspace,
09144 %      GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
09145 %      YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
09146 %      YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
09147 %      HSLColorspace, or HWBColorspace.
09148 %
09149 */
09150 WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand,
09151   const ColorspaceType colorspace)
09152 {
09153   assert(wand != (MagickWand *) NULL);
09154   assert(wand->signature == WandSignature);
09155   if (wand->debug != MagickFalse)
09156     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09157   if (wand->images == (Image *) NULL)
09158     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09159   return(SetImageColorspace(wand->images,colorspace));
09160 }
09161 
09162 /*
09163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09164 %                                                                             %
09165 %                                                                             %
09166 %                                                                             %
09167 %   M a g i c k S e t I m a g e C o m p o s e                                 %
09168 %                                                                             %
09169 %                                                                             %
09170 %                                                                             %
09171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09172 %
09173 %  MagickSetImageCompose() sets the image composite operator, useful for
09174 %  specifying how to composite the image thumbnail when using the
09175 %  MagickMontageImage() method.
09176 %
09177 %  The format of the MagickSetImageCompose method is:
09178 %
09179 %      MagickBooleanType MagickSetImageCompose(MagickWand *wand,
09180 %        const CompositeOperator compose)
09181 %
09182 %  A description of each parameter follows:
09183 %
09184 %    o wand: the magick wand.
09185 %
09186 %    o compose: the image composite operator.
09187 %
09188 */
09189 WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand,
09190   const CompositeOperator compose)
09191 {
09192   assert(wand != (MagickWand *) NULL);
09193   assert(wand->signature == WandSignature);
09194   if (wand->debug != MagickFalse)
09195     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09196   if (wand->images == (Image *) NULL)
09197     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09198   wand->images->compose=compose;
09199   return(MagickTrue);
09200 }
09201 
09202 /*
09203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09204 %                                                                             %
09205 %                                                                             %
09206 %                                                                             %
09207 %   M a g i c k S e t I m a g e C o m p r e s s i o n                         %
09208 %                                                                             %
09209 %                                                                             %
09210 %                                                                             %
09211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09212 %
09213 %  MagickSetImageCompression() sets the image compression.
09214 %
09215 %  The format of the MagickSetImageCompression method is:
09216 %
09217 %      MagickBooleanType MagickSetImageCompression(MagickWand *wand,
09218 %        const CompressionType compression)
09219 %
09220 %  A description of each parameter follows:
09221 %
09222 %    o wand: the magick wand.
09223 %
09224 %    o compression: the image compression type.
09225 %
09226 */
09227 WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
09228   const CompressionType compression)
09229 {
09230   assert(wand != (MagickWand *) NULL);
09231   assert(wand->signature == WandSignature);
09232   if (wand->debug != MagickFalse)
09233     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09234   if (wand->images == (Image *) NULL)
09235     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09236   wand->images->compression=compression;
09237   return(MagickTrue);
09238 }
09239 
09240 /*
09241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09242 %                                                                             %
09243 %                                                                             %
09244 %                                                                             %
09245 %   M a g i c k S e t I m a g e C o m p r e s s i o n Q u a l i t y           %
09246 %                                                                             %
09247 %                                                                             %
09248 %                                                                             %
09249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09250 %
09251 %  MagickSetImageCompressionQuality() sets the image compression quality.
09252 %
09253 %  The format of the MagickSetImageCompressionQuality method is:
09254 %
09255 %      MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
09256 %        const unsigned long quality)
09257 %
09258 %  A description of each parameter follows:
09259 %
09260 %    o wand: the magick wand.
09261 %
09262 %    o quality: the image compression tlityype.
09263 %
09264 */
09265 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
09266   const unsigned long quality)
09267 {
09268   assert(wand != (MagickWand *) NULL);
09269   assert(wand->signature == WandSignature);
09270   if (wand->debug != MagickFalse)
09271     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09272   if (wand->images == (Image *) NULL)
09273     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09274   wand->images->quality=quality;
09275   return(MagickTrue);
09276 }
09277 
09278 /*
09279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09280 %                                                                             %
09281 %                                                                             %
09282 %                                                                             %
09283 %   M a g i c k S e t I m a g e D e l a y                                     %
09284 %                                                                             %
09285 %                                                                             %
09286 %                                                                             %
09287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09288 %
09289 %  MagickSetImageDelay() sets the image delay.
09290 %
09291 %  The format of the MagickSetImageDelay method is:
09292 %
09293 %      MagickBooleanType MagickSetImageDelay(MagickWand *wand,
09294 %        const unsigned long delay)
09295 %
09296 %  A description of each parameter follows:
09297 %
09298 %    o wand: the magick wand.
09299 %
09300 %    o delay: the image delay in ticks-per-second units.
09301 %
09302 */
09303 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
09304   const unsigned long delay)
09305 {
09306   assert(wand != (MagickWand *) NULL);
09307   assert(wand->signature == WandSignature);
09308   if (wand->debug != MagickFalse)
09309     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09310   if (wand->images == (Image *) NULL)
09311     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09312   wand->images->delay=delay;
09313   return(MagickTrue);
09314 }
09315 
09316 /*
09317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09318 %                                                                             %
09319 %                                                                             %
09320 %                                                                             %
09321 %   M a g i c k S e t I m a g e D e p t h                                     %
09322 %                                                                             %
09323 %                                                                             %
09324 %                                                                             %
09325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09326 %
09327 %  MagickSetImageDepth() sets the image depth.
09328 %
09329 %  The format of the MagickSetImageDepth method is:
09330 %
09331 %      MagickBooleanType MagickSetImageDepth(MagickWand *wand,
09332 %        const unsigned long depth)
09333 %
09334 %  A description of each parameter follows:
09335 %
09336 %    o wand: the magick wand.
09337 %
09338 %    o depth: the image depth in bits: 8, 16, or 32.
09339 %
09340 */
09341 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
09342   const unsigned long depth)
09343 {
09344   assert(wand != (MagickWand *) NULL);
09345   assert(wand->signature == WandSignature);
09346   if (wand->debug != MagickFalse)
09347     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09348   if (wand->images == (Image *) NULL)
09349     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09350   wand->images->depth=depth;
09351   return(MagickTrue);
09352 }
09353 
09354 /*
09355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09356 %                                                                             %
09357 %                                                                             %
09358 %                                                                             %
09359 %   M a g i c k S e t I m a g e D i s p o s e                                 %
09360 %                                                                             %
09361 %                                                                             %
09362 %                                                                             %
09363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09364 %
09365 %  MagickSetImageDispose() sets the image disposal method.
09366 %
09367 %  The format of the MagickSetImageDispose method is:
09368 %
09369 %      MagickBooleanType MagickSetImageDispose(MagickWand *wand,
09370 %        const DisposeType dispose)
09371 %
09372 %  A description of each parameter follows:
09373 %
09374 %    o wand: the magick wand.
09375 %
09376 %    o dispose: the image disposeal type.
09377 %
09378 */
09379 WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
09380   const DisposeType dispose)
09381 {
09382   assert(wand != (MagickWand *) NULL);
09383   assert(wand->signature == WandSignature);
09384   if (wand->debug != MagickFalse)
09385     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09386   if (wand->images == (Image *) NULL)
09387     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09388   wand->images->dispose=dispose;
09389   return(MagickTrue);
09390 }
09391 
09392 /*
09393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09394 %                                                                             %
09395 %                                                                             %
09396 %                                                                             %
09397 %   M a g i c k S e t I m a g e E x t e n t                                   %
09398 %                                                                             %
09399 %                                                                             %
09400 %                                                                             %
09401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09402 %
09403 %  MagickSetImageExtent() sets the image size (i.e. columns & rows).
09404 %
09405 %  The format of the MagickSetImageExtent method is:
09406 %
09407 %      MagickBooleanType MagickSetImageExtent(MagickWand *wand,
09408 %        const unsigned long columns,const unsigned rows)
09409 %
09410 %  A description of each parameter follows:
09411 %
09412 %    o wand: the magick wand.
09413 %
09414 %    o columns:  The image width in pixels.
09415 %
09416 %    o rows:  The image height in pixels.
09417 %
09418 */
09419 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
09420   const unsigned long columns,const unsigned long rows)
09421 {
09422   assert(wand != (MagickWand *) NULL);
09423   assert(wand->signature == WandSignature);
09424   if (wand->debug != MagickFalse)
09425     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09426   if (wand->images == (Image *) NULL)
09427     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09428   return(SetImageExtent(wand->images,columns,rows));
09429 }
09430 
09431 /*
09432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09433 %                                                                             %
09434 %                                                                             %
09435 %                                                                             %
09436 %   M a g i c k S e t I m a g e F i l e n a m e                               %
09437 %                                                                             %
09438 %                                                                             %
09439 %                                                                             %
09440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09441 %
09442 %  MagickSetImageFilename() sets the filename of a particular image in a
09443 %  sequence.
09444 %
09445 %  The format of the MagickSetImageFilename method is:
09446 %
09447 %      MagickBooleanType MagickSetImageFilename(MagickWand *wand,
09448 %        const char *filename)
09449 %
09450 %  A description of each parameter follows:
09451 %
09452 %    o wand: the magick wand.
09453 %
09454 %    o filename: the image filename.
09455 %
09456 */
09457 WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand,
09458   const char *filename)
09459 {
09460   assert(wand != (MagickWand *) NULL);
09461   assert(wand->signature == WandSignature);
09462   if (wand->debug != MagickFalse)
09463     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09464   if (wand->images == (Image *) NULL)
09465     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09466   if (filename != (const char *) NULL)
09467     (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
09468   return(MagickTrue);
09469 }
09470 
09471 /*
09472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09473 %                                                                             %
09474 %                                                                             %
09475 %                                                                             %
09476 %   M a g i c k S e t I m a g e F o r m a t                                   %
09477 %                                                                             %
09478 %                                                                             %
09479 %                                                                             %
09480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09481 %
09482 %  MagickSetImageFormat() sets the format of a particular image in a
09483 %  sequence.
09484 %
09485 %  The format of the MagickSetImageFormat method is:
09486 %
09487 %      MagickBooleanType MagickSetImageFormat(MagickWand *wand,
09488 %        const char *format)
09489 %
09490 %  A description of each parameter follows:
09491 %
09492 %    o wand: the magick wand.
09493 %
09494 %    o format: the image format.
09495 %
09496 */
09497 WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand,
09498   const char *format)
09499 {
09500   const MagickInfo
09501     *magick_info;
09502 
09503   assert(wand != (MagickWand *) NULL);
09504   assert(wand->signature == WandSignature);
09505   if (wand->debug != MagickFalse)
09506     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09507   if (wand->images == (Image *) NULL)
09508     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09509   if ((format == (char *) NULL) || (*format == '\0'))
09510     {
09511       *wand->images->magick='\0';
09512       return(MagickTrue);
09513     }
09514   magick_info=GetMagickInfo(format,wand->exception);
09515   if (magick_info == (const MagickInfo *) NULL)
09516     return(MagickFalse);
09517   ClearMagickException(wand->exception);
09518   (void) CopyMagickString(wand->images->magick,format,MaxTextExtent);
09519   return(MagickTrue);
09520 }
09521 
09522 /*
09523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09524 %                                                                             %
09525 %                                                                             %
09526 %                                                                             %
09527 %   M a g i c k S e t I m a g e F u z z                                       %
09528 %                                                                             %
09529 %                                                                             %
09530 %                                                                             %
09531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09532 %
09533 %  MagickSetImageFuzz() sets the image fuzz.
09534 %
09535 %  The format of the MagickSetImageFuzz method is:
09536 %
09537 %      MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
09538 %        const double fuzz)
09539 %
09540 %  A description of each parameter follows:
09541 %
09542 %    o wand: the magick wand.
09543 %
09544 %    o fuzz: the image fuzz.
09545 %
09546 */
09547 WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand,
09548   const double fuzz)
09549 {
09550   assert(wand != (MagickWand *) NULL);
09551   assert(wand->signature == WandSignature);
09552   if (wand->debug != MagickFalse)
09553     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09554   if (wand->images == (Image *) NULL)
09555     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09556   wand->images->fuzz=fuzz;
09557   return(MagickTrue);
09558 }
09559 
09560 /*
09561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09562 %                                                                             %
09563 %                                                                             %
09564 %                                                                             %
09565 %   M a g i c k S e t I m a g e G a m m a                                     %
09566 %                                                                             %
09567 %                                                                             %
09568 %                                                                             %
09569 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09570 %
09571 %  MagickSetImageGamma() sets the image gamma.
09572 %
09573 %  The format of the MagickSetImageGamma method is:
09574 %
09575 %      MagickBooleanType MagickSetImageGamma(MagickWand *wand,
09576 %        const double gamma)
09577 %
09578 %  A description of each parameter follows:
09579 %
09580 %    o wand: the magick wand.
09581 %
09582 %    o gamma: the image gamma.
09583 %
09584 */
09585 WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand,
09586   const double gamma)
09587 {
09588   assert(wand != (MagickWand *) NULL);
09589   assert(wand->signature == WandSignature);
09590   if (wand->debug != MagickFalse)
09591     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09592   if (wand->images == (Image *) NULL)
09593     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09594   wand->images->gamma=gamma;
09595   return(MagickTrue);
09596 }
09597 
09598 /*
09599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09600 %                                                                             %
09601 %                                                                             %
09602 %                                                                             %
09603 %   M a g i c k S e t I m a g e G r a v i t y                                 %
09604 %                                                                             %
09605 %                                                                             %
09606 %                                                                             %
09607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09608 %
09609 %  MagickSetImageGravity() sets the image gravity type.
09610 %
09611 %  The format of the MagickSetImageGravity method is:
09612 %
09613 %      MagickBooleanType MagickSetImageGravity(MagickWand *wand,
09614 %        const GravityType gravity)
09615 %
09616 %  A description of each parameter follows:
09617 %
09618 %    o wand: the magick wand.
09619 %
09620 %    o gravity: the image interlace scheme: NoInterlace, LineInterlace,
09621 %      PlaneInterlace, PartitionInterlace.
09622 %
09623 */
09624 WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand,
09625   const GravityType gravity)
09626 {
09627   assert(wand != (MagickWand *) NULL);
09628   assert(wand->signature == WandSignature);
09629   if (wand->debug != MagickFalse)
09630     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09631   if (wand->images == (Image *) NULL)
09632     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09633   wand->images->gravity=gravity;
09634   return(MagickTrue);
09635 }
09636 
09637 /*
09638 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09639 %                                                                             %
09640 %                                                                             %
09641 %                                                                             %
09642 %   M a g i c k S e t I m a g e G r e e n P r i m a r y                       %
09643 %                                                                             %
09644 %                                                                             %
09645 %                                                                             %
09646 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09647 %
09648 %  MagickSetImageGreenPrimary() sets the image chromaticity green primary
09649 %  point.
09650 %
09651 %  The format of the MagickSetImageGreenPrimary method is:
09652 %
09653 %      MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
09654 %        const double x,const double y)
09655 %
09656 %  A description of each parameter follows:
09657 %
09658 %    o wand: the magick wand.
09659 %
09660 %    o x: the green primary x-point.
09661 %
09662 %    o y: the green primary y-point.
09663 %
09664 %
09665 */
09666 WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand,
09667   const double x,const double y)
09668 {
09669   assert(wand != (MagickWand *) NULL);
09670   assert(wand->signature == WandSignature);
09671   if (wand->debug != MagickFalse)
09672     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09673   if (wand->images == (Image *) NULL)
09674     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09675   wand->images->chromaticity.green_primary.x=x;
09676   wand->images->chromaticity.green_primary.y=y;
09677   return(MagickTrue);
09678 }
09679 
09680 /*
09681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09682 %                                                                             %
09683 %                                                                             %
09684 %                                                                             %
09685 %   M a g i c k S e t I m a g e I n t e r l a c e S c h e m e                 %
09686 %                                                                             %
09687 %                                                                             %
09688 %                                                                             %
09689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09690 %
09691 %  MagickSetImageInterlaceScheme() sets the image interlace scheme.
09692 %
09693 %  The format of the MagickSetImageInterlaceScheme method is:
09694 %
09695 %      MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
09696 %        const InterlaceType interlace)
09697 %
09698 %  A description of each parameter follows:
09699 %
09700 %    o wand: the magick wand.
09701 %
09702 %    o interlace: the image interlace scheme: NoInterlace, LineInterlace,
09703 %      PlaneInterlace, PartitionInterlace.
09704 %
09705 */
09706 WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand,
09707   const InterlaceType interlace)
09708 {
09709   assert(wand != (MagickWand *) NULL);
09710   assert(wand->signature == WandSignature);
09711   if (wand->debug != MagickFalse)
09712     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09713   if (wand->images == (Image *) NULL)
09714     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09715   wand->images->interlace=interlace;
09716   return(MagickTrue);
09717 }
09718 
09719 /*
09720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09721 %                                                                             %
09722 %                                                                             %
09723 %                                                                             %
09724 %   M a g i c k S e t I m a g e I n t e r p o l a t e M e t h o d             %
09725 %                                                                             %
09726 %                                                                             %
09727 %                                                                             %
09728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09729 %
09730 %  MagickSetImageInterpolateMethod() sets the image interpolate pixel method.
09731 %
09732 %  The format of the MagickSetImageInterpolateMethod method is:
09733 %
09734 %      MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
09735 %        const InterpolatePixelMethod method)
09736 %
09737 %  A description of each parameter follows:
09738 %
09739 %    o wand: the magick wand.
09740 %
09741 %    o method: the image interpole pixel methods: choose from Undefined,
09742 %      Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor.
09743 %
09744 */
09745 WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
09746   const InterpolatePixelMethod method)
09747 {
09748   assert(wand != (MagickWand *) NULL);
09749   assert(wand->signature == WandSignature);
09750   if (wand->debug != MagickFalse)
09751     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09752   if (wand->images == (Image *) NULL)
09753     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09754   wand->images->interpolate=method;
09755   return(MagickTrue);
09756 }
09757 
09758 /*
09759 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09760 %                                                                             %
09761 %                                                                             %
09762 %                                                                             %
09763 %   M a g i c k S e t I m a g e I t e r a t i o n s                           %
09764 %                                                                             %
09765 %                                                                             %
09766 %                                                                             %
09767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09768 %
09769 %  MagickSetImageIterations() sets the image iterations.
09770 %
09771 %  The format of the MagickSetImageIterations method is:
09772 %
09773 %      MagickBooleanType MagickSetImageIterations(MagickWand *wand,
09774 %        const unsigned long iterations)
09775 %
09776 %  A description of each parameter follows:
09777 %
09778 %    o wand: the magick wand.
09779 %
09780 %    o delay: the image delay in 1/100th of a second.
09781 %
09782 */
09783 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
09784   const unsigned long iterations)
09785 {
09786   assert(wand != (MagickWand *) NULL);
09787   assert(wand->signature == WandSignature);
09788   if (wand->debug != MagickFalse)
09789     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09790   if (wand->images == (Image *) NULL)
09791     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09792   wand->images->iterations=iterations;
09793   return(MagickTrue);
09794 }
09795 
09796 /*
09797 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09798 %                                                                             %
09799 %                                                                             %
09800 %                                                                             %
09801 %   M a g i c k S e t I m a g e M a t t e                                     %
09802 %                                                                             %
09803 %                                                                             %
09804 %                                                                             %
09805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09806 %
09807 %  MagickSetImageMatte() sets the image matte channel.
09808 %
09809 %  The format of the MagickSetImageMatteColor method is:
09810 %
09811 %      MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
09812 %        const MagickBooleanType *matte)
09813 %
09814 %  A description of each parameter follows:
09815 %
09816 %    o wand: the magick wand.
09817 %
09818 %    o matte: Set to MagickTrue to enable the image matte channel otherwise
09819 %      MagickFalse.
09820 %
09821 */
09822 WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
09823   const MagickBooleanType matte)
09824 {
09825   assert(wand != (MagickWand *) NULL);
09826   assert(wand->signature == WandSignature);
09827   if (wand->debug != MagickFalse)
09828     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09829   if (wand->images == (Image *) NULL)
09830     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09831   if ((wand->images->matte == MagickFalse) && (matte != MagickFalse))
09832     (void) SetImageOpacity(wand->images,OpaqueOpacity);
09833   wand->images->matte=matte;
09834   return(MagickTrue);
09835 }
09836 
09837 /*
09838 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09839 %                                                                             %
09840 %                                                                             %
09841 %                                                                             %
09842 %   M a g i c k S e t I m a g e M a t t e C o l o r                           %
09843 %                                                                             %
09844 %                                                                             %
09845 %                                                                             %
09846 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09847 %
09848 %  MagickSetImageMatteColor() sets the image matte color.
09849 %
09850 %  The format of the MagickSetImageMatteColor method is:
09851 %
09852 %      MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
09853 %        const PixelWand *matte)
09854 %
09855 %  A description of each parameter follows:
09856 %
09857 %    o wand: the magick wand.
09858 %
09859 %    o matte: the matte pixel wand.
09860 %
09861 */
09862 WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
09863   const PixelWand *matte)
09864 {
09865   assert(wand != (MagickWand *) NULL);
09866   assert(wand->signature == WandSignature);
09867   if (wand->debug != MagickFalse)
09868     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09869   if (wand->images == (Image *) NULL)
09870     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09871   PixelGetQuantumColor(matte,&wand->images->matte_color);
09872   return(MagickTrue);
09873 }
09874 
09875 /*
09876 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09877 %                                                                             %
09878 %                                                                             %
09879 %                                                                             %
09880 %   M a g i c k S e t I m a g e O p a c i t y                                 %
09881 %                                                                             %
09882 %                                                                             %
09883 %                                                                             %
09884 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09885 %
09886 %  MagickSetImageOpacity() sets the image to the specified opacity level.
09887 %
09888 %  The format of the MagickSetImageOpacity method is:
09889 %
09890 %      MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
09891 %        const double alpha)
09892 %
09893 %  A description of each parameter follows:
09894 %
09895 %    o wand: the magick wand.
09896 %
09897 %    o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
09898 %      transparent.
09899 %
09900 */
09901 WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand,
09902   const double alpha)
09903 {
09904   MagickBooleanType
09905     status;
09906 
09907   assert(wand != (MagickWand *) NULL);
09908   assert(wand->signature == WandSignature);
09909   if (wand->debug != MagickFalse)
09910     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09911   if (wand->images == (Image *) NULL)
09912     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09913   status=SetImageOpacity(wand->images,RoundToQuantum((MagickRealType)
09914     QuantumRange-QuantumRange*alpha));
09915   if (status == MagickFalse)
09916     InheritException(wand->exception,&wand->images->exception);
09917   return(status);
09918 }
09919 
09920 /*
09921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09922 %                                                                             %
09923 %                                                                             %
09924 %                                                                             %
09925 %   M a g i c k S e t I m a g e O r i e n t a t i o n                         %
09926 %                                                                             %
09927 %                                                                             %
09928 %                                                                             %
09929 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09930 %
09931 %  MagickSetImageOrientation() sets the image orientation.
09932 %
09933 %  The format of the MagickSetImageOrientation method is:
09934 %
09935 %      MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
09936 %        const OrientationType orientation)
09937 %
09938 %  A description of each parameter follows:
09939 %
09940 %    o wand: the magick wand.
09941 %
09942 %    o orientation: the image orientation type.
09943 %
09944 */
09945 WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
09946   const OrientationType orientation)
09947 {
09948   assert(wand != (MagickWand *) NULL);
09949   assert(wand->signature == WandSignature);
09950   if (wand->debug != MagickFalse)
09951     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09952   if (wand->images == (Image *) NULL)
09953     ThrowWandException(WandError,"ContainsNoImages",wand->name);
09954   wand->images->orientation=orientation;
09955   return(MagickTrue);
09956 }
09957 
09958 /*
09959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09960 %                                                                             %
09961 %                                                                             %
09962 %                                                                             %
09963 %   M a g i c k S e t I m a g e P a g e                                       %
09964 %                                                                             %
09965 %                                                                             %
09966 %                                                                             %
09967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09968 %
09969 %  MagickSetImagePage() sets the page geometry of the image.
09970 %
09971 %  The format of the MagickSetImagePage method is:
09972 %
09973 %      MagickBooleanType MagickSetImagePage(MagickWand *wand,
09974 %        const unsigned long width,const unsigned long height,const long x,
09975 %        const long y)
09976 %
09977 %  A description of each parameter follows:
09978 %
09979 %    o wand: the magick wand.
09980 %
09981 %    o width: the page width.
09982 %
09983 %    o height: the page height.
09984 %
09985 %    o x: the page x-offset.
09986 %
09987 %    o y: the page y-offset.
09988 %
09989 */
09990 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
09991   const unsigned long width,const unsigned long height,const long x,
09992   const long y)
09993 {
09994   assert(wand != (MagickWand *) NULL);
09995   assert(wand->signature == WandSignature);
09996   if (wand->debug != MagickFalse)
09997     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
09998   if (wand->images == (Image *) NULL)
09999     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10000   wand->images->page.width=width;
10001   wand->images->page.height=height;
10002   wand->images->page.x=x;
10003   wand->images->page.y=y;
10004   return(MagickTrue);
10005 }
10006 
10007 /*
10008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10009 %                                                                             %
10010 %                                                                             %
10011 %                                                                             %
10012 %   M a g i c k S e t I m a g e P r o g r e s s M o n i t o r                 %
10013 %                                                                             %
10014 %                                                                             %
10015 %                                                                             %
10016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10017 %
10018 %  MagickSetImageProgressMonitor() sets the wand image progress monitor to the
10019 %  specified method and returns the previous progress monitor if any.  The
10020 %  progress monitor method looks like this:
10021 %
10022 %    MagickBooleanType MagickProgressMonitor(const char *text,
10023 %      const MagickOffsetType offset,const MagickSizeType span,
10024 %      void *client_data)
10025 %
10026 %  If the progress monitor returns MagickFalse, the current operation is
10027 %  interrupted.
10028 %
10029 %  The format of the MagickSetImageProgressMonitor method is:
10030 %
10031 %      MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand
10032 %        const MagickProgressMonitor progress_monitor,void *client_data)
10033 %
10034 %  A description of each parameter follows:
10035 %
10036 %    o wand: the magick wand.
10037 %
10038 %    o progress_monitor: Specifies a pointer to a method to monitor progress
10039 %      of an image operation.
10040 %
10041 %    o client_data: Specifies a pointer to any client data.
10042 %
10043 */
10044 WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand,
10045   const MagickProgressMonitor progress_monitor,void *client_data)
10046 {
10047   MagickProgressMonitor
10048     previous_monitor;
10049 
10050   assert(wand != (MagickWand *) NULL);
10051   assert(wand->signature == WandSignature);
10052   if (wand->debug != MagickFalse)
10053     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10054   if (wand->images == (Image *) NULL)
10055     {
10056       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10057         "ContainsNoImages","`%s'",wand->name);
10058       return((MagickProgressMonitor) NULL);
10059     }
10060   previous_monitor=SetImageProgressMonitor(wand->images,
10061     progress_monitor,client_data);
10062   return(previous_monitor);
10063 }
10064 
10065 /*
10066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10067 %                                                                             %
10068 %                                                                             %
10069 %                                                                             %
10070 %   M a g i c k S e t I m a g e R e d P r i m a r y                           %
10071 %                                                                             %
10072 %                                                                             %
10073 %                                                                             %
10074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10075 %
10076 %  MagickSetImageRedPrimary() sets the image chromaticity red primary point.
10077 %
10078 %  The format of the MagickSetImageRedPrimary method is:
10079 %
10080 %      MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10081 %        const double x,const double y)
10082 %
10083 %  A description of each parameter follows:
10084 %
10085 %    o wand: the magick wand.
10086 %
10087 %    o x: the red primary x-point.
10088 %
10089 %    o y: the red primary y-point.
10090 %
10091 */
10092 WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand,
10093   const double x,const double y)
10094 {
10095   assert(wand != (MagickWand *) NULL);
10096   assert(wand->signature == WandSignature);
10097   if (wand->debug != MagickFalse)
10098     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10099   if (wand->images == (Image *) NULL)
10100     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10101   wand->images->chromaticity.red_primary.x=x;
10102   wand->images->chromaticity.red_primary.y=y;
10103   return(MagickTrue);
10104 }
10105 
10106 /*
10107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10108 %                                                                             %
10109 %                                                                             %
10110 %                                                                             %
10111 %   M a g i c k S e t I m a g e R e n d e r i n g I n t e n t                 %
10112 %                                                                             %
10113 %                                                                             %
10114 %                                                                             %
10115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10116 %
10117 %  MagickSetImageRenderingIntent() sets the image rendering intent.
10118 %
10119 %  The format of the MagickSetImageRenderingIntent method is:
10120 %
10121 %      MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10122 %        const RenderingIntent rendering_intent)
10123 %
10124 %  A description of each parameter follows:
10125 %
10126 %    o wand: the magick wand.
10127 %
10128 %    o rendering_intent: the image rendering intent: UndefinedIntent,
10129 %      SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
10130 %
10131 */
10132 WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand,
10133   const RenderingIntent rendering_intent)
10134 {
10135   assert(wand != (MagickWand *) NULL);
10136   assert(wand->signature == WandSignature);
10137   if (wand->debug != MagickFalse)
10138     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10139   if (wand->images == (Image *) NULL)
10140     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10141   wand->images->rendering_intent=rendering_intent;
10142   return(MagickTrue);
10143 }
10144 
10145 /*
10146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10147 %                                                                             %
10148 %                                                                             %
10149 %                                                                             %
10150 %   M a g i c k S e t I m a g e R e s o l u t i o n                           %
10151 %                                                                             %
10152 %                                                                             %
10153 %                                                                             %
10154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10155 %
10156 %  MagickSetImageResolution() sets the image resolution.
10157 %
10158 %  The format of the MagickSetImageResolution method is:
10159 %
10160 %      MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10161 %        const double x_resolution,const doubtl y_resolution)
10162 %
10163 %  A description of each parameter follows:
10164 %
10165 %    o wand: the magick wand.
10166 %
10167 %    o x_resolution: the image x resolution.
10168 %
10169 %    o y_resolution: the image y resolution.
10170 %
10171 */
10172 WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
10173   const double x_resolution,const double y_resolution)
10174 {
10175   assert(wand != (MagickWand *) NULL);
10176   assert(wand->signature == WandSignature);
10177   if (wand->debug != MagickFalse)
10178     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10179   if (wand->images == (Image *) NULL)
10180     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10181   wand->images->x_resolution=x_resolution;
10182   wand->images->y_resolution=y_resolution;
10183   return(MagickTrue);
10184 }
10185 
10186 /*
10187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10188 %                                                                             %
10189 %                                                                             %
10190 %                                                                             %
10191 %   M a g i c k S e t I m a g e S c e n e                                     %
10192 %                                                                             %
10193 %                                                                             %
10194 %                                                                             %
10195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10196 %
10197 %  MagickSetImageScene() sets the image scene.
10198 %
10199 %  The format of the MagickSetImageScene method is:
10200 %
10201 %      MagickBooleanType MagickSetImageScene(MagickWand *wand,
10202 %        const unsigned long scene)
10203 %
10204 %  A description of each parameter follows:
10205 %
10206 %    o wand: the magick wand.
10207 %
10208 %    o delay: the image scene number.
10209 %
10210 */
10211 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
10212   const unsigned long scene)
10213 {
10214   assert(wand != (MagickWand *) NULL);
10215   assert(wand->signature == WandSignature);
10216   if (wand->debug != MagickFalse)
10217     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10218   if (wand->images == (Image *) NULL)
10219     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10220   wand->images->scene=scene;
10221   return(MagickTrue);
10222 }
10223 
10224 /*
10225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10226 %                                                                             %
10227 %                                                                             %
10228 %                                                                             %
10229 %   M a g i c k S e t I m a g e T i c k s P e r S e c o n d                   %
10230 %                                                                             %
10231 %                                                                             %
10232 %                                                                             %
10233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10234 %
10235 %  MagickSetImageTicksPerSecond() sets the image ticks-per-second.
10236 %
10237 %  The format of the MagickSetImageTicksPerSecond method is:
10238 %
10239 %      MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10240 %        const long ticks_per-second)
10241 %
10242 %  A description of each parameter follows:
10243 %
10244 %    o wand: the magick wand.
10245 %
10246 %    o ticks_per_second: the units to use for the image delay.
10247 %
10248 */
10249 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
10250   const long ticks_per_second)
10251 {
10252   assert(wand != (MagickWand *) NULL);
10253   assert(wand->signature == WandSignature);
10254   if (wand->debug != MagickFalse)
10255     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10256   if (wand->images == (Image *) NULL)
10257     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10258   wand->images->ticks_per_second=ticks_per_second;
10259   return(MagickTrue);
10260 }
10261 
10262 /*
10263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10264 %                                                                             %
10265 %                                                                             %
10266 %                                                                             %
10267 %   M a g i c k S e t I m a g e T y p e                                       %
10268 %                                                                             %
10269 %                                                                             %
10270 %                                                                             %
10271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10272 %
10273 %  MagickSetImageType() sets the image type.
10274 %
10275 %  The format of the MagickSetImageType method is:
10276 %
10277 %      MagickBooleanType MagickSetImageType(MagickWand *wand,
10278 %        const ImageType image_type)
10279 %
10280 %  A description of each parameter follows:
10281 %
10282 %    o wand: the magick wand.
10283 %
10284 %    o image_type: the image type:   UndefinedType, BilevelType, GrayscaleType,
10285 %      GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
10286 %      TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
10287 %      or OptimizeType.
10288 %
10289 */
10290 WandExport MagickBooleanType MagickSetImageType(MagickWand *wand,
10291   const ImageType image_type)
10292 {
10293   assert(wand != (MagickWand *) NULL);
10294   assert(wand->signature == WandSignature);
10295   if (wand->debug != MagickFalse)
10296     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10297   if (wand->images == (Image *) NULL)
10298     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10299   return(SetImageType(wand->images,image_type));
10300 }
10301 
10302 /*
10303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10304 %                                                                             %
10305 %                                                                             %
10306 %                                                                             %
10307 %   M a g i c k S e t I m a g e U n i t s                                     %
10308 %                                                                             %
10309 %                                                                             %
10310 %                                                                             %
10311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10312 %
10313 %  MagickSetImageUnits() sets the image units of resolution.
10314 %
10315 %  The format of the MagickSetImageUnits method is:
10316 %
10317 %      MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10318 %        const ResolutionType units)
10319 %
10320 %  A description of each parameter follows:
10321 %
10322 %    o wand: the magick wand.
10323 %
10324 %    o units: the image units of resolution : UndefinedResolution,
10325 %      PixelsPerInchResolution, or PixelsPerCentimeterResolution.
10326 %
10327 */
10328 WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand,
10329   const ResolutionType units)
10330 {
10331   assert(wand != (MagickWand *) NULL);
10332   assert(wand->signature == WandSignature);
10333   if (wand->debug != MagickFalse)
10334     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10335   if (wand->images == (Image *) NULL)
10336     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10337   wand->images->units=units;
10338   return(MagickTrue);
10339 }
10340 
10341 /*
10342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10343 %                                                                             %
10344 %                                                                             %
10345 %                                                                             %
10346 %   M a g i c k S e t I m a g e V i r t u a l P i x e l M e t h o d           %
10347 %                                                                             %
10348 %                                                                             %
10349 %                                                                             %
10350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10351 %
10352 %  MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.
10353 %
10354 %  The format of the MagickSetImageVirtualPixelMethod method is:
10355 %
10356 %      VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10357 %        const VirtualPixelMethod method)
10358 %
10359 %  A description of each parameter follows:
10360 %
10361 %    o wand: the magick wand.
10362 %
10363 %    o method: the image virtual pixel method : UndefinedVirtualPixelMethod,
10364 %      ConstantVirtualPixelMethod,  EdgeVirtualPixelMethod,
10365 %      MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
10366 %
10367 */
10368 WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand,
10369   const VirtualPixelMethod method)
10370 {
10371   assert(wand != (MagickWand *) NULL);
10372   assert(wand->signature == WandSignature);
10373   if (wand->debug != MagickFalse)
10374     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10375   if (wand->images == (Image *) NULL)
10376     return(UndefinedVirtualPixelMethod);
10377   return(SetImageVirtualPixelMethod(wand->images,method));
10378 }
10379 
10380 /*
10381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10382 %                                                                             %
10383 %                                                                             %
10384 %                                                                             %
10385 %   M a g i c k S e t I m a g e W h i t e P o i n t                           %
10386 %                                                                             %
10387 %                                                                             %
10388 %                                                                             %
10389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10390 %
10391 %  MagickSetImageWhitePoint() sets the image chromaticity white point.
10392 %
10393 %  The format of the MagickSetImageWhitePoint method is:
10394 %
10395 %      MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10396 %        const double x,const double y)
10397 %
10398 %  A description of each parameter follows:
10399 %
10400 %    o wand: the magick wand.
10401 %
10402 %    o x: the white x-point.
10403 %
10404 %    o y: the white y-point.
10405 %
10406 */
10407 WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand,
10408   const double x,const double y)
10409 {
10410   assert(wand != (MagickWand *) NULL);
10411   assert(wand->signature == WandSignature);
10412   if (wand->debug != MagickFalse)
10413     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10414   if (wand->images == (Image *) NULL)
10415     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10416   wand->images->chromaticity.white_point.x=x;
10417   wand->images->chromaticity.white_point.y=y;
10418   return(MagickTrue);
10419 }
10420 
10421 /*
10422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10423 %                                                                             %
10424 %                                                                             %
10425 %                                                                             %
10426 %   M a g i c k S h a d e I m a g e C h a n n e l                             %
10427 %                                                                             %
10428 %                                                                             %
10429 %                                                                             %
10430 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10431 %
10432 %  MagickShadeImage() shines a distant light on an image to create a
10433 %  three-dimensional effect. You control the positioning of the light with
10434 %  azimuth and elevation; azimuth is measured in degrees off the x axis
10435 %  and elevation is measured in pixels above the Z axis.
10436 %
10437 %  The format of the MagickShadeImage method is:
10438 %
10439 %      MagickBooleanType MagickShadeImage(MagickWand *wand,
10440 %        const MagickBooleanType gray,const double azimuth,
10441 %        const double elevation)
10442 %
10443 %  A description of each parameter follows:
10444 %
10445 %    o wand: the magick wand.
10446 %
10447 %    o gray: A value other than zero shades the intensity of each pixel.
10448 %
10449 %    o azimuth, elevation:  Define the light source direction.
10450 %
10451 */
10452 WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
10453   const MagickBooleanType gray,const double asimuth,const double elevation)
10454 {
10455   Image
10456     *shade_image;
10457 
10458   assert(wand != (MagickWand *) NULL);
10459   assert(wand->signature == WandSignature);
10460   if (wand->debug != MagickFalse)
10461     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10462   if (wand->images == (Image *) NULL)
10463     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10464   shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception);
10465   if (shade_image == (Image *) NULL)
10466     return(MagickFalse);
10467   ReplaceImageInList(&wand->images,shade_image);
10468   return(MagickTrue);
10469 }
10470 
10471 /*
10472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10473 %                                                                             %
10474 %                                                                             %
10475 %                                                                             %
10476 %   M a g i c k S h a d o w I m a g e                                         %
10477 %                                                                             %
10478 %                                                                             %
10479 %                                                                             %
10480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10481 %
10482 %  MagickShadowImage() simulates an image shadow.
10483 %
10484 %  The format of the MagickShadowImage method is:
10485 %
10486 %      MagickBooleanType MagickShadowImage(MagickWand *wand,
10487 %        const double opacity,const double sigma,const long x,const long y)
10488 %
10489 %  A description of each parameter follows:
10490 %
10491 %    o wand: the magick wand.
10492 %
10493 %    o opacity: percentage transparency.
10494 %
10495 %    o sigma: the standard deviation of the Gaussian, in pixels.
10496 %
10497 %    o x: the shadow x-offset.
10498 %
10499 %    o y: the shadow y-offset.
10500 %
10501 */
10502 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
10503   const double opacity,const double sigma,const long x,const long y)
10504 {
10505   Image
10506     *shadow_image;
10507 
10508   assert(wand != (MagickWand *) NULL);
10509   assert(wand->signature == WandSignature);
10510   if (wand->debug != MagickFalse)
10511     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10512   if (wand->images == (Image *) NULL)
10513     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10514   shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception);
10515   if (shadow_image == (Image *) NULL)
10516     return(MagickFalse);
10517   ReplaceImageInList(&wand->images,shadow_image);
10518   return(MagickTrue);
10519 }
10520 
10521 /*
10522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10523 %                                                                             %
10524 %                                                                             %
10525 %                                                                             %
10526 %   M a g i c k S h a r p e n I m a g e                                       %
10527 %                                                                             %
10528 %                                                                             %
10529 %                                                                             %
10530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10531 %
10532 %  MagickSharpenImage() sharpens an image.  We convolve the image with a
10533 %  Gaussian operator of the given radius and standard deviation (sigma).
10534 %  For reasonable results, the radius should be larger than sigma.  Use a
10535 %  radius of 0 and MagickSharpenImage() selects a suitable radius for you.
10536 %
10537 %  The format of the MagickSharpenImage method is:
10538 %
10539 %      MagickBooleanType MagickSharpenImage(MagickWand *wand,
10540 %        const double radius,const double sigma)
10541 %      MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
10542 %        const ChannelType channel,const double radius,const double sigma)
10543 %
10544 %  A description of each parameter follows:
10545 %
10546 %    o wand: the magick wand.
10547 %
10548 %    o channel: the image channel(s).
10549 %
10550 %    o radius: the radius of the Gaussian, in pixels, not counting the center
10551 %      pixel.
10552 %
10553 %    o sigma: the standard deviation of the Gaussian, in pixels.
10554 %
10555 */
10556 
10557 WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand,
10558   const double radius,const double sigma)
10559 {
10560   MagickBooleanType
10561     status;
10562 
10563   status=MagickSharpenImageChannel(wand,DefaultChannels,radius,sigma);
10564   return(status);
10565 }
10566 
10567 WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
10568   const ChannelType channel,const double radius,const double sigma)
10569 {
10570   Image
10571     *sharp_image;
10572 
10573   assert(wand != (MagickWand *) NULL);
10574   assert(wand->signature == WandSignature);
10575   if (wand->debug != MagickFalse)
10576     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10577   if (wand->images == (Image *) NULL)
10578     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10579   sharp_image=SharpenImageChannel(wand->images,channel,radius,sigma,
10580     wand->exception);
10581   if (sharp_image == (Image *) NULL)
10582     return(MagickFalse);
10583   ReplaceImageInList(&wand->images,sharp_image);
10584   return(MagickTrue);
10585 }
10586 
10587 /*
10588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10589 %                                                                             %
10590 %                                                                             %
10591 %                                                                             %
10592 %   M a g i c k S h a v e I m a g e                                           %
10593 %                                                                             %
10594 %                                                                             %
10595 %                                                                             %
10596 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10597 %
10598 %  MagickShaveImage() shaves pixels from the image edges.  It allocates the
10599 %  memory necessary for the new Image structure and returns a pointer to the
10600 %  new image.
10601 %
10602 %  The format of the MagickShaveImage method is:
10603 %
10604 %      MagickBooleanType MagickShaveImage(MagickWand *wand,
10605 %        const unsigned long columns,const unsigned long rows)
10606 %
10607 %  A description of each parameter follows:
10608 %
10609 %    o wand: the magick wand.
10610 %
10611 %    o columns: the number of columns in the scaled image.
10612 %
10613 %    o rows: the number of rows in the scaled image.
10614 %
10615 %
10616 */
10617 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
10618   const unsigned long columns,const unsigned long rows)
10619 {
10620   Image
10621     *shave_image;
10622 
10623   RectangleInfo
10624     shave_info;
10625 
10626   assert(wand != (MagickWand *) NULL);
10627   assert(wand->signature == WandSignature);
10628   if (wand->debug != MagickFalse)
10629     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10630   if (wand->images == (Image *) NULL)
10631     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10632   shave_info.width=columns;
10633   shave_info.height=rows;
10634   shave_info.x=0;
10635   shave_info.y=0;
10636   shave_image=ShaveImage(wand->images,&shave_info,wand->exception);
10637   if (shave_image == (Image *) NULL)
10638     return(MagickFalse);
10639   ReplaceImageInList(&wand->images,shave_image);
10640   return(MagickTrue);
10641 }
10642 
10643 /*
10644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10645 %                                                                             %
10646 %                                                                             %
10647 %                                                                             %
10648 %   M a g i c k S h e a r I m a g e                                           %
10649 %                                                                             %
10650 %                                                                             %
10651 %                                                                             %
10652 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10653 %
10654 %  MagickShearImage() slides one edge of an image along the X or Y axis,
10655 %  creating a parallelogram.  An X direction shear slides an edge along the X
10656 %  axis, while a Y direction shear slides an edge along the Y axis.  The amount
10657 %  of the shear is controlled by a shear angle.  For X direction shears, x_shear
10658 %  is measured relative to the Y axis, and similarly, for Y direction shears
10659 %  y_shear is measured relative to the X axis.  Empty triangles left over from
10660 %  shearing the image are filled with the background color.
10661 %
10662 %  The format of the MagickShearImage method is:
10663 %
10664 %      MagickBooleanType MagickShearImage(MagickWand *wand,
10665 %        const PixelWand *background,const double x_shear,onst double y_shear)
10666 %
10667 %  A description of each parameter follows:
10668 %
10669 %    o wand: the magick wand.
10670 %
10671 %    o background: the background pixel wand.
10672 %
10673 %    o x_shear: the number of degrees to shear the image.
10674 %
10675 %    o y_shear: the number of degrees to shear the image.
10676 %
10677 */
10678 WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
10679   const PixelWand *background,const double x_shear,const double y_shear)
10680 {
10681   Image
10682     *shear_image;
10683 
10684   assert(wand != (MagickWand *) NULL);
10685   assert(wand->signature == WandSignature);
10686   if (wand->debug != MagickFalse)
10687     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10688   if (wand->images == (Image *) NULL)
10689     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10690   PixelGetQuantumColor(background,&wand->images->background_color);
10691   shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception);
10692   if (shear_image == (Image *) NULL)
10693     return(MagickFalse);
10694   ReplaceImageInList(&wand->images,shear_image);
10695   return(MagickTrue);
10696 }
10697 
10698 /*
10699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10700 %                                                                             %
10701 %                                                                             %
10702 %                                                                             %
10703 %   M a g i c k S i g m o i d a l C o n t r a s t I m a g e                   %
10704 %                                                                             %
10705 %                                                                             %
10706 %                                                                             %
10707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10708 %
10709 %  MagickSigmoidalContrastImage() adjusts the contrast of an image with a
10710 %  non-linear sigmoidal contrast algorithm.  Increase the contrast of the
10711 %  image using a sigmoidal transfer function without saturating highlights or
10712 %  shadows.  Contrast indicates how much to increase the contrast (0 is none;
10713 %  3 is typical; 20 is pushing it); mid-point indicates where midtones fall in
10714 %  the resultant image (0 is white; 50% is middle-gray; 100% is black).  Set
10715 %  sharpen to MagickTrue to increase the image contrast otherwise the contrast
10716 %  is reduced.
10717 %
10718 %  The format of the MagickSigmoidalContrastImage method is:
10719 %
10720 %      MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10721 %        const MagickBooleanType sharpen,const double alpha,const double beta)
10722 %      MagickBooleanType MagickSigmoidalContrastImageChannel(MagickWand *wand,
10723 %        const ChannelType channel,const MagickBooleanType sharpen,
10724 %        const double alpha,const double beta)
10725 %
10726 %  A description of each parameter follows:
10727 %
10728 %    o wand: the magick wand.
10729 %
10730 %    o channel: Identify which channel to level: RedChannel, GreenChannel,
10731 %
10732 %    o sharpen: Increase or decrease image contrast.
10733 %
10734 %    o alpha: control the "shoulder" of the contast curve.
10735 %
10736 %    o beta: control the "toe" of the contast curve.
10737 %
10738 */
10739 
10740 WandExport MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
10741   const MagickBooleanType sharpen,const double alpha,const double beta)
10742 {
10743   MagickBooleanType
10744     status;
10745 
10746   status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen,
10747     alpha,beta);
10748   return(status);
10749 }
10750 
10751 WandExport MagickBooleanType MagickSigmoidalContrastImageChannel(
10752   MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen,
10753   const double alpha,const double beta)
10754 {
10755   MagickBooleanType
10756     status;
10757 
10758   assert(wand != (MagickWand *) NULL);
10759   assert(wand->signature == WandSignature);
10760   if (wand->debug != MagickFalse)
10761     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10762   if (wand->images == (Image *) NULL)
10763     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10764   status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta);
10765   if (status == MagickFalse)
10766     InheritException(wand->exception,&wand->images->exception);
10767   return(status);
10768 }
10769 
10770 /*
10771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10772 %                                                                             %
10773 %                                                                             %
10774 %                                                                             %
10775 %   M a g i c k S i m i l a r i t y I m a g e                                 %
10776 %                                                                             %
10777 %                                                                             %
10778 %                                                                             %
10779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10780 %
10781 %  MagickSimilarityImage() compares the reference image of the image and
10782 %  returns the best match offset.  In addition, it returns a similarity image
10783 %  such that an exact match location is completely white and if none of the
10784 %  pixels match, black, otherwise some gray level in-between.
10785 %
10786 %  The format of the MagickSimilarityImage method is:
10787 %
10788 %      MagickWand *MagickSimilarityImage(MagickWand *wand,
10789 %        const MagickWand *reference,RectangeInfo *offset,double *similarity)
10790 %
10791 %  A description of each parameter follows:
10792 %
10793 %    o wand: the magick wand.
10794 %
10795 %    o reference: the reference wand.
10796 %
10797 %    o offset: the best match offset of the reference image within the image.
10798 %
10799 %    o similarity: the computed similarity between the images.
10800 %
10801 */
10802 WandExport MagickWand *MagickSimilarityImage(MagickWand *wand,
10803   const MagickWand *reference,RectangleInfo *offset,double *similarity)
10804 {
10805   Image
10806     *similarity_image;
10807 
10808   assert(wand != (MagickWand *) NULL);
10809   assert(wand->signature == WandSignature);
10810   if (wand->debug != MagickFalse)
10811     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10812   if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
10813     {
10814       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
10815         "ContainsNoImages","`%s'",wand->name);
10816       return((MagickWand *) NULL);
10817     }
10818   similarity_image=SimilarityImage(wand->images,reference->images,offset,
10819     similarity,&wand->images->exception);
10820   if (similarity_image == (Image *) NULL)
10821     return((MagickWand *) NULL);
10822   return(CloneMagickWandFromImages(wand,similarity_image));
10823 }
10824 
10825 /*
10826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10827 %                                                                             %
10828 %                                                                             %
10829 %                                                                             %
10830 %   M a g i c k S k e t c h I m a g e                                         %
10831 %                                                                             %
10832 %                                                                             %
10833 %                                                                             %
10834 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10835 %
10836 %  MagickSketchImage() simulates a pencil sketch.  We convolve the image with
10837 %  a Gaussian operator of the given radius and standard deviation (sigma).
10838 %  For reasonable results, radius should be larger than sigma.  Use a
10839 %  radius of 0 and SketchImage() selects a suitable radius for you.
10840 %  Angle gives the angle of the blurring motion.
10841 %
10842 %  The format of the MagickSketchImage method is:
10843 %
10844 %      MagickBooleanType MagickSketchImage(MagickWand *wand,
10845 %        const double radius,const double sigma,const double angle)
10846 %
10847 %  A description of each parameter follows:
10848 %
10849 %    o wand: the magick wand.
10850 %
10851 %    o radius: the radius of the Gaussian, in pixels, not counting
10852 %      the center pixel.
10853 %
10854 %    o sigma: the standard deviation of the Gaussian, in pixels.
10855 %
10856 %    o angle: Apply the effect along this angle.
10857 %
10858 */
10859 WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
10860   const double radius,const double sigma,const double angle)
10861 {
10862   Image
10863     *sketch_image;
10864 
10865   assert(wand != (MagickWand *) NULL);
10866   assert(wand->signature == WandSignature);
10867   if (wand->debug != MagickFalse)
10868     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10869   if (wand->images == (Image *) NULL)
10870     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10871   sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
10872   if (sketch_image == (Image *) NULL)
10873     return(MagickFalse);
10874   ReplaceImageInList(&wand->images,sketch_image);
10875   return(MagickTrue);
10876 }
10877 
10878 /*
10879 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10880 %                                                                             %
10881 %                                                                             %
10882 %                                                                             %
10883 %     M a g i c k S o l a r i z e I m a g e                                   %
10884 %                                                                             %
10885 %                                                                             %
10886 %                                                                             %
10887 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10888 %
10889 %  MagickSolarizeImage() applies a special effect to the image, similar to the
10890 %  effect achieved in a photo darkroom by selectively exposing areas of photo
10891 %  sensitive paper to light.  Threshold ranges from 0 to QuantumRange and is a
10892 %  measure of the extent of the solarization.
10893 %
10894 %  The format of the MagickSolarizeImage method is:
10895 %
10896 %      MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10897 %        const double threshold)
10898 %
10899 %  A description of each parameter follows:
10900 %
10901 %    o wand: the magick wand.
10902 %
10903 %    o threshold:  Define the extent of the solarization.
10904 %
10905 */
10906 WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
10907   const double threshold)
10908 {
10909   MagickBooleanType
10910     status;
10911 
10912   assert(wand != (MagickWand *) NULL);
10913   assert(wand->signature == WandSignature);
10914   if (wand->debug != MagickFalse)
10915     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10916   if (wand->images == (Image *) NULL)
10917     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10918   status=SolarizeImage(wand->images,threshold);
10919   if (status == MagickFalse)
10920     InheritException(wand->exception,&wand->images->exception);
10921   return(status);
10922 }
10923 
10924 /*
10925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10926 %                                                                             %
10927 %                                                                             %
10928 %                                                                             %
10929 %   M a g i c k S p a r s e C o l o r I m a g e                               %
10930 %                                                                             %
10931 %                                                                             %
10932 %                                                                             %
10933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10934 %
10935 %  MagickSparseColorImage(), given a set of coordinates, interpolates the
10936 %  colors found at those coordinates, across the whole image, using various
10937 %  methods.
10938 %
10939 %  The format of the MagickSparseColorImage method is:
10940 %
10941 %      MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10942 %        const ChannelType channel,const SparseColorMethod method,
10943 %        const unsigned long number_arguments,const double *arguments)
10944 %
10945 %  A description of each parameter follows:
10946 %
10947 %    o image: the image to be sparseed.
10948 %
10949 %    o method: the method of image sparseion.
10950 %
10951 %        ArcSparseColorion will always ignore source image offset, and always
10952 %        'bestfit' the destination image with the top left corner offset
10953 %        relative to the polar mapping center.
10954 %
10955 %        Bilinear has no simple inverse mapping so will not allow 'bestfit'
10956 %        style of image sparseion.
10957 %
10958 %        Affine, Perspective, and Bilinear, will do least squares fitting of
10959 %        the distrotion when more than the minimum number of control point
10960 %        pairs are provided.
10961 %
10962 %        Perspective, and Bilinear, will fall back to a Affine sparseion when
10963 %        less than 4 control point pairs are provided. While Affine sparseions
10964 %        will let you use any number of control point pairs, that is Zero pairs
10965 %        is a No-Op (viewport only) distrotion, one pair is a translation and
10966 %        two pairs of control points will do a scale-rotate-translate, without
10967 %        any shearing.
10968 %
10969 %    o number_arguments: the number of arguments given for this sparseion
10970 %      method.
10971 %
10972 %    o arguments: the arguments for this sparseion method.
10973 %
10974 */
10975 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
10976   const ChannelType channel,const SparseColorMethod method,
10977   const unsigned long number_arguments,const double *arguments)
10978 {
10979   Image
10980     *sparse_image;
10981 
10982   assert(wand != (MagickWand *) NULL);
10983   assert(wand->signature == WandSignature);
10984   if (wand->debug != MagickFalse)
10985     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
10986   if (wand->images == (Image *) NULL)
10987     ThrowWandException(WandError,"ContainsNoImages",wand->name);
10988   sparse_image=SparseColorImage(wand->images,channel,method,number_arguments,
10989     arguments,wand->exception);
10990   if (sparse_image == (Image *) NULL)
10991     return(MagickFalse);
10992   ReplaceImageInList(&wand->images,sparse_image);
10993   return(MagickTrue);
10994 }
10995 
10996 /*
10997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10998 %                                                                             %
10999 %                                                                             %
11000 %                                                                             %
11001 %   M a g i c k S p l i c e I m a g e                                         %
11002 %                                                                             %
11003 %                                                                             %
11004 %                                                                             %
11005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11006 %
11007 %  MagickSpliceImage() splices a solid color into the image.
11008 %
11009 %  The format of the MagickSpliceImage method is:
11010 %
11011 %      MagickBooleanType MagickSpliceImage(MagickWand *wand,
11012 %        const unsigned long width,const unsigned long height,const long x,
11013 %        const long y)
11014 %
11015 %  A description of each parameter follows:
11016 %
11017 %    o wand: the magick wand.
11018 %
11019 %    o width: the region width.
11020 %
11021 %    o height: the region height.
11022 %
11023 %    o x: the region x offset.
11024 %
11025 %    o y: the region y offset.
11026 %
11027 */
11028 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
11029   const unsigned long width,const unsigned long height,const long x,
11030   const long y)
11031 {
11032   Image
11033     *splice_image;
11034 
11035   RectangleInfo
11036     splice;
11037 
11038   assert(wand != (MagickWand *) NULL);
11039   assert(wand->signature == WandSignature);
11040   if (wand->debug != MagickFalse)
11041     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11042   if (wand->images == (Image *) NULL)
11043     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11044   splice.width=width;
11045   splice.height=height;
11046   splice.x=x;
11047   splice.y=y;
11048   splice_image=SpliceImage(wand->images,&splice,wand->exception);
11049   if (splice_image == (Image *) NULL)
11050     return(MagickFalse);
11051   ReplaceImageInList(&wand->images,splice_image);
11052   return(MagickTrue);
11053 }
11054 
11055 /*
11056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11057 %                                                                             %
11058 %                                                                             %
11059 %                                                                             %
11060 %   M a g i c k S p r e a d I m a g e                                         %
11061 %                                                                             %
11062 %                                                                             %
11063 %                                                                             %
11064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11065 %
11066 %  MagickSpreadImage() is a special effects method that randomly displaces each
11067 %  pixel in a block defined by the radius parameter.
11068 %
11069 %  The format of the MagickSpreadImage method is:
11070 %
11071 %      MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
11072 %
11073 %  A description of each parameter follows:
11074 %
11075 %    o wand: the magick wand.
11076 %
11077 %    o radius:  Choose a random pixel in a neighborhood of this extent.
11078 %
11079 */
11080 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
11081   const double radius)
11082 {
11083   Image
11084     *spread_image;
11085 
11086   assert(wand != (MagickWand *) NULL);
11087   assert(wand->signature == WandSignature);
11088   if (wand->debug != MagickFalse)
11089     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11090   if (wand->images == (Image *) NULL)
11091     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11092   spread_image=SpreadImage(wand->images,radius,wand->exception);
11093   if (spread_image == (Image *) NULL)
11094     return(MagickFalse);
11095   ReplaceImageInList(&wand->images,spread_image);
11096   return(MagickTrue);
11097 }
11098 
11099 /*
11100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11101 %                                                                             %
11102 %                                                                             %
11103 %                                                                             %
11104 %   M a g i c k S t e g a n o I m a g e                                       %
11105 %                                                                             %
11106 %                                                                             %
11107 %                                                                             %
11108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11109 %
11110 %  MagickSteganoImage() hides a digital watermark within the image.
11111 %  Recover the hidden watermark later to prove that the authenticity of
11112 %  an image.  Offset defines the start position within the image to hide
11113 %  the watermark.
11114 %
11115 %  The format of the MagickSteganoImage method is:
11116 %
11117 %      MagickWand *MagickSteganoImage(MagickWand *wand,
11118 %        const MagickWand *watermark_wand,const long offset)
11119 %
11120 %  A description of each parameter follows:
11121 %
11122 %    o wand: the magick wand.
11123 %
11124 %    o watermark_wand: the watermark wand.
11125 %
11126 %    o offset: Start hiding at this offset into the image.
11127 %
11128 */
11129 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
11130   const MagickWand *watermark_wand,const long offset)
11131 {
11132   Image
11133     *stegano_image;
11134 
11135   assert(wand != (MagickWand *) NULL);
11136   assert(wand->signature == WandSignature);
11137   if (wand->debug != MagickFalse)
11138     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11139   if ((wand->images == (Image *) NULL) ||
11140       (watermark_wand->images == (Image *) NULL))
11141     {
11142       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11143         "ContainsNoImages","`%s'",wand->name);
11144       return((MagickWand *) NULL);
11145     }
11146   wand->images->offset=offset;
11147   stegano_image=SteganoImage(wand->images,watermark_wand->images,
11148     wand->exception);
11149   if (stegano_image == (Image *) NULL)
11150     return((MagickWand *) NULL);
11151   return(CloneMagickWandFromImages(wand,stegano_image));
11152 }
11153 
11154 /*
11155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11156 %                                                                             %
11157 %                                                                             %
11158 %                                                                             %
11159 %   M a g i c k S t e r e o I m a g e                                         %
11160 %                                                                             %
11161 %                                                                             %
11162 %                                                                             %
11163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11164 %
11165 %  MagickStereoImage() composites two images and produces a single image that
11166 %  is the composite of a left and right image of a stereo pair
11167 %
11168 %  The format of the MagickStereoImage method is:
11169 %
11170 %      MagickWand *MagickStereoImage(MagickWand *wand,
11171 %        const MagickWand *offset_wand)
11172 %
11173 %  A description of each parameter follows:
11174 %
11175 %    o wand: the magick wand.
11176 %
11177 %    o offset_wand: Another image wand.
11178 %
11179 */
11180 WandExport MagickWand *MagickStereoImage(MagickWand *wand,
11181   const MagickWand *offset_wand)
11182 {
11183   Image
11184     *stereo_image;
11185 
11186   assert(wand != (MagickWand *) NULL);
11187   assert(wand->signature == WandSignature);
11188   if (wand->debug != MagickFalse)
11189     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11190   if ((wand->images == (Image *) NULL) ||
11191       (offset_wand->images == (Image *) NULL))
11192     {
11193       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11194         "ContainsNoImages","`%s'",wand->name);
11195       return((MagickWand *) NULL);
11196     }
11197   stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception);
11198   if (stereo_image == (Image *) NULL)
11199     return((MagickWand *) NULL);
11200   return(CloneMagickWandFromImages(wand,stereo_image));
11201 }
11202 
11203 /*
11204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11205 %                                                                             %
11206 %                                                                             %
11207 %                                                                             %
11208 %   M a g i c k S t r i p I m a g e                                           %
11209 %                                                                             %
11210 %                                                                             %
11211 %                                                                             %
11212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11213 %
11214 %  MagickStripImage() strips an image of all profiles and comments.
11215 %
11216 %  The format of the MagickStripImage method is:
11217 %
11218 %      MagickBooleanType MagickStripImage(MagickWand *wand)
11219 %
11220 %  A description of each parameter follows:
11221 %
11222 %    o wand: the magick wand.
11223 %
11224 */
11225 WandExport MagickBooleanType MagickStripImage(MagickWand *wand)
11226 {
11227   MagickBooleanType
11228     status;
11229 
11230   assert(wand != (MagickWand *) NULL);
11231   assert(wand->signature == WandSignature);
11232   if (wand->debug != MagickFalse)
11233     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11234   if (wand->images == (Image *) NULL)
11235     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11236   status=StripImage(wand->images);
11237   if (status == MagickFalse)
11238     InheritException(wand->exception,&wand->images->exception);
11239   return(status);
11240 }
11241 
11242 /*
11243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11244 %                                                                             %
11245 %                                                                             %
11246 %                                                                             %
11247 %   M a g i c k S w i r l I m a g e                                           %
11248 %                                                                             %
11249 %                                                                             %
11250 %                                                                             %
11251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11252 %
11253 %  MagickSwirlImage() swirls the pixels about the center of the image, where
11254 %  degrees indicates the sweep of the arc through which each pixel is moved.
11255 %  You get a more dramatic effect as the degrees move from 1 to 360.
11256 %
11257 %  The format of the MagickSwirlImage method is:
11258 %
11259 %      MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees)
11260 %
11261 %  A description of each parameter follows:
11262 %
11263 %    o wand: the magick wand.
11264 %
11265 %    o degrees: Define the tightness of the swirling effect.
11266 %
11267 */
11268 WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand,
11269   const double degrees)
11270 {
11271   Image
11272     *swirl_image;
11273 
11274   assert(wand != (MagickWand *) NULL);
11275   assert(wand->signature == WandSignature);
11276   if (wand->debug != MagickFalse)
11277     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11278   if (wand->images == (Image *) NULL)
11279     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11280   swirl_image=SwirlImage(wand->images,degrees,wand->exception);
11281   if (swirl_image == (Image *) NULL)
11282     return(MagickFalse);
11283   ReplaceImageInList(&wand->images,swirl_image);
11284   return(MagickTrue);
11285 }
11286 
11287 /*
11288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11289 %                                                                             %
11290 %                                                                             %
11291 %                                                                             %
11292 %   M a g i c k T e x t u r e I m a g e                                       %
11293 %                                                                             %
11294 %                                                                             %
11295 %                                                                             %
11296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11297 %
11298 %  MagickTextureImage() repeatedly tiles the texture image across and down the
11299 %  image canvas.
11300 %
11301 %  The format of the MagickTextureImage method is:
11302 %
11303 %      MagickWand *MagickTextureImage(MagickWand *wand,
11304 %        const MagickWand *texture_wand)
11305 %
11306 %  A description of each parameter follows:
11307 %
11308 %    o wand: the magick wand.
11309 %
11310 %    o texture_wand: the texture wand
11311 %
11312 */
11313 WandExport MagickWand *MagickTextureImage(MagickWand *wand,
11314   const MagickWand *texture_wand)
11315 {
11316   Image
11317     *texture_image;
11318 
11319   MagickBooleanType
11320     status;
11321 
11322   assert(wand != (MagickWand *) NULL);
11323   assert(wand->signature == WandSignature);
11324   if (wand->debug != MagickFalse)
11325     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11326   if ((wand->images == (Image *) NULL) ||
11327       (texture_wand->images == (Image *) NULL))
11328     {
11329       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
11330         "ContainsNoImages","`%s'",wand->name);
11331       return((MagickWand *) NULL);
11332     }
11333   texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11334   if (texture_image == (Image *) NULL)
11335     return((MagickWand *) NULL);
11336   status=TextureImage(texture_image,texture_wand->images);
11337   if (status == MagickFalse)
11338     {
11339       InheritException(wand->exception,&texture_image->exception);
11340       texture_image=DestroyImage(texture_image);
11341       return((MagickWand *) NULL);
11342     }
11343   return(CloneMagickWandFromImages(wand,texture_image));
11344 }
11345 
11346 /*
11347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11348 %                                                                             %
11349 %                                                                             %
11350 %                                                                             %
11351 %   M a g i c k T h r e s h o l d I m a g e                                   %
11352 %                                                                             %
11353 %                                                                             %
11354 %                                                                             %
11355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11356 %
11357 %  MagickThresholdImage() changes the value of individual pixels based on
11358 %  the intensity of each pixel compared to threshold.  The result is a
11359 %  high-contrast, two color image.
11360 %
11361 %  The format of the MagickThresholdImage method is:
11362 %
11363 %      MagickBooleanType MagickThresholdImage(MagickWand *wand,
11364 %        const double threshold)
11365 %      MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11366 %        const ChannelType channel,const double threshold)
11367 %
11368 %  A description of each parameter follows:
11369 %
11370 %    o wand: the magick wand.
11371 %
11372 %    o channel: the image channel(s).
11373 %
11374 %    o threshold: Define the threshold value.
11375 %
11376 */
11377 WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand,
11378   const double threshold)
11379 {
11380   MagickBooleanType
11381     status;
11382 
11383   status=MagickThresholdImageChannel(wand,DefaultChannels,threshold);
11384   return(status);
11385 }
11386 
11387 WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
11388   const ChannelType channel,const double threshold)
11389 {
11390   MagickBooleanType
11391     status;
11392 
11393   assert(wand != (MagickWand *) NULL);
11394   assert(wand->signature == WandSignature);
11395   if (wand->debug != MagickFalse)
11396     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11397   if (wand->images == (Image *) NULL)
11398     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11399   status=BilevelImageChannel(wand->images,channel,threshold);
11400   if (status == MagickFalse)
11401     InheritException(wand->exception,&wand->images->exception);
11402   return(status);
11403 }
11404 
11405 /*
11406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11407 %                                                                             %
11408 %                                                                             %
11409 %                                                                             %
11410 %   M a g i c k T h u m b n a i l I m a g e                                   %
11411 %                                                                             %
11412 %                                                                             %
11413 %                                                                             %
11414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11415 %
11416 %  MagickThumbnailImage()  changes the size of an image to the given dimensions
11417 %  and removes any associated profiles.  The goal is to produce small low cost
11418 %  thumbnail images suited for display on the Web.
11419 %
11420 %  The format of the MagickThumbnailImage method is:
11421 %
11422 %      MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11423 %        const unsigned long columns,const unsigned long rows)
11424 %
11425 %  A description of each parameter follows:
11426 %
11427 %    o wand: the magick wand.
11428 %
11429 %    o columns: the number of columns in the scaled image.
11430 %
11431 %    o rows: the number of rows in the scaled image.
11432 %
11433 */
11434 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
11435   const unsigned long columns,const unsigned long rows)
11436 {
11437   Image
11438     *thumbnail_image;
11439 
11440   assert(wand != (MagickWand *) NULL);
11441   assert(wand->signature == WandSignature);
11442   if (wand->debug != MagickFalse)
11443     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11444   if (wand->images == (Image *) NULL)
11445     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11446   thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception);
11447   if (thumbnail_image == (Image *) NULL)
11448     return(MagickFalse);
11449   ReplaceImageInList(&wand->images,thumbnail_image);
11450   return(MagickTrue);
11451 }
11452 
11453 /*
11454 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11455 %                                                                             %
11456 %                                                                             %
11457 %                                                                             %
11458 %   M a g i c k T i n t I m a g e                                             %
11459 %                                                                             %
11460 %                                                                             %
11461 %                                                                             %
11462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11463 %
11464 %  MagickTintImage() applies a color vector to each pixel in the image.  The
11465 %  length of the vector is 0 for black and white and at its maximum for the
11466 %  midtones.  The vector weighting function is
11467 %  f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
11468 %
11469 %  The format of the MagickTintImage method is:
11470 %
11471 %      MagickBooleanType MagickTintImage(MagickWand *wand,
11472 %        const PixelWand *tint,const PixelWand *opacity)
11473 %
11474 %  A description of each parameter follows:
11475 %
11476 %    o wand: the magick wand.
11477 %
11478 %    o tint: the tint pixel wand.
11479 %
11480 %    o opacity: the opacity pixel wand.
11481 %
11482 */
11483 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
11484   const PixelWand *tint,const PixelWand *opacity)
11485 {
11486   char
11487     percent_opaque[MaxTextExtent];
11488 
11489   Image
11490     *tint_image;
11491 
11492   PixelPacket
11493     target;
11494 
11495   assert(wand != (MagickWand *) NULL);
11496   assert(wand->signature == WandSignature);
11497   if (wand->debug != MagickFalse)
11498     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11499   if (wand->images == (Image *) NULL)
11500     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11501   (void) FormatMagickString(percent_opaque,MaxTextExtent,"%g,%g,%g,%g",
11502     (double) (100.0*QuantumScale*PixelGetRedQuantum(opacity)),
11503     (double) (100.0*QuantumScale*PixelGetGreenQuantum(opacity)),
11504     (double) (100.0*QuantumScale*PixelGetBlueQuantum(opacity)),
11505     (double) (100.0*QuantumScale*PixelGetOpacityQuantum(opacity)));
11506   PixelGetQuantumColor(tint,&target);
11507   tint_image=TintImage(wand->images,percent_opaque,target,wand->exception);
11508   if (tint_image == (Image *) NULL)
11509     return(MagickFalse);
11510   ReplaceImageInList(&wand->images,tint_image);
11511   return(MagickTrue);
11512 }
11513 
11514 /*
11515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11516 %                                                                             %
11517 %                                                                             %
11518 %                                                                             %
11519 %   M a g i c k T r a n s f o r m I m a g e                                   %
11520 %                                                                             %
11521 %                                                                             %
11522 %                                                                             %
11523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11524 %
11525 %  MagickTransformImage() is a convenience method that behaves like
11526 %  MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping
11527 %  information as a region geometry specification.  If the operation fails,
11528 %  a NULL image handle is returned.
11529 %
11530 %  The format of the MagickTransformImage method is:
11531 %
11532 %      MagickWand *MagickTransformImage(MagickWand *wand,const char *crop,
11533 %        const char *geometry)
11534 %
11535 %  A description of each parameter follows:
11536 %
11537 %    o wand: the magick wand.
11538 %
11539 %    o crop: A crop geometry string.  This geometry defines a subregion of the
11540 %      image to crop.
11541 %
11542 %    o geometry: An image geometry string.  This geometry defines the final
11543 %      size of the image.
11544 %
11545 */
11546 WandExport MagickWand *MagickTransformImage(MagickWand *wand,
11547   const char *crop,const char *geometry)
11548 {
11549   Image
11550     *transform_image;
11551 
11552   MagickBooleanType
11553     status;
11554 
11555   assert(wand != (MagickWand *) NULL);
11556   assert(wand->signature == WandSignature);
11557   if (wand->debug != MagickFalse)
11558     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11559   if (wand->images == (Image *) NULL)
11560     return((MagickWand *) NULL);
11561   transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
11562   if (transform_image == (Image *) NULL)
11563     return((MagickWand *) NULL);
11564   status=TransformImage(&transform_image,crop,geometry);
11565   if (status == MagickFalse)
11566     {
11567       InheritException(wand->exception,&transform_image->exception);
11568       transform_image=DestroyImage(transform_image);
11569       return((MagickWand *) NULL);
11570     }
11571   return(CloneMagickWandFromImages(wand,transform_image));
11572 }
11573 
11574 /*
11575 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11576 %                                                                             %
11577 %                                                                             %
11578 %                                                                             %
11579 %   M a g i c k T r a n s f o r m I m a g e C o l o r s p a c e               %
11580 %                                                                             %
11581 %                                                                             %
11582 %                                                                             %
11583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11584 %
11585 %  MagickTransformImageColorspace() transform the image colorspace.
11586 %
11587 %  The format of the MagickTransformImageColorspace method is:
11588 %
11589 %      MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11590 %        const ColorspaceType colorspace)
11591 %
11592 %  A description of each parameter follows:
11593 %
11594 %    o wand: the magick wand.
11595 %
11596 %    o colorspace: the image colorspace:   UndefinedColorspace, RGBColorspace,
11597 %      GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,
11598 %      YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,
11599 %      YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,
11600 %      HSLColorspace, or HWBColorspace.
11601 %
11602 */
11603 WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand,
11604   const ColorspaceType colorspace)
11605 {
11606   assert(wand != (MagickWand *) NULL);
11607   assert(wand->signature == WandSignature);
11608   if (wand->debug != MagickFalse)
11609     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11610   if (wand->images == (Image *) NULL)
11611     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11612   return(TransformImageColorspace(wand->images,colorspace));
11613 }
11614 
11615 /*
11616 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11617 %                                                                             %
11618 %                                                                             %
11619 %                                                                             %
11620 %   M a g i c k T r a n s p a r e n t P a i n t I m a g e                     %
11621 %                                                                             %
11622 %                                                                             %
11623 %                                                                             %
11624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11625 %
11626 %  MagickTransparentPaintImage() changes any pixel that matches color with the
11627 %  color defined by fill.
11628 %
11629 %  The format of the MagickTransparentPaintImage method is:
11630 %
11631 %      MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11632 %        const PixelWand *target,const double alpha,const double fuzz,
11633 %        const MagickBooleanType invert)
11634 %
11635 %  A description of each parameter follows:
11636 %
11637 %    o wand: the magick wand.
11638 %
11639 %    o target: Change this target color to specified opacity value within
11640 %      the image.
11641 %
11642 %    o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
11643 %      transparent.
11644 %
11645 %    o fuzz: By default target must match a particular pixel color
11646 %      exactly.  However, in many cases two colors may differ by a small amount.
11647 %      The fuzz member of image defines how much tolerance is acceptable to
11648 %      consider two colors as the same.  For example, set fuzz to 10 and the
11649 %      color red at intensities of 100 and 102 respectively are now interpreted
11650 %      as the same color for the purposes of the floodfill.
11651 %
11652 %    o invert: paint any pixel that does not match the target color.
11653 %
11654 */
11655 WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand,
11656   const PixelWand *target,const double alpha,const double fuzz,
11657   const MagickBooleanType invert)
11658 {
11659   MagickBooleanType
11660     status;
11661 
11662   MagickPixelPacket
11663     target_pixel;
11664 
11665   assert(wand != (MagickWand *) NULL);
11666   assert(wand->signature == WandSignature);
11667   if (wand->debug != MagickFalse)
11668     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11669   if (wand->images == (Image *) NULL)
11670     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11671   PixelGetMagickColor(target,&target_pixel);
11672   wand->images->fuzz=fuzz;
11673   status=TransparentPaintImage(wand->images,&target_pixel,RoundToQuantum(
11674     (MagickRealType) QuantumRange-QuantumRange*alpha),invert);
11675   if (status == MagickFalse)
11676     InheritException(wand->exception,&wand->images->exception);
11677   return(status);
11678 }
11679 
11680 /*
11681 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11682 %                                                                             %
11683 %                                                                             %
11684 %                                                                             %
11685 %   M a g i c k T r a n s p o s e I m a g e                                   %
11686 %                                                                             %
11687 %                                                                             %
11688 %                                                                             %
11689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11690 %
11691 %  MagickTransposeImage() creates a vertical mirror image by reflecting the
11692 %  pixels around the central x-axis while rotating them 90-degrees.
11693 %
11694 %  The format of the MagickTransposeImage method is:
11695 %
11696 %      MagickBooleanType MagickTransposeImage(MagickWand *wand)
11697 %
11698 %  A description of each parameter follows:
11699 %
11700 %    o wand: the magick wand.
11701 %
11702 */
11703 WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand)
11704 {
11705   Image
11706     *transpose_image;
11707 
11708   assert(wand != (MagickWand *) NULL);
11709   assert(wand->signature == WandSignature);
11710   if (wand->debug != MagickFalse)
11711     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11712   if (wand->images == (Image *) NULL)
11713     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11714   transpose_image=TransposeImage(wand->images,wand->exception);
11715   if (transpose_image == (Image *) NULL)
11716     return(MagickFalse);
11717   ReplaceImageInList(&wand->images,transpose_image);
11718   return(MagickTrue);
11719 }
11720 
11721 /*
11722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11723 %                                                                             %
11724 %                                                                             %
11725 %                                                                             %
11726 %   M a g i c k T r a n s v e r s e I m a g e                                 %
11727 %                                                                             %
11728 %                                                                             %
11729 %                                                                             %
11730 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11731 %
11732 %  MagickTransverseImage() creates a horizontal mirror image by reflecting the
11733 %  pixels around the central y-axis while rotating them 270-degrees.
11734 %
11735 %  The format of the MagickTransverseImage method is:
11736 %
11737 %      MagickBooleanType MagickTransverseImage(MagickWand *wand)
11738 %
11739 %  A description of each parameter follows:
11740 %
11741 %    o wand: the magick wand.
11742 %
11743 */
11744 WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand)
11745 {
11746   Image
11747     *transverse_image;
11748 
11749   assert(wand != (MagickWand *) NULL);
11750   assert(wand->signature == WandSignature);
11751   if (wand->debug != MagickFalse)
11752     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11753   if (wand->images == (Image *) NULL)
11754     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11755   transverse_image=TransverseImage(wand->images,wand->exception);
11756   if (transverse_image == (Image *) NULL)
11757     return(MagickFalse);
11758   ReplaceImageInList(&wand->images,transverse_image);
11759   return(MagickTrue);
11760 }
11761 
11762 /*
11763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11764 %                                                                             %
11765 %                                                                             %
11766 %                                                                             %
11767 %   M a g i c k T r i m I m a g e                                             %
11768 %                                                                             %
11769 %                                                                             %
11770 %                                                                             %
11771 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11772 %
11773 %  MagickTrimImage() remove edges that are the background color from the image.
11774 %
11775 %  The format of the MagickTrimImage method is:
11776 %
11777 %      MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11778 %
11779 %  A description of each parameter follows:
11780 %
11781 %    o wand: the magick wand.
11782 %
11783 %    o fuzz: By default target must match a particular pixel color
11784 %      exactly.  However, in many cases two colors may differ by a small amount.
11785 %      The fuzz member of image defines how much tolerance is acceptable to
11786 %      consider two colors as the same.  For example, set fuzz to 10 and the
11787 %      color red at intensities of 100 and 102 respectively are now interpreted
11788 %      as the same color for the purposes of the floodfill.
11789 %
11790 */
11791 WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz)
11792 {
11793   Image
11794     *trim_image;
11795 
11796   assert(wand != (MagickWand *) NULL);
11797   assert(wand->signature == WandSignature);
11798   if (wand->debug != MagickFalse)
11799     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11800   if (wand->images == (Image *) NULL)
11801     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11802   wand->images->fuzz=fuzz;
11803   trim_image=TrimImage(wand->images,wand->exception);
11804   if (trim_image == (Image *) NULL)
11805     return(MagickFalse);
11806   ReplaceImageInList(&wand->images,trim_image);
11807   return(MagickTrue);
11808 }
11809 
11810 /*
11811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11812 %                                                                             %
11813 %                                                                             %
11814 %                                                                             %
11815 %   M a g i c k U n i q u e I m a g e C o l o r s                             %
11816 %                                                                             %
11817 %                                                                             %
11818 %                                                                             %
11819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11820 %
11821 %  MagickUniqueImageColors() discards all but one of any pixel color.
11822 %
11823 %  The format of the MagickUniqueImageColors method is:
11824 %
11825 %      MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11826 %
11827 %  A description of each parameter follows:
11828 %
11829 %    o wand: the magick wand.
11830 %
11831 */
11832 WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand)
11833 {
11834   Image
11835     *unique_image;
11836 
11837   assert(wand != (MagickWand *) NULL);
11838   assert(wand->signature == WandSignature);
11839   if (wand->debug != MagickFalse)
11840     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11841   if (wand->images == (Image *) NULL)
11842     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11843   unique_image=UniqueImageColors(wand->images,wand->exception);
11844   if (unique_image == (Image *) NULL)
11845     return(MagickFalse);
11846   ReplaceImageInList(&wand->images,unique_image);
11847   return(MagickTrue);
11848 }
11849 
11850 /*
11851 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11852 %                                                                             %
11853 %                                                                             %
11854 %                                                                             %
11855 %   M a g i c k U n s h a r p M a s k I m a g e                               %
11856 %                                                                             %
11857 %                                                                             %
11858 %                                                                             %
11859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11860 %
11861 %  MagickUnsharpMaskImage() sharpens an image.  We convolve the image with a
11862 %  Gaussian operator of the given radius and standard deviation (sigma).
11863 %  For reasonable results, radius should be larger than sigma.  Use a radius
11864 %  of 0 and UnsharpMaskImage() selects a suitable radius for you.
11865 %
11866 %  The format of the MagickUnsharpMaskImage method is:
11867 %
11868 %      MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11869 %        const double radius,const double sigma,const double amount,
11870 %        const double threshold)
11871 %      MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
11872 %        const ChannelType channel,const double radius,const double sigma,
11873 %        const double amount,const double threshold)
11874 %
11875 %  A description of each parameter follows:
11876 %
11877 %    o wand: the magick wand.
11878 %
11879 %    o channel: the image channel(s).
11880 %
11881 %    o radius: the radius of the Gaussian, in pixels, not counting the center
11882 %      pixel.
11883 %
11884 %    o sigma: the standard deviation of the Gaussian, in pixels.
11885 %
11886 %    o amount: the percentage of the difference between the original and the
11887 %      blur image that is added back into the original.
11888 %
11889 %    o threshold: the threshold in pixels needed to apply the diffence amount.
11890 %
11891 */
11892 
11893 WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand,
11894   const double radius,const double sigma,const double amount,
11895   const double threshold)
11896 {
11897   MagickBooleanType
11898     status;
11899 
11900   status=MagickUnsharpMaskImageChannel(wand,DefaultChannels,radius,sigma,
11901     amount,threshold);
11902   return(status);
11903 }
11904 
11905 WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
11906   const ChannelType channel,const double radius,const double sigma,
11907   const double amount,const double threshold)
11908 {
11909   Image
11910     *unsharp_image;
11911 
11912   assert(wand != (MagickWand *) NULL);
11913   assert(wand->signature == WandSignature);
11914   if (wand->debug != MagickFalse)
11915     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11916   if (wand->images == (Image *) NULL)
11917     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11918   unsharp_image=UnsharpMaskImageChannel(wand->images,channel,radius,sigma,
11919     amount,threshold,wand->exception);
11920   if (unsharp_image == (Image *) NULL)
11921     return(MagickFalse);
11922   ReplaceImageInList(&wand->images,unsharp_image);
11923   return(MagickTrue);
11924 }
11925 
11926 /*
11927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11928 %                                                                             %
11929 %                                                                             %
11930 %                                                                             %
11931 %   M a g i c k V i g n e t t e I m a g e                                     %
11932 %                                                                             %
11933 %                                                                             %
11934 %                                                                             %
11935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11936 %
11937 %  MagickVignetteImage() softens the edges of the image in vignette style.
11938 %
11939 %  The format of the MagickVignetteImage method is:
11940 %
11941 %      MagickBooleanType MagickVignetteImage(MagickWand *wand,
11942 %        const double black_point,const double white_point,const long x,
11943 %        const long y)
11944 %
11945 %  A description of each parameter follows:
11946 %
11947 %    o wand: the magick wand.
11948 %
11949 %    o black_point: the black point.
11950 %
11951 %    o white_point: the white point.
11952 %
11953 %    o x, y:  Define the x and y ellipse offset.
11954 %
11955 */
11956 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
11957   const double black_point,const double white_point,const long x,const long y)
11958 {
11959   Image
11960     *vignette_image;
11961 
11962   assert(wand != (MagickWand *) NULL);
11963   assert(wand->signature == WandSignature);
11964   if (wand->debug != MagickFalse)
11965     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
11966   if (wand->images == (Image *) NULL)
11967     ThrowWandException(WandError,"ContainsNoImages",wand->name);
11968   vignette_image=VignetteImage(wand->images,black_point,white_point,x,y,
11969     wand->exception);
11970   if (vignette_image == (Image *) NULL)
11971     return(MagickFalse);
11972   ReplaceImageInList(&wand->images,vignette_image);
11973   return(MagickTrue);
11974 }
11975 
11976 /*
11977 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11978 %                                                                             %
11979 %                                                                             %
11980 %                                                                             %
11981 %   M a g i c k W a v e I m a g e                                             %
11982 %                                                                             %
11983 %                                                                             %
11984 %                                                                             %
11985 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11986 %
11987 %  MagickWaveImage()  creates a "ripple" effect in the image by shifting
11988 %  the pixels vertically along a sine wave whose amplitude and wavelength
11989 %  is specified by the given parameters.
11990 %
11991 %  The format of the MagickWaveImage method is:
11992 %
11993 %      MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude,
11994 %        const double wave_length)
11995 %
11996 %  A description of each parameter follows:
11997 %
11998 %    o wand: the magick wand.
11999 %
12000 %    o amplitude, wave_length:  Define the amplitude and wave length of the
12001 %      sine wave.
12002 %
12003 */
12004 WandExport MagickBooleanType MagickWaveImage(MagickWand *wand,
12005   const double amplitude,const double wave_length)
12006 {
12007   Image
12008     *wave_image;
12009 
12010   assert(wand != (MagickWand *) NULL);
12011   assert(wand->signature == WandSignature);
12012   if (wand->debug != MagickFalse)
12013     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12014   if (wand->images == (Image *) NULL)
12015     ThrowWandException(WandError,"ContainsNoImages",wand->name);
12016   wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception);
12017   if (wave_image == (Image *) NULL)
12018     return(MagickFalse);
12019   ReplaceImageInList(&wand->images,wave_image);
12020   return(MagickTrue);
12021 }
12022 
12023 /*
12024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12025 %                                                                             %
12026 %                                                                             %
12027 %                                                                             %
12028 %   M a g i c k W h i t e T h r e s h o l d I m a g e                         %
12029 %                                                                             %
12030 %                                                                             %
12031 %                                                                             %
12032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12033 %
12034 %  MagickWhiteThresholdImage() is like ThresholdImage() but  force all pixels
12035 %  above the threshold into white while leaving all pixels below the threshold
12036 %  unchanged.
12037 %
12038 %  The format of the MagickWhiteThresholdImage method is:
12039 %
12040 %      MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12041 %        const PixelWand *threshold)
12042 %
12043 %  A description of each parameter follows:
12044 %
12045 %    o wand: the magick wand.
12046 %
12047 %    o threshold: the pixel wand.
12048 %
12049 */
12050 WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand,
12051   const PixelWand *threshold)
12052 {
12053   char
12054     thresholds[MaxTextExtent];
12055 
12056   MagickBooleanType
12057     status;
12058 
12059   assert(wand != (MagickWand *) NULL);
12060   assert(wand->signature == WandSignature);
12061   if (wand->debug != MagickFalse)
12062     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12063   if (wand->images == (Image *) NULL)
12064     ThrowWandException(WandError,"ContainsNoImages",wand->name);
12065   (void) FormatMagickString(thresholds,MaxTextExtent,
12066     QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
12067     PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
12068     PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
12069   status=WhiteThresholdImage(wand->images,thresholds);
12070   if (status == MagickFalse)
12071     InheritException(wand->exception,&wand->images->exception);
12072   return(status);
12073 }
12074 
12075 /*
12076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12077 %                                                                             %
12078 %                                                                             %
12079 %                                                                             %
12080 %   M a g i c k W r i t e I m a g e                                           %
12081 %                                                                             %
12082 %                                                                             %
12083 %                                                                             %
12084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12085 %
12086 %  MagickWriteImage() writes an image to the specified filename.  If the
12087 %  filename parameter is NULL, the image is written to the filename set
12088 %  by MagickReadImage() or MagickSetImageFilename().
12089 %
12090 %  The format of the MagickWriteImage method is:
12091 %
12092 %      MagickBooleanType MagickWriteImage(MagickWand *wand,
12093 %        const char *filename)
12094 %
12095 %  A description of each parameter follows:
12096 %
12097 %    o wand: the magick wand.
12098 %
12099 %    o filename: the image filename.
12100 %
12101 %
12102 */
12103 WandExport MagickBooleanType MagickWriteImage(MagickWand *wand,
12104   const char *filename)
12105 {
12106   Image
12107     *image;
12108 
12109   ImageInfo
12110     *write_info;
12111 
12112   MagickBooleanType
12113     status;
12114 
12115   assert(wand != (MagickWand *) NULL);
12116   assert(wand->signature == WandSignature);
12117   if (wand->debug != MagickFalse)
12118     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12119   if (wand->images == (Image *) NULL)
12120     ThrowWandException(WandError,"ContainsNoImages",wand->name);
12121   if (filename != (const char *) NULL)
12122     (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent);
12123   image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12124   if (image == (Image *) NULL)
12125     return(MagickFalse);
12126   write_info=CloneImageInfo(wand->image_info);
12127   write_info->adjoin=MagickTrue;
12128   status=WriteImage(write_info,image);
12129   if (status == MagickFalse)
12130     InheritException(wand->exception,&image->exception);
12131   image=DestroyImage(image);
12132   write_info=DestroyImageInfo(write_info);
12133   return(status);
12134 }
12135 
12136 /*
12137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12138 %                                                                             %
12139 %                                                                             %
12140 %                                                                             %
12141 %   M a g i c k W r i t e I m a g e F i l e                                   %
12142 %                                                                             %
12143 %                                                                             %
12144 %                                                                             %
12145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12146 %
12147 %  MagickWriteImageFile() writes an image to an open file descriptor.
12148 %
12149 %  The format of the MagickWriteImageFile method is:
12150 %
12151 %      MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12152 %
12153 %  A description of each parameter follows:
12154 %
12155 %    o wand: the magick wand.
12156 %
12157 %    o file: the file descriptor.
12158 %
12159 %
12160 */
12161 WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file)
12162 {
12163   Image
12164     *image;
12165 
12166   ImageInfo
12167     *write_info;
12168 
12169   MagickBooleanType
12170     status;
12171 
12172   assert(wand != (MagickWand *) NULL);
12173   assert(wand->signature == WandSignature);
12174   assert(file != (FILE *) NULL);
12175   if (wand->debug != MagickFalse)
12176     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12177   if (wand->images == (Image *) NULL)
12178     ThrowWandException(WandError,"ContainsNoImages",wand->name);
12179   image=CloneImage(wand->images,0,0,MagickTrue,wand->exception);
12180   if (image == (Image *) NULL)
12181     return(MagickFalse);
12182   write_info=CloneImageInfo(wand->image_info);
12183   SetImageInfoFile(write_info,file);
12184   write_info->adjoin=MagickTrue;
12185   status=WriteImage(write_info,image);
12186   write_info=DestroyImageInfo(write_info);
12187   if (status == MagickFalse)
12188     InheritException(wand->exception,&image->exception);
12189   image=DestroyImage(image);
12190   return(status);
12191 }
12192 
12193 /*
12194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12195 %                                                                             %
12196 %                                                                             %
12197 %                                                                             %
12198 %   M a g i c k W r i t e I m a g e s                                         %
12199 %                                                                             %
12200 %                                                                             %
12201 %                                                                             %
12202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12203 %
12204 %  MagickWriteImages() writes an image or image sequence.
12205 %
12206 %  The format of the MagickWriteImages method is:
12207 %
12208 %      MagickBooleanType MagickWriteImages(MagickWand *wand,
12209 %        const char *filename,const MagickBooleanType adjoin)
12210 %
12211 %  A description of each parameter follows:
12212 %
12213 %    o wand: the magick wand.
12214 %
12215 %    o filename: the image filename.
12216 %
12217 %    o adjoin: join images into a single multi-image file.
12218 %
12219 */
12220 WandExport MagickBooleanType MagickWriteImages(MagickWand *wand,
12221   const char *filename,const MagickBooleanType adjoin)
12222 {
12223   ImageInfo
12224     *write_info;
12225 
12226   MagickBooleanType
12227     status;
12228 
12229   assert(wand != (MagickWand *) NULL);
12230   assert(wand->signature == WandSignature);
12231   if (wand->debug != MagickFalse)
12232     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12233   if (wand->images == (Image *) NULL)
12234     ThrowWandException(WandError,"ContainsNoImages",wand->name);
12235   write_info=CloneImageInfo(wand->image_info);
12236   write_info->adjoin=adjoin;
12237   status=WriteImages(write_info,wand->images,filename,wand->exception);
12238   if (status == MagickFalse)
12239     InheritException(wand->exception,&wand->images->exception);
12240   write_info=DestroyImageInfo(write_info);
12241   return(status);
12242 }
12243 
12244 /*
12245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12246 %                                                                             %
12247 %                                                                             %
12248 %                                                                             %
12249 %   M a g i c k W r i t e I m a g e s F i l e                                 %
12250 %                                                                             %
12251 %                                                                             %
12252 %                                                                             %
12253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12254 %
12255 %  MagickWriteImagesFile() writes an image sequence to an open file descriptor.
12256 %
12257 %  The format of the MagickWriteImagesFile method is:
12258 %
12259 %      MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12260 %
12261 %  A description of each parameter follows:
12262 %
12263 %    o wand: the magick wand.
12264 %
12265 %    o file: the file descriptor.
12266 %
12267 */
12268 WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file)
12269 {
12270   ImageInfo
12271     *write_info;
12272 
12273   MagickBooleanType
12274     status;
12275 
12276   assert(wand != (MagickWand *) NULL);
12277   assert(wand->signature == WandSignature);
12278   if (wand->debug != MagickFalse)
12279     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
12280   if (wand->images == (Image *) NULL)
12281     ThrowWandException(WandError,"ContainsNoImages",wand->name);
12282   write_info=CloneImageInfo(wand->image_info);
12283   SetImageInfoFile(write_info,file);
12284   write_info->adjoin=MagickTrue;
12285   status=WriteImages(write_info,wand->images,(const char *) NULL,
12286     wand->exception);
12287   write_info=DestroyImageInfo(write_info);
12288   if (status == MagickFalse)
12289     InheritException(wand->exception,&wand->images->exception);
12290   return(status);
12291 }

Generated on Thu Jul 2 12:03:38 2009 for MagickWand by  doxygen 1.5.8