GDAL

gdalalg_raster_clean_collar.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "raster clean-collar" subcommand
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_CLEAN_COLLAR_INCLUDED
14#define GDALALG_RASTER_CLEAN_COLLAR_INCLUDED
15
16#include "gdalalgorithm.h"
17
19
20/************************************************************************/
21/* GDALRasterCleanCollarAlgorithm */
22/************************************************************************/
23
24 class GDALRasterCleanCollarAlgorithm final : public GDALAlgorithm
25{
26 public:
27 static constexpr const char *NAME = "clean-collar";
28 static constexpr const char *DESCRIPTION =
29 "Clean the collar of a raster dataset, removing noise.";
30 static constexpr const char *HELP_URL =
31 "/programs/gdal_raster_clean_collar.html";
32
33 explicit GDALRasterCleanCollarAlgorithm();
34
35 private:
36 bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
37
38 GDALArgDatasetValue m_inputDataset{};
39 std::vector<std::string> m_openOptions{};
40 std::vector<std::string> m_inputFormats{};
41
42 std::string m_format{};
43 GDALArgDatasetValue m_outputDataset{};
44 std::vector<std::string> m_creationOptions{};
45 bool m_update = false;
46 bool m_overwrite = false;
47 std::vector<std::string> m_color{};
48 int m_colorThreshold = 15;
49 int m_pixelDistance = 2;
50 bool m_addAlpha = false;
51 bool m_addMask = false;
52 std::string m_algorithm = "floodfill";
53};
54
56
57#endif
GDALAlgorithm
GDAL algorithm.
Definition gdalalgorithm_cpp.h:2261
GDALArgDatasetValue
Value for an argument that points to a GDALDataset.
Definition gdalalgorithm_cpp.h:149