-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathapplication.hpp
51 lines (44 loc) · 1.25 KB
/
application.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <string>
#include <iostream>
#include <opencv2/core/core.hpp>
#include "processing.hpp"
bool onButtonClicked(cv::Rect buttonPlace, int x, int y);
void onButtonsOnOffClick(int eventId, int x, int y, int flags, void *userData);
class Application
{
public:
enum WindowState
{
OnFilter,
OffFilter,
SaveFilter
};
struct Parameters
{
std::string imgFileName;
};
struct GUIElementsState
{
WindowState state;
cv::Rect onButtonPlace;
cv::Rect offButtonPlace;
cv::Rect saveButtonPlace;
};
int parseArguments(int argc, const char **argv, Parameters ¶ms);
int getFrame(const std::string &fileName, cv::Mat& src);
int processFrame(const cv::Mat& src, cv::Mat& dst);
int showFrame(const std::string &caption,
const cv::Mat& src, cv::Mat& dst);
friend void onButtonsOnOffClick(int eventId, int x, int y,
int flags, void *userData);
Application()
{
guiState.state = OnFilter;
};
private:
Processing processor;
GUIElementsState guiState;
int drawButtons(cv::Mat &display);
friend bool onButtonClicked(cv::Rect buttonPlace, int x, int y);
};