LCOV - code coverage report
Current view: top level - apps - gdalalg_raster_roughness.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 4 4 100.0 %
Date: 2025-06-19 12:30:01 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  "roughness" 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_ROUGHNESS_INCLUDED
      14             : #define GDALALG_RASTER_ROUGHNESS_INCLUDED
      15             : 
      16             : #include "gdalalg_raster_pipeline.h"
      17             : 
      18             : #include <limits>
      19             : 
      20             : //! @cond Doxygen_Suppress
      21             : 
      22             : /************************************************************************/
      23             : /*                     GDALRasterRoughnessAlgorithm                     */
      24             : /************************************************************************/
      25             : 
      26             : class GDALRasterRoughnessAlgorithm /* non final */
      27             :     : public GDALRasterPipelineStepAlgorithm
      28             : {
      29             :   public:
      30             :     static constexpr const char *NAME = "roughness";
      31             :     static constexpr const char *DESCRIPTION = "Generate a roughness map";
      32             :     static constexpr const char *HELP_URL =
      33             :         "/programs/gdal_raster_roughness.html";
      34             : 
      35             :     explicit GDALRasterRoughnessAlgorithm(bool standaloneStep = false);
      36             : 
      37             :   private:
      38             :     bool RunStep(GDALPipelineStepRunContext &ctxt) override;
      39             : 
      40             :     int m_band = 1;
      41             :     bool m_noEdges = false;
      42             : };
      43             : 
      44             : /************************************************************************/
      45             : /*                 GDALRasterRoughnessAlgorithmStandalone               */
      46             : /************************************************************************/
      47             : 
      48          24 : class GDALRasterRoughnessAlgorithmStandalone final
      49             :     : public GDALRasterRoughnessAlgorithm
      50             : {
      51             :   public:
      52          12 :     GDALRasterRoughnessAlgorithmStandalone()
      53          12 :         : GDALRasterRoughnessAlgorithm(/* standaloneStep = */ true)
      54             :     {
      55          12 :     }
      56             : 
      57             :     ~GDALRasterRoughnessAlgorithmStandalone() override;
      58             : };
      59             : 
      60             : //! @endcond
      61             : 
      62             : #endif /* GDALALG_RASTER_ROUGHNESS_INCLUDED */

Generated by: LCOV version 1.14