JeVois Smart Embedded Machine Vision Toolkit
Exception-safe wrapper around a raw image to be sent over USB.
This wrapper operates much like std:future in standard C++11. Users can get the next memory-allocated but blank image to be sent over USB by calling get(), which may block if all buffers are still being sent over USB by Gadget and no blank one is available, or may throw if getting that buffer fails for some reason (e.g., usb disconnect, user just changed video mode in their webcam software or closed it). The allocated image size and pixel type is as defined by the current VideoMapping, USB section, i.e., it is the USB video mode currently selected by the user. To save time, image buffers are not zeroed out, so you should not assume that the image is filled with black pixels, it could contain random pixels, or previous output frames. In addition, a send() function is provided which users may use as soon as they are finished with writing the pixel data into the image obtained via get(), to allow the USB driver to send that image to the connected host computer. If send() has not been called by the time the OutputFrame is destroyed, it will be called automatically, if get() had been called.
OutputFrame implements a zero-copy, zero-wait access to output video frames, that is:
|OutputFrame (OutputFrame &&other)=default|
|Move constructor. More...|
|RawImage const &||get () const|
|Get a pre-allocated image so that we can fill the pixel data and later send out over USB using send() More...|
|void||send () const|
|Send an image out over USB to the host computer. More...|
|Destructor, returns the buffers to the driver as needed. More...|
|jevois::RawImage const & jevois::OutputFrame::get||(||)||const|
Get a pre-allocated image so that we can fill the pixel data and later send out over USB using send()