animate.c

Go to the documentation of this file.
00001 /*
00002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00003 %                                                                             %
00004 %                                                                             %
00005 %                                                                             %
00006 %                AAA   N   N  IIIII  M   M   AAA   TTTTT  EEEEE               %
00007 %               A   A  NN  N    I    MM MM  A   A    T    E                   %
00008 %               AAAAA  N N N    I    M M M  AAAAA    T    EEE                 %
00009 %               A   A  N  NN    I    M   M  A   A    T    E                   %
00010 %               A   A  N   N  IIIII  M   M  A   A    T    EEEEE               %
00011 %                                                                             %
00012 %                                                                             %
00013 %              Methods to Interactively Animate an Image Sequence             %
00014 %                                                                             %
00015 %                             Software Design                                 %
00016 %                               John Cristy                                   %
00017 %                                July 1992                                    %
00018 %                                                                             %
00019 %                                                                             %
00020 %  Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization      %
00021 %  dedicated to making software imaging solutions freely available.           %
00022 %                                                                             %
00023 %  You may not use this file except in compliance with the License.  You may  %
00024 %  obtain a copy of the License at                                            %
00025 %                                                                             %
00026 %    http://www.imagemagick.org/script/license.php                            %
00027 %                                                                             %
00028 %  Unless required by applicable law or agreed to in writing, software        %
00029 %  distributed under the License is distributed on an "AS IS" BASIS,          %
00030 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
00031 %  See the License for the specific language governing permissions and        %
00032 %  limitations under the License.                                             %
00033 %                                                                             %
00034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00035 %
00036 %
00037 */
00038 
00039 /*
00040   Include declarations.
00041 */
00042 #include "wand/studio.h"
00043 #include "wand/MagickWand.h"
00044 #include "wand/mogrify-private.h"
00045 #include "magick/animate-private.h"
00046 
00047 /*
00048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00049 %                                                                             %
00050 %                                                                             %
00051 %                                                                             %
00052 +   A n i m a t e I m a g e C o m m a n d                                     %
00053 %                                                                             %
00054 %                                                                             %
00055 %                                                                             %
00056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00057 %
00058 %  AnimateImageCommand() displays a sequence of images on any workstation
00059 %  display running an X server. Animate first determines the hardware
00060 %  capabilities of the workstation. If the number of unique colors in an image
00061 %  is less than or equal to the number the workstation can support, the image
00062 %  is displayed in an X window. Otherwise the number of colors in the image is
00063 %  first reduced to match the color resolution of the workstation before it is
00064 %  displayed.
00065 %
00066 %  This means that a continuous-tone 24 bits/pixel image can display on a 8
00067 %  bit pseudo-color device or monochrome device. In most instances the reduced
00068 %  color image closely resembles the original. Alternatively, a monochrome or
00069 %  pseudo-color image sequence can display on a continuous-tone 24 bits/pixels
00070 %  device.
00071 %
00072 %  The format of the AnimateImageCommand method is:
00073 %
00074 %      MagickBooleanType AnimateImageCommand(ImageInfo *image_info,int argc,
00075 %        char **argv,char **metadata,ExceptionInfo *exception)
00076 %
00077 %  A description of each parameter follows:
00078 %
00079 %    o image_info: the image info.
00080 %
00081 %    o argc: the number of elements in the argument vector.
00082 %
00083 %    o argv: A text array containing the command line arguments.
00084 %
00085 %    o metadata: any metadata is returned here.
00086 %
00087 %    o exception: return any errors or warnings in this structure.
00088 %
00089 */
00090 
00091 static void AnimateUsage(void)
00092 {
00093   const char
00094     **p;
00095 
00096   static const char
00097     *buttons[]=
00098     {
00099       "Press any button to map or unmap the Command widget",
00100       (char *) NULL
00101     },
00102     *miscellaneous[]=
00103     {
00104       "-debug events        display copious debugging information",
00105       "-help                print program options",
00106       "-list type           print a list of supported option arguments",
00107       "-log format          format of debugging information",
00108       "-version             print version information",
00109       (char *) NULL
00110     },
00111     *operators[]=
00112     {
00113       "-colors value        preferred number of colors in the image",
00114       "-crop geometry       preferred size and location of the cropped image",
00115       "-extract geometry    extract area from image",
00116       "-monochrome          transform image to black and white",
00117       "-repage geometry     size and location of an image canvas (operator)",
00118       "-resample geometry   change the resolution of an image",
00119       "-resize geometry     resize the image",
00120       "-rotate degrees      apply Paeth rotation to the image",
00121       "-strip               strip image of all profiles and comments",
00122       "-trim                trim image edges",
00123       (char *) NULL
00124     },
00125     *settings[]=
00126     {
00127       "-alpha option        activate, deactivate, reset, or set the alpha channel",
00128       "-authenticate password",
00129       "                     decipher image with this password",
00130       "-backdrop            display image centered on a backdrop",
00131       "-channel type        apply option to select image channels",
00132       "-colormap type       Shared or Private",
00133       "-colorspace type     alternate image colorspace",
00134       "-decipher filename   convert cipher pixels to plain pixels",
00135       "-define format:option",
00136       "                     define one or more image format options",
00137       "-delay value         display the next image after pausing",
00138       "-density geometry    horizontal and vertical density of the image",
00139       "-depth value         image depth",
00140       "-display server      display image to this X server",
00141       "-dispose method      layer disposal method",
00142       "-dither method       apply error diffusion to image",
00143       "-filter type         use this filter when resizing an image",
00144       "-format \"string\"     output formatted image characteristics",
00145       "-gamma value         level of gamma correction",
00146       "-geometry geometry   preferred size and location of the Image window",
00147       "-identify            identify the format and characteristics of the image",
00148       "-immutable           displayed image cannot be modified",
00149       "-interlace type      type of image interlacing scheme",
00150       "-interpolate method  pixel color interpolation method",
00151       "-limit type value    pixel cache resource limit",
00152       "-loop iterations     loop images then exit",
00153       "-map type            display image using this Standard Colormap",
00154       "-monitor             monitor progress",
00155       "-pause               seconds to pause before reanimating",
00156       "-page geometry       size and location of an image canvas (setting)",
00157       "-quantize colorspace reduce colors in this colorspace",
00158       "-quiet               suppress all warning messages",
00159       "-regard-warnings     pay attention to warning messages",
00160       "-remote command      execute a command in an remote display process",
00161       "-respect-parenthesis settings remain in effect until parenthesis boundary",
00162       "-sampling-factor geometry",
00163       "                     horizontal and vertical sampling factor",
00164       "-seed value          seed a new sequence of pseudo-random numbers",
00165       "-set attribute value set an image attribute",
00166       "-size geometry       width and height of image",
00167       "-transparent-color color",
00168       "                     transparent color",
00169       "-treedepth value     color tree depth",
00170       "-verbose             print detailed information about the image",
00171       "-visual type         display image using this visual type",
00172       "-virtual-pixel method",
00173       "                     virtual pixel access method",
00174       "-window id           display image to background of this window",
00175       (char *) NULL
00176     },
00177     *sequence_operators[]=
00178     {
00179       "-coalesce            merge a sequence of images",
00180       "-flatten             flatten a sequence of images",
00181       (char *) NULL
00182     };
00183 
00184   (void) printf("Version: %s\n",GetMagickVersion((unsigned long *) NULL));
00185   (void) printf("Copyright: %s\n\n",GetMagickCopyright());
00186   (void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n",
00187     GetClientName());
00188   (void) printf("\nImage Settings:\n");
00189   for (p=settings; *p != (char *) NULL; p++)
00190     (void) printf("  %s\n",*p);
00191   (void) printf("\nImage Operators:\n");
00192   for (p=operators; *p != (char *) NULL; p++)
00193     (void) printf("  %s\n",*p);
00194   (void) printf("\nImage Sequence Operators:\n");
00195   for (p=sequence_operators; *p != (char *) NULL; p++)
00196     (void) printf("  %s\n",*p);
00197   (void) printf("\nMiscellaneous Options:\n");
00198   for (p=miscellaneous; *p != (char *) NULL; p++)
00199     (void) printf("  %s\n",*p);
00200   (void) printf(
00201     "\nIn addition to those listed above, you can specify these standard X\n");
00202   (void) printf(
00203     "resources as command line options:  -background, -bordercolor,\n");
00204   (void) printf(
00205     "-borderwidth, -font, -foreground, -iconGeometry, -iconic, -name,\n");
00206   (void) printf("-mattecolor, -shared-memory, or -title.\n");
00207   (void) printf(
00208     "\nBy default, the image format of `file' is determined by its magic\n");
00209   (void) printf(
00210     "number.  To specify a particular image format, precede the filename\n");
00211   (void) printf(
00212     "with an image format name and a colon (i.e. ps:image) or specify the\n");
00213   (void) printf(
00214     "image type as the filename suffix (i.e. image.ps).  Specify 'file' as\n");
00215   (void) printf("'-' for standard input or output.\n");
00216   (void) printf("\nButtons: \n");
00217   for (p=buttons; *p != (char *) NULL; p++)
00218     (void) printf("  %s\n",*p);
00219   exit(0);
00220 }
00221 
00222 WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info,
00223   int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception)
00224 {
00225 #if defined(MAGICKCORE_X11_DELEGATE)
00226 #define DestroyAnimate() \
00227 { \
00228   XDestroyResourceInfo(&resource_info); \
00229   if (display != (Display *) NULL) \
00230     { \
00231       XCloseDisplay(display); \
00232       display=(Display *) NULL; \
00233     } \
00234   XDestroyResourceInfo(&resource_info); \
00235   DestroyImageStack(); \
00236   for (i=0; i < (long) argc; i++) \
00237     argv[i]=DestroyString(argv[i]); \
00238   argv=(char **) RelinquishMagickMemory(argv); \
00239 }
00240 #define ThrowAnimateException(asperity,tag,option) \
00241 { \
00242   (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
00243     option); \
00244   DestroyAnimate(); \
00245   return(MagickFalse); \
00246 }
00247 #define ThrowAnimateInvalidArgumentException(option,argument) \
00248 { \
00249   (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
00250     "InvalidArgument","`%s': %s",argument,option); \
00251   DestroyAnimate(); \
00252   return(MagickFalse); \
00253 }
00254 
00255   char
00256     *resource_value,
00257     *server_name;
00258 
00259   const char
00260     *option;
00261 
00262   Display
00263     *display;
00264 
00265   Image
00266     *image;
00267 
00268   ImageStack
00269     image_stack[MaxImageStackDepth+1];
00270 
00271   long
00272     j,
00273     k;
00274 
00275   MagickBooleanType
00276     fire,
00277     pend;
00278 
00279   MagickStatusType
00280     status;
00281 
00282   QuantizeInfo
00283     *quantize_info;
00284 
00285   register long
00286     i;
00287 
00288   XResourceInfo
00289     resource_info;
00290 
00291   XrmDatabase
00292     resource_database;
00293 
00294   /*
00295     Set defaults.
00296   */
00297   assert(image_info != (ImageInfo *) NULL);
00298   assert(image_info->signature == MagickSignature);
00299   if (image_info->debug != MagickFalse)
00300     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
00301   assert(exception != (ExceptionInfo *) NULL);
00302   if (argc == 2)
00303     {
00304       option=argv[1];
00305       if ((LocaleCompare("version",option+1) == 0) ||
00306           (LocaleCompare("-version",option+1) == 0))
00307         {
00308           (void) fprintf(stdout,"Version: %s\n",
00309             GetMagickVersion((unsigned long *) NULL));
00310           (void) fprintf(stdout,"Copyright: %s\n\n",GetMagickCopyright());
00311           return(MagickFalse);
00312         }
00313     }
00314   status=MagickTrue;
00315   SetNotifyHandlers;
00316   display=(Display *) NULL;
00317   j=1;
00318   k=0;
00319   NewImageStack();
00320   option=(char *) NULL;
00321   pend=MagickFalse;
00322   resource_database=(XrmDatabase) NULL;
00323   (void) ResetMagickMemory(&resource_info,0,sizeof(XResourceInfo));
00324   server_name=(char *) NULL;
00325   status=MagickTrue;
00326   /*
00327     Check for server name specified on the command line.
00328   */
00329   ReadCommandlLine(argc,&argv);
00330   status=ExpandFilenames(&argc,&argv);
00331   if (status == MagickFalse)
00332     ThrowAnimateException(ResourceLimitError,"MemoryAllocationFailed",
00333       image_info->filename);
00334   for (i=1; i < (long) argc; i++)
00335   {
00336     /*
00337       Check command line for server name.
00338     */
00339     option=argv[i];
00340     if (IsMagickOption(option) == MagickFalse)
00341       continue;
00342     if (LocaleCompare("display",option+1) == 0)
00343       {
00344         /*
00345           User specified server name.
00346         */
00347         i++;
00348         if (i == (long) argc)
00349           ThrowAnimateException(OptionError,"MissingArgument",option);
00350         server_name=argv[i];
00351       }
00352     if ((LocaleCompare("help",option+1) == 0) ||
00353         (LocaleCompare("-help",option+1) == 0))
00354       AnimateUsage();
00355   }
00356   /*
00357     Get user defaults from X resource database.
00358   */
00359   display=XOpenDisplay(server_name);
00360   if (display == (Display *) NULL)
00361     ThrowAnimateException(XServerError,"UnableToOpenXServer",
00362       XDisplayName(server_name));
00363   (void) XSetErrorHandler(XError);
00364   resource_database=XGetResourceDatabase(display,GetClientName());
00365   XGetResourceInfo(image_info,resource_database,GetClientName(),
00366     &resource_info);
00367   quantize_info=resource_info.quantize_info;
00368   image_info->density=XGetResourceInstance(resource_database,GetClientName(),
00369     "density",(char *) NULL);
00370   if (image_info->density == (char *) NULL)
00371     image_info->density=XGetScreenDensity(display);
00372   resource_value=XGetResourceInstance(resource_database,GetClientName(),
00373     "interlace","none");
00374   image_info->interlace=(InterlaceType)
00375     ParseMagickOption(MagickInterlaceOptions,MagickFalse,resource_value);
00376   resource_value=XGetResourceInstance(resource_database,GetClientName(),
00377     "verbose","False");
00378   image_info->verbose=IsMagickTrue(resource_value);
00379   resource_value=XGetResourceInstance(resource_database,GetClientName(),
00380     "dither","True");
00381   quantize_info->dither=IsMagickTrue(resource_value);
00382   /*
00383     Parse command line.
00384   */
00385   for (i=1; i <= (long) argc; i++)
00386   {
00387     if (i < (long) argc)
00388       option=argv[i];
00389     else
00390       if (image != (Image *) NULL)
00391         break;
00392       else
00393         if (isatty(STDIN_FILENO) != MagickFalse)
00394           option="logo:";
00395         else
00396           {
00397             int
00398               c;
00399 
00400             c=getc(stdin);
00401             if (c == EOF)
00402               option="logo:";
00403             else
00404               {
00405                 c=ungetc(c,stdin);
00406                 option="-";
00407               }
00408           }
00409     if (LocaleCompare(option,"(") == 0)
00410       {
00411         FireImageStack(MagickFalse,MagickTrue,pend);
00412         if (k == MaxImageStackDepth)
00413           ThrowAnimateException(OptionError,"ParenthesisNestedTooDeeply",
00414             option);
00415         PushImageStack();
00416         continue;
00417       }
00418     if (LocaleCompare(option,")") == 0)
00419       {
00420         FireImageStack(MagickFalse,MagickTrue,MagickTrue);
00421         if (k == 0)
00422           ThrowAnimateException(OptionError,"UnableToParseExpression",option);
00423         PopImageStack();
00424         continue;
00425       }
00426     if (IsMagickOption(option) == MagickFalse)
00427       {
00428         const char
00429           *filename;
00430 
00431         Image
00432           *images;
00433 
00434         /*
00435           Read input image.
00436         */
00437         FireImageStack(MagickTrue,MagickTrue,pend);
00438         filename=option;
00439         if ((LocaleCompare(filename,"--") == 0) && (i < (argc-1)))
00440           {
00441             option=argv[++i];
00442             filename=option;
00443           }
00444         (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
00445         if (image_info->ping != MagickFalse)
00446           images=PingImages(image_info,exception);
00447         else
00448           images=ReadImages(image_info,exception);
00449         status&=(images != (Image *) NULL) &&
00450           (exception->severity < ErrorException);
00451         if (images == (Image *) NULL)
00452           continue;
00453         AppendImageStack(images);
00454         continue;
00455       }
00456     pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
00457     switch (*(option+1))
00458     {
00459       case 'a':
00460       {
00461         if (LocaleCompare("alpha",option+1) == 0)
00462           {
00463             long
00464               type;
00465 
00466             if (*option == '+')
00467               break;
00468             i++;
00469             if (i == (long) argc)
00470               ThrowAnimateException(OptionError,"MissingArgument",option);
00471             type=ParseMagickOption(MagickAlphaOptions,MagickFalse,argv[i]);
00472             if (type < 0)
00473               ThrowAnimateException(OptionError,"UnrecognizedAlphaChannelType",
00474                 argv[i]);
00475             break;
00476           }
00477         if (LocaleCompare("authenticate",option+1) == 0)
00478           {
00479             if (*option == '+')
00480               break;
00481             i++;
00482             if (i == (long) argc)
00483               ThrowAnimateException(OptionError,"MissingArgument",option);
00484             break;
00485           }
00486         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00487       }
00488       case 'b':
00489       {
00490         if (LocaleCompare("backdrop",option+1) == 0)
00491           {
00492             resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse;
00493             break;
00494           }
00495         if (LocaleCompare("background",option+1) == 0)
00496           {
00497             if (*option == '+')
00498               break;
00499             i++;
00500             if (i == (long) argc)
00501               ThrowAnimateException(OptionError,"MissingArgument",option);
00502             resource_info.background_color=argv[i];
00503             break;
00504           }
00505         if (LocaleCompare("bordercolor",option+1) == 0)
00506           {
00507             if (*option == '+')
00508               break;
00509             i++;
00510             if (i == (long) argc)
00511               ThrowAnimateException(OptionError,"MissingArgument",option);
00512             resource_info.border_color=argv[i];
00513             break;
00514           }
00515         if (LocaleCompare("borderwidth",option+1) == 0)
00516           {
00517             resource_info.border_width=0;
00518             if (*option == '+')
00519               break;
00520             i++;
00521             if ((i == (long) argc) || (IsGeometry(argv[i]) == MagickFalse))
00522               ThrowAnimateException(OptionError,"MissingArgument",option);
00523             resource_info.border_width=(unsigned int) atoi(argv[i]);
00524             break;
00525           }
00526         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00527       }
00528       case 'c':
00529       {
00530         if (LocaleCompare("cache",option+1) == 0)
00531           {
00532             if (*option == '+')
00533               break;
00534             i++;
00535             if (i == (long) argc)
00536               ThrowAnimateException(OptionError,"MissingArgument",option);
00537             if (IsGeometry(argv[i]) == MagickFalse)
00538               ThrowAnimateInvalidArgumentException(option,argv[i]);
00539             break;
00540           }
00541         if (LocaleCompare("channel",option+1) == 0)
00542           {
00543             long
00544               channel;
00545 
00546             if (*option == '+')
00547               break;
00548             i++;
00549             if (i == (long) (argc-1))
00550               ThrowAnimateException(OptionError,"MissingArgument",option);
00551             channel=ParseChannelOption(argv[i]);
00552             if (channel < 0)
00553               ThrowAnimateException(OptionError,"UnrecognizedChannelType",
00554                 argv[i]);
00555             break;
00556           }
00557         if (LocaleCompare("clone",option+1) == 0)
00558           {
00559             Image
00560               *clone_images;
00561 
00562             clone_images=image;
00563             if (k != 0)
00564               clone_images=image_stack[k-1].image;
00565             if (clone_images == (Image *) NULL)
00566               ThrowAnimateException(ImageError,"ImageSequenceRequired",option);
00567             if (*option == '+')
00568               clone_images=CloneImages(clone_images,"-1",exception);
00569             else
00570               {
00571                 i++;
00572                 if (i == (long) (argc-1))
00573                   ThrowAnimateException(OptionError,"MissingArgument",option);
00574                 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
00575                   ThrowAnimateInvalidArgumentException(option,argv[i]);
00576                 clone_images=CloneImages(clone_images,argv[i],exception);
00577               }
00578             if (clone_images == (Image *) NULL)
00579               ThrowAnimateException(OptionError,"NoSuchImage",option);
00580             FireImageStack(MagickFalse,MagickTrue,MagickTrue);
00581             AppendImageStack(clone_images);
00582             break;
00583           }
00584         if (LocaleCompare("coalesce",option+1) == 0)
00585           break;
00586         if (LocaleCompare("colormap",option+1) == 0)
00587           {
00588             resource_info.colormap=PrivateColormap;
00589             if (*option == '+')
00590               break;
00591             i++;
00592             if (i == (long) argc)
00593               ThrowAnimateException(OptionError,"MissingArgument",option);
00594             resource_info.colormap=UndefinedColormap;
00595             if (LocaleCompare("private",argv[i]) == 0)
00596               resource_info.colormap=PrivateColormap;
00597             if (LocaleCompare("shared",argv[i]) == 0)
00598               resource_info.colormap=SharedColormap;
00599             if (resource_info.colormap == UndefinedColormap)
00600               ThrowAnimateException(OptionError,"UnrecognizedColormapType",
00601                 argv[i]);
00602             break;
00603           }
00604         if (LocaleCompare("colors",option+1) == 0)
00605           {
00606             quantize_info->number_colors=0;
00607             if (*option == '+')
00608               break;
00609             i++;
00610             if (i == (long) argc)
00611               ThrowAnimateException(OptionError,"MissingArgument",option);
00612             if (IsGeometry(argv[i]) == MagickFalse)
00613               ThrowAnimateInvalidArgumentException(option,argv[i]);
00614             quantize_info->number_colors=(unsigned long) atol(argv[i]);
00615             break;
00616           }
00617         if (LocaleCompare("colorspace",option+1) == 0)
00618           {
00619             long
00620               colorspace;
00621 
00622             if (*option == '+')
00623               break;
00624             i++;
00625             if (i == (long) argc)
00626               ThrowAnimateException(OptionError,"MissingArgument",option);
00627             colorspace=ParseMagickOption(MagickColorspaceOptions,
00628               MagickFalse,argv[i]);
00629             if (colorspace < 0)
00630               ThrowAnimateException(OptionError,"UnrecognizedColorspace",
00631                 argv[i]);
00632             break;
00633           }
00634         if (LocaleCompare("crop",option+1) == 0)
00635           {
00636             if (*option == '+')
00637               break;
00638             i++;
00639             if (i == (long) argc)
00640               ThrowAnimateException(OptionError,"MissingArgument",option);
00641             if (IsGeometry(argv[i]) == MagickFalse)
00642               ThrowAnimateInvalidArgumentException(option,argv[i]);
00643             break;
00644           }
00645         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00646       }
00647       case 'd':
00648       {
00649         if (LocaleCompare("debug",option+1) == 0)
00650           {
00651             long
00652               event;
00653 
00654             if (*option == '+')
00655               break;
00656             i++;
00657             if (i == (long) argc)
00658               ThrowAnimateException(OptionError,"MissingArgument",option);
00659             event=ParseMagickOption(MagickLogEventOptions,MagickFalse,argv[i]);
00660             if (event < 0)
00661               ThrowAnimateException(OptionError,"UnrecognizedEventType",
00662                 argv[i]);
00663             (void) SetLogEventMask(argv[i]);
00664             break;
00665           }
00666         if (LocaleCompare("decipher",option+1) == 0)
00667           {
00668             if (*option == '+')
00669               break;
00670             i++;
00671             if (i == (long) (argc-1))
00672               ThrowAnimateException(OptionError,"MissingArgument",option);
00673             break;
00674           }
00675         if (LocaleCompare("define",option+1) == 0)
00676           {
00677             i++;
00678             if (i == (long) argc)
00679               ThrowAnimateException(OptionError,"MissingArgument",option);
00680             if (*option == '+')
00681               {
00682                 const char
00683                   *define;
00684 
00685                 define=GetImageOption(image_info,argv[i]);
00686                 if (define == (const char *) NULL)
00687                   ThrowAnimateException(OptionError,"NoSuchOption",argv[i]);
00688                 break;
00689               }
00690             break;
00691           }
00692         if (LocaleCompare("delay",option+1) == 0)
00693           {
00694             if (*option == '+')
00695               break;
00696             i++;
00697             if (i == (long) argc)
00698               ThrowAnimateException(OptionError,"MissingArgument",option);
00699             if (IsGeometry(argv[i]) == MagickFalse)
00700               ThrowAnimateInvalidArgumentException(option,argv[i]);
00701             break;
00702           }
00703         if (LocaleCompare("density",option+1) == 0)
00704           {
00705             if (*option == '+')
00706               break;
00707             i++;
00708             if (i == (long) argc)
00709               ThrowAnimateException(OptionError,"MissingArgument",option);
00710             if (IsGeometry(argv[i]) == MagickFalse)
00711               ThrowAnimateInvalidArgumentException(option,argv[i]);
00712             break;
00713           }
00714         if (LocaleCompare("depth",option+1) == 0)
00715           {
00716             if (*option == '+')
00717               break;
00718             i++;
00719             if (i == (long) argc)
00720               ThrowAnimateException(OptionError,"MissingArgument",option);
00721             if (IsGeometry(argv[i]) == MagickFalse)
00722               ThrowAnimateInvalidArgumentException(option,argv[i]);
00723             break;
00724           }
00725         if (LocaleCompare("display",option+1) == 0)
00726           {
00727             if (*option == '+')
00728               break;
00729             i++;
00730             if (i == (long) argc)
00731               ThrowAnimateException(OptionError,"MissingArgument",option);
00732             break;
00733           }
00734         if (LocaleCompare("dispose",option+1) == 0)
00735           {
00736             long
00737               dispose;
00738 
00739             if (*option == '+')
00740               break;
00741             i++;
00742             if (i == (long) argc)
00743               ThrowAnimateException(OptionError,"MissingArgument",option);
00744             dispose=ParseMagickOption(MagickDisposeOptions,MagickFalse,argv[i]);
00745             if (dispose < 0)
00746               ThrowAnimateException(OptionError,"UnrecognizedDisposeMethod",
00747                 argv[i]);
00748             break;
00749           }
00750         if (LocaleCompare("dither",option+1) == 0)
00751           {
00752             long
00753               method;
00754 
00755             quantize_info->dither=MagickFalse;
00756             if (*option == '+')
00757               break;
00758             i++;
00759             if (i == (long) argc)
00760               ThrowAnimateException(OptionError,"MissingArgument",option);
00761             method=ParseMagickOption(MagickDitherOptions,MagickFalse,argv[i]);
00762             if (method < 0)
00763               ThrowAnimateException(OptionError,"UnrecognizedDitherMethod",
00764                 argv[i]);
00765             quantize_info->dither=MagickTrue;
00766             quantize_info->dither_method=(DitherMethod) method;
00767             break;
00768           }
00769         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00770       }
00771       case 'e':
00772       {
00773         if (LocaleCompare("extract",option+1) == 0)
00774           {
00775             if (*option == '+')
00776               break;
00777             i++;
00778             if (i == (long) argc)
00779               ThrowAnimateException(OptionError,"MissingArgument",option);
00780             if (IsGeometry(argv[i]) == MagickFalse)
00781               ThrowAnimateInvalidArgumentException(option,argv[i]);
00782             break;
00783           }
00784         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00785       }
00786       case 'f':
00787       {
00788         if (LocaleCompare("filter",option+1) == 0)
00789           {
00790             long
00791               filter;
00792 
00793             if (*option == '+')
00794               break;
00795             i++;
00796             if (i == (long) (argc-1))
00797               ThrowAnimateException(OptionError,"MissingArgument",option);
00798             filter=ParseMagickOption(MagickFilterOptions,MagickFalse,argv[i]);
00799             if (filter < 0)
00800               ThrowAnimateException(OptionError,"UnrecognizedImageFilter",
00801                 argv[i]);
00802             break;
00803           }
00804         if (LocaleCompare("flatten",option+1) == 0)
00805           break;
00806         if (LocaleCompare("font",option+1) == 0)
00807           {
00808             if (*option == '+')
00809               break;
00810             i++;
00811             if (i == (long) argc)
00812               ThrowAnimateException(OptionError,"MissingArgument",option);
00813             resource_info.font=XGetResourceClass(resource_database,
00814               GetClientName(),"font",argv[i]);
00815             break;
00816           }
00817         if (LocaleCompare("foreground",option+1) == 0)
00818           {
00819             if (*option == '+')
00820               break;
00821             i++;
00822             if (i == (long) argc)
00823               ThrowAnimateException(OptionError,"MissingArgument",option);
00824             resource_info.foreground_color=argv[i];
00825             break;
00826           }
00827         if (LocaleCompare("format",option+1) == 0)
00828           {
00829             if (*option == '+')
00830               break;
00831             i++;
00832             if (i == (long) (argc-1))
00833               ThrowAnimateException(OptionError,"MissingArgument",option);
00834             break;
00835           }
00836         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00837       }
00838       case 'g':
00839       {
00840         if (LocaleCompare("gamma",option+1) == 0)
00841           {
00842             i++;
00843             if (i == (long) argc)
00844               ThrowAnimateException(OptionError,"MissingArgument",option);
00845             if (IsGeometry(argv[i]) == MagickFalse)
00846               ThrowAnimateInvalidArgumentException(option,argv[i]);
00847             break;
00848           }
00849         if (LocaleCompare("geometry",option+1) == 0)
00850           {
00851             resource_info.image_geometry=(char *) NULL;
00852             if (*option == '+')
00853               break;
00854             i++;
00855             if (i == (long) argc)
00856               ThrowAnimateException(OptionError,"MissingArgument",option);
00857             if (IsGeometry(argv[i]) == MagickFalse)
00858               ThrowAnimateInvalidArgumentException(option,argv[i]);
00859             resource_info.image_geometry=ConstantString(argv[i]);
00860             break;
00861           }
00862         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00863       }
00864       case 'h':
00865       {
00866         if ((LocaleCompare("help",option+1) == 0) ||
00867             (LocaleCompare("-help",option+1) == 0))
00868           break;
00869         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00870       }
00871       case 'i':
00872       {
00873         if (LocaleCompare("iconGeometry",option+1) == 0)
00874           {
00875             resource_info.icon_geometry=(char *) NULL;
00876             if (*option == '+')
00877               break;
00878             i++;
00879             if (i == (long) argc)
00880               ThrowAnimateException(OptionError,"MissingArgument",option);
00881             if (IsGeometry(argv[i]) == MagickFalse)
00882               ThrowAnimateInvalidArgumentException(option,argv[i]);
00883             resource_info.icon_geometry=argv[i];
00884             break;
00885           }
00886         if (LocaleCompare("iconic",option+1) == 0)
00887           {
00888             resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse;
00889             break;
00890           }
00891         if (LocaleCompare("identify",option+1) == 0)
00892           break;
00893         if (LocaleCompare("immutable",option+1) == 0)
00894           {
00895             resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse;
00896             break;
00897           }
00898         if (LocaleCompare("interlace",option+1) == 0)
00899           {
00900             long
00901               interlace;
00902 
00903             if (*option == '+')
00904               break;
00905             i++;
00906             if (i == (long) argc)
00907               ThrowAnimateException(OptionError,"MissingArgument",option);
00908             interlace=ParseMagickOption(MagickInterlaceOptions,MagickFalse,
00909               argv[i]);
00910             if (interlace < 0)
00911               ThrowAnimateException(OptionError,"UnrecognizedInterlaceType",
00912                 argv[i]);
00913             break;
00914           }
00915         if (LocaleCompare("interpolate",option+1) == 0)
00916           {
00917             long
00918               interpolate;
00919 
00920             if (*option == '+')
00921               break;
00922             i++;
00923             if (i == (long) argc)
00924               ThrowAnimateException(OptionError,"MissingArgument",option);
00925             interpolate=ParseMagickOption(MagickInterpolateOptions,MagickFalse,
00926               argv[i]);
00927             if (interpolate < 0)
00928               ThrowAnimateException(OptionError,"UnrecognizedInterpolateMethod",
00929                 argv[i]);
00930             break;
00931           }
00932         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00933       }
00934       case 'l':
00935       {
00936         if (LocaleCompare("label",option+1) == 0)
00937           {
00938             if (*option == '+')
00939               break;
00940             i++;
00941             if (i == (long) argc)
00942               ThrowAnimateException(OptionError,"MissingArgument",option);
00943             break;
00944           }
00945         if (LocaleCompare("limit",option+1) == 0)
00946           {
00947             char
00948               *p;
00949 
00950             long
00951               resource;
00952 
00953             if (*option == '+')
00954               break;
00955             i++;
00956             if (i == (long) argc)
00957               ThrowAnimateException(OptionError,"MissingArgument",option);
00958             resource=ParseMagickOption(MagickResourceOptions,MagickFalse,
00959               argv[i]);
00960             if (resource < 0)
00961               ThrowAnimateException(OptionError,"UnrecognizedResourceType",
00962                 argv[i]);
00963             i++;
00964             if (i == (long) argc)
00965               ThrowAnimateException(OptionError,"MissingArgument",option);
00966             (void) strtod(argv[i],&p);
00967             if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
00968               ThrowAnimateInvalidArgumentException(option,argv[i]);
00969             break;
00970           }
00971         if (LocaleCompare("log",option+1) == 0)
00972           {
00973             if (*option == '+')
00974               break;
00975             i++;
00976             if ((i == (long) argc) ||
00977                 (strchr(argv[i],'%') == (char *) NULL))
00978               ThrowAnimateException(OptionError,"MissingArgument",option);
00979             break;
00980           }
00981         if (LocaleCompare("loop",option+1) == 0)
00982           {
00983             if (*option == '+')
00984               break;
00985             i++;
00986             if (i == (long) (argc-1))
00987               ThrowAnimateException(OptionError,"MissingArgument",option);
00988             if (IsGeometry(argv[i]) == MagickFalse)
00989               ThrowAnimateInvalidArgumentException(option,argv[i]);
00990             break;
00991           }
00992         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
00993       }
00994       case 'm':
00995       {
00996         if (LocaleCompare("map",option+1) == 0)
00997           {
00998             resource_info.map_type=(char *) NULL;
00999             if (*option == '+')
01000               break;
01001             (void) CopyMagickString(argv[i]+1,"sans",MaxTextExtent);
01002             i++;
01003             if (i == (long) argc)
01004               ThrowAnimateException(OptionError,"MissingArgument",option);
01005             resource_info.map_type=argv[i];
01006             break;
01007           }
01008         if (LocaleCompare("matte",option+1) == 0)
01009           break;
01010         if (LocaleCompare("mattecolor",option+1) == 0)
01011           {
01012             if (*option == '+')
01013               break;
01014             i++;
01015             if (i == (long) argc)
01016               ThrowAnimateException(OptionError,"MissingArgument",option);
01017             resource_info.matte_color=argv[i];
01018             break;
01019           }
01020         if (LocaleCompare("monitor",option+1) == 0)
01021           break;
01022         if (LocaleCompare("monochrome",option+1) == 0)
01023           {
01024             if (*option == '+')
01025               break;
01026             quantize_info->number_colors=2;
01027             quantize_info->colorspace=GRAYColorspace;
01028             break;
01029           }
01030         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01031       }
01032       case 'n':
01033       {
01034         if (LocaleCompare("name",option+1) == 0)
01035           {
01036             resource_info.name=(char *) NULL;
01037             if (*option == '+')
01038               break;
01039             i++;
01040             if (i == (long) argc)
01041               ThrowAnimateException(OptionError,"MissingArgument",option);
01042             resource_info.name=ConstantString(argv[i]);
01043             break;
01044           }
01045         if (LocaleCompare("noop",option+1) == 0)
01046           break;
01047         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01048       }
01049       case 'p':
01050       {
01051         if (LocaleCompare("pause",option+1) == 0)
01052           {
01053             resource_info.pause=0;
01054             if (*option == '+')
01055               break;
01056             i++;
01057             if (i == (long) argc)
01058               ThrowAnimateException(OptionError,"MissingArgument",option);
01059             if (IsGeometry(argv[i]) == MagickFalse)
01060               ThrowAnimateInvalidArgumentException(option,argv[i]);
01061             resource_info.pause=(unsigned int) atoi(argv[i]);
01062             break;
01063           }
01064         if (LocaleCompare("page",option+1) == 0)
01065           {
01066             if (*option == '+')
01067               break;
01068             i++;
01069             if (i == (long) argc)
01070               ThrowAnimateException(OptionError,"MissingArgument",option);
01071             break;
01072           }
01073         if (LocaleCompare("profile",option+1) == 0)
01074           {
01075             i++;
01076             if (i == (long) argc)
01077               ThrowAnimateException(OptionError,"MissingArgument",option);
01078             break;
01079           }
01080         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01081       }
01082       case 'q':
01083       {
01084         if (LocaleCompare("quantize",option+1) == 0)
01085           {
01086             long
01087               colorspace;
01088 
01089             if (*option == '+')
01090               break;
01091             i++;
01092             if (i == (long) (argc-1))
01093               ThrowAnimateException(OptionError,"MissingArgument",option);
01094             colorspace=ParseMagickOption(MagickColorspaceOptions,
01095               MagickFalse,argv[i]);
01096             if (colorspace < 0)
01097               ThrowAnimateException(OptionError,"UnrecognizedColorspace",
01098                 argv[i]);
01099             break;
01100           }
01101         if (LocaleCompare("quiet",option+1) == 0)
01102           break;
01103         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01104       }
01105       case 'r':
01106       {
01107         if (LocaleCompare("regard-warnings",option+1) == 0)
01108           break;
01109         if (LocaleCompare("remote",option+1) == 0)
01110           {
01111             i++;
01112             if (i == (long) argc)
01113               ThrowAnimateException(OptionError,"MissingArgument",option);
01114             if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
01115               return(MagickFalse);
01116             i--;
01117             break;
01118           }
01119         if (LocaleCompare("repage",option+1) == 0)
01120           {
01121             if (*option == '+')
01122               break;
01123             i++;
01124             if (i == (long) argc)
01125               ThrowAnimateException(OptionError,"MissingArgument",option);
01126             if (IsGeometry(argv[i]) == MagickFalse)
01127               ThrowAnimateInvalidArgumentException(option,argv[i]);
01128             break;
01129           }
01130         if (LocaleCompare("resample",option+1) == 0)
01131           {
01132             if (*option == '+')
01133               break;
01134             i++;
01135             if (i == (long) (argc-1))
01136               ThrowAnimateException(OptionError,"MissingArgument",option);
01137             if (IsGeometry(argv[i]) == MagickFalse)
01138               ThrowAnimateInvalidArgumentException(option,argv[i]);
01139             break;
01140           }
01141         if (LocaleCompare("resize",option+1) == 0)
01142           {
01143             if (*option == '+')
01144               break;
01145             i++;
01146             if (i == (long) argc)
01147               ThrowAnimateException(OptionError,"MissingArgument",option);
01148             if (IsGeometry(argv[i]) == MagickFalse)
01149               ThrowAnimateInvalidArgumentException(option,argv[i]);
01150             break;
01151           }
01152         if (LocaleCompare("respect-parenthesis",option+1) == 0)
01153           {
01154             respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
01155             break;
01156           }
01157         if (LocaleCompare("rotate",option+1) == 0)
01158           {
01159             i++;
01160             if (i == (long) argc)
01161               ThrowAnimateException(OptionError,"MissingArgument",option);
01162             if (IsGeometry(argv[i]) == MagickFalse)
01163               ThrowAnimateInvalidArgumentException(option,argv[i]);
01164             break;
01165           }
01166         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01167       }
01168       case 's':
01169       {
01170         if (LocaleCompare("sampling-factor",option+1) == 0)
01171           {
01172             if (*option == '+')
01173               break;
01174             i++;
01175             if (i == (long) argc)
01176               ThrowAnimateException(OptionError,"MissingArgument",option);
01177             if (IsGeometry(argv[i]) == MagickFalse)
01178               ThrowAnimateInvalidArgumentException(option,argv[i]);
01179             break;
01180           }
01181         if (LocaleCompare("seed",option+1) == 0)
01182           {
01183             if (*option == '+')
01184               break;
01185             i++;
01186             if (i == (long) (argc-1))
01187               ThrowAnimateException(OptionError,"MissingArgument",option);
01188             if (IsGeometry(argv[i]) == MagickFalse)
01189               ThrowAnimateInvalidArgumentException(option,argv[i]);
01190             break;
01191           }
01192         if (LocaleCompare("scenes",option+1) == 0)  /* deprecated */
01193           {
01194             if (*option == '+')
01195               break;
01196             i++;
01197             if (i == (long) argc)
01198               ThrowAnimateException(OptionError,"MissingArgument",option);
01199             if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
01200               ThrowAnimateInvalidArgumentException(option,argv[i]);
01201             break;
01202           }
01203         if (LocaleCompare("set",option+1) == 0)
01204           {
01205             i++;
01206             if (i == (long) argc)
01207               ThrowAnimateException(OptionError,"MissingArgument",option);
01208             if (*option == '+')
01209               break;
01210             i++;
01211             if (i == (long) argc)
01212               ThrowAnimateException(OptionError,"MissingArgument",option);
01213             break;
01214           }
01215         if (LocaleCompare("shared-memory",option+1) == 0)
01216           {
01217             resource_info.use_shared_memory=(*option == '-') ? MagickTrue :
01218               MagickFalse;
01219             break;
01220           }
01221         if (LocaleCompare("size",option+1) == 0)
01222           {
01223             if (*option == '+')
01224               break;
01225             i++;
01226             if (i == (long) argc)
01227               ThrowAnimateException(OptionError,"MissingArgument",option);
01228             if (IsGeometry(argv[i]) == MagickFalse)
01229               ThrowAnimateInvalidArgumentException(option,argv[i]);
01230             break;
01231           }
01232         if (LocaleCompare("strip",option+1) == 0)
01233           break;
01234         if (LocaleCompare("support",option+1) == 0)
01235           {
01236             i++;  /* deprecated */
01237             break;
01238           }
01239         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01240       }
01241       case 't':
01242       {
01243         if (LocaleCompare("text-font",option+1) == 0)
01244           {
01245             resource_info.text_font=(char *) NULL;
01246             if (*option == '+')
01247               break;
01248             i++;
01249             if (i == (long) argc)
01250               ThrowAnimateException(OptionError,"MissingArgument",option);
01251             resource_info.text_font=XGetResourceClass(resource_database,
01252               GetClientName(),"font",argv[i]);
01253             break;
01254           }
01255         if (LocaleCompare("thumbnail",option+1) == 0)
01256           {
01257             if (*option == '+')
01258               break;
01259             i++;
01260             if (i == (long) argc)
01261               ThrowAnimateException(OptionError,"MissingArgument",option);
01262             if (IsGeometry(argv[i]) == MagickFalse)
01263               ThrowAnimateInvalidArgumentException(option,argv[i]);
01264             break;
01265           }
01266         if (LocaleCompare("title",option+1) == 0)
01267           {
01268             resource_info.title=(char *) NULL;
01269             if (*option == '+')
01270               break;
01271             i++;
01272             if (i == (long) argc)
01273               ThrowAnimateException(OptionError,"MissingArgument",option);
01274             resource_info.title=argv[i];
01275             break;
01276           }
01277         if (LocaleCompare("transparent-color",option+1) == 0)
01278           {
01279             if (*option == '+')
01280               break;
01281             i++;
01282             if (i == (long) (argc-1))
01283               ThrowAnimateException(OptionError,"MissingArgument",option);
01284             break;
01285           }
01286         if (LocaleCompare("treedepth",option+1) == 0)
01287           {
01288             quantize_info->tree_depth=0;
01289             if (*option == '+')
01290               break;
01291             i++;
01292             if (i == (long) argc)
01293               ThrowAnimateException(OptionError,"MissingArgument",option);
01294             if (IsGeometry(argv[i]) == MagickFalse)
01295               ThrowAnimateInvalidArgumentException(option,argv[i]);
01296             quantize_info->tree_depth=(unsigned long) atol(argv[i]);
01297             break;
01298           }
01299         if (LocaleCompare("trim",option+1) == 0)
01300           break;
01301         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01302       }
01303       case 'v':
01304       {
01305         if (LocaleCompare("verbose",option+1) == 0)
01306           break;
01307         if ((LocaleCompare("version",option+1) == 0) ||
01308             (LocaleCompare("-version",option+1) == 0))
01309           {
01310             (void) fprintf(stdout,"Version: %s\n",
01311               GetMagickVersion((unsigned long *) NULL));
01312             (void) fprintf(stdout,"Copyright: %s\n\n",GetMagickCopyright());
01313             break;
01314           }
01315         if (LocaleCompare("virtual-pixel",option+1) == 0)
01316           {
01317             long
01318               method;
01319 
01320             if (*option == '+')
01321               break;
01322             i++;
01323             if (i == (long) argc)
01324               ThrowAnimateException(OptionError,"MissingArgument",option);
01325             method=ParseMagickOption(MagickVirtualPixelOptions,MagickFalse,
01326               argv[i]);
01327             if (method < 0)
01328               ThrowAnimateException(OptionError,
01329                 "UnrecognizedVirtualPixelMethod",argv[i]);
01330             break;
01331           }
01332         if (LocaleCompare("visual",option+1) == 0)
01333           {
01334             resource_info.visual_type=(char *) NULL;
01335             if (*option == '+')
01336               break;
01337             i++;
01338             if (i == (long) argc)
01339               ThrowAnimateException(OptionError,"MissingArgument",option);
01340             resource_info.visual_type=argv[i];
01341             break;
01342           }
01343         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01344       }
01345       case 'w':
01346       {
01347         if (LocaleCompare("window",option+1) == 0)
01348           {
01349             resource_info.window_id=(char *) NULL;
01350             if (*option == '+')
01351               break;
01352             i++;
01353             if (i == (long) argc)
01354               ThrowAnimateException(OptionError,"MissingArgument",option);
01355             resource_info.window_id=argv[i];
01356             break;
01357           }
01358         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01359       }
01360       case '?':
01361         break;
01362       default:
01363         ThrowAnimateException(OptionError,"UnrecognizedOption",option);
01364     }
01365     fire=ParseMagickOption(MagickImageListOptions,MagickFalse,option+1) < 0 ? 
01366       MagickFalse : MagickTrue;
01367     if (fire != MagickFalse)
01368       FireImageStack(MagickFalse,MagickTrue,MagickTrue);
01369   }
01370   i--;
01371   if (k != 0)
01372     ThrowAnimateException(OptionError,"UnbalancedParenthesis",argv[i]);
01373   if (image == (Image *) NULL)
01374     ThrowAnimateException(OptionError,"MissingAnImageFilename",argv[argc-1])
01375   FinalizeImageSettings(image_info,image);
01376   if (resource_info.window_id != (char *) NULL)
01377     XAnimateBackgroundImage(display,&resource_info,image);
01378   else
01379     {
01380       Image
01381         *animate_image;
01382 
01383       /*
01384         Animate image to X server.
01385       */
01386       animate_image=XAnimateImages(display,&resource_info,argv,argc,image);
01387       while (animate_image != (Image *) NULL)
01388       {
01389         image=animate_image;
01390         animate_image=XAnimateImages(display,&resource_info,argv,argc,image);
01391       }
01392     }
01393   DestroyAnimate();
01394   return(status != 0 ? MagickTrue : MagickFalse);
01395 #else
01396   (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
01397     "DelegateLibrarySupportNotBuiltIn","`%s' (X11)",image_info->filename);
01398   AnimateUsage();
01399   return(MagickFalse);
01400 #endif
01401 }

Generated on Sat Nov 22 23:45:25 2008 for MagickWand by  doxygen 1.5.7.1