JeVois  1.20
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
jevois::ImGuiBackendMALI Class Reference

#include <jevois/GPU/ImGuiBackendMALI.H>

BackendMALI for ImGui on JeVois-Pro.

This abstract base class provides an interface used by VideoDisplayGUI. Derived implementations are available for SDL2 and Mali framebuffer + evdev.

JeVois Pro hardware reports the following:

EGL v1.4 EGL API is EGL_OPENGL_ES_API OpenGL ES 3.2 git.c8adbf9.122c9daed32dbba4b3056f41a2f23c58 ARM (Mali-G52) GL_VER=3.2

OpenGL extensions: GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_EXT_texture_compression_astc_decode_mode GL_EXT_texture_compression_astc_decode_mode_rgb9e5 GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjoint_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_clamp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader_multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_shader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_extension_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_EXT_copy_image GL_OES_copy_image GL_EXT_shader_non_constant_global_initializers GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_elements_base_vertex GL_OES_draw_elements_base_vertex GL_EXT_buffer_storage GL_EXT_texture_filter_anisotropic

To get correct UTF-8 keyboard translation, you need env var LC_CTYPE to be set, e.g., en_US.UTF-8

Definition at line 86 of file ImGuiBackendMALI.H.

Inheritance diagram for jevois::ImGuiBackendMALI:
Collaboration diagram for jevois::ImGuiBackendMALI:

Public Member Functions

 ImGuiBackendMALI ()
 Constructor. More...
 
virtual ~ImGuiBackendMALI ()
 Virtual destructor for safe inheritance, free resources. More...
 
virtual void init (unsigned short w, unsigned short h, bool fullscreen=false, float scale=1.0f, bool conslock=true)
 Initialize the underlying engine that will process events, create windows, etc. More...
 
virtual bool pollEvents (bool &shouldclose) override
 Poll events such as mouse movements, buttons, keyboard, joystick, and pass to ImGui. More...
 
virtual void newFrame () override
 Start a new frame and clear the window/framebuffer. More...
 
virtual void render () override
 Render the ImGui graphics. More...
 
- Public Member Functions inherited from jevois::VideoDisplayBackendMALI
 VideoDisplayBackendMALI ()
 Constructor. More...
 
virtual ~VideoDisplayBackendMALI ()
 Virtual destructor for safe inheritance, free resources. More...
 
virtual void init (unsigned short w, unsigned short h, bool fullscreen=false) override
 Initialize the underlying engine that will process events, create windows, etc. More...
 
- Public Member Functions inherited from jevois::VideoDisplayBackend
 VideoDisplayBackend ()
 Constructor. More...
 
virtual ~VideoDisplayBackend ()
 Virtual destructor for safe inheritance, free resources. More...
 
virtual void getWindowSize (unsigned short &w, unsigned short &h) const
 
EGLDisplay getDisplay () const
 Access our display. More...
 

Protected Member Functions

void scanDevices ()
 
void addDevice (size_t num, int fd)
 
void removeDevice (size_t num)
 
- Protected Member Functions inherited from jevois::VideoDisplayBackend
virtual void init (unsigned short w, unsigned short h, EGLNativeWindowType win)
 Initialize the underlying engine that will process events, create windows, etc. More...
 
virtual void uninit ()
 Un-initialize the underlying engine, close windows, etc. More...
 

Protected Attributes

std::chrono::time_point< std::chrono::steady_clock > itsLastNewFrameTime
 
int itsFd [32]
 
int itsMouseX
 
int itsMouseY
 
bool itsMouseButton [5]
 
int itsConsoleFd
 
int itsTTY
 
int itsKBmode
 
int itsWidth = 0
 
int itsHeight = 0
 
std::array< wchar_t, 49 > itsCharKeys { L"1234567890-=qwertyuiop[]asdfghjkl;'`\\zxcvbnm,./<" }
 
std::array< wchar_t, 49 > itsShiftKeys { L"!@#$%^&*()_+QWERTYUIOP{}ASDFGHJKL:\"~|ZXCVBNM<>?>" }
 
std::array< wchar_t, 49 > itsAltgrKeys = { 0 }
 
input_event_state itsInputState = { }
 
char itsInputBuffer [256] = { 0 }
 
bool itsInitialized = false
 
- Protected Attributes inherited from jevois::VideoDisplayBackendMALI
fbdev_window itsWindow
 
- Protected Attributes inherited from jevois::VideoDisplayBackend
const std::string itsName
 
EGLDisplay itsDisplay = EGL_NO_DISPLAY
 
EGLConfig itsConfig = 0
 
EGLContext itsContext = EGL_NO_CONTEXT
 
EGLSurface itsSurface = 0
 

Static Protected Attributes

static constexpr wchar_t itsFuncKeys [58][8]
 

Constructor & Destructor Documentation

◆ ImGuiBackendMALI()

jevois::ImGuiBackendMALI::ImGuiBackendMALI ( )

Constructor.

Definition at line 368 of file ImGuiBackendMALI.C.

References itsAltgrKeys, itsCharKeys, itsFd, itsMouseButton, itsShiftKeys, and NELEMS.

◆ ~ImGuiBackendMALI()

jevois::ImGuiBackendMALI::~ImGuiBackendMALI ( )
virtual

Virtual destructor for safe inheritance, free resources.

Definition at line 379 of file ImGuiBackendMALI.C.

References jevois::unMuteKeyboard(), and jevois::warnAndIgnoreException().

Member Function Documentation

◆ addDevice()

void jevois::ImGuiBackendMALI::addDevice ( size_t  num,
int  fd 
)
protected

Definition at line 707 of file ImGuiBackendMALI.C.

References LERROR, LFATAL, LINFO, and NELEMS.

◆ init()

void jevois::ImGuiBackendMALI::init ( unsigned short  w,
unsigned short  h,
bool  fullscreen = false,
float  scale = 1.0f,
bool  conslock = true 
)
virtual

Initialize the underlying engine that will process events, create windows, etc.

The init starts with the given initial window/framebuffer size. If conslock is true, we lock the console and the framebuffer; set to false when running in gdb for debugging, using gdb –args jevoispro-daemon –conslock=false

Definition at line 399 of file ImGuiBackendMALI.C.

References jevois::getActiveTTY(), jevois::getConsoleFd(), h, jevois::VideoDisplayBackendMALI::init(), jevois::muteKeyboard(), and jevois::warnAndIgnoreException().

◆ newFrame()

void jevois::ImGuiBackendMALI::newFrame ( )
overridevirtual

Start a new frame and clear the window/framebuffer.

Reimplemented from jevois::VideoDisplayBackend.

Definition at line 674 of file ImGuiBackendMALI.C.

References LERROR, and jevois::VideoDisplayBackend::newFrame().

◆ pollEvents()

bool jevois::ImGuiBackendMALI::pollEvents ( bool &  shouldclose)
overridevirtual

Poll events such as mouse movements, buttons, keyboard, joystick, and pass to ImGui.

Returns true if some events were received, which can be used to turn on mouse pointer and GUI.

Reimplemented from jevois::VideoDisplayBackendMALI.

Definition at line 509 of file ImGuiBackendMALI.C.

References LERROR, and NELEMS.

◆ removeDevice()

void jevois::ImGuiBackendMALI::removeDevice ( size_t  num)
protected

Definition at line 715 of file ImGuiBackendMALI.C.

References LERROR, LFATAL, LINFO, and NELEMS.

◆ render()

void jevois::ImGuiBackendMALI::render ( )
overridevirtual

Render the ImGui graphics.

Reimplemented from jevois::VideoDisplayBackend.

Definition at line 699 of file ImGuiBackendMALI.C.

References jevois::VideoDisplayBackend::render().

◆ scanDevices()

void jevois::ImGuiBackendMALI::scanDevices ( )
protected

Definition at line 725 of file ImGuiBackendMALI.C.

References jevois::isInputDevice(), NELEMS, and jevois::to_string().

Member Data Documentation

◆ itsAltgrKeys

std::array<wchar_t, 49> jevois::ImGuiBackendMALI::itsAltgrKeys = { 0 }
protected

Definition at line 127 of file ImGuiBackendMALI.H.

Referenced by ImGuiBackendMALI().

◆ itsCharKeys

std::array<wchar_t, 49> jevois::ImGuiBackendMALI::itsCharKeys { L"1234567890-=qwertyuiop[]asdfghjkl;'`\\zxcvbnm,./<" }
protected

Definition at line 125 of file ImGuiBackendMALI.H.

Referenced by ImGuiBackendMALI().

◆ itsConsoleFd

int jevois::ImGuiBackendMALI::itsConsoleFd
protected

Definition at line 120 of file ImGuiBackendMALI.H.

◆ itsFd

int jevois::ImGuiBackendMALI::itsFd[32]
protected

Definition at line 114 of file ImGuiBackendMALI.H.

Referenced by ImGuiBackendMALI().

◆ itsFuncKeys

constexpr wchar_t jevois::ImGuiBackendMALI::itsFuncKeys[58][8]
staticconstexprprotected
Initial value:
=
{
L"<Esc>", L"<BckSp>", L"<Tab>", L"<Enter>", L"<LCtrl>", L"<LShft>",
L"<RShft>", L"<KP*>", L"<LAlt>", L" ", L"<CpsLk>", L"<F1>", L"<F2>",
L"<F3>", L"<F4>", L"<F5>", L"<F6>", L"<F7>", L"<F8>", L"<F9>", L"<F10>",
L"<NumLk>", L"<ScrLk>", L"<KP7>", L"<KP8>", L"<KP9>", L"<KP->", L"<KP4>",
L"<KP5>", L"<KP6>", L"<KP+>", L"<KP1>", L"<KP2>", L"<KP3>", L"<KP0>",
L"<KP.>", L"<F11>", L"<F12>", L"<KPEnt>", L"<RCtrl>", L"<KP/>",
L"<PrtSc>", L"<AltGr>", L"<Break>" , L"<Home>", L"<Up>",
L"<PgUp>", L"<Left>", L"<Right>", L"<End>", L"<Down>", L"<PgDn>",
L"<Ins>", L"<Del>", L"<Pause>", L"<LMeta>", L"<RMeta>", L"<Menu>"
}

Definition at line 128 of file ImGuiBackendMALI.H.

◆ itsHeight

int jevois::ImGuiBackendMALI::itsHeight = 0
protected

Definition at line 123 of file ImGuiBackendMALI.H.

◆ itsInitialized

bool jevois::ImGuiBackendMALI::itsInitialized = false
protected

Definition at line 143 of file ImGuiBackendMALI.H.

◆ itsInputBuffer

char jevois::ImGuiBackendMALI::itsInputBuffer[256] = { 0 }
protected

Definition at line 142 of file ImGuiBackendMALI.H.

◆ itsInputState

input_event_state jevois::ImGuiBackendMALI::itsInputState = { }
protected

Definition at line 141 of file ImGuiBackendMALI.H.

◆ itsKBmode

int jevois::ImGuiBackendMALI::itsKBmode
protected

Definition at line 122 of file ImGuiBackendMALI.H.

◆ itsLastNewFrameTime

std::chrono::time_point<std::chrono::steady_clock> jevois::ImGuiBackendMALI::itsLastNewFrameTime
protected

Definition at line 113 of file ImGuiBackendMALI.H.

◆ itsMouseButton

bool jevois::ImGuiBackendMALI::itsMouseButton[5]
protected

Definition at line 119 of file ImGuiBackendMALI.H.

Referenced by ImGuiBackendMALI().

◆ itsMouseX

int jevois::ImGuiBackendMALI::itsMouseX
protected

Definition at line 118 of file ImGuiBackendMALI.H.

◆ itsMouseY

int jevois::ImGuiBackendMALI::itsMouseY
protected

Definition at line 118 of file ImGuiBackendMALI.H.

◆ itsShiftKeys

std::array<wchar_t, 49> jevois::ImGuiBackendMALI::itsShiftKeys { L"!@#$%^&*()_+QWERTYUIOP{}ASDFGHJKL:\"~|ZXCVBNM<>?>" }
protected

Definition at line 126 of file ImGuiBackendMALI.H.

Referenced by ImGuiBackendMALI().

◆ itsTTY

int jevois::ImGuiBackendMALI::itsTTY
protected

Definition at line 121 of file ImGuiBackendMALI.H.

◆ itsWidth

int jevois::ImGuiBackendMALI::itsWidth = 0
protected

Definition at line 123 of file ImGuiBackendMALI.H.


The documentation for this class was generated from the following files:
L
#define L(i, x, y, z)
Definition: GUIhelper.C:2374