aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
blob: 563077346f753e519877f36c9bf8f61614fa3297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "imv.h"

#include "backend.h"

#include "backend_freeimage.h"
#include "backend_libtiff.h"
#include "backend_libpng.h"
#include "backend_libjpeg.h"
#include "backend_librsvg.h"

int main(int argc, char** argv)
{
  struct imv *imv = imv_create();

  if(!imv) {
    return 1;
  }

#ifdef IMV_BACKEND_FREEIMAGE
  imv_install_backend(imv, imv_backend_freeimage());
#endif

#ifdef IMV_BACKEND_LIBTIFF
  imv_install_backend(imv, imv_backend_libtiff());
#endif

#ifdef IMV_BACKEND_LIBPNG
  imv_install_backend(imv, imv_backend_libpng());
#endif

#ifdef IMV_BACKEND_LIBJPEG
  imv_install_backend(imv, imv_backend_libjpeg());
#endif

#ifdef IMV_BACKEND_LIBRSVG
  imv_install_backend(imv, imv_backend_librsvg());
#endif

  if(!imv_load_config(imv)) {
    imv_free(imv);
    return 1;
  }

  if(!imv_parse_args(imv, argc, argv)) {
    imv_free(imv);
    return 1;
  }

  int ret = imv_run(imv);

  imv_free(imv);

  return ret;
}

/* vim:set ts=2 sts=2 sw=2 et: */