ima-save.cc 373 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
  // \{
Guillaume Lazzara's avatar
Guillaume Lazzara committed
18
19
  io::pbm::save(ima, "../figures/ima_save.pbm");
  // \}
20
}