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
2dbe7093
Commit
2dbe7093
authored
Jul 12, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
d98d1ecc
71fab625
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
generic_image.h
dlib/image_processing/generic_image.h
+11
-2
No files found.
dlib/image_processing/generic_image.h
View file @
2dbe7093
...
...
@@ -5,6 +5,7 @@
#include "../assert.h"
#include "../pixel.h"
#include <type_traits>
namespace
dlib
{
...
...
@@ -136,6 +137,12 @@ namespace dlib
struct
is_grayscale_image
{
const
static
bool
value
=
pixel_traits
<
typename
image_traits
<
image_type
>::
pixel_type
>::
grayscale
;
};
// Check if T has image_traits<T> defined for it.
template
<
typename
T
,
typename
enabled
=
void
>
struct
is_image_type
:
public
std
::
false_type
{};
template
<
typename
T
>
struct
is_image_type
<
T
,
image_traits
<
typename
std
::
decay
<
T
>::
type
>>
:
public
std
::
true_type
{};
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// UTILITIES TO MAKE ACCESSING IMAGE PIXELS SIMPLER
...
...
@@ -444,7 +451,8 @@ namespace dlib
!*/
template
<
typename
image_type1
,
typename
image_type2
>
bool
have_same_dimensions
(
typename
std
::
enable_if
<
is_image_type
<
image_type1
>::
value
&&
is_image_type
<
image_type2
>::
value
,
bool
>::
type
have_same_dimensions
(
const
image_type1
&
img1
,
const
image_type2
&
img2
)
{
return
num_rows
(
img1
)
==
num_rows
(
img2
)
&&
num_columns
(
img1
)
==
num_columns
(
img2
);
}
...
...
@@ -454,7 +462,8 @@ namespace dlib
!*/
template
<
typename
image_type1
,
typename
image_type2
,
typename
...
T
>
bool
have_same_dimensions
(
typename
std
::
enable_if
<
is_image_type
<
image_type1
>::
value
&&
is_image_type
<
image_type2
>::
value
,
bool
>::
type
have_same_dimensions
(
const
image_type1
&
img1
,
const
image_type2
&
img2
,
T
&&
...
args
...
...
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