!1346 新增native image接口

Merge pull request !1346 from 李辉/wx0828
This commit is contained in:
openharmony_ci 2024-08-29 13:05:34 +00:00 committed by Gitee
commit 07971f24de
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 36 additions and 0 deletions

View File

@ -22,5 +22,13 @@
{
"first_introduced": "12",
"name": "OH_ConsumerSurface_Create"
},
{
"first_introduced": "13",
"name": "OH_ConsumerSuface_SetDefaultUsage"
},
{
"first_introduced": "13",
"name": "OH_ConsumerSuface_SetDefaultSize"
}
]

View File

@ -300,6 +300,34 @@ int32_t OH_NativeImage_ReleaseNativeWindowBuffer(OH_NativeImage* image,
*/
OH_NativeImage* OH_ConsumerSurface_Create();
/**
* @brief Set the default usage of the <b>OH_NativeImage</b>.\n
* This interface dose not support concurrency.\n
*
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
* @param image Indicates the pointer to a <b>OH_NativeImage</b> instance.
* @param usage Indicates the usage of the <b>OH_NativeImage</b>.Refer to the enum <b>OH_NativeBuffer_Usage</b>.
* @return {@link NATIVE_ERROR_OK} 0 - Success.
* {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image is NULL.
* @since 13
* @version 1.0
*/
int32_t OH_ConsumerSuface_SetDefaultUsage(OH_NativeImage* image, uint64_t usage);
/**
* @brief Set the default size of the <b>OH_NativeImage</b>.\n
* This interface dose not support concurrency.\n
*
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
* @param image Indicates the pointer to a <b>OH_NativeImage</b> instance.
* @param width Indicates the width of the <b>OH_NativeImage</b>, and it should be greater than 0.
* @param height Indicates the height of the <b>OH_NativeImage</b>, and it should be greater than 0.
* @return {@link NATIVE_ERROR_OK} 0 - Success.
* {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image is NULL or width, height less than or equal to 0.
* @since 13
* @version 1.0
*/
int32_t OH_ConsumerSuface_SetDefaultSize(OH_NativeImage* image, int32_t width, int32_t height);
#ifdef __cplusplus
}
#endif