Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
c1820284
Commit
c1820284
authored
May 20, 2018
by
Davis King
Browse files
Made point and dpoint constructable from each other.
parent
f917f5e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
tools/python/src/vector.cpp
tools/python/src/vector.cpp
+2
-0
No files found.
tools/python/src/vector.cpp
View file @
c1820284
...
...
@@ -181,6 +181,7 @@ void bind_vector(py::module& m)
typedef
point
type
;
py
::
class_
<
type
>
(
m
,
"point"
,
"This object represents a single point of integer coordinates that maps directly to a dlib::point."
)
.
def
(
py
::
init
<
long
,
long
>
(),
py
::
arg
(
"x"
),
py
::
arg
(
"y"
))
.
def
(
py
::
init
<
dpoint
>
(),
py
::
arg
(
"p"
))
.
def
(
"__repr__"
,
&
point__repr__
)
.
def
(
"__str__"
,
&
point__str__
)
.
def_property
(
"x"
,
&
point_x
,
[](
point
&
p
,
long
x
){
p
.
x
()
=
x
;},
"The x-coordinate of the point."
)
...
...
@@ -200,6 +201,7 @@ void bind_vector(py::module& m)
typedef
dpoint
type
;
py
::
class_
<
type
>
(
m
,
"dpoint"
,
"This object represents a single point of floating point coordinates that maps directly to a dlib::dpoint."
)
.
def
(
py
::
init
<
double
,
double
>
(),
py
::
arg
(
"x"
),
py
::
arg
(
"y"
))
.
def
(
py
::
init
<
point
>
(),
py
::
arg
(
"p"
))
.
def
(
"__repr__"
,
&
dpoint__repr__
)
.
def
(
"__str__"
,
&
dpoint__str__
)
.
def_property
(
"x"
,
&
dpoint_x
,
[](
dpoint
&
p
,
double
x
){
p
.
x
()
=
x
;},
"The x-coordinate of the dpoint."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment