LCOV - code coverage report
Current view: top level - apps - gdalalg_raster_set_type.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 3 3 100.0 %
Date: 2025-05-15 18:21:54 Functions: 1 1 100.0 %

          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_SET_TYPE_INCLUDED
      14             : #define GDALALG_RASTER_SET_TYPE_INCLUDED
      15             : 
      16             : #include "gdalalg_raster_pipeline.h"
      17             : 
      18             : //! @cond Doxygen_Suppress
      19             : 
      20             : /************************************************************************/
      21             : /*                   GDALRasterSetTypeAlgorithm                         */
      22             : /************************************************************************/
      23             : 
      24             : class GDALRasterSetTypeAlgorithm /* non final */
      25             :     : public GDALRasterPipelineStepAlgorithm
      26             : {
      27             :   public:
      28             :     static constexpr const char *NAME = "set-type";
      29             :     static constexpr const char *DESCRIPTION =
      30             :         "Modify the data type of bands of a raster dataset.";
      31             :     static constexpr const char *HELP_URL =
      32             :         "/programs/gdal_raster_set_type.html";
      33             : 
      34             :     explicit GDALRasterSetTypeAlgorithm(bool standaloneStep = false);
      35             : 
      36             :   private:
      37             :     bool RunStep(GDALProgressFunc pfnProgress, void *pProgressData) override;
      38             : 
      39             :     std::string m_type{};
      40             : };
      41             : 
      42             : /************************************************************************/
      43             : /*                GDALRasterSetTypeAlgorithmStandalone                  */
      44             : /************************************************************************/
      45             : 
      46             : class GDALRasterSetTypeAlgorithmStandalone final
      47             :     : public GDALRasterSetTypeAlgorithm
      48             : {
      49             :   public:
      50           4 :     GDALRasterSetTypeAlgorithmStandalone()
      51           4 :         : GDALRasterSetTypeAlgorithm(/* standaloneStep = */ true)
      52             :     {
      53           4 :     }
      54             : };
      55             : 
      56             : //! @endcond
      57             : 
      58             : #endif /* GDALALG_RASTER_SET_TYPE_INCLUDED */

Generated by: LCOV version 1.14