OTB  9.0.0
Orfeo Toolbox
otbGDALOverviewsBuilder.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 #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 
116  void ListResolutions(SizeVector&);
117 
118  unsigned int GetOverviewsCount() const;
119 
120 
121  size_t GetEstimatedSize() const;
122 
123  GDALResampling GetResamplingMethod() const;
124 
125  void SetResamplingMethod(GDALResampling);
126 
127 
128  void SetBypassEnabled(bool);
129 
130  bool IsBypassEnabled() const;
131 
132  unsigned int GetWidth() const;
133 
134  unsigned int GetHeight() const;
135 
136  GDALCompression GetCompressionMethod() const;
137 
138  void SetCompressionMethod(GDALCompression);
139 
140 
141  GDALFormat GetFormat() const;
142 
143  void SetFormat(GDALFormat);
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
otb::GDALOverviewsBuilder::Size
itk::Size< 2 > Size
Definition: otbGDALOverviewsBuilder.h:94
otb::GDAL_RESAMPLING_CUBIC
@ GDAL_RESAMPLING_CUBIC
Definition: otbGDALOverviewsBuilder.h:46
otb::GDAL_RESAMPLING_NONE
@ GDAL_RESAMPLING_NONE
Definition: otbGDALOverviewsBuilder.h:42
otb::GDALOverviewsBuilder::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGDALOverviewsBuilder.h:91
otb::GDAL_FORMAT_GEOTIFF
@ GDAL_FORMAT_GEOTIFF
Definition: otbGDALOverviewsBuilder.h:78
otb::GDALOverviewsBuilder::Self
GDALOverviewsBuilder Self
Definition: otbGDALOverviewsBuilder.h:89
otb::GDAL_RESAMPLING_AVERAGE_MAGPHASE
@ GDAL_RESAMPLING_AVERAGE_MAGPHASE
Definition: otbGDALOverviewsBuilder.h:49
otbGDALDatasetWrapper.h
otb::GDAL_COMPRESSION_NONE
@ GDAL_COMPRESSION_NONE
Definition: otbGDALOverviewsBuilder.h:62
otb::GDAL_RESAMPLING_AVERAGE
@ GDAL_RESAMPLING_AVERAGE
Definition: otbGDALOverviewsBuilder.h:47
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::GDALOverviewsBuilder::m_GDALDataset
GDALDatasetWrapper::Pointer m_GDALDataset
Definition: otbGDALOverviewsBuilder.h:181
otb::GDALOverviewsBuilder::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbGDALOverviewsBuilder.h:92
otb::GDAL_FORMAT_ERDAS
@ GDAL_FORMAT_ERDAS
Definition: otbGDALOverviewsBuilder.h:77
otb::GDALOverviewsBuilder::SizeVector
std::vector< Size > SizeVector
Definition: otbGDALOverviewsBuilder.h:95
otb::GDALResampling
GDALResampling
Definition: otbGDALOverviewsBuilder.h:40
otb::GDAL_COMPRESSION_DEFLATE
@ GDAL_COMPRESSION_DEFLATE
Definition: otbGDALOverviewsBuilder.h:67
otb::GDAL_COMPRESSION_LZW
@ GDAL_COMPRESSION_LZW
Definition: otbGDALOverviewsBuilder.h:65
otb::GDALOverviewsBuilder::m_NbResolutions
unsigned int m_NbResolutions
Definition: otbGDALOverviewsBuilder.h:183
otb::GDALOverviewsBuilder::m_CompressionMethod
GDALCompression m_CompressionMethod
Definition: otbGDALOverviewsBuilder.h:186
otb::GDALCompression
GDALCompression
Definition: otbGDALOverviewsBuilder.h:60
otb::GDALOverviewsBuilder::m_Format
GDALFormat m_Format
Definition: otbGDALOverviewsBuilder.h:187
otb::GDALResamplingType
GDALResampling GDALResamplingType
Definition: otbGDALOverviewsBuilder.h:56
otb::GDALFormat
GDALFormat
Definition: otbGDALOverviewsBuilder.h:75
otb::GDAL_RESAMPLING_GAUSS
@ GDAL_RESAMPLING_GAUSS
Definition: otbGDALOverviewsBuilder.h:45
otb::GDAL_COMPRESSION_JPEG
@ GDAL_COMPRESSION_JPEG
Definition: otbGDALOverviewsBuilder.h:64
otb::GDALOverviewsBuilder::m_ResolutionFactor
unsigned int m_ResolutionFactor
Definition: otbGDALOverviewsBuilder.h:184
otb::GDALDatasetWrapper::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGDALDatasetWrapper.h:46
otb::GDAL_COMPRESSION_PACKBITS
@ GDAL_COMPRESSION_PACKBITS
Definition: otbGDALOverviewsBuilder.h:66
otb::GDALOverviewsBuilder::m_InputFileName
std::string m_InputFileName
Definition: otbGDALOverviewsBuilder.h:182
otb::GDAL_COMPRESSION_COUNT
@ GDAL_COMPRESSION_COUNT
Definition: otbGDALOverviewsBuilder.h:69
otb::GDALOverviewsBuilder::~GDALOverviewsBuilder
~GDALOverviewsBuilder() override
Definition: otbGDALOverviewsBuilder.h:166
otb::GDALOverviewsBuilder::Superclass
ProcessObject Superclass
Definition: otbGDALOverviewsBuilder.h:90
otb::GDALOverviewsBuilder::m_ResamplingMethod
GDALResampling m_ResamplingMethod
Definition: otbGDALOverviewsBuilder.h:185
otb::GDALOverviewsBuilder::m_IsBypassEnabled
bool m_IsBypassEnabled
Definition: otbGDALOverviewsBuilder.h:188
otb::GDAL_FORMAT_COUNT
@ GDAL_FORMAT_COUNT
Definition: otbGDALOverviewsBuilder.h:80
otb::GDAL_RESAMPLING_MODE
@ GDAL_RESAMPLING_MODE
Definition: otbGDALOverviewsBuilder.h:48
otb::GDAL_RESAMPLING_COUNT
@ GDAL_RESAMPLING_COUNT
Definition: otbGDALOverviewsBuilder.h:51
otb::GDALOverviewsBuilder
Definition: otbGDALOverviewsBuilder.h:86
otb::GDAL_RESAMPLING_NEAREST
@ GDAL_RESAMPLING_NEAREST
Definition: otbGDALOverviewsBuilder.h:44