<!--
{
  "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/CVPixelBufferCreationAttributes",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "s:9CoreVideo31CVPixelBufferCreationAttributesV"
  },
  "title" : "CVPixelBufferCreationAttributes"
}
-->

# CVPixelBufferCreationAttributes

Attributes needed for creating a pixel buffer.

```
struct CVPixelBufferCreationAttributes
```

## Topics

### Initializers

[`init?(CVPixelBufferAttributes)`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/init(_:))

Convert Attributes to CreationAttributes. This init will fail if [`pixelFormatType`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/pixelFormatType) or [`size`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/size) properties are absent.

[`init(pixelFormatType: CVPixelFormatType, size: CVImageSize, compatibility: CVPixelFormatDescription.Compatibility, bytesPerRowAlignment: Int?, planeAlignment: Int?, extendedPixels: CVPixelBufferPadding?)`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/init(pixelFormatType:size:compatibility:bytesPerRowAlignment:planeAlignment:extendedPixels:))

[`init(pixelFormatType: CVPixelFormatType, size: CVImageSize, compatibility: CVPixelFormatDescription.Compatibility, bytesPerRowAlignment: Int?, planeAlignment: Int?, extendedPixels: CVPixelBufferPadding?, attachments: CVAttachmentContainer<CVPixelBufferAttachmentKeyDefinitions>?)`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/init(pixelFormatType:size:compatibility:bytesPerRowAlignment:planeAlignment:extendedPixels:attachments:))

### Instance Properties

[`var attachments: CVAttachmentContainer<CVPixelBufferAttachmentKeyDefinitions>?`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/attachments)

Attachments to set on the pixel buffer.

[`var backing: CVPixelBufferCreationAttributes.Backing`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/backing-swift.property)

Defines how the memory for the pixel buffer backing is allocated. IOSurface backed pixel buffers
can be shared between CPU and GPU also across process boundaries.
Defaults to `Backing.ioSurface`.

[`var bytesPerRowAlignment: Int?`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/bytesPerRowAlignment)

The number of bytes per row in the pixel buffer must be a multiple of this number.

[`var compatibility: CVPixelFormatDescription.Compatibility`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/compatibility)

Defines interoperability of pixel buffers with other frameworks

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

Sets the amount of extended pixel padding in the pixel buffer.

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

Format of the pixel buffer bytes

[`var planeAlignment: Int?`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/planeAlignment)

Planes start on a byte number that’s a multiple of this value.

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

Size of the buffer in pixels

### Enumerations

[`enum Backing`](/documentation/CoreVideo/CVPixelBufferCreationAttributes/Backing-swift.enum)

Type of backing storage used by the pixel buffer

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

---

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)