Skip to content

Commit 5731ff6

Browse files
authored
Merge pull request #3 from SSARCandy/macos-fix
Fix macOS build
2 parents 632ea00 + 7526585 commit 5731ff6

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

include/gui.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MyFrame : public wxFrame {
4545
wxStaticText *slider_sigma1_t;
4646
wxStaticText *slider_sigma2_t;
4747
wxStaticText *slider_t_t;
48-
void addlog(wxString info, wxColour& color);
48+
void addlog(wxString info, const wxColour& color);
4949
void activateRenderLoop(bool on);
5050

5151
protected:
@@ -120,4 +120,4 @@ enum {
120120
SLIDER_SIGMA_M_T,
121121
SLIDER_SIGMA_C_T,
122122
SLIDER_ETF_KERNEL_T,
123-
};
123+
};

include/postProcessing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using namespace std;
55

6+
#define M_PI 3.14159265358979323846
7+
68
class PP {
79
public:
810
PP(cv::Size);

src/gui.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
4444
#pragma endregion
4545

4646
#pragma region ToolBar: Buttons(Start, Fill Ink, Clean), Combobox(processingBox)
47-
wxToolBar *toolbar1 = new wxToolBar(this, wxID_ANY);
48-
start = new wxButton(toolbar1, BUTTON_Start, _T("Start"), wxDefaultPosition, wxDefaultSize, 0);
49-
clean = new wxButton(toolbar1, BUTTON_Clean, _T("Clean"), wxDefaultPosition, wxDefaultSize, 0);
47+
wxToolBar *toolbar1 = CreateToolBar();
48+
start = new wxButton(toolbar1, BUTTON_Start, _T("Start"), wxDefaultPosition, wxSize(100, 40), 0);
49+
clean = new wxButton(toolbar1, BUTTON_Clean, _T("Clean"), wxDefaultPosition, wxSize(100, 40), 0);
5050

5151
processingBox = new wxComboBox(toolbar1, COMBOBOX_Processing, "Original Image", wxDefaultPosition, wxSize(200, 20), 0);
5252
processingBox->Append("Original Image");
@@ -214,7 +214,8 @@ void MyFrame::OnOpenSrc(wxCommandEvent& event) {
214214
dp->SetMinSize(img);
215215
this->Layout();
216216

217-
drawPane->paintNow(true);
217+
render_loop_on = true;
218+
activateRenderLoop(render_loop_on);
218219
}
219220

220221
void MyFrame::OnSaveResult(wxCommandEvent& event) {
@@ -288,7 +289,7 @@ void MyFrame::OnIterativeFDoG(wxCommandEvent& event) {
288289

289290
//Comboboxes
290291
void MyFrame::OnProcessingBox(wxCommandEvent& event) {
291-
string s = processingBox->GetValue();
292+
wxString s = processingBox->GetValue();
292293
drawPane->processingS = s;
293294

294295
if (s == "ETF" || s=="ETF-debug") {
@@ -359,7 +360,7 @@ void MyFrame::OnSliderTau(wxCommandEvent& event) {
359360
drawPane->paintNow(true); //execute action
360361
}
361362

362-
void MyFrame::addlog(wxString info, wxColour& color) {
363+
void MyFrame::addlog(wxString info, const wxColour& color) {
363364
time_t currentTime;// for logging current time
364365
struct tm *localTime;// for logging current time
365366
time(&currentTime); // Get the current time
@@ -445,4 +446,4 @@ void BasicDrawPane::render(wxDC& dc, bool render_loop_on) {
445446
wxBitmap bmp(img);
446447
dc.DrawBitmap(bmp, 0, 0);
447448
}
448-
#pragma endregion
449+
#pragma endregion

src/postProcessing.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ PP::PP(Size s) {}
77

88
// visualize the ETF
99
void PP::ETF(Mat &flowfield, Mat &dis) {
10-
const float M_PI = 3.14159265358979323846;
1110
Mat noise = Mat::zeros(cv::Size(flowfield.cols / 2, flowfield.rows / 2), CV_32F);
1211
dis = Mat::zeros(flowfield.size(), CV_32F);
1312
randu(noise, 0, 1.0f);
@@ -72,4 +71,4 @@ void PP::AntiAlias(cv::Mat & src, cv::Mat & dst) {
7271

7372
normalize(src, dst, 60, 255, NORM_MINMAX);
7473
GaussianBlur(dst, dst, Size(BLUR_SIZE, BLUR_SIZE), 0, 0);
75-
}
74+
}

0 commit comments

Comments
 (0)