From 025d11bb22de1fa51a7c63e46bb9c516531ac966 Mon Sep 17 00:00:00 2001 From: Lawrence Date: Sat, 18 Jan 2020 15:26:52 -0800 Subject: [PATCH] Make auto perspective centered at 0 darktable/ART searches for the optimal value of a parameter starting with the currently set value. They scan within a range of that value. This commit changes the starting value to 0 for rotation, pitch, and yaw. It makes the search range balanced. --- rtengine/ashift_dt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rtengine/ashift_dt.c b/rtengine/ashift_dt.c index ba2f62271..d5367d7a5 100644 --- a/rtengine/ashift_dt.c +++ b/rtengine/ashift_dt.c @@ -2170,7 +2170,7 @@ static dt_iop_ashift_nmsresult_t nmsfit(dt_iop_module_t *module, dt_iop_ashift_p { // we fit rotation fit.params_count++; - params[pcount] = logit(fit.rotation, -fit.rotation_range, fit.rotation_range); + params[pcount] = logit(0, -fit.rotation_range, fit.rotation_range); pcount++; fit.rotation = NAN; } @@ -2208,7 +2208,7 @@ static dt_iop_ashift_nmsresult_t nmsfit(dt_iop_module_t *module, dt_iop_ashift_p { // we fit pitch fit.params_count++; - params[pcount] = logit(fit.camera_pitch, -fit.camera_pitch_range, fit.camera_pitch_range); + params[pcount] = logit(0, -fit.camera_pitch_range, fit.camera_pitch_range); pcount++; fit.camera_pitch = NAN; } @@ -2217,7 +2217,7 @@ static dt_iop_ashift_nmsresult_t nmsfit(dt_iop_module_t *module, dt_iop_ashift_p { // we fit yaw fit.params_count++; - params[pcount] = logit(fit.camera_yaw, -fit.camera_yaw_range, fit.camera_yaw_range); + params[pcount] = logit(0, -fit.camera_yaw_range, fit.camera_yaw_range); pcount++; fit.camera_yaw = NAN; }