@@ -20,13 +20,17 @@ template <typename Scalar_>
20
20
struct StdPointTraits <cv::Point_<Scalar_>> {
21
21
static_assert (sizeof (cv::Point_<Scalar_>) == (sizeof (Scalar_) * 2 ), " " );
22
22
23
+ // ! \brief The scalar type of point coordinates.
23
24
using ScalarType = Scalar_;
25
+ // ! \brief Compile time spatial dimension.
24
26
static constexpr int Dim = 2 ;
25
27
28
+ // ! \brief Returns a pointer to the coordinates of \p point.
26
29
inline static ScalarType const * Coords (cv::Point_<Scalar_> const & point) {
27
30
return &point.x ;
28
31
}
29
32
33
+ // ! \brief Returns the spatial dimension of a cv::Point_.
30
34
inline static int constexpr Sdim (cv::Point_<Scalar_> const &) { return Dim; }
31
35
};
32
36
@@ -35,26 +39,34 @@ template <typename Scalar_>
35
39
struct StdPointTraits <cv::Point3_<Scalar_>> {
36
40
static_assert (sizeof (cv::Point3_<Scalar_>) == (sizeof (Scalar_) * 3 ), " " );
37
41
42
+ // ! \brief The scalar type of point coordinates.
38
43
using ScalarType = Scalar_;
44
+ // ! \brief Compile time spatial dimension.
39
45
static constexpr int Dim = 3 ;
40
46
47
+ // ! \brief Returns a pointer to the coordinates of \p point.
41
48
inline static Scalar_ const * Coords (cv::Point3_<Scalar_> const & point) {
42
49
return &point.x ;
43
50
}
44
51
52
+ // ! \brief Returns the spatial dimension of a cv::Point3_.
45
53
inline static int constexpr Sdim (cv::Point3_<Scalar_> const &) { return Dim; }
46
54
};
47
55
48
56
// ! \brief StdPointTraits provides an interface for cv::Vec<>.
49
57
template <typename Scalar_, int Dim_>
50
58
struct StdPointTraits <cv::Vec<Scalar_, Dim_>> {
59
+ // ! \brief The scalar type of point coordinates.
51
60
using ScalarType = Scalar_;
61
+ // ! \brief Compile time spatial dimension.
52
62
static constexpr int Dim = Dim_;
53
63
64
+ // ! \brief Returns a pointer to the coordinates of \p point.
54
65
inline static Scalar_ const * Coords (cv::Vec<Scalar_, Dim_> const & point) {
55
66
return point.val ;
56
67
}
57
68
69
+ // ! \brief Returns the spatial dimension of a cv::Vec.
58
70
inline static int constexpr Sdim (cv::Vec<Scalar_, Dim_> const &) {
59
71
return Dim;
60
72
}
@@ -80,7 +92,7 @@ class CvMatRow {
80
92
// ! \brief Returns a pointer to this point's coordinates.
81
93
inline Scalar_ const * coords () const { return coords_; }
82
94
83
- // ! \brief Returns the amount of spatial dimensions of this point.
95
+ // ! \brief Returns the spatial dimension of this point.
84
96
inline int sdim () const {
85
97
assert (Dim == kDynamicDim || Dim == space.step1 ());
86
98
// TODO This run time version is actually quite expensive when used. Perhaps
@@ -96,13 +108,17 @@ class CvMatRow {
96
108
// ! \brief StdPointTraits provides an interface for CvMatRow<>.
97
109
template <typename Scalar_, int Dim_>
98
110
struct StdPointTraits <CvMatRow<Scalar_, Dim_>> {
111
+ // ! \brief The scalar type of point coordinates.
99
112
using ScalarType = Scalar_;
113
+ // ! \brief Compile time spatial dimension.
100
114
static constexpr int Dim = Dim_;
101
115
116
+ // ! \brief Returns a pointer to the coordinates of \p point.
102
117
inline static Scalar_ const * Coords (CvMatRow<Scalar_, Dim_> const & point) {
103
118
return point.coords ();
104
119
}
105
120
121
+ // ! \brief Returns the spatial dimension of \p point.
106
122
inline static int Sdim (CvMatRow<Scalar_, Dim_> const & point) {
107
123
return point.sdim ();
108
124
}
0 commit comments