JeVois  1.17
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 ()=default
 Default constructor to keep boost::python happy, object is not operational. More...
 
 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...
 
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() [1/2]

jevois::GUIhelperPython::GUIhelperPython ( )
default

Default constructor to keep boost::python happy, object is not operational.

◆ GUIhelperPython() [2/2]

jevois::GUIhelperPython::GUIhelperPython ( GUIhelper src)

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

Definition at line 285 of file PythonModule.C.

Member Function Documentation

◆ 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 417 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 305 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 315 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 325 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 335 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 373 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 387 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 394 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 401 of file PythonModule.C.

References LFATAL.

◆ 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 380 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 424 of file PythonModule.C.

References LFATAL.

◆ endFrame()

void jevois::GUIhelperPython::endFrame ( )

Finish current frame and render it.

Definition at line 467 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 298 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 345 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 352 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 359 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 366 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 445 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 431 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 438 of file PythonModule.C.

References LFATAL.

◆ releaseImage()

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

Release an image.

Definition at line 453 of file PythonModule.C.

References LFATAL.

◆ releaseImage2()

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

Release an image, second video stream.

Definition at line 460 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 481 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 488 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 474 of file PythonModule.C.

References LFATAL.

◆ startFrame()

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

Start a new rendering frame.

Definition at line 289 of file PythonModule.C.

References h, and LFATAL.


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