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
feeb9fae
Commit
feeb9fae
authored
May 18, 2013
by
Davis King
Browse files
Added global function versions of rectangle::intersect() and rectangle::area()
to make the overall rectangle API more uniform.
parent
d204408f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
dlib/geometry/rectangle.h
dlib/geometry/rectangle.h
+13
-0
dlib/geometry/rectangle_abstract.h
dlib/geometry/rectangle_abstract.h
+22
-0
No files found.
dlib/geometry/rectangle.h
View file @
feeb9fae
...
@@ -361,6 +361,19 @@ namespace dlib
...
@@ -361,6 +361,19 @@ namespace dlib
return
result
;
return
result
;
}
}
// ----------------------------------------------------------------------------------------
inline
rectangle
intersect
(
const
rectangle
&
a
,
const
rectangle
&
b
)
{
return
a
.
intersect
(
b
);
}
// ----------------------------------------------------------------------------------------
inline
unsigned
long
area
(
const
rectangle
&
a
)
{
return
a
.
area
();
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
inline
point
center
(
inline
point
center
(
...
...
dlib/geometry/rectangle_abstract.h
View file @
feeb9fae
...
@@ -477,6 +477,28 @@ namespace dlib
...
@@ -477,6 +477,28 @@ namespace dlib
and height)
and height)
!*/
!*/
// ----------------------------------------------------------------------------------------
inline
rectangle
intersect
(
const
rectangle
&
a
,
const
rectangle
&
b
);
/*!
ensures
- returns a.intersect(b)
(i.e. returns a rectangle representing the intersection of a and b)
!*/
// ----------------------------------------------------------------------------------------
inline
unsigned
long
area
(
const
rectangle
&
a
);
/*!
ensures
- returns a.area()
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
inline
const
rectangle
shrink_rect
(
inline
const
rectangle
shrink_rect
(
...
...
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