"""Reenquadrar a resolução do projeto. Extraído de writer.py — ver fcpxml/writer/__init__.py para o conjunto. """ class ReformatMixin: """Reenquadrar a resolução do projeto.""" # REFORMAT OPERATIONS (v0.5.0) # ======================================================================== SOCIAL_FORMATS = { "9:16": (1080, 1920), "1:1": (1080, 1080), "4:5": (1080, 1350), "16:9": (1920, 1080), "4:3": (1440, 1080), } def reformat_resolution(self, width: int, height: int) -> None: """Change the timeline format to a new resolution. Updates the format resource dimensions. FCP handles spatial conforming (letterbox/pillarbox) on import. Args: width: Target width in pixels height: Target height in pixels """ for fmt in self.root.findall('.//format'): fmt.set('width', str(width)) fmt.set('height', str(height)) old_name = fmt.get('name', '') if old_name: fmt.set('name', f"FFVideoFormat{width}x{height}") sequence = self.root.find('.//sequence') if sequence is not None and sequence.get('format'): pass # format ref stays the same, dimensions updated in-place # ========================================================================