blob: 39ff936bffc278d29adf9379c711a6c1555e0bc0 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% %
4% %
5% %
6% CCCC OOO M M PPPP AAA RRRR EEEEE %
7% C O O MM MM P P A A R R E %
8% C O O M M M PPPP AAAAA RRRR EEE %
9% C O O M M P A A R R E %
10% CCCC OOO M M P A A R R EEEEE %
11% %
12% %
13% Image Comparison Utility %
14% %
15% %
16% Software Design %
17% John Cristy %
18% December 2003 %
19% %
20% %
cristy7e41fe82010-12-04 23:12:08 +000021% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
cristy3ed852e2009-09-05 21:47:34 +000022% dedicated to making software imaging solutions freely available. %
23% %
24% You may not use this file except in compliance with the License. You may %
25% obtain a copy of the License at %
26% %
27% http://www.imagemagick.org/script/license.php %
28% %
29% Unless required by applicable law or agreed to in writing, software %
30% distributed under the License is distributed on an "AS IS" BASIS, %
31% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
32% See the License for the specific language governing permissions and %
33% limitations under the License. %
34% %
35%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36%
37% The compare utility mathematically and visually annotates the difference
38% between an image and its reconstruction.
39%
40*/
41
42/*
43 Include declarations.
44*/
cristyee678102011-07-01 23:32:11 +000045#include "MagickWand/studio.h"
46#include "MagickWand/MagickWand.h"
cristy3ed852e2009-09-05 21:47:34 +000047
48/*
49%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50% %
51% %
52% %
53% M a i n %
54% %
55% %
56% %
57%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58%
59%
60*/
cristy9c88feb2011-09-21 13:06:09 +000061static int CompareMain(int argc,char **argv)
cristy3ed852e2009-09-05 21:47:34 +000062{
63 char
cristy3980b0d2009-10-25 14:37:13 +000064 *metadata;
cristy3ed852e2009-09-05 21:47:34 +000065
66 ExceptionInfo
67 *exception;
68
69 ImageInfo
70 *image_info;
71
72 MagickBooleanType
cristy3ed852e2009-09-05 21:47:34 +000073 status;
74
cristy3ed852e2009-09-05 21:47:34 +000075 MagickCoreGenesis(*argv,MagickTrue);
76 exception=AcquireExceptionInfo();
cristy3980b0d2009-10-25 14:37:13 +000077 image_info=AcquireImageInfo();
78 metadata=(char *) NULL;
cristy8a9106f2011-07-05 14:39:26 +000079 status=MagickCommandGenesis(image_info,CompareImagesCommand,argc,argv,
cristy3980b0d2009-10-25 14:37:13 +000080 &metadata,exception);
81 if (metadata != (char *) NULL)
82 metadata=DestroyString(metadata);
83 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(CompareMain(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=CompareMain(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