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 <fvutils/color/yuv.h>
31#include <fvwidgets/image_widget.h>
32
33#include <gtkmm.h>
34
35using namespace firevision;
36
37class YuvViewerGtkWindow : public Gtk::Window
38{
39private:
40public:
41 YuvViewerGtkWindow(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> builder);
42 virtual ~YuvViewerGtkWindow();
43
44private:
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
53private:
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__ */
Tool to show the YUV color space.
YuvViewerGtkWindow(BaseObjectType *cobject, const Glib::RefPtr< Gtk::Builder > builder)
Constructor.
virtual ~YuvViewerGtkWindow()
Destructor.
This class is an image container to display fawkes cameras (or image buffers) inside a Gtk::Container...
Definition: image_widget.h:43