SDC C-Project CF Review 프로그램
LYW
2021-10-15 e5fa774d622d6852fe8e1f033045aed221649108
ReviewHistory/ReveiwHistory/CameraImageView.h
»õ ÆÄÀÏ
@@ -0,0 +1,139 @@
#pragma once
#include "CHImageControls/CHImageData.h"
#define IDR_LOAD_IMAGE      9000
#define IDR_SAVE_IMAGE      9001
#define IDR_ONLY_SAVE_IMAGE   9002
#define IDR_CENTER_LINE      9100
#define IDR_RULER         9101
#define IDR_ROI_RECT      9102
#define IDR_CLEAR_ROI_RECT   9103
#define IDR_SAVE_ROI_RECT   9104
#define IDR_VIEW_ORIGIN      9200
#define IDR_VIEW_FIT      9201
#define IDR_VIEW_COLOR      9300
#define IDR_VIEW_GRAY      9301
#define IDR_VIEW_RED      9302
#define IDR_VIEW_BLUE      9303
#define IDR_VIEW_GREEN      9304
// CDlgHistory ëŒ€í™” ìƒìžìž…니다.
interface ICameraImageView2Parent
{
   virtual void CIV2P_GetImagePathName(CString& strFilename) = 0;
   virtual void CIV2P_ManualSimulation(CCHImageData* pImageData) = 0;
};
class CCameraImageView : public CWnd, public CCHImageData
{
   DECLARE_DYNAMIC(CCameraImageView)
public:
   CCameraImageView(CWnd *pParentWnd);
   virtual ~CCameraImageView();
   void SetCIV2P(ICameraImageView2Parent* pCIV2P)      { m_pCIV2P = pCIV2P; }
   BOOL GetViewImage(CCHImageData* pImageData);
   BOOL GetOriginImage(CCHImageData* pImageData);
   BOOL SetViewImage(CCHImageData* pImageData);
   BOOL SetOriginImage(CCHImageData* pImageData);
   BOOL SetOriginImage(int nWidth, int nHeight, int nChannels, int nWidthStep, const BYTE* pBuffer);
   // getter
   int      GetScaleWidth(void);
   int      GetScaleHeight(void);
   int      GetHScrollPos(void);
   int      GetVScrollPos(void);
   double   GetWidthScale()      { return m_dWidthScale; }
   double   GetHeightScale()   { return m_dHeightScale; }
   // setter
   void   SetDrawObject(BOOL bDraw);
   void   SetDrawMode(int nDrawMode);
   void   SetViewName(const CString strViewName);
   void   SetParentWnd(CWnd* pParentWnd);
   void   SetDrawCenterLine(BOOL bDraw);
   void   SetDrawRuler(BOOL bDraw);
   void   SetResolution(double dRes);
   void   SetRulerGab(double dGab);
   BOOL   LoadImage(const CString& strFilename);
protected:
   void   UpdateImageView(CDC *pDC);
   void   DrawCenterLine(CDC *pDC);
   void   DrawRuler(CDC *pDC);
   void   DrawViewName(CDC *pDC);
   ICameraImageView2Parent*   m_pCIV2P;
   CRITICAL_SECTION   m_csImageData;
   CWnd            *m_pParentWnd;
   CString            m_strViewName;
   CCHImageData      m_OriginImage;
   // pre draw info
   int         m_nViewBand;
   CRect      m_rtClientRect;
   int         m_nScaleWidth;
   int         m_nScaleHeight;
   double      m_dWidthScale;
   double      m_dHeightScale;
   // Scroll Pos
   int         m_nVScroll;
   int         m_nHScroll;
   // Max Scroll Pos
   int         m_nMaxVScroll;
   int         m_nMaxHScroll;
   // image draw
   int         m_nDrawMode;
   BOOL      m_bDrawViewName;
   BOOL      m_bDrawCenterLine;
   BOOL      m_bDrawRuler;
   double      m_dRulerGab;
   double      m_dResolution;
protected:
   DECLARE_MESSAGE_MAP()
   afx_msg void OnLoadImage();
   afx_msg void OnSaveImage();
   afx_msg void OnCenterLine();
   afx_msg void OnRuler();
   afx_msg void OnViewOrigin();
   afx_msg void OnViewFit();
   afx_msg void OnViewColor();
   afx_msg void OnViewGray();
   afx_msg void OnViewRed();
   afx_msg void OnViewGreen();
   afx_msg void OnViewBlue();
   afx_msg void OnDestroy();
   afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
   afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
   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);
public:
};
// typedef std::vector<CCameraImageView*>               VectorCameraImageView;
// typedef std::vector<CCameraImageView*>::iterator      VectorCameraImageViewIt;