---
title: formatCode
framework: accelerate
role: symbol
role_heading: Instance Property
path: accelerate/vimagecvimageformat/formatcode
---

# formatCode

The four-character code that encodes the pixel format of the Core Video image format.

## Declaration

```swift
var formatCode: UInt32 { get }
```

## Discussion

Discussion For example, the following code prints the format code of a kCVPixelFormatType_420YpCbCr8Planar Core Video image format that equals the expected type: let cvImageFormat = vImageCVImageFormat.make(     format: .format420YpCbCr8Planar,     matrix: kvImage_ARGBToYpCbCrMatrix_ITU_R_709_2.pointee,     chromaSiting: .center,     colorSpace: CGColorSpace(name: CGColorSpace.sRGB)!,     alphaIsOpaqueHint: true)!

// Prints "true". print(cvImageFormat.formatCode == kCVPixelFormatType_420YpCbCr8Planar)

## See Also

### Related Documentation

- [vImageCVImageFormat_GetFormatCode(_:)](accelerate/vimagecvimageformat_getformatcode(_:).md)

### Inspecting a Core Video image format’s properties

- [channelCount](accelerate/vimagecvimageformat/channelcount.md)
- [channels](accelerate/vimagecvimageformat/channels.md)
- [channelDescription(bufferType:)](accelerate/vimagecvimageformat/channeldescription(buffertype:).md)
- [chromaSiting](accelerate/vimagecvimageformat/chromasiting-swift.property.md)
- [colorSpace](accelerate/vimagecvimageformat/colorspace.md)
- [alphaIsOpaqueHint](accelerate/vimagecvimageformat/alphaisopaquehint.md)
