1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| #ifndef DILATE_H
#define DILATE_H
namespace mylib
{
namespace Dilate
{
template<typename T> void HistX(const T *src, const int sewidth, T *res)
{
static_assert(std::is_same<T, UINT8>::value, "") ;
...
}
template<typename T> void InterHistX(const UINTT8 *src, const int sewidth, T *res)
{
static_assert(std::is_same<T, UINT8>::value, "") ;
...
}
template<typename T> void FmX(const T *src, const int sewidth, T *res) {...}
template<typename T> void AvX(const T *src, const int sewidth, T *res) {...}
template<typename T> void SegmentX(const T *src, const int sewidth, T *res)
{
if ( sewidth <= 13 ) AvX(src, sewidth, res) ;
else
if ( std::is_same<T, UINT8>::value ) HistX((UINT8*)src, sewidth, (UINT8*)res) ;
else FmX(src, sewidth, res) ;
}
template<typename T> void SegmentInterX(const T *src, const int sewidth, T *res)
{
if ( std::is_same<T, UINT8>::value )
if ( sewidth <= 13 ) AvX(src, sewidth, res) ;
else InterHistX((UINT8*)src, sewidth, (UINT8*)res) ;
else
if ( sewidth <= 13 || channel != 1 ) AvX(src, sewidth, res) ;
else FmX(src, sewidth, res) ;
}
} // namespace Dilate
} // namespace mylib
#endif /* DILATE_H */ |
Partager