init(planarBuffers:)
Creates a 3-channel, 8-bit-per-channel interleaved buffer from three 8-bit planar buffers.
Declaration
init(planarBuffers: [vImage.PixelBuffer<vImage.Planar8>])Parameters
- planarBuffers:
An array that contains three 8-bit planar buffers.
Discussion
Use this function to interleave three discrete planar buffers. For example, the following code creates a three-channel interleaved buffer from three planar buffers:
let planar0 = vImage.PixelBuffer<vImage.Planar8>(
pixelValues: [UInt8(50)],
size: vImage.Size(width: 1, height: 1))
let planar1 = vImage.PixelBuffer<vImage.Planar8>(
pixelValues: [UInt8(100)],
size: vImage.Size(width: 1, height: 1))
let planar2 = vImage.PixelBuffer<vImage.Planar8>(
pixelValues: [UInt8(150)],
size: vImage.Size(width: 1, height: 1))
let interleaved = vImage.PixelBuffer<vImage.Interleaved8x3>(
planarBuffers: [planar0, planar1, planar2])
// Prints "[50, 100, 150]"
print(interleaved.array)