OTB  10.0.0
Orfeo Toolbox
otbGDALDatasetWrapper.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 otbGDALDatasetWrapper_h
22 #define otbGDALDatasetWrapper_h
23 
24 #include "itkLightObject.h"
25 #include "itkObjectFactory.h"
26 
27 #include "otbConfigure.h"
28 #include "otbGeometryMetadata.h"
29 
30 
31 class GDALDataset;
32 
33 
34 namespace otb
35 {
36 
37 // only two states : the Pointer is Null or GetDataSet() returns a
38 // valid dataset
39 class GDALDatasetWrapper : public itk::LightObject
40 {
42 
43 public:
45  typedef itk::LightObject Superclass;
46  typedef itk::SmartPointer<Self> Pointer;
47 
49  itkNewMacro(Self);
50 
52  itkTypeMacro(GDALImageIO, itk::LightObject);
53 
56  const GDALDataset* GetDataSet() const;
57  GDALDataset* GetDataSet();
59 
63  bool IsJPEG2000() const;
64 
67  int GetOverviewsCount() const;
68 
71  unsigned int GetWidth() const;
72 
75  unsigned int GetHeight() const;
76 
79  size_t GetPixelBytes() const;
80 
83 
84 protected:
86 
87  ~GDALDatasetWrapper() override;
88 
89 
90 private:
91  GDALDataset* m_Dataset;
92 }; // end of GDALDatasetWrapper
93 
94 
95 } // end namespace otb
96 
97 
98 #endif // otbGDALDatasetWrapper_h
~GDALDatasetWrapper() override
Projection::GCPParam GetGCPParam() const
vcl_size_t GetPixelBytes() const
const GDALDataset * GetDataSet() const
unsigned int GetWidth() const
itk::SmartPointer< Self > Pointer
unsigned int GetHeight() const
void SetGCPParam(Projection::GCPParam gcpParam)
GDALDataset * GetDataSet()
int GetOverviewsCount() const
Provide an unique instance of a GDALDataSet.
ImageIO object for reading and writing images with GDAL.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
This structure handles the list of the GCP parameters.