OTB  10.0.0
Orfeo Toolbox
otbGDALOverviewsBuilder.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 otbGDALOverviewsBuilder_h
22 #define otbGDALOverviewsBuilder_h
23 
24 
25 // #include "itkLightObject.h"
26 #include "itkProcessObject.h"
27 #include "itkSize.h"
28 
29 #include "otbGDALDatasetWrapper.h"
30 #include "otbConfigure.h"
31 
32 #include "OTBIOGDALExport.h"
33 #include <string>
34 
35 namespace otb
36 {
37 
41 {
43  //
50  //
52 };
53 
54 
55 // Compile-time compatibility alias.
57 
61 {
63  //
68  //
70 };
71 
72 
76 {
79  //
81 };
82 
83 
86 class OTBIOGDAL_EXPORT GDALOverviewsBuilder : public itk::ProcessObject
87 {
88 public:
90  typedef ProcessObject Superclass;
91  typedef itk::SmartPointer<Self> Pointer;
92  typedef itk::SmartPointer<const Self> ConstPointer;
93 
94  typedef itk::Size<2> Size;
95  typedef std::vector<Size> SizeVector;
96 
98  itkNewMacro(Self);
99 
102  static bool CanGenerateOverviews(const std::string& filename);
103 
108  unsigned int CountResolutions(unsigned int factor, unsigned int size) const;
109 
110  unsigned int CountResolutions(unsigned int size) const;
111 
112  unsigned int CountResolutions() const;
113 
114  void ListResolutions(SizeVector&, unsigned int factor, unsigned int count);
115 
117 
118  unsigned int GetOverviewsCount() const;
119 
120 
121  size_t GetEstimatedSize() const;
122 
124 
126 
127 
128  void SetBypassEnabled(bool);
129 
130  bool IsBypassEnabled() const;
131 
132  unsigned int GetWidth() const;
133 
134  unsigned int GetHeight() const;
135 
137 
139 
140 
142 
144 
145 
146  unsigned int GetNbResolutions() const;
147 
148  void SetNbResolutions(unsigned int);
149 
150  unsigned int GetResolutionFactor() const;
151 
152  void SetResolutionFactor(unsigned int);
153 
154 
155  const std::string& GetInputFileName() const;
156 
157  void SetInputFileName(const std::string& str);
158 
159 
160  void Update() override;
161 
162 
163 protected:
165 
166  ~GDALOverviewsBuilder() override{};
167 
168  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
169 
170 
171 private:
172  GDALOverviewsBuilder(const Self&) = delete;
173 
174  void operator=(const Self&) = delete;
175 
176  // void GetGDALResamplingMethod( std::string & resamplingMethod );
177 
178  void OpenDataset(const std::string& filename);
179 
180 
182  std::string m_InputFileName;
183  unsigned int m_NbResolutions;
184  unsigned int m_ResolutionFactor;
189 
190 }; // end of GDALOverviewsBuilder
191 
192 } // end namespace otb
193 
194 #endif // otbGDALOverviewsBuilder_h
itk::SmartPointer< Self > Pointer
void SetResamplingMethod(GDALResampling)
unsigned int GetNbResolutions() const
unsigned int GetHeight() const
void ListResolutions(SizeVector &)
void SetNbResolutions(unsigned int)
GDALCompression GetCompressionMethod() const
unsigned int CountResolutions() const
vcl_size_t GetEstimatedSize() const
itk::SmartPointer< const Self > ConstPointer
itk::SmartPointer< Self > Pointer
GDALFormat GetFormat() const
unsigned int GetWidth() const
const std::string & GetInputFileName() const
void SetFormat(GDALFormat)
GDALDatasetWrapper::Pointer m_GDALDataset
bool IsBypassEnabled() const
unsigned int GetResolutionFactor() const
GDALOverviewsBuilder(const Self &)=delete
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void SetCompressionMethod(GDALCompression)
unsigned int GetOverviewsCount() const
static bool CanGenerateOverviews(const std::string &filename)
GDALResampling GetResamplingMethod() const
void operator=(const Self &)=delete
void SetInputFileName(const std::string &str)
void SetResolutionFactor(unsigned int)
unsigned int CountResolutions(unsigned int size) const
void ListResolutions(SizeVector &, unsigned int factor, unsigned int count)
void OpenDataset(const std::string &filename)
void Update() override
unsigned int CountResolutions(unsigned int factor, unsigned int size) const
Count the number of resolution levels larger than factor^n.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
@ GDAL_COMPRESSION_PACKBITS
@ GDAL_COMPRESSION_DEFLATE
@ GDAL_RESAMPLING_AVERAGE_MAGPHASE
GDALResampling GDALResamplingType