OTB  9.0.0
Orfeo Toolbox
otbGDALDatasetWrapper.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 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 
82  void SetGCPParam(Projection::GCPParam gcpParam);
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
otb::GDALDatasetWrapper::GDALDatasetWrapper
GDALDatasetWrapper()
otb::GDALDatasetWrapper::Self
GDALDatasetWrapper Self
Definition: otbGDALDatasetWrapper.h:44
otb::GDALDatasetWrapper::GetDataSet
const GDALDataset * GetDataSet() const
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::GDALImageIO
ImageIO object for reading and writing images with GDAL.
Definition: otbGDALImageIO.h:77
otbGeometryMetadata.h
otb::GDALDatasetWrapper::GetGCPParam
Projection::GCPParam GetGCPParam() const
otb::GDALDatasetWrapper::GetOverviewsCount
int GetOverviewsCount() const
otb::GDALDatasetWrapper
Definition: otbGDALDatasetWrapper.h:39
otb::GDALDriverManagerWrapper
Provide an unique instance of a GDALDataSet.
Definition: otbGDALDriverManagerWrapper.h:60
otb::GDALDatasetWrapper::GetWidth
unsigned int GetWidth() const
otb::GDALDatasetWrapper::m_Dataset
GDALDataset * m_Dataset
Definition: otbGDALDatasetWrapper.h:91
otb::GDALDatasetWrapper::GetPixelBytes
vcl_size_t GetPixelBytes() const
otb::GDALDatasetWrapper::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGDALDatasetWrapper.h:46
otb::GDALDatasetWrapper::SetGCPParam
void SetGCPParam(Projection::GCPParam gcpParam)
otb::GDALDatasetWrapper::IsJPEG2000
bool IsJPEG2000() const
otb::Projection::GCPParam
This structure handles the list of the GCP parameters.
Definition: otbGeometryMetadata.h:88
otb::GDALDatasetWrapper::~GDALDatasetWrapper
~GDALDatasetWrapper() override
otb::GDALDatasetWrapper::GetHeight
unsigned int GetHeight() const
otb::GDALDatasetWrapper::Superclass
itk::LightObject Superclass
Definition: otbGDALDatasetWrapper.h:45