Cleaned up code and pushed is_rgb_image and is_grayscale_image somewhere more accessible.

This commit is contained in:
Davis King 2018-05-25 19:12:22 -04:00
parent 37d13ae88e
commit 233ae95c14
3 changed files with 8 additions and 12 deletions

View File

@ -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

View File

@ -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>
{

View File

@ -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 <