1# image_pixel_map_napi.h 2 3 4## Overview 5 6Declares the APIs that can lock, access, and unlock pixel map data. 7 8**Since:** 98 10 11**Related Modules:** 12 13[Image](image.md) 14 15 16## Summary 17 18 19### Structs 20 21| Name | Description | 22| -------- | -------- | 23| [OhosPixelMapInfo](_ohos_pixel_map_info.md) | Defines the pixel map information. | 24| [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md) |Defines the options used for creating a pixel map. | 25 26### Types 27 28| Name | Description | 29| -------- | -------- | 30| [NativePixelMap](image.md#nativepixelmap) | Defines the data type name of the native pixel map. | 31 32### Enums 33 34| Name | Description | 35| -------- | -------- | 36| { OHOS_IMAGE_RESULT_SUCCESS = 0, OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | Enumerates the error codes returned by a function. | 37| { OHOS_PIXEL_MAP_FORMAT_NONE = 0, OHOS_PIXEL_MAP_FORMAT_RGBA_8888 = 3, OHOS_PIXEL_MAP_FORMAT_RGB_565 = 2 } | Enumerates the pixel formats. | 38| { 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. | 39| { OHOS_PIXEL_MAP_SCALE_MODE_FIT_TARGET_SIZE = 0, OHOS_PIXEL_MAP_SCALE_MODE_CENTER_CROP = 1 } | Enumerates the pixel map scale modes. | 40| { OHOS_PIXEL_MAP_READ_ONLY = 0, OHOS_PIXEL_MAP_EDITABLE = 1 } | Enumerates the pixel map editing types. | 41 42 43### Functions 44 45| Name | Description | 46| -------- | -------- | 47| [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. | 48| [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. | 49| [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. | 50 51 52### Variables 53 54| Name | Description | 55| -------- | -------- | 56| [width](#width) | Image width, in pixels. | 57| [height](#height) | Image height, in pixels. | 58| [pixelFormat](#pixelformat) | Image format. | 59| [editable](#editable) | Editing type of the image. | 60| [alphaType](#alphatype) | Alpha type of the image. | 61| [scaleMode](#scalemode) | Scale mode of the image. | 62 63 64## Variable Description 65 66 67### alphaType 68 69 70``` 71uint32_t alphaType 72``` 73**Description:** 74Alpha type of the image. 75 76 77### editable 78 79 80``` 81uint32_t editable 82``` 83**Description:** 84Editing type of the image. 85 86 87### height 88 89 90``` 91uint32_t height 92``` 93**Description:** 94Image height, in pixels. 95 96 97### pixelFormat 98 99 100``` 101int32_t pixelFormat 102``` 103**Description:** 104Image format. 105 106 107### scaleMode 108 109 110``` 111uint32_t scaleMode 112``` 113**Description:** 114Scale mode of the image. 115 116 117### width 118 119 120``` 121uint32_t width 122``` 123**Description:** 124Image width, in pixels. 125