LCOV - code coverage report
Current view: top level - apps - gdalalg_raster_resize.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 4 4 100.0 %
Date: 2025-11-01 22:59:07 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  "resize" 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_RESIZE_INCLUDED
      14             : #define GDALALG_RASTER_RESIZE_INCLUDED
      15             : 
      16             : #include "gdalalg_raster_pipeline.h"
      17             : 
      18             : //! @cond Doxygen_Suppress
      19             : 
      20             : /************************************************************************/
      21             : /*                     GDALRasterResizeAlgorithm                        */
      22             : /************************************************************************/
      23             : 
      24             : class GDALRasterResizeAlgorithm /* non final */
      25             :     : public GDALRasterPipelineStepAlgorithm
      26             : {
      27             :   public:
      28             :     static constexpr const char *NAME = "resize";
      29             :     static constexpr const char *DESCRIPTION =
      30             :         "Resize a raster dataset without changing the georeferenced extents.";
      31             :     static constexpr const char *HELP_URL = "/programs/gdal_raster_resize.html";
      32             : 
      33             :     explicit GDALRasterResizeAlgorithm(bool standaloneStep = false);
      34             : 
      35             :   private:
      36             :     bool RunStep(GDALPipelineStepRunContext &ctxt) override;
      37             : 
      38             :     std::vector<std::string> m_size{};
      39             :     std::vector<double> m_resolution{};
      40             :     std::string m_resampling{};
      41             : };
      42             : 
      43             : /************************************************************************/
      44             : /*                  GDALRasterResizeAlgorithmStandalone                 */
      45             : /************************************************************************/
      46             : 
      47          22 : class GDALRasterResizeAlgorithmStandalone final
      48             :     : public GDALRasterResizeAlgorithm
      49             : {
      50             :   public:
      51          11 :     GDALRasterResizeAlgorithmStandalone()
      52          11 :         : GDALRasterResizeAlgorithm(/* standaloneStep = */ true)
      53             :     {
      54          11 :     }
      55             : 
      56             :     ~GDALRasterResizeAlgorithmStandalone() override;
      57             : };
      58             : 
      59             : //! @endcond
      60             : 
      61             : #endif /* GDALALG_RASTER_RESIZE_INCLUDED */

Generated by: LCOV version 1.14