39#include <visp3/core/vpConfig.h>
41#if (defined(VISP_HAVE_GDI))
42#ifndef vpGDIRenderer_HH
43#define vpGDIRenderer_HH
45#ifndef DOXYGEN_SHOULD_SKIP_THIS
52#include <visp3/core/vpDisplayException.h>
53#include <visp3/core/vpImage.h>
54#include <visp3/core/vpRGBa.h>
55#include <visp3/gui/vpWin32Renderer.h>
57#include <visp3/core/vpMath.h>
59class VISP_EXPORT vpGDIRenderer :
public vpWin32Renderer
74 CRITICAL_SECTION m_criticalSection;
76 unsigned int m_bmp_width;
77 unsigned int m_bmp_height;
82 virtual ~vpGDIRenderer();
84 bool init(HWND hWnd,
unsigned int width,
unsigned int height);
88 void setImg(
const vpImage<vpRGBa> &I);
89 void setImg(
const vpImage<unsigned char> &I);
90 void setImgROI(
const vpImage<vpRGBa> &I,
const vpImagePoint &iP,
unsigned int width,
unsigned int height);
91 void setImgROI(
const vpImage<unsigned char> &I,
const vpImagePoint &iP,
unsigned int width,
unsigned int height);
93 void setPixel(
const vpImagePoint &iP,
const vpColor &color);
95 void drawLine(
const vpImagePoint &ip1,
const vpImagePoint &ip2,
const vpColor &color,
unsigned int thickness,
96 int style = PS_SOLID);
98 void drawRect(
const vpImagePoint &topLeft,
unsigned int width,
unsigned int height,
const vpColor &color,
99 bool fill =
false,
unsigned int thickness = 1);
101 void clear(
const vpColor &color);
103 void drawCircle(
const vpImagePoint ¢er,
unsigned int radius,
const vpColor &color,
bool fill =
false,
104 unsigned int thickness = 1);
106 void drawText(
const vpImagePoint &ip,
const char *text,
const vpColor &color);
108 void drawCross(
const vpImagePoint &ip,
unsigned int size,
const vpColor &color,
unsigned int thickness = 1);
110 void drawArrow(
const vpImagePoint &ip1,
const vpImagePoint &ip2,
const vpColor &color,
unsigned int w,
unsigned int h,
111 unsigned int thickness = 1);
113 void getImage(vpImage<vpRGBa> &I);
117 bool updateBitmap(HBITMAP &hBmp,
unsigned char *imBuffer,
unsigned int w,
unsigned int h);
119 bool updateBitmapROI(
unsigned char *imBuffer,
int i_min,
int j_min,
int w,
int h);
122 void convert(
const vpImage<vpRGBa> &I, HBITMAP &hBmp);
125 void convert(
const vpImage<unsigned char> &I, HBITMAP &hBmp);
128 void convertROI(
const vpImage<vpRGBa> &I,
const vpImagePoint &iP,
unsigned int width,
unsigned int height);
131 void convertROI(
const vpImage<unsigned char> &I,
const vpImagePoint &iP,
unsigned int width,
unsigned int height);