DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ContourHelper.ih
1 
29 
30 // IMPLEMENTATION of inline methods.
32 
34 #include <cstdlib>
36 
37 
38 
40 // Implementation of inline methods //
41 
42 
43 
44 Z2i::Point
45 inline
46 ContourHelper::getMeanPoint(vector<Z2i::Point> contour){
47  Z2i::Point ptMean;
48  for(unsigned int i =0; i<contour.size(); i++){
49  ptMean[0]+=contour.at(i)[0];
50  ptMean[1]+=contour.at(i)[1];
51  }
52  ptMean[0] /= (int)contour.size();
53  ptMean[1] /= (int)contour.size();
54  return ptMean;
55 }
56 
57 
58 
60 // Implementation of inline functions and external operators //
61 
68 inline
69 std::ostream&
70 DGtal::operator<< ( std::ostream & out,
71  const ContourHelper & object )
72 {
73  object.selfDisplay ( out );
74  return out;
75 }
76 
77 // //
79 
80