Milena (Olena)
User documentation 2.0a Id
Main Page
Related Pages
Modules
Namespaces
Classes
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerator
Groups
Pages
ima2d-3.cc
1
#include <mln/core/image/image2d.hh>
2
#include <mln/core/alias/box2d.hh>
3
#include <mln/opt/at.hh>
4
#include <mln/value/int_u8.hh>
5
6
int
main()
7
{
8
using namespace
mln;
9
10
// \{
11
box2d
b(2,3);
12
image2d<value::int_u8>
ima(b);
13
14
// On image2d, Site <=> point2d
15
point2d
p(1, 2);
16
17
// Associate '9' as value for the site/point2d (1,2).
18
// The value is returned by reference and can be changed.
19
opt::at
(ima, 1,2) = 9;
20
std::cout <<
"opt::at(ima, 1,2) = "
<<
opt::at
(ima, 1,2)
21
<< std::endl;
22
std::cout <<
"ima(p) = "
<< ima(p) << std::endl;
23
24
std::cout <<
"---"
<< std::endl;
25
26
27
// Associate '2' as value for the site/point2d (1,2).
28
// The value is returned by reference
29
// and can be changed as well.
30
ima(p) = 2;
31
std::cout <<
"opt::at(ima, 1,2) = "
<<
opt::at
(ima, 1,2)
32
<< std::endl;
33
std::cout <<
"ima(p) = "
<< ima(p) << std::endl;
34
// \}
35
}
doc
examples
ima2d-3.cc
Generated on Thu Nov 8 2012 10:58:07 for Milena (Olena) by
1.8.2-20120930