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>
65class 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();
114 int style = PS_SOLID);
116 void drawRect(
const vpImagePoint &topLeft,
unsigned int width,
unsigned int height,
const vpColor &color,
117 bool fill =
false,
unsigned int thickness = 1);
119 void clear(
const vpColor &color);
121 void drawCircle(
const vpImagePoint ¢er,
unsigned int radius,
const vpColor &color,
bool fill =
false,
122 unsigned int thickness = 1);
126 void drawCross(
const vpImagePoint &ip,
unsigned int size,
const vpColor &color,
unsigned int thickness = 1);
129 unsigned int thickness = 1);
134 void initView(
float,
float);
140 void subDrawCircle(
int i,
int j,
int x,
int y,
vpColor col,
unsigned char *buf,
unsigned int pitch,
unsigned int maxX,
143 void convert(
const vpImage<vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch);
145 void convertROI(
const vpImage<vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch,
int i_min,
int j_min,
146 int i_max,
int j_max);
147 void convertROI(
const vpImage<unsigned char> &I,
unsigned char *imBuffer,
unsigned int pitch,
int i_min,
int j_min,
148 int i_max,
int j_max);
162 inline void setBufferPixel(
unsigned char *buf,
unsigned int pitch,
int x,
int y,
const vpColor &color,
163 unsigned int maxX,
unsigned int maxY)
167 c = colors[color.
id];
169 c = D3DCOLOR_ARGB(0xFF, color.
R, color.
G, color.
B);
172 if (x >= 0 && y >= 0 && x <= (
int)maxX && y <= (
int)maxY)
173 *(
unsigned long *)(buf + (y * pitch) + (x << 2)) = c;
184 inline void setBufferPixel(
unsigned char *buf,
unsigned int pitch,
int x,
int y,
const vpColor &color)
188 c = colors[color.
id];
190 c = D3DCOLOR_ARGB(0xFF, color.
R, color.
G, color.
B);
193 *(
unsigned long *)(buf + (y * pitch) + (x << 2)) = c;
196 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.