27 #ifndef MLN_IO_CLOUD_LOAD_HH
28 # define MLN_IO_CLOUD_LOAD_HH
45 # include <mln/core/concept/image.hh>
46 # include <mln/core/site_set/p_array.hh>
68 # ifndef MLN_INCLUDE_ONLY
75 void load_data(p_array<P>& arr, std::ifstream& file)
78 while (std::getline(file, line))
80 algebra::vec<P::dim,float> v;
81 std::istringstream sline(line);
82 sline >> v[0] >> v[1] >> v[2];
94 mln_trace(
"mln::io::cloud::load");
97 mln_precondition(P::dim == 3u);
99 std::ifstream file(filename.c_str());
102 std::cerr <<
"error: cannot open file '" << filename <<
"'!";
106 internal::load_data(arr, file);
111 # endif // ! MLN_INCLUDE_ONLY
119 #endif // ! MLN_IO_CLOUD_LOAD_HH