ruanjx / VideoLab

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.
MIT License
845 stars 176 forks source link

功能:增加画面区域裁剪(非时长剪切) #25

Open xueyongwei opened 8 months ago

xueyongwei commented 8 months ago

背景: 我看到了RenderLayer可以设置transform,来进行移动、旋转、缩放。

let renderLayer1 = RenderLayer(timeRange: timeRange, source: source)
var transform = Transform(center: center, rotation: 0, scale: 0.5)
renderLayer1.transform = transform

期望: 新增裁剪画面区域,比如:

et renderLayer1 = RenderLayer(timeRange: timeRange, source: source)
var transform = Transform(center: center, rotation: 0, scale: 0.5)
renderLayer1.transform = transform

/// ------
renderLayer1.cropFrame = CGRect(x: 0, y: 0, width: 300, height: 300) //< 新增裁剪方法