Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
GuiCV.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS 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 Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 #ifndef __GuiCV_hh__
27 #define __GuiCV_hh__
28 
29 
30 #include "bias_config.h"
31 
32 #ifndef BIAS_HAVE_OPENCV
33 # error BIAS_HAVE_OPENCV not defined. Please recompile BIAS with USE_OPENCV enabled if you want to use GuiCV.
34 #endif
35 
36 #include "GuiBase.hh"
37 #include <string>
38 
39 
40 // forwrad declaration for cxtypes.h to avoid cv.h inclusion:
41 typedef struct _IplImage IplImage;
42 
43 namespace BIAS{
44  /** @class GuiCV
45  @ingroup g_gui
46  @brief Gui based on OpenCV is a simple windowing environment...
47 
48  Usage:
49  - get an object
50  - call ShowImage() to visualize an image
51  - use CheckForKeyEvent() to have your programm react on pressed keys
52  */
53  class BIASGui_EXPORT GuiCV : public GuiBase
54  {
55  public:
56  GuiCV(bool ShowMousePos = true);
57  GuiCV(const std::string& Title, bool ShowMousePos = true);
58  GuiCV(const GuiCV& gui);
59  virtual ~GuiCV();
60 
61  // GuiBase functions
62  virtual void SetTitle(std::string const& Title);
63  virtual int DestroyWindow();
64  virtual char CheckForKeyEvent();
65  virtual char WaitForKeyEvent();
66  virtual void WaitForMouseButtonEvent(bool& Pressed, int& Button,
67  int& Xpos, int& Ypos);
68 
69  protected:
70  IplImage* IplImage_;
72 
73  // GuiBase functions
74  virtual int ShowConvertedImage_(Image<unsigned char> &image);
75 
76  void MouseCallback(int event, int x, int y, int flags);
77  static void StaticMouseCallback(int event, int x, int y,
78  int flags, void* param);
79 
80  int CreateIplImageShared(const BIAS::ImageBase* p_src, IplImage* &p_dest);
81  };
82 
83 } // namespace BIAS
84 
85 #endif // __GuiCV_hh__
IplImage * IplImage_
Definition: GuiCV.hh:70
Gui is a simple windowing environment...
Definition: GuiBase.hh:75
Gui based on OpenCV is a simple windowing environment...
Definition: GuiCV.hh:53
Image< unsigned char > CurrentImage_
Definition: GuiCV.hh:71
This is the base class for images in BIAS.
Definition: ImageBase.hh:102