Commit 4e338db7 authored by Davis King's avatar Davis King

changed to avoid compiler warnings in visual studio

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403969
parent a69f997b
......@@ -492,11 +492,32 @@ namespace dlib
!*/
template <typename T, typename P>
typename enable_if_c<sizeof(P) == sizeof(T), bool>::type less_or_equal_to_max (
typename enable_if_c<sizeof(P) == sizeof(T) && pixel_traits<T>::is_unsigned == pixel_traits<P>::is_unsigned, bool>::type less_or_equal_to_max (
const P& p
)
{
return p <= pixel_traits<T>::max();
return p <= pixel_traits<T>::max();
}
template <typename T, typename P>
typename enable_if_c<sizeof(P) == sizeof(T) && pixel_traits<T>::is_unsigned && !pixel_traits<P>::is_unsigned, bool>::type less_or_equal_to_max (
const P& p
)
{
if (p <= 0)
return true;
else if (static_cast<T>(p) <= pixel_traits<T>::max())
return true;
else
return false;
}
template <typename T, typename P>
typename enable_if_c<sizeof(P) == sizeof(T) && !pixel_traits<T>::is_unsigned && pixel_traits<P>::is_unsigned, bool>::type less_or_equal_to_max (
const P& p
)
{
return p <= static_cast<P>(pixel_traits<T>::max());
}
template <typename T, typename P>
......@@ -507,8 +528,10 @@ namespace dlib
return p <= static_cast<P>(pixel_traits<T>::max());
}
// -----------------------------
template <typename T, typename P>
typename enable_if<is_unsigned_type<P>, bool >::type greater_or_equal_to_min (
typename enable_if_c<pixel_traits<P>::is_unsigned, bool >::type greater_or_equal_to_min (
const P&
) { return true; }
/*!
......@@ -517,12 +540,21 @@ namespace dlib
!*/
template <typename T, typename P>
typename disable_if<is_unsigned_type<P>, bool >::type greater_or_equal_to_min (
typename enable_if_c<!pixel_traits<P>::is_unsigned && pixel_traits<T>::is_unsigned, bool >::type greater_or_equal_to_min (
const P& p
)
{
return p >= 0;
}
template <typename T, typename P>
typename enable_if_c<!pixel_traits<P>::is_unsigned && !pixel_traits<T>::is_unsigned, bool >::type greater_or_equal_to_min (
const P& p
)
{
return p >= pixel_traits<T>::min();
}
// -----------------------------
template < typename P1, typename P2 >
typename enable_if_c<pixel_traits<P1>::grayscale && pixel_traits<P2>::grayscale>::type
......@@ -542,6 +574,10 @@ namespace dlib
dest = pixel_traits<P1>::max();
}
// -----------------------------
// -----------------------------
// -----------------------------
template < typename P1, typename P2 >
typename enable_if_c<pixel_traits<P1>::rgb && pixel_traits<P2>::rgb>::type
assign(P1& dest, const P2& src)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment