<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImageCVImageFormat/formatCode",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:So22vImageCVImageFormatRefa10AccelerateE10formatCodes6UInt32Vvp"
  },
  "title" : "formatCode"
}
-->

# formatCode

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

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

## Discussion

For example, the following code prints the format code of a <doc://com.apple.documentation/documentation/CoreVideo/kCVPixelFormatType_420YpCbCr8Planar> Core Video image format that equals the expected type:

```swift
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

[`func vImageCVImageFormat_GetFormatCode(vImageConstCVImageFormat) -> UInt32`](/documentation/Accelerate/vImageCVImageFormat_GetFormatCode(_:))

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



---

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)