blob: 0a36c80a24da06517e209fd8d3571677de83e5e1 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% %
4% %
5% %
6% IIIII M M PPPP OOO RRRR TTTTT %
7% I MM MM P P O O R R T %
8% I M M M PPPP O O RRRR T %
9% I M M P O O R R T %
10% IIIII M M P OOO R R T %
11% %
12% %
13% Import image to a machine independent format. %
14% %
15% Software Design %
16% John Cristy %
17% July 1992 %
18% %
19% %
cristy7e41fe82010-12-04 23:12:08 +000020% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
cristy3ed852e2009-09-05 21:47:34 +000021% 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% Import is an X Window System window dumping utility. Import allows X
37% users to store window images in a specially formatted dump file. This
38% file can then be read by the Display utility for redisplay, printing,
39% editing, formatting, archiving, image processing, etc. The target
40% window can be specified by id or name or be selected by clicking the
41% mouse in the desired window. The keyboard bell is rung once at the
42% beginning of the dump and twice when the dump is completed.
43%
44%
45*/
46
47/*
48 Include declarations.
49*/
cristyee678102011-07-01 23:32:11 +000050#include "MagickWand/studio.h"
51#include "MagickWand/MagickWand.h"
cristy3ed852e2009-09-05 21:47:34 +000052
53/*
54%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55% %
56% %
57% %
cristy3980b0d2009-10-25 14:37:13 +000058% M a i n %
cristy3ed852e2009-09-05 21:47:34 +000059% %
60% %
61% %
62%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63%
64%
65*/
cristy3980b0d2009-10-25 14:37:13 +000066
cristy9c88feb2011-09-21 13:06:09 +000067static int ImportMain(int argc,char **argv)
cristy3ed852e2009-09-05 21:47:34 +000068{
cristy3ed852e2009-09-05 21:47:34 +000069 ExceptionInfo
70 *exception;
71
72 ImageInfo
73 *image_info;
74
75 MagickBooleanType
cristy3ed852e2009-09-05 21:47:34 +000076 status;
77
cristy3ed852e2009-09-05 21:47:34 +000078 MagickCoreGenesis(*argv,MagickTrue);
79 exception=AcquireExceptionInfo();
cristy3980b0d2009-10-25 14:37:13 +000080 image_info=AcquireImageInfo();
cristy3980b0d2009-10-25 14:37:13 +000081 status=MagickCommandGenesis(image_info,ImportImageCommand,argc,argv,
cristye99d1c02009-11-03 02:17:57 +000082 (char **) NULL,exception);
cristy3980b0d2009-10-25 14:37:13 +000083 image_info=DestroyImageInfo(image_info);
cristy3ed852e2009-09-05 21:47:34 +000084 exception=DestroyExceptionInfo(exception);
85 MagickCoreTerminus();
cristy3980b0d2009-10-25 14:37:13 +000086 return(status);
cristy3ed852e2009-09-05 21:47:34 +000087}
cristy66f9c3c2011-08-13 17:12:28 +000088
89#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__)
90int main(int argc,char **argv)
91{
92 return(ImportMain(argc,argv));
93}
94#else
95int wmain(int argc,wchar_t *argv[])
96{
97 char
98 **utf8;
99
100 int
101 status;
102
103 register int
104 i;
105
106 utf8=NTArgvToUTF8(argc,argv);
107 status=ImportMain(argc,utf8);
108 for (i=0; i < argc; i++)
109 utf8[i]=DestroyString(utf8[i]);
110 utf8=(char **) RelinquishMagickMemory(utf8);
111 return(status);
112}
113#endif