mirror of https://github.com/davisking/dlib.git
Cleaned up code and pushed is_rgb_image and is_grayscale_image somewhere more accessible.
This commit is contained in:
parent
37d13ae88e
commit
233ae95c14
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
{
|
||||
|
|
|
@ -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 <
|
||||
|
|
Loading…
Reference in New Issue