34 #ifndef VP_D3D_RENDERER_H
35 #define VP_D3D_RENDERER_H
37 #include <visp3/core/vpConfig.h>
39 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 #if (defined(VISP_HAVE_D3D9))
46 #include <visp3/core/vpDisplayException.h>
47 #include <visp3/gui/vpWin32Renderer.h>
60 class VISP_EXPORT vpD3DRenderer :
public vpWin32Renderer
65 IDirect3DDevice9 *pd3dDevice;
72 IDirect3DTexture9 *pd3dText;
76 IDirect3DTexture9 *pd3dVideoText;
79 unsigned int textWidth;
94 bool init(HWND hwnd,
unsigned int width,
unsigned int height);
98 virtual ~vpD3DRenderer() VP_OVERRIDE;
101 void setImg(const
vpImage<
unsigned char> &im);
103 void setImgROI(const
vpImage<
unsigned char> &im, const
vpImagePoint &iP,
unsigned int width,
unsigned int height);
108 int style = PS_SOLID);
110 void drawRect(const
vpImagePoint &topLeft,
unsigned int width,
unsigned int height, const
vpColor &color,
111 bool fill = false,
unsigned int thickness = 1);
113 void clear(const
vpColor &color);
115 void drawCircle(const
vpImagePoint ¢er,
unsigned int radius, const
vpColor &color,
bool fill = false,
116 unsigned int thickness = 1);
120 void drawCross(const
vpImagePoint &ip,
unsigned int size, const
vpColor &color,
unsigned int thickness = 1);
123 unsigned int thickness = 1);
128 void initView(
float,
float);
134 void subDrawCircle(
int i,
int j,
int x,
int y,
vpColor col,
unsigned char *buf,
unsigned int pitch,
unsigned int maxX,
137 void convert(const
vpImage<
vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch);
138 void convert(const
vpImage<
unsigned char> &I,
unsigned char *imBuffer,
unsigned int pitch);
139 void convertROI(const
vpImage<
vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch,
int i_min,
int j_min,
140 int i_max,
int j_max);
141 void convertROI(const
vpImage<
unsigned char> &I,
unsigned char *imBuffer,
unsigned int pitch,
int i_min,
int j_min,
142 int i_max,
int j_max);
156 inline
void setBufferPixel(
unsigned char *buf,
unsigned int pitch,
int x,
int y, const
vpColor &color,
157 unsigned int maxX,
unsigned int maxY)
161 c = colors[color.id];
163 c = D3DCOLOR_ARGB(0xFF, color.R, color.G, color.B);
166 if (x >= 0 && y >= 0 && x <= (
int)maxX && y <= (
int)maxY)
167 *(
unsigned long *)(buf + (y * pitch) + (x << 2)) = c;
178 inline void setBufferPixel(
unsigned char *buf,
unsigned int pitch,
int x,
int y,
const vpColor &color)
182 c = colors[color.
id];
184 c = D3DCOLOR_ARGB(0xFF, color.
R, color.
G, color.
B);
187 *(
unsigned long *)(buf + (y * pitch) + (x << 2)) = c;
190 unsigned int supPowerOf2(
unsigned int n);
Class to define RGB colors available for display functionalities.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition of the vpImage class member functions.
unsigned char B
Blue component.
unsigned char R
Red component.
unsigned char G
Green component.