26 #ifndef MLN_IO_CLOUD_LOAD_HH
27 # define MLN_IO_CLOUD_LOAD_HH
44 # include <mln/core/concept/image.hh>
45 # include <mln/core/site_set/p_array.hh>
61 void load(p_array<P>& arr,
const std::string& filename);
64 # ifndef MLN_INCLUDE_ONLY
71 void load_data(p_array<P>& arr, std::ifstream& file)
74 while (std::getline(file, line))
76 algebra::vec<P::dim,float> v;
77 std::istringstream sline(line);
78 sline >> v[0] >> v[1] >> v[2];
90 trace::entering(
"mln::io::cloud::load");
93 mln_precondition(P::dim == 3u);
95 std::ifstream file(filename.c_str());
98 std::cerr <<
"error: cannot open file '" << filename <<
"'!";
102 internal::load_data(arr, file);
104 trace::exiting(
"mln::io::cloud::load");
108 # endif // ! MLN_INCLUDE_ONLY
116 #endif // ! MLN_IO_CLOUD_LOAD_HH