Enhancement to Find by Filename filter - support for comma-separated values (issue 1594)

This commit is contained in:
michael
2012-10-16 21:49:34 -04:00
commit a82fb5aea9
1448 changed files with 310836 additions and 0 deletions

70
rtengine/rt_math.h Normal file
View File

@@ -0,0 +1,70 @@
#ifndef _MYMATH_
#define _MYMATH_
#include <cmath>
#include <algorithm>
#include "rtengine.h"
namespace rtengine {
static const int MAXVAL = 0xffff;
template <typename _Tp>
inline const _Tp SQR (_Tp x) {
// return std::pow(x,2); Slower than:
return (x*x);
}
template<typename _Tp>
inline const _Tp& min(const _Tp& a, const _Tp& b) {
return std::min(a,b);
}
template<typename _Tp>
inline const _Tp& max(const _Tp& a, const _Tp& b) {
return std::max(a,b);
}
template<typename _Tp>
inline const _Tp LIM(const _Tp& a, const _Tp& b, const _Tp& c) {
return std::max(b,std::min(a,c));
}
template<typename _Tp>
inline const _Tp LIM01(const _Tp& a) {
return std::max(_Tp(1),std::min(a,_Tp(0)));
}
template<typename _Tp>
inline const _Tp ULIM(const _Tp& a, const _Tp& b, const _Tp& c) {
return ((b < c) ? LIM(a,b,c) : LIM(a,c,b));
}
template<typename _Tp>
inline const _Tp CLIP(const _Tp& a) {
return LIM(a, static_cast<_Tp>(0), static_cast<_Tp>(MAXVAL));
//return ((a)>0.0? ((a)<MAXVAL?(a):MAXVAL):0.0);
}
template<typename _Tp>
inline const _Tp& min(const _Tp& a, const _Tp& b, const _Tp& c) {
return std::min(c,std::min(a,b));
}
template<typename _Tp>
inline const _Tp& max(const _Tp& a, const _Tp& b, const _Tp& c) {
return std::max(c,std::max(a,b));
}
template<typename _Tp>
inline const _Tp& min(const _Tp& a, const _Tp& b, const _Tp& c, const _Tp& d) {
return std::min(d,std::min(c,std::min(a,b)));
}
template<typename _Tp>
inline const _Tp& max(const _Tp& a, const _Tp& b, const _Tp& c, const _Tp& d) {
return std::max(d,std::max(c,std::max(a,b)));
}
}
#endif