frame_observer.cpp
Go to the documentation of this file.
1 
34 #include <iostream>
35 
36 FrameObserver::FrameObserver(CameraPtr cam_ptr, Callback callback) : IFrameObserver( cam_ptr ), callback_(callback), cam_ptr_(cam_ptr)
37 {
38  // Nothing
39 }
40 
41 void FrameObserver::FrameReceived( const FramePtr vimba_frame_ptr )
42 {
43  VmbFrameStatusType eReceiveStatus;
44  VmbErrorType err = vimba_frame_ptr->GetReceiveStatus(eReceiveStatus);
45 
46  if (err == VmbErrorSuccess) {
47  switch (eReceiveStatus)
48  {
50  {
51  // Call the callback
52  callback_(vimba_frame_ptr);
53  break;
54  }
56  {
57  std::cout << "ERR: FrameObserver VmbFrameStatusIncomplete" << std::endl;
58  break;
59  }
61  {
62  std::cout << "ERR: FrameObserver VmbFrameStatusTooSmall" << std::endl;
63  break;
64  }
66  {
67  std::cout << "ERR: FrameObserver VmbFrameStatusInvalid" << std::endl;
68  break;
69  }
70  default:
71  {
72  std::cout << "ERR: FrameObserver no known status" << std::endl;
73  break;
74  }
75  }
76  }
77 
78  cam_ptr_->QueueFrame( vimba_frame_ptr );
79 }
CameraPtr cam_ptr_
NetPointer< Frame, AVT::VmbAPINET::Frame > FramePtr
Callback callback_
VmbErrorType
NetPointer< Camera, AVT::VmbAPINET::Camera > CameraPtr
boost::function< void(const FramePtr vimba_frame_ptr)> Callback
FrameObserver(CameraPtr cam_ptr, Callback callback)
virtual void FrameReceived(const FramePtr vimba_frame_ptr)
VmbFrameStatusType
Definition: VimbaC.h:246


avt_vimba_camera
Author(s): Miquel Massot , Allied Vision Technologies
autogenerated on Wed Jun 5 2019 22:22:40