From 2c678e60f8a1417ab950718366e0b4247eb90094 Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Fri, 21 May 2021 21:31:39 +0000 Subject: [PATCH] Implement scale by width and height for final animation. --- bemani/format/afp/render.py | 1 - bemani/utils/afputils.py | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bemani/format/afp/render.py b/bemani/format/afp/render.py index 899ca03..55ca78d 100644 --- a/bemani/format/afp/render.py +++ b/bemani/format/afp/render.py @@ -666,7 +666,6 @@ class AFPRenderer(VerboseOutput): # Calculate actual size based on given movie transform. actual_size = movie_transform.multiply_point(Point(swf.location.width, swf.location.height)).as_tuple() - print(actual_size) # Create a root clip for the movie to play. root_clip = PlacedClip( diff --git a/bemani/utils/afputils.py b/bemani/utils/afputils.py index c5a8a4e..2a05fd4 100644 --- a/bemani/utils/afputils.py +++ b/bemani/utils/afputils.py @@ -279,6 +279,18 @@ def main() -> int: default=None, help="Force the aspect ratio of the rendered image, as a colon-separated aspect ratio such as 16:9 or 4:3.", ) + render_parser.add_argument( + "--scale-width", + type=float, + default=1.0, + help="Scale the width of the animation by some factor.", + ) + render_parser.add_argument( + "--scale-height", + type=float, + default=1.0, + help="Scale the height of the animation by some factor.", + ) render_parser.add_argument( "--disable-threads", action="store_true", @@ -754,6 +766,9 @@ def main() -> int: else: requested_height = new_height + requested_width *= args.scale_width + requested_height *= args.scale_height + # Calculate the overall view matrix based on the requested width/height. transform = Matrix( a=requested_width / swf_location.width, @@ -763,7 +778,6 @@ def main() -> int: tx=0.0, ty=0.0, ) - print(transform) # Render the gif/webp frames. if args.only_depths is not None: