KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_convert_image_to_outlines.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <functional>
23
24#include <dialog_shim.h>
25#include <wx/arrstr.h>
26
27class wxCheckBox;
28class wxChoice;
29class wxSlider;
30
31
38{
39public:
46 DIALOG_CONVERT_IMAGE_TO_OUTLINES( wxWindow* aParent, const wxArrayString& aLayerNames, int aSelectedLayer,
47 std::function<void( double, bool )> aOnChange );
48
50 double GetThreshold() const;
51
52 bool GetInvert() const;
53
55 int GetLayerSelection() const;
56
57private:
58 void onSettingChanged( wxCommandEvent& aEvent );
59 void onThresholdScrolled( wxScrollEvent& aEvent );
60
61 wxSlider* m_threshold;
62 wxCheckBox* m_invert;
63 wxChoice* m_layer;
64 std::function<void( double, bool )> m_onChange;
65};
double GetThreshold() const
Brightness cut deciding which pixels are traced, from 0 to 1.
int GetLayerSelection() const
Index into the layer names given to the constructor, or -1 when there were none.
DIALOG_CONVERT_IMAGE_TO_OUTLINES(wxWindow *aParent, const wxArrayString &aLayerNames, int aSelectedLayer, std::function< void(double, bool)> aOnChange)
std::function< void(double, bool)> m_onChange
DIALOG_SHIM(wxWindow *aParent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, const wxString &name=wxDialogNameStr)