cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
| 2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3 | % % |
| 4 | % % |
| 5 | % % |
| 6 | % DDDD IIIII SSSSS PPPP L AAA Y Y % |
| 7 | % D D I SS P P L A A Y Y % |
| 8 | % D D I SSS PPPP L AAAAA Y % |
| 9 | % D D I SS P L A A Y % |
| 10 | % DDDD IIIII SSSSS P LLLLL A A Y % |
| 11 | % % |
| 12 | % % |
| 13 | % Interactively Display an Image. % |
| 14 | % % |
| 15 | % Software Design % |
| 16 | % John Cristy % |
| 17 | % July 1992 % |
| 18 | % % |
| 19 | % % |
cristy | 7e41fe8 | 2010-12-04 23:12:08 +0000 | [diff] [blame] | 20 | % Copyright 1999-2011 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 | % Display is a machine architecture independent image processing |
| 37 | % and display program. It can display any image in the MIFF format on |
| 38 | % any workstation display running X. Display first determines the |
| 39 | % hardware capabilities of the workstation. If the number of unique |
| 40 | % colors in the image is less than or equal to the number the workstation |
| 41 | % can support, the image is displayed in an X window. Otherwise the |
| 42 | % number of colors in the image is first reduced to match the color |
| 43 | % resolution of the workstation before it is displayed. |
| 44 | % |
| 45 | % This means that a continuous-tone 24 bits-per-pixel image can display on a |
| 46 | % 8 bit pseudo-color device or monochrome device. In most instances the |
| 47 | % reduced color image closely resembles the original. Alternatively, a |
| 48 | % monochrome or pseudo-color image can display on a continuous-tone 24 |
| 49 | % bits-per-pixel device. |
| 50 | % |
| 51 | % |
| 52 | % |
| 53 | */ |
| 54 | |
| 55 | /* |
| 56 | Include declarations. |
| 57 | */ |
cristy | ee67810 | 2011-07-01 23:32:11 +0000 | [diff] [blame] | 58 | #include "MagickWand/studio.h" |
| 59 | #include "MagickWand/MagickWand.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 60 | |
| 61 | /* |
| 62 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 63 | % % |
| 64 | % % |
| 65 | % % |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 66 | % M a i n % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 67 | % % |
| 68 | % % |
| 69 | % % |
| 70 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 71 | % |
| 72 | % |
| 73 | */ |
| 74 | |
cristy | 9c88feb | 2011-09-21 13:06:09 +0000 | [diff] [blame^] | 75 | static int DisplayMain(int argc,char **argv) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 76 | { |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 77 | ExceptionInfo |
| 78 | *exception; |
| 79 | |
| 80 | ImageInfo |
| 81 | *image_info; |
| 82 | |
| 83 | MagickBooleanType |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 84 | status; |
| 85 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 86 | MagickCoreGenesis(*argv,MagickTrue); |
| 87 | exception=AcquireExceptionInfo(); |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 88 | image_info=AcquireImageInfo(); |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 89 | status=MagickCommandGenesis(image_info,DisplayImageCommand,argc,argv, |
cristy | 4e1dff6 | 2009-10-25 20:36:03 +0000 | [diff] [blame] | 90 | (char **) NULL,exception); |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 91 | image_info=DestroyImageInfo(image_info); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 92 | exception=DestroyExceptionInfo(exception); |
| 93 | MagickCoreTerminus(); |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 94 | return(status); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 95 | } |
cristy | 66f9c3c | 2011-08-13 17:12:28 +0000 | [diff] [blame] | 96 | |
| 97 | #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) |
| 98 | int main(int argc,char **argv) |
| 99 | { |
| 100 | return(DisplayMain(argc,argv)); |
| 101 | } |
| 102 | #else |
| 103 | int wmain(int argc,wchar_t *argv[]) |
| 104 | { |
| 105 | char |
| 106 | **utf8; |
| 107 | |
| 108 | int |
| 109 | status; |
| 110 | |
| 111 | register int |
| 112 | i; |
| 113 | |
| 114 | utf8=NTArgvToUTF8(argc,argv); |
| 115 | status=DisplayMain(argc,utf8); |
| 116 | for (i=0; i < argc; i++) |
| 117 | utf8[i]=DestroyString(utf8[i]); |
| 118 | utf8=(char **) RelinquishMagickMemory(utf8); |
| 119 | return(status); |
| 120 | } |
| 121 | #endif |