root / ImageMagick / branches / ImageMagick-6.3.5 / utilities / animate.c
| Revision 7647, 5.6 kB (checked in by cristy, 15 months ago) |
|---|
| Line | |
|---|---|
| 1 | /* |
| 2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3 | % % |
| 4 | % % |
| 5 | % % |
| 6 | % AAA N N IIIII M M AAA TTTTT EEEEE % |
| 7 | % A A NN N I MM MM A A T E % |
| 8 | % AAAAA N N N I M M M AAAAA T EEE % |
| 9 | % A A N NN I M M A A T E % |
| 10 | % A A N N IIIII M M A A T EEEEE % |
| 11 | % % |
| 12 | % % |
| 13 | % Interactively Animate an Image Sequence. % |
| 14 | % % |
| 15 | % Software Design % |
| 16 | % John Cristy % |
| 17 | % July 1992 % |
| 18 | % % |
| 19 | % % |
| 20 | % Copyright 1999-2007 ImageMagick Studio LLC, a non-profit organization % |
| 21 | % dedicated to making software imaging solutions freely available. % |
| 22 | % % |
| 23 | % You may not use this file except in compliance with the License. You may % |
| 24 | % obtain a copy of the License at % |
| 25 | % % |
| 26 | % http://www.imagemagick.org/script/license.php % |
| 27 | % % |
| 28 | % Unless required by applicable law or agreed to in writing, software % |
| 29 | % distributed under the License is distributed on an "AS IS" BASIS, % |
| 30 | % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % |
| 31 | % See the License for the specific language governing permissions and % |
| 32 | % limitations under the License. % |
| 33 | % % |
| 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 35 | % |
| 36 | % Animate displays a sequence of images in the MIFF format on any |
| 37 | % workstation display running an X server. Animate first determines the |
| 38 | % hardware capabilities of the workstation. If the number of unique |
| 39 | % colors in an image is less than or equal to the number the workstation |
| 40 | % can support, the image is displayed in an X window. Otherwise the |
| 41 | % number of colors in the image is first reduced to match the color |
| 42 | % resolution of the workstation before it is displayed. |
| 43 | % |
| 44 | % This means that a continuous-tone 24 bits-per-pixel image can display on a |
| 45 | % 8 bit pseudo-color device or monochrome device. In most instances the |
| 46 | % reduced color image closely resembles the original. Alternatively, a |
| 47 | % monochrome or pseudo-color image can display on a continuous-tone 24 |
| 48 | % bits-per-pixel device. |
| 49 | % |
| 50 | % |
| 51 | */ |
| 52 | |
| 53 | /* |
| 54 | Include declarations. |
| 55 | */ |
| 56 | #include <stdio.h> |
| 57 | #include <stdlib.h> |
| 58 | #include <string.h> |
| 59 | #include <time.h> |
| 60 | #include "wand/MagickWand.h" |
| 61 | #if defined(__WINDOWS__) |
| 62 | #include <windows.h> |
| 63 | #endif |
| 64 | |
| 65 | /* |
| 66 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 67 | % % |
| 68 | % % |
| 69 | % % |
| 70 | % M a i n % |
| 71 | % % |
| 72 | % % |
| 73 | % % |
| 74 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 75 | % |
| 76 | % |
| 77 | */ |
| 78 | |
| 79 | #if defined(__WINDOWS__) |
| 80 | int WINAPI WinMain(HINSTANCE instance,HINSTANCE last,LPSTR command,int state) |
| 81 | { |
| 82 | char |
| 83 | **argv; |
| 84 | |
| 85 | int |
| 86 | argc, |
| 87 | main(int,char **); |
| 88 | |
| 89 | argv=StringToArgv(command,&argc); |
| 90 | return(main(argc,argv)); |
| 91 | } |
| 92 | #endif |
| 93 | |
| 94 | int main(int argc,char **argv) |
| 95 | { |
| 96 | char |
| 97 | *option; |
| 98 | |
| 99 | ExceptionInfo |
| 100 | *exception; |
| 101 | |
| 102 | ImageInfo |
| 103 | *image_info; |
| 104 | |
| 105 | MagickBooleanType |
| 106 | regard_warnings, |
| 107 | status; |
| 108 | |
| 109 | register long |
| 110 | i; |
| 111 | |
| 112 | MagickCoreGenesis(*argv,MagickTrue); |
| 113 | exception=AcquireExceptionInfo(); |
| 114 | regard_warnings=MagickFalse; |
| 115 | for (i=1; i < (long) argc; i++) |
| 116 | { |
| 117 | option=argv[i]; |
| 118 | if ((strlen(option) == 1) || ((*option != '-') && (*option != '+'))) |
| 119 | continue; |
| 120 | if (LocaleCompare("debug",option+1) == 0) |
| 121 | (void) SetLogEventMask(argv[++i]); |
| 122 | if (LocaleCompare("regard-warnings",option+1) == 0) |
| 123 | regard_warnings=MagickTrue; |
| 124 | } |
| 125 | image_info=AcquireImageInfo(); |
| 126 | status=AnimateImageCommand(image_info,argc,argv,(char **) NULL,exception); |
| 127 | if ((status == MagickFalse) || (exception->severity != UndefinedException)) |
| 128 | { |
| 129 | if ((exception->severity < ErrorException) && |
| 130 | (regard_warnings == MagickFalse)) |
| 131 | status=MagickTrue; |
| 132 | CatchException(exception); |
| 133 | } |
| 134 | image_info=DestroyImageInfo(image_info); |
| 135 | exception=DestroyExceptionInfo(exception); |
| 136 | MagickCoreTerminus(); |
| 137 | return(status == MagickFalse ? 1 : 0); |
| 138 | } |
Note: See TracBrowser
for help on using the browser.
