-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMFC_ImageProcessingDlg_BACKUP_748.h
More file actions
243 lines (181 loc) · 6.27 KB
/
Copy pathMFC_ImageProcessingDlg_BACKUP_748.h
File metadata and controls
243 lines (181 loc) · 6.27 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<<<<<<< HEAD
// MFC_ImageProcessingDlg.h: 头文件
//
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc.hpp>
#pragma once
// CMFCImageProcessingDlg 对话框
class CMFCImageProcessingDlg : public CDialogEx
{
// 构造
public:
CMFCImageProcessingDlg(CWnd* pParent = nullptr); // 标准构造函数
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_MFC_IMAGEPROCESSING_DIALOG };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 实现
protected:
HICON m_hIcon;
bool m_is_open = false; //判断是否打开了图片(鲁棒性)
//文本框数据
CRect m_textRect; //文本框位置
CString m_text; //文本
CFont m_font; //字体
int m_font_size; //字体大小
COLORREF m_font_col; //字体颜色
bool m_is_text = false; //判断是否为文本框模式
bool m_texted = false; //图片上是否添加过文本
// 生成的消息映射函数
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
//afx_msg void OnDestroy(); // 清理全局指针
DECLARE_MESSAGE_MAP();
public:
afx_msg void OnClickedOpenButton();
afx_msg void OnClickedSaveButton();
//定义变量存储图片信息
BITMAPINFO* pBmpInfo; //记录图像细节
BYTE* pBmpData; //图像数据
BITMAPFILEHEADER bmpHeader; //文件头
BITMAPINFOHEADER bmpInfo; //信息头
CFile bmpFile; //记录打开文件
CString FilePath; //记录打开文件路径
DWORD RowComplete; //记录每行比特填充的字节数
DWORD Bytes; // 计算位图数据大小
afx_msg void OnClickedRotation();
// 显示位图
void Show_Bmp(double hfactor, double wfactor);
afx_msg void OnClickedBlurButton();
afx_msg void OnClickedSharpButton();
void Save_Open_Temp_Bmp();
afx_msg void OnClickedScaleButton();
void Bmp2Mat(cv::Mat img, int height, int width);
void Mat2Bmp(cv::Mat img, int height, int width);
afx_msg void OnBnClickedTextButton();
//选择功能
CListBox m_func_select;
int cur_sel = 0;
afx_msg void OnSelchangeListFunc();
void CreateTextImage(CString& text, CRect& textRect,
const CString& textImagePath, const int font_size, const COLORREF& font_col);
void AddTextToImage(CString& text, CRect& textRect,
const int font_size, const COLORREF& font_col);
//图像分割
void OnBnClickedPicseg();
//调色
void AdjustInit(int choice,int factor);
CSliderCtrl m_slider_ad; // 声明滑块控件
int saturation_factor = 50; // 暂存饱和度滑块位置
int brightness_factor = 50; // 暂存亮度滑块位置
int warmth_factor = 50; // 暂存暖色滑块位置
//进度条
CProgressCtrl m_progress;
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnStnClickedStaticPic();
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//马赛克
bool ismosaic = 0;
CSliderCtrl nummosaic;
int nummo; //马赛克大小
CButton m_mosaic_button;
afx_msg void OnBnClickedButton1();
afx_msg void OnBnClickedButton2();
};
=======
// MFC_ImageProcessingDlg.h: 头文件
//
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc.hpp>
#pragma once
// CMFCImageProcessingDlg 对话框
class CMFCImageProcessingDlg : public CDialogEx
{
// 构造
public:
CMFCImageProcessingDlg(CWnd* pParent = nullptr); // 标准构造函数
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_MFC_IMAGEPROCESSING_DIALOG };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 实现
protected:
HICON m_hIcon;
bool m_is_open = false; //判断是否打开了图片(鲁棒性)
//文本框数据
CRect m_textRect; //文本框位置
CString m_text; //文本
CFont m_font; //字体
int m_font_size; //字体大小
COLORREF m_font_col; //字体颜色
bool m_is_text = false; //判断是否为文本框模式
bool m_texted = false; //图片上是否添加过文本
// 生成的消息映射函数
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
//afx_msg void OnDestroy(); // 清理全局指针
DECLARE_MESSAGE_MAP();
public:
afx_msg void OnClickedOpenButton();
afx_msg void OnClickedSaveButton();
//定义变量存储图片信息
BITMAPINFO* pBmpInfo; //记录图像细节
BYTE* pBmpData; //图像数据
BITMAPFILEHEADER bmpHeader; //文件头
BITMAPINFOHEADER bmpInfo; //信息头
CFile bmpFile; //记录打开文件
CString FilePath; //记录打开文件路径
DWORD RowComplete; //记录每行比特填充的字节数
DWORD Bytes; // 计算位图数据大小
afx_msg void OnClickedRotation();
// 显示位图
void Show_Bmp(double hfactor, double wfactor);
afx_msg void OnClickedBlurButton();
afx_msg void OnClickedSharpButton();
void Save_Open_Temp_Bmp();
afx_msg void OnClickedScaleButton();
void Bmp2Mat(cv::Mat img, int height, int width);
void Mat2Bmp(cv::Mat img, int height, int width);
afx_msg void OnBnClickedTextButton();
//选择功能
CListBox m_func_select;
int cur_sel = 0;
afx_msg void OnSelchangeListFunc();
void CreateTextImage(CString& text, CRect& textRect,
const CString& textImagePath, const int font_size, const COLORREF& font_col);
void AddTextToImage(CString& text, CRect& textRect,
const int font_size, const COLORREF& font_col);
//图像分割
void OnBnClickedPicseg();
//调色
void AdjustInit(int choice,int factor);
CSliderCtrl m_slider_ad; // 声明滑块控件
int saturation_factor = 50; // 暂存饱和度滑块位置
int brightness_factor = 50; // 暂存亮度滑块位置
int warmth_factor = 50; // 暂存暖色滑块位置
//进度条
CProgressCtrl m_progress;
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnStnClickedStaticPic();
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//马赛克
bool ismosaic = 0;
CSliderCtrl nummosaic;
int nummo; //马赛克大小
CButton m_mosaic_button;
afx_msg void OnBnClickedButton1();
afx_msg void OnBnClickedButton2();
};
>>>>>>> be1ca4f9e1c9d19f52644dd227ca4daa1c81f8bb