JeVois  1.18
JeVois Smart Embedded Machine Vision Toolkit
Share this page:

#include <jevois/Core/PythonModule.H>

Wrapper around GUIhelper to be used by Python.

This class is not intended for general use, but only for use by PythonModule. Users of this class must ensure that the original GUIhelper will outlive any and all GUIhelperPython instances, since GUIhelperPython just references to the source GUIhelper by unprotected raw pointer. Although the C++ object is called GUIhelperPython, we will expose it to python under the name GUIhelper (see PythonSupport.C).

Definition at line 224 of file PythonModule.H.

Public Member Functions

 GUIhelperPython (GUIhelper *src)
 Construct from a regular GUIhelper that should be be coming from Engine. More...
 
boost::python::tuple startFrame ()
 Start a new rendering frame. More...
 
bool frameStarted () const
 Helper to indicate that startFrame() was called, and thus endFrame() should be called. More...
 
boost::python::tuple drawImage (char const *name, RawImage const &img, bool noalias=false, bool isoverlay=false)
 Draw a RawImage, copying pixel data to an OpenGL texture. More...
 
boost::python::tuple drawImage1 (char const *name, cv::Mat const &img, bool rgb, bool noalias=false, bool isoverlay=false)
 Draw an OpenCV image, copying pixel data to an OpenGL texture. More...
 
boost::python::tuple drawInputFrame (char const *name, InputFramePython const &frame, bool noalias=false, bool casync=false)
 Draw the input video frame from the camera using zero-copy. More...
 
boost::python::tuple drawInputFrame2 (char const *name, InputFramePython const &frame, bool noalias=false, bool casync=false)
 Draw the second (scaled) input video frame from the camera using zero-copy. More...
 
ImVec2 i2d (ImVec2 p, char const *name=nullptr)
 Convert coordinates of a point from within a rendered image to on-screen. More...
 
ImVec2 i2d1 (float x, float y, char const *name=nullptr)
 Convert coordinates of a point from within a rendered image to on-screen. More...
 
ImVec2 i2ds (ImVec2 p, char const *name=nullptr)
 Convert a 2D size from within a rendered image to on-screen. More...
 
ImVec2 i2ds1 (float x, float y, char const *name=nullptr)
 Convert a 2D size from within a rendered image to on-screen. More...
 
void drawLine (float x1, float y1, float x2, float y2, ImU32 col=IM_COL32(128, 255, 128, 255))
 Draw line over an image. More...
 
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. More...
 
void drawPoly (std::vector< cv::Point > const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw polygon over an image. More...
 
void drawPoly1 (std::vector< cv::Point2f > const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw polygon over an image. More...
 
void drawPoly2 (cv::Mat const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw polygon over an image. More...
 
void drawCircle (float x, float y, float r, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
 Draw circle over an image. More...
 
void drawText (float x, float y, char const *txt, ImU32 col=IM_COL32(128, 255, 128, 255))
 Draw text over an image. More...
 
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. More...
 
void itext (char const *txt, ImU32 const &col=IM_COL32_BLACK_TRANS, int line=-1)
 Draw some overlay text on top of an image. More...
 
void iinfo (jevois::InputFramePython const &inframe, std::string const &fpscpu, unsigned short winw=0, unsigned short winh=0)
 Display processing and video info at bottom of screen. More...
 
void releaseImage (char const *name)
 Release an image. More...
 
void releaseImage2 (char const *name)
 Release an image, second video stream. More...
 
void endFrame ()
 Finish current frame and render it. More...
 
ImVec2 d2i (ImVec2 p, char const *name=nullptr)
 Convert coordinates of a point from on-screen to within a rendered image. More...
 
ImVec2 d2i1 (float x, float y, char const *name=nullptr)
 Convert coordinates of a point from on-screen to within a rendered image. More...
 
ImVec2 d2is (ImVec2 p, char const *name=nullptr)
 Convert a 2D size from on-screen to within a rendered image. More...
 
ImVec2 d2is1 (float x, float y, char const *name=nullptr)
 Convert a 2D size from on-screen to within a rendered image. More...
 
void reportError (std::string const &err)
 Report an error in an overlay window. More...
 
void reportAndIgnoreException (std::string const &prefix="")
 Report current exception in a modal dialog, then ignore it. More...
 
void reportAndRethrowException (std::string const &prefix="")
 Report current exception in a modal dialog, then re-throw it. More...
 

Constructor & Destructor Documentation

◆ GUIhelperPython()

jevois::GUIhelperPython::GUIhelperPython ( GUIhelper src)

Construct from a regular GUIhelper that should be be coming from Engine.

Definition at line 288 of file PythonModule.C.

Member Function Documentation

◆ d2i()

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

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

Definition at line 376 of file PythonModule.C.

References LFATAL.

◆ d2i1()

ImVec2 jevois::GUIhelperPython::d2i1 ( float  x,
float  y,
char const *  name = nullptr 
)

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

Definition at line 383 of file PythonModule.C.

References LFATAL.

◆ d2is()

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

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

Definition at line 390 of file PythonModule.C.

References LFATAL.

◆ d2is1()

ImVec2 jevois::GUIhelperPython::d2is1 ( float  x,
float  y,
char const *  name = nullptr 
)

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

Definition at line 397 of file PythonModule.C.

References LFATAL.

◆ drawCircle()

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

Draw circle over an image.

Definition at line 456 of file PythonModule.C.

References LFATAL.

◆ drawImage()

boost::python::tuple jevois::GUIhelperPython::drawImage ( char const *  name,
RawImage const &  img,
bool  noalias = false,
bool  isoverlay = false 
)

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

Definition at line 308 of file PythonModule.C.

References h, and LFATAL.

◆ drawImage1()

boost::python::tuple jevois::GUIhelperPython::drawImage1 ( char const *  name,
cv::Mat const &  img,
bool  rgb,
bool  noalias = false,
bool  isoverlay = false 
)

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

Definition at line 318 of file PythonModule.C.

References h, and LFATAL.

◆ drawInputFrame()

boost::python::tuple jevois::GUIhelperPython::drawInputFrame ( char const *  name,
InputFramePython const &  frame,
bool  noalias = false,
bool  casync = false 
)

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

Definition at line 328 of file PythonModule.C.

References h, and LFATAL.

◆ drawInputFrame2()

boost::python::tuple jevois::GUIhelperPython::drawInputFrame2 ( char const *  name,
InputFramePython const &  frame,
bool  noalias = false,
bool  casync = false 
)

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

Definition at line 338 of file PythonModule.C.

References h, and LFATAL.

◆ drawLine()

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

Draw line over an image.

Definition at line 404 of file PythonModule.C.

References LFATAL.

◆ drawPoly()

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

Draw polygon over an image.

Definition at line 418 of file PythonModule.C.

References LFATAL.

◆ drawPoly1()

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

Draw polygon over an image.

Definition at line 425 of file PythonModule.C.

References LFATAL.

◆ drawPoly2()

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

Draw polygon over an image.

Definition at line 432 of file PythonModule.C.

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

◆ drawRect()

void jevois::GUIhelperPython::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.

Definition at line 411 of file PythonModule.C.

References LFATAL.

◆ drawText()

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

Draw text over an image.

Definition at line 463 of file PythonModule.C.

References LFATAL.

◆ endFrame()

void jevois::GUIhelperPython::endFrame ( )

Finish current frame and render it.

Definition at line 506 of file PythonModule.C.

References LFATAL.

◆ frameStarted()

bool jevois::GUIhelperPython::frameStarted ( ) const

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

Definition at line 301 of file PythonModule.C.

References LFATAL.

◆ i2d()

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

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

Definition at line 348 of file PythonModule.C.

References LFATAL.

◆ i2d1()

ImVec2 jevois::GUIhelperPython::i2d1 ( float  x,
float  y,
char const *  name = nullptr 
)

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

Definition at line 355 of file PythonModule.C.

References LFATAL.

◆ i2ds()

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

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

Definition at line 362 of file PythonModule.C.

References LFATAL.

◆ i2ds1()

ImVec2 jevois::GUIhelperPython::i2ds1 ( float  x,
float  y,
char const *  name = nullptr 
)

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

Definition at line 369 of file PythonModule.C.

References LFATAL.

◆ iinfo()

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

Display processing and video info at bottom of screen.

Definition at line 484 of file PythonModule.C.

References LFATAL.

◆ iline()

ImVec2 jevois::GUIhelperPython::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.

Definition at line 470 of file PythonModule.C.

References LFATAL.

◆ itext()

void jevois::GUIhelperPython::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 477 of file PythonModule.C.

References LFATAL.

◆ releaseImage()

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

Release an image.

Definition at line 492 of file PythonModule.C.

References LFATAL.

◆ releaseImage2()

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

Release an image, second video stream.

Definition at line 499 of file PythonModule.C.

References LFATAL.

◆ reportAndIgnoreException()

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

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

Definition at line 520 of file PythonModule.C.

References LFATAL.

◆ reportAndRethrowException()

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

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

Definition at line 527 of file PythonModule.C.

References LFATAL.

◆ reportError()

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

Report an error in an overlay window.

Definition at line 513 of file PythonModule.C.

References LFATAL.

◆ startFrame()

boost::python::tuple jevois::GUIhelperPython::startFrame ( )

Start a new rendering frame.

Definition at line 292 of file PythonModule.C.

References h, and LFATAL.


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