Implement basic perspective control lines (WIP)

This commit is contained in:
Lawrence Lee
2020-06-08 18:21:12 -07:00
parent 852b3270e1
commit 6b7c1871b9
12 changed files with 703 additions and 51 deletions

View File

@@ -860,7 +860,7 @@ void ToolPanelCoordinator::straightenRequested ()
toolBar->setTool (TMStraighten);
}
void ToolPanelCoordinator::autoPerspRequested (bool corr_pitch, bool corr_yaw, double& rot, double& pitch, double& yaw)
void ToolPanelCoordinator::autoPerspRequested (bool corr_pitch, bool corr_yaw, double& rot, double& pitch, double& yaw, const rtengine::ControlLine *lines, size_t line_count)
{
if (!(ipc && (corr_pitch || corr_yaw))) {
return;
@@ -874,7 +874,7 @@ void ToolPanelCoordinator::autoPerspRequested (bool corr_pitch, bool corr_yaw, d
rtengine::procparams::ProcParams params;
ipc->getParams(&params);
auto res = rtengine::PerspectiveCorrection::autocompute(src, corr_pitch, corr_yaw, &params, src->getMetaData());
auto res = rtengine::PerspectiveCorrection::autocompute(src, corr_pitch, corr_yaw, &params, src->getMetaData(), lines, line_count);
rot = res.angle;
pitch = res.pitch;
yaw = res.yaw;
@@ -889,6 +889,16 @@ double ToolPanelCoordinator::autoDistorRequested ()
return rtengine::ImProcFunctions::getAutoDistor (ipc->getInitialImage()->getFileName(), 400);
}
void ToolPanelCoordinator::updateTransformPreviewRequested(rtengine::ProcEvent event, bool render_perspective)
{
if (!ipc) {
return;
}
ipc->beginUpdateParams()->perspective.render = render_perspective;
ipc->endUpdateParams(event);
}
void ToolPanelCoordinator::spotWBRequested (int size)
{
@@ -1101,4 +1111,4 @@ bool ToolPanelCoordinator::getFilmNegativeExponents(rtengine::Coord spotA, rteng
bool ToolPanelCoordinator::getRawSpotValues(rtengine::Coord spot, int spotSize, std::array<float, 3>& rawValues)
{
return ipc && ipc->getRawSpotValues(spot.x, spot.y, spotSize, rawValues);
}
}