SDC C-Project CF Review 프로그램
LYW
2021-06-23 598cef9de915e5554fc2f7572b24f15d8a4acf41
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
#pragma once
 
#include "CHImageControls/CHRectTracker.h"
#include "CHCameraViewer/CameraView.h"
// CCameraView_Review
 
class AFX_EXT_CLASS CCameraView_Review : public CCameraView
{
    DECLARE_DYNAMIC(CCameraView_Review)
 
public:
    CCameraView_Review(int nViewIndex=0, CWnd* pParentWnd=NULL);
    virtual ~CCameraView_Review();
 
    BOOL GetAoiImage(CCHImageData* pImageData);
    BOOL SetAoiImage(CCHImageData* pImageData);
    BOOL SetAoiImage(int nWidth, int nHeight, int nChannels, int nWidthStep, const BYTE* pBuffer);
 
    // loader
    BOOL    LoadAoiImage(const CString& strFilename);
 
    void    SetDrawRoiRect(BOOL bDraw);
    void    SetDrawReviewAlignRect(BOOL bDraw);
    void    SetDrawDefectPos(BOOL bDraw);
    void    SetDrawAoiDefect(BOOL bDraw);
    
    void    SetTrackerRect(const CRect& rtRect);
    BOOL    GetTrackerRect(CRect& rtRect);
    void    ClearTrackerRect();
    void    SetDefectPos(const CPoint& ptPoint);
 
    // Reivew Align Rect
    void SetReviewAlginRect(BOOL bShow, const CRect& rtRect);
    BOOL GetReviewAlginRect(CRect& rtRect);
 
protected:
    DECLARE_MESSAGE_MAP()
    afx_msg void OnPaint();
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
    afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
    
    afx_msg void OnSaveAsImage();
    afx_msg void OnChangeView();
    afx_msg void OnROIRect();
    afx_msg void OnAoiDefect();
    afx_msg void OnDefectPos();
    afx_msg void OnClearROIRect();
    afx_msg void OnSaveROIRect();
    afx_msg void OnLoadAoiImage();
 
protected:
    void    DrawROIRect(CDC *pDC);
    void    DrawReviewAlignRect(CDC *pDC);
    void    DrawDefectPos(CDC *pDC);
    void    DrawAoiDefect(CDC *pDC);
    virtual void PopUpCommandMenu(const CPoint& point);
    
protected:
    // roi
    BOOL            m_bDrawRoiRect;
    CRect            m_rtRoiRect;
    SPixelInfo        m_sROIInfo;
 
    // Reveiw Align
    BOOL            m_bDrawReviewAlignRect;
    CRect            m_rtReviewAlignRect;
 
    // defect pos
    BOOL            m_bDrawDefectPos;
    CPoint            m_ptDefectPos;
 
    // aoi defect
    BOOL            m_bDrawAoiDefect;
    CRect            m_rtAoiDefectRect;
    CCHImageData    m_AoiDefectImage;
 
    // tracker
    BOOL            m_bDrawTracker;
    CPoint            m_ptTrackerStart;
    CCHRectTracker    m_rectTracker;
 
 
};