Fixed bug in last commit when image was rotated
This commit is contained in:
parent
b720a67328
commit
d570459f1e
@ -160,7 +160,7 @@ public:
|
||||
{
|
||||
return this;
|
||||
}
|
||||
virtual void getRawValues(int x, int y, int &R, int &G, int &B) = 0;
|
||||
virtual void getRawValues(int x, int y, int rotate, int &R, int &G, int &B) = 0;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
@ -5460,10 +5460,25 @@ void RawImageSource::init ()
|
||||
}
|
||||
}
|
||||
|
||||
void RawImageSource::getRawValues(int x, int y, int &R, int &G, int &B)
|
||||
void RawImageSource::getRawValues(int x, int y, int rotate, int &R, int &G, int &B)
|
||||
{
|
||||
int xnew = x + border;
|
||||
int ynew = y + border;
|
||||
rotate += ri->get_rotateDegree();
|
||||
rotate %= 360;
|
||||
if (rotate == 90) {
|
||||
std::swap(xnew,ynew);
|
||||
ynew = H - 1 - ynew;
|
||||
} else if (rotate == 180) {
|
||||
xnew = W - 1 - xnew;
|
||||
ynew = H - 1 - ynew;
|
||||
} else if (rotate == 270) {
|
||||
std::swap(xnew,ynew);
|
||||
ynew = H - 1 - ynew;
|
||||
xnew = W - 1 - xnew;
|
||||
ynew = H - 1 - ynew;
|
||||
}
|
||||
|
||||
int c = FC(ynew,xnew);
|
||||
int val = round(rawData[ynew][xnew] / scale_mul[c]);
|
||||
if(c == 0) {
|
||||
|
@ -264,7 +264,7 @@ protected:
|
||||
void pixelshift(int winx, int winy, int winw, int winh, const RAWParams::BayerSensor &bayerParams, unsigned int frame, const std::string &model, float rawWpCorrection);
|
||||
void hflip (Imagefloat* im);
|
||||
void vflip (Imagefloat* im);
|
||||
void getRawValues(int x, int y, int &R, int &G, int &B);
|
||||
void getRawValues(int x, int y, int rotate, int &R, int &G, int &B);
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
}
|
||||
void setCurrentFrame(unsigned int frameNum) {}
|
||||
|
||||
void getRawValues(int x, int y, int &R, int &G, int &B) { R = G = B = 0;}
|
||||
void getRawValues(int x, int y, int rotate, int &R, int &G, int &B) { R = G = B = 0;}
|
||||
|
||||
|
||||
};
|
||||
|
@ -1045,7 +1045,7 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
|
||||
ipc->getParams(¶ms);
|
||||
if(params.raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::none]) {
|
||||
ImageSource *isrc = static_cast<ImageSource*>(ipc->getInitialImage());
|
||||
isrc->getRawValues(mx, my, rval, gval, bval);
|
||||
isrc->getRawValues(mx, my, params.coarse.rotate, rval, gval, bval);
|
||||
}
|
||||
}
|
||||
// pmlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user