Fawkes API  Fawkes Development Version
yuv_viewer_gui.h
1 
2 /***************************************************************************
3  * yuv_viewer.h - YUV viewer gui
4  *
5  * Created: Sat Mar 22 16:34:02 2009
6  * Copyright 2009 Christof Rath <c.rath@student.tugraz.at>
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __FIREVISION_TOOLS_YUV_VIEWER_LOC_VIEWER_GUI_H_
24 #define __FIREVISION_TOOLS_YUV_VIEWER_LOC_VIEWER_GUI_H_
25 
26 #define LOC_PLUGIN_NAME "fvnao_loc"
27 #define FUSE_PLUGIN_NAME "fvfountain"
28 #define FOUNTAIN_PORT_PATH "/firevision/fountain/tcp_port"
29 
30 #include <fvwidgets/image_widget.h>
31 #include <fvutils/color/yuv.h>
32 
33 #include <gtkmm.h>
34 
35 using namespace firevision;
36 
37 class YuvViewerGtkWindow : public Gtk::Window
38 {
39 private:
40 public:
41  YuvViewerGtkWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder> builder);
42  virtual ~YuvViewerGtkWindow();
43 
44 private:
45  bool on_mouse_over_yuv(GdkEventMotion *event);
46  bool on_click_on_yuv(GdkEventButton *event);
47  void on_y_value_changed();
48  void on_y_res_changed();
49  void on_uv_res_changed();
50  void calc_seg();
51  Glib::ustring convert_float2str(float f, unsigned int width);
52 
53 private:
54  // widgets
55  Gtk::EventBox *__yuv_vp;
56  Gtk::Viewport *__cur_vp;
57  Gtk::Viewport *__seg_vp;
58  Gtk::HScale *__y_scale;
59  Gtk::Label *__u_value;
60  Gtk::Label *__v_value;
61  Gtk::SpinButton *__y_res;
62  Gtk::SpinButton *__u_res;
63  Gtk::SpinButton *__v_res;
64 
65  ImageWidget *__yuv_widget;
66  ImageWidget *__cur_widget;
67  ImageWidget *__seg_widget;
68 
69  unsigned char __yuv_buffer[256 * 256 * 2];
70  unsigned char __cur_buffer[ 60 * 40 * 2];
71  unsigned char __seg_buffer[256 * 256 * 2];
72 };
73 
74 #endif /* __FIREVISION_TOOLS_YUV_VIEWER_LOC_VIEWER_GUI_H_ */
This class is an image container to display fawkes cameras (or image buffers) inside a Gtk::Container...
Definition: image_widget.h:45
Tool to show the YUV color space.