34#ifndef VP_WIN32_RENDERER_H
35#define VP_WIN32_RENDERER_H
37#include <visp3/core/vpConfig.h>
39#if (defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9))
41#ifndef DOXYGEN_SHOULD_SKIP_THIS
43#include <visp3/core/vpColor.h>
44#include <visp3/core/vpImage.h>
50# pragma clang diagnostic push
51# pragma clang diagnostic ignored "-Wnonportable-system-include-path"
60# pragma clang diagnostic pop
65class VISP_EXPORT vpWin32Renderer
70 unsigned int m_rwidth;
71 unsigned int m_rheight;
72 unsigned int m_rscale;
78 vpWin32Renderer() : m_rwidth(0), m_rheight(0), m_rscale(1) { }
83 vpWin32Renderer(
const vpWin32Renderer &renderer)
91 virtual ~vpWin32Renderer() { }
96 vpWin32Renderer &operator=(
const vpWin32Renderer &renderer)
98 m_rwidth = renderer.m_rwidth;
99 m_rheight = renderer.m_rheight;
100 m_rscale = renderer.m_rscale;
105 virtual bool init(HWND hWnd,
unsigned int w,
unsigned int h) = 0;
108 virtual bool render() = 0;
114 virtual void setImg(
const vpImage<vpRGBa> &im) = 0;
115 virtual void setImg(
const vpImage<unsigned char> &im) = 0;
116 virtual void setImgROI(
const vpImage<vpRGBa> &im,
const vpImagePoint &iP,
unsigned int width,
117 unsigned int height) = 0;
118 virtual void setImgROI(
const vpImage<unsigned char> &im,
const vpImagePoint &iP,
unsigned int width,
119 unsigned int height) = 0;
126 virtual void setPixel(
const vpImagePoint &iP,
const vpColor &color) = 0;
128 void setScale(
unsigned int scale) { m_rscale = scale; }
129 void setHeight(
unsigned int height) { m_rheight =
height; }
130 void setWidth(
unsigned int width) { m_rwidth =
width; }
140 virtual void drawLine(
const vpImagePoint &ip1,
const vpImagePoint &ip2,
const vpColor &color,
unsigned int thickness,
141 int style = PS_SOLID) = 0;
152 virtual void drawRect(
const vpImagePoint &topLeft,
unsigned int width,
unsigned int height,
const vpColor &color,
153 bool fill =
false,
unsigned int thickness = 1) = 0;
159 virtual void clear(
const vpColor &color) = 0;
169 virtual void drawCircle(
const vpImagePoint ¢er,
unsigned int radius,
const vpColor &color,
bool fill,
170 unsigned int thickness = 1) = 0;
178 virtual void drawText(
const vpImagePoint &ip,
const char *text,
const vpColor &color) = 0;
187 virtual void drawCross(
const vpImagePoint &ip,
unsigned int size,
const vpColor &color,
188 unsigned int thickness = 1) = 0;
199 virtual void drawArrow(
const vpImagePoint &ip1,
const vpImagePoint &ip2,
const vpColor &color,
unsigned int w,
200 unsigned int h,
unsigned int thickness) = 0;
206 virtual void getImage(vpImage<vpRGBa> &I) = 0;