JeVois  1.22
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Loading...
Searching...
No Matches

#include <jevois/GPU/GUIhelper.H>

Helper class to assist modules in creating graphical and GUI elements.

This class only works on JeVois-Pro.

Definition at line 129 of file GUIhelper.H.

Inheritance diagram for jevois::GUIhelper:
Collaboration diagram for jevois::GUIhelper:

Classes

struct  ErrorData
 

Public Member Functions

 GUIhelper (std::string const &instance, bool conslock=false)
 Constructor.
 
virtual ~GUIhelper ()
 Destructor.
 
bool startFrame (unsigned short &w, unsigned short &h)
 Start a new rendering frame.
 
bool idle () const
 Check for idle in case startFrame() was called elsewhere.
 
bool frameStarted () const
 Helper to indicate that startFrame() was called, and thus endFrame() should be called.
 
void drawImage (char const *name, RawImage const &img, int &x, int &y, unsigned short &w, unsigned short &h, bool noalias=false, bool isoverlay=false)
 Draw a RawImage, copying pixel data to an OpenGL texture.
 
void drawImage (char const *name, cv::Mat const &img, bool rgb, int &x, int &y, unsigned short &w, unsigned short &h, bool noalias=false, bool isoverlay=false)
 Draw an OpenCV image, copying pixel data to an OpenGL texture.
 
void drawInputFrame (char const *name, InputFrame const &frame, int &x, int &y, unsigned short &w, unsigned short &h, bool noalias=false, bool casync=false)
 Draw the input video frame from the camera using zero-copy.
 
void drawInputFrame2 (char const *name, InputFrame const &frame, int &x, int &y, unsigned short &w, unsigned short &h, bool noalias=false, bool casync=false)
 Draw the second (scaled) input video frame from the camera using zero-copy.
 
ImVec2 i2d (ImVec2 p, char const *name=nullptr)
 Convert coordinates of a point from within a rendered image to on-screen.
 
ImVec2 i2d (float x, float y, char const *name=nullptr)
 Convert coordinates of a point from within a rendered image to on-screen.
 
ImVec2 i2ds (ImVec2 p, char const *name=nullptr)
 Convert a 2D size from within a rendered image to on-screen.
 
ImVec2 i2ds (float x, float y, char const *name=nullptr)
 Convert a 2D size from within a rendered image to on-screen.
 
void drawLine (float x1, float y1, float x2, float y2, ImU32 col=IM_COL32(128, 255, 128, 255))
 Draw line over an image.
 
void drawRect (float x1, float y1, float x2, float y2, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw rectangular box over an image.
 
void drawPoly (std::vector< cv::Point > const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw polygon over an image.
 
void drawPoly (std::vector< cv::Point2f > const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw polygon over an image.
 
void drawPoly (cv::Mat const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw polygon over an image.
 
void drawCircle (float x, float y, float r, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw circle over an image.
 
void drawEllipse (float x, float y, float rx, float ry, float rot=0.0F, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw ellipse over an image.
 
void drawText (float x, float y, char const *txt, ImU32 col=IM_COL32(128, 255, 128, 255))
 Draw text over an image.
 
void drawText (float x, float y, std::string const &txt, ImU32 col=IM_COL32(128, 255, 128, 255))
 Draw text over an image.
 
ImVec2 iline (int line=-1, char const *name=nullptr)
 Get coordinates of the start of a given line of text to be drawn as overlay on top of an image.
 
void itext (char const *txt, ImU32 const &col=IM_COL32_BLACK_TRANS, int line=-1)
 Draw some overlay text on top of an image.
 
void itext (std::string const &txt, ImU32 const &col=IM_COL32_BLACK_TRANS, int line=-1)
 Draw some overlay text on top of an image.
 
void iinfo (jevois::InputFrame const &inframe, std::string const &fpscpu, unsigned short winw=0, unsigned short winh=0)
 Display processing and video info at bottom of screen.
 
void releaseImage (char const *name)
 Release an image.
 
void releaseImage2 (char const *name)
 Release an image, second video stream.
 
void endFrame ()
 Finish current frame and render it.
 
void resetstate (bool modulechanged=true)
 Reset to default state, typically called on Module or video format change.
 
void reportError (std::string const &err)
 Report an error in an overlay window.
 
void reportAndIgnoreException (std::string const &prefix="")
 Report current exception in a modal dialog, then ignore it.
 
void reportAndRethrowException (std::string const &prefix="")
 Report current exception in a modal dialog, then re-throw it.
 
void clearErrors ()
 Clear all errors currently displayed in the JeVois-Pro GUI.
 
void helpMarker (char const *msg, char const *msg2=nullptr, char const *msg3=nullptr)
 Display a (?) label and show tooltip when it is hovered.
 
bool toggleButton (char const *name, bool *val)
 Helper to draw a toggle button.
 
int modal (std::string const &title, char const *text, int *default_val=nullptr, char const *b1txt="Ok", char const *b2txt="Cancel")
 Helper to draw a modal with 2 choices.
 
bool combo (std::string const &name, std::vector< std::string > const &items, int &selected_index)
 Helper to draw a combobox from a vector of strings.
 
void headlessDisplay ()
 Show a message that we are running headless.
 
bool serlogEnabled () const
 Tell whether user enabled serlog messages to GUI console.
 
bool seroutEnabled () const
 Tell whether user enabled serout messages to GUI console.
 
ImVec2 d2i (ImVec2 p, char const *name=nullptr)
 Convert coordinates of a point from on-screen to within a rendered image.
 
ImVec2 d2i (float x, float y, char const *name=nullptr)
 Convert coordinates of a point from on-screen to within a rendered image.
 
ImVec2 d2is (ImVec2 p, char const *name=nullptr)
 Convert a 2D size from on-screen to within a rendered image.
 
ImVec2 d2is (float x, float y, char const *name=nullptr)
 Convert a 2D size from on-screen to within a rendered image.
 
void startCompilation ()
 Compile a newly created module.
 
void highlightText (std::string const &str)
 Like ImGui::Textunformatted but in a highlight color (typically, red)
 
void demoBanner (std::string const &title="", std::string const &msg="")
 Display some text in a big banner, used by demo mode.
 
- Public Member Functions inherited from jevois::Component
 Component (std::string const &instance)
 Constructor.
 
virtual ~Component ()
 Virtual destructor for safe inheritance.
 
template<class Comp , typename... Args>
std::shared_ptr< Comp > addSubComponent (std::string const &instance, Args &&...args)
 Pseudo-constructor: construct and add another component as a subcomponent of this one.
 
template<class Comp >
void removeSubComponent (std::shared_ptr< Comp > &component)
 Remove a sub-Component from this Component, by shared_ptr.
 
void removeSubComponent (std::string const &instance, bool warnIfNotFound=true)
 Remove a sub-Component from this Component, by instance name.
 
template<class Comp = jevois::Component>
std::shared_ptr< Comp > getSubComponent (std::string const &instance) const
 Get a sub-component by instance name.
 
bool isTopLevel () const
 Returns true if this component is top-level, i.e., its parent is jevois::Manager.
 
bool initialized () const
 Has this component been initialized yet?
 
std::string const & className () const
 The class name of this component.
 
std::string const & instanceName () const
 The instance name of this component.
 
template<typename T >
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 Set a parameter value.
 
template<typename T >
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 Set a parameter value, simple version assuming only one parameter match.
 
template<typename T >
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 Get parameter(s) value(s) by descriptor.
 
template<typename T >
getParamValUnique (std::string const &paramdescriptor) const
 Get a parameter value, simple version assuming only one parameter match.
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 Set a parameter value, by string.
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 Set a parameter value by string, simple version assuming only one parameter match.
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 Get a parameter value, by string.
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 Get a parameter value by string, simple version assuming only one parameter match.
 
void freezeParam (std::string const &paramdescriptor, bool doit)
 Freeze/unfreeze a parameter, by name, see ParameterBase::freeze()
 
void freezeAllParams (bool doit)
 Freeze all parameters.
 
std::string descriptor () const
 Get our full descriptor (including all parents) as [Instancename]:[...]:[...].
 
void setParamsFromFile (std::string const &filename)
 Set some parameters from a file.
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 Set some parameters from an open stream.
 
virtual void paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="")
 Get machine-oriented descriptions of all parameters.
 
void foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="")
 Run a function on every param we hold.
 
template<typename T >
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category)
 Add a new parameter after the Component has already been constructed.
 
template<typename T , template< typename > class ValidValuesSpec>
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category)
 Add a new parameter after the Component has already been constructed.
 
template<typename T >
void setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true)
 Register a callback with a previously created dynamic parameter.
 
void removeDynamicParameter (std::string const &name, bool throw_if_not_found=true)
 Remove a previously added dynamic parameter.
 
void setPath (std::string const &path)
 Assign a filesystem path to this component.
 
std::filesystem::path absolutePath (std::filesystem::path const &path="")
 If given path is relative (not starting with /), prepend the Component path to it.
 
- Public Member Functions inherited from jevois::ParameterRegistry
virtual ~ParameterRegistry ()
 Virtual destructor for safe inheritance.
 

Public Attributes

float const pixel_perfect_z = 0.0F
 Z distance from camera to image plane to achieve pixel-perfect rendering.
 
glm::mat4 proj
 Our projection matrix.
 
glm::mat4 view
 Our view matrix.
 

Protected Types

enum  CompilationState {
  Idle , Start , Cmake , Make ,
  Install , CPack , Success , Error
}
 

Protected Member Functions

void drawPolyInternal (ImVec2 const *pts, size_t npts, ImU32 col, bool filled)
 
ImU32 applyFillAlpha (ImU32 col) const
 
void drawJeVoisGUI ()
 
void drawInfo ()
 
void drawParameters ()
 
void drawConsole ()
 
void drawCamCtrls ()
 
void drawTweaks ()
 
void drawSystem ()
 
void drawMenuBar ()
 
void drawModuleSelect ()
 
void drawErrorPopup ()
 
void drawNewModuleForm ()
 
void compileModule ()
 
void newModEntry (char const *wname, std::string &str, char const *desc, char const *hint, char const *hlp)
 
void setparstr (std::string const &descriptor, std::string const &val)
 
template<class T >
void setparval (std::string const &descriptor, T const &val)
 
void onParamChange (gui::scale const &param, float const &newval) override
 
void onParamChange (gui::rounding const &param, int const &newval) override
 
void onParamChange (gui::style const &param, gui::GuiStyle const &newval) override
 
void onParamChange (gui::twirl const &param, float const &newval) override
 
bool compileCommand (std::string const &cmd, std::string &msg)
 
void runNewModule ()
 
- Protected Member Functions inherited from jevois::Component
virtual void preInit ()
 Called before all sub-Components are init()ed.
 
virtual void postInit ()
 Called after all sub-Components are init()ed.
 
virtual void preUninit ()
 Called before all sub-Components are uninit()ed.
 
virtual void postUninit ()
 Called after all sub-Components are uninit()ed.
 
- Protected Member Functions inherited from jevois::ParameterRegistry
void addParameter (ParameterBase *const param)
 The Parameter class uses this method to register itself on construction with its owning Component.
 
void removeParameter (ParameterBase *const param)
 The Parameter class uses this method to un-register itself on destruction with its owning Component.
 
void callbackInitCall ()
 For all parameters that have a callback which has never been called, call it with the default param value.
 

Protected Attributes

std::map< std::string, GPUimageitsImages
 
std::map< std::string, GPUimageitsImages2
 
GPUimageitsLastDrawnImage = nullptr
 
int itsLastDrawnTextLine = -1
 
bool itsUsingScaledImage = false
 
float itsScaledImageFacX = 1.0F
 
float itsScaledImageFacY = 1.0F
 
std::chrono::time_point< std::chrono::steady_clock > itsLastEventTime
 
bool itsIdle = true
 Idle state, updated by startFrame(), used by endFrame() to decide whether to draw GUI.
 
bool itsIdleBlocked = false
 While creating/compiling new modules, prevent idle.
 
bool itsEndFrameCalled = true
 
std::mutex itsErrorMtx
 
std::list< ErrorDataitsErrors
 
std::set< std::string > itsOpenModals
 
bool itsConsLock
 
ImGuiBackendMALI itsBackend
 
std::string itsWindowTitle
 
ImGuiImage itsIcon
 
ImGuiImage itsHeadless
 
std::string itsModName
 
std::string itsModDesc
 
std::string itsModAuth
 
std::string itsModLang
 
std::vector< std::string > itsModDoc
 
gui::GuiStyle itsCurrentStyle = gui::GuiStyle::Dark
 
bool itsShowStyleEditor = false
 
bool itsShowAppMetrics = false
 
bool itsShowImGuiDemo = false
 
bool itsSerLogEnabled = true
 
bool itsSerOutEnabled = false
 
bool itsShowHardSerialWin = false
 
bool itsShowUsbSerialWin = false
 
std::shared_ptr< GUIeditoritsCfgEditor
 
std::shared_ptr< GUIeditoritsCodeEditor
 
std::future< std::string > itsDnnGetFut
 
bool itsRefreshVideoMappings = false
 
int itsVideoMappingListType = 0
 
bool itsUSBserial = false
 
CompilationState itsCompileState = CompilationState::Idle
 
VideoMapping itsNewMapping
 
std::future< std::string > itsCompileFut
 
std::array< std::string, 4 > itsCompileMessages
 
std::string itsBannerTitle
 
std::string itsBannerMsg
 
float itsGlobalAlpha = 1.0F
 

Related Symbols

(Note that these are not member symbols.)

 JEVOIS_DECLARE_PARAMETER (fullscreen, bool, "Use a fullscreen display when true, only has effect on host. " "Platform always is fullscreen as the MALI OpenGL driver do not support windowing.", false, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (winsize, cv::Size, "Initial window size to use on host. On platform, size is determined " "by hardware and the value of this parameter will be overwritten on init. The " "parameter can still be used to query display size.", cv::Size(0, 0), ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (hidesecs, float, "Number of seconds of inactivity from keyboard/mouse/joystick/etc after " "which we hide the GUI, or 0.0 to never hide it. Note: The GUI starts hidden until the " "first input event from a keyboard, mouse, etc.", 30.0F, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (scale, float, "Scale factor applied to the GUI", 2.0f, { 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.0f }, ParamCateg)
 Parameter.
 
 JEVOIS_DEFINE_ENUM_CLASS (GuiStyle,(Light)(Dark)(Classic))
 Enum for Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (style, GuiStyle, "Color style for the JeVois GUI", GuiStyle::Light, GuiStyle_Values, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (rounding, int, "Window and widget corner rounding for the JeVois GUI. " "Note than changing GUI scale will update this parameter as well.", 4, jevois::Range< int >(0, 24), ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (overlaycolor, ImColor, "Default color to use for overlay text", ImColor(255, 255, 255, 255), ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (linethick, float, "Line thickness for overlay drawings", 5.0F, jevois::Range< float >(0.1F, 20.0F), ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (fillalpha, float, "Alpha multiplier for overlay fills", 0.25F, jevois::Range< float >(0.0F, 1.0F), ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (allowquit, bool, "Quit application on ESC key (platform) or window close (host)", false, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (twirl, float, "Apply twirl effect to displayed video and images, useful " "mainly for demo mode", 0.0F, jevois::Range< float >(-15.0F, 15.0F), ParamCateg)
 Parameter.
 

Member Enumeration Documentation

◆ CompilationState

Enumerator
Idle 
Start 
Cmake 
Make 
Install 
CPack 
Success 
Error 

Definition at line 511 of file GUIhelper.H.

Constructor & Destructor Documentation

◆ GUIhelper()

jevois::GUIhelper::GUIhelper ( std::string const &  instance,
bool  conslock = false 
)

◆ ~GUIhelper()

jevois::GUIhelper::~GUIhelper ( )
virtual

Destructor.

Definition at line 107 of file GUIhelper.C.

References JEVOIS_WAIT_GET_FUTURE.

Member Function Documentation

◆ applyFillAlpha()

ImU32 jevois::GUIhelper::applyFillAlpha ( ImU32  col) const
protected

Definition at line 636 of file GUIhelper.C.

◆ clearErrors()

void jevois::GUIhelper::clearErrors ( )

Clear all errors currently displayed in the JeVois-Pro GUI.

In the JevoisPro GUI, errors reported via reportError() remain displayed for a few seconds, but sometimes we want to clear them right away, e.g., after DNN pipeline threw, if the user selects another one, we want the previous error to disappear immediately since it is not applicable anymore.

Definition at line 2631 of file GUIhelper.C.

◆ combo()

bool jevois::GUIhelper::combo ( std::string const &  name,
std::vector< std::string > const &  items,
int &  selected_index 
)

Helper to draw a combobox from a vector of strings.

Note that selected_index is read-write: the passed value is used to display the current item in the combobox, and, when a new item is selected, its index is returned in selected_index and true is returned.

Definition at line 1710 of file GUIhelper.C.

Referenced by jevois::dnn::Pipeline::showDataPeekWindow().

◆ compileCommand()

bool jevois::GUIhelper::compileCommand ( std::string const &  cmd,
std::string &  msg 
)
protected

◆ compileModule()

void jevois::GUIhelper::compileModule ( )
protected

Definition at line 2816 of file GUIhelper.C.

References LERROR, LINFO, and jevois::Engine::reloadVideoMappings().

◆ d2i() [1/2]

ImVec2 jevois::GUIhelper::d2i ( float  x,
float  y,
char const *  name = nullptr 
)

Convert coordinates of a point from on-screen to within a rendered image.

If name is nullptr, the last image used by drawImage() or drawInputFrame() is used. In such case, if drawInputFrame() was called on a frame that also had a second, scaled image, assume that we have displayed the full-resolution input frame but sent the scaled image to processing, and that hence we also need to scale from second to first frame.

Definition at line 735 of file GUIhelper.C.

◆ d2i() [2/2]

ImVec2 jevois::GUIhelper::d2i ( ImVec2  p,
char const *  name = nullptr 
)

Convert coordinates of a point from on-screen to within a rendered image.

If name is nullptr, the last image used by drawImage() or drawInputFrame() is used. In such case, if drawInputFrame() was called on a frame that also had a second, scaled image, assume that we have displayed the full-resolution input frame but sent the scaled image to processing, and that hence we also need to scale from second to first frame.

Definition at line 702 of file GUIhelper.C.

References jevois::GPUimage::d2i().

◆ d2is() [1/2]

ImVec2 jevois::GUIhelper::d2is ( float  x,
float  y,
char const *  name = nullptr 
)

Convert a 2D size from on-screen to within a rendered image.

If name is nullptr, the last image used by drawImage() or drawInputFrame() is used. In such case, if drawInputFrame() was called on a frame that also had a second, scaled image, assume that we have displayed the full-resolution input frame but sent the scaled image to processing, and that hence we also need to scale from second to first frame.

Definition at line 772 of file GUIhelper.C.

◆ d2is() [2/2]

ImVec2 jevois::GUIhelper::d2is ( ImVec2  p,
char const *  name = nullptr 
)

Convert a 2D size from on-screen to within a rendered image.

If name is nullptr, the last image used by drawImage() or drawInputFrame() is used. In such case, if drawInputFrame() was called on a frame that also had a second, scaled image, assume that we have displayed the full-resolution input frame but sent the scaled image to processing, and that hence we also need to scale from second to first frame.

Definition at line 739 of file GUIhelper.C.

References jevois::GPUimage::d2is().

◆ demoBanner()

void jevois::GUIhelper::demoBanner ( std::string const &  title = "",
std::string const &  msg = "" 
)

Display some text in a big banner, used by demo mode.

Any non-empty banner remains on screen until demoBanner() called again with empty title (default args).

Definition at line 2776 of file GUIhelper.C.

◆ drawCamCtrls()

void jevois::GUIhelper::drawCamCtrls ( )
protected

Definition at line 1651 of file GUIhelper.C.

References jevois::Engine::drawCameraGUI().

◆ drawCircle()

void jevois::GUIhelper::drawCircle ( float  x,
float  y,
float  r,
ImU32  col = IM_COL32(128,255,128,255),
bool  filled = true 
)

Draw circle over an image.

Coordinates used should be image coordinates, as this function internally calls i2d(). Color order is IMCOL_32(R,G,B,A).

Definition at line 598 of file GUIhelper.C.

Referenced by jevois::dnn::PostProcessorPose::report(), and jevois::dnn::PostProcessorYuNet::report().

◆ drawConsole()

◆ drawEllipse()

void jevois::GUIhelper::drawEllipse ( float  x,
float  y,
float  rx,
float  ry,
float  rot = 0.0F,
ImU32  col = IM_COL32(128,255,128,255),
bool  filled = true 
)

Draw ellipse over an image.

Coordinates used should be image coordinates, as this function internally calls i2d().

Definition at line 611 of file GUIhelper.C.

◆ drawErrorPopup()

void jevois::GUIhelper::drawErrorPopup ( )
protected

Definition at line 2670 of file GUIhelper.C.

◆ drawImage() [1/2]

void jevois::GUIhelper::drawImage ( char const *  name,
cv::Mat const &  img,
bool  rgb,
int &  x,
int &  y,
unsigned short &  w,
unsigned short &  h,
bool  noalias = false,
bool  isoverlay = false 
)

Draw an OpenCV image, copying pixel data to an OpenGL texture.

Name should be a unique name, and should typically remain constant across successive video frames. This name is used as an index to OpenGL textures, shaders, and programs created to render the images. Note that OpenGL will slow down and eventually run out of resources if you create too many textures, thus Module writers should try to minimize the number of different names that are used. If image has three or four 8-bit channels, interpret as RGB[A] if rgb is true, otherwise BGR[A]. If two 8-bit channels, interpret as YUYV. If one, interpret as GRAY. If you pass w=0 or h=0 then the image will be rescaled to fill the display as much as possible without changing the aspect ratio, and the actually used x,y,w,h will be returned. Further, if noalias is true, that rescaling will ensure an integer scaling factor. Otherwise, x,y,w,h are not modified. If isoverlay is true, then the image is assumed to be a semi-transparent overlay to be drawn on top of a previously drawn image, and we preserve the drawing parameters of that previous image.

Definition at line 312 of file GUIhelper.C.

References h.

◆ drawImage() [2/2]

void jevois::GUIhelper::drawImage ( char const *  name,
jevois::RawImage const &  img,
int &  x,
int &  y,
unsigned short &  w,
unsigned short &  h,
bool  noalias = false,
bool  isoverlay = false 
)

Draw a RawImage, copying pixel data to an OpenGL texture.

Name should be a unique name, and should typically remain constant across successive video frames. This name is used as an index to OpenGL textures, shaders, and programs created to render the images. Note that OpenGL will slow down and eventually run out of resources if you create too many textures, thus Module writers should try to minimize the number of different names that are used. Note that we will add a suffix to the name, corresponding to the bufindex of the RawImage. If you pass w=0 or h=0 then the image will be rescaled to fill the display as much as possible without changing the aspect ratio, and the actually used x,y,w,h will be returned. Otherwise, x,y,w,h are not modified. If noalias is specified, the scaling factor will be rounded down to the nearest integer to prevent aliasing in the display. This may reduce the displayed image size. For example, with a 1920x1080 window, a 640x480 image would be letterboxed to 1440x1080 when noalias is false. But that is a scaling factor of 2.25 which may create rendering aliasing. When noalias is true, the letterboxed image size will be 1280x960 (scale factor of 2.0). If isoverlay is true, then the image is assumed to be a semi-transparent overlay to be drawn on top of a previously drawn image, and we preserve the drawing parameters of that previous image.

Definition at line 287 of file GUIhelper.C.

References jevois::RawImage::bufindex, and h.

Referenced by jevois::dnn::PostProcessorSegment::report().

◆ drawInfo()

◆ drawInputFrame()

void jevois::GUIhelper::drawInputFrame ( char const *  name,
jevois::InputFrame const &  frame,
int &  x,
int &  y,
unsigned short &  w,
unsigned short &  h,
bool  noalias = false,
bool  casync = false 
)

Draw the input video frame from the camera using zero-copy.

If you pass w=0 or h=0 then the image will be rescaled to fill the display as much as possible without changing the aspect ratio, and the actually used x,y,w,h will be returned. Further, if noalias is true, that rescaling will ensure an integer scaling factor. Otherwise, x,y,w,h are not modified.

Definition at line 334 of file GUIhelper.C.

References jevois::RawImage::bufindex, jevois::InputFrame::get(), jevois::InputFrame::get2(), h, jevois::InputFrame::hasScaledImage(), jevois::RawImage::height, and jevois::RawImage::width.

◆ drawInputFrame2()

void jevois::GUIhelper::drawInputFrame2 ( char const *  name,
jevois::InputFrame const &  frame,
int &  x,
int &  y,
unsigned short &  w,
unsigned short &  h,
bool  noalias = false,
bool  casync = false 
)

Draw the second (scaled) input video frame from the camera using zero-copy.

If you pass w=0 or h=0 then the image will be rescaled to fill the display as much as possible without changing the aspect ratio, and the actually used x,y,w,h will be returned. Further, if noalias is true, that rescaling will ensure an integer scaling factor. Otherwise, x,y,w,h are not modified. Throws unless we are JeVois-Pro Platform and the camera is set to CropScale mode.

Definition at line 364 of file GUIhelper.C.

References jevois::RawImage::bufindex, jevois::InputFrame::get2(), and h.

◆ drawJeVoisGUI()

void jevois::GUIhelper::drawJeVoisGUI ( )
protected

Definition at line 841 of file GUIhelper.C.

References jevois::Manager::getComponent().

◆ drawLine()

void jevois::GUIhelper::drawLine ( float  x1,
float  y1,
float  x2,
float  y2,
ImU32  col = IM_COL32(128,255,128,255) 
)

Draw line over an image.

Coordinates used should be image coordinates, as this function internally calls i2d(). Color order is IMCOL_32(R,G,B,A).

Definition at line 472 of file GUIhelper.C.

Referenced by jevois::dnn::PostProcessorPose::report(), and jevois::dnn::PostProcessorYuNet::report().

◆ drawMenuBar()

void jevois::GUIhelper::drawMenuBar ( )
protected

Definition at line 964 of file GUIhelper.C.

References jevois::Engine::quit().

◆ drawModuleSelect()

void jevois::GUIhelper::drawModuleSelect ( )
protected

◆ drawNewModuleForm()

◆ drawParameters()

◆ drawPoly() [1/3]

void jevois::GUIhelper::drawPoly ( cv::Mat const &  pts,
ImU32  col = IM_COL32(128,255,128,255),
bool  filled = true 
)

Draw polygon over an image.

For N vertices, pts should be either CV_32F and 2xN or Nx2 for x,x,x,x,... y,y,y,y,..., or 1x2N or 2Nx1 for x,y,x,y,x,y...; or CV_32FC2 and 1xN or Nx1. If N < 2, nothing is drawn. Other shapes are illegal. Color order is IMCOL_32(R,G,B,A).

Definition at line 538 of file GUIhelper.C.

References LFATAL, and jevois::dnn::shapestr().

◆ drawPoly() [2/3]

void jevois::GUIhelper::drawPoly ( std::vector< cv::Point > const &  pts,
ImU32  col = IM_COL32(128,255,128,255),
bool  filled = true 
)

Draw polygon over an image.

Coordinates used should be image coordinates, as this function internally calls i2d(). Color order is IMCOL_32(R,G,B,A).

Definition at line 514 of file GUIhelper.C.

Referenced by jevois::dnn::PostProcessorDetect::report(), and jevois::dnn::PostProcessorDetectOBB::report().

◆ drawPoly() [3/3]

void jevois::GUIhelper::drawPoly ( std::vector< cv::Point2f > const &  pts,
ImU32  col = IM_COL32(128,255,128,255),
bool  filled = true 
)

Draw polygon over an image.

Coordinates used should be image coordinates, as this function internally calls i2d(). Color order is IMCOL_32(R,G,B,A).

Definition at line 526 of file GUIhelper.C.

◆ drawPolyInternal()

void jevois::GUIhelper::drawPolyInternal ( ImVec2 const *  pts,
size_t  npts,
ImU32  col,
bool  filled 
)
protected

Definition at line 492 of file GUIhelper.C.

◆ drawRect()

void jevois::GUIhelper::drawRect ( float  x1,
float  y1,
float  x2,
float  y2,
ImU32  col = IM_COL32(128,255,128,255),
bool  filled = true 
)

Draw rectangular box over an image.

Coordinates used should be image coordinates, as this function internally calls i2d(). Color order is IMCOL_32(R,G,B,A).

Definition at line 478 of file GUIhelper.C.

Referenced by jevois::dnn::PostProcessorDetect::report(), jevois::dnn::PostProcessorPose::report(), and jevois::dnn::PostProcessorYuNet::report().

◆ drawSystem()

◆ drawText() [1/2]

void jevois::GUIhelper::drawText ( float  x,
float  y,
char const *  txt,
ImU32  col = IM_COL32(128,255,128,255) 
)

Draw text over an image.

Coordinates used should be image coordinates, as this function internally calls i2d(). Color order is IMCOL_32(R,G,B,A).

Definition at line 624 of file GUIhelper.C.

Referenced by jevois::dnn::PostProcessorDetect::report(), jevois::dnn::PostProcessorDetectOBB::report(), jevois::dnn::PostProcessorPose::report(), and jevois::dnn::PostProcessorYuNet::report().

◆ drawText() [2/2]

void jevois::GUIhelper::drawText ( float  x,
float  y,
std::string const &  txt,
ImU32  col = IM_COL32(128,255,128,255) 
)

Draw text over an image.

Coordinates used should be image coordinates, as this function internally calls i2d(). Color order is IMCOL_32(R,G,B,A).

Definition at line 630 of file GUIhelper.C.

◆ drawTweaks()

void jevois::GUIhelper::drawTweaks ( )
protected

Definition at line 2532 of file GUIhelper.C.

References drawTinyImGUIdemo().

◆ endFrame()

void jevois::GUIhelper::endFrame ( )

Finish current frame and render it.

This should be called once for every call to startFrame().

Definition at line 776 of file GUIhelper.C.

References jevois::Engine::abortDemo(), LERROR, and jevois::Engine::nextDemo().

◆ frameStarted()

bool jevois::GUIhelper::frameStarted ( ) const

Helper to indicate that startFrame() was called, and thus endFrame() should be called.

Mostly useful during exception handling inside Engine.

Definition at line 283 of file GUIhelper.C.

◆ headlessDisplay()

void jevois::GUIhelper::headlessDisplay ( )

Show a message that we are running headless.

Definition at line 2748 of file GUIhelper.C.

References JEVOIS_SHARE_PATH, and jevois::warnAndIgnoreException().

◆ helpMarker()

void jevois::GUIhelper::helpMarker ( char const *  msg,
char const *  msg2 = nullptr,
char const *  msg3 = nullptr 
)

Display a (?) label and show tooltip when it is hovered.

If 2 or more messages are provided, they will be separated by a separator.

Definition at line 2712 of file GUIhelper.C.

◆ highlightText()

void jevois::GUIhelper::highlightText ( std::string const &  str)

Like ImGui::Textunformatted but in a highlight color (typically, red)

Definition at line 2768 of file GUIhelper.C.

◆ i2d() [1/2]

ImVec2 jevois::GUIhelper::i2d ( float  x,
float  y,
char const *  name = nullptr 
)

Convert coordinates of a point from within a rendered image to on-screen.

If name is nullptr, the last image used by drawImage() or drawInputFrame() is used. In such case, if drawInputFrame() was called on a frame that also had a second, scaled image, assume that we have displayed the full-resolution input frame but sent the scaled image to processing, and that hence we also need to scale from second to first frame.

Definition at line 432 of file GUIhelper.C.

◆ i2d() [2/2]

ImVec2 jevois::GUIhelper::i2d ( ImVec2  p,
char const *  name = nullptr 
)

Convert coordinates of a point from within a rendered image to on-screen.

If name is nullptr, the last image used by drawImage() or drawInputFrame() is used. In such case, if drawInputFrame() was called on a frame that also had a second, scaled image, assume that we have displayed the full-resolution input frame but sent the scaled image to processing, and that hence we also need to scale from second to first frame.

Definition at line 400 of file GUIhelper.C.

References jevois::GPUimage::i2d().

Referenced by jevois::dnn::PostProcessorSegment::report(), and jevois::dnn::PreProcessor::sendreport().

◆ i2ds() [1/2]

ImVec2 jevois::GUIhelper::i2ds ( float  x,
float  y,
char const *  name = nullptr 
)

Convert a 2D size from within a rendered image to on-screen.

If name is nullptr, the last image used by drawImage() or drawInputFrame() is used. In such case, if drawInputFrame() was called on a frame that also had a second, scaled image, assume that we have displayed the full-resolution input frame but sent the scaled image to processing, and that hence we also need to scale from second to first frame.

Definition at line 468 of file GUIhelper.C.

◆ i2ds() [2/2]

ImVec2 jevois::GUIhelper::i2ds ( ImVec2  p,
char const *  name = nullptr 
)

Convert a 2D size from within a rendered image to on-screen.

If name is nullptr, the last image used by drawImage() or drawInputFrame() is used. In such case, if drawInputFrame() was called on a frame that also had a second, scaled image, assume that we have displayed the full-resolution input frame but sent the scaled image to processing, and that hence we also need to scale from second to first frame.

Definition at line 436 of file GUIhelper.C.

References jevois::GPUimage::i2ds().

◆ idle()

bool jevois::GUIhelper::idle ( ) const

Check for idle in case startFrame() was called elsewhere.

Definition at line 227 of file GUIhelper.C.

◆ iinfo()

void jevois::GUIhelper::iinfo ( jevois::InputFrame const &  inframe,
std::string const &  fpscpu,
unsigned short  winw = 0,
unsigned short  winh = 0 
)

Display processing and video info at bottom of screen.

This helper is to be used by modules to provide a consistent info display at the bottom of the screen. fpscpu should be the string returned by Timer::stop(). If winw and winh are not given, will query from display backend, which will cost a few CPU cycles; so pass it on if you already have it, e.g, from running startFrame() previously.

Definition at line 667 of file GUIhelper.C.

References jevois::fccstr(), jevois::RawImage::fmt, jevois::InputFrame::get(), jevois::InputFrame::get2(), jevois::InputFrame::hasScaledImage(), jevois::RawImage::height, jevois::sformat(), and jevois::RawImage::width.

◆ iline()

ImVec2 jevois::GUIhelper::iline ( int  line = -1,
char const *  name = nullptr 
)

Get coordinates of the start of a given line of text to be drawn as overlay on top of an image.

Use this to draw overlay text on top of a previously drawn image, it will scale by font size for you. If line is -1, we will increment over the last time this function was called (use with caution). Line number is reset to 0 when drawImage() or drawInputFrame(), etc are called.

Definition at line 644 of file GUIhelper.C.

◆ itext() [1/2]

void jevois::GUIhelper::itext ( char const *  txt,
ImU32 const &  col = IM_COL32_BLACK_TRANS,
int  line = -1 
)

Draw some overlay text on top of an image.

Definition at line 654 of file GUIhelper.C.

Referenced by jevois::dnn::Pipeline::process(), and jevois::dnn::PostProcessorClassify::report().

◆ itext() [2/2]

void jevois::GUIhelper::itext ( std::string const &  txt,
ImU32 const &  col = IM_COL32_BLACK_TRANS,
int  line = -1 
)

Draw some overlay text on top of an image.

Definition at line 661 of file GUIhelper.C.

◆ modal()

int jevois::GUIhelper::modal ( std::string const &  title,
char const *  text,
int *  default_val = nullptr,
char const *  b1txt = "Ok",
char const *  b2txt = "Cancel" 
)

Helper to draw a modal with 2 choices.

Returns 1 if the first button was clicked, 2 if the second was, or some other value if no button was clicked (caller should just wait and try again at the next frame if not 1 or 2, passing again that returned value). By default, the first button is in focus. If default_val is not nullptr, add a "don't ask again" checkbox. If default_val is 1 or 2, just return that without even showing the modal.

Definition at line 1657 of file GUIhelper.C.

◆ newModEntry()

void jevois::GUIhelper::newModEntry ( char const *  wname,
std::string &  str,
char const *  desc,
char const *  hint,
char const *  hlp 
)
protected

Definition at line 1724 of file GUIhelper.C.

◆ onParamChange() [1/4]

void jevois::GUIhelper::onParamChange ( gui::rounding const &  param,
int const &  newval 
)
overrideprotected

◆ onParamChange() [2/4]

void jevois::GUIhelper::onParamChange ( gui::scale const &  param,
float const &  newval 
)
overrideprotected

◆ onParamChange() [3/4]

void jevois::GUIhelper::onParamChange ( gui::style const &  param,
gui::GuiStyle const &  newval 
)
overrideprotected

◆ onParamChange() [4/4]

void jevois::GUIhelper::onParamChange ( gui::twirl const &  param,
float const &  newval 
)
overrideprotected

Definition at line 388 of file GUIhelper.C.

◆ releaseImage()

void jevois::GUIhelper::releaseImage ( char const *  name)

Release an image.

Call this if you plan on re-using the same image name later for an image of different size or format. Otherwise, once an image has been used once, its OpenGL texture (including its dims) will remain the same and only the pixel values will be updated when the image is drawn again. Silently ignores if the image is not found, i.e., has not been drawn before.

Definition at line 688 of file GUIhelper.C.

Referenced by jevois::dnn::PostProcessorSegment::~PostProcessorSegment().

◆ releaseImage2()

void jevois::GUIhelper::releaseImage2 ( char const *  name)

Release an image, second video stream.

Call this if you plan on re-using the same image name later for an image of different size or format. Otherwise, once an image has been used once, its OpenGL texture (including its dims) will remain the same and only the pixel values will be updated when the image is drawn again. Silently ignores if the image is not found, i.e., has not been drawn before.

Definition at line 695 of file GUIhelper.C.

◆ reportAndIgnoreException()

void jevois::GUIhelper::reportAndIgnoreException ( std::string const &  prefix = "")

Report current exception in a modal dialog, then ignore it.

Definition at line 2638 of file GUIhelper.C.

References jevois::getPythonExceptionString().

Referenced by jevois::dnn::Pipeline::process().

◆ reportAndRethrowException()

void jevois::GUIhelper::reportAndRethrowException ( std::string const &  prefix = "")

Report current exception in a modal dialog, then re-throw it.

Definition at line 2663 of file GUIhelper.C.

◆ reportError()

void jevois::GUIhelper::reportError ( std::string const &  err)

Report an error in an overlay window.

Definition at line 2605 of file GUIhelper.C.

Referenced by jevois::dnn::Pipeline::showDataPeekWindow().

◆ resetstate()

void jevois::GUIhelper::resetstate ( bool  modulechanged = true)

Reset to default state, typically called on Module or video format change.

Free images, reset matrices, etc.

Definition at line 114 of file GUIhelper.C.

References jevois::VideoMapping::cmakepath(), jevois::Engine::getCurrentVideoMapping(), jevois::Component::getParamStringUnique(), h, and LFATAL.

◆ runNewModule()

void jevois::GUIhelper::runNewModule ( )
protected

◆ serlogEnabled()

bool jevois::GUIhelper::serlogEnabled ( ) const

Tell whether user enabled serlog messages to GUI console.

Definition at line 1643 of file GUIhelper.C.

◆ seroutEnabled()

bool jevois::GUIhelper::seroutEnabled ( ) const

Tell whether user enabled serout messages to GUI console.

Definition at line 1647 of file GUIhelper.C.

◆ setparstr()

void jevois::GUIhelper::setparstr ( std::string const &  descriptor,
std::string const &  val 
)
protected

◆ setparval()

template<class T >
void jevois::GUIhelper::setparval ( std::string const &  descriptor,
T const &  val 
)
protected

◆ startCompilation()

void jevois::GUIhelper::startCompilation ( )

Compile a newly created module.

This is mainly for internal use. Called by the code editor when saving C++ code to let us know to start the compilation process again. itsNewMapping should contain the new module's data.

Definition at line 2784 of file GUIhelper.C.

◆ startFrame()

bool jevois::GUIhelper::startFrame ( unsigned short &  w,
unsigned short &  h 
)

Start a new rendering frame.

This should be called on every new video frame to be rendered. Will initialize OpenGL and open the window or screen if needed. Sets the current window size into w and h, returns true if idle (no keyboard/mouse/etc events received in more than hidesecs seconds).

Definition at line 169 of file GUIhelper.C.

References h, LFATAL, LINFO, and jevois::Engine::quit().

◆ toggleButton()

bool jevois::GUIhelper::toggleButton ( char const *  name,
bool *  val 
)

Helper to draw a toggle button.

Definition at line 2729 of file GUIhelper.C.

Referenced by jevois::dnn::Pipeline::showDataPeekWindow().

Friends And Related Symbol Documentation

◆ JEVOIS_DECLARE_PARAMETER() [1/7]

JEVOIS_DECLARE_PARAMETER ( allowquit  ,
bool  ,
"Quit application on ESC key (platform) or window close (host)"  ,
false  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [2/7]

JEVOIS_DECLARE_PARAMETER ( fillalpha  ,
float  ,
"Alpha multiplier for overlay fills"  ,
0.  25F,
jevois::Range< float >  0.0F, 1.0F,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [3/7]

JEVOIS_DECLARE_PARAMETER ( fullscreen  ,
bool  ,
"Use a fullscreen display when  true,
only has effect on host. " "Platform always is fullscreen as the MALI OpenGL driver do not support windowing."  ,
false  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [4/7]

JEVOIS_DECLARE_PARAMETER ( hidesecs  ,
float  ,
"Number of seconds of inactivity from keyboard/mouse/joystick/etc after " "which we hide the  GUI,
or 0.0 to never hide it. Note:The GUI starts hidden until the " "first input event from a  keyboard,
mouse  ,
etc."  ,
30.  0F,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [5/7]

JEVOIS_DECLARE_PARAMETER ( linethick  ,
float  ,
"Line thickness for overlay drawings"  ,
5.  0F,
jevois::Range< float >  0.1F, 20.0F,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [6/7]

JEVOIS_DECLARE_PARAMETER ( overlaycolor  ,
ImColor  ,
"Default color to use for overlay text"  ,
ImColor(255, 255, 255, 255)  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [7/7]

JEVOIS_DECLARE_PARAMETER ( winsize  ,
cv::Size  ,
"Initial window size to use on host. On  platform,
size is determined " "by hardware and the value of this parameter will be overwritten on init. The " "parameter can still be used to query display size."  ,
cv::Size(0, 0)  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [1/4]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( rounding  ,
int  ,
"Window and widget corner rounding for the JeVois GUI. " "Note than changing GUI scale will update this parameter as well."  ,
,
jevois::Range< int >  0, 24,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [2/4]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( scale  ,
float  ,
"Scale factor applied to the GUI"  ,
2.  0f,
{ 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.0f }  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [3/4]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( style  ,
GuiStyle  ,
"Color style for the JeVois GUI"  ,
GuiStyle::Light  ,
GuiStyle_Values  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [4/4]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( twirl  ,
float  ,
"Apply twirl effect to displayed video and  images,
useful " "mainly for demo mode"  ,
0.  0F,
jevois::Range< float >  -15.0F, 15.0F,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DEFINE_ENUM_CLASS()

JEVOIS_DEFINE_ENUM_CLASS ( GuiStyle  ,
(Light)(Dark)(Classic)   
)
related

Enum for Parameter.

Member Data Documentation

◆ itsBackend

ImGuiBackendMALI jevois::GUIhelper::itsBackend
protected

Definition at line 446 of file GUIhelper.H.

◆ itsBannerMsg

std::string jevois::GUIhelper::itsBannerMsg
protected

Definition at line 520 of file GUIhelper.H.

◆ itsBannerTitle

std::string jevois::GUIhelper::itsBannerTitle
protected

Definition at line 520 of file GUIhelper.H.

◆ itsCfgEditor

std::shared_ptr<GUIeditor> jevois::GUIhelper::itsCfgEditor
protected

Definition at line 495 of file GUIhelper.H.

Referenced by GUIhelper().

◆ itsCodeEditor

std::shared_ptr<GUIeditor> jevois::GUIhelper::itsCodeEditor
protected

Definition at line 498 of file GUIhelper.H.

Referenced by GUIhelper().

◆ itsCompileFut

std::future<std::string> jevois::GUIhelper::itsCompileFut
protected

Definition at line 514 of file GUIhelper.H.

◆ itsCompileMessages

std::array<std::string, 4> jevois::GUIhelper::itsCompileMessages
protected

Definition at line 516 of file GUIhelper.H.

◆ itsCompileState

CompilationState jevois::GUIhelper::itsCompileState = CompilationState::Idle
protected

Definition at line 512 of file GUIhelper.H.

◆ itsConsLock

bool jevois::GUIhelper::itsConsLock
protected

Definition at line 444 of file GUIhelper.H.

◆ itsCurrentStyle

gui::GuiStyle jevois::GUIhelper::itsCurrentStyle = gui::GuiStyle::Dark
protected

Definition at line 458 of file GUIhelper.H.

◆ itsDnnGetFut

std::future<std::string> jevois::GUIhelper::itsDnnGetFut
protected

Definition at line 501 of file GUIhelper.H.

◆ itsEndFrameCalled

bool jevois::GUIhelper::itsEndFrameCalled = true
protected

Definition at line 428 of file GUIhelper.H.

◆ itsErrorMtx

std::mutex jevois::GUIhelper::itsErrorMtx
mutableprotected

Definition at line 430 of file GUIhelper.H.

◆ itsErrors

std::list<ErrorData> jevois::GUIhelper::itsErrors
protected

Definition at line 437 of file GUIhelper.H.

◆ itsGlobalAlpha

float jevois::GUIhelper::itsGlobalAlpha = 1.0F
protected

Definition at line 521 of file GUIhelper.H.

◆ itsHeadless

ImGuiImage jevois::GUIhelper::itsHeadless
protected

Definition at line 452 of file GUIhelper.H.

◆ itsIcon

ImGuiImage jevois::GUIhelper::itsIcon
protected

Definition at line 451 of file GUIhelper.H.

◆ itsIdle

bool jevois::GUIhelper::itsIdle = true
protected

Idle state, updated by startFrame(), used by endFrame() to decide whether to draw GUI.

Definition at line 426 of file GUIhelper.H.

◆ itsIdleBlocked

bool jevois::GUIhelper::itsIdleBlocked = false
protected

While creating/compiling new modules, prevent idle.

Definition at line 427 of file GUIhelper.H.

◆ itsImages

std::map<std::string , GPUimage> jevois::GUIhelper::itsImages
protected

Definition at line 419 of file GUIhelper.H.

◆ itsImages2

std::map<std::string , GPUimage> jevois::GUIhelper::itsImages2
protected

Definition at line 419 of file GUIhelper.H.

◆ itsLastDrawnImage

GPUimage* jevois::GUIhelper::itsLastDrawnImage = nullptr
protected

Definition at line 420 of file GUIhelper.H.

◆ itsLastDrawnTextLine

int jevois::GUIhelper::itsLastDrawnTextLine = -1
protected

Definition at line 421 of file GUIhelper.H.

◆ itsLastEventTime

std::chrono::time_point<std::chrono::steady_clock> jevois::GUIhelper::itsLastEventTime
protected

Definition at line 425 of file GUIhelper.H.

◆ itsModAuth

std::string jevois::GUIhelper::itsModAuth
protected

Definition at line 455 of file GUIhelper.H.

◆ itsModDesc

std::string jevois::GUIhelper::itsModDesc
protected

Definition at line 454 of file GUIhelper.H.

◆ itsModDoc

std::vector<std::string> jevois::GUIhelper::itsModDoc
protected

Definition at line 457 of file GUIhelper.H.

◆ itsModLang

std::string jevois::GUIhelper::itsModLang
protected

Definition at line 456 of file GUIhelper.H.

◆ itsModName

std::string jevois::GUIhelper::itsModName
protected

Definition at line 453 of file GUIhelper.H.

◆ itsNewMapping

VideoMapping jevois::GUIhelper::itsNewMapping
protected

Definition at line 513 of file GUIhelper.H.

◆ itsOpenModals

std::set<std::string> jevois::GUIhelper::itsOpenModals
protected

Definition at line 439 of file GUIhelper.H.

◆ itsRefreshVideoMappings

bool jevois::GUIhelper::itsRefreshVideoMappings = false
protected

Definition at line 504 of file GUIhelper.H.

◆ itsScaledImageFacX

float jevois::GUIhelper::itsScaledImageFacX = 1.0F
protected

Definition at line 423 of file GUIhelper.H.

◆ itsScaledImageFacY

float jevois::GUIhelper::itsScaledImageFacY = 1.0F
protected

Definition at line 423 of file GUIhelper.H.

◆ itsSerLogEnabled

bool jevois::GUIhelper::itsSerLogEnabled = true
protected

Definition at line 462 of file GUIhelper.H.

◆ itsSerOutEnabled

bool jevois::GUIhelper::itsSerOutEnabled = false
protected

Definition at line 463 of file GUIhelper.H.

◆ itsShowAppMetrics

bool jevois::GUIhelper::itsShowAppMetrics = false
protected

Definition at line 460 of file GUIhelper.H.

◆ itsShowHardSerialWin

bool jevois::GUIhelper::itsShowHardSerialWin = false
protected

Definition at line 464 of file GUIhelper.H.

◆ itsShowImGuiDemo

bool jevois::GUIhelper::itsShowImGuiDemo = false
protected

Definition at line 461 of file GUIhelper.H.

◆ itsShowStyleEditor

bool jevois::GUIhelper::itsShowStyleEditor = false
protected

Definition at line 459 of file GUIhelper.H.

◆ itsShowUsbSerialWin

bool jevois::GUIhelper::itsShowUsbSerialWin = false
protected

Definition at line 465 of file GUIhelper.H.

◆ itsUSBserial

bool jevois::GUIhelper::itsUSBserial = false
protected

Definition at line 508 of file GUIhelper.H.

◆ itsUsingScaledImage

bool jevois::GUIhelper::itsUsingScaledImage = false
protected

Definition at line 422 of file GUIhelper.H.

◆ itsVideoMappingListType

int jevois::GUIhelper::itsVideoMappingListType = 0
protected

Definition at line 505 of file GUIhelper.H.

◆ itsWindowTitle

std::string jevois::GUIhelper::itsWindowTitle
protected

Definition at line 450 of file GUIhelper.H.

Referenced by GUIhelper().

◆ pixel_perfect_z

float const jevois::GUIhelper::pixel_perfect_z = 0.0F

Z distance from camera to image plane to achieve pixel-perfect rendering.

Definition at line 338 of file GUIhelper.H.

◆ proj

glm::mat4 jevois::GUIhelper::proj

Our projection matrix.

Definition at line 341 of file GUIhelper.H.

◆ view

glm::mat4 jevois::GUIhelper::view

Our view matrix.

On the first call to startFrame(), the whole OpenGL engine is initialized and the view matrix is set so that the pixel perfect image plane is vertical and centered on the origin, while the camera is translated in negative Z to achieve pixel perfect rendering.

Definition at line 347 of file GUIhelper.H.


The documentation for this class was generated from the following files: