channels
The channels of the Core Video image format.
Declaration
var channels: [vImage.BufferType] { get }Discussion
For example, the following code prints the channels in a kCVPixelFormatType_420YpCbCr8Planar Core Video image format:
let cvImageFormat = vImageCVImageFormat.make(
format: .format420YpCbCr8Planar,
matrix: kvImage_ARGBToYpCbCrMatrix_ITU_R_709_2.pointee,
chromaSiting: .center,
colorSpace: CGColorSpace(name: CGColorSpace.sRGB)!,
alphaIsOpaqueHint: true)!
// Prints "channels [Accelerate.vImage.BufferType.luminance,
// Accelerate.vImage.BufferType.Cb,
// Accelerate.vImage.BufferType.Cr]".
print("channels \(cvImageFormat.channels)")