$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ima2d-5.cc
1 #include <mln/core/image/image2d.hh>
2 int main()
3 {
4  using namespace mln;
5 
6  // \{
7  image2d<int> ima1(box2d(2, 3));
8  image2d<int> ima2;
9  point2d p(1,2);
10 
11  ima2 = ima1; // ima1.id() == ima2.id()
12  // and both point to the same memory area.
13 
14  ima2(p) = 2; // ima1 is modified as well.
15 
16  // prints "2 - 2"
17  std::cout << ima2(p) << " - " << ima1(p) << std::endl;
18  // prints "true"
19  std::cout << (ima2.id_() == ima1.id_()) << std::endl;
20  // \}
21 }