Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
908f5540
Commit
908f5540
authored
Jun 02, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make arrays of points and rectangles constructable with a size in the Python API.
parent
44c06150
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
rectangles.cpp
tools/python/src/rectangles.cpp
+2
-0
vector.cpp
tools/python/src/vector.cpp
+2
-0
No files found.
tools/python/src/rectangles.cpp
View file @
908f5540
...
...
@@ -241,6 +241,7 @@ ensures \n\
{
typedef
std
::
vector
<
rectangle
>
type
;
py
::
bind_vector
<
type
>
(
m
,
"rectangles"
,
"An array of rectangle objects."
)
.
def
(
py
::
init
<
size_t
>
(),
py
::
arg
(
"initial_size"
))
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
rectangle
>
)
...
...
@@ -250,6 +251,7 @@ ensures \n\
{
typedef
std
::
vector
<
std
::
vector
<
rectangle
>>
type
;
py
::
bind_vector
<
type
>
(
m
,
"rectangless"
,
"An array of arrays of rectangle objects."
)
.
def
(
py
::
init
<
size_t
>
(),
py
::
arg
(
"initial_size"
))
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
rectangle
>
)
...
...
tools/python/src/vector.cpp
View file @
908f5540
...
...
@@ -438,6 +438,7 @@ void bind_vector(py::module& m)
{
typedef
std
::
vector
<
point
>
type
;
py
::
bind_vector
<
type
>
(
m
,
"points"
,
"An array of point objects."
)
.
def
(
py
::
init
<
size_t
>
(),
py
::
arg
(
"initial_size"
))
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
point
>
)
...
...
@@ -467,6 +468,7 @@ void bind_vector(py::module& m)
{
typedef
std
::
vector
<
dpoint
>
type
;
py
::
bind_vector
<
type
>
(
m
,
"dpoints"
,
"An array of dpoint objects."
)
.
def
(
py
::
init
<
size_t
>
(),
py
::
arg
(
"initial_size"
))
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
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