/src/gdal/apps/gdalalg_raster_overview.h
Line | Count | Source |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Project: GDAL |
4 | | * Purpose: gdal "raster overview" subcommand |
5 | | * Author: Even Rouault <even dot rouault at spatialys.com> |
6 | | * |
7 | | ****************************************************************************** |
8 | | * Copyright (c) 2025, Even Rouault <even dot rouault at spatialys.com> |
9 | | * |
10 | | * SPDX-License-Identifier: MIT |
11 | | ****************************************************************************/ |
12 | | |
13 | | #ifndef GDALALG_RASTER_OVERVIEW_INCLUDED |
14 | | #define GDALALG_RASTER_OVERVIEW_INCLUDED |
15 | | |
16 | | #include "gdalalgorithm.h" |
17 | | |
18 | | //! @cond Doxygen_Suppress |
19 | | |
20 | | #include "gdalalgorithm.h" |
21 | | |
22 | | #include "gdalalg_raster_overview_add.h" |
23 | | #include "gdalalg_raster_overview_delete.h" |
24 | | #include "gdalalg_raster_overview_refresh.h" |
25 | | |
26 | | /************************************************************************/ |
27 | | /* GDALRasterOverviewAlgorithm */ |
28 | | /************************************************************************/ |
29 | | |
30 | | class GDALRasterOverviewAlgorithm /* non final */ |
31 | | : public GDALRasterPipelineStepAlgorithm |
32 | | { |
33 | | public: |
34 | | static constexpr const char *NAME = "overview"; |
35 | | static constexpr const char *DESCRIPTION = |
36 | | "Manage overviews of a raster dataset."; |
37 | | static constexpr const char *HELP_URL = |
38 | | "/programs/gdal_raster_overview.html"; |
39 | | |
40 | | explicit GDALRasterOverviewAlgorithm(bool standaloneStep = false) |
41 | 0 | : GDALRasterPipelineStepAlgorithm(NAME, DESCRIPTION, HELP_URL, |
42 | 0 | ConstructorOptions() |
43 | 0 | .SetStandaloneStep(standaloneStep) |
44 | 0 | .SetAddDefaultArguments(false)) |
45 | 0 | { |
46 | 0 | if (standaloneStep) |
47 | 0 | { |
48 | 0 | RegisterSubAlgorithm<GDALRasterOverviewAlgorithmAddStandalone>(); |
49 | 0 | RegisterSubAlgorithm<GDALRasterOverviewAlgorithmDelete>(); |
50 | 0 | RegisterSubAlgorithm<GDALRasterOverviewAlgorithmRefresh>(); |
51 | 0 | } |
52 | 0 | else |
53 | 0 | { |
54 | 0 | RegisterSubAlgorithm<GDALRasterOverviewAlgorithmAdd>(); |
55 | 0 | } |
56 | 0 | } |
57 | | |
58 | | private: |
59 | | bool RunStep(GDALPipelineStepRunContext &ctxt) override; |
60 | | }; |
61 | | |
62 | | /************************************************************************/ |
63 | | /* GDALRasterOverviewAlgorithmStandalone */ |
64 | | /************************************************************************/ |
65 | | |
66 | | class GDALRasterOverviewAlgorithmStandalone final |
67 | | : public GDALRasterOverviewAlgorithm |
68 | | { |
69 | | public: |
70 | | GDALRasterOverviewAlgorithmStandalone() |
71 | 0 | : GDALRasterOverviewAlgorithm(/* standaloneStep = */ true) |
72 | 0 | { |
73 | 0 | } |
74 | | |
75 | | ~GDALRasterOverviewAlgorithmStandalone() override; |
76 | | }; |
77 | | |
78 | | //! @endcond |
79 | | |
80 | | #endif |