Milena (Olena)
User documentation 2.0a Id
Main Page
Related Pages
Modules
Namespaces
Classes
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerator
Groups
Pages
doc/examples/fill.cc
1
#include <mln/core/image/image2d.hh>
2
#include <mln/core/image/dmorph/image_if.hh>
3
4
#include <mln/value/rgb8.hh>
5
#include <mln/io/ppm/load.hh>
6
#include <mln/literal/colors.hh>
7
8
#include <tests/data.hh>
9
#include <doc/tools/sample_utils.hh>
10
11
// \{
12
template
<
typename
I>
13
void
fill(I& ima, mln_value(I) v)
14
{
15
mln_piter(I) p(ima.domain());
16
for_all(p)
17
ima(p) = v;
18
}
19
// \}
20
21
int
main()
22
{
23
using namespace
mln;
24
25
image2d<value::rgb8>
ima;
26
io::ppm::load
(ima, MLN_IMG_DIR
"/small.ppm"
);
27
28
// \{
29
box2d
b(20,20);
30
fill((ima | b).rw(),
literal::green
);
31
// \}
32
doc::ppmsave(ima,
"fill"
);
33
34
// \{
35
fill(ima,
literal::green
);
36
// \}
37
doc::ppmsave(ima,
"fill"
);
38
}
doc
examples
fill.cc
Generated on Thu Nov 8 2012 10:58:04 for Milena (Olena) by
1.8.2-20120930