OTB  9.0.0
Orfeo Toolbox
otbReciprocalPauliDecompImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 
22 #ifndef otbReciprocalPauliDecompImageFilter_h
23 #define otbReciprocalPauliDecompImageFilter_h
24 
25 #include "otbFunctorImageFilter.h"
26 
27 namespace otb
28 {
29 
30 namespace Functor
31 {
32 
41 template <class TInput, class TOutput>
43 {
44 public:
45  typedef typename TInput::ValueType InputValueType;
46  typedef typename TOutput::ValueType OutputValueType;
47 
48  inline void operator()(TOutput& result, const TInput& Sinclair) const
49  {
50  InputValueType sqrt2(std::sqrt(2.0), 0.0);
51 
52  InputValueType Shh = static_cast<InputValueType>(Sinclair[0]);
53  InputValueType Shv = static_cast<InputValueType>(Sinclair[1]);
54  InputValueType Svv = static_cast<InputValueType>(Sinclair[2]);
55 
56  result[0] = (Shh + Svv) / sqrt2;
57  result[1] = (Shh - Svv) / sqrt2;
58  result[2] = sqrt2 * Shv;
59  }
60 
61  constexpr size_t OutputSize(...) const
62  {
63  // Size of the result
64  return 3;
65  }
66 
67 private:
68  static constexpr double m_Epsilon = 1e-6;
69 };
70 } // namespace Functor
71 
84 template <typename TInputImage, typename TOutputImage>
87 
88 } // end namespace otb
89 
90 #endif
otbFunctorImageFilter.h
otb::Functor::ReciprocalPauliDecompFunctor::OutputValueType
TOutput::ValueType OutputValueType
Definition: otbReciprocalPauliDecompImageFilter.h:46
otb::FunctorImageFilter
A generic functor filter templated by its functor.
Definition: otbFunctorImageFilter.h:322
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Functor::ReciprocalPauliDecompFunctor::m_Epsilon
static constexpr double m_Epsilon
Definition: otbReciprocalPauliDecompImageFilter.h:68
otb::Functor::ReciprocalPauliDecompFunctor::OutputSize
constexpr vcl_size_t OutputSize(...) const
Definition: otbReciprocalPauliDecompImageFilter.h:61
otb::Functor::ReciprocalPauliDecompFunctor::operator()
void operator()(TOutput &result, const TInput &Sinclair) const
Definition: otbReciprocalPauliDecompImageFilter.h:48
otb::Functor::ReciprocalPauliDecompFunctor
Evaluate the Pauli decomposition from the reciprocal Sinclair matrix image.
Definition: otbReciprocalPauliDecompImageFilter.h:42
otb::Functor::ReciprocalPauliDecompFunctor::InputValueType
TInput::ValueType InputValueType
Definition: otbReciprocalPauliDecompImageFilter.h:45