OTB  9.0.0
Orfeo Toolbox
otbImageRegionTileMapSplitter.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 
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
otb::ImageRegionTileMapSplitter::m_AlignStep
unsigned int m_AlignStep
Definition: otbImageRegionTileMapSplitter.h:137
otb::ImageRegionTileMapSplitter::SizeValueType
SizeType::SizeValueType SizeValueType
Definition: otbImageRegionTileMapSplitter.h:105
otb::ImageRegionTileMapSplitter::~ImageRegionTileMapSplitter
~ImageRegionTileMapSplitter() override
Definition: otbImageRegionTileMapSplitter.h:127
otb::ImageRegionTileMapSplitter
Divide a region into several pieces.
Definition: otbImageRegionTileMapSplitter.h:75
otb::ImageRegionTileMapSplitter::IndexType
itk::Index< VImageDimension > IndexType
Definition: otbImageRegionTileMapSplitter.h:100
otb::ImageRegionTileMapSplitter::SizeType
itk::Size< VImageDimension > SizeType
Definition: otbImageRegionTileMapSplitter.h:104
otb::ImageRegionTileMapSplitter::ImageRegionTileMapSplitter
ImageRegionTileMapSplitter()
Definition: otbImageRegionTileMapSplitter.h:124
otb::ImageRegionTileMapSplitter::GetImageDimension
static unsigned int GetImageDimension()
Definition: otbImageRegionTileMapSplitter.h:94
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ImageRegionTileMapSplitter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbImageRegionTileMapSplitter.h:82
otb::ImageRegionTileMapSplitter::RegionType
itk::ImageRegion< VImageDimension > RegionType
Definition: otbImageRegionTileMapSplitter.h:108
otb::ImageRegionTileMapSplitter::Superclass
itk::ImageRegionSplitter< VImageDimension > Superclass
Definition: otbImageRegionTileMapSplitter.h:80
otb::ImageRegionTileMapSplitter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageRegionTileMapSplitter.h:81
otb::ImageRegionTileMapSplitter::IndexValueType
IndexType::IndexValueType IndexValueType
Definition: otbImageRegionTileMapSplitter.h:101
otbImageRegionTileMapSplitter.hxx
otb::ImageRegionTileMapSplitter::Self
ImageRegionTileMapSplitter Self
Definition: otbImageRegionTileMapSplitter.h:79