<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.3.0 -",
    "tvOS: 5.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImageConvert_ChunkyToPlanarF(_:_:_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vImageConvert_ChunkyToPlanarF"
  },
  "title" : "vImageConvert_ChunkyToPlanarF(_:_:_:_:_:_:_:_:)"
}
-->

# vImageConvert_ChunkyToPlanarF(_:_:_:_:_:_:_:_:)

Deinterleaves a floating-point 32-bit-per-channel interleaved buffer with an arbitrary number of channels into the corresponding number of 32-bit planar buffers.

```
func vImageConvert_ChunkyToPlanarF(_ srcChannels: UnsafeMutablePointer<UnsafeRawPointer?>, _ destPlanarBuffers: UnsafeMutablePointer<UnsafePointer<vImage_Buffer>?>, _ channelCount: UInt32, _ srcStrideBytes: Int, _ srcWidth: vImagePixelCount, _ srcHeight: vImagePixelCount, _ srcRowBytes: Int, _ flags: vImage_Flags) -> vImage_Error
```

## Parameters

`srcChannels`

An array that contains pointers to the start of each channel in the source buffer.

`destPlanarBuffers`

An array that contains `channelCount` destination planar vImage buffers. Each source buffer must be the same height and width, but they may have different [`rowBytes`](/documentation/Accelerate/vImage_Buffer/rowBytes) values.

`channelCount`

The number of channels in the source image.

`srcStrideBytes`

The number of bytes between consecutive pixels in a channel in the same row.

`srcWidth`

The width, in pixels, of the source channels and the destination planar buffers.

`srcHeight`

The height, in pixels, of the source channels and the destination planar buffers.

`srcRowBytes`

The distance, in bytes, between the corresponding pixels in consecutive rows in the source buffer, including any unused space between them.

`flags`

The options to use when performing the operation. If your code implements its own tiling or its own multithreading, pass [`kvImageDoNotTile`](/documentation/Accelerate/kvImageDoNotTile); otherwise, pass [`kvImageNoFlags`](/documentation/Accelerate/kvImageNoFlags).

## Return Value

[`kvImageNoError`](/documentation/Accelerate/kvImageNoError); otherwise, one of the error codes in <doc://com.apple.documentation/documentation/Accelerate/data-types-and-constants>.

## Discussion

Use this function to deinterleave formats that either aren’t supported by the vImage library or are only known at runtime.

The following code interleaves a 4 x 1 interleaved 2-channel buffer into two 4 x 1 planar buffers:

```swift
let width = 4
let height = 1
let size = vImage.Size(width: width,
                       height: height)

let cbCrBuffer = vImage.PixelBuffer(pixelValues: [10, 20,   11, 21,   12, 22,   13, 23],
                                    size: size,
                                    pixelFormat: vImage.InterleavedFx2.self)

let cbBuffer = vImage.PixelBuffer(size: size,
                                  pixelFormat: vImage.PlanarF.self)

let crBuffer = vImage.PixelBuffer(size: size,
                                  pixelFormat: vImage.PlanarF.self)

cbCrBuffer.withUnsafeVImageBuffer { cbcr in
    cbBuffer.withUnsafePointerToVImageBuffer { cb in
        crBuffer.withUnsafePointerToVImageBuffer { cr in
            
            var srcChannels = [
                UnsafeRawPointer(cbcr.data),
                UnsafeRawPointer(cbcr.data.advanced(by: MemoryLayout<Pixel_F>.stride))
            ]
            
            var dstPlanarBuffers = [Optional(cb), Optional(cr)]
            
            let channelCount = 2
            
            _ = vImageConvert_ChunkyToPlanarF(
                &srcChannels,
                &dstPlanarBuffers,
                UInt32(channelCount),
                MemoryLayout<Pixel_F>.stride * channelCount,
                vImagePixelCount(width),
                vImagePixelCount(height),
                cbcr.rowBytes,
                vImage_Flags(kvImageNoFlags))
            
        }
    }
}

// Prints "[10.0, 11.0,    12.0, 13.0]".
print(cbBuffer.array)

// Prints "[20.0, 21.0,    22.0, 23.0]".
print(crBuffer.array)
```

---

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)