---
title: CMCountProfileElements
framework: Application Services
role: pseudoSymbol
platforms: []
path: applicationservices/colorsync_manager/1804963-cmcountprofileelements
---

# CMCountProfileElements

Counts the number of elements in the specified profile.

## Declaration

```occ
CMError CMCountProfileElements (
   CMProfileRef prof,
   UInt32 *elementCount
);
```

## Parameters

- `prof`: A profile reference of type [doc://com.apple.documentation/documentation/applicationservices/cmprofileref](applicationservices/cmprofileref.md) to the profile to examine.
- `elementCount`: A pointer to an element count. On return, a one-based count of the number of elements.

## Return Value

A `CMError` value. See [Result Codes](../colorsync_manager.md).

## Overview

Every element in the profile outside the header is counted. A profile may contain tags that are references to other elements. These tags are included in the count. 

## See Also

### Accessing Profile Elements

- [CMProfileElementExists](1804967-cmprofileelementexists.md)
- [CMGetProfileElement](1804973-cmgetprofileelement.md)
- [CMSetProfileElement](1804977-cmsetprofileelement.md)
- [CMSetProfileElementSize](1804980-cmsetprofileelementsize.md)
- [CMGetPartialProfileElement](1804984-cmgetpartialprofileelement.md)
- [CMSetPartialProfileElement](1804989-cmsetpartialprofileelement.md)
- [CMGetIndProfileElementInfo](1804996-cmgetindprofileelementinfo.md)
- [CMGetIndProfileElement](1805002-cmgetindprofileelement.md)
- [CMSetProfileElementReference](1805005-cmsetprofileelementreference.md)
- [CMRemoveProfileElement](1805008-cmremoveprofileelement.md)
