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
| #ifndef DILATE_H
#define DILATE_H
namespace mylib
{
namespace Dilate
{
void HistX(const UINT8 *src, const int sewidth, UINT8 *res) {...}
void InterHistX(const UINT8 *src, const int sewidth, UINT8 *res) {...}
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(src, sewidth, 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(src, sewidth, res) ;
else
if ( sewidth <= 13 || channel != 1 ) AvX(src, sewidth, res) ;
else FmX(src, sewidth, res) ;
}
} // namespace Dilate
} // namespace mylib
#endif /* DILATE_H */ |
Partager