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
233ae95c
Commit
233ae95c
authored
May 25, 2018
by
Davis King
Browse files
Cleaned up code and pushed is_rgb_image and is_grayscale_image somewhere more accessible.
parent
37d13ae8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
dlib/image_processing/generic_image.h
dlib/image_processing/generic_image.h
+8
-0
dlib/image_saver/image_saver.h
dlib/image_saver/image_saver.h
+0
-7
dlib/image_transforms/interpolation.h
dlib/image_transforms/interpolation.h
+0
-5
No files found.
dlib/image_processing/generic_image.h
View file @
233ae95c
...
...
@@ -4,6 +4,7 @@
#define DLIB_GeNERIC_IMAGE_Hh_
#include "../assert.h"
#include "../pixel.h"
namespace
dlib
{
...
...
@@ -128,6 +129,13 @@ namespace dlib
image_traits<image_type>::pixel_type
!*/
template
<
typename
image_type
>
struct
is_rgb_image
{
const
static
bool
value
=
pixel_traits
<
typename
image_traits
<
image_type
>::
pixel_type
>::
rgb
;
};
template
<
typename
image_type
>
struct
is_grayscale_image
{
const
static
bool
value
=
pixel_traits
<
typename
image_traits
<
image_type
>::
pixel_type
>::
grayscale
;
};
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// UTILITIES TO MAKE ACCESSING IMAGE PIXELS SIMPLER
...
...
dlib/image_saver/image_saver.h
View file @
233ae95c
...
...
@@ -423,13 +423,6 @@ namespace dlib
}
};
template
<
typename
image_type
>
struct
is_rgb_image
{
typedef
typename
image_traits
<
image_type
>::
pixel_type
pixel_type
;
const
static
bool
value
=
pixel_traits
<
pixel_type
>::
rgb
;
};
template
<
typename
image_type
>
struct
save_dng_helper
<
image_type
,
typename
enable_if
<
is_rgb_image
<
image_type
>
>::
type
>
{
...
...
dlib/image_transforms/interpolation.h
View file @
233ae95c
...
...
@@ -705,11 +705,6 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
>
struct
is_rgb_image
{
const
static
bool
value
=
pixel_traits
<
typename
image_traits
<
image_type
>::
pixel_type
>::
rgb
;
};
template
<
typename
image_type
>
struct
is_grayscale_image
{
const
static
bool
value
=
pixel_traits
<
typename
image_traits
<
image_type
>::
pixel_type
>::
grayscale
;
};
// This is an optimized version of resize_image for the case where bilinear
// interpolation is used.
template
<
...
...
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