OTB  6.7.0
Orfeo Toolbox
otbGDALOverviewsBuilder.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 #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;
93 
95  typedef std::vector< Size > SizeVector;
96 
98  itkNewMacro( Self );
99 
102  static
103  bool CanGenerateOverviews( const std::string & filename );
104 
109  unsigned int
110  CountResolutions( unsigned int factor, unsigned int size ) const;
111 
112  unsigned int
113  CountResolutions( unsigned int size ) const;
114 
115  unsigned int
116  CountResolutions() const;
117 
118  void ListResolutions( SizeVector &, unsigned int factor, unsigned int count );
119 
120  void ListResolutions( SizeVector & );
121 
122  unsigned int GetOverviewsCount() const;
123 
124 
125  size_t GetEstimatedSize() const;
126 
127  GDALResampling GetResamplingMethod() const;
128 
129  void SetResamplingMethod( GDALResampling );
130 
131 
132  void SetBypassEnabled( bool );
133 
134  bool IsBypassEnabled() const;
135 
136  unsigned int GetWidth() const;
137 
138  unsigned int GetHeight() const;
139 
140  GDALCompression GetCompressionMethod() const;
141 
142  void SetCompressionMethod( GDALCompression );
143 
144 
145  GDALFormat GetFormat() const;
146 
147  void SetFormat( GDALFormat );
148 
149 
150  unsigned int GetNbResolutions() const;
151 
152  void SetNbResolutions( unsigned int );
153 
154  unsigned int GetResolutionFactor() const;
155 
156  void SetResolutionFactor( unsigned int );
157 
158 
159  const std::string & GetInputFileName() const;
160 
161  void SetInputFileName( const std::string & str );
162 
163 
164  void Update() override;
165 
166 
167 protected:
169 
170  ~GDALOverviewsBuilder() override {};
171 
172  void PrintSelf( std::ostream & os, itk::Indent indent ) const override;
173 
174 
175 private:
176  GDALOverviewsBuilder( const Self & ) = delete;
177 
178  void operator = ( const Self & ) = delete;
179 
180  // void GetGDALResamplingMethod( std::string & resamplingMethod );
181 
182  void OpenDataset( const std::string & filename );
183 
184 
186  std::string m_InputFileName;
187  unsigned int m_NbResolutions;
188  unsigned int m_ResolutionFactor;
192  bool m_IsBypassEnabled : 1;
193 
194 }; // end of GDALOverviewsBuilder
195 
196 } // end namespace otb
197 
198 #endif // otbGDALOverviewsBuilder_h
itk::SmartPointer< Self > Pointer
GDALResampling GDALResamplingType
GDALDatasetWrapper::Pointer m_GDALDataset
itk::SmartPointer< const Self > ConstPointer