我需要使用一个UnsafeMutablePointer<UnsafeMutablePointer<Float>?>!
用作参数的函数。它是在 Objective-C++ 框架中编写的,我通过桥接头访问它:
- (void) applyFilters: (float *) input_image input_params: (long *) input_params output_image : (float *) output_image output_params : (long *) output_params filter_id : (int) filter_id args : (float**) args
我在理解 args 参数的结构时遇到了一些麻烦,即float**
. 在 Swift 中,它要求一个 type 的参数,UnsafeMutablePointer<UnsafeMutablePointer<Float>>
我猜它指向一个浮点数组。
applyFilters(input_image: UnsafeMutablePointer<Float>!UnsafeMutablePointer<Float>!, input_params: UnsafeMutablePointer<Int>!, output_image: UnsafeMutablePointer<Float>!, output_params: UnsafeMutablePointer<Int>!, filter_id: Int32, args: UnsafeMutablePointer<UnsafeMutablePointer<Float>?>!)
如果我创建一个浮点数组数组,我如何使用它来指向它,UnsafeMutablePointer<UnsafeMutablePointer<Float>>
以便我可以将它传递给 C++ 函数?