36 #include <Gui/ImageCanvas.hh>
37 #include <Image/Camera.hh>
38 #include <Gui/StringConv.hh>
39 #include <VideoSource/VideoSource_SwissRanger.hh>
40 #include <VideoSource/VideoSourceCapabilities.hh>
42 #include <Base/Image/ImageConvert.hh>
43 #include <Base/Image/ImageIO.hh>
44 #include <Gui/StringConv.hh>
56 class MyApp :
public wxApp
58 virtual bool OnInit();
61 class MyFrame:
public wxFrame
65 MyFrame(
const wxString& title,
const wxPoint& pos,
const wxSize& size);
67 void OnQuit(wxCommandEvent& event);
68 void OnReconnect(wxCommandEvent& event);
69 void OnTimer(wxTimerEvent& event);
73 wxButton *QuitButton_, *WhiteBalanceButton_;
92 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
93 EVT_MENU(
ID_Quit, MyFrame::OnQuit)
94 EVT_MENU(ID_Reconnect, MyFrame::OnReconnect)
96 EVT_TIMER(
ID_TIMER, MyFrame::OnTimer)
104 new MyFrame( wxT(
"Example Video4Linux"), wxPoint(50,50), wxSize(800,600) );
112 MyFrame::MyFrame(
const wxString& title,
const wxPoint& pos,
const wxSize& size)
113 : wxFrame((wxFrame *)NULL, -1, title, pos, size)
118 int res = cam->OpenDevice();
120 cout<<
"Failed to open swissranger device!"<<endl;
129 wxMenu *menuFile =
new wxMenu;
130 menuFile->Append( ID_Quit, wxT(
"E&xit") );
131 menuFile->Append( ID_Reconnect, wxT(
"Reconnect") );
133 wxMenuBar *menuBar =
new wxMenuBar;
134 menuBar->Append( menuFile, wxT(
"&File") );
136 SetMenuBar( menuBar );
137 wxStatusBar* s = CreateStatusBar();
138 SetStatusText( wxT(
"") );
140 wxSizer *Sizer =
new wxBoxSizer( wxHORIZONTAL );
142 ic_ =
new ImageCanvas(
this,s,0,-1,wxDefaultPosition,wxSize(640,480));
144 Sizer->Add(ic_,1,wxEXPAND);
148 ic_->Show(pic,
"foo");
149 Timer_.SetOwner(
this, ID_TIMER);
150 Timer_.Start(100,
true);
153 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
162 void MyFrame::OnReconnect(wxCommandEvent& WXUNUSED(event))
174 cam->SetWaitForNew(
false);
175 Timer_.Start(100,
true);
180 void MyFrame::OnTimer(wxTimerEvent& event)
182 cam->GrabSingle(pic);
184 sprintf(name,
"image_%04i",imgNo);
198 Timer_.Start(20,
true);
wxString AsciiToWx(const char *thestring)
Converts a C string to a wxString.
extends the Image by MetaData support (e.g.
Support for SwissRanger usb cam.
display image in wx application, provides zoom and investigation functionality
void AssignUUID(const bool &consecutively=DEFAULT_UUID_CONSECUTIVELY)
function to assign a fresh, unique ID.
virtual int OpenDevice()
try to open first unused PMD-camera
interface class for producing/storing Universally Unique IDentifiers