blob: 2921b76ba7f65faeefcc493e86f02f2003cf3d7f [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% %
4% %
5% %
6% SSSSS TTTTT RRRR EEEEE AAA M M %
7% SS T R R E A A MM MM %
8% SSS T RRRR EEE AAAAA M M M %
9% SS T R R E A A M M %
10% SSSSS T R R EEEEE A A M M %
11% %
12% %
13% Stream image to a raw image 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% Stream is a lightweight utility designed to extract pixels from large image
37% files to a raw format using a minimum of system resources. The entire
38% image or any regular portion of the image can be extracted.
39%
40%
41*/
42
43/*
44 Include declarations.
45*/
cristyee678102011-07-01 23:32:11 +000046#include "MagickWand/studio.h"
47#include "MagickWand/MagickWand.h"
cristy3ed852e2009-09-05 21:47:34 +000048
49/*
50%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51% %
52% %
53% %
cristy3980b0d2009-10-25 14:37:13 +000054% M a i n %
cristy3ed852e2009-09-05 21:47:34 +000055% %
56% %
57% %
58%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59%
60%
61*/
cristy66f9c3c2011-08-13 17:12:28 +000062
cristy9c88feb2011-09-21 13:06:09 +000063static int StreamMain(int argc,char **argv)
cristy3ed852e2009-09-05 21:47:34 +000064{
cristy3ed852e2009-09-05 21:47:34 +000065 ExceptionInfo
66 *exception;
67
68 ImageInfo
69 *image_info;
70
71 MagickBooleanType
cristy3ed852e2009-09-05 21:47:34 +000072 status;
73
cristy3ed852e2009-09-05 21:47:34 +000074 MagickCoreGenesis(*argv,MagickTrue);
75 exception=AcquireExceptionInfo();
cristy3980b0d2009-10-25 14:37:13 +000076 image_info=AcquireImageInfo();
cristy3980b0d2009-10-25 14:37:13 +000077 status=MagickCommandGenesis(image_info,StreamImageCommand,argc,argv,
cristy4e1dff62009-10-25 20:36:03 +000078 (char **) NULL,exception);
cristy3980b0d2009-10-25 14:37:13 +000079 image_info=DestroyImageInfo(image_info);
cristy3ed852e2009-09-05 21:47:34 +000080 exception=DestroyExceptionInfo(exception);
81 MagickCoreTerminus();
cristy3980b0d2009-10-25 14:37:13 +000082 return(status);
cristy3ed852e2009-09-05 21:47:34 +000083}
cristy66f9c3c2011-08-13 17:12:28 +000084
85#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__)
86int main(int argc,char **argv)
87{
88 return(StreamMain(argc,argv));
89}
90#else
91int wmain(int argc,wchar_t *argv[])
92{
93 char
94 **utf8;
95
96 int
97 status;
98
99 register int
100 i;
101
102 utf8=NTArgvToUTF8(argc,argv);
103 status=StreamMain(argc,utf8);
104 for (i=0; i < argc; i++)
105 utf8[i]=DestroyString(utf8[i]);
106 utf8=(char **) RelinquishMagickMemory(utf8);
107 return(status);
108}
109#endif