---
title: "vImageCVImageFormat_GetConversionMatrix(_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/vimagecvimageformat_getconversionmatrix(_:_:)"
---

# vImageCVImageFormat_GetConversionMatrix(_:_:)

Returns a pointer to the RGB-to-YpCbCr conversion matrix of a Core Video image format.

## Declaration

```swift
func vImageCVImageFormat_GetConversionMatrix(_ format: vImageConstCVImageFormat, _ outType: UnsafeMutablePointer<vImageMatrixType>!) -> UnsafeRawPointer!
```

## Parameters

- `format`: The Core Video image format to query.
- `outType`: A pointer to a vImageMatrixType.

## Return Value

Return Value A pointer to the conversion matrix.

## Discussion

Discussion The functions that create Core Video image formats, such as vImageCVImageFormat_CreateWithCVPixelBuffer(_:), return a vImageCVImageFormat. The following code shows how you create a vImageConstCVImageFormat representation of a vImageCVImageFormat instance to pass to vImageCVImageFormat_GetConversionMatrix(_:_:): let conversionMatrixPointer = withUnsafeBytes(of: cvImageFormat) { bytes in     var outType = UInt32()          let format = bytes.assumingMemoryBound(         to: vImageConstCVImageFormat.self).first!          return vImageCVImageFormat_GetConversionMatrix(format, &outType) }

## See Also

### Querying and setting the conversion matrix

- [vImageCVImageFormat_CopyConversionMatrix(_:_:_:)](accelerate/vimagecvimageformat_copyconversionmatrix(_:_:_:).md)
