Consolidate camera configuration

This commit is contained in:
Grant Sanderson
2024-12-10 11:39:13 -06:00
parent d4c5c4736a
commit 4cc2e5ed17
4 changed files with 42 additions and 44 deletions

View File

@ -8,7 +8,7 @@ from PIL import Image
from manimlib.camera.camera_frame import CameraFrame
from manimlib.constants import BLACK
from manimlib.constants import DEFAULT_FPS
from manimlib.constants import DEFAULT_PIXEL_HEIGHT, DEFAULT_PIXEL_WIDTH
from manimlib.constants import DEFAULT_RESOLUTION
from manimlib.constants import FRAME_HEIGHT
from manimlib.constants import FRAME_WIDTH
from manimlib.mobject.mobject import Mobject
@ -29,10 +29,9 @@ class Camera(object):
window: Optional[Window] = None,
background_image: Optional[str] = None,
frame_config: dict = dict(),
pixel_width: int = DEFAULT_PIXEL_WIDTH,
pixel_height: int = DEFAULT_PIXEL_HEIGHT,
# Note: frame height and width will be resized to match this resolution aspect ratio
resolution=DEFAULT_RESOLUTION,
fps: int = DEFAULT_FPS,
# Note: frame height and width will be resized to match the pixel aspect ratio
background_color: ManimColor = BLACK,
background_opacity: float = 1.0,
# Points in vectorized mobjects with norm greater
@ -47,9 +46,9 @@ class Camera(object):
# to set samples to be greater than 0.
samples: int = 0,
):
self.background_image = background_image
self.window = window
self.default_pixel_shape = (pixel_width, pixel_height)
self.background_image = background_image
self.default_pixel_shape = resolution # Rename?
self.fps = fps
self.max_allowable_norm = max_allowable_norm
self.image_mode = image_mode