Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvinC committed Aug 29, 2021
2 parents 700018c + 6fb7ce9 commit ae9f424
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 80 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,4 @@ dmypy.json

# Pyre type checker
.pyre/
.idea/
76 changes: 0 additions & 76 deletions .idea/workspace.xml

This file was deleted.

27 changes: 23 additions & 4 deletions gyroflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@ def init_UI(self):
#self.sync_controls_layout.addWidget(self.sync_correction_button)


# Select method for doing low-pass filtering
# Select method for doing low-pass filtering
self.stab_controls_layout.addWidget(QtWidgets.QLabel("Smoothing method"))
self.stabilization_algo_select = QtWidgets.QComboBox()

Expand Down Expand Up @@ -1765,9 +1765,17 @@ def init_UI(self):
text.setAlignment(QtCore.Qt.AlignCenter)
self.export_controls_layout.addWidget(text)

# output size choice
self.out_size_text = QtWidgets.QLabel("Output dimensions: ")
self.export_controls_layout.addWidget(self.out_size_text)
# output size choice presets
names = ["4K", "2.7K", "1440p", "1080p", "720p", "4K 2.39:1"]
self.resolutions = [(3840, 2160), (2704, 1520), (2560, 1440), (1920, 1080), (1280, 720), (4096, 1716)]
self.export_controls_layout.addWidget(QtWidgets.QLabel("Preset video resolutions:"))
self.preset_resolution_combo = QtWidgets.QComboBox()
self.preset_resolution_combo.addItem(f"Original")
for name, res in zip(names, self.resolutions):
self.preset_resolution_combo.addItem(f"{name} ({res[0]}x{res[1]}px)")
self.preset_resolution_combo.currentIndexChanged.connect(self.preset_resolution_selected)

self.export_controls_layout.addWidget(self.preset_resolution_combo)

self.out_width_control = QtWidgets.QSpinBox(self)
self.out_width_control.setMinimum(16)
Expand All @@ -1778,6 +1786,8 @@ def init_UI(self):


# output size choice
self.out_size_text = QtWidgets.QLabel("Output dimensions: ")
self.export_controls_layout.addWidget(self.out_size_text)
self.out_height_control = QtWidgets.QSpinBox(self)
self.out_height_control.setMinimum(9)
self.out_height_control.setMaximum(4320)
Expand Down Expand Up @@ -2418,6 +2428,15 @@ def zoom_changed(self):
val = self.zoom.value() / 10
self.zoom_text.setText("Zoom Factor (with adaptive zoom) or FOV scale (same as preview): {}".format(val))

def preset_resolution_selected(self):
index = self.preset_resolution_combo.currentIndex()
if index == 0:
self.out_width_control.setValue(self.video_info_dict["width"])
self.out_height_control.setValue(self.video_info_dict["height"])
else:
self.out_width_control.setValue(self.resolutions[index - 1][0])
self.out_height_control.setValue(self.resolutions[index - 1][1])

def update_out_size(self):
"""Update export image size
"""
Expand Down

0 comments on commit ae9f424

Please sign in to comment.