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
1a3f8d5b
Commit
1a3f8d5b
authored
May 26, 2018
by
Davis King
Browse files
Added center() and more overloads of centered_rect() to the Python API.
parent
8516442a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
tools/python/src/rectangles.cpp
tools/python/src/rectangles.cpp
+18
-0
No files found.
tools/python/src/rectangles.cpp
View file @
1a3f8d5b
...
@@ -271,6 +271,24 @@ ensures \n\
...
@@ -271,6 +271,24 @@ ensures \n\
m
.
def
(
"centered_rects"
,
[](
const
std
::
vector
<
point
>&
p
,
unsigned
long
width
,
unsigned
long
height
)
{
m
.
def
(
"centered_rects"
,
[](
const
std
::
vector
<
point
>&
p
,
unsigned
long
width
,
unsigned
long
height
)
{
return
centered_rects
(
p
,
width
,
height
);
},
return
centered_rects
(
p
,
width
,
height
);
},
py
::
arg
(
"pts"
),
py
::
arg
(
"width"
),
py
::
arg
(
"height"
));
py
::
arg
(
"pts"
),
py
::
arg
(
"width"
),
py
::
arg
(
"height"
));
m
.
def
(
"centered_rect"
,
[](
const
dpoint
&
p
,
unsigned
long
width
,
unsigned
long
height
)
{
return
centered_rect
(
p
,
width
,
height
);
},
py
::
arg
(
"p"
),
py
::
arg
(
"width"
),
py
::
arg
(
"height"
));
m
.
def
(
"centered_rect"
,
[](
const
rectangle
&
rect
,
unsigned
long
width
,
unsigned
long
height
)
{
return
centered_rect
(
rect
,
width
,
height
);
},
py
::
arg
(
"rect"
),
py
::
arg
(
"width"
),
py
::
arg
(
"height"
));
m
.
def
(
"centered_rect"
,
[](
const
drectangle
&
rect
,
unsigned
long
width
,
unsigned
long
height
)
{
return
centered_rect
(
rect
,
width
,
height
);
},
py
::
arg
(
"rect"
),
py
::
arg
(
"width"
),
py
::
arg
(
"height"
));
m
.
def
(
"center"
,
[](
const
rectangle
&
rect
){
return
center
(
rect
);
},
py
::
arg
(
"rect"
),
" returns the center of the given rectangle"
);
m
.
def
(
"center"
,
[](
const
drectangle
&
rect
){
return
center
(
rect
);
},
py
::
arg
(
"rect"
),
" returns the center of the given rectangle"
);
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
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