---
title: hi_mpi_rgn_create
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/dvpp/aclcppdevg_03_0545.html
sourcePath: /source/zh/canncommercial/900/API/dvpp/aclcppdevg_03_0545.html
indexId: 40c17f7be1a711f6dc6bb382f1db7491549f15da9ad20251caf56e6ee27e3f8e62
---
# hi_mpi_rgn_create

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | ☓ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | ☓ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | ☓ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | ☓ |
| Atlas 训练系列产品 | ☓ |


#### 功能说明

创建不同类型的区域。

Atlas 200I/500 A2 推理产品 的 Ascend EP 形态下，不支持使用该接口。


#### 函数原型

```
hi_s32
hi_mpi_rgn_create(
hi_rgn_handle
handle, const
hi_rgn_attr
*rgn_attr)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| handle | 输入 | 区域句柄号。 必须是未使用的handle号，由用户指定，意义等同于ID号。 取值范围：[0, 1024)。 |
| rgn\_attr | 输入 | 区域属性指针，不能为空。 此处仅设置像素格式、区域宽高等属性，其它区域属性，如区域位置、层次等，需调用hi\_mpi\_rgn\_attach\_to\_chn接口时指定。 |


#### 返回值说明

- 0：获取数据成功
- 非0：失败，参见  19.18.5-区域管理返回码


#### 约束说明

- 不支持重复创建。
- 创建区域时，本接口只进行基本的参数的检查，譬如：最小宽高，最大宽高等；当调用  hi_mpi_rgn_attach_to_chn
接口将区域叠加到通道上时，根据各通道模块支持类型的约束条件进行更加有针对性的参数检查，譬如支持的像素格式等。


#### 参考资源

接口调用流程，参见NVR场景视频解码、处理和显示(https://www.hiascend.com/document/detail/zh/canncommercial/900/programug/acldevg/aclcppdevg_000067.html)。
