| 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Project: GDAL |
| 4 | * Purpose: "neighbors" 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_NEIGHBORS_INCLUDED |
| 14 | #define GDALALG_RASTER_NEIGHBORS_INCLUDEDcxx . . $ `apps/gdalalg_raster_neighbors.h:14:9`! |
| 15 | |
| 16 | #include "gdalalg_raster_pipeline.h"cxx . . $ `<file>/apps/gdalalg_raster_pipeline.h`/ |
| 17 | |
| 18 | //! @cond Doxygen_Suppress |
| 19 | |
| 20 | /************************************************************************/ |
| 21 | /* GDALRasterNeighborsAlgorithm */ |
| 22 | /************************************************************************/ |
| 23 | |
| 24 | class GDALRasterNeighborsAlgorithmcxx . . $ GDALRasterNeighborsAlgorithm# : public GDALRasterPipelineStepAlgorithmcxx . . $ GDALRasterPipelineStepAlgorithm# |
| 25 | { |
| 26 | public: |
| 27 | explicit GDALRasterNeighborsAlgorithmcxx . . $ GDALRasterNeighborsAlgorithm#GDALRasterNeighborsAlgorithm(9f0ba574c1c44ffc).(bool standaloneStep = false) noexcept; |
| 28 | |
| 29 | static constexpr const char *NAMEcxx . . $ GDALRasterNeighborsAlgorithm#NAME. = "neighbors"; |
| 30 | static constexpr const char *DESCRIPTIONcxx . . $ GDALRasterNeighborsAlgorithm#DESCRIPTION. = |
| 31 | "Compute the value of each pixel from its neighbors (focal statistics)"; |
| 32 | static constexpr const char *HELP_URLcxx . . $ GDALRasterNeighborsAlgorithm#HELP_URL. = |
| 33 | "/programs/gdal_raster_neighbors.html"; |
| 34 | |
| 35 | static stdcxx . . $ std/::vector<stdcxx . . $ std/::string> GetAliasesStaticcxx . . $ GDALRasterNeighborsAlgorithm#GetAliasesStatic(c1a9bfb60daa162d).() |
| 36 | { |
| 37 | return {"neighbours"}; |
| 38 | } |
| 39 | |
| 40 | private: |
| 41 | bool RunStepcxx . . $ GDALRasterNeighborsAlgorithm#RunStep(f551efd8892e175).(GDALPipelineStepRunContextcxx . . $ GDALPipelineStepRunContext# &ctxt) override; |
| 42 | |
| 43 | int m_bandcxx . . $ GDALRasterNeighborsAlgorithm#m_band. = 0; |
| 44 | stdcxx . . $ std/::vector<stdcxx . . $ std/::string> m_methodcxx . . $ GDALRasterNeighborsAlgorithm#m_method.{}; |
| 45 | int m_sizecxx . . $ GDALRasterNeighborsAlgorithm#m_size. = 0; |
| 46 | stdcxx . . $ std/::vector<stdcxx . . $ std/::string> m_kernelcxx . . $ GDALRasterNeighborsAlgorithm#m_kernel.{}; |
| 47 | stdcxx . . $ std/::string m_typecxx . . $ GDALRasterNeighborsAlgorithm#m_type.{}; |
| 48 | stdcxx . . $ std/::string m_nodatacxx . . $ GDALRasterNeighborsAlgorithm#m_nodata.{}; |
| 49 | }; |
| 50 | |
| 51 | /************************************************************************/ |
| 52 | /* GDALRasterNeighborsAlgorithmStandalone */ |
| 53 | /************************************************************************/ |
| 54 | |
| 55 | class GDALRasterNeighborsAlgorithmStandalonecxx . . $ GDALRasterNeighborsAlgorithmStandalone# final |
| 56 | : public GDALRasterNeighborsAlgorithmcxx . . $ GDALRasterNeighborsAlgorithm# |
| 57 | { |
| 58 | public: |
| 59 | GDALRasterNeighborsAlgorithmStandalonecxx . . $ GDALRasterNeighborsAlgorithmStandalone#GDALRasterNeighborsAlgorithmStandalone(49f6e7a06ebc5aa8).() |
| 60 | : GDALRasterNeighborsAlgorithmcxx . . $ GDALRasterNeighborsAlgorithm#GDALRasterNeighborsAlgorithm(9f0ba574c1c44ffc).(/* standaloneStep = */ true) |
| 61 | { |
| 62 | } |
| 63 | |
| 64 | ~cxx . . $ GDALRasterNeighborsAlgorithmStandalone#`~GDALRasterNeighborsAlgorithmStandalone`(ced63f7c635d850d).GDALRasterNeighborsAlgorithmStandalonecxx . . $ GDALRasterNeighborsAlgorithmStandalone#() override; |
| 65 | }; |
| 66 | |
| 67 | //! @endcond |
| 68 | |
| 69 | #endif /* GDALALG_RASTER_CALC_INCLUDED */ |