-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewProject01View.h
More file actions
147 lines (122 loc) · 3.39 KB
/
NewProject01View.h
File metadata and controls
147 lines (122 loc) · 3.39 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
// NewProject01View.h : CNewProject01View 클래스의 인터페이스
//
#pragma once
#include "resource.h"
#include "Resource.h"
#include "NewProject01Doc.h"
#include "cdib.h"
#include "afxwin.h"
#include <iostream>
#include <vector>
#include "Preview.h"
#include <gdiplus.h>
//using namespace Gdiplus;
//#pragma comment (lib,"gdiplus.lib")
/*
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
//using namespace std;
*/
class CNewProject01View : public CFormView
{
protected: // serialization에서만 만들어집니다.
CNewProject01View();
DECLARE_DYNCREATE(CNewProject01View)
public:
int imgBPP; //이미지의 pixel 당 비트수
unsigned char** CNewProject01View::malloc2D(int h, int w);
void CNewProject01View::free2DImage(unsigned char** image, int h);
void CNewProject01View::PointColor(CImage *image, int x, int y, COLORREF c, int m_nBitDepth);
//preview에서 눌러진 좌표로 이동하는 함수
void CNewProject01View::pointmove(CPoint movepoint);
//이미지의 pixel값을 받아올 함수
unsigned char** inImageR = NULL;
unsigned char** inImageG = NULL;
unsigned char** inImageB = NULL;
unsigned char** outImageR = NULL;
unsigned char** outImageG = NULL;
unsigned char** outImageB = NULL;
int inH = 0;
int inW = 0;
int outH = 0;
int outW = 0;
Preview *pre;
CRect this_rect;
CPoint p_point;
CPoint m_point;
CImage ero_image;
double zoom;
int m_nMagnify;
//불러오는 이미지의 크기 선언
double i_wid;
double i_hei;
//폼에 나타낼 크기 선언
double wid;
double hei;
//이미지에서 폼에 나타낼 좌표 표현 TopLeft=(x1,y1) BottomRight=(x2,y2)
double x1, x2, y1, y2;
private:
HBITMAP hbitmap;
CNewProject01Doc* pDoc;
CDC *mp_display_memory;
CBitmap *mp_bitmap, *mp_old_bitmap;
CRect m_image_rect;
CImage Buf_image;
CString strPathname;
CDib rtrt;
CRect image_rect;
double x, y;
CSize image_xy;
HANDLE bmp;
CBitmap cBitmap;
BITMAP bmpinfo;
protected:
public:
enum{ IDD = IDD_NEWPROJECT01_FORM };
// 특성입니다.
public:
CNewProject01Doc* GetDocument() const;
// 작업입니다.
public:
// 재정의입니다.
public:
void DrawClipImage(HDC ah_dc, CImage *ap_image, POINT a_clip_start_pos, POINT a_clip_end_pos,
int a_use_fixed_pos = 0, int a_fixed_x = 0, int a_fixed_y = 0);
virtual void OnDraw(CDC* pDC);
CRect CNewProject01View::Zoom_in_out(int m_nMagnify);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원입니다.
virtual void OnInitialUpdate(); // 생성 후 처음 호출되었습니다.
// 구현입니다.
public:
BITMAPINFO* BmInfo;
virtual ~CNewProject01View();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// 생성된 메시지 맵 함수
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnImageLoadImage();
afx_msg void OnUpdateImageLoadimage(CCmdUI *pCmdUI);
afx_msg void OnImageSaveImage();
afx_msg void OnImageErrosion();
afx_msg void OnImageDilation();
afx_msg void OnDestroy();
// CStatic m_stDisp;
// CStatic M_stDisp;
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnBnClickedButton1();
afx_msg void OnBnClickederrosion();
afx_msg void OnBnClickedDilation();
};
#ifndef _DEBUG // NewProject01View.cpp의 디버그 버전
inline CNewProject01Doc* CNewProject01View::GetDocument() const
{ return reinterpret_cast<CNewProject01Doc*>(m_pDocument); }
#endif