OTB  9.0.0
Orfeo Toolbox
otbPeriodicSampler.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 #ifndef otbPeriodicSampler_h
22 #define otbPeriodicSampler_h
23 
24 #include "otbSamplerBase.h"
25 
26 namespace otb
27 {
28 
38 class ITK_EXPORT PeriodicSampler : public SamplerBase
39 {
40 public:
43  typedef itk::SmartPointer<Self> Pointer;
44  typedef itk::SmartPointer<const Self> ConstPointer;
45 
49  typedef struct Parameter
50  {
51 
54  unsigned long Offset;
55 
57  unsigned long MaxJitter;
58 
60  unsigned long MaxBufferSize;
61 
62  bool operator!=(const struct Parameter& param) const;
63  } ParameterType;
64 
66  itkNewMacro(Self);
67 
69  itkTypeMacro(PeriodicSampler, SamplerBase);
70 
72  void SetParameters(const ParameterType& param)
73  {
74  if (m_Parameters != param)
75  {
76  this->Modified();
77  m_Parameters = param;
78  }
79  }
81 
84  {
85  return m_Parameters;
86  }
87 
91  void Reset(void) override;
92 
97  bool TakeSample(void);
98 
99 protected:
101  PeriodicSampler();
102 
104  ~PeriodicSampler() override
105  {
106  }
107 
108 private:
109  // Not implemented
110  PeriodicSampler(const Self&);
111  void operator=(const Self&);
112 
115 
117  double m_JitterSize;
118 
122 
124  std::vector<double> m_JitterValues;
125 };
126 
127 } // namespace otb
128 #endif
otb::PeriodicSampler::SetParameters
void SetParameters(const ParameterType &param)
Definition: otbPeriodicSampler.h:72
otb::PeriodicSampler::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbPeriodicSampler.h:44
otb::PeriodicSampler::Parameter
Definition: otbPeriodicSampler.h:49
otb::PeriodicSampler::GetParameters
ParameterType GetParameters()
Definition: otbPeriodicSampler.h:83
otb::PeriodicSampler::m_Parameters
ParameterType m_Parameters
Definition: otbPeriodicSampler.h:114
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::PeriodicSampler::Parameter::MaxBufferSize
unsigned long MaxBufferSize
Definition: otbPeriodicSampler.h:60
otb::SamplerBase
This is a base class for sampling methods.
Definition: otbSamplerBase.h:37
otb::PeriodicSampler::m_JitterValues
std::vector< double > m_JitterValues
Definition: otbPeriodicSampler.h:124
otbSamplerBase.h
otb::PeriodicSampler::Parameter::MaxJitter
unsigned long MaxJitter
Definition: otbPeriodicSampler.h:57
otb::PeriodicSampler
Periodic sampler for iteration loops.
Definition: otbPeriodicSampler.h:38
otb::PeriodicSampler::Superclass
SamplerBase Superclass
Definition: otbPeriodicSampler.h:42
otb::PeriodicSampler::m_OffsetValue
double m_OffsetValue
Definition: otbPeriodicSampler.h:121
otb::PeriodicSampler::Parameter::Offset
unsigned long Offset
Definition: otbPeriodicSampler.h:54
otb::operator!=
constexpr bool operator!=(extents< StaticExtentsL... > const &lhs, extents< StaticExtentsR... > const &rhs)
Definition: otbExtents.h:164
otb::PeriodicSampler::Self
PeriodicSampler Self
Definition: otbPeriodicSampler.h:41
otb::PeriodicSampler::~PeriodicSampler
~PeriodicSampler() override
Definition: otbPeriodicSampler.h:104
otb::PeriodicSampler::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbPeriodicSampler.h:43
otb::PeriodicSampler::m_JitterSize
double m_JitterSize
Definition: otbPeriodicSampler.h:117
otb::Wrapper::ParameterType
ParameterType
Definition: otbWrapperTypes.h:37