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
2dbe7093
Commit
2dbe7093
authored
Jul 12, 2018
by
Davis King
Browse files
merged
parents
d98d1ecc
71fab625
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
dlib/image_processing/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 @@
...
@@ -5,6 +5,7 @@
#include "../assert.h"
#include "../assert.h"
#include "../pixel.h"
#include "../pixel.h"
#include <type_traits>
namespace
dlib
namespace
dlib
{
{
...
@@ -136,6 +137,12 @@ 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
;
};
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
// UTILITIES TO MAKE ACCESSING IMAGE PIXELS SIMPLER
...
@@ -444,7 +451,8 @@ namespace dlib
...
@@ -444,7 +451,8 @@ namespace dlib
!*/
!*/
template
<
typename
image_type1
,
typename
image_type2
>
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_type1
&
img1
,
const
image_type2
&
img2
const
image_type2
&
img2
)
{
return
num_rows
(
img1
)
==
num_rows
(
img2
)
&&
num_columns
(
img1
)
==
num_columns
(
img2
);
}
)
{
return
num_rows
(
img1
)
==
num_rows
(
img2
)
&&
num_columns
(
img1
)
==
num_columns
(
img2
);
}
...
@@ -454,7 +462,8 @@ namespace dlib
...
@@ -454,7 +462,8 @@ namespace dlib
!*/
!*/
template
<
typename
image_type1
,
typename
image_type2
,
typename
...
T
>
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_type1
&
img1
,
const
image_type2
&
img2
,
const
image_type2
&
img2
,
T
&&
...
args
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