File: test_imageio.cpp

package info (click to toggle)
cgal 6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144,912 kB
  • sloc: cpp: 810,858; ansic: 208,477; sh: 493; python: 411; makefile: 286; javascript: 174
file content (68 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download | duplicates (4)
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
57
58
59
60
61
62
63
64
65
66
67
68
#include <CGAL/ImageIO.h>
#include <iostream>

#define SHOW(attribut) "\n  "#attribut": " << image->attribut
#define SHOWENUM(enumitem) #enumitem"=" << enumitem

int main(int argc, char** argv)
{
  if(argc > 1)
  {
    _image* image = ::_readImage(argv[1]);
    if(image)
    {
      std::cerr
        << "Image infos:"
        << "\ndimensions"
        << SHOW(xdim)
        << SHOW(ydim)
        << SHOW(zdim)
        << SHOW(vdim)
        << "\nvoxel size"
        << SHOW(vx)
        << SHOW(vy)
        << SHOW(vz)
        <<"\nimage offset"
        << SHOW(tx)
        << SHOW(ty)
        << SHOW(tz)
        <<"\nrotation vector"
        << SHOW(rx)
        << SHOW(ry)
        << SHOW(rz)
        <<"\nimage center"
        << SHOW(cx)
        << SHOW(cy)
        << SHOW(cz)
        << "\nword size (in bytes)"
        << SHOW(wdim)
        << "\nimage format"
        << "\n  " << image->imageFormat->realName
        << " (extension list: " << image->imageFormat->fileExtension << ")"
        << "\nvectors interlaced or not ("
        << SHOWENUM(VM_INTERLACED) << ", "
        << SHOWENUM(VM_NON_INTERLACED) << ", "
        << SHOWENUM(VM_SCALAR) << ")"
        << SHOW(vectMode)
        << "\nword kind ("
        << SHOWENUM(WK_FIXED) << ", "
        << SHOWENUM(WK_FLOAT) << ", "
        << SHOWENUM(WK_UNKNOWN)
        << ")"
        << SHOW(wordKind)
        << "\nword sign ("
        << SHOWENUM(SGN_SIGNED) << ", "
        << SHOWENUM(SGN_UNSIGNED) << ", "
        << SHOWENUM(SGN_UNKNOWN)
        << ")"
        << SHOW(sign)
        << "\n";

      ::_freeImage(image);
    }
    else
      std::cerr << "\"" << argv[1] << "\" is not a supported file.\n";
  }
  else
    ::printSupportedFileFormat();
}