Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: "astype" step of "raster pipeline" 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_ASTYPE_INCLUDED 14 : #define GDALALG_RASTER_ASTYPE_INCLUDED 15 : 16 : #include "gdalalg_raster_pipeline.h" 17 : 18 : //! @cond Doxygen_Suppress 19 : 20 : /************************************************************************/ 21 : /* GDALRasterAsTypeAlgorithm */ 22 : /************************************************************************/ 23 : 24 : class GDALRasterAsTypeAlgorithm /* non final */ 25 : : public GDALRasterPipelineStepAlgorithm 26 : { 27 : public: 28 : static constexpr const char *NAME = "astype"; 29 : static constexpr const char *DESCRIPTION = 30 : "Modify the data type of bands of a raster dataset."; 31 : static constexpr const char *HELP_URL = "/programs/gdal_raster_astype.html"; 32 : 33 378 : static std::vector<std::string> GetAliases() 34 : { 35 378 : return {}; 36 : } 37 : 38 : explicit GDALRasterAsTypeAlgorithm(bool standaloneStep = false); 39 : 40 : private: 41 : bool RunStep(GDALProgressFunc pfnProgress, void *pProgressData) override; 42 : 43 : std::string m_type{}; 44 : }; 45 : 46 : /************************************************************************/ 47 : /* GDALRasterAsTypeAlgorithmStandalone */ 48 : /************************************************************************/ 49 : 50 : class GDALRasterAsTypeAlgorithmStandalone final 51 : : public GDALRasterAsTypeAlgorithm 52 : { 53 : public: 54 3 : GDALRasterAsTypeAlgorithmStandalone() 55 3 : : GDALRasterAsTypeAlgorithm(/* standaloneStep = */ true) 56 : { 57 3 : } 58 : }; 59 : 60 : //! @endcond 61 : 62 : #endif /* GDALALG_RASTER_ASTYPE_INCLUDED */