JeVois  1.20
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
VideoDisplayGUI.H
Go to the documentation of this file.
1 // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 //
3 // JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2020 by Laurent Itti, the University of Southern
4 // California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project.
5 //
6 // This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can
7 // redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
8 // Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
10 // License for more details. You should have received a copy of the GNU General Public License along with this program;
11 // if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
12 //
13 // Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, CA 90089-2520 - USA.
14 // Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org
15 // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
16 /*! \file */
17 
18 #ifdef JEVOIS_PRO
19 
20 #pragma once
21 
23 #include <jevois/Core/VideoBuf.H>
25 #include <jevois/GPU/GPUimage.H>
27 #include <atomic>
28 
29 namespace jevois
30 {
31  class GUIhelper;
32 
33  //! Video output to local screen with basic GUI
34  /*! This class provides accelerated OpenGL-ES display on JeVois-Pro, using Dear-ImGui for a simple graphical
35  interface. \ingroup core */
37  {
38  public:
39  //! Constructor
40  VideoDisplayGUI(std::shared_ptr<GUIhelper> helper, size_t nbufs = 2);
41 
42  //! Virtual destructor for safe inheritance
43  virtual ~VideoDisplayGUI();
44 
45  //! Set the video format and frame rate, allocate the buffers
46  virtual void setFormat(VideoMapping const & m) override;
47 
48  //! Get a pre-allocated image so that we can fill the pixel data and later send out using send()
49  virtual void get(RawImage & img) override;
50 
51  //! Send an image out to display
52  virtual void send(RawImage const & img) override;
53 
54  //! Start streaming
55  virtual void streamOn() override;
56 
57  //! Abort streaming
58  /*! This only cancels future get() and done() calls, one should still call streamOff() to turn off streaming. */
59  virtual void abortStream() override;
60 
61  //! Stop streaming
62  virtual void streamOff() override;
63 
64  private:
65  std::vector<std::shared_ptr<VideoBuf> > itsBuffers;
67  std::shared_ptr<jevois::GUIhelper> itsHelper;
68  std::atomic<bool> itsStreaming;
69  };
70 }
71 
72 #endif // JEVOIS_PRO
jevois::VideoDisplayGUI
Video output to local screen with basic GUI.
Definition: VideoDisplayGUI.H:36
jevois::VideoDisplayGUI::get
virtual void get(RawImage &img) override
Get a pre-allocated image so that we can fill the pixel data and later send out using send()
Definition: VideoDisplayGUI.C:78
GPUimage.H
jevois::VideoDisplayGUI::VideoDisplayGUI
VideoDisplayGUI(std::shared_ptr< GUIhelper > helper, size_t nbufs=2)
Constructor.
Definition: VideoDisplayGUI.C:27
BoundedBuffer.H
jevois::VideoOutput
Base class for video output. Gadget, MovieOutput, VideoDisplay, and VideoOutputNone derive from it.
Definition: VideoOutput.H:27
jevois::VideoDisplayGUI::streamOn
virtual void streamOn() override
Start streaming.
Definition: VideoDisplayGUI.C:112
jevois::VideoDisplayGUI::~VideoDisplayGUI
virtual ~VideoDisplayGUI()
Virtual destructor for safe inheritance.
Definition: VideoDisplayGUI.C:65
VideoBuf.H
jevois::BoundedBuffer
Thread-safe synchronized producer/consumer queue.
Definition: BoundedBuffer.H:37
jevois::RawImage
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
Definition: RawImage.H:110
ImGuiBackend.H
jevois::VideoDisplayGUI::send
virtual void send(RawImage const &img) override
Send an image out to display.
Definition: VideoDisplayGUI.C:88
jevois
Definition: Concepts.dox:1
jevois::VideoDisplayGUI::streamOff
virtual void streamOff() override
Stop streaming.
Definition: VideoDisplayGUI.C:120
VideoOutput.H
jevois::VideoDisplayGUI::abortStream
virtual void abortStream() override
Abort streaming.
Definition: VideoDisplayGUI.C:116
jevois::VideoDisplayGUI::setFormat
virtual void setFormat(VideoMapping const &m) override
Set the video format and frame rate, allocate the buffers.
Definition: VideoDisplayGUI.C:34