Commit 12a0efa6 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by Laurent Claustre
Browse files

Add HW RoI support to Frelon16:

* Camera is configured to read full lines
* Both single-dual SPB8 modes are supported
* EspiaSGRoi is disabled in dual-SPB8 mode
parent 75fcbc7f
...@@ -475,13 +475,18 @@ Flip Geometry::getMirror() ...@@ -475,13 +475,18 @@ Flip Geometry::getMirror()
{ {
DEB_MEMBER_FUNCT(); DEB_MEMBER_FUNCT();
InputChan curr;
getInputChan(curr);
Flip mirror; Flip mirror;
mirror.x = isChanActive(curr, Chan12) || isChanActive(curr, Chan34); if (isFrelon16()) {
mirror.y = isChanActive(curr, Chan13) || isChanActive(curr, Chan24); mirror.x = false;
if (isFrelon16()) mirror.y = (m_model.getSPBConType() == SPBConXY);
mirror = Flip(false); } else {
InputChan curr;
getInputChan(curr);
mirror.x = (isChanActive(curr, Chan12) ||
isChanActive(curr, Chan34));
mirror.y = (isChanActive(curr, Chan13) ||
isChanActive(curr, Chan24));
}
DEB_RETURN() << DEB_VAR1(mirror); DEB_RETURN() << DEB_VAR1(mirror);
return mirror; return mirror;
} }
...@@ -532,11 +537,16 @@ void Geometry::xformChanCoords(const Point& point, Point& xform_point, ...@@ -532,11 +537,16 @@ void Geometry::xformChanCoords(const Point& point, Point& xform_point,
Flip mirror = getMirror(); Flip mirror = getMirror();
Size chan_size = getChanSize(); Size chan_size = getChanSize();
InputChan curr; Flip readout_flip(false);
getInputChan(curr); if (!isFrelon16()) {
bool right = !isChanActive(curr, Chan1) && !isChanActive(curr, Chan3); InputChan curr;
bool bottom = !isChanActive(curr, Chan1) && !isChanActive(curr, Chan2); getInputChan(curr);
Flip readout_flip(right, bottom); bool right = (!isChanActive(curr, Chan1) &&
!isChanActive(curr, Chan3));
bool bottom = (!isChanActive(curr, Chan1) &&
!isChanActive(curr, Chan2));
readout_flip = Flip(right, bottom);
}
DEB_TRACE() << DEB_VAR2(chan_flip, readout_flip); DEB_TRACE() << DEB_VAR2(chan_flip, readout_flip);
Flip effect_flip = chan_flip & readout_flip; Flip effect_flip = chan_flip & readout_flip;
...@@ -713,8 +723,21 @@ void Geometry::processSetRoi(const Roi& set_roi, Roi& hw_roi, ...@@ -713,8 +723,21 @@ void Geometry::processSetRoi(const Roi& set_roi, Roi& hw_roi,
DEB_MEMBER_FUNCT(); DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(set_roi); DEB_PARAM() << DEB_VAR1(set_roi);
Roi aligned_roi = set_roi; Roi aligned_roi;
aligned_roi.alignCornersTo(Point(32, 1), Ceil); if (isFrelon16()) {
// no horizontal roi in Frelon16
Point top_left(0, set_roi.getTopLeft().y);
FrameDim frame_dim;
getFrameDim(frame_dim);
Bin bin;
getBin(bin);
Size size(frame_dim.getSize().getWidth() / bin.getX(),
set_roi.getSize().getHeight());
aligned_roi = Roi(top_left, size);
} else {
aligned_roi = set_roi;
aligned_roi.alignCornersTo(Point(32, 1), Ceil);
}
Flip roi_inside_mirror; Flip roi_inside_mirror;
calcChanRoi(aligned_roi, chan_roi, roi_inside_mirror); calcChanRoi(aligned_roi, chan_roi, roi_inside_mirror);
Roi image_roi; Roi image_roi;
......
...@@ -586,7 +586,8 @@ void RoiCtrlObj::checkEspiaRoi(const Roi& set_roi, Roi& hw_roi, ...@@ -586,7 +586,8 @@ void RoiCtrlObj::checkEspiaRoi(const Roi& set_roi, Roi& hw_roi,
det_frame_size = hw_roi.getSize(); det_frame_size = hw_roi.getSize();
bool sg_roi = (!set_roi.isEmpty() && (hw_roi != set_roi)); bool f16_dual = m_cam.getModel().isFrelon16Dual();
bool sg_roi = (!f16_dual && !set_roi.isEmpty() && (hw_roi != set_roi));
if (sg_roi) { if (sg_roi) {
espia_roi = hw_roi.subRoiAbs2Rel(set_roi); espia_roi = hw_roi.subRoiAbs2Rel(set_roi);
int width = set_roi.getSize().getWidth(); int width = set_roi.getSize().getWidth();
...@@ -659,12 +660,19 @@ void FlipCtrlObj::setFlip(const Flip& flip) ...@@ -659,12 +660,19 @@ void FlipCtrlObj::setFlip(const Flip& flip)
Espia::SGImgConfig img_config = (flip.y ? Espia::SGImgConcatVertInv2 : Espia::SGImgConfig img_config = (flip.y ? Espia::SGImgConcatVertInv2 :
Espia::SGImgConcatVert2); Espia::SGImgConcatVert2);
FrameDim det_frame_dim; Size det_size;
m_cam.getFrameDim(det_frame_dim); Roi roi;
Bin bin; m_cam.getRoi(roi);
m_cam.getBin(bin); if (roi.isActive()) {
det_frame_dim /= bin; det_size = roi.getSize();
m_acq.setSGImgConfig(img_config, det_frame_dim.getSize()); } else {
FrameDim det_frame_dim;
m_cam.getFrameDim(det_frame_dim);
Bin bin;
m_cam.getBin(bin);
det_size = det_frame_dim.getSize() / bin;
}
m_acq.setSGImgConfig(img_config, det_size);
} }
void FlipCtrlObj::getFlip(Flip& flip) void FlipCtrlObj::getFlip(Flip& flip)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment