38 #ifndef DOXYGEN_SHOULD_SKIP_THIS 42 #include <visp3/core/vpConfig.h> 43 #if (defined(_WIN32) & defined(VISP_HAVE_D3D9)) 45 #include <visp3/core/vpColor.h> 46 #include <visp3/core/vpMath.h> 47 #include <visp3/gui/vpD3DRenderer.h> 74 vpD3DRenderer::vpD3DRenderer()
161 hFont = CreateFont(18, 0, 0, 0, FW_NORMAL,
false,
false,
false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
162 CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, NULL);
169 vpD3DRenderer::~vpD3DRenderer()
173 if (pd3dDevice != NULL)
174 pd3dDevice->Release();
177 if (pd3dText != NULL)
179 if (pd3dVideoText != NULL)
180 pd3dVideoText->Release();
188 unsigned int vpD3DRenderer::supPowerOf2(
unsigned int n)
195 return static_cast<unsigned int>(1 << (i + 1));
205 bool vpD3DRenderer::init(HWND hwnd,
unsigned int width,
unsigned int height)
213 if (NULL == (pD3D = Direct3DCreate9(D3D_SDK_VERSION)))
216 D3DDISPLAYMODE d3ddm;
217 if (FAILED(pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm)))
220 D3DPRESENT_PARAMETERS d3dpp;
221 ZeroMemory(&d3dpp,
sizeof(d3dpp));
222 d3dpp.BackBufferCount = 1;
223 d3dpp.Windowed = TRUE;
224 d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
225 d3dpp.BackBufferFormat = d3ddm.Format;
228 if (FAILED(pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
229 D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED, &d3dpp, &pd3dDevice)))
233 pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
236 initView((
float)m_rwidth, (
float)m_rheight);
239 textWidth = supPowerOf2((m_rwidth > m_rheight) ? m_rwidth : m_rheight);
244 if (D3DXCreateTexture(pd3dDevice, textWidth, textWidth, D3DX_DEFAULT, 0, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM,
245 &pd3dText) != D3D_OK) {
250 if (D3DXCreateTexture(pd3dDevice, textWidth, textWidth, D3DX_DEFAULT, D3DUSAGE_DYNAMIC, D3DFMT_X8R8G8B8,
251 D3DPOOL_DEFAULT, &pd3dVideoText) != D3D_OK) {
256 if (D3DXCreateSprite(pd3dDevice, &pSprite) != S_OK)
267 void vpD3DRenderer::initView(
float WindowWidth,
float WindowHeight)
272 D3DXMatrixOrthoLH(&Ortho2D, WindowWidth, WindowHeight, 0.0f, 1.0f);
273 D3DXMatrixIdentity(&Identity);
275 if (pd3dDevice->SetTransform(D3DTS_PROJECTION, &Ortho2D) != D3D_OK ||
276 pd3dDevice->SetTransform(D3DTS_WORLD, &Identity) != D3D_OK ||
277 pd3dDevice->SetTransform(D3DTS_VIEW, &Identity) != D3D_OK)
287 void vpD3DRenderer::convert(
const vpImage<vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch)
290 for (
unsigned int i = 0; i < m_rheight; i++) {
291 unsigned int ii_ = i * pitch;
292 for (
unsigned int j = 0; j < m_rwidth; j++) {
294 unsigned int index_ = ii_ + j * 4;
295 imBuffer[index_] = val.
B;
296 imBuffer[++index_] = val.
G;
297 imBuffer[++index_] = val.
R;
298 imBuffer[++index_] = val.
A;
302 for (
unsigned int i = 0; i < m_rheight; i++) {
303 unsigned int i_ = i * m_rscale;
304 unsigned int ii_ = i * pitch;
305 for (
unsigned int j = 0; j < m_rwidth; j++) {
306 vpRGBa val = I[i_][j * m_rscale];
307 unsigned int index_ = ii_ + j * 4;
308 imBuffer[index_] = val.
B;
309 imBuffer[++index_] = val.
G;
310 imBuffer[++index_] = val.
R;
311 imBuffer[++index_] = val.
A;
326 for (
unsigned int i = 0; i < m_rheight; i++) {
327 unsigned int ii_ = i * pitch;
328 for (
unsigned int j = 0; j < m_rwidth; j++) {
329 unsigned char val = I[i][j];
330 unsigned int index_ = ii_ + j * 4;
331 imBuffer[index_] = val;
332 imBuffer[++index_] = val;
333 imBuffer[++index_] = val;
338 for (
unsigned int i = 0; i < m_rheight; i++) {
339 unsigned int i_ = i * m_rscale;
340 unsigned int ii_ = i * pitch;
341 for (
unsigned int j = 0; j < m_rwidth; j++) {
342 unsigned char val = I[i_][j * m_rscale];
343 unsigned int index_ = ii_ + j * 4;
344 imBuffer[index_] = val;
345 imBuffer[++index_] = val;
346 imBuffer[++index_] = val;
361 void vpD3DRenderer::convertROI(
const vpImage<unsigned char> &I,
unsigned char *imBuffer,
unsigned int pitch,
int i_min,
362 int j_min,
int i_max,
int j_max)
364 int h = i_max - i_min;
365 int w = j_max - j_min;
368 for (
int i = 0; i < h; i++) {
369 unsigned int i_ = i_min + i;
370 unsigned int ii_ = i * pitch;
371 for (
int j = 0; j < w; j++) {
372 unsigned char val = I[i_][j_min + j];
373 unsigned int index_ = ii_ + j * 4;
374 imBuffer[index_] = val;
375 imBuffer[++index_] = val;
376 imBuffer[++index_] = val;
381 for (
int i = 0; i < h; i++) {
382 unsigned int i_ = (i_min + i) * m_rscale;
383 unsigned int ii_ = i * pitch;
384 for (
int j = 0; j < w; j++) {
385 unsigned char val = I[i_][(j_min + j) * m_rscale];
386 unsigned int index_ = ii_ + j * 4;
387 imBuffer[index_] = val;
388 imBuffer[++index_] = val;
389 imBuffer[++index_] = val;
404 void vpD3DRenderer::convertROI(
const vpImage<vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch,
int i_min,
405 int j_min,
int i_max,
int j_max)
407 int h = i_max - i_min;
408 int w = j_max - j_min;
411 for (
int i = 0; i < h; i++) {
412 unsigned int i_ = i_min + i;
413 unsigned int ii_ = i * pitch;
414 for (
int j = 0; j < w; j++) {
415 vpRGBa val = I[i_][j_min + j];
416 unsigned int index_ = ii_ + j * 4;
417 imBuffer[index_] = val.
B;
418 imBuffer[++index_] = val.
G;
419 imBuffer[++index_] = val.
R;
424 for (
int i = 0; i < h; i++) {
425 unsigned int i_ = (i_min + i) * m_rscale;
426 unsigned int ii_ = i * pitch;
427 for (
int j = 0; j < w; j++) {
428 vpRGBa val = I[i_][(j_min + j) * m_rscale];
429 unsigned int index_ = ii_ + j * 4;
430 imBuffer[index_] = val.
B;
431 imBuffer[++index_] = val.
G;
432 imBuffer[++index_] = val.
R;
446 if (pd3dDevice != NULL) {
447 D3DLOCKED_RECT d3dLRect;
452 r.bottom =
static_cast<signed long>(m_rheight);
453 r.right =
static_cast<signed long>(m_rwidth);
456 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
457 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
462 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
463 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
466 convert(im, buf, pitch);
469 if (pd3dText->UnlockRect(0) != D3D_OK)
470 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
482 if (pd3dDevice != NULL) {
483 D3DLOCKED_RECT d3dLRect;
485 int i_min = (std::max)((
int)ceil(iP.
get_i() / m_rscale), 0);
486 int j_min = (std::max)((
int)ceil(iP.
get_j() / m_rscale), 0);
487 int i_max = (std::min)((
int)ceil((iP.
get_i() + height) / m_rscale), (int)m_rheight);
488 int j_max = (std::min)((
int)ceil((iP.
get_j() + width) / m_rscale), (int)m_rwidth);
492 r.left = (LONG)j_min;
493 r.bottom = (LONG)i_max;
494 r.right = (LONG)j_max;
497 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
498 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
503 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
504 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
507 convertROI(im, buf, pitch, i_min, j_min, i_max, j_max);
510 if (pd3dText->UnlockRect(0) != D3D_OK)
511 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
522 if (pd3dDevice != NULL) {
523 D3DLOCKED_RECT d3dLRect;
528 r.bottom =
static_cast<LONG
>(m_rheight);
529 r.right =
static_cast<LONG
>(m_rwidth);
532 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
533 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
538 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
539 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
542 convert(im, buf, pitch);
545 if (pd3dText->UnlockRect(0) != D3D_OK)
546 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
558 if (pd3dDevice != NULL) {
559 D3DLOCKED_RECT d3dLRect;
561 int i_min = (std::max)((
int)ceil(iP.
get_i() / m_rscale), 0);
562 int j_min = (std::max)((
int)ceil(iP.
get_j() / m_rscale), 0);
563 int i_max = (std::min)((
int)ceil((iP.
get_i() + height) / m_rscale), (int)m_rheight);
564 int j_max = (std::min)((
int)ceil((iP.
get_j() + width) / m_rscale), (int)m_rwidth);
568 r.left = (LONG)j_min;
569 r.bottom = (LONG)i_max;
570 r.right = (LONG)j_max;
573 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
574 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
579 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
580 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
583 convertROI(im, buf, pitch, i_min, j_min, i_max, j_max);
586 if (pd3dText->UnlockRect(0) != D3D_OK)
587 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
596 bool vpD3DRenderer::render()
603 pd3dDevice->BeginScene();
609 r.bottom =
static_cast<LONG
>(m_rheight);
610 r.right =
static_cast<LONG
>(m_rwidth);
614 pd3dDevice->UpdateTexture(pd3dText, pd3dVideoText);
618 #if (D3DX_SDK_VERSION <= 9) 620 pSprite->Draw(pd3dVideoText, &r, NULL, NULL, NULL, NULL, 0xFFFFFFFF);
623 pSprite->Draw(pd3dVideoText, &r, NULL, NULL, 0xFFFFFFFF);
628 pd3dDevice->EndScene();
630 pd3dDevice->Present(NULL, NULL, NULL, NULL);
644 if (iPscaled.
get_i() < 0 || iPscaled.
get_j() < 0 || iPscaled.
get_i() >= (int)m_rheight ||
645 iPscaled.
get_j() >= (int)m_rwidth) {
650 if (pd3dDevice != NULL) {
651 D3DLOCKED_RECT d3dLRect;
655 r.top = (LONG)iPscaled.
get_i();
656 r.left = (LONG)iPscaled.
get_j();
657 r.bottom = (LONG)iPscaled.
get_i() + 1;
658 r.right = (LONG)iPscaled.
get_j() + 1;
661 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
662 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
667 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
668 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
671 setBufferPixel(buf, pitch, 0, 0, color);
674 if (pd3dText->UnlockRect(0) != D3D_OK)
675 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
687 unsigned int thickness,
int style)
690 if (pd3dDevice != NULL) {
695 IDirect3DSurface9 *pd3dSurf;
696 pd3dText->GetSurfaceLevel(0, &pd3dSurf);
699 pd3dSurf->GetDC(&hDCMem);
704 hPen = CreatePen(style, static_cast<int>(thickness), colorsGDI[color.
id]);
706 COLORREF gdicolor = RGB(color.
R, color.
G, color.
B);
707 hPen = CreatePen(style, static_cast<int>(thickness), gdicolor);
711 SetBkMode(hDCMem, TRANSPARENT);
714 SelectObject(hDCMem, hPen);
719 if (thickness != 1 && style != PS_SOLID) {
723 double size = 10. * m_rscale;
725 bool vertical_line = (int)ip2_.
get_j() == (int)ip1_.
get_j();
728 std::swap(ip1_, ip2_);
731 std::swap(ip1_, ip2_);
734 double diff_j = vertical_line ? 1 : ip2_.
get_j() - ip1_.
get_j();
735 double deltaj = size / length * diff_j;
736 double deltai = size / length * (ip2_.
get_i() - ip1_.
get_i());
737 double slope = (ip2_.
get_i() - ip1_.
get_i()) / diff_j;
738 double orig = ip1_.
get_i() - slope * ip1_.
get_j();
741 for (
unsigned int i = (
unsigned int)ip1_.
get_i(); i < ip2_.
get_i(); i += (
unsigned int)(2 * deltai)) {
742 double j = ip1_.
get_j();
750 for (
unsigned int j = (
unsigned int)ip1_.
get_j(); j < ip2_.
get_j(); j += (
unsigned int)(2 * deltaj)) {
751 double i = slope * j + orig;
766 pd3dSurf->ReleaseDC(hDCMem);
783 void vpD3DRenderer::drawRect(
const vpImagePoint &topLeft,
unsigned int width,
unsigned int height,
const vpColor &color,
784 bool fill,
unsigned int thickness)
787 if (pd3dDevice != NULL) {
789 drawLine(topLeft, topLeft +
vpImagePoint(0, width), color, thickness);
792 drawLine(topLeft +
vpImagePoint(height, 0), topLeft, color, thickness);
795 unsigned int widthScaled = width / m_rscale;
796 unsigned int heightScaled = height / m_rscale;
798 if (topLeftScaled.
get_i() > (int)m_rheight - 1 || topLeftScaled.
get_j() > (int)m_rwidth - 1 ||
799 topLeftScaled.
get_i() + height < 0 || topLeftScaled.
get_j() + width < 0) {
804 D3DLOCKED_RECT d3dLRect;
807 r.top = (LONG)((topLeftScaled.
get_i() > 0) ? topLeftScaled.
get_i() : 0);
808 r.left = (LONG)((topLeftScaled.
get_j() > 0) ? topLeftScaled.
get_j() : 0);
809 r.bottom = (LONG)((topLeftScaled.
get_i() + heightScaled < (int)m_rheight) ? topLeftScaled.
get_i() + heightScaled
811 r.right = (LONG)((topLeftScaled.
get_j() + widthScaled < (int)m_rwidth) ? topLeftScaled.
get_j() + widthScaled
814 int rectW = r.right - r.left;
815 int rectH = r.bottom - r.top;
818 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
819 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
824 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
825 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
827 if (topLeftScaled.
get_i() >= 0 && topLeftScaled.
get_j() + widthScaled < m_rwidth &&
828 topLeftScaled.
get_i() + heightScaled < m_rheight && topLeftScaled.
get_j() >= 0) {
829 for (
int x = 0; x < rectW; x++) {
830 for (
int y = 0; y < rectH; y++)
831 setBufferPixel(buf, pitch, x, y, color);
836 if (pd3dText->UnlockRect(0) != D3D_OK)
837 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
846 void vpD3DRenderer::clear(
const vpColor &color)
849 if (pd3dDevice != NULL) {
850 D3DLOCKED_RECT d3dLRect;
855 r.bottom =
static_cast<LONG
>(m_rheight);
856 r.right =
static_cast<LONG
>(m_rwidth);
859 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
860 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
865 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
866 long *buf = (
long *)(d3dLRect.pBits);
870 c = colors[color.
id];
872 c = D3DCOLOR_ARGB(0xFF, color.
R, color.
G, color.
B);
874 long *end = (
long *)(buf + (pitch * m_rheight));
878 *buf++ =
static_cast<long>(c);
881 if (pd3dText->UnlockRect(0) != D3D_OK)
882 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
888 void vpD3DRenderer::subDrawCircle(
int i,
int j,
int x,
int y,
vpColor col,
unsigned char *buf,
unsigned int pitch,
889 unsigned int maxX,
unsigned int maxY)
892 setBufferPixel(buf, pitch, i, j + y, col, maxX, maxY);
893 setBufferPixel(buf, pitch, i, j - y, col, maxX, maxY);
894 setBufferPixel(buf, pitch, i + y, j, col, maxX, maxY);
895 setBufferPixel(buf, pitch, i - y, j, col, maxX, maxY);
897 setBufferPixel(buf, pitch, i + x, j + y, col, maxX, maxY);
898 setBufferPixel(buf, pitch, i - x, j + y, col, maxX, maxY);
899 setBufferPixel(buf, pitch, i + x, j - y, col, maxX, maxY);
900 setBufferPixel(buf, pitch, i - x, j - y, col, maxX, maxY);
902 setBufferPixel(buf, pitch, i + x, j + y, col, maxX, maxY);
903 setBufferPixel(buf, pitch, i - x, j + y, col, maxX, maxY);
904 setBufferPixel(buf, pitch, i + x, j - y, col, maxX, maxY);
905 setBufferPixel(buf, pitch, i - x, j - y, col, maxX, maxY);
906 setBufferPixel(buf, pitch, i + y, j + x, col, maxX, maxY);
907 setBufferPixel(buf, pitch, i - y, j + x, col, maxX, maxY);
908 setBufferPixel(buf, pitch, i + y, j - x, col, maxX, maxY);
909 setBufferPixel(buf, pitch, i - y, j - x, col, maxX, maxY);
919 void vpD3DRenderer::drawCircle(
const vpImagePoint ¢er,
unsigned int radius,
const vpColor &color,
bool ,
922 unsigned int radiusScaled = radius / m_rscale;
931 if (pd3dDevice != NULL) {
932 D3DLOCKED_RECT d3dLRect;
935 int radiusScaled_ =
static_cast<int>(radiusScaled);
945 rec.bottom = (LONG)((
vpMath::round(centerScaled.
get_i() + radiusScaled_) < (
int)m_rheight)
946 ? centerScaled.
get_i() + radiusScaled_
948 rec.right = (LONG)((
vpMath::round(centerScaled.
get_j() + radiusScaled_) < (
int)m_rwidth)
949 ? centerScaled.
get_j() + radiusScaled_
953 unsigned int rectW =
static_cast<unsigned int>(rec.right - rleft);
954 unsigned int rectH =
static_cast<unsigned int>(rec.bottom - rtop);
957 if (pd3dText->LockRect(0, &d3dLRect, &rec, 0) != D3D_OK) {
958 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
963 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
964 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
969 int y = static_cast<int>(radiusScaled);
970 int p = (3 - (y << 1));
980 p += ((x << 1) + 1) << 1;
983 p += (((x - y) << 1) + 1) << 1;
989 if (pd3dText->UnlockRect(0) != D3D_OK)
990 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
1000 void vpD3DRenderer::drawText(
const vpImagePoint &ip,
const char *text,
const vpColor &color)
1006 IDirect3DSurface9 *pd3dSurf;
1007 pd3dText->GetSurfaceLevel(0, &pd3dSurf);
1010 pd3dSurf->GetDC(&hDCMem);
1013 SelectObject(hDCMem, hFont);
1017 SetTextColor(hDCMem, colorsGDI[color.
id]);
1019 COLORREF gdicolor = RGB(color.
R, color.
G, color.
B);
1020 SetTextColor(hDCMem, gdicolor);
1024 SetBkMode(hDCMem, TRANSPARENT);
1027 int length = (int)strlen(text);
1030 GetTextExtentPoint32(hDCMem, text, length, &size);
1036 pd3dSurf->ReleaseDC(hDCMem);
1038 pd3dSurf->Release();
1040 DeleteObject(hFont);
1050 void vpD3DRenderer::drawCross(
const vpImagePoint &ip,
unsigned int size,
const vpColor &color,
unsigned int thickness)
1052 double i = ip.
get_i();
1053 double j = ip.
get_j();
1056 ip1.
set_i(i - size / 2);
1058 ip2.
set_i(i + size / 2);
1060 drawLine(ip1, ip2, color, thickness);
1063 ip1.
set_j(j - size / 2);
1065 ip2.
set_j(j + size / 2);
1067 drawLine(ip1, ip2, color, thickness);
1078 unsigned int h,
unsigned int thickness)
1085 if ((std::fabs(a) <= std::numeric_limits<double>::epsilon()) &&
1086 (std::fabs(b) <= std::numeric_limits<double>::epsilon())) {
1101 drawLine(ip2, ip4, color, thickness);
1107 drawLine(ip2, ip4, color, thickness);
1109 drawLine(ip1, ip2, color, thickness);
1119 void TextureToRGBa(
vpImage<vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch)
1132 I.
bitmap[i].
B = imBuffer[k + 0];
1133 I.
bitmap[i].
G = imBuffer[k + 1];
1134 I.
bitmap[i].
R = imBuffer[k + 2];
1135 I.
bitmap[i].
A = imBuffer[k + 3];
1149 if (pd3dDevice != NULL) {
1152 I.
resize(m_rheight, m_rwidth);
1154 D3DLOCKED_RECT d3dLRect;
1159 r.bottom =
static_cast<LONG
>(m_rheight);
1160 r.right =
static_cast<LONG
>(m_rwidth);
1163 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
1164 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
1169 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
1170 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
1173 TextureToRGBa(I, buf, pitch);
1176 if (pd3dText->UnlockRect(0) != D3D_OK)
1177 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
1181 #elif !defined(VISP_BUILD_SHARED_LIBS) 1184 void dummy_vpD3DRenderer(){};
unsigned int getWidth() const
void resize(unsigned int h, unsigned int w)
resize the image : Image initialization
unsigned char B
Blue component.
Type * bitmap
points toward the bitmap
static const vpColor black
static const vpColor darkRed
Class to define RGB colors available for display functionnalities.
static const vpColor lightGray
static const vpColor darkBlue
unsigned char G
Green component.
static const vpColor green
static const vpColor lightRed
static const vpColor orange
static const vpColor cyan
static const vpColor lightGreen
static double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
static double sqr(double x)
unsigned char A
Additionnal component.
static const vpColor gray
static const vpColor darkGray
static int round(double x)
Error that can be emited by the vpDisplay class and its derivates.
unsigned char R
Red component.
unsigned int getHeight() const
static const vpColor darkGreen
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static const vpColor yellow
static const vpColor lightBlue
static const vpColor purple
static const vpColor white
static const vpColor blue