code clean

This commit is contained in:
Patrick Haßel 2025-06-27 21:30:05 +02:00
parent 630e55122a
commit 00deaff4fe

View File

@ -35,15 +35,15 @@ class Fotobox:
camera.hflip = True
camera.resolution = (2592, 1944)
camera.rotation = 270
camera.preview_configuration.main.size = res
camera.preview_configuration.main.format = 'BGR888'
camera.preview_configuration.transform = Transform(hflip=1, vflip=1)
camera.configure("preview")
#####################
# here configure still capture
self._capture_config = camera.create_still_configuration()
camera.still_configuration.main.size = (2592, 1944)
#####################
camera.start()
self._camera = camera
@ -97,11 +97,6 @@ class Fotobox:
image = Image.fromarray(frame)
self._photos.append(Photo(self._shooting_timer.current(), image))
#stream = io.BytesIO()
#self._camera.capture(stream, format='rgb')
#stream.seek(0)
#self._photos.append(Photo(self._shooting_timer.current(), Image.open(stream)))
screen.fill((0, 0, 0))
pygame.display.flip()
@ -211,10 +206,6 @@ class Fotobox:
print(new_state)
self._state = new_state
if new_state == State.COUNTDOWN:
#config = self._camera.create_preview_configuration(main={"size": (PHOTO_WIDTH, PHOTO_HEIGHT)})
#self._camera.configure(config)
#self._camera.start_preview()
#self._camera.start()
self._countdown_timer.restart()
elif new_state == State.SHOOTING:
self._photos = []
@ -223,7 +214,6 @@ class Fotobox:
print("Starting shooting: S%04d-%s" % (self._shooting_number, iso(self._shooting_datetime)))
self._shooting_timer.restart()
elif new_state == State.PREPARE:
#self._camera.stop_preview()
for photo in self._photos:
photo.prepare(self._event)
self._set_state(State.CHOOSE)