$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
parray-bbox.cc
1 #include <mln/core/alias/point2d.hh>
2 #include <mln/core/alias/box2d.hh>
3 #include <mln/geom/bbox.hh>
4 #include <mln/core/site_set/p_array.hh>
5 int main()
6 {
7  using namespace mln;
8 
9  // \{
10  p_array<point2d> arr;
11  arr.insert(point2d(1,0));
12  arr.insert(point2d(1,1));
13 
14  // The bbox is computed thanks to bbox() algorithm.
15  box2d box = geom::bbox(arr);
16  std::cout << box << std::endl;
17 
18  // p_array provides nsites(),
19  // it can be retrieved in constant time.
20  std::cout << "nsites = " << arr.nsites() << std::endl;
21  // \}
22 }