cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 % |
cristy | de984cd | 2013-12-01 14:49:27 +0000 | [diff] [blame] | 16 | % Cristy % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 17 | % July 1992 % |
| 18 | % % |
| 19 | % % |
cristy | b56bb24 | 2014-11-25 17:12:48 +0000 | [diff] [blame] | 20 | % Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | |
cristy | ee67810 | 2011-07-01 23:32:11 +0000 | [diff] [blame] | 53 | #include "MagickWand/studio.h" |
| 54 | #include "MagickWand/MagickWand.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 55 | |
| 56 | /* |
| 57 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 58 | % % |
| 59 | % % |
| 60 | % % |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 61 | % M a i n % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 62 | % % |
| 63 | % % |
| 64 | % % |
| 65 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 66 | % |
| 67 | % |
| 68 | */ |
| 69 | |
cristy | 9c88feb | 2011-09-21 13:06:09 +0000 | [diff] [blame] | 70 | static int AnimateMain(int argc,char **argv) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 71 | { |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 72 | ExceptionInfo |
| 73 | *exception; |
| 74 | |
| 75 | ImageInfo |
| 76 | *image_info; |
| 77 | |
| 78 | MagickBooleanType |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 79 | status; |
| 80 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 81 | MagickCoreGenesis(*argv,MagickTrue); |
| 82 | exception=AcquireExceptionInfo(); |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 83 | image_info=AcquireImageInfo(); |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 84 | status=MagickCommandGenesis(image_info,AnimateImageCommand,argc,argv, |
cristy | 4e1dff6 | 2009-10-25 20:36:03 +0000 | [diff] [blame] | 85 | (char **) NULL,exception); |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 86 | image_info=DestroyImageInfo(image_info); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 87 | exception=DestroyExceptionInfo(exception); |
| 88 | MagickCoreTerminus(); |
cristy | 3589219 | 2014-05-26 12:04:36 +0000 | [diff] [blame] | 89 | return(status != MagickFalse ? 0 : 1); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 90 | } |
cristy | 66f9c3c | 2011-08-13 17:12:28 +0000 | [diff] [blame] | 91 | |
cristy | 07a3cca | 2012-12-10 13:09:10 +0000 | [diff] [blame] | 92 | #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) |
cristy | 66f9c3c | 2011-08-13 17:12:28 +0000 | [diff] [blame] | 93 | int main(int argc,char **argv) |
| 94 | { |
| 95 | return(AnimateMain(argc,argv)); |
| 96 | } |
| 97 | #else |
| 98 | int wmain(int argc,wchar_t *argv[]) |
| 99 | { |
| 100 | char |
| 101 | **utf8; |
| 102 | |
| 103 | int |
| 104 | status; |
| 105 | |
| 106 | register int |
| 107 | i; |
| 108 | |
| 109 | utf8=NTArgvToUTF8(argc,argv); |
| 110 | status=AnimateMain(argc,utf8); |
| 111 | for (i=0; i < argc; i++) |
| 112 | utf8[i]=DestroyString(utf8[i]); |
| 113 | utf8=(char **) RelinquishMagickMemory(utf8); |
dirk | 3c746fb | 2014-06-05 18:21:08 +0000 | [diff] [blame] | 114 | return(status); |
cristy | 66f9c3c | 2011-08-13 17:12:28 +0000 | [diff] [blame] | 115 | } |
| 116 | #endif |