OTB  7.1.0
Orfeo Toolbox
otbSubsampledImageRegionIterator.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  * Copyright (C) 2007-2012 Institut Mines Telecom / Telecom Bretagne
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 
23 #ifndef otbSubsampledImageRegionIterator_h
24 #define otbSubsampledImageRegionIterator_h
25 
27 
28 namespace otb
29 {
30 
45 template <class TImage>
47 {
48 public:
52 
55 
56  itkStaticConstMacro(ImageIteratorDimension, unsigned int, Superclass::ImageIteratorDimension);
57 
58  // typedef redefinition from superclass
59  typedef typename Superclass::IndexType IndexType;
60  typedef typename Superclass::SizeType SizeType;
61  typedef typename Superclass::RegionType RegionType;
62  typedef typename Superclass::OffsetType OffsetType;
63  typedef typename Superclass::ImageType ImageType;
64  typedef typename Superclass::PixelContainer PixelContainer;
65  typedef typename Superclass::PixelContainerPointer PixelContainerPointer;
66  typedef typename Superclass::InternalPixelType InternalPixelType;
67  typedef typename Superclass::PixelType PixelType;
68  typedef typename Superclass::AccessorType AccessorType;
69  typedef typename Superclass::IndexValueType IndexValueType;
70 
71  // Constructors
73  {
74  }
75 
76  SubsampledImageRegionIterator(const ImageType* ptr, const RegionType& region) : SubsampledImageRegionConstIterator<TImage>(ptr, region)
77  {
78  }
79 
80  SubsampledImageRegionIterator(const itk::ImageIterator<TImage>& it) : SubsampledImageRegionConstIterator<TImage>(it)
81  {
82  }
83 
84  SubsampledImageRegionIterator(const itk::ImageConstIterator<TImage>& it) : SubsampledImageRegionConstIterator<TImage>(it)
85  {
86  }
87 
89  void Set(const PixelType& value) const
90  {
91  this->m_PixelAccessorFunctor.Set(*(const_cast<InternalPixelType*>(this->m_Buffer + this->m_Offset)), value);
92  }
93 
94  PixelType& Value(void)
95  {
96  return *(const_cast<InternalPixelType*>(this->m_Buffer + this->m_Offset));
97  }
98 
99 }; // end of class
100 
101 } // end of namespace otb
102 
103 #endif
Superclass::PixelContainerPointer PixelContainerPointer
SubsampledImageRegionIterator(const itk::ImageConstIterator< TImage > &it)
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
SubsampledImageRegionIterator(const ImageType *ptr, const RegionType &region)
Regular subsample iterator over an image.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
SubsampledImageRegionIterator(const itk::ImageIterator< TImage > &it)
static constexpr GLenum value() noexcept
SubsampledImageRegionConstIterator< TImage > Superclass
Regular subsample iterator over an image.