CVPixelBufferRef到NSImage

时间:2012-04-25 14:56:13

标签: macos cocoa osx-lion nsimage

如何将CVPixelBufferRef转换为NSImage或CGImageRef?我需要能够在核心动画层中显示像素缓冲区的内容。

1 个答案:

答案 0 :(得分:0)

要将缓冲区转换为图像,您需要先将缓冲区转换为 ele = ConfigPage_POF.IVP3_Protocol_drpdwnbtn; act.moveToElement(ele); Thread.sleep(1000); act.build().perform(); Thread.sleep(1000); ele.click(); Thread.sleep(500);[enter image description here][1] ,然后将其转换为CIImage

NSImage

从此处,您可以同时访问let ciImage = CIImage(cvImageBuffer: pixelBuffer) let context = CIContext(options: nil) GCImage

NSImage