未验证 提交 7186f885 编写于 作者: Z zengyawen 提交者: Gitee

add nativeapis

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 0abd4c83
......@@ -21,7 +21,13 @@ Declares the APIs that can lock, access, and unlock pixel map data.
| Name | Description |
| -------- | -------- |
| [OhosPixelMapInfo](_ohos_pixel_map_info.md) | Defines the pixel map information. |
| [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md) |Defines the options used for creating a pixel map. |
### Types
| Name | Description |
| -------- | -------- |
| [NativePixelMap](image.md#nativepixelmap) | Defines the data type name of the native pixel map. |
### Enums
......@@ -29,6 +35,9 @@ Declares the APIs that can lock, access, and unlock pixel map data.
| -------- | -------- |
| { OHOS_IMAGE_RESULT_SUCCESS = 0, OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | Enumerates the error codes returned by a function. |
| { OHOS_PIXEL_MAP_FORMAT_NONE = 0, OHOS_PIXEL_MAP_FORMAT_RGBA_8888 = 3, OHOS_PIXEL_MAP_FORMAT_RGB_565 = 2 } | Enumerates the pixel formats. |
| { OHOS_PIXEL_MAP_ALPHA_TYPE_UNKNOWN = 0, OHOS_PIXEL_MAP_ALPHA_TYPE_OPAQUE = 1, OHOS_PIXEL_MAP_ALPHA_TYPE_PREMUL = 2, OHOS_PIXEL_MAP_ALPHA_TYPE_UNPREMUL = 3 } | Enumerates the pixel map alpha types. |
| { OHOS_PIXEL_MAP_SCALE_MODE_FIT_TARGET_SIZE = 0, OHOS_PIXEL_MAP_SCALE_MODE_CENTER_CROP = 1 } | Enumerates the pixel map scale modes. |
| { OHOS_PIXEL_MAP_READ_ONLY = 0, OHOS_PIXEL_MAP_EDITABLE = 1 } | Enumerates the pixel map editing types. |
### Functions
......@@ -38,3 +47,78 @@ Declares the APIs that can lock, access, and unlock pixel map data.
| [OH_GetImageInfo](image.md#oh_getimageinfo) (napi_env env, napi_value value, [OhosPixelMapInfo](_ohos_pixel_map_info.md) \*info) | Obtains the **PixelMap** information and stores the information to the [OhosPixelMapInfo](_ohos_pixel_map_info.md) structure. |
| [OH_AccessPixels](image.md#oh_accesspixels) (napi_env env, napi_value value, void \*\*addrPtr) | Obtains the memory address of the **PixelMap** object data and locks the memory. |
| [OH_UnAccessPixels](image.md#oh_unaccesspixels) (napi_env env, napi_value value) | Unlocks the memory of the **PixelMap** object data. This function is used with [OH_AccessPixels](image.md#oh_accesspixels) in pairs. |
### Variables
| Name | Description |
| -------- | -------- |
| [width](#width) | Image width, in pixels. |
| [height](#height) | Image height, in pixels. |
| [pixelFormat](#pixelformat) | Image format. |
| [editable](#editable) | Editing type of the image. |
| [alphaType](#alphatype) | Alpha type of the image. |
| [scaleMode](#scalemode) | Scale mode of the image. |
## Variable Description
### alphaType
```
uint32_t alphaType
```
**Description:**
Alpha type of the image.
### editable
```
uint32_t editable
```
**Description:**
Editing type of the image.
### height
```
uint32_t height
```
**Description:**
Image height, in pixels.
### pixelFormat
```
int32_t pixelFormat
```
**Description:**
Image format.
### scaleMode
```
uint32_t scaleMode
```
**Description:**
Scale mode of the image.
### width
```
uint32_t width
```
**Description:**
Image width, in pixels.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册