34#ifndef VP_GDI_RENDERER_H
35#define VP_GDI_RENDERER_H
37#include <visp3/core/vpConfig.h>
39#if (defined(VISP_HAVE_GDI))
41#ifndef DOXYGEN_SHOULD_SKIP_THIS
47# pragma clang diagnostic push
48# pragma clang diagnostic ignored "-Wnonportable-system-include-path"
57# pragma clang diagnostic pop
60#include <visp3/core/vpDisplayException.h>
61#include <visp3/core/vpImage.h>
62#include <visp3/core/vpRGBa.h>
63#include <visp3/gui/vpWin32Renderer.h>
65#include <visp3/core/vpMath.h>
69class VISP_EXPORT vpGDIRenderer :
public vpWin32Renderer
84 CRITICAL_SECTION m_criticalSection;
86 unsigned int m_bmp_width;
87 unsigned int m_bmp_height;
92 virtual ~vpGDIRenderer() VP_OVERRIDE;
94#if (VISP_CXX_STANDARD > VISP_CXX_STANDARD_98)
95 vpGDIRenderer(
const vpGDIRenderer &) =
default;
96 vpGDIRenderer &operator=(
const vpGDIRenderer &) =
default;
99 bool init(HWND hWnd,
unsigned int width,
unsigned int height) VP_OVERRIDE;
101 bool render() VP_OVERRIDE;
103 void setImg(const vpImage<vpRGBa> &I) VP_OVERRIDE;
104 void setImg(const vpImage<
unsigned char> &I) VP_OVERRIDE;
105 void setImgROI(const vpImage<vpRGBa> &I, const vpImagePoint &iP,
unsigned int width,
unsigned int height) VP_OVERRIDE;
106 void setImgROI(const vpImage<
unsigned char> &I, const vpImagePoint &iP,
unsigned int width,
unsigned int height) VP_OVERRIDE;
108 void setPixel(const vpImagePoint &iP, const vpColor &color) VP_OVERRIDE;
110 void drawLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color,
unsigned int thickness,
111 int style = PS_SOLID) VP_OVERRIDE;
113 void drawRect(const vpImagePoint &topLeft,
unsigned int width,
unsigned int height, const vpColor &color,
114 bool fill = false,
unsigned int thickness = 1) VP_OVERRIDE;
116 void clear(const vpColor &color) VP_OVERRIDE;
118 void drawCircle(const vpImagePoint ¢er,
unsigned int radius, const vpColor &color,
bool fill = false,
119 unsigned int thickness = 1) VP_OVERRIDE;
121 void drawText(const vpImagePoint &ip, const
char *text, const vpColor &color) VP_OVERRIDE;
123 void drawCross(const vpImagePoint &ip,
unsigned int size, const vpColor &color,
unsigned int thickness = 1) VP_OVERRIDE;
125 void drawArrow(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color,
unsigned int w,
unsigned int h,
126 unsigned int thickness = 1) VP_OVERRIDE;
128 void getImage(vpImage<vpRGBa> &I) VP_OVERRIDE;
132 bool updateBitmap(HBITMAP &hBmp,
unsigned char *imBuffer,
unsigned int w,
unsigned int h);
134 bool updateBitmapROI(
unsigned char *imBuffer,
int i_min,
int j_min,
int w,
int h);
137 void convert(const vpImage<vpRGBa> &I, HBITMAP &hBmp);
140 void convert(const vpImage<
unsigned char> &I, HBITMAP &hBmp);
143 void convertROI(const vpImage<vpRGBa> &I, const vpImagePoint &iP,
unsigned int width,
unsigned int height);
146 void convertROI(const vpImage<
unsigned char> &I, const vpImagePoint &iP,
unsigned int width,
unsigned int height);