---
title: "vImageCGImageFormat_GetComponentCount(_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/vimagecgimageformat_getcomponentcount(_:)"
---

# vImageCGImageFormat_GetComponentCount(_:)

Calculates the number of color and alpha channels for a specified image format.

## Declaration

```swift
func vImageCGImageFormat_GetComponentCount(_ format: UnsafePointer<vImage_CGImageFormat>) -> UInt32
```

## Parameters

- `format`: A valid doc://com.apple.accelerate/documentation/Accelerate/vImage_CGImageFormat structure.

## Return Value

Return Value The number of color and alpha channels in the image.

## See Also

### Querying Core Graphics image format attributes

- [vImageCGImageFormat_IsEqual(_:_:)](accelerate/vimagecgimageformat_isequal(_:_:).md)
