---
title: "permuteChannels(to:destination:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/permutechannels(to:destination:)-8y213"
---

# permuteChannels(to:destination:)

Permutes the channels of an unsigned 16-bit-per-channel, 4-channel interleaved pixel buffer.

## Declaration

```swift
func permuteChannels(to permuteMap: (UInt8, UInt8, UInt8, UInt8), destination: vImage.PixelBuffer<Format>)
```

## Parameters

- `permuteMap`: A tuple of four 8-bit integers with the values 0, 1, 2, and 3, in some order.
- `destination`: The destination pixel buffer.

## Discussion

Discussion For example, the following code reverses the channel ordering of a pixel buffer: let buffer = vImage.PixelBuffer<vImage.Interleaved16Ux4>(     pixelValues: [10, 20, 30, 40],     size: vImage.Size(width: 1,                       height: 1))

buffer.permuteChannels(to: (3, 2, 1, 0),                        destination: buffer)

// Prints "[40, 30, 20, 10]" print(buffer.array)

## See Also

### Permuting Channels

- [permuteChannels(to:destination:)](accelerate/vimage/pixelbuffer/permutechannels(to:destination:)-4y4rh.md)
- [permuteChannels(to:destination:)](accelerate/vimage/pixelbuffer/permutechannels(to:destination:)-tr2h.md)
- [permuteChannels(to:destination:)](accelerate/vimage/pixelbuffer/permutechannels(to:destination:)-74dmh.md)
- [permuteChannels(to:destination:)](accelerate/vimage/pixelbuffer/permutechannels(to:destination:)-6n6yi.md)
