How to build AVDepthData manually
问题 I want to build my own depth map and save image like portrait photo with depth info. So first of all I need generate AVDepthData. After dig how it builded, I try to reproduce it: func buildDepth() { // ... let info: [AnyHashable: Any] = [kCGImagePropertyPixelFormat: kCVPixelFormatType_DisparityFloat32, kCGImagePropertyWidth: width, kCGImagePropertyHeight: height, kCGImagePropertyBytesPerRow: bytesPerRow] let metadata = generateMetadata(photo: photo) let dic: [AnyHashable: Any] =