GDAL
gdalorienteddataset.h
1/**********************************************************************
2 *
3 * Project: GDAL
4 * Purpose: Dataset that modifies the orientation of an underlying dataset
5 * Author: Even Rouault, <even dot rouault at spatialys dot com>
6 *
7 **********************************************************************
8 * Copyright (c) 2022, Even Rouault, <even dot rouault at spatialys dot com>
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDAL_ORIENTED_DATASET_H
14#define GDAL_ORIENTED_DATASET_H
15
16#include "gdal_priv.h"
17
19
20/************************************************************************/
21/* GDALOrientedDataset */
22/************************************************************************/
23
24class CPL_DLL GDALOrientedDataset : public GDALDataset
25{
26 public:
38 enum class Origin
39 {
40 TOP_LEFT = 1, /* row 0 top, col 0 lhs */
41 TOP_RIGHT = 2, /* row 0 top, col 0 rhs */
42 BOT_RIGHT = 3, /* row 0 bottom, col 0 rhs */
43 BOT_LEFT = 4, /* row 0 bottom, col 0 lhs */
44 LEFT_TOP = 5, /* row 0 lhs, col 0 top */
45 RIGHT_TOP = 6, /* row 0 rhs, col 0 top */
46 RIGHT_BOT = 7, /* row 0 rhs, col 0 bottom */
47 LEFT_BOT = 8, /* row 0 lhs, col 0 bottom */
48 };
49
50 GDALOrientedDataset(GDALDataset *poSrcDataset, Origin eOrigin);
51 GDALOrientedDataset(std::unique_ptr<GDALDataset> &&poSrcDataset,
52 Origin eOrigin);
53
54 char **GetMetadataDomainList() override
55 {
56 return m_poSrcDS->GetMetadataDomainList();
57 }
58
59 char **GetMetadata(const char *pszDomain = "") override;
60 const char *GetMetadataItem(const char *pszName,
61 const char *pszDomain = "") override;
62
63 private:
64 friend class GDALOrientedRasterBand;
65
66 std::unique_ptr<GDALDataset> m_poSrcDSHolder{};
67 GDALDataset *m_poSrcDS = nullptr;
68 Origin m_eOrigin;
69 CPLStringList m_aosSrcMD{};
70 CPLStringList m_aosSrcMD_EXIF{};
71
72 GDALOrientedDataset(const GDALOrientedDataset &) = delete;
73 GDALOrientedDataset &operator=(const GDALOrientedDataset &) = delete;
74};
75
77
78#endif
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:436
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:495
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition: gdaldataset.cpp:4774
void static void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition: gdaldataset.cpp:4668
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:325
C++ GDAL entry points.