39 #ifndef DOXYGEN_SHOULD_SKIP_THIS 41 #include <visp3/core/vpConfig.h> 43 #if (defined(VISP_HAVE_D3D9)) 45 #ifndef VPD3DRENDERER_HH 46 #define VPD3DRENDERER_HH 52 #include <visp3/core/vpDisplayException.h> 53 #include <visp3/gui/vpWin32Renderer.h> 65 class VISP_EXPORT vpD3DRenderer :
public vpWin32Renderer
71 IDirect3DDevice9 *pd3dDevice;
78 IDirect3DTexture9 *pd3dText;
82 IDirect3DTexture9 *pd3dVideoText;
85 unsigned int textWidth;
100 bool init(HWND hwnd,
unsigned int width,
unsigned int height);
104 virtual ~vpD3DRenderer();
109 unsigned int height);
111 unsigned int height);
116 int style = PS_SOLID);
118 void drawRect(
const vpImagePoint &topLeft,
unsigned int width,
unsigned int height,
const vpColor &color,
119 bool fill =
false,
unsigned int thickness = 1);
121 void clear(
const vpColor &color);
123 void drawCircle(
const vpImagePoint ¢er,
unsigned int radius,
const vpColor &color,
bool fill =
false,
124 unsigned int thickness = 1);
128 void drawCross(
const vpImagePoint &ip,
unsigned int size,
const vpColor &color,
unsigned int thickness = 1);
131 unsigned int thickness = 1);
136 void initView(
float,
float);
142 void subDrawCircle(
int i,
int j,
int x,
int y,
vpColor col,
unsigned char *buf,
unsigned int pitch,
unsigned int maxX,
145 void convert(
const vpImage<vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch);
147 void convertROI(
const vpImage<vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch,
int i_min,
int j_min,
148 int i_max,
int j_max);
149 void convertROI(
const vpImage<unsigned char> &I,
unsigned char *imBuffer,
unsigned int pitch,
int i_min,
int j_min,
150 int i_max,
int j_max);
164 inline void setBufferPixel(
unsigned char *buf,
unsigned int pitch,
int x,
int y,
const vpColor &color,
165 unsigned int maxX,
unsigned int maxY)
169 c = colors[color.
id];
171 c = D3DCOLOR_ARGB(0xFF, color.
R, color.
G, color.
B);
174 if (x >= 0 && y >= 0 && x <= (
int)maxX && y <= (
int)maxY)
175 *(
unsigned long *)(buf + (y * pitch) + (x << 2)) = c;
186 inline void setBufferPixel(
unsigned char *buf,
unsigned int pitch,
int x,
int y,
const vpColor &color)
190 c = colors[color.
id];
192 c = D3DCOLOR_ARGB(0xFF, color.
R, color.
G, color.
B);
195 *(
unsigned long *)(buf + (y * pitch) + (x << 2)) = c;
198 unsigned int supPowerOf2(
unsigned int n);
unsigned char B
Blue component.
Class to define RGB colors available for display functionnalities.
unsigned char G
Green component.
unsigned char R
Red component.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...