Lab color numbers in navigator, on behalf of Jacques; see issue #627

This commit is contained in:
Oliver Duis
2011-04-18 09:54:07 +02:00
parent cfbd175e4d
commit a6370306f7
4 changed files with 91 additions and 31 deletions

View File

@@ -464,15 +464,33 @@ void CropWindow::pointerMoved (int x, int y) {
int mx, my;
translateCoord (x, y, mx, my);
if (!onArea (CropImage, x, y) || !cropHandler.cropPixbuf)
pmlistener->pointerMoved (false, mx, my, -1, -1, -1);
// pmlistener->pointerMoved (false, mx, my, -1, -1, -1);
pmlistener->pointerMoved (false, cropHandler.colorParams.working, mx, my, -1, -1, -1);
else {
Glib::Mutex::Lock lock(cropHandler.cimg);
/*Glib::Mutex::Lock lock(cropHandler.cimg);
int vx = x - xpos - imgX;
int vy = y - ypos - imgY;
guint8* pix = cropHandler.cropPixbuf->get_pixels() + vy*cropHandler.cropPixbuf->get_rowstride() + vx*3;
if (vx < cropHandler.cropPixbuf->get_width() && vy < cropHandler.cropPixbuf->get_height())
pmlistener->pointerMoved (true, mx, my, pix[0], pix[1], pix[2]);
*/
cropHandler.cimg.lock ();
int vx = x - xpos - imgX;
int vy = y - ypos - imgY;
// guint8* pix = cropHandler.cropPixbuf->get_pixels() + vy*cropHandler.cropPixbuf->get_rowstride() + vx*3;
// if (vx < cropHandler.cropPixbuf->get_width() && vy < cropHandler.cropPixbuf->get_height())
// pmlistener->pointerMoved (true, mx, my, pix[0], pix[1], pix[2]);
int imwidth = cropHandler.cropPixbuf->get_width();
int imheight = cropHandler.cropPixbuf->get_height();
guint8* pix = cropHandler.cropPixbuftrue->get_pixels() + vy*cropHandler.cropPixbuf->get_rowstride() + vx*3;
if (vx < imwidth && vy < imheight)
pmlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]);
cropHandler.cimg.unlock ();
}
}
}