ima-save.cc 470 Bytes
Newer Older
1
2
3
#include <mln/core/image/image2d.hh>
#include <mln/io/pbm/save.hh>
#include <mln/make/image.hh>
4
5
int main()
{
Guillaume Lazzara's avatar
Guillaume Lazzara committed
6
7
8
9
10
11
12
13
14
15
  using namespace mln;

  bool vals[5][5] = {
    {1, 0, 1, 0, 0},
    {0, 1, 0, 1, 0},
    {1, 0, 1, 0, 0},
    {0, 1, 0, 1, 0},
    {0, 1, 0, 1, 0}
  };
  image2d<bool> ima = make::image(vals);
16

Guillaume Lazzara's avatar
Guillaume Lazzara committed
17
  // \{
18
19
20
  /* FIXME: Hard-coded paths are bad!  Use something like
     milena/tests/data.hh.in instead.  */
  io::pbm::save(ima, "figures/ima_save.pbm");
Guillaume Lazzara's avatar
Guillaume Lazzara committed
21
  // \}
22
}