imread.cpp 976 Bytes
Newer Older
1
2
3
#include <mln/io/imread.hpp>

#include <mln/core/image/ndbuffer_image.hpp>
4
5
6
#include <mln/io/private/cfitsio_plugin.hpp>
#include <mln/io/private/freeimage_plugin.hpp>
#include <mln/io/private/io.hpp>
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

namespace mln::io
{
  mln::ndbuffer_image imread(const std::string& filename)
  {
    mln::ndbuffer_image out;
    imread(filename, out);
    return out;
  }

  void imread(const std::string& filename, mln::ndbuffer_image& out)
  {
    internal::freeimage_reader_plugin p;
    internal::load(&p, filename.c_str(), out);
  }
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

  namespace fits
  {
    mln::ndbuffer_image imread(const std::string& filename, int ind = 0)
    {
      mln::ndbuffer_image out;
      imread(filename, out, ind);
      return out;
    }

    void                imread(const std::string& filename, mln::ndbuffer_image& out, int ind = 0)
    {
      internal::cfitsio_reader_plugin p(ind);
      mln::io::internal::load(&p, filename.c_str(), out);
    }
  } // namespace fits
} // namespace mln::io