From f514a691041fcb528d4b8e683038012f5b70ea2b Mon Sep 17 00:00:00 2001 From: Lawrence Date: Fri, 27 Dec 2019 20:50:18 -0800 Subject: [PATCH] Group perspective adjusters in frames Divide perspective correction adjusters into three groups: camera attributes, post-correction adjustments, and perspective distortion recovery. --- rtdata/languages/default | 3 +++ rtgui/perspective.cc | 50 ++++++++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 776074d5e..98a11b164 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1810,17 +1810,20 @@ TP_PCVIGNETTE_STRENGTH;Strength TP_PCVIGNETTE_STRENGTH_TOOLTIP;Filter strength in stops (reached in corners). TP_PDSHARPENING_LABEL;Capture Sharpening TP_PERSPECTIVE_CAMERA_CROP_FACTOR;Crop factor +TP_PERSPECTIVE_CAMERA_FRAME;Correction TP_PERSPECTIVE_CAMERA_FOCAL_LENGTH;Focal length TP_PERSPECTIVE_CAMERA_SHIFT_HORIZONTAL;Horizontal shift TP_PERSPECTIVE_CAMERA_SHIFT_VERTICAL;Vertical shift TP_PERSPECTIVE_HORIZONTAL;Horizontal TP_PERSPECTIVE_LABEL;Perspective +TP_PERSPECTIVE_POST_CORRECTION_ADJUSTMENT_FRAME;Post-correction adjustment TP_PERSPECTIVE_PROJECTION_PITCH;Vertical TP_PERSPECTIVE_PROJECTION_ROTATE;Rotation TP_PERSPECTIVE_PROJECTION_SCALE;Scale TP_PERSPECTIVE_PROJECTION_SHIFT_HORIZONTAL;Horizontal shift TP_PERSPECTIVE_PROJECTION_SHIFT_VERTICAL;Vertical shift TP_PERSPECTIVE_PROJECTION_YAW;Horizontal +TP_PERSPECTIVE_RECOVERY_FRAME;Recovery TP_PERSPECTIVE_VERTICAL;Vertical TP_PFCURVE_CURVEEDITOR_CH;Hue TP_PFCURVE_CURVEEDITOR_CH_TOOLTIP;Controls defringe strength by color.\nHigher = more,\nLower = less. diff --git a/rtgui/perspective.cc b/rtgui/perspective.cc index a7c3900ad..c9ccd794b 100644 --- a/rtgui/perspective.cc +++ b/rtgui/perspective.cc @@ -40,6 +40,12 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" Gtk::Image* ipers_rotate_left = Gtk::manage(new RTImage("rotate-right-small.png")); Gtk::Image* ipers_rotate_right = Gtk::manage(new RTImage("rotate-left-small.png")); + Gtk::Frame* camera_frame = Gtk::manage (new Gtk::Frame + (M("TP_PERSPECTIVE_CAMERA_FRAME"))); + camera_frame->set_label_align(0.025, 0.5); + + Gtk::VBox* camera_vbox = Gtk::manage (new Gtk::VBox()); + vert = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_VERTICAL"), -85, 85, 0.1, 0, ipersVL, ipersVR)); vert->setAdjusterListener (this); @@ -58,6 +64,12 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" camera_shift_vert = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_CAMERA_SHIFT_VERTICAL"), -100, 100, 0.01, 0)); camera_shift_vert->setAdjusterListener (this); + Gtk::Frame* pca_frame = Gtk::manage (new Gtk::Frame + (M("TP_PERSPECTIVE_POST_CORRECTION_ADJUSTMENT_FRAME"))); + pca_frame->set_label_align(0.025, 0.5); + + Gtk::VBox* pca_vbox = Gtk::manage (new Gtk::VBox()); + projection_shift_horiz = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_PROJECTION_SHIFT_HORIZONTAL"), -100, 100, 0.01, 0)); projection_shift_horiz->setAdjusterListener (this); @@ -70,24 +82,38 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" projection_scale = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_PROJECTION_SCALE"), 0.5, 2, 0.01, 1)); projection_scale->setAdjusterListener (this); + Gtk::Frame* recovery_frame = Gtk::manage (new Gtk::Frame + (M("TP_PERSPECTIVE_RECOVERY_FRAME"))); + recovery_frame->set_label_align(0.025, 0.5); + + Gtk::VBox* recovery_vbox = Gtk::manage (new Gtk::VBox()); + projection_pitch = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_PROJECTION_PITCH"), -85, 85, 0.1, 0, ipers_proj_pitch_left, ipers_proj_pitch_right)); projection_pitch->setAdjusterListener (this); projection_yaw = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_PROJECTION_YAW"), -85, 85, 0.1, 0, ipers_proj_yaw_left, ipers_proj_yaw_right)); projection_yaw->setAdjusterListener (this); - pack_start (*vert); - pack_start (*horiz); - pack_start (*camera_focal_length); - pack_start (*camera_crop_factor); - pack_start (*camera_shift_horiz); - pack_start (*camera_shift_vert); - pack_start (*projection_shift_horiz); - pack_start (*projection_shift_vert); - pack_start (*projection_rotate); - pack_start (*projection_scale); - pack_start (*projection_yaw); - pack_start (*projection_pitch); + camera_vbox->pack_start (*vert); + camera_vbox->pack_start (*horiz); + camera_vbox->pack_start (*camera_focal_length); + camera_vbox->pack_start (*camera_crop_factor); + camera_vbox->pack_start (*camera_shift_horiz); + camera_vbox->pack_start (*camera_shift_vert); + camera_frame->add(*camera_vbox); + pack_start(*camera_frame); + + pca_vbox->pack_start (*projection_shift_horiz); + pca_vbox->pack_start (*projection_shift_vert); + pca_vbox->pack_start (*projection_rotate); + pca_vbox->pack_start (*projection_scale); + pca_frame->add(*pca_vbox); + pack_start(*pca_frame); + + recovery_vbox->pack_start (*projection_yaw); + recovery_vbox->pack_start (*projection_pitch); + recovery_frame->add(*recovery_vbox); + pack_start(*recovery_frame); horiz->setLogScale(2, 0); vert->setLogScale(2, 0);