main.cc 1.35 KB
Newer Older
Guillaume Lazzara's avatar
Guillaume Lazzara committed
1
2
// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
// (LRDE)
3
//
4
// This file is part of Olena.
5
//
6
7
8
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
9
//
10
11
12
13
// Olena is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
14
//
15
16
// You should have received a copy of the GNU General Public License
// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
17
18

#include <QtGui>
Florent D'Halluin's avatar
Florent D'Halluin committed
19
20
#include <iostream>

Guillaume Lazzara's avatar
Guillaume Lazzara committed
21
#undef MLN_WO_GLOBAL_VARS
22
#include "viewer.hh"
Guillaume Lazzara's avatar
Guillaume Lazzara committed
23
24
25
26
#include <mln/labeling/colorize.hh>
#include <mln/math/pi.hh>
#include <mln/io/magick/load.hh>
#include <scribo/make/debug_filename.hh>
Guillaume Lazzara's avatar
Guillaume Lazzara committed
27
#include <mln/debug/filename.hh>
Guillaume Lazzara's avatar
Guillaume Lazzara committed
28
#include <mln/literal/colors.hh>
29
30
31

int main(int argc, char** argv)
{
Florent D'Halluin's avatar
Florent D'Halluin committed
32
33
34
35
36
37
38
39
40
  if (argc > 2 ||
      (argc == 2 &&
       (QString(argv[1]) == "--help" || QString(argv[1]) == "-h")))
  {
    std::cout << "Usage:" << std::endl
	      << argv[0] << " <image dir>" << std::endl;
    return 0;
  }

41
42
  Magick::InitializeMagick(*argv);

43
44
45
  Viewer* viewer = Viewer::Instance(argc, argv);

  if (!viewer)
Florent D'Halluin's avatar
Florent D'Halluin committed
46
    return -1;
47
48
49

  return viewer->exec();
}