Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: gdal "raster overview add" 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_ADD_INCLUDED 14 : #define GDALALG_RASTER_OVERVIEW_ADD_INCLUDED 15 : 16 : #include "gdalalg_raster_pipeline.h" 17 : 18 : //! @cond Doxygen_Suppress 19 : 20 : /************************************************************************/ 21 : /* GDALRasterOverviewAlgorithmAdd */ 22 : /************************************************************************/ 23 : 24 : class GDALRasterOverviewAlgorithmAdd /* non final */ 25 : : public GDALRasterPipelineStepAlgorithm 26 : { 27 : public: 28 : static constexpr const char *NAME = "add"; 29 : static constexpr const char *DESCRIPTION = "Adding overviews."; 30 : static constexpr const char *HELP_URL = 31 : "/programs/gdal_raster_overview_add.html"; 32 : 33 : explicit GDALRasterOverviewAlgorithmAdd(bool standaloneStep = false); 34 : 35 : private: 36 : bool RunStep(GDALPipelineStepRunContext &ctxt) override; 37 : bool RunImpl(GDALProgressFunc, void *) override; 38 : 39 : std::vector<GDALArgDatasetValue> m_overviewSources{}; 40 : std::string m_resampling{}; 41 : std::vector<int> m_levels{}; 42 : int m_minSize = 256; 43 : bool m_readOnly = false; 44 : }; 45 : 46 : /************************************************************************/ 47 : /* GDALRasterOverviewAlgorithmAddStandalone */ 48 : /************************************************************************/ 49 : 50 66 : class GDALRasterOverviewAlgorithmAddStandalone final 51 : : public GDALRasterOverviewAlgorithmAdd 52 : { 53 : public: 54 33 : GDALRasterOverviewAlgorithmAddStandalone() 55 33 : : GDALRasterOverviewAlgorithmAdd(/* standaloneStep = */ true) 56 : { 57 33 : } 58 : 59 : ~GDALRasterOverviewAlgorithmAddStandalone() override; 60 : }; 61 : 62 : //! @endcond 63 : 64 : #endif