Orfeo Toolbox  4.0
otbPolarimetricSynthesisFunctor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbPolarimetricSynthesisFunctor_h
19 #define __otbPolarimetricSynthesisFunctor_h
20 
21 #include "otbMath.h"
22 #include "vcl_complex.h"
23 #include "itkFixedArray.h"
24 
25 namespace otb
26 {
27 namespace Functor
28 {
39 template <class TInput1, class TInput2, class TInput3, class TInput4, class TOutput>
41 {
42 public:
44  typedef typename std::complex <double> ComplexType;
46 
49  {
50  m_Ei = ei;
51  }
52 
55  {
56  m_Er = er;
57  }
58 
61  {
62  m_Ei.Fill(1);
63  m_Er.Fill(1);
64  }
67  inline TOutput operator ()(const TInput1& Shh, const TInput2& Shv, const TInput3& Svh, const TInput4& Svv)
68  {
69  ComplexType tmp;
70  double scalar;
71 
72  tmp = vcl_conj(m_Er[0]) * (m_Ei[0] * static_cast<ComplexType>(Shh) + m_Ei[1] * static_cast<ComplexType>(Shv))
73  + vcl_conj(m_Er[1]) * (m_Ei[0] * static_cast<ComplexType>(Svh) + m_Ei[1] * static_cast<ComplexType>(Svv));
74 
75  scalar = static_cast<double>(vcl_abs(tmp)) * static_cast<double>(vcl_abs(tmp));
76 
77  return (static_cast<TOutput>(scalar));
78  }
79 
80 private:
85 
86 };
87 
88 } // namespace Functor
89 } // namespace otb
90 
91 #endif

Generated at Sat Mar 8 2014 16:13:25 for Orfeo Toolbox with doxygen 1.8.3.1