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

# CVPixelFormatDescription.PixelLayout

Defines pixel layout of a buffer plane or the entire buffer if the format is non-planar.

```
struct PixelLayout
```

## Overview

Note: The value of [`fillExtendedPixels`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/fillExtendedPixels) property is ignored when comparing two pixel layouts for equality.

## Topics

### Initializers

[`init(blockSize: CVImageSize, bitsPerBlock: Int, bitsPerComponent: Int?, blockAlignment: CVPixelFormatDescription.Dimensions, subsampling: CVPixelFormatDescription.Dimensions, blackBlock: Data?, fillExtendedPixels: ((inout CVMutablePixelBuffer) -> Void)?, cgBitmapInfo: CGBitmapInfo?)`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/init(blockSize:bitsPerBlock:bitsPerComponent:blockAlignment:subsampling:blackBlock:fillExtendedPixels:cgBitmapInfo:))

### Instance Properties

[`var bitsPerBlock: Int`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/bitsPerBlock)

Number of bits per pixel. If [`blockSize`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/blockSize) is greater than (1, 1) then this represents bits per block.

[`var bitsPerComponent: Int?`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/bitsPerComponent)

The logical bit depth of each component of the plane.

[`var blackBlock: Data?`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/blackBlock)

The bit pattern for a block of black pixels.  If absent, black is assumed to be all zeros.
Otherwise, this should be [`bitsPerBlock`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/bitsPerBlock) bits long. If bitsPerBlock is less than a byte, repeat the bit
pattern for the full byte.

[`var blockAlignment: CVPixelFormatDescription.Dimensions`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/blockAlignment)

Alignment requirements on block multiples. v210 would be (8, 1) here for the horizontal case,
to match the standard v210 row alignment value of 48.

[`var blockSize: CVImageSize`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/blockSize)

Used to assist with allocating memory for pixel formats that don’t have an integer value for bytes per pixel.
Block width/height is essentially the width/height in pixels of the smallest “byte addressable” group of pixels.
This works in close conjunction with [`bitsPerBlock`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/bitsPerBlock).
Examples:
8-bit luminance only, blockSize.width would be 1, bitsPerBlock would be 8
16-bit 1555 RGB, blockSize.width would be 1, bitsPerBlock would be 16
32-bit 8888 ARGB, blockSize.width would be 1, bitsPerBlock would be 32
2vuy (CbYCrY), blockSize.width would be 2, bitsPerBlock would be 32
1-bit bitmap, blockSize.width would be 8, bitsPerBlock would be 8
v210, blockSize.width would be 6, bitsPerBlock would be 128

[`var cgBitmapInfo: CGBitmapInfo?`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/cgBitmapInfo)

CoreGraphics bitmap info used for CG compatibility.

[`var fillExtendedPixels: ((inout CVMutablePixelBuffer) -> Void)?`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/fillExtendedPixels)

Callback which can replicate edge pixels to the extended pixels.

[`var subsampling: CVPixelFormatDescription.Dimensions`](/documentation/CoreVideo/CVPixelFormatDescription/PixelLayout/subsampling)

Pixel subsampling for this plane.

## Relationships

### Conforms To

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

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

[`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)