---
title: CMSetProfileElementSize
framework: Application Services
role: pseudoSymbol
platforms: []
path: applicationservices/colorsync_manager/1804980-cmsetprofileelementsize
---

# CMSetProfileElementSize

Reserves the element data size for a specific tag in the specified profile before setting the element data. 

## Declaration

```occ
CMError CMSetProfileElementSize (
   CMProfileRef prof,
   OSType tag,
   UInt32 elementSize
);
```

## Parameters

- `prof`: A profile reference of type [doc://com.apple.documentation/documentation/applicationservices/cmprofileref](applicationservices/cmprofileref.md) to the profile in which the element data size is reserved.
- `tag`: The tag signature for the element whose size is reserved. The tag identifies the element. For a complete list of the tag signatures a profile may contain, including a description of each tag, refer to the International Color Consortium Profile Format Specification. The signatures for profile tags are defined in the `CMICCProfile.h` header file.
- `elementSize`: The total size in bytes to reserve for the element data.

## Return Value

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

## Overview

Your application can use the `CMSetProfileElementSize` function to reserve the size of element data for a specific tag before you call the function [CMGetPartialProfileElement](1804984-cmgetpartialprofileelement.md) to set the element data. The most efficient way to set a large amount of element data when you know the size of the data is to first set the size, then call the `CMSetPartialProfileElement` function to set each of the data segments. Calling the `CMSetProfileElementSize` function first eliminates the need for the ColorSync Manager to repeatedly increase the size for the data each time you call the `CMSetPartialProfileElement` function. 

In addition to reserving the element data size, the `CMSetProfileElementSize` function sets the element tag, if it does not already exist. 

## See Also

### Accessing Profile Elements

- [CMCountProfileElements](1804963-cmcountprofileelements.md)
- [CMProfileElementExists](1804967-cmprofileelementexists.md)
- [CMGetProfileElement](1804973-cmgetprofileelement.md)
- [CMSetProfileElement](1804977-cmsetprofileelement.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)
