26 #include <mln/io/off/load.hh>
27 #include <mln/io/vtk/save.hh>
29 #include <mln/literal/colors.hh>
31 #include "tests/data.hh"
38 const std::vector<mln_value(I)>& values)
42 mln_piter(I) p(ima.domain());
45 ima(p) = values[i++ % values.size()];
65 unsigned nfaces = bin_ima.
domain().cplx().nfaces();
69 std::vector<value::int_u8> values(nfaces);
70 for (
unsigned i = 0; i < nfaces; ++i)
72 io::vtk::save(make_image<int_u8_2complex_image3df>(bin_ima, values),
73 "save-tetrahedron-int_u8.vtk");
78 std::vector<unsigned> values(nfaces);
79 for (
unsigned i = 0; i < nfaces; ++i)
80 values[i] = mln_max(
unsigned) / nfaces * i;
81 io::vtk::save(make_image<unsigned_2complex_image3df>(bin_ima, values),
82 "save-tetrahedron-unsigned.vtk");
87 std::vector<float> values(nfaces);
88 for (
unsigned i = 0; i < nfaces; ++i)
89 values[i] = mln_max(
float) / nfaces * i;
90 io::vtk::save(make_image<float_2complex_image3df>(bin_ima, values),
91 "save-tetrahedron-float.vtk");
101 const unsigned colors_size =
sizeof(colors_array) /
sizeof(
value::rgb8);
102 std::vector<value::rgb8> colors (colors_array, colors_array + colors_size);
103 io::vtk::save(make_image<rgb8_2complex_image3df>(bin_ima, colors),
104 "save-tetrahedron-rgb8.vtk");