21 #ifndef otbMeanFunctor_h
22 #define otbMeanFunctor_h
33 template <
class TInput,
class TOutputValue>
49 if (inPix.Size() <= 0)
50 return static_cast<TOutputValue
>(0.);
51 for (
unsigned int i = 0; i < inPix.Size(); ++i)
53 value +=
static_cast<double>(inPix[i]);
55 return static_cast<TOutputValue
>(value /
static_cast<double>(inPix.Size()));
This functor generate the mean value of a component pixels.
TOutputValue operator()(const TInput &inPix)
MeanFunctor< TInput, TOutputValue > MeanFunctorType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.