#include <zgui.h>
|
| Window (std::string title, cv::Rect_< int > r) |
|
void | show () |
| draw mat_ More...
|
|
void | popup (Window &w, std::function< void(int)> f=[](int){}) |
|
void | popdown (int value) |
|
std::string | type () const |
|
int | open (int flag=cv::WINDOW_AUTOSIZE, int x=-1, int y=-1) |
|
void | quit (int r) |
|
void | focus (bool v) |
|
Window & | operator+ (Widget &w) |
|
Window & | operator- (Widget &w) |
|
Window & | operator<< (Widget &r) |
|
Window & | operator>> (Widget &r) |
|
int | loop () |
|
std::vector< Widget * >::iterator | begin () |
|
std::vector< Widget * >::iterator | end () |
|
void | close () |
|
void | start (int flag=cv::WINDOW_AUTOSIZE|cv::WINDOW_KEEPRATIO) |
|
void | keyboard_callback (int key, int level=0) |
|
std::string | title () const |
|
void | tie (TextInput &t, Button &b, const std::vector< std::string > &v, int font_size) |
|
template<class T > |
auto | tie (TextInput &t, Button &b1, Button &b2, T start, T step) |
|
template<class... T> |
void | tabs (int xpos, int ypos, T &... wins) |
|
void | organize_accordingto_zindex () |
|
void | move_widget (Widget &w, cv::Point2i p) |
|
void | on_register () |
| will be called when widget is added to a window
|
|
bool | is_window () const |
|
template<class... T> |
auto | tie (T &... checks) |
|
template<class... T> |
void | wrap (const char *title, int font, int N, const T &... widgets) |
|
void | draw_all_wrapped () |
|
void | scroll_to (cv::Rect2i r) |
|
void | set_ul (cv::Point2i p) |
|
void | set_br (cv::Point2i p) |
|
| Widget (cv::Rect_< int > r) |
|
Widget & | operator= (const Widget &r) |
|
bool | focus () const |
|
virtual void | event_callback (int event, int x, int y) |
|
void | resize (cv::Rect2i r) |
|
void | update () |
|
int | zIndex () |
|
void | zIndex (int v) |
|
void | hidden (bool v) |
|
void | activated (bool v) |
|
bool | hidden () const |
|
bool | activated () const |
|
void | hide () |
|
float | alpha () const |
|
void | alpha (float f) |
|
void | shade_rect (cv::Rect2i r, int shade=3, cv::Vec3b color=widget_color_, cv::Vec3b upper_left=highlight_color_, cv::Vec3b lower_right=click_color_) |
|
|
cv::Rect2i | scrolled_rect_ = cv::Rect2i{0,0,0,0} |
|
std::vector< Widget * > | widgets_ |
|
std::vector< Widget * > | backup_ |
|
std::map< int, std::function< void(int, int)> > | gui_callback_ |
| map<int : event, function(x, y)>. library will draw change in widget graphics after gui_callback
|
|
std::map< int, std::function< void(int, int)> > | user_callback_ |
|
cv::Mat3b | mat_ |
| Matrix that contains widget shape.
|
|
Window * | parent_ = nullptr |
| pointer to parent window that is containing this widget
|
|
|
void | draw_wrapped (const Wrapped &wr) |
|
|
std::string | title_ |
|
bool | closed_ = false |
|
int | result_ = -1 |
|
float | alpha_ = 1 |
| alpha value of widget. Widgets can be overlapped. Alpha value will be calculated in such cases.
|
|
bool | hidden_ = false |
| if hidden, a widget will not show on window, but still can react to event.
|
|
bool | activated_ = true |
| deactivated widget cannot get focus so that it cannot react to events.
|
|
bool | focus_ = false |
|
int | zIndex_ = 0 |
| higher zIndex widget will be in front of lower zIndex widget.
|
|
|
static const cv::Vec3b | background_color_ = {200, 200, 200} |
|
static const cv::Vec3b | widget_color_ = {220, 220, 220} |
|
static const cv::Vec3b | highlight_color_ = {240, 240, 240} |
|
static const cv::Vec3b | click_color_ = {180, 180, 180} |
|
static cv::Ptr< cv::freetype::FreeType2 > | ft2_ |
| freetype2 font. CJK font needed
|
|
Window class houses all widgets including other windows
◆ Window()
z::Window::Window |
( |
std::string |
title, |
|
|
cv::Rect_< int > |
r |
|
) |
| |
create a window with title and position and size of r.
- Parameters
-
title | if window is the top window, this will be the window title. else if window is embedded inside another window, window will be framed and title will be the frame title. In case title == "", no frame will show. |
r | window will occupy this rectangular space. If this window is not embedded inside other window x, y postions is not relevant. |
◆ close()
void z::Window::close |
( |
| ) |
|
◆ draw_all_wrapped()
void z::Window::draw_all_wrapped |
( |
| ) |
|
◆ focus()
void z::Window::focus |
( |
bool |
v | ) |
|
|
virtual |
also unfocus child widgets
Reimplemented from z::Widget.
◆ loop()
get keyboard event by calling cv::waitKey
◆ move_widget()
void z::Window::move_widget |
( |
z::Widget & |
w, |
|
|
cv::Point2i |
p |
|
) |
| |
move a widget that is already mounted. Just change the widget's xy position
◆ open()
int z::Window::open |
( |
int |
flag = cv::WINDOW_AUTOSIZE , |
|
|
int |
x = -1 , |
|
|
int |
y = -1 |
|
) |
| |
Open another window. Call quit to close window that is opened.
- Returns
- return int value when quit is called.
◆ operator+()
add widget to this window
◆ operator-()
remove widget from this window
◆ operator<<()
◆ operator>>()
◆ organize_accordingto_zindex()
void z::Window::organize_accordingto_zindex |
( |
| ) |
|
sort widgets according to zIndex_ and copy all widgets that is not hiddent to window matrix.
for mouse event
◆ popdown()
void z::Window::popdown |
( |
int |
value | ) |
|
close popup window.
- Parameters
-
value | this value will be handed over to function that is registered with popup function call. |
◆ popup()
void z::Window::popup |
( |
z::Window & |
w, |
|
|
std::function< void(int)> |
f = [](int){} |
|
) |
| |
show popup window on window w, and register result function. popdown function will hand over int value to f.
◆ scroll_to()
void z::Window::scroll_to |
( |
cv::Rect2i |
r | ) |
|
use this to scroll or resize window.
◆ show()
draw mat_
show window and its components
Reimplemented from z::Widget.
◆ start()
void z::Window::start |
( |
int |
flag = cv::WINDOW_AUTOSIZE | cv::WINDOW_KEEPRATIO | ) |
|
organize according to zindex -> set mouse callback -> show window
◆ tabs()
template<class... T>
void z::Window::tabs |
( |
int |
xpos, |
|
|
int |
ypos, |
|
|
T &... |
wins |
|
) |
| |
|
inline |
create a tab by combining multiple Womdows and will create tab navigation buttons on top
- Parameters
-
xpos | x position to create tab. |
ypos | y position to create tab. This is the Upper left postion of navigation button. |
◆ tie() [1/2]
template<class... T>
auto z::Window::tie |
( |
T &... |
checks | ) |
|
|
inline |
create a radio button by combining multiple CheckBoxes. RadioButton is a widget that allows one CheckBox to be selected at one time.
◆ tie() [2/2]
create a numeric spin button by tying a textinput and two buttons.
- Parameters
-
start | number to begin with |
step | step to increase or decrease when buttons are clicked. |
◆ title()
string z::Window::title |
( |
| ) |
const |
◆ wrap()
template<class... T>
void z::Window::wrap |
( |
const char * |
title, |
|
|
int |
font, |
|
|
int |
N, |
|
|
const T &... |
widgets |
|
) |
| |
|
inline |
@parma N margin.
- Parameters
-
The documentation for this class was generated from the following files:
- /home/zeta/Programming/opencv-gui/src/zgui.h
- /home/zeta/Programming/opencv-gui/src/scrolledwindow.cc
- /home/zeta/Programming/opencv-gui/src/window.cc