GDAL
gdalalg_raster_overview.h
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
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
30class 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 : GDALRasterPipelineStepAlgorithm(NAME, DESCRIPTION, HELP_URL,
42 ConstructorOptions()
43 .SetStandaloneStep(standaloneStep)
44 .SetAddDefaultArguments(false))
45 {
46 if (standaloneStep)
47 {
48 RegisterSubAlgorithm<GDALRasterOverviewAlgorithmAddStandalone>();
49 RegisterSubAlgorithm<GDALRasterOverviewAlgorithmDelete>();
50 RegisterSubAlgorithm<GDALRasterOverviewAlgorithmRefresh>();
51 }
52 else
53 {
54 RegisterSubAlgorithm<GDALRasterOverviewAlgorithmAdd>();
55 }
56 }
57
58 private:
59 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
60};
61
62/************************************************************************/
63/* GDALRasterOverviewAlgorithmStandalone */
64/************************************************************************/
65
66class GDALRasterOverviewAlgorithmStandalone final
67 : public GDALRasterOverviewAlgorithm
68{
69 public:
70 GDALRasterOverviewAlgorithmStandalone()
71 : GDALRasterOverviewAlgorithm(/* standaloneStep = */ true)
72 {
73 }
74
75 ~GDALRasterOverviewAlgorithmStandalone() override;
76};
77
79
80#endif