One Logo Pool Ball
CoreVideo · IOS API REFERENCE

CVPixelBufferRepresentable

protocol · iOS 26.0+ · SDK 27.1

protocol CVPixelBufferRepresentable : CVImageBufferRepresentable, ~Copyable

CVPixelBufferRepresentable protocol is a sealed protocol intended to be implemented by the types in CoreVideo framework. This protocol facilitates Swift types that wrap a value of CVPixelBuffer type.

Members (11)

get · iOS 26.0+

planeCount

Swift declaration
var planeCount: Int { get }

Number of planes in this pixel buffer. This value will always be greater than 0. `planeCount` is more efficient to access than count property of ``planes``. A non-planar pixel buffer implicitly defines a single plane. To check if the pixel buffer was defined with planes use ``isPlanar`` property.

get · iOS 26.0+

extendedPixels

Swift declaration
var extendedPixels: CVPixelBufferPadding { get }

Padding pixels around this pixel buffer

get · iOS 26.0+

pixelFormatType

Swift declaration
var pixelFormatType: CVPixelFormatType { get }

Pixel format of this pixel buffer

get · iOS 26.0+

planeProperties

Swift declaration
var planeProperties: [CVPixelBufferPlaneProperties] { get }

Properties of all the planes in this pixel buffer. This array will contain at least one element. In case of non-planar pixel buffers, the first value represents the entire pixel data.

method · iOS 26.0+

isCompatibleWith

Swift declaration
func isCompatibleWith(_ attributes: CVPixelBufferAttributes) -> Bool

Returns `true` if the pixel buffer is compatible with the specified attributes.

method · iOS 26.0+

isCompatibleWith

Swift declaration
func isCompatibleWith(_ attributes: CVPixelBufferCreationAttributes) -> Bool

Returns `true` if the pixel buffer is compatible with the specified creation attributes.

get · iOS 26.0+

creationAttributes

Swift declaration
var creationAttributes: CVPixelBufferCreationAttributes { get }

Attributes used for creating this pixel buffer

method · iOS 26.0+

accessUnsafeRawPlaneBytes

Swift declaration
func accessUnsafeRawPlaneBytes<R>(_ block: ([(properties: CVPixelBufferPlaneProperties, bytes: UnsafeRawBufferPointer)]) throws -> sending R) rethrows -> sending R

Access the pixels in the planes contained within this buffer. The base address is locked for reading during the execution of the block.

method · iOS 26.0+

withUnsafeBackingIOSurfaceIfPresent

Swift declaration
func withUnsafeBackingIOSurfaceIfPresent<R>(_ block: (IOSurface) throws -> sending R) rethrows -> sending R?

Access the IOSurface backing the pixel buffer if present.

get · iOS 26.0+

size

Swift declaration
var size: CVImageSize { get }

Size of the pixel buffer in pixels

get · iOS 26.0+

isPlanar

Swift declaration
var isPlanar: Bool { get }

True if the buffer was created with support for one or more planes.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

CVPixelBufferRepresentable.attachments

The iOS SDK compiler rejected this binding: instance method 'out' requires that 'CVAttachmentAccess<CVPixelBufferAttachmentKeyDefinitions>' be a class type

All CoreVideo types →