OTB  6.7.0
Orfeo Toolbox
otbPeriodicSampler.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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:
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 private:
107  // Not implemented
108  PeriodicSampler(const Self&);
109  void operator=(const Self&);
110 
113 
115  double m_JitterSize;
116 
120 
122  std::vector<double> m_JitterValues;
123 };
124 
125 } // namespace otb
126 #endif
std::vector< double > m_JitterValues
void SetParameters(const ParameterType &param)
ParameterType GetParameters()
Periodic sampler for iteration loops.
OTBGdalAdapters_EXPORT bool operator!=(const CoordinateTransformation &ct1, const CoordinateTransformation &ct2) noexcept
different operator
itk::SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
This is a base class for sampling methods.