mirror of
https://gitee.com/openharmony/interface_sdk_c
synced 2024-11-23 23:00:30 +00:00
!1013 新增PixelMap Native JS 互转接口
Merge pull request !1013 from duanhan/TS_API
This commit is contained in:
commit
0ff0a0e154
@ -37,6 +37,7 @@
|
||||
#ifndef INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PIXELMAP_NATIVE_H_
|
||||
#define INTERFACES_KITS_NATIVE_INCLUDE_IMAGE_PIXELMAP_NATIVE_H_
|
||||
#include "image_common.h"
|
||||
#include "napi/native_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -399,6 +400,34 @@ Image_ErrorCode OH_PixelmapImageInfo_Release(OH_Pixelmap_ImageInfo *info);
|
||||
Image_ErrorCode OH_PixelmapNative_CreatePixelmap(uint8_t *data, size_t dataLength,
|
||||
OH_Pixelmap_InitializationOptions *options, OH_PixelmapNative **pixelmap);
|
||||
|
||||
/**
|
||||
* @brief Convert a native <b>PixelMap</b> object to <b>PixelMap</b> napi object.
|
||||
*
|
||||
* @param env Indicates the NAPI environment pointer.
|
||||
* @param pixelmapNative Indicates a pointer to the <b>PixelMap</b> object created at the native layer.
|
||||
* @param pixelmapNapi the <b>PixelMap</b> pointer will be converted.
|
||||
* @return Image functions result code.
|
||||
* {@link IMAGE_SUCCESS} if the execution is successful.
|
||||
* {@link IMAGE_BAD_PARAMETER} pixelmapNative is nullptr
|
||||
* @since 12
|
||||
*/
|
||||
Image_ErrorCode OH_PixelmapNative_ConvertPixelmapNativeToNapi(napi_env env, OH_PixelmapNative *pixelmapNative,
|
||||
napi_value *pixelmapNapi);
|
||||
|
||||
/**
|
||||
* @brief Convert a <b>PixelMap</b> napi object to native <b>PixelMap</b> object.
|
||||
*
|
||||
* @param env Indicates the NAPI environment pointer.
|
||||
* @param pixelmapNapi Indicates napi <b>PixelMap</b> object.
|
||||
* @param pixelmapNative Indicates native <b>PixelMap</b> pointer to created.
|
||||
* @return Image functions result code.
|
||||
* {@link IMAGE_SUCCESS} if the execution is successful.
|
||||
* {@link IMAGE_BAD_PARAMETER} pixelmapNative is nullptr, or pixelmapNapi is not a PixelMap
|
||||
* @since 12
|
||||
*/
|
||||
Image_ErrorCode OH_PixelmapNative_ConvertPixelmapNativeFromNapi(napi_env env, napi_value pixelmapNapi,
|
||||
OH_PixelmapNative **pixelmapNative);
|
||||
|
||||
/**
|
||||
* @brief Reads data of this pixel map to an Buffer. If this pixel map is created in the BGRA_8888 format,
|
||||
* the data read is the same as the original data.
|
||||
|
@ -146,5 +146,13 @@
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_PixelmapNative_CreateEmptyPixelmap"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_PixelmapNative_ConvertPixelmapToNapi"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_PixelmapNative_ConvertPixelmapFromNapi"
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue
Block a user