-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #535 from Kicer86/faces_detection_improvements
Faces detection improvements
- Loading branch information
Showing
105 changed files
with
2,859 additions
and
1,093 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
#ifndef DOWN_CAST_HPP | ||
#define DOWN_CAST_HPP | ||
|
||
#include <cassert> | ||
#include <type_traits> | ||
|
||
|
||
template<typename T, typename R> | ||
T down_cast(R* base) | ||
{ | ||
assert(dynamic_cast<T>(base) != nullptr); | ||
|
||
return static_cast<T>(base); | ||
} | ||
|
||
|
||
template<typename T, typename F> | ||
T safe_cast(const F& from) | ||
{ | ||
static_assert(sizeof(F) <= sizeof(T)); // TODO: handle size conversion when needed | ||
static_assert(std::is_nothrow_convertible_v<F, T>); | ||
|
||
if constexpr (std::is_signed_v<F> && std::is_unsigned_v<T>) // cast from signed to unsigned | ||
assert(from >= 0); | ||
|
||
return static_cast<T>(from); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,4 +121,4 @@ class Id | |
bool m_valid = false; | ||
}; | ||
|
||
#endif // ID_HPP | ||
#endif |
Oops, something went wrong.