ViSP  2.8.0
vpWin32Renderer.h
1 /****************************************************************************
2  *
3  * $Id: vpWin32Renderer.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Windows 32 renderer base class
36  *
37  * Authors:
38  * Bruno Renier
39  *
40  *****************************************************************************/
41 
42 #include <visp/vpConfig.h>
43 
44 #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) )
45 
46 #ifndef vpWin32Renderer_HH
47 #define vpWin32Renderer_HH
48 
49 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 
51 #include <visp/vpImage.h>
52 #include <visp/vpColor.h>
53 #include <windows.h>
54 #include <visp/vpDebug.h>
55 
56 class VISP_EXPORT vpWin32Renderer
57 {
58 
59  protected:
60  //the size of the display
61  unsigned int nbCols;
62  unsigned int nbRows;
63 
64  public:
66  virtual ~vpWin32Renderer() {};
67 
69  unsigned int getImageWidth(){ return nbCols; }
70  unsigned int getImageHeight(){ return nbRows; }
71 
72 
73 
75  virtual bool init(HWND hWnd, unsigned int w, unsigned int h) =0;
76 
78  virtual bool render() =0;
79 
80 
85  virtual void setImg(const vpImage<vpRGBa>& im) =0;
86  virtual void setImg(const vpImage<unsigned char>& im) =0;
87  virtual void setImgROI(const vpImage<vpRGBa>& im, const vpImagePoint &iP, const unsigned int width, const unsigned int height ) =0;
88  virtual void setImgROI(const vpImage<unsigned char>& im, const vpImagePoint &iP, const unsigned int width, const unsigned int height ) =0;
89 
96  virtual void setPixel(const vpImagePoint &iP, const vpColor &color) =0;
97 
108  virtual void drawLine(const vpImagePoint &ip1,
109  const vpImagePoint &ip2,
110  const vpColor &color, unsigned int thickness, int style=PS_SOLID) =0;
111 
122  virtual void drawRect(const vpImagePoint &topLeft,
123  unsigned int width, unsigned int height,
124  const vpColor &color, bool fill=false,
125  unsigned int thickness=1) =0;
126 
131  virtual void clear(const vpColor &color) =0;
132 
140  virtual void drawCircle(const vpImagePoint &center, unsigned int radius,
141  const vpColor &color, bool fill, unsigned int thickness=1) =0;
142 
150  virtual void drawText(const vpImagePoint &ip, const char * text,
151  const vpColor &color) =0;
152 
161  virtual void drawCross(const vpImagePoint &ip, unsigned int size,
162  const vpColor &color, unsigned int thickness=1) =0;
163 
174  virtual void drawArrow(const vpImagePoint &ip1,
175  const vpImagePoint &ip2,
176  const vpColor &color, unsigned int w,unsigned int h, unsigned int thickness) =0;
177 
182  virtual void getImage(vpImage<vpRGBa> &I) =0;
183 };
184 
185 #endif
186 #endif
187 #endif
Class to define colors available for display functionnalities.
Definition: vpColor.h:125
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:92