@@ -20,13 +20,17 @@ template <typename Scalar_>
2020struct StdPointTraits <cv::Point_<Scalar_>> {
2121 static_assert (sizeof (cv::Point_<Scalar_>) == (sizeof (Scalar_) * 2 ), " " );
2222
23+ // ! \brief The scalar type of point coordinates.
2324 using ScalarType = Scalar_;
25+ // ! \brief Compile time spatial dimension.
2426 static constexpr int Dim = 2 ;
2527
28+ // ! \brief Returns a pointer to the coordinates of \p point.
2629 inline static ScalarType const * Coords (cv::Point_<Scalar_> const & point) {
2730 return &point.x ;
2831 }
2932
33+ // ! \brief Returns the spatial dimension of a cv::Point_.
3034 inline static int constexpr Sdim (cv::Point_<Scalar_> const &) { return Dim; }
3135};
3236
@@ -35,26 +39,34 @@ template <typename Scalar_>
3539struct StdPointTraits <cv::Point3_<Scalar_>> {
3640 static_assert (sizeof (cv::Point3_<Scalar_>) == (sizeof (Scalar_) * 3 ), " " );
3741
42+ // ! \brief The scalar type of point coordinates.
3843 using ScalarType = Scalar_;
44+ // ! \brief Compile time spatial dimension.
3945 static constexpr int Dim = 3 ;
4046
47+ // ! \brief Returns a pointer to the coordinates of \p point.
4148 inline static Scalar_ const * Coords (cv::Point3_<Scalar_> const & point) {
4249 return &point.x ;
4350 }
4451
52+ // ! \brief Returns the spatial dimension of a cv::Point3_.
4553 inline static int constexpr Sdim (cv::Point3_<Scalar_> const &) { return Dim; }
4654};
4755
4856// ! \brief StdPointTraits provides an interface for cv::Vec<>.
4957template <typename Scalar_, int Dim_>
5058struct StdPointTraits <cv::Vec<Scalar_, Dim_>> {
59+ // ! \brief The scalar type of point coordinates.
5160 using ScalarType = Scalar_;
61+ // ! \brief Compile time spatial dimension.
5262 static constexpr int Dim = Dim_;
5363
64+ // ! \brief Returns a pointer to the coordinates of \p point.
5465 inline static Scalar_ const * Coords (cv::Vec<Scalar_, Dim_> const & point) {
5566 return point.val ;
5667 }
5768
69+ // ! \brief Returns the spatial dimension of a cv::Vec.
5870 inline static int constexpr Sdim (cv::Vec<Scalar_, Dim_> const &) {
5971 return Dim;
6072 }
@@ -80,7 +92,7 @@ class CvMatRow {
8092 // ! \brief Returns a pointer to this point's coordinates.
8193 inline Scalar_ const * coords () const { return coords_; }
8294
83- // ! \brief Returns the amount of spatial dimensions of this point.
95+ // ! \brief Returns the spatial dimension of this point.
8496 inline int sdim () const {
8597 assert (Dim == kDynamicDim || Dim == space.step1 ());
8698 // TODO This run time version is actually quite expensive when used. Perhaps
@@ -96,13 +108,17 @@ class CvMatRow {
96108// ! \brief StdPointTraits provides an interface for CvMatRow<>.
97109template <typename Scalar_, int Dim_>
98110struct StdPointTraits <CvMatRow<Scalar_, Dim_>> {
111+ // ! \brief The scalar type of point coordinates.
99112 using ScalarType = Scalar_;
113+ // ! \brief Compile time spatial dimension.
100114 static constexpr int Dim = Dim_;
101115
116+ // ! \brief Returns a pointer to the coordinates of \p point.
102117 inline static Scalar_ const * Coords (CvMatRow<Scalar_, Dim_> const & point) {
103118 return point.coords ();
104119 }
105120
121+ // ! \brief Returns the spatial dimension of \p point.
106122 inline static int Sdim (CvMatRow<Scalar_, Dim_> const & point) {
107123 return point.sdim ();
108124 }
0 commit comments