OTB  7.1.0
Orfeo Toolbox
otbImageRegionTileMapSplitter.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 
22 #ifndef otbImageRegionTileMapSplitter_h
23 #define otbImageRegionTileMapSplitter_h
24 
25 #include "itkRegion.h"
26 #include "itkImageRegionSplitter.h"
27 #include "itkObjectFactory.h"
28 #include "itkIndex.h"
29 #include "itkSize.h"
30 
31 namespace otb
32 {
33 
74 template <unsigned int VImageDimension>
75 class ITK_EXPORT ImageRegionTileMapSplitter : public itk::ImageRegionSplitter<VImageDimension>
76 {
77 public:
80  typedef itk::ImageRegionSplitter<VImageDimension> Superclass;
81  typedef itk::SmartPointer<Self> Pointer;
82  typedef itk::SmartPointer<const Self> ConstPointer;
83 
85  itkNewMacro(Self);
86 
88  itkTypeMacro(ImageRegionTileMapSplitter, itk::Object);
89 
91  itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension);
92 
94  static unsigned int GetImageDimension()
95  {
96  return VImageDimension;
97  }
98 
100  typedef itk::Index<VImageDimension> IndexType;
101  typedef typename IndexType::IndexValueType IndexValueType;
102 
104  typedef itk::Size<VImageDimension> SizeType;
105  typedef typename SizeType::SizeValueType SizeValueType;
106 
108  typedef itk::ImageRegion<VImageDimension> RegionType;
109 
116  unsigned int GetNumberOfSplits(const RegionType& region, unsigned int requestedNumber) override;
117 
121  RegionType GetSplit(unsigned int i, unsigned int numberOfPieces, const RegionType& region) override;
122 
123 protected:
124  ImageRegionTileMapSplitter() : m_SplitsPerDimension{0}, m_AlignStep(256)
125  {
126  }
128  {
129  }
130  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
131 
132 private:
134  void operator=(const ImageRegionTileMapSplitter&) = delete;
135 
136  unsigned int m_SplitsPerDimension[VImageDimension];
137  unsigned int m_AlignStep;
138 };
139 
140 } // end namespace otb
141 
142 #ifndef OTB_MANUAL_INSTANTIATION
144 #endif
145 
146 #endif
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
itk::SmartPointer< const Self > ConstPointer
itk::ImageRegion< VImageDimension > RegionType
itk::ImageRegionSplitter< VImageDimension > Superclass
Divide a region into several pieces.