Avatar
omochimetaru 12/1/2017 2:11 AM
let yPlaneBuffer = CVPixelBufferGetBaseAddressOfPlane(pixelBuffer, 0) yPlaneData.withUnsafeBytes { (data) in yPlaneBuffer!.copyBytes(from: data, count: yPlaneData.count) }
2:11 AM
これコンパイル通るのなんでだろう
2:12 AM
yPlaneDataData 型で、 withUnsafeBytes は public func withUnsafeBytes<ResultType, ContentType>(_ body: (UnsafePointer<ContentType>) throws -> ResultType) rethrows -> ResultType
2:12 AM
で、copyBytes public func copyBytes(from source: UnsafeRawPointer, count: Int)
2:12 AM
だから
2:12 AM
クロージャの (data) の推論が
2:13 AM
UnsafePointer<ContentType>UnsafeRawPointer でぶつかって解決できないように思う