| 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Project: GDAL |
| 4 | * Purpose: "nodata-to-alpha" 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_NODATA_TO_ALPHA_INCLUDED |
| 14 | #define GDALALG_RASTER_NODATA_TO_ALPHA_INCLUDEDcxx . . $ `apps/gdalalg_raster_nodata_to_alpha.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 | /* GDALRasterNoDataToAlphaAlgorithm */ |
| 22 | /************************************************************************/ |
| 23 | |
| 24 | class GDALRasterNoDataToAlphaAlgorithmcxx . . $ GDALRasterNoDataToAlphaAlgorithm# /* non final */ |
| 25 | : public GDALRasterPipelineStepAlgorithmcxx . . $ GDALRasterPipelineStepAlgorithm# |
| 26 | { |
| 27 | public: |
| 28 | static constexpr const char *NAMEcxx . . $ GDALRasterNoDataToAlphaAlgorithm#NAME. = "nodata-to-alpha"; |
| 29 | static constexpr const char *DESCRIPTIONcxx . . $ GDALRasterNoDataToAlphaAlgorithm#DESCRIPTION. = |
| 30 | "Replace nodata value(s) with an alpha band."; |
| 31 | static constexpr const char *HELP_URLcxx . . $ GDALRasterNoDataToAlphaAlgorithm#HELP_URL. = |
| 32 | "/programs/gdal_raster_nodata_to_alpha.html"; |
| 33 | |
| 34 | explicit GDALRasterNoDataToAlphaAlgorithmcxx . . $ GDALRasterNoDataToAlphaAlgorithm#GDALRasterNoDataToAlphaAlgorithm(b45ddcbc8423892c).(bool standaloneStep = false); |
| 35 | |
| 36 | private: |
| 37 | bool RunStepcxx . . $ GDALRasterNoDataToAlphaAlgorithm#RunStep(f551efd8892e175).(GDALPipelineStepRunContextcxx . . $ GDALPipelineStepRunContext# &ctxt) override; |
| 38 | |
| 39 | stdcxx . . $ std/::vector<double> m_nodatacxx . . $ GDALRasterNoDataToAlphaAlgorithm#m_nodata.{}; |
| 40 | |
| 41 | // Work variables |
| 42 | stdcxx . . $ std/::unique_ptr<GDALDatasetcxx . . $ GDALDataset#> m_tempDScxx . . $ GDALRasterNoDataToAlphaAlgorithm#m_tempDS.{}; |
| 43 | }; |
| 44 | |
| 45 | /************************************************************************/ |
| 46 | /* GDALRasterNoDataToAlphaAlgorithmStandalone */ |
| 47 | /************************************************************************/ |
| 48 | |
| 49 | class GDALRasterNoDataToAlphaAlgorithmStandalonecxx . . $ GDALRasterNoDataToAlphaAlgorithmStandalone# final |
| 50 | : public GDALRasterNoDataToAlphaAlgorithmcxx . . $ GDALRasterNoDataToAlphaAlgorithm# |
| 51 | { |
| 52 | public: |
| 53 | GDALRasterNoDataToAlphaAlgorithmStandalonecxx . . $ GDALRasterNoDataToAlphaAlgorithmStandalone#GDALRasterNoDataToAlphaAlgorithmStandalone(49f6e7a06ebc5aa8).() |
| 54 | : GDALRasterNoDataToAlphaAlgorithmcxx . . $ GDALRasterNoDataToAlphaAlgorithm#GDALRasterNoDataToAlphaAlgorithm(b45ddcbc8423892c).(/* standaloneStep = */ true) |
| 55 | { |
| 56 | } |
| 57 | |
| 58 | ~cxx . . $ GDALRasterNoDataToAlphaAlgorithmStandalone#`~GDALRasterNoDataToAlphaAlgorithmStandalone`(ced63f7c635d850d).GDALRasterNoDataToAlphaAlgorithmStandalonecxx . . $ GDALRasterNoDataToAlphaAlgorithmStandalone#() override; |
| 59 | }; |
| 60 | |
| 61 | //! @endcond |
| 62 | |
| 63 | #endif /* GDALALG_RASTER_NODATA_TO_ALPHA_INCLUDED */ |