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
34265709
Commit
34265709
authored
May 28, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More overloads for rectangle.contains()
parent
4f2f565c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
rectangles.cpp
tools/python/src/rectangles.cpp
+6
-4
No files found.
tools/python/src/rectangles.cpp
View file @
34265709
...
...
@@ -41,8 +41,8 @@ point center(const rect_type& r) { return center(r); }
template
<
typename
rect_type
>
point
dcenter
(
const
rect_type
&
r
)
{
return
dcenter
(
r
);
}
template
<
typename
rect_type
>
bool
contains
(
const
rect_type
&
r
,
const
p
oint
&
p
)
{
return
r
.
contains
(
p
);
}
template
<
typename
rect_type
,
typename
ptype
>
bool
contains
(
const
rect_type
&
r
,
const
p
type
&
p
)
{
return
r
.
contains
(
p
);
}
template
<
typename
rect_type
>
bool
contains_xy
(
const
rect_type
&
r
,
const
long
x
,
const
long
y
)
{
return
r
.
contains
(
point
(
x
,
y
));
}
...
...
@@ -113,7 +113,8 @@ void bind_rectangles(py::module& m)
.
def
(
"is_empty"
,
&::
is_empty
<
type
>
)
.
def
(
"center"
,
&::
center
<
type
>
)
.
def
(
"dcenter"
,
&::
dcenter
<
type
>
)
.
def
(
"contains"
,
&::
contains
<
type
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains
<
type
,
point
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains
<
type
,
dpoint
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains_xy
<
type
>
,
py
::
arg
(
"x"
),
py
::
arg
(
"y"
))
.
def
(
"contains"
,
&::
contains_rec
<
type
>
,
py
::
arg
(
"rectangle"
))
.
def
(
"intersect"
,
&::
intersect
<
type
>
,
py
::
arg
(
"rectangle"
))
...
...
@@ -148,7 +149,8 @@ void bind_rectangles(py::module& m)
.
def
(
"tr_corner"
,
&
type
::
tr_corner
,
"Returns the top right corner of the rectangle."
)
.
def
(
"bl_corner"
,
&
type
::
bl_corner
,
"Returns the bottom left corner of the rectangle."
)
.
def
(
"br_corner"
,
&
type
::
br_corner
,
"Returns the bottom right corner of the rectangle."
)
.
def
(
"contains"
,
&::
contains
<
type
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains
<
type
,
point
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains
<
type
,
dpoint
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains_xy
<
type
>
,
py
::
arg
(
"x"
),
py
::
arg
(
"y"
))
.
def
(
"contains"
,
&::
contains_rec
<
type
>
,
py
::
arg
(
"rectangle"
))
.
def
(
"intersect"
,
&::
intersect
<
type
>
,
py
::
arg
(
"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