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-2008 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 
00054 /*
00055   Define declarations.
00056 */
00057 #define ThrowWandException(severity,tag,context) \
00058 { \
00059   (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
00060     tag,"`%s'",context); \
00061   return(MagickFalse); \
00062 }
00063 #define MagickWandId  "MagickWand"
00064 
00065 /*
00066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00067 %                                                                             %
00068 %                                                                             %
00069 %                                                                             %
00070 +   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                         %
00071 %                                                                             %
00072 %                                                                             %
00073 %                                                                             %
00074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00075 %
00076 %  CloneMagickWandFromImages() clones the magick wand and inserts a new image
00077 %  list.
00078 %
00079 %  The format of the CloneMagickWandFromImages method is:
00080 %
00081 %      MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
00082 %        Image *images)
00083 %
00084 %  A description of each parameter follows:
00085 %
00086 %    o wand: the magick wand.
00087 %
00088 %    o images: replace the image list with these image(s).
00089 %
00090 */
00091 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
00092   Image *images)
00093 {
00094   MagickWand
00095     *clone_wand;
00096 
00097   assert(wand != (MagickWand *) NULL);
00098   assert(wand->signature == WandSignature);
00099   if (wand->debug != MagickFalse)
00100     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00101   clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
00102   if (clone_wand == (MagickWand *) NULL)
00103     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
00104       images->filename);
00105   (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
00106   clone_wand->id=AcquireWandId();
00107   (void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%lu",
00108     MagickWandId,clone_wand->id);
00109   clone_wand->exception=AcquireExceptionInfo();
00110   InheritException(clone_wand->exception,wand->exception);
00111   clone_wand->image_info=CloneImageInfo(wand->image_info);
00112   clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
00113   clone_wand->images=images;
00114   clone_wand->debug=IsEventLogging();
00115   if (clone_wand->debug != MagickFalse)
00116     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
00117   clone_wand->signature=WandSignature;
00118   return(clone_wand);
00119 }
00120 
00121 /*
00122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00123 %                                                                             %
00124 %                                                                             %
00125 %                                                                             %
00126 %   G e t I m a g e F r o m M a g i c k W a n d                               %
00127 %                                                                             %
00128 %                                                                             %
00129 %                                                                             %
00130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00131 %
00132 %  GetImageFromMagickWand() returns the current image from the magick wand.
00133 %
00134 %  The format of the GetImageFromMagickWand method is:
00135 %
00136 %      Image *GetImageFromMagickWand(const MagickWand *wand)
00137 %
00138 %  A description of each parameter follows:
00139 %
00140 %    o wand: the magick wand.
00141 %
00142 */
00143 WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
00144 {
00145   assert(wand != (MagickWand *) NULL);
00146   assert(wand->signature == WandSignature);
00147   if (wand->debug != MagickFalse)
00148     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00149   if (wand->images == (Image *) NULL)
00150     {
00151       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00152         "ContainsNoImages","`%s'",wand->name);
00153       return((Image *) NULL);
00154     }
00155   return(wand->images);
00156 }
00157 
00158 /*
00159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00160 %                                                                             %
00161 %                                                                             %
00162 %                                                                             %
00163 %   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                       %
00164 %                                                                             %
00165 %                                                                             %
00166 %                                                                             %
00167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00168 %
00169 %  MagickAdaptiveBlurImage() adaptively blurs the image by blurring
00170 %  less intensely near image edges and more intensely far from edges. We
00171 %  blur the image with a Gaussian operator of the given radius and standard
00172 %  deviation (sigma).  For reasonable results, radius should be larger than
00173 %  sigma.  Use a radius of 0 and MagickAdaptiveBlurImage() selects a
00174 %  suitable radius for you.
00175 %
00176 %  The format of the MagickAdaptiveBlurImage method is:
00177 %
00178 %      MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
00179 %        const double radius,const double sigma)
00180 %      MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,
00181 %        const ChannelType channel,const double radius,const double sigma)
00182 %
00183 %  A description of each parameter follows:
00184 %
00185 %    o wand: the magick wand.
00186 %
00187 %    o channel: the image channel(s).
00188 %
00189 %    o radius: the radius of the Gaussian, in pixels, not counting the center
00190 %      pixel.
00191 %
00192 %    o sigma: the standard deviation of the Gaussian, in pixels.
00193 %
00194 */
00195 
00196 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
00197   const double radius,const double sigma)
00198 {
00199   MagickBooleanType
00200     status;
00201 
00202   status=MagickAdaptiveBlurImageChannel(wand,DefaultChannels,radius,sigma);
00203   return(status);
00204 }
00205 
00206 WandExport MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,
00207   const ChannelType channel,const double radius,const double sigma)
00208 {
00209   Image
00210     *sharp_image;
00211 
00212   assert(wand != (MagickWand *) NULL);
00213   assert(wand->signature == WandSignature);
00214   if (wand->debug != MagickFalse)
00215     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00216   if (wand->images == (Image *) NULL)
00217     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00218   sharp_image=AdaptiveBlurImageChannel(wand->images,channel,radius,sigma,
00219     wand->exception);
00220   if (sharp_image == (Image *) NULL)
00221     return(MagickFalse);
00222   ReplaceImageInList(&wand->images,sharp_image);
00223   return(MagickTrue);
00224 }
00225 
00226 /*
00227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00228 %                                                                             %
00229 %                                                                             %
00230 %                                                                             %
00231 %   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                         %
00232 %                                                                             %
00233 %                                                                             %
00234 %                                                                             %
00235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00236 %
00237 %  MagickAdaptiveResizeImage() adaptively resize image with data dependent
00238 %  triangulation.
00239 %
00240 %      MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
00241 %        const unsigned long columns,const unsigned long rows)
00242 %
00243 %  A description of each parameter follows:
00244 %
00245 %    o wand: the magick wand.
00246 %
00247 %    o columns: the number of columns in the scaled image.
00248 %
00249 %    o rows: the number of rows in the scaled image.
00250 %
00251 */
00252 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
00253   const unsigned long columns,const unsigned long rows)
00254 {
00255   Image
00256     *resize_image;
00257 
00258   assert(wand != (MagickWand *) NULL);
00259   assert(wand->signature == WandSignature);
00260   if (wand->debug != MagickFalse)
00261     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00262   if (wand->images == (Image *) NULL)
00263     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00264   resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception);
00265   if (resize_image == (Image *) NULL)
00266     return(MagickFalse);
00267   ReplaceImageInList(&wand->images,resize_image);
00268   return(MagickTrue);
00269 }
00270 
00271 /*
00272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00273 %                                                                             %
00274 %                                                                             %
00275 %                                                                             %
00276 %   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                       %
00277 %                                                                             %
00278 %                                                                             %
00279 %                                                                             %
00280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00281 %
00282 %  MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening
00283 %  more intensely near image edges and less intensely far from edges. We
00284 %  sharpen the image with a Gaussian operator of the given radius and standard
00285 %  deviation (sigma).  For reasonable results, radius should be larger than
00286 %  sigma.  Use a radius of 0 and MagickAdaptiveSharpenImage() selects a
00287 %  suitable radius for you.
00288 %
00289 %  The format of the MagickAdaptiveSharpenImage method is:
00290 %
00291 %      MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
00292 %        const double radius,const double sigma)
00293 %      MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand,
00294 %        const ChannelType channel,const double radius,const double sigma)
00295 %
00296 %  A description of each parameter follows:
00297 %
00298 %    o wand: the magick wand.
00299 %
00300 %    o channel: the image channel(s).
00301 %
00302 %    o radius: the radius of the Gaussian, in pixels, not counting the center
00303 %      pixel.
00304 %
00305 %    o sigma: the standard deviation of the Gaussian, in pixels.
00306 %
00307 */
00308 
00309 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
00310   const double radius,const double sigma)
00311 {
00312   MagickBooleanType
00313     status;
00314 
00315   status=MagickAdaptiveSharpenImageChannel(wand,DefaultChannels,radius,sigma);
00316   return(status);
00317 }
00318 
00319 WandExport MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand,
00320   const ChannelType channel,const double radius,const double sigma)
00321 {
00322   Image
00323     *sharp_image;
00324 
00325   assert(wand != (MagickWand *) NULL);
00326   assert(wand->signature == WandSignature);
00327   if (wand->debug != MagickFalse)
00328     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00329   if (wand->images == (Image *) NULL)
00330     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00331   sharp_image=AdaptiveSharpenImageChannel(wand->images,channel,radius,sigma,
00332     wand->exception);
00333   if (sharp_image == (Image *) NULL)
00334     return(MagickFalse);
00335   ReplaceImageInList(&wand->images,sharp_image);
00336   return(MagickTrue);
00337 }
00338 
00339 /*
00340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00341 %                                                                             %
00342 %                                                                             %
00343 %                                                                             %
00344 %   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                   %
00345 %                                                                             %
00346 %                                                                             %
00347 %                                                                             %
00348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00349 %
00350 %  MagickAdaptiveThresholdImage() selects an individual threshold for each pixel
00351 %  based on the range of intensity values in its local neighborhood.  This
00352 %  allows for thresholding of an image whose global intensity histogram
00353 %  doesn't contain distinctive peaks.
00354 %
00355 %  The format of the AdaptiveThresholdImage method is:
00356 %
00357 %      MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
00358 %        const unsigned long width,const unsigned long height,const long offset)
00359 %
00360 %  A description of each parameter follows:
00361 %
00362 %    o wand: the magick wand.
00363 %
00364 %    o width: the width of the local neighborhood.
00365 %
00366 %    o height: the height of the local neighborhood.
00367 %
00368 %    o offset: the mean offset.
00369 %
00370 */
00371 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
00372   const unsigned long width,const unsigned long height,const long offset)
00373 {
00374   Image
00375     *threshold_image;
00376 
00377   assert(wand != (MagickWand *) NULL);
00378   assert(wand->signature == WandSignature);
00379   if (wand->debug != MagickFalse)
00380     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00381   if (wand->images == (Image *) NULL)
00382     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00383   threshold_image=AdaptiveThresholdImage(wand->images,width,height,offset,
00384     wand->exception);
00385   if (threshold_image == (Image *) NULL)
00386     return(MagickFalse);
00387   ReplaceImageInList(&wand->images,threshold_image);
00388   return(MagickTrue);
00389 }
00390 
00391 /*
00392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00393 %                                                                             %
00394 %                                                                             %
00395 %                                                                             %
00396 %   M a g i c k A d d I m a g e                                               %
00397 %                                                                             %
00398 %                                                                             %
00399 %                                                                             %
00400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00401 %
00402 %  MagickAddImage() adds the specified images at the current image location.
00403 %
00404 %  The format of the MagickAddImage method is:
00405 %
00406 %      MagickBooleanType MagickAddImage(MagickWand *wand,
00407 %        const MagickWand *add_wand)
00408 %
00409 %  A description of each parameter follows:
00410 %
00411 %    o wand: the magick wand.
00412 %
00413 %    o add_wand: A wand that contains images to add at the current image
00414 %      location.
00415 %
00416 */
00417 
00418 static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
00419   Image *images)
00420 {
00421   Image
00422     *sentinel;
00423 
00424   sentinel=wand->images;
00425   if (sentinel == (Image *) NULL)
00426     {
00427       wand->images=GetFirstImageInList(images);
00428       return(MagickTrue);
00429     }
00430   if (wand->active == MagickFalse)
00431     {
00432       if ((wand->pend != MagickFalse) && (sentinel->next == (Image *) NULL))
00433         {
00434           AppendImageToList(&sentinel,images);
00435           wand->images=GetLastImageInList(images);
00436           return(MagickTrue);
00437         }
00438       if ((wand->pend != MagickFalse) && (sentinel->previous == (Image *) NULL))
00439         {
00440           PrependImageToList(&sentinel,images);
00441           wand->images=GetFirstImageInList(images);
00442           return(MagickTrue);
00443         }
00444     }
00445   InsertImageInList(&sentinel,images);
00446   wand->images=GetFirstImageInList(images);
00447   return(MagickTrue);
00448 }
00449 
00450 WandExport MagickBooleanType MagickAddImage(MagickWand *wand,
00451   const MagickWand *add_wand)
00452 {
00453   Image
00454     *images;
00455 
00456   assert(wand != (MagickWand *) NULL);
00457   assert(wand->signature == WandSignature);
00458   if (wand->debug != MagickFalse)
00459     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00460   assert(add_wand != (MagickWand *) NULL);
00461   assert(add_wand->signature == WandSignature);
00462   if (add_wand->images == (Image *) NULL)
00463     ThrowWandException(WandError,"ContainsNoImages",add_wand->name);
00464   images=CloneImageList(add_wand->images,wand->exception);
00465   if (images == (Image *) NULL)
00466     return(MagickFalse);
00467   return(InsertImageInWand(wand,images));
00468 }
00469 
00470 /*
00471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00472 %                                                                             %
00473 %                                                                             %
00474 %     M a g i c k A d d N o i s e I m a g e                                   %
00475 %                                                                             %
00476 %                                                                             %
00477 %                                                                             %
00478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00479 %
00480 %  MagickAddNoiseImage() adds random noise to the image.
00481 %
00482 %  The format of the MagickAddNoiseImage method is:
00483 %
00484 %      MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
00485 %        const NoiseType noise_type)
00486 %      MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,
00487 %        const ChannelType channel,const NoiseType noise_type)
00488 %
00489 %  A description of each parameter follows:
00490 %
00491 %    o wand: the magick wand.
00492 %
00493 %    o channel: the image channel(s).
00494 %
00495 %    o noise_type:  The type of noise: Uniform, Gaussian, Multiplicative,
00496 %      Impulse, Laplacian, or Poisson.
00497 %
00498 */
00499 
00500 WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand,
00501   const NoiseType noise_type)
00502 {
00503   MagickBooleanType
00504     status;
00505 
00506   status=MagickAddNoiseImageChannel(wand,DefaultChannels,noise_type);
00507   return(status);
00508 }
00509 
00510 WandExport MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,
00511   const ChannelType channel,const NoiseType noise_type)
00512 {
00513   Image
00514     *noise_image;
00515 
00516   assert(wand != (MagickWand *) NULL);
00517   assert(wand->signature == WandSignature);
00518   if (wand->debug != MagickFalse)
00519     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00520   if (wand->images == (Image *) NULL)
00521     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00522   noise_image=AddNoiseImageChannel(wand->images,channel,noise_type,
00523     wand->exception);
00524   if (noise_image == (Image *) NULL)
00525     return(MagickFalse);
00526   ReplaceImageInList(&wand->images,noise_image);
00527   return(MagickTrue);
00528 }
00529 
00530 /*
00531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00532 %                                                                             %
00533 %                                                                             %
00534 %                                                                             %
00535 %   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                       %
00536 %                                                                             %
00537 %                                                                             %
00538 %                                                                             %
00539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00540 %
00541 %  MagickAffineTransformImage() transforms an image as dictated by the affine
00542 %  matrix of the drawing wand.
00543 %
00544 %  The format of the MagickAffineTransformImage method is:
00545 %
00546 %      MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
00547 %        const DrawingWand *drawing_wand)
00548 %
00549 %  A description of each parameter follows:
00550 %
00551 %    o wand: the magick wand.
00552 %
00553 %    o drawing_wand: the draw wand.
00554 %
00555 */
00556 WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand,
00557   const DrawingWand *drawing_wand)
00558 {
00559   DrawInfo
00560     *draw_info;
00561 
00562   Image
00563     *affine_image;
00564 
00565   assert(wand != (MagickWand *) NULL);
00566   assert(wand->signature == WandSignature);
00567   if (wand->debug != MagickFalse)
00568     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00569   if (wand->images == (Image *) NULL)
00570     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00571   draw_info=PeekDrawingWand(drawing_wand);
00572   if (draw_info == (DrawInfo *) NULL)
00573     return(MagickFalse);
00574   affine_image=AffineTransformImage(wand->images,&draw_info->affine,
00575     wand->exception);
00576   draw_info=DestroyDrawInfo(draw_info);
00577   if (affine_image == (Image *) NULL)
00578     return(MagickFalse);
00579   ReplaceImageInList(&wand->images,affine_image);
00580   return(MagickTrue);
00581 }
00582 
00583 /*
00584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00585 %                                                                             %
00586 %                                                                             %
00587 %                                                                             %
00588 %   M a g i c k A n n o t a t e I m a g e                                     %
00589 %                                                                             %
00590 %                                                                             %
00591 %                                                                             %
00592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00593 %
00594 %  MagickAnnotateImage() annotates an image with text.
00595 %
00596 %  The format of the MagickAnnotateImage method is:
00597 %
00598 %      MagickBooleanType MagickAnnotateImage(MagickWand *wand,
00599 %        const DrawingWand *drawing_wand,const double x,const double y,
00600 %        const double angle,const char *text)
00601 %
00602 %  A description of each parameter follows:
00603 %
00604 %    o wand: the magick wand.
00605 %
00606 %    o drawing_wand: the draw wand.
00607 %
00608 %    o x: x ordinate to left of text
00609 %
00610 %    o y: y ordinate to text baseline
00611 %
00612 %    o angle: rotate text relative to this angle.
00613 %
00614 %    o text: text to draw
00615 %
00616 */
00617 WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand,
00618   const DrawingWand *drawing_wand,const double x,const double y,
00619   const double angle,const char *text)
00620 {
00621   char
00622     geometry[MaxTextExtent];
00623 
00624   DrawInfo
00625     *draw_info;
00626 
00627   MagickBooleanType
00628     status;
00629 
00630   assert(wand != (MagickWand *) NULL);
00631   assert(wand->signature == WandSignature);
00632   if (wand->debug != MagickFalse)
00633     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00634   if (wand->images == (Image *) NULL)
00635     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00636   draw_info=PeekDrawingWand(drawing_wand);
00637   if (draw_info == (DrawInfo *) NULL)
00638     return(MagickFalse);
00639   (void) CloneString(&draw_info->text,text);
00640   (void) FormatMagickString(geometry,MaxTextExtent,"%+g%+g",x,y);
00641   draw_info->affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
00642   draw_info->affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
00643   draw_info->affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
00644   draw_info->affine.sy=cos(DegreesToRadians(fmod(angle,360.0)));
00645   (void) CloneString(&draw_info->geometry,geometry);
00646   status=AnnotateImage(wand->images,draw_info);
00647   draw_info=DestroyDrawInfo(draw_info);
00648   if (status == MagickFalse)
00649     InheritException(wand->exception,&wand->images->exception);
00650   return(status);
00651 }
00652 
00653 /*
00654 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00655 %                                                                             %
00656 %                                                                             %
00657 %                                                                             %
00658 %   M a g i c k A n i m a t e I m a g e s                                     %
00659 %                                                                             %
00660 %                                                                             %
00661 %                                                                             %
00662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00663 %
00664 %  MagickAnimateImages() animates an image or image sequence.
00665 %
00666 %  The format of the MagickAnimateImages method is:
00667 %
00668 %      MagickBooleanType MagickAnimateImages(MagickWand *wand,
00669 %        const char *server_name)
00670 %
00671 %  A description of each parameter follows:
00672 %
00673 %    o wand: the magick wand.
00674 %
00675 %    o server_name: the X server name.
00676 %
00677 */
00678 WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand,
00679   const char *server_name)
00680 {
00681   MagickBooleanType
00682     status;
00683 
00684   assert(wand != (MagickWand *) NULL);
00685   assert(wand->signature == WandSignature);
00686   if (wand->debug != MagickFalse)
00687     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00688   (void) CloneString(&wand->image_info->server_name,server_name);
00689   status=AnimateImages(wand->image_info,wand->images);
00690   if (status == MagickFalse)
00691     InheritException(wand->exception,&wand->images->exception);
00692   return(status);
00693 }
00694 
00695 /*
00696 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00697 %                                                                             %
00698 %                                                                             %
00699 %                                                                             %
00700 %   M a g i c k A p p e n d I m a g e s                                       %
00701 %                                                                             %
00702 %                                                                             %
00703 %                                                                             %
00704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00705 %
00706 %  MagickAppendImages() append a set of images.
00707 %
00708 %  The format of the MagickAppendImages method is:
00709 %
00710 %      MagickWand *MagickAppendImages(MagickWand *wand,
00711 %        const MagickBooleanType stack)
00712 %
00713 %  A description of each parameter follows:
00714 %
00715 %    o wand: the magick wand.
00716 %
00717 %    o stack: By default, images are stacked left-to-right. Set stack to
00718 %      MagickTrue to stack them top-to-bottom.
00719 %
00720 */
00721 WandExport MagickWand *MagickAppendImages(MagickWand *wand,
00722   const MagickBooleanType stack)
00723 {
00724   Image
00725     *append_image;
00726 
00727   assert(wand != (MagickWand *) NULL);
00728   assert(wand->signature == WandSignature);
00729   if (wand->debug != MagickFalse)
00730     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00731   if (wand->images == (Image *) NULL)
00732     return((MagickWand *) NULL);
00733   append_image=AppendImages(wand->images,stack,wand->exception);
00734   if (append_image == (Image *) NULL)
00735     return((MagickWand *) NULL);
00736   return(CloneMagickWandFromImages(wand,append_image));
00737 }
00738 
00739 /*
00740 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00741 %                                                                             %
00742 %                                                                             %
00743 %                                                                             %
00744 %   M a g i c k A v e r a g e I m a g e s                                     %
00745 %                                                                             %
00746 %                                                                             %
00747 %                                                                             %
00748 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00749 %
00750 %  MagickAverageImages() average a set of images.
00751 %
00752 %  The format of the MagickAverageImages method is:
00753 %
00754 %      MagickWand *MagickAverageImages(MagickWand *wand)
00755 %
00756 %  A description of each parameter follows:
00757 %
00758 %    o wand: the magick wand.
00759 %
00760 */
00761 WandExport MagickWand *MagickAverageImages(MagickWand *wand)
00762 {
00763   Image
00764     *average_image;
00765 
00766   assert(wand != (MagickWand *) NULL);
00767   assert(wand->signature == WandSignature);
00768   if (wand->debug != MagickFalse)
00769     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00770   if (wand->images == (Image *) NULL)
00771     return((MagickWand *) NULL);
00772   average_image=AverageImages(wand->images,wand->exception);
00773   if (average_image == (Image *) NULL)
00774     return((MagickWand *) NULL);
00775   return(CloneMagickWandFromImages(wand,average_image));
00776 }
00777 
00778 /*
00779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00780 %                                                                             %
00781 %                                                                             %
00782 %                                                                             %
00783 %   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                         %
00784 %                                                                             %
00785 %                                                                             %
00786 %                                                                             %
00787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00788 %
00789 %  MagickBlackThresholdImage() is like MagickThresholdImage() but  forces all
00790 %  pixels below the threshold into black while leaving all pixels above the
00791 %  threshold unchanged.
00792 %
00793 %  The format of the MagickBlackThresholdImage method is:
00794 %
00795 %      MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
00796 %        const PixelWand *threshold)
00797 %
00798 %  A description of each parameter follows:
00799 %
00800 %    o wand: the magick wand.
00801 %
00802 %    o threshold: the pixel wand.
00803 %
00804 */
00805 WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand,
00806   const PixelWand *threshold)
00807 {
00808   char
00809     thresholds[MaxTextExtent];
00810 
00811   MagickBooleanType
00812     status;
00813 
00814   assert(wand != (MagickWand *) NULL);
00815   assert(wand->signature == WandSignature);
00816   if (wand->debug != MagickFalse)
00817     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00818   if (wand->images == (Image *) NULL)
00819     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00820   (void) FormatMagickString(thresholds,MaxTextExtent,
00821     QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat,
00822     PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold),
00823     PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold));
00824   status=BlackThresholdImage(wand->images,thresholds);
00825   if (status == MagickFalse)
00826     InheritException(wand->exception,&wand->images->exception);
00827   return(status);
00828 }
00829 
00830 /*
00831 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00832 %                                                                             %
00833 %                                                                             %
00834 %                                                                             %
00835 %   M a g i c k B l u r I m a g e                                             %
00836 %                                                                             %
00837 %                                                                             %
00838 %                                                                             %
00839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00840 %
00841 %  MagickBlurImage() blurs an image.  We convolve the image with a
00842 %  gaussian operator of the given radius and standard deviation (sigma).
00843 %  For reasonable results, the radius should be larger than sigma.  Use a
00844 %  radius of 0 and BlurImage() selects a suitable radius for you.
00845 %
00846 %  The format of the MagickBlurImage method is:
00847 %
00848 %      MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius,
00849 %        const double sigma)
00850 %      MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
00851 %        const ChannelType channel,const double radius,const double sigma)
00852 %
00853 %  A description of each parameter follows:
00854 %
00855 %    o wand: the magick wand.
00856 %
00857 %    o channel: the image channel(s).
00858 %
00859 %    o radius: the radius of the , in pixels, not counting the center
00860 %      pixel.
00861 %
00862 %    o sigma: the standard deviation of the , in pixels.
00863 %
00864 */
00865 
00866 WandExport MagickBooleanType MagickBlurImage(MagickWand *wand,
00867   const double radius,const double sigma)
00868 {
00869   MagickBooleanType
00870     status;
00871 
00872   status=MagickBlurImageChannel(wand,DefaultChannels,radius,sigma);
00873   return(status);
00874 }
00875 
00876 WandExport MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
00877   const ChannelType channel,const double radius,const double sigma)
00878 {
00879   Image
00880     *blur_image;
00881 
00882   assert(wand != (MagickWand *) NULL);
00883   assert(wand->signature == WandSignature);
00884   if (wand->debug != MagickFalse)
00885     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00886   if (wand->images == (Image *) NULL)
00887     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00888   blur_image=BlurImageChannel(wand->images,channel,radius,sigma,
00889     wand->exception);
00890   if (blur_image == (Image *) NULL)
00891     return(MagickFalse);
00892   ReplaceImageInList(&wand->images,blur_image);
00893   return(MagickTrue);
00894 }
00895 
00896 /*
00897 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00898 %                                                                             %
00899 %                                                                             %
00900 %                                                                             %
00901 %   M a g i c k B o r d e r I m a g e                                         %
00902 %                                                                             %
00903 %                                                                             %
00904 %                                                                             %
00905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00906 %
00907 %  MagickBorderImage() surrounds the image with a border of the color defined
00908 %  by the bordercolor pixel wand.
00909 %
00910 %  The format of the MagickBorderImage method is:
00911 %
00912 %      MagickBooleanType MagickBorderImage(MagickWand *wand,
00913 %        const PixelWand *bordercolor,const unsigned long width,
00914 %        const unsigned long height)
00915 %
00916 %  A description of each parameter follows:
00917 %
00918 %    o wand: the magick wand.
00919 %
00920 %    o bordercolor: the border color pixel wand.
00921 %
00922 %    o width: the border width.
00923 %
00924 %    o height: the border height.
00925 %
00926 */
00927 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
00928   const PixelWand *bordercolor,const unsigned long width,
00929   const unsigned long height)
00930 {
00931   Image
00932     *border_image;
00933 
00934   RectangleInfo
00935     border_info;
00936 
00937   assert(wand != (MagickWand *) NULL);
00938   assert(wand->signature == WandSignature);
00939   if (wand->debug != MagickFalse)
00940     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00941   if (wand->images == (Image *) NULL)
00942     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00943   border_info.width=width;
00944   border_info.height=height;
00945   border_info.x=0;
00946   border_info.y=0;
00947   PixelGetQuantumColor(bordercolor,&wand->images->border_color);
00948   border_image=BorderImage(wand->images,&border_info,wand->exception);
00949   if (border_image == (Image *) NULL)
00950     return(MagickFalse);
00951   ReplaceImageInList(&wand->images,border_image);
00952   return(MagickTrue);
00953 }
00954 
00955 /*
00956 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00957 %                                                                             %
00958 %                                                                             %
00959 %                                                                             %
00960 %   M a g i c k C h a r c o a l I m a g e                                     %
00961 %                                                                             %
00962 %                                                                             %
00963 %                                                                             %
00964 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00965 %
00966 %  MagickCharcoalImage() simulates a charcoal drawing.
00967 %
00968 %  The format of the MagickCharcoalImage method is:
00969 %
00970 %      MagickBooleanType MagickCharcoalImage(MagickWand *wand,
00971 %        const double radius,const double sigma)
00972 %
00973 %  A description of each parameter follows:
00974 %
00975 %    o wand: the magick wand.
00976 %
00977 %    o radius: the radius of the Gaussian, in pixels, not counting the center
00978 %      pixel.
00979 %
00980 %    o sigma: the standard deviation of the Gaussian, in pixels.
00981 %
00982 */
00983 WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
00984   const double radius,const double sigma)
00985 {
00986   Image
00987     *charcoal_image;
00988 
00989   assert(wand != (MagickWand *) NULL);
00990   assert(wand->signature == WandSignature);
00991   if (wand->debug != MagickFalse)
00992     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00993   if (wand->images == (Image *) NULL)
00994     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00995   charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception);
00996   if (charcoal_image == (Image *) NULL)
00997     return(MagickFalse);
00998   ReplaceImageInList(&wand->images,charcoal_image);
00999   return(MagickTrue);
01000 }
01001 
01002 /*
01003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01004 %                                                                             %
01005 %                                                                             %
01006 %                                                                             %
01007 %   M a g i c k C h o p I m a g e                                             %
01008 %                                                                             %
01009 %                                                                             %
01010 %                                                                             %
01011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01012 %
01013 %  MagickChopImage() removes a region of an image and collapses the image to
01014 %  occupy the removed portion
01015 %
01016 %  The format of the MagickChopImage method is:
01017 %
01018 %      MagickBooleanType MagickChopImage(MagickWand *wand,
01019 %        const unsigned long width,const unsigned long height,const long x,
01020 %        const long y)
01021 %
01022 %  A description of each parameter follows:
01023 %
01024 %    o wand: the magick wand.
01025 %
01026 %    o width: the region width.
01027 %
01028 %    o height: the region height.
01029 %
01030 %    o x: the region x offset.
01031 %
01032 %    o y: the region y offset.
01033 %
01034 %
01035 */
01036 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
01037   const unsigned long width,const unsigned long height,const long x,
01038   const long y)
01039 {
01040   Image
01041     *chop_image;
01042 
01043   RectangleInfo
01044     chop;
01045 
01046   assert(wand != (MagickWand *) NULL);
01047   assert(wand->signature == WandSignature);
01048   if (wand->debug != MagickFalse)
01049     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01050   if (wand->images == (Image *) NULL)
01051     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01052   chop.width=width;
01053   chop.height=height;
01054   chop.x=x;
01055   chop.y=y;
01056   chop_image=ChopImage(wand->images,&chop,wand->exception);
01057   if (chop_image == (Image *) NULL)
01058     return(MagickFalse);
01059   ReplaceImageInList(&wand->images,chop_image);
01060   return(MagickTrue);
01061 }
01062 
01063 /*
01064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01065 %                                                                             %
01066 %                                                                             %
01067 %                                                                             %
01068 %   M a g i c k C l i p I m a g e                                             %
01069 %                                                                             %
01070 %                                                                             %
01071 %                                                                             %
01072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01073 %
01074 %  MagickClipImage() clips along the first path from the 8BIM profile, if
01075 %  present.
01076 %
01077 %  The format of the MagickClipImage method is:
01078 %
01079 %      MagickBooleanType MagickClipImage(MagickWand *wand)
01080 %
01081 %  A description of each parameter follows:
01082 %
01083 %    o wand: the magick wand.
01084 %
01085 */
01086 WandExport MagickBooleanType MagickClipImage(MagickWand *wand)
01087 {
01088   MagickBooleanType
01089     status;
01090 
01091   assert(wand != (MagickWand *) NULL);
01092   assert(wand->signature == WandSignature);
01093   if (wand->debug != MagickFalse)
01094     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01095   if (wand->images == (Image *) NULL)
01096     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01097   status=ClipImage(wand->images);
01098   if (status == MagickFalse)
01099     InheritException(wand->exception,&wand->images->exception);
01100   return(status);
01101 }
01102 
01103 /*
01104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01105 %                                                                             %
01106 %                                                                             %
01107 %                                                                             %
01108 %   M a g i c k C l i p I m a g e P a t h                                     %
01109 %                                                                             %
01110 %                                                                             %
01111 %                                                                             %
01112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01113 %
01114 %  MagickClipImagePath() clips along the named paths from the 8BIM profile, if
01115 %  present. Later operations take effect inside the path.  Id may be a number
01116 %  if preceded with #, to work on a numbered path, e.g., "#1" to use the first
01117 %  path.
01118 %
01119 %  The format of the MagickClipImagePath method is:
01120 %
01121 %      MagickBooleanType MagickClipImagePath(MagickWand *wand,
01122 %        const char *pathname,const MagickBooleanType inside)
01123 %
01124 %  A description of each parameter follows:
01125 %
01126 %    o wand: the magick wand.
01127 %
01128 %    o pathname: name of clipping path resource. If name is preceded by #, use
01129 %      clipping path numbered by name.
01130 %
01131 %    o inside: if non-zero, later operations take effect inside clipping path.
01132 %      Otherwise later operations take effect outside clipping path.