source: eviacam/trunk/fuentes/wxcamwindow/camwindow.h @ 567

Last change on this file since 567 was 567, checked in by mabarracus, 4 years ago

updated sources to version 2.0.3

  • Property svn:executable set to *
File size: 3.0 KB
Line 
1/////////////////////////////////////////////////////////////////////////////
2// Name:        camwindow.h
3// Purpose:             wxPanel derived class to show live camera image
4// Author:      Cesar Mauri Loba (cesar at crea-si dot com)
5// Modified by:
6// Created:     
7// Copyright:   (C) 2008 Cesar Mauri Loba - CREA Software Systems
8//
9//  This program is free software: you can redistribute it and/or modify
10//  it under the terms of the GNU General Public License as published by
11//  the Free Software Foundation, either version 3 of the License, or
12//  (at your option) any later version.
13//
14//  This program is distributed in the hope that it will be useful,
15//  but WITHOUT ANY WARRANTY; without even the implied warranty of
16//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17//  GNU General Public License for more details.
18//
19//  You should have received a copy of the GNU General Public License
20//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21/////////////////////////////////////////////////////////////////////////////
22
23#ifndef _CAMWINDOW_H_
24#define _CAMWINDOW_H_
25
26// Includes
27#include <wx/panel.h>
28#include <wx/bitmap.h>
29#include <crvimage.h>
30#include <list>
31using namespace std;
32
33// Forward class declarations
34class CVisibleNormROI;
35class CWXNormROI;
36
37class CCamWindow : public wxPanel
38{     
39public:
40        //CCamWindow( wxWindow* parent, const wxPoint& pos, const wxSize& size );
41        CCamWindow();
42        CCamWindow(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSIMPLE_BORDER); //, const wxString& name = _T("camwindow"));
43       
44        bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSIMPLE_BORDER); //, const wxString& name = _T("camwindow"));
45       
46        virtual ~CCamWindow(void);
47
48        // Draw method
49        void DrawCam (IplImage* pImg);
50
51        // True if all ok, false if control already registered
52        bool RegisterControl (CVisibleNormROI* pVisibleNormROI);
53
54        // True if all ok, false if control wasn't registered
55        bool UnregisterControl (CVisibleNormROI* pVisibleNormROI);     
56
57private:
58        typedef std::list<CWXNormROI> TWXNormROIList;
59        typedef TWXNormROIList::iterator TWXNormROIListIterator;
60
61        void OnPaint(wxPaintEvent& event);
62        void OnSize(wxSizeEvent& event);
63        void OnEvtMotion ( wxMouseEvent& event );
64        void OnEvtLeftDClick ( wxMouseEvent& event );
65        void OnRecvRefresh( wxCommandEvent &event );
66        //TWXNormROIListIterator FindControl (CVisibleNormROI* pVisibleNormROI);
67        bool FindControl (CVisibleNormROI* pVisibleNormROI, TWXNormROIListIterator &it);
68       
69        void ResizeParentClientArea(int width, int height);
70
71        void Init();
72
73protected:
74        DECLARE_EVENT_TABLE()
75
76private:
77        wxCriticalSection       m_ImageCopyMutex;
78        wxCriticalSection       m_ListMutex;
79        wxBitmap        m_Bitmap;
80        volatile bool   m_ImageShowed;
81        volatile bool   m_AccessingImage;
82       
83        // Previous captured image size
84        int             m_nImgWidth;
85        int             m_nImgHeight;
86        CIplImage m_SharedImage;
87        CIplImage m_DisplayImage;       
88        TWXNormROIList m_ControlList;
89        wxPoint m_prevCursor;
90};
91
92#endif
Note: See TracBrowser for help on using the repository browser.