Merge branch 'dev' into histogram-scaling

This commit is contained in:
Roel Baars
2018-08-22 17:39:31 +02:00
committed by GitHub
132 changed files with 2791 additions and 855 deletions

View File

@@ -1003,7 +1003,9 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
int mx, my;
screenCoordToImage (x, y, mx, my);
if (!onArea (CropImage, x, y) || !cropHandler.cropPixbuf) {
MyMutex::MyLock lock(cropHandler.cimg);
if (!onArea (CropImage, x, y) || !cropHandler.cropPixbuftrue) {
cropHandler.getFullImageSize(mx, my);
// pmlistener->pointerMoved (false, cropHandler.colorParams.working, mx, my, -1, -1, -1);
// if (pmhlistener) pmhlistener->pointerMoved (false, cropHandler.colorParams.working, mx, my, -1, -1, -1);
@@ -1019,7 +1021,7 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
}
} else {
/*MyMutex::MyLock lock(cropHandler.cimg);
/*
int vx = x - xpos - imgX;
int vy = y - ypos - imgY;
@@ -1029,7 +1031,6 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
*/
cropHandler.cimg.lock ();
int vx = x - xpos - imgX;
int vy = y - ypos - imgY;
@@ -1041,34 +1042,35 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
// 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.cropPixbuf->get_pixels() + vy * cropHandler.cropPixbuf->get_rowstride() + vx * 3;
int imwidth = cropHandler.cropPixbuftrue->get_width();
int imheight = cropHandler.cropPixbuftrue->get_height();
guint8* pix = cropHandler.cropPixbuftrue->get_pixels() + vy * cropHandler.cropPixbuftrue->get_rowstride() + vx * 3;
int rval = pix[0];
int gval = pix[1];
int bval = pix[2];
bool isRaw = false;
if (vx < imwidth && vy < imheight) {
rtengine::StagedImageProcessor* ipc = iarea->getImProcCoordinator();
if(ipc) {
procparams::ProcParams params;
ipc->getParams(&params);
if(params.raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE) || params.raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE)) {
isRaw = params.raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE) || params.raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE);
if(isRaw) {
ImageSource *isrc = static_cast<ImageSource*>(ipc->getInitialImage());
isrc->getRawValues(mx, my, params.coarse.rotate, rval, gval, bval);
}
}
// pmlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]);
pmlistener->pointerMoved (true, cropHandler.colorParams.outputProfile, cropHandler.colorParams.workingProfile, mx, my, rval, gval, bval);
if (pmhlistener)
// pmhlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]);
{
pmhlistener->pointerMoved (true, cropHandler.colorParams.outputProfile, cropHandler.colorParams.workingProfile, mx, my, pix[0], pix[1], pix[2]);
// Updates the Navigator
// TODO: possible double color conversion if rval, gval, bval come from cropHandler.cropPixbuftrue ? see issue #4583
pmlistener->pointerMoved (true, cropHandler.colorParams.outputProfile, cropHandler.colorParams.workingProfile, mx, my, rval, gval, bval, isRaw);
if (pmhlistener) {
// Updates the HistogramRGBArea
pmhlistener->pointerMoved (true, cropHandler.colorParams.outputProfile, cropHandler.colorParams.workingProfile, mx, my, rval, gval, bval);
}
}
cropHandler.cimg.unlock ();
}
}
}
@@ -1375,7 +1377,7 @@ void CropWindow::expose (Cairo::RefPtr<Cairo::Context> cr)
break;
}
}
bool useBgColor = (state == SNormal);
bool useBgColor = (state == SNormal || state == SDragPicker || state == SDeletePicker);
if (cropHandler.cropPixbuf) {
imgW = cropHandler.cropPixbuf->get_width ();