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;
479 const unsigned int height)
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;
555 const unsigned int height)
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) {
720 double size = 10. * m_rscale;
722 double deltaj = size / length * (ip2.
get_j() - ip1.
get_j());
723 double deltai = size / length * (ip2.
get_i() - ip1.
get_i());
725 double orig = ip1.
get_i() - slope * ip1.
get_j();
726 for (
unsigned int j = (
unsigned int)ip1.
get_j(); j < ip2.
get_j(); j += (
unsigned int)(2 * deltaj)) {
727 double i = slope * j + orig;
741 pd3dSurf->ReleaseDC(hDCMem);
758 void vpD3DRenderer::drawRect(
const vpImagePoint &topLeft,
unsigned int width,
unsigned int height,
const vpColor &color,
759 bool fill,
unsigned int thickness)
762 if (pd3dDevice != NULL) {
764 drawLine(topLeft, topLeft +
vpImagePoint(0, width), color, thickness);
767 drawLine(topLeft +
vpImagePoint(height, 0), topLeft, color, thickness);
770 unsigned int widthScaled = width / m_rscale;
771 unsigned int heightScaled = height / m_rscale;
773 if (topLeftScaled.
get_i() > (int)m_rheight - 1 || topLeftScaled.
get_j() > (int)m_rwidth - 1 ||
774 topLeftScaled.
get_i() + height < 0 || topLeftScaled.
get_j() + width < 0) {
779 D3DLOCKED_RECT d3dLRect;
782 r.top = (LONG)((topLeftScaled.
get_i() > 0) ? topLeftScaled.
get_i() : 0);
783 r.left = (LONG)((topLeftScaled.
get_j() > 0) ? topLeftScaled.
get_j() : 0);
784 r.bottom = (LONG)((topLeftScaled.
get_i() + heightScaled < (int)m_rheight) ? topLeftScaled.
get_i() + heightScaled
786 r.right = (LONG)((topLeftScaled.
get_j() + widthScaled < (int)m_rwidth) ? topLeftScaled.
get_j() + widthScaled
789 int rectW = r.right - r.left;
790 int rectH = r.bottom - r.top;
793 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
794 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
799 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
800 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
802 if (topLeftScaled.
get_i() >= 0 && topLeftScaled.
get_j() + widthScaled < m_rwidth &&
803 topLeftScaled.
get_i() + heightScaled < m_rheight && topLeftScaled.
get_j() >= 0) {
804 for (
int x = 0; x < rectW; x++) {
805 for (
int y = 0; y < rectH; y++)
806 setBufferPixel(buf, pitch, x, y, color);
811 if (pd3dText->UnlockRect(0) != D3D_OK)
812 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
821 void vpD3DRenderer::clear(
const vpColor &color)
824 if (pd3dDevice != NULL) {
825 D3DLOCKED_RECT d3dLRect;
830 r.bottom =
static_cast<LONG
>(m_rheight);
831 r.right =
static_cast<LONG
>(m_rwidth);
834 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
835 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
840 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
841 long *buf = (
long *)(d3dLRect.pBits);
845 c = colors[color.
id];
847 c = D3DCOLOR_ARGB(0xFF, color.
R, color.
G, color.
B);
849 long *end = (
long *)(buf + (pitch * m_rheight));
853 *buf++ =
static_cast<long>(c);
856 if (pd3dText->UnlockRect(0) != D3D_OK)
857 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
863 void vpD3DRenderer::subDrawCircle(
int i,
int j,
int x,
int y,
vpColor col,
unsigned char *buf,
unsigned int pitch,
864 unsigned int maxX,
unsigned int maxY)
867 setBufferPixel(buf, pitch, i, j + y, col, maxX, maxY);
868 setBufferPixel(buf, pitch, i, j - y, col, maxX, maxY);
869 setBufferPixel(buf, pitch, i + y, j, col, maxX, maxY);
870 setBufferPixel(buf, pitch, i - y, j, col, maxX, maxY);
872 setBufferPixel(buf, pitch, i + x, j + y, col, maxX, maxY);
873 setBufferPixel(buf, pitch, i - x, j + y, col, maxX, maxY);
874 setBufferPixel(buf, pitch, i + x, j - y, col, maxX, maxY);
875 setBufferPixel(buf, pitch, i - x, j - y, col, maxX, maxY);
877 setBufferPixel(buf, pitch, i + x, j + y, col, maxX, maxY);
878 setBufferPixel(buf, pitch, i - x, j + y, col, maxX, maxY);
879 setBufferPixel(buf, pitch, i + x, j - y, col, maxX, maxY);
880 setBufferPixel(buf, pitch, i - x, j - y, col, maxX, maxY);
881 setBufferPixel(buf, pitch, i + y, j + x, col, maxX, maxY);
882 setBufferPixel(buf, pitch, i - y, j + x, col, maxX, maxY);
883 setBufferPixel(buf, pitch, i + y, j - x, col, maxX, maxY);
884 setBufferPixel(buf, pitch, i - y, j - x, col, maxX, maxY);
894 void vpD3DRenderer::drawCircle(
const vpImagePoint ¢er,
unsigned int radius,
const vpColor &color,
bool ,
897 unsigned int radiusScaled = radius / m_rscale;
906 if (pd3dDevice != NULL) {
907 D3DLOCKED_RECT d3dLRect;
910 int radiusScaled_ =
static_cast<int>(radiusScaled);
920 rec.bottom = (LONG)((
vpMath::round(centerScaled.
get_i() + radiusScaled_) < (
int)m_rheight)
921 ? centerScaled.
get_i() + radiusScaled_
923 rec.right = (LONG)((
vpMath::round(centerScaled.
get_j() + radiusScaled_) < (
int)m_rwidth)
924 ? centerScaled.
get_j() + radiusScaled_
928 unsigned int rectW =
static_cast<unsigned int>(rec.right - rleft);
929 unsigned int rectH =
static_cast<unsigned int>(rec.bottom - rtop);
932 if (pd3dText->LockRect(0, &d3dLRect, &rec, 0) != D3D_OK) {
933 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
938 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
939 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
944 int y = static_cast<int>(radiusScaled);
945 int p = (3 - (y << 1));
955 p += ((x << 1) + 1) << 1;
958 p += (((x - y) << 1) + 1) << 1;
964 if (pd3dText->UnlockRect(0) != D3D_OK)
965 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
975 void vpD3DRenderer::drawText(
const vpImagePoint &ip,
const char *text,
const vpColor &color)
981 IDirect3DSurface9 *pd3dSurf;
982 pd3dText->GetSurfaceLevel(0, &pd3dSurf);
985 pd3dSurf->GetDC(&hDCMem);
988 SelectObject(hDCMem, hFont);
992 SetTextColor(hDCMem, colorsGDI[color.
id]);
994 COLORREF gdicolor = RGB(color.
R, color.
G, color.
B);
995 SetTextColor(hDCMem, gdicolor);
999 SetBkMode(hDCMem, TRANSPARENT);
1002 int length = (int)strlen(text);
1005 GetTextExtentPoint32(hDCMem, text, length, &size);
1011 pd3dSurf->ReleaseDC(hDCMem);
1013 pd3dSurf->Release();
1015 DeleteObject(hFont);
1025 void vpD3DRenderer::drawCross(
const vpImagePoint &ip,
unsigned int size,
const vpColor &color,
unsigned int thickness)
1027 double i = ip.
get_i();
1028 double j = ip.
get_j();
1031 ip1.
set_i(i - size / 2);
1033 ip2.
set_i(i + size / 2);
1035 drawLine(ip1, ip2, color, thickness);
1038 ip1.
set_j(j - size / 2);
1040 ip2.
set_j(j + size / 2);
1042 drawLine(ip1, ip2, color, thickness);
1053 unsigned int h,
unsigned int thickness)
1060 if ((std::fabs(a) <= std::numeric_limits<double>::epsilon()) &&
1061 (std::fabs(b) <= std::numeric_limits<double>::epsilon())) {
1076 drawLine(ip2, ip4, color, thickness);
1082 drawLine(ip2, ip4, color, thickness);
1084 drawLine(ip1, ip2, color, thickness);
1094 void TextureToRGBa(
vpImage<vpRGBa> &I,
unsigned char *imBuffer,
unsigned int pitch)
1107 I.
bitmap[i].
B = imBuffer[k + 0];
1108 I.
bitmap[i].
G = imBuffer[k + 1];
1109 I.
bitmap[i].
R = imBuffer[k + 2];
1110 I.
bitmap[i].
A = imBuffer[k + 3];
1124 if (pd3dDevice != NULL) {
1127 I.
resize(m_rheight, m_rwidth);
1129 D3DLOCKED_RECT d3dLRect;
1134 r.bottom =
static_cast<LONG
>(m_rheight);
1135 r.right =
static_cast<LONG
>(m_rwidth);
1138 if (pd3dText->LockRect(0, &d3dLRect, &r, 0) != D3D_OK) {
1139 vpCERROR <<
"D3D : Couldn't lock the texture!" << std::endl;
1144 unsigned int pitch =
static_cast<unsigned int>(d3dLRect.Pitch);
1145 unsigned char *buf = (
unsigned char *)d3dLRect.pBits;
1148 TextureToRGBa(I, buf, pitch);
1151 if (pd3dText->UnlockRect(0) != D3D_OK)
1152 vpCERROR <<
"D3D : Couldn't unlock the texture!" << std::endl;
1156 #elif !defined(VISP_BUILD_SHARED_LIBS) 1159 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