JeVois
1.20
JeVois Smart Embedded Machine Vision Toolkit
|
|
#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 | drawImage2 (char const *name, RawImage const &img, int x, int y, int w, int h, bool noalias=false, bool isoverlay=false) |
Draw an OpenCV image, copying pixel data to an OpenGL texture. More... | |
boost::python::tuple | drawImage3 (char const *name, cv::Mat const &img, bool rgb, int x, int y, int w, int h, 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... | |
ImVec2 | getMousePos () |
ImGui helper: get mouse position. More... | |
bool | isMouseClicked (int button_num) |
ImGui helper: check if mouse button clicked. More... | |
bool | isMouseDoubleClicked (int button_num) |
ImGui helper: check if mouse button double-clicked. More... | |
bool | isMouseDragging (int button_num) |
ImGui helper: check if mouse button dragged. More... | |
bool | isMouseDown (int button_num) |
ImGui helper: check if mouse button pressed. More... | |
bool | isMouseReleased (int button_num) |
ImGui helper: check if mouse button released. More... | |
jevois::GUIhelperPython::GUIhelperPython | ( | GUIhelper * | src | ) |
Construct from a regular GUIhelper that should be be coming from Engine.
Definition at line 290 of file PythonModule.C.
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 402 of file PythonModule.C.
References LFATAL.
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 409 of file PythonModule.C.
References LFATAL.
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 416 of file PythonModule.C.
References LFATAL.
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 423 of file PythonModule.C.
References LFATAL.
void jevois::GUIhelperPython::drawCircle | ( | float | x, |
float | y, | ||
float | r, | ||
ImU32 | col = IM_COL32(128,255,128,255) , |
||
bool | filled = true |
||
) |
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 310 of file PythonModule.C.
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 320 of file PythonModule.C.
boost::python::tuple jevois::GUIhelperPython::drawImage2 | ( | char const * | name, |
RawImage const & | img, | ||
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
bool | noalias = false , |
||
bool | isoverlay = false |
||
) |
Draw an OpenCV image, copying pixel data to an OpenGL texture.
Definition at line 330 of file PythonModule.C.
boost::python::tuple jevois::GUIhelperPython::drawImage3 | ( | char const * | name, |
cv::Mat const & | img, | ||
bool | rgb, | ||
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
bool | noalias = false , |
||
bool | isoverlay = false |
||
) |
Draw an OpenCV image, copying pixel data to an OpenGL texture.
Definition at line 342 of file PythonModule.C.
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 354 of file PythonModule.C.
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 364 of file PythonModule.C.
void jevois::GUIhelperPython::drawLine | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
ImU32 | col = IM_COL32(128,255,128,255) |
||
) |
void jevois::GUIhelperPython::drawPoly | ( | std::vector< cv::Point > const & | pts, |
ImU32 | col = IM_COL32(128,255,128,255) , |
||
bool | filled = true |
||
) |
void jevois::GUIhelperPython::drawPoly1 | ( | std::vector< cv::Point2f > const & | pts, |
ImU32 | col = IM_COL32(128,255,128,255) , |
||
bool | filled = true |
||
) |
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 458 of file PythonModule.C.
References LFATAL, and jevois::dnn::shapestr().
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 437 of file PythonModule.C.
References LFATAL.
void jevois::GUIhelperPython::drawText | ( | float | x, |
float | y, | ||
char const * | txt, | ||
ImU32 | col = IM_COL32(128,255,128,255) |
||
) |
void jevois::GUIhelperPython::endFrame | ( | ) |
Finish current frame and render it.
Definition at line 532 of file PythonModule.C.
References LFATAL.
bool jevois::GUIhelperPython::frameStarted | ( | ) | const |
Helper to indicate that startFrame() was called, and thus endFrame() should be called.
Definition at line 303 of file PythonModule.C.
References LFATAL.
ImVec2 jevois::GUIhelperPython::getMousePos | ( | ) |
ImGui helper: get mouse position.
Definition at line 560 of file PythonModule.C.
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 374 of file PythonModule.C.
References LFATAL.
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 381 of file PythonModule.C.
References LFATAL.
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 388 of file PythonModule.C.
References LFATAL.
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 395 of file PythonModule.C.
References LFATAL.
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 510 of file PythonModule.C.
References LFATAL.
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 496 of file PythonModule.C.
References LFATAL.
bool jevois::GUIhelperPython::isMouseClicked | ( | int | button_num | ) |
ImGui helper: check if mouse button clicked.
Definition at line 564 of file PythonModule.C.
bool jevois::GUIhelperPython::isMouseDoubleClicked | ( | int | button_num | ) |
ImGui helper: check if mouse button double-clicked.
Definition at line 568 of file PythonModule.C.
bool jevois::GUIhelperPython::isMouseDown | ( | int | button_num | ) |
ImGui helper: check if mouse button pressed.
Definition at line 576 of file PythonModule.C.
bool jevois::GUIhelperPython::isMouseDragging | ( | int | button_num | ) |
ImGui helper: check if mouse button dragged.
Definition at line 572 of file PythonModule.C.
bool jevois::GUIhelperPython::isMouseReleased | ( | int | button_num | ) |
ImGui helper: check if mouse button released.
Definition at line 580 of file PythonModule.C.
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 503 of file PythonModule.C.
References LFATAL.
void jevois::GUIhelperPython::releaseImage | ( | char const * | name | ) |
void jevois::GUIhelperPython::releaseImage2 | ( | char const * | name | ) |
Release an image, second video stream.
Definition at line 525 of file PythonModule.C.
References LFATAL.
void jevois::GUIhelperPython::reportAndIgnoreException | ( | std::string const & | prefix = "" | ) |
Report current exception in a modal dialog, then ignore it.
Definition at line 546 of file PythonModule.C.
References LFATAL.
void jevois::GUIhelperPython::reportAndRethrowException | ( | std::string const & | prefix = "" | ) |
Report current exception in a modal dialog, then re-throw it.
Definition at line 553 of file PythonModule.C.
References LFATAL.
void jevois::GUIhelperPython::reportError | ( | std::string const & | err | ) |
Report an error in an overlay window.
Definition at line 539 of file PythonModule.C.
References LFATAL.
boost::python::tuple jevois::GUIhelperPython::startFrame | ( | ) |
Start a new rendering frame.
Definition at line 294 of file PythonModule.C.