31 #ifndef IMG_ALG_TRANS_HH
32 #define IMG_ALG_TRANS_HH
39 #define IMG_ALG_TRANSCENDENTALS_BLOCK(FF,NN,SS) \
43 template <typename T, class D> \
44 void VisitState(ImageStateImpl<T,D>& isi) const { \
45 const T* end = isi.Data().GetEnd(); \
46 for(T* it = isi.Data().GetData(); it!=end; ++it) { \
51 void VisitState(ImageStateImpl<Word,D>& isi) const { \
52 const Word* end = isi.Data().GetEnd(); \
53 for(Word* it = isi.Data().GetData(); it!=end; ++it) { \
54 (*it) = static_cast<Word>(SS(static_cast<Real>(*it))); \
57 static String GetAlgorithmName() {return "";} \
59 typedef ImageStateConstModIPAlgorithm<FF> NN;
61 namespace ost {
namespace img {
namespace alg {
76 template <
typename T,
class D>
78 const T*
end = isi.Data().GetEnd();
79 for(T* it = isi.Data().GetData(); it!=
end; ++it) {
80 (*it) = std::pow(*it,exp_);
88 typedef ImageStateConstModIPAlgorithm<PowFnc>
Pow;
93 #undef IMG_ALG_TRANSCENDENTALS_BLOCK
ImageStateConstModIPAlgorithm< LogFnc > Log
ImageStateConstModIPAlgorithm< Log10Fnc > Log10
ImageStateConstModIPAlgorithm< CosFnc > Cos
ImageStateConstModIPAlgorithm< ExpFnc > Exp
pointer_it< T > end(const std::vector< T > &values)
static String GetAlgorithmName()
ImageStateConstModIPAlgorithm< PowFnc > Pow
ImageStateConstModIPAlgorithm< TanFnc > Tan
ImageStateConstModIPAlgorithm< SinFnc > Sin
ImageStateConstModIPAlgorithm< SqrtFnc > Sqrt
void VisitState(ImageStateImpl< T, D > &isi) const
#define IMG_ALG_TRANSCENDENTALS_BLOCK(FF, NN, SS)