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