Refactoring how Camera frame height and width are handled

This commit is contained in:
Grant Sanderson
2018-05-11 17:41:37 -07:00
parent f0b8ae7647
commit f04b2e270c
8 changed files with 112 additions and 55 deletions

View File

@ -25,15 +25,14 @@ class MultiCamera(MovingCamera):
def update_sub_cameras(self):
""" Reshape sub_camera pixel_arrays """
for imfc in self.image_mobjects_from_cameras:
frame_height, frame_width = self.frame_shape
pixel_height, pixel_width = self.get_pixel_array().shape[:2]
imfc.camera.frame_shape = (
imfc.camera.frame.get_height(),
imfc.camera.frame.get_width(),
)
imfc.camera.reset_pixel_shape((
int(pixel_height * imfc.get_height() / frame_height),
int(pixel_width * imfc.get_width() / frame_width),
int(pixel_height * imfc.get_height() / self.get_frame_height()),
int(pixel_width * imfc.get_width() / self.get_frame_width()),
))
def reset(self):