UnitySwiftKotlin←API Reference Return to API Reference index Method toYUV420PixelBuffer toYUV420PixelBuffer Declaration func toYUV420PixelBuffer(width: Int, height: Int) -> CVPixelBuffer? Summary Converts the CGImage to a CVPixelBuffer in YUV420NV12 (bi-planar) format for use as a camera feed. Uses Core Image to perform the color conversion. Returns nil if buffer creation or render fails. Parameters NameTypeSummarywidthIntTarget width for the pixel buffer (typically the image width).heightIntTarget height for the pixel buffer (typically the image height).
Converts the CGImage to a CVPixelBuffer in YUV420NV12 (bi-planar) format for use as a camera feed.
Uses Core Image to perform the color conversion. Returns nil if buffer creation or render fails.