---
title: "overwriteChannels(_:withInterleavedBuffer:destination:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/overwritechannels(_:withinterleavedbuffer:destination:)-8xkd1"
---

# overwriteChannels(_:withInterleavedBuffer:destination:)

Overwrites the pixels of one or more channels of the pixel buffer with the provided 32-bit interleaved pixel buffer.

## Declaration

```swift
func overwriteChannels(_ channels: [UInt8], withInterleavedBuffer buffer: vImage.PixelBuffer<Format>, destination: vImage.PixelBuffer<Format>)
```

## Parameters

- `channels`: An array that contains the indices of the channels that the function overwrites.
- `buffer`: The planar buffer that the function writes to the channels.
- `destination`: The destination pixel buffer.

## Discussion

Discussion Use this function to overwrite one or more channels of an interleaved buffer with an interleaved buffer. The following code overwrites channels 1 and 3 with the values in overwriteValues: let pixelValues: [Pixel_F] = [ 1, 2, 3, 4,                                5, 6, 7, 8 ] let buffer = vImage.PixelBuffer(pixelValues: pixelValues,                                 size: vImage.Size(width: 1,                                                   height: 2),                                 pixelFormat: vImage.InterleavedFx4.self)

let destination = vImage.PixelBuffer(size: vImage.Size(width: 1,                                                        height: 2),                                      pixelFormat: vImage.InterleavedFx4.self)

let overwriteValues: [Pixel_F] = [ 101, 102, 103, 104,                                    105, 106, 107, 108]

let overwriteBuffer = vImage.PixelBuffer<vImage.Interleaved8x4>(pixelValues: overwriteValues,                                                                 size: vImage.Size(width: 1,                                                                                   height: 2))

buffer.overwriteChannels([3, 1],                          withInterleavedBuffer: overwriteBuffer,                          destination: destination) On return, destination.array contains the following values: [ 1, 102, 3, 104,     5, 106, 7, 108 ]

## See Also

### Overwriting Channels

- [overwriteChannels(withScalar:)](accelerate/vimage/pixelbuffer/overwritechannels(withscalar:)-3zb93.md)
- [overwriteChannels(withScalar:)](accelerate/vimage/pixelbuffer/overwritechannels(withscalar:)-1hrrg.md)
- [overwriteChannels(withScalar:)](accelerate/vimage/pixelbuffer/overwritechannels(withscalar:)-1wm1o.md)
- [overwriteChannels(_:withScalar:destination:)](accelerate/vimage/pixelbuffer/overwritechannels(_:withscalar:destination:)-57ov2.md)
- [overwriteChannels(_:withScalar:destination:)](accelerate/vimage/pixelbuffer/overwritechannels(_:withscalar:destination:)-ev8q.md)
- [overwriteChannels(_:withPixel:destination:)](accelerate/vimage/pixelbuffer/overwritechannels(_:withpixel:destination:)-6fab6.md)
- [overwriteChannels(_:withPixel:destination:)](accelerate/vimage/pixelbuffer/overwritechannels(_:withpixel:destination:)-6zw3o.md)
- [overwriteChannels(_:withPixel:destination:)](accelerate/vimage/pixelbuffer/overwritechannels(_:withpixel:destination:)-6pbz8.md)
- [overwriteChannels(_:withPlanarBuffer:destination:)](accelerate/vimage/pixelbuffer/overwritechannels(_:withplanarbuffer:destination:)-9jbky.md)
- [overwriteChannels(_:withPlanarBuffer:destination:)](accelerate/vimage/pixelbuffer/overwritechannels(_:withplanarbuffer:destination:)-hiw0.md)
- [overwriteChannels(_:withInterleavedBuffer:destination:)](accelerate/vimage/pixelbuffer/overwritechannels(_:withinterleavedbuffer:destination:)-74hah.md)
