21 #ifndef otbHillShadingFunctor_h
22 #define otbHillShadingFunctor_h
24 #include "itkNumericTraits.h"
43 template <
class TInput1,
class TInput2 = TInput1,
class TOutput = TInput1>
54 inline TOutput
operator()(
const TInput1& A,
const TInput2& B)
const
57 out.SetRed(
static_cast<typename TOutput::ValueType
>(
static_cast<double>(A.GetRed()) *
static_cast<double>(B)));
58 out.SetGreen(
static_cast<typename TOutput::ValueType
>(
static_cast<double>(A.GetGreen()) *
static_cast<double>(B)));
59 out.SetBlue(
static_cast<typename TOutput::ValueType
>(
static_cast<double>(A.GetBlue()) *
static_cast<double>(B)));
76 template <
class TNeighIter,
class TInputImage,
class TOutput>
151 const typename IteratorType::OffsetType LEFT = {{-1, 0}};
152 const typename IteratorType::OffsetType RIGHT = {{1, 0}};
153 const typename IteratorType::OffsetType UP = {{0, -1}};
154 const typename IteratorType::OffsetType DOWN = {{0, 1}};
155 const typename IteratorType::OffsetType LEFTUP = {{-1, -1}};
156 const typename IteratorType::OffsetType RIGHTDOWN = {{1, 1}};
157 const typename IteratorType::OffsetType RIGHTUP = {{1, -1}};
158 const typename IteratorType::OffsetType LEFTDOWN = {{-1, 1}};
172 return (lambertian + 1) / 2;
178 return v < itk::NumericTraits<PixelType>::Zero ? itk::NumericTraits<PixelType>::Zero : v;