Fix flip_image for picam

This commit is contained in:
ABelliqueux 2025-02-24 14:44:06 +01:00
parent 5fef8eed03
commit df0193a689
1 changed files with 9 additions and 4 deletions

View File

@ -360,6 +360,8 @@ class picam():
def flip_image(self):
self.cam.stop()
self.increment_setting('vertical_flip')
self.increment_setting('horizontal_flip')
self.picam_config["transform"] = self.Transform(vflip=self.camera_current_settings['vertical_flip']['value'],hflip=self.camera_current_settings['horizontal_flip']['value'])
self.cam.configure(self.picam_config)
self.cam.start()
@ -1033,16 +1035,16 @@ def main(args):
if len(img_list):
if playback:
playback = False
index, frame = last_frame(index)
cam.o_frame = cam.frame.copy()
index, cam.frame = last_frame(index)
cam.o_frame = cam.frame.copy()
# Key down , kp 2
elif (k%256 == 84) or (k%256 == 50) or (k%256 == 178):
print(_("First frame"))
if len(img_list):
if playback:
playback = False
index, frame = first_frame(index)
cam.o_frame = cam.frame.copy()
index, cam.frame = first_frame(index)
cam.o_frame = cam.frame.copy()
# Key left, kp 4
elif (k%256 == 81) or (k%256 == 52) or (k%256 == 180):
print(_("Prev. frame"))
@ -1092,6 +1094,9 @@ def main(args):
elif (k%256 == 113):
print(_("Anti-flicker mode"))
cam.apply_setting(['anti_flicker'], True)
# Unused : key S
elif (k%256 == 115):
pass
# SPACE or numpad 0 pressed
elif (k%256 == 32) or (k%256 == 48) or (k%256 == 176):
print(_("Capture frame"))