JeVois
1.22
JeVois Smart Embedded Machine Vision Toolkit
|
|
#include <jevois/GPU/ImGuiImage.H>
Wrapper for an image that can be rendered into ImGui.
The wrapper combines an OpenCV image and an OpenGL texture.
Definition at line 30 of file ImGuiImage.H.
Public Member Functions | |
ImGuiImage () | |
Constructor, image is uninitialized and loaded() returns false. | |
void | load (std::string const &fname) |
Load from file. | |
void | load (cv::Mat const &img, bool isbgr=true) |
Load from an OpenCV image. | |
bool | loaded () const |
Returns true if an image has been loaded through load() | |
void | clear () |
Free the texture and revert to un-initialized state. | |
~ImGuiImage () | |
Destructor. | |
void | draw (ImVec2 const &pos, ImVec2 const &size, ImDrawList *dl=nullptr) |
Draw into into current ImGui window or a drawlist. | |
jevois::ImGuiImage::ImGuiImage | ( | ) |
Constructor, image is uninitialized and loaded() returns false.
Definition at line 27 of file ImGuiImage.C.
jevois::ImGuiImage::~ImGuiImage | ( | ) |
Destructor.
Deletes the associated GPU texture and OpenCV pixel data.
Definition at line 94 of file ImGuiImage.C.
void jevois::ImGuiImage::clear | ( | ) |
Free the texture and revert to un-initialized state.
Definition at line 88 of file ImGuiImage.C.
void jevois::ImGuiImage::draw | ( | ImVec2 const & | pos, |
ImVec2 const & | size, | ||
ImDrawList * | dl = nullptr |
||
) |
Draw into into current ImGui window or a drawlist.
Definition at line 98 of file ImGuiImage.C.
void jevois::ImGuiImage::load | ( | cv::Mat const & | img, |
bool | isbgr = true |
||
) |
Load from an OpenCV image.
Allocates a texture on the GPU for the image.
Definition at line 31 of file ImGuiImage.C.
References LFATAL, and jevois::rescaleCv().
void jevois::ImGuiImage::load | ( | std::string const & | fname | ) |
bool jevois::ImGuiImage::loaded | ( | ) | const |
Returns true if an image has been loaded through load()
Definition at line 84 of file ImGuiImage.C.