MCPcopy Create free account
hub / github.com/andybarry/makerscanner / UpdateImage

Method UpdateImage

ActiveStereoMain.cpp:355–397  ·  view source on GitHub ↗

Catch an update image event and display the new image

Source from the content-addressed store, hash-verified

353
354// Catch an update image event and display the new image
355void ActiveStereoFrame::UpdateImage(wxCommandEvent &event)
356{
357
358 // image is shipped as a pointer in the event
359 // cast to IplImage (must release once finished)
360 IplImage *img = (IplImage*)event.GetClientData();
361
362 if (updateImageRunning == true)
363 {
364 txtLog->AppendText(wxT("\nUpdate image was already running"));
365 cvReleaseImage(&img);
366 return;
367 }
368 updateImageRunning = true;
369
370 // camera is connected -- update if it isn't
371 if (cameraConnected != true)
372 {
373 cameraConnected = true;
374 lblCameraConnected->SetLabel(wxT("Connected"));
375
376 // reset layouts now that the length of the label in lblCameraConnected has changed
377 flexGridStatus->Layout();
378 staticBoxSizerStatus->Layout();
379 headBoxSizer->Layout();
380
381 butCapture->Enable(true);
382 butCapture->SetFocus();
383 }
384
385 // update image display
386 m_pCamView->DrawCam(img);
387
388 // delete the image that was copied for us to display
389 cvReleaseImage(&img);
390
391 updateImageRunning = false;
392
393 // update the FPS display
394 framesSinceLastFpsUpdate ++;
395
396
397}
398
399// catch a display text event and append the text to the terminal display
400void ActiveStereoFrame::DisplayText(wxCommandEvent &event)

Callers

nothing calls this directly

Calls 1

DrawCamMethod · 0.80

Tested by

no test coverage detected