37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 #include <visp3/core/vpConfig.h>
42 #if ( defined(_WIN32) & defined(VISP_HAVE_D3D9) )
44 #include <visp3/gui/vpD3DRenderer.h>
45 #include <visp3/core/vpColor.h>
46 #include <visp3/core/vpMath.h>
73 vpD3DRenderer::vpD3DRenderer()
158 hFont = CreateFont(18, 0, 0, 0, FW_NORMAL,
false,
false,
false,
159 DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
160 CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
161 DEFAULT_PITCH | FF_DONTCARE, NULL);
168 vpD3DRenderer::~vpD3DRenderer()
172 if(pd3dDevice != NULL)
173 pd3dDevice->Release();
178 if(pd3dVideoText != NULL)
179 pd3dVideoText->Release();
187 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)))
215 "Can't initialize D3D!");
217 D3DDISPLAYMODE d3ddm;
218 if(FAILED(pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm)))
220 "Can't get the adapter's display mode!");
223 D3DPRESENT_PARAMETERS d3dpp;
224 ZeroMemory(&d3dpp,
sizeof(d3dpp));
225 d3dpp.BackBufferCount=1;
226 d3dpp.Windowed = TRUE;
227 d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
228 d3dpp.BackBufferFormat = d3ddm.Format;
231 if( FAILED(pD3D->CreateDevice(D3DADAPTER_DEFAULT , D3DDEVTYPE_HAL, hWnd,
232 D3DCREATE_SOFTWARE_VERTEXPROCESSING |
233 D3DCREATE_MULTITHREADED,
234 &d3dpp, &pd3dDevice )))
236 "Can't create the Direct3D device!");
240 pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
244 initView((
float)m_rwidth,(
float)m_rheight);
248 textWidth = supPowerOf2( (m_rwidth>m_rheight) ? m_rwidth : m_rheight );
253 if( D3DXCreateTexture(pd3dDevice, textWidth, textWidth, D3DX_DEFAULT, 0,
254 D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM , &pd3dText)
258 "Can't create memory texture!");
262 if( D3DXCreateTexture(pd3dDevice, textWidth, textWidth, D3DX_DEFAULT,
264 D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &pd3dVideoText)
268 "Can't create video texture!");
272 if(D3DXCreateSprite(pd3dDevice, &pSprite) != S_OK)
274 "Can't create the texture's sprite!");
289 void vpD3DRenderer::initView(
float WindowWidth,
float WindowHeight)
294 D3DXMatrixOrthoLH(&Ortho2D, WindowWidth, WindowHeight, 0.0f, 1.0f);
295 D3DXMatrixIdentity(&Identity);
297 if( pd3dDevice->SetTransform(D3DTS_PROJECTION, &Ortho2D) != D3D_OK
298 || pd3dDevice->SetTransform(D3DTS_WORLD, &Identity) != D3D_OK
299 || pd3dDevice->SetTransform(D3DTS_VIEW, &Identity) != D3D_OK)
301 "Can't set the view!");
311 void vpD3DRenderer::convert(
const vpImage<vpRGBa>& I,
unsigned char * imBuffer,
unsigned int pitch)
314 for (
unsigned int i = 0; i < m_rheight; i++) {
315 unsigned int ii_ = i*pitch;
316 for (
unsigned int j = 0; j < m_rwidth; j++) {
318 unsigned int index_ = ii_ + j * 4;
319 imBuffer[index_] = val.
B;
320 imBuffer[++index_] = val.
G;
321 imBuffer[++index_] = val.
R;
322 imBuffer[++index_] = val.
A;
327 for (
unsigned int i = 0; i < m_rheight; i++) {
328 unsigned int i_ = i*m_rscale;
329 unsigned int ii_ = i*pitch;
330 for (
unsigned int j = 0; j < m_rwidth; j++) {
331 vpRGBa val = I[i_][j*m_rscale];
332 unsigned int index_ = ii_ + j * 4;
333 imBuffer[index_] = val.
B;
334 imBuffer[++index_] = val.
G;
335 imBuffer[++index_] = val.
R;
336 imBuffer[++index_] = val.
A;
348 void vpD3DRenderer::convert(
const vpImage<unsigned char>& I,
unsigned char * imBuffer,
unsigned int pitch)
351 for (
unsigned int i = 0; i < m_rheight; i++) {
352 unsigned int ii_ = i*pitch;
353 for (
unsigned int j = 0; j < m_rwidth; j++) {
354 unsigned char val = I[i][j];
355 unsigned int index_ = ii_ + j * 4;
356 imBuffer[index_] = val;
357 imBuffer[++index_] = val;
358 imBuffer[++index_] = val;
364 for (
unsigned int i = 0; i < m_rheight; i++) {
365 unsigned int i_ = i*m_rscale;
366 unsigned int ii_ = i*pitch;
367 for (
unsigned int j = 0; j < m_rwidth; j++) {
368 unsigned char val = I[i_][j*m_rscale];
369 unsigned int index_ = ii_ + j * 4;
370 imBuffer[index_] = val;
371 imBuffer[++index_] = val;
372 imBuffer[++index_] = val;
387 void vpD3DRenderer::convertROI(
const vpImage<unsigned char>& I,
unsigned char * imBuffer,
unsigned int pitch,
388 int i_min,
int j_min,
int i_max,
int j_max)
390 int h = i_max - i_min;
391 int w = j_max - j_min;
394 for (
int i = 0; i < h; i++) {
395 unsigned int i_ = i_min + i;
396 unsigned int ii_ = i*pitch;
397 for (
int j = 0; j < w; j++) {
398 unsigned char val = I[i_][j_min + j];
399 unsigned int index_ = ii_ + j * 4;
400 imBuffer[index_] = val;
401 imBuffer[++index_] = val;
402 imBuffer[++index_] = val;
408 for (
int i = 0; i < h; i++) {
409 unsigned int i_ = (i_min + i)*m_rscale;
410 unsigned int ii_ = i*pitch;
411 for (
int j = 0; j < w; j++) {
412 unsigned char val = I[i_][(j_min + j)*m_rscale];
413 unsigned int index_ = ii_ + j * 4;
414 imBuffer[index_] = val;
415 imBuffer[++index_] = val;
416 imBuffer[++index_] = val;
431 void vpD3DRenderer::convertROI(
const vpImage<vpRGBa>& I,
unsigned char * imBuffer,
unsigned int pitch,
432 int i_min,
int j_min,
int i_max,
int j_max)
434 int h = i_max - i_min;
435 int w = j_max - j_min;
438 for (
int i = 0; i < h; i++) {
439 unsigned int i_ = i_min + i;
440 unsigned int ii_ = i*pitch;
441 for (
int j = 0; j < w; j++) {
442 vpRGBa val = I[i_][j_min + j];
443 unsigned int index_ = ii_ + j * 4;
444 imBuffer[index_] = val.
B;
445 imBuffer[++index_] = val.
G;
446 imBuffer[++index_] = val.
R;
452 for (
int i = 0; i < h; i++) {
453 unsigned int i_ = (i_min + i)*m_rscale;
454 unsigned int ii_ = i*pitch;
455 for (
int j = 0; j < w; j++) {
456 vpRGBa val = I[i_][(j_min + j)*m_rscale];
457 unsigned int index_ = ii_ + j * 4;
458 imBuffer[index_] = val.
B;
459 imBuffer[++index_] = val.
G;
460 imBuffer[++index_] = val.
R;
474 if(pd3dDevice != NULL)
476 D3DLOCKED_RECT d3dLRect;
480 r.bottom=
static_cast<signed long>(m_rheight);
481 r.right=
static_cast<signed long>(m_rwidth);
484 if(pd3dText->LockRect(0, &d3dLRect, &r, 0)!= D3D_OK)
486 vpCERROR<<
"D3D : Couldn't lock the texture!"<<std::endl;
491 unsigned int pitch =
static_cast<unsigned int>( d3dLRect.Pitch );
492 unsigned char * buf = (
unsigned char *) d3dLRect.pBits;
495 convert(im, buf, pitch);
498 if( pd3dText->UnlockRect(0) != D3D_OK)
499 vpCERROR<<
"D3D : Couldn't unlock the texture!"<<std::endl;
508 void vpD3DRenderer::setImgROI(
const vpImage<vpRGBa>& im,
const vpImagePoint &iP,
const unsigned int width,
const unsigned int height )
511 if(pd3dDevice != NULL)
513 D3DLOCKED_RECT d3dLRect;
515 int i_min = std::max((
int)ceil(iP.
get_i() / m_rscale), 0);
516 int j_min = std::max((
int)ceil(iP.
get_j() / m_rscale), 0);
517 int i_max = std::min((
int)ceil((iP.
get_i() + height) / m_rscale), (int)m_rheight);
518 int j_max = std::min((
int)ceil((iP.
get_j() + width) / m_rscale), (int)m_rwidth);
521 r.top = (LONG)i_min; r.left = (LONG)j_min;
522 r.bottom = (LONG)i_max; r.right = (LONG)j_max;
525 if(pd3dText->LockRect(0, &d3dLRect, &r, 0)!= D3D_OK)
527 vpCERROR<<
"D3D : Couldn't lock the texture!"<<std::endl;
532 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
533 unsigned char * buf = (
unsigned char *) d3dLRect.pBits;
536 convertROI(im, buf, pitch, i_min, j_min, i_max, j_max);
539 if( pd3dText->UnlockRect(0) != D3D_OK)
540 vpCERROR<<
"D3D : Couldn't unlock the texture!"<<std::endl;
552 if(pd3dDevice != NULL)
554 D3DLOCKED_RECT d3dLRect;
559 r.bottom =
static_cast<LONG
>(m_rheight);
560 r.right =
static_cast<LONG
>(m_rwidth);
563 if(pd3dText->LockRect(0, &d3dLRect, &r, 0)!= D3D_OK)
565 vpCERROR<<
"D3D : Couldn't lock the texture!"<<std::endl;
570 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
571 unsigned char * buf = (
unsigned char *) d3dLRect.pBits;
574 convert(im, buf, pitch);
577 if( pd3dText->UnlockRect(0) != D3D_OK)
578 vpCERROR<<
"D3D : Couldn't unlock the texture!"<<std::endl;
590 if(pd3dDevice != NULL)
592 D3DLOCKED_RECT d3dLRect;
594 int i_min = std::max((
int)ceil(iP.
get_i() / m_rscale), 0);
595 int j_min = std::max((
int)ceil(iP.
get_j() / m_rscale), 0);
596 int i_max = std::min((
int)ceil((iP.
get_i() + height) / m_rscale), (int)m_rheight);
597 int j_max = std::min((
int)ceil((iP.
get_j() + width) / m_rscale), (int)m_rwidth);
600 r.top=(LONG)i_min; r.left= (LONG)j_min;
601 r.bottom= (LONG)i_max; r.right= (LONG)j_max;
604 if(pd3dText->LockRect(0, &d3dLRect, &r, 0)!= D3D_OK)
606 vpCERROR<<
"D3D : Couldn't lock the texture!"<<std::endl;
611 unsigned int pitch =
static_cast<unsigned int>( d3dLRect.Pitch );
612 unsigned char * buf = (
unsigned char *) d3dLRect.pBits;
615 convertROI(im, buf, pitch, i_min, j_min, i_max, j_max);
618 if( pd3dText->UnlockRect(0) != D3D_OK)
619 vpCERROR<<
"D3D : Couldn't unlock the texture!"<<std::endl;
628 bool vpD3DRenderer::render()
634 pd3dDevice->BeginScene();
640 r.bottom =
static_cast<LONG
>(m_rheight);
641 r.right =
static_cast<LONG
>(m_rwidth);
645 pd3dDevice->UpdateTexture(pd3dText,pd3dVideoText);
649 #if (D3DX_SDK_VERSION <= 9)
651 pSprite->Draw(pd3dVideoText, &r, NULL, NULL, NULL, NULL, 0xFFFFFFFF );
654 pSprite->Draw(pd3dVideoText, &r, NULL, NULL, 0xFFFFFFFF );
659 pd3dDevice->EndScene();
661 pd3dDevice->Present( NULL, NULL, NULL, NULL );
677 if(iPscaled.
get_i()<0 || iPscaled.
get_j()<0 || iPscaled.
get_i()>=(int)m_rheight || iPscaled.
get_j()>=(int)m_rwidth)
683 if(pd3dDevice != NULL)
685 D3DLOCKED_RECT d3dLRect;
689 r.top=(LONG)iPscaled.
get_i();
690 r.left=(LONG)iPscaled.
get_j();
691 r.bottom=(LONG)iPscaled.
get_i()+1;
692 r.right=(LONG)iPscaled.
get_j()+1;
695 if(pd3dText->LockRect(0, &d3dLRect, &r, 0)!= D3D_OK)
697 vpCERROR<<
"D3D : Couldn't lock the texture!"<<std::endl;
702 unsigned int pitch =
static_cast<unsigned int>( d3dLRect.Pitch );
703 unsigned char * buf = (
unsigned char *) d3dLRect.pBits;
706 setBufferPixel(buf, pitch, 0, 0,color);
709 if( pd3dText->UnlockRect(0) != D3D_OK)
710 vpCERROR<<
"D3D : Couldn't unlock the texture!"<<std::endl;
724 unsigned int thickness,
int style)
727 if(pd3dDevice != NULL)
733 IDirect3DSurface9 * pd3dSurf;
734 pd3dText->GetSurfaceLevel(0, &pd3dSurf);
737 pd3dSurf->GetDC(&hDCMem);
742 hPen = CreatePen(style, static_cast<int>(thickness), colorsGDI[color.
id]);
744 COLORREF gdicolor = RGB(color.
R, color.
G, color.
B);
745 hPen = CreatePen(style, static_cast<int>(thickness), gdicolor);
749 SetBkMode(hDCMem, TRANSPARENT);
752 SelectObject(hDCMem, hPen);
756 if (thickness != 1 && style != PS_SOLID) {
757 double size = 10.*m_rscale;
759 double deltaj = size / length*(ip2.
get_j() - ip1.
get_j());
760 double deltai = size / length*(ip2.
get_i() - ip1.
get_i());
762 double orig = ip1.
get_i() - slope*ip1.
get_j();
763 for (
unsigned int j = (
unsigned int)ip1.
get_j(); j < ip2.
get_j(); j += (
unsigned int)(2 * deltaj)) {
764 double i = slope*j + orig;
779 pd3dSurf->ReleaseDC(hDCMem);
797 void vpD3DRenderer::drawRect(
const vpImagePoint &topLeft,
798 unsigned int width,
unsigned int height,
799 const vpColor &color,
bool fill,
800 unsigned int thickness)
803 if(pd3dDevice != NULL)
807 drawLine(topLeft, topLeft +
vpImagePoint(0, width), color, thickness);
810 drawLine(topLeft +
vpImagePoint(height, 0), topLeft, color, thickness);
815 unsigned int widthScaled = width / m_rscale;
816 unsigned int heightScaled = height / m_rscale;
818 if (topLeftScaled.
get_i()>(int)m_rheight - 1 || topLeftScaled.
get_j()>(int)m_rwidth - 1 || topLeftScaled.
get_i() + height<0 || topLeftScaled.
get_j() + width<0)
824 D3DLOCKED_RECT d3dLRect;
827 r.top = (LONG)((topLeftScaled.
get_i()>0) ? topLeftScaled.
get_i() : 0);
828 r.left = (LONG)((topLeftScaled.
get_j()>0) ? topLeftScaled.
get_j() : 0);
829 r.bottom = (LONG)((topLeftScaled.
get_i() + heightScaled < (int)m_rheight) ? topLeftScaled.
get_i() + heightScaled : m_rheight - 1);
830 r.right = (LONG)((topLeftScaled.
get_j() + widthScaled < (int)m_rwidth) ? topLeftScaled.
get_j() + widthScaled : m_rwidth - 1);
832 int rectW = r.right - r.left;
833 int rectH = r.bottom - r.top;
836 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK)
838 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
843 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
844 unsigned char * buf = (
unsigned char *)d3dLRect.pBits;
846 if(topLeftScaled.
get_i()>=0 && topLeftScaled.
get_j()+widthScaled < m_rwidth && topLeftScaled.
get_i()+heightScaled < m_rheight && topLeftScaled.
get_j()>=0)
848 for (
int x = 0; x<rectW; x++) {
849 for (
int y = 0; y<rectH; y++)
850 setBufferPixel(buf, pitch, x, y, color);
855 if (pd3dText->UnlockRect(0) != D3D_OK)
856 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
865 void vpD3DRenderer::clear(
const vpColor &color)
868 if(pd3dDevice != NULL)
870 D3DLOCKED_RECT d3dLRect;
875 r.bottom =
static_cast<LONG
>( m_rheight );
876 r.right =
static_cast<LONG
>( m_rwidth );
879 if(pd3dText->LockRect(0, &d3dLRect, &r, 0)!= D3D_OK)
881 vpCERROR<<
"D3D : Couldn't lock the texture!"<<std::endl;
886 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
887 long * buf = (
long *) ( d3dLRect.pBits );
891 c = colors[color.
id];
893 c = D3DCOLOR_ARGB(0xFF, color.
R, color.
G, color.
B);
895 long * end = (
long*)(buf + (pitch * m_rheight));
899 *buf++ =
static_cast<long>( c );
902 if( pd3dText->UnlockRect(0) != D3D_OK)
903 vpCERROR<<
"D3D : Couldn't unlock the texture!"<<std::endl;
910 void vpD3DRenderer::subDrawCircle(
int i,
int j,
913 unsigned char* buf,
unsigned int pitch,
914 unsigned int maxX,
unsigned int maxY)
917 setBufferPixel(buf, pitch, i , j+y, col, maxX, maxY);
918 setBufferPixel(buf, pitch, i , j-y, col, maxX, maxY);
919 setBufferPixel(buf, pitch, i+y, j, col, maxX, maxY);
920 setBufferPixel(buf, pitch, i-y, j, col, maxX, maxY);
923 setBufferPixel(buf, pitch, i+x,j+y,col, maxX, maxY);
924 setBufferPixel(buf, pitch, i-x,j+y,col, maxX, maxY);
925 setBufferPixel(buf, pitch, i+x,j-y,col, maxX, maxY);
926 setBufferPixel(buf, pitch, i-x,j-y,col, maxX, maxY);
929 setBufferPixel(buf, pitch, i+x,j+y,col, maxX, maxY);
930 setBufferPixel(buf, pitch, i-x,j+y,col, maxX, maxY);
931 setBufferPixel(buf, pitch, i+x,j-y,col, maxX, maxY);
932 setBufferPixel(buf, pitch, i-x,j-y,col, maxX, maxY);
933 setBufferPixel(buf, pitch, i+y,j+x,col, maxX, maxY);
934 setBufferPixel(buf, pitch, i-y,j+x,col, maxX, maxY);
935 setBufferPixel(buf, pitch, i+y,j-x,col, maxX, maxY);
936 setBufferPixel(buf, pitch, i-y,j-x,col, maxX, maxY);
947 void vpD3DRenderer::drawCircle(
const vpImagePoint ¢er,
unsigned int radius,
948 const vpColor &color,
bool ,
unsigned int )
950 unsigned int radiusScaled = radius / m_rscale;
959 if(pd3dDevice != NULL)
961 D3DLOCKED_RECT d3dLRect;
964 int radiusScaled_ =
static_cast<int>(radiusScaled);
970 rec.bottom=(LONG)((
vpMath::round(centerScaled.
get_i()+ radiusScaled_) < (
int)m_rheight) ? centerScaled.
get_i()+ radiusScaled_ : m_rheight-1);
971 rec.right=(LONG)((
vpMath::round(centerScaled.
get_j()+ radiusScaled_) < (
int)m_rwidth) ? centerScaled.
get_j()+ radiusScaled_ : m_rwidth-1);
974 unsigned int rectW =
static_cast<unsigned int> ( rec.right - rleft );
975 unsigned int rectH =
static_cast<unsigned int> ( rec.bottom - rtop );
978 if(pd3dText->LockRect(0, &d3dLRect, &rec, 0)!= D3D_OK)
980 vpCERROR<<
"D3D : Couldn't lock the texture!"<<std::endl;
985 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
986 unsigned char * buf = (
unsigned char *) d3dLRect.pBits;
991 int y = static_cast<int>(radiusScaled);
992 int p = (3 - (y<<1));
1008 p += (((x-y)<<1)+1)<<1;
1014 if( pd3dText->UnlockRect(0) != D3D_OK)
1015 vpCERROR<<
"D3D : Couldn't unlock the texture!"<<std::endl;
1027 void vpD3DRenderer::drawText(
const vpImagePoint &ip,
const char * text,
1034 IDirect3DSurface9 * pd3dSurf;
1035 pd3dText->GetSurfaceLevel(0, &pd3dSurf);
1038 pd3dSurf->GetDC(&hDCMem);
1041 SelectObject(hDCMem, hFont);
1045 SetTextColor(hDCMem, colorsGDI[color.
id]);
1047 COLORREF gdicolor = RGB(color.
R, color.
G, color.
B);
1048 SetTextColor(hDCMem, gdicolor);
1052 SetBkMode(hDCMem, TRANSPARENT);
1055 int length = (int) strlen(text);
1058 GetTextExtentPoint32(hDCMem, text, length, &size);
1064 pd3dSurf->ReleaseDC(hDCMem);
1066 pd3dSurf->Release();
1068 DeleteObject(hFont);
1081 const vpColor &color,
unsigned int thickness)
1083 double i = ip.
get_i();
1084 double j = ip.
get_j();
1087 ip1.
set_i(i - size / 2);
1089 ip2.
set_i(i + size / 2);
1091 drawLine(ip1, ip2, color, thickness);
1094 ip1.
set_j(j - size / 2);
1096 ip2.
set_j(j + size / 2);
1098 drawLine(ip1, ip2, color, thickness);
1111 unsigned int w,
unsigned int h,
unsigned int thickness)
1118 if ((std::fabs(a) <= std::numeric_limits<double>::epsilon()) && (std::fabs(b) <= std::numeric_limits<double>::epsilon()))
1136 drawLine(ip2, ip4, color, thickness);
1142 drawLine(ip2, ip4, color, thickness);
1144 drawLine(ip1, ip2, color, thickness);
1169 I.
bitmap[i].
B = imBuffer[k+0];
1170 I.
bitmap[i].
G = imBuffer[k+1];
1171 I.
bitmap[i].
R = imBuffer[k+2];
1172 I.
bitmap[i].
A = imBuffer[k+3];
1186 if(pd3dDevice != NULL)
1190 I.
resize(m_rheight, m_rwidth);
1192 D3DLOCKED_RECT d3dLRect;
1197 r.bottom =
static_cast<LONG
>( m_rheight );
1198 r.right =
static_cast<LONG
>( m_rwidth );
1201 if(pd3dText->LockRect(0, &d3dLRect, &r, 0)!= D3D_OK)
1203 vpCERROR<<
"D3D : Couldn't lock the texture!"<<std::endl;
1208 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
1209 unsigned char * buf = (
unsigned char *) d3dLRect.pBits;
1212 TextureToRGBa(I,buf, pitch);
1215 if( pd3dText->UnlockRect(0) != D3D_OK)
1216 vpCERROR<<
"D3D : Couldn't unlock the texture!"<<std::endl;
1220 #elif !defined(VISP_BUILD_SHARED_LIBS)
1222 void dummy_vpD3DRenderer() {};
unsigned int getWidth() const
unsigned char B
Blue component.
Type * bitmap
points toward the bitmap
static const vpColor black
static const vpColor darkRed
Class to define colors available for display functionnalities.
static const vpColor lightGray
static const vpColor darkBlue
unsigned char G
Green component.
static const vpColor green
static int round(const double x)
static const vpColor lightRed
static const vpColor orange
void set_i(const double ii)
static const vpColor cyan
static const vpColor lightGreen
static double sqr(double x)
unsigned char A
Additionnal component.
void resize(const unsigned int h, const unsigned int w)
resize the image : Image initialization
static const vpColor gray
static const vpColor darkGray
void set_j(const double jj)
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 double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
static const vpColor blue