mirror of https://github.com/davisking/dlib.git
Added image_traits specializations for const types because it makes
certain compiler errors you get when accidentally trying to mutate a const image a little easier to understand.
This commit is contained in:
parent
7cc653deda
commit
201c1601c8
|
@ -13,6 +13,11 @@ namespace dlib
|
|||
{
|
||||
typedef T pixel_type;
|
||||
};
|
||||
template <typename T, typename mm>
|
||||
struct image_traits<const array2d<T,mm> >
|
||||
{
|
||||
typedef T pixel_type;
|
||||
};
|
||||
|
||||
template <typename T, typename mm>
|
||||
inline long num_rows( const array2d<T,mm>& img) { return img.nr(); }
|
||||
|
|
|
@ -19,6 +19,17 @@ namespace dlib
|
|||
typedef T pixel_type;
|
||||
};
|
||||
|
||||
template <
|
||||
typename T,
|
||||
long NR,
|
||||
long NC,
|
||||
typename MM
|
||||
>
|
||||
struct image_traits<const matrix<T,NR,NC,MM> >
|
||||
{
|
||||
typedef T pixel_type;
|
||||
};
|
||||
|
||||
template <
|
||||
typename T,
|
||||
long NR,
|
||||
|
|
Loading…
Reference in New Issue