OTB  10.0.0
Orfeo Toolbox
otbPeriodicSampler.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 #include "OTBStatisticsExport.h"
26 
27 namespace otb
28 {
29 
39 class OTBStatistics_EXPORT PeriodicSampler : public SamplerBase
40 {
41 public:
44  typedef itk::SmartPointer<Self> Pointer;
45  typedef itk::SmartPointer<const Self> ConstPointer;
46 
50  typedef struct Parameter
51  {
52 
55  unsigned long Offset;
56 
58  unsigned long MaxJitter;
59 
61  unsigned long MaxBufferSize;
62 
63  bool operator!=(const struct Parameter& param) const;
65 
67  itkNewMacro(Self);
68 
70  itkTypeMacro(PeriodicSampler, SamplerBase);
71 
73  void SetParameters(const ParameterType& param)
74  {
75  if (m_Parameters != param)
76  {
77  this->Modified();
78  m_Parameters = param;
79  }
80  }
82 
85  {
86  return m_Parameters;
87  }
88 
92  void Reset(void) override;
93 
98  bool TakeSample(void);
99 
100 protected:
103 
105  ~PeriodicSampler() override
106  {
107  }
108 
109 private:
110  // Not implemented
112  void operator=(const Self&);
113 
116 
118  double m_JitterSize;
119 
123 
125  std::vector<double> m_JitterValues;
126 };
127 
128 } // namespace otb
129 #endif
Periodic sampler for iteration loops.
void Reset(void) override
itk::SmartPointer< Self > Pointer
PeriodicSampler(const Self &)
std::vector< double > m_JitterValues
void operator=(const Self &)
void SetParameters(const ParameterType &param)
ParameterType GetParameters()
itk::SmartPointer< const Self > ConstPointer
This is a base class for sampling methods.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
bool operator!=(const struct Parameter &param) const