-4
unsigned char pixelData[4] = { 0, 0, 0, 0 };
CGContextRef context = CGBitmapContextCreate(pixelData,
1,
1,
bitsPerComponent,
bytesPerRow,
colorSpace,
kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
我想将unsigned char pixelData[4] = { 0, 0, 0, 0 };
翻译为Swift。看来我必须使用UnsafeMutableRawPointer
。但是我不知道怎么做。将CGBitmapContextCreate从Objective-C翻译成Swift
请参阅[__Apple Docs__](https://developer.apple.com/documentation/swift/unsafemutablerawpointer)以获取更多信息,也许? – holex