JeVois  1.17
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
jevois::ImGuiImage Class Reference

#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. More...
 
void load (std::string const &fname)
 Load from file. More...
 
void load (cv::Mat const &img, bool isbgr=true)
 Load from an OpenCV image. More...
 
bool loaded () const
 Returns true if an image has been loaded through load() More...
 
void clear ()
 Free the texture and revert to un-initialized state. More...
 
 ~ImGuiImage ()
 Destructor. More...
 
void draw (ImVec2 const &pos, ImVec2 const &size, ImDrawList *dl=nullptr)
 Draw into into current ImGui window or a drawlist. More...
 

Constructor & Destructor Documentation

◆ ImGuiImage()

jevois::ImGuiImage::ImGuiImage ( )

Constructor, image is uninitialized and loaded() returns false.

Definition at line 27 of file ImGuiImage.C.

◆ ~ImGuiImage()

jevois::ImGuiImage::~ImGuiImage ( )

Destructor.

Deletes the associated GPU texture and OpenCV pixel data.

Definition at line 94 of file ImGuiImage.C.

Member Function Documentation

◆ clear()

void jevois::ImGuiImage::clear ( )

Free the texture and revert to un-initialized state.

Definition at line 88 of file ImGuiImage.C.

◆ draw()

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.

◆ load() [1/2]

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().

◆ load() [2/2]

void jevois::ImGuiImage::load ( std::string const &  fname)

Load from file.

Definition at line 76 of file ImGuiImage.C.

References LFATAL.

◆ loaded()

bool jevois::ImGuiImage::loaded ( ) const

Returns true if an image has been loaded through load()

Definition at line 84 of file ImGuiImage.C.


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