Visual Servoing Platform  version 3.0.0
vpWin32Renderer.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Windows 32 renderer base class
32  *
33  * Authors:
34  * Bruno Renier
35  *
36  *****************************************************************************/
37 
38 #include <visp3/core/vpConfig.h>
39 
40 #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) )
41 
42 #ifndef vpWin32Renderer_HH
43 #define vpWin32Renderer_HH
44 
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
46 
47 #include <visp3/core/vpImage.h>
48 #include <visp3/core/vpColor.h>
49 #include <windows.h>
50 #include <visp3/core/vpDebug.h>
51 
52 class VISP_EXPORT vpWin32Renderer
53 {
54 
55  protected:
56  //the size of the display
57  unsigned int nbCols;
58  unsigned int nbRows;
59 
60  public:
62  virtual ~vpWin32Renderer() {};
63 
65  unsigned int getImageWidth(){ return nbCols; }
66  unsigned int getImageHeight(){ return nbRows; }
67 
68 
69 
71  virtual bool init(HWND hWnd, unsigned int w, unsigned int h) =0;
72 
74  virtual bool render() =0;
75 
76 
81  virtual void setImg(const vpImage<vpRGBa>& im) =0;
82  virtual void setImg(const vpImage<unsigned char>& im) =0;
83  virtual void setImgROI(const vpImage<vpRGBa>& im, const vpImagePoint &iP, const unsigned int width, const unsigned int height ) =0;
84  virtual void setImgROI(const vpImage<unsigned char>& im, const vpImagePoint &iP, const unsigned int width, const unsigned int height ) =0;
85 
92  virtual void setPixel(const vpImagePoint &iP, const vpColor &color) =0;
93 
104  virtual void drawLine(const vpImagePoint &ip1,
105  const vpImagePoint &ip2,
106  const vpColor &color, unsigned int thickness, int style=PS_SOLID) =0;
107 
118  virtual void drawRect(const vpImagePoint &topLeft,
119  unsigned int width, unsigned int height,
120  const vpColor &color, bool fill=false,
121  unsigned int thickness=1) =0;
122 
127  virtual void clear(const vpColor &color) =0;
128 
136  virtual void drawCircle(const vpImagePoint &center, unsigned int radius,
137  const vpColor &color, bool fill, unsigned int thickness=1) =0;
138 
146  virtual void drawText(const vpImagePoint &ip, const char * text,
147  const vpColor &color) =0;
148 
157  virtual void drawCross(const vpImagePoint &ip, unsigned int size,
158  const vpColor &color, unsigned int thickness=1) =0;
159 
170  virtual void drawArrow(const vpImagePoint &ip1,
171  const vpImagePoint &ip2,
172  const vpColor &color, unsigned int w,unsigned int h, unsigned int thickness) =0;
173 
178  virtual void getImage(vpImage<vpRGBa> &I) =0;
179 };
180 
181 #endif
182 #endif
183 #endif
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88