<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVPixelBufferRepresentable",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "s:9CoreVideo26CVPixelBufferRepresentableP"
  },
  "title" : "CVPixelBufferRepresentable"
}
-->

# CVPixelBufferRepresentable

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.

```
protocol CVPixelBufferRepresentable : CVImageBufferRepresentable, ~Copyable
```

## Topics

### Instance Properties

[`var attachments: Self.Attachments`](/documentation/CoreVideo/CVPixelBufferRepresentable/attachments-swift.property)

Access attachments of this pixel buffer.

[`var creationAttributes: CVPixelBufferCreationAttributes`](/documentation/CoreVideo/CVPixelBufferRepresentable/creationAttributes)

Attributes used for creating this pixel buffer

[`var extendedPixels: CVPixelBufferPadding`](/documentation/CoreVideo/CVPixelBufferRepresentable/extendedPixels)

Padding pixels around this pixel buffer

[`var isPlanar: Bool`](/documentation/CoreVideo/CVPixelBufferRepresentable/isPlanar)

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

[`var pixelFormatType: CVPixelFormatType`](/documentation/CoreVideo/CVPixelBufferRepresentable/pixelFormatType)

Pixel format of this pixel buffer

[`var planeCount: Int`](/documentation/CoreVideo/CVPixelBufferRepresentable/planeCount)

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`](/documentation/CoreVideo/CVPixelBufferRepresentable/isPlanar) property.

[`var planeProperties: [CVPixelBufferPlaneProperties]`](/documentation/CoreVideo/CVPixelBufferRepresentable/planeProperties)

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.

[`var size: CVImageSize`](/documentation/CoreVideo/CVPixelBufferRepresentable/size)

Size of the pixel buffer in pixels

### Instance Methods

[`func accessUnsafeRawPlaneBytes<R>(([(properties: CVPixelBufferPlaneProperties, bytes: UnsafeRawBufferPointer)]) throws -> sending R) rethrows -> sending R`](/documentation/CoreVideo/CVPixelBufferRepresentable/accessUnsafeRawPlaneBytes(_:))

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

[`func isCompatibleWith(CVPixelBufferAttributes) -> Bool`](/documentation/CoreVideo/CVPixelBufferRepresentable/isCompatibleWith(_:)-9fsoy)

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

[`func isCompatibleWith(CVPixelBufferCreationAttributes) -> Bool`](/documentation/CoreVideo/CVPixelBufferRepresentable/isCompatibleWith(_:)-b775)

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

[`func withUnsafeBackingIOSurfaceIfPresent<R>((IOSurface) throws -> sending R) rethrows -> sending R?`](/documentation/CoreVideo/CVPixelBufferRepresentable/withUnsafeBackingIOSurfaceIfPresent(_:))

Access the IOSurface backing the pixel buffer if present.

### Type Aliases

[`typealias Attachments`](/documentation/CoreVideo/CVPixelBufferRepresentable/Attachments-swift.typealias)

## Relationships

### Conforming Types

[`CVReadOnlyPixelBuffer`](/documentation/CoreVideo/CVReadOnlyPixelBuffer)

[`CVMutablePixelBuffer`](/documentation/CoreVideo/CVMutablePixelBuffer)

### Inherits From

[`CVImageBufferRepresentable`](/documentation/CoreVideo/CVImageBufferRepresentable)

[`CVBufferRepresentable`](/documentation/CoreVideo/CVBufferRepresentable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)