提交 9bb7abc1 编写于 作者: G Gloria

Update docs against 21596+21748+21628

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 bae87b24
......@@ -24,11 +24,13 @@
- [AVDemuxer](_a_v_demuxer.md)
- [AVSource](_a_v_source.md)
- [OHAudio](_o_h_audio.md)
- [AVScreenCapture](_a_v_screen_capture.md)
- [HuksKeyApi](_huks_key_api.md)
- [HuksParamSetApi](_huks_param_set_api.md)
- [HuksTypeApi](_huks_type_api.md)
- [Init](init.md)
- [Memory](memory.md)
- [UsbDdk](_usb_ddk.md)
- [Hitrace](_hitrace.md)
- [Vulkan](_vulkan.md)
- Header Files
......@@ -43,7 +45,12 @@
- [drawing_text_typography.h](drawing__text__typography_8h.md)
- [drawing_types.h](drawing__types_8h.md)
- [external_window.h](external__window_8h.md)
- [image_mdk.h](image__mdk_8h.md)
- [image_mdk_common.h](image__mdk__common_8h.md)
- [image_pixel_map_mdk.h](image__pixel__map__mdk_8h.md)
- [image_pixel_map_napi.h](image__pixel__map__napi_8h.md)
- [image_receiver_mdk.h](image__receiver__mdk_8h.md)
- [image_source_mdk.h](image__source__mdk_8h.md)
- [log.h](log_8h.md)
- [native_buffer.h](native__buffer_8h.md)
- [native_image.h](native__image_8h.md)
......@@ -79,6 +86,9 @@
- [native_audiorenderer.h](native__audiorenderer_8h.md)
- [native_audiostream_base.h](native__audiostream__base_8h.md)
- [native_audiostreambuilder.h](native__audiostreambuilder_8h.md)
- [native_avscreen_capture.h](native__avscreen__capture_8h.md)
- [native_avscreen_capture_base.h](native__avscreen__capture__base_8h.md)
- [native_avscreen_capture_errors.h](native__avscreen__capture__errors_8h.md)
- [native_huks_api.h](native__huks__api_8h.md)
- [native_huks_param.h](native__huks__param_8h.md)
- [native_huks_type.h](native__huks__type_8h.md)
......@@ -90,6 +100,8 @@
- [relational_store.h](relational__store_8h.md)
- [syscap_ndk.h](syscap__ndk_8h.md)
- [purgeable_memory.h](purgeable__memory_8h.md)
- [usb_ddk_api.h](usb__ddk__api_8h.md)
- [usb_ddk_types.h](usb__ddk__types_8h.md)
- [trace.h](trace_8h.md)
- [vulkan_ohos.h](vulkan__ohos_8h.md)
- Structs
......@@ -102,8 +114,23 @@
- [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md)
- [OHExtDataHandle](_o_h_ext_data_handle.md)
- [OHHDRMetaData](_o_h_h_d_r_meta_data.md)
- [OHOS::Media::OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md)
- [OHOS::Media::OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md)
- [OHOS::Media::OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md)
- [OhosImageDecodingOps](_ohos_image_decoding_ops.md)
- [OhosImageReceiverInfo](_ohos_image_receiver_info.md)
- [OhosImageRegion](_ohos_image_region.md)
- [OhosImageSize](_ohos_image_size.md)
- [OhosImageSource](_ohos_image_source.md)
- [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md)
- [OhosImageSourceInfo](_ohos_image_source_info.md)
- [OhosImageSourceOps](_ohos_image_source_ops.md)
- [OhosImageSourceProperty](_ohos_image_source_property.md)
- [OhosImageSourceSupportedFormat](_ohos_image_source_supported_format.md)
- [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md)
- [OhosImageSourceUpdateData](_ohos_image_source_update_data.md)
- [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md)
- [OhosPixelMapInfo](_ohos_pixel_map_info.md)
- [OhosPixelMapInfos](_ohos_pixel_map_infos.md)
- [RawFileDescriptor](_raw_file_descriptor.md)
- [Region](_region.md)
- [Rect](_rect.md)
......@@ -119,6 +146,17 @@
- [OH_AVRange](_o_h___a_v_range.md)
- [OH_AudioCapturer_Callbacks_Struct](_o_h___audio_capturer___callbacks___struct.md)
- [OH_AudioRenderer_Callbacks_Struct](_o_h___audio_renderer___callbacks___struct.md)
- [OH_AudioBuffer](_o_h___audio_buffer.md)
- [OH_AudioCaptureInfo](_o_h___audio_capture_info.md)
- [OH_AudioEncInfo](_o_h___audio_enc_info.md)
- [OH_AudioInfo](_o_h___audio_info.md)
- [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md)
- [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md)
- [OH_RecorderInfo](_o_h___recorder_info.md)
- [OH_Rect](_o_h___rect.md)
- [OH_VideoCaptureInfo](_o_h___video_capture_info.md)
- [OH_VideoEncInfo](_o_h___video_enc_info.md)
- [OH_VideoInfo](_o_h___video_info.md)
- [OH_Huks_Blob](_o_h___huks___blob.md)
- [OH_Huks_CertChain](_o_h___huks___cert_chain.md)
- [OH_Huks_KeyInfo](_o_h___huks___key_info.md)
......@@ -137,6 +175,17 @@
- [OH_Rdb_Store](_o_h___rdb___store.md)
- [OH_VBucket](_o_h___v_bucket.md)
- [OH_VObject](_o_h___v_object.md)
- [UsbConfigDescriptor](_usb_config_descriptor.md)
- [UsbControlRequestSetup](_usb_control_request_setup.md)
- [UsbDdkConfigDescriptor](_usb_ddk_config_descriptor.md)
- [UsbDdkEndpointDescriptor](_usb_ddk_endpoint_descriptor.md)
- [UsbDdkInterface](_usb_ddk_interface.md)
- [UsbDdkInterfaceDescriptor](_usb_ddk_interface_descriptor.md)
- [UsbDeviceDescriptor](_usb_device_descriptor.md)
- [UsbDeviceMemMap](_usb_device_mem_map.md)
- [UsbEndpointDescriptor](_usb_endpoint_descriptor.md)
- [UsbInterfaceDescriptor](_usb_interface_descriptor.md)
- [UsbRequestPipe](_usb_request_pipe.md)
- [VkExternalFormatOHOS](_vk_external_format_o_h_o_s.md)
- [VkImportNativeBufferInfoOHOS](_vk_import_native_buffer_info_o_h_o_s.md)
- [VkMemoryGetNativeBufferInfoOHOS](_vk_memory_get_native_buffer_info_o_h_o_s.md)
......
# AVScreenCapture
## Overview
The **AVScreenCapture** module provides APIs for screen capture.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
## Summary
### Files
| Name| Description|
| -------- | -------- |
| [native_avscreen_capture.h](native__avscreen__capture_8h.md) | Declares the native APIs used to create an **OH_AVScreenCapture** instance.<br>**File to include**: <multimedia/player_framework/native_avscreen_capture.h> <br>**Library**: libnative_avscreen_capture.so|
| [native_avscreen_capture_base.h](native__avscreen__capture__base_8h.md) | Declares the common structs, character constants, and enums used for running screen capture.<br>**File to include**: <multimedia/player_framework/native_avscreen_capture_base.h><br>**Library**: libnative_avscreen_capture.so|
| [native_avscreen_capture_errors.h](native__avscreen__capture__errors_8h.md) | Declares the error codes generated during screen capture.<br>**File to include**: <multimedia/player_framework/native_avscreen_capture_errors.h><br>**Library**: libnative_avscreen_capture.so|
### Structs
| Name| Description|
| -------- | -------- |
| [OH_AudioCaptureInfo](_o_h___audio_capture_info.md) | Defines audio capture information.|
| [OH_AudioEncInfo](_o_h___audio_enc_info.md) | Defines audio encoding information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_AudioInfo](_o_h___audio_info.md) | Defines audio capture parameters.|
| [OH_VideoCaptureInfo](_o_h___video_capture_info.md) | Defines video capture information.|
| [OH_VideoEncInfo](_o_h___video_enc_info.md) | Defines video encoding information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_VideoInfo](_o_h___video_info.md) | Defines video capture parameters.|
| [OH_RecorderInfo](_o_h___recorder_info.md) | Defines recording file information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) | Defines the screen capture configuration.|
| [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.|
| [OH_Rect](_o_h___rect.md) | Defines the width, height, and image information of the rectangle used for screen capture.|
| [OH_AudioBuffer](_o_h___audio_buffer.md) | Defines the configuration such as the size, type, and timestamp of audio data.|
### Types
| Name| Description|
| -------- | -------- |
| [OH_NativeBuffer](#oh_nativebuffer) | Defines the native video stream class for screen capture.|
| [OH_AVScreenCapture](#oh_avscreencapture) | Defines a screen capture instance used to obtain original video and audio streams.|
| [OH_CaptureMode](#oh_capturemode) | Defines an enum that enumerates the screen capture modes.|
| [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) | Defines an enum that enumerates the audio source types during screen capture.|
| [OH_AudioCodecFormat](#oh_audiocodecformat) | Defines an enum that enumerates the audio encoding formats.|
| [OH_VideoCodecFormat](#oh_videocodecformat) | Defines an enum that enumerates the video encoding formats.|
| [OH_DataType](#oh_datatype) | Defines an enum that enumerates the data types of screen capture streams.|
| [OH_VideoSourceType](#oh_videosourcetype) | Defines an enum that enumerates the video source formats.|
| [OH_ContainerFormatType](#oh_containerformattype) | Defines an enum that enumerates the types of files generated during screen capture.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_AudioCaptureInfo](#oh_audiocaptureinfo) | Defines audio capture information.|
| [OH_AudioEncInfo](#oh_audioencinfo) | Defines audio encoding information.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_AudioInfo](#oh_audioinfo) | Defines audio capture parameters.|
| [OH_VideoCaptureInfo](#oh_videocaptureinfo) | Defines video capture information.|
| [OH_VideoEncInfo](#oh_videoencinfo) | Defines video encoding information.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_VideoInfo](#oh_videoinfo) | Defines video capture parameters.|
| [OH_RecorderInfo](#oh_recorderinfo) | Defines recording file information.|
| [OH_AVScreenCaptureConfig](#oh_avscreencaptureconfig) | Defines the screen capture configuration.|
| (\*[OH_AVScreenCaptureOnError](#oh_avscreencaptureonerror)) ([OH_AVScreenCapture](#oh_avscreencapture) \*capture, int32_t errorCode) | Defines a pointer to a callback function that is called when an error occurs during the running of an **OH_AVScreenCapture** instance.|
| (\*[OH_AVScreenCaptureOnAudioBufferAvailable](#oh_avscreencaptureonaudiobufferavailable)) ([OH_AVScreenCapture](#oh_avscreencapture) \*capture, bool isReady, [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) type) | Defines a pointer to a callback function that is called when an audio buffer is available during the running of an **OH_AVScreenCapture** instance.|
| (\*[OH_AVScreenCaptureOnVideoBufferAvailable](#oh_avscreencaptureonvideobufferavailable)) ([OH_AVScreenCapture](#oh_avscreencapture) \*capture, bool isReady) | Defines a pointer to a callback function that is called when a video buffer is available during the running of an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCaptureCallback](#oh_avscreencapturecallback) | Defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.|
| [OH_Rect](#oh_rect) | Defines the width, height, and image information of the rectangle used for screen capture.|
| [OH_AudioBuffer](#oh_audiobuffer) | Defines the configuration such as the size, type, and timestamp of audio data.|
| [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) | Defines an enum that enumerates the error codes generated during screen recording.|
### Enums
| Name| Description|
| -------- | -------- |
| [OH_CaptureMode](#oh_capturemode) { OH_CAPTURE_HOME_SCREEN = 0, OH_CAPTURE_SPECIFIED_SCREEN = 1, OH_CAPTURE_SPECIFIED_WINDOW = 2, OH_CAPTURE_INVAILD = -1 } | Enumerates the screen capture modes.|
| [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) {<br>OH_SOURCE_INVALID = -1, OH_SOURCE_DEFAULT = 0, OH_MIC = 1, OH_ALL_PLAYBACK = 2,<br>OH_APP_PLAYBACK = 3<br>} | Enumerates the audio source types during screen capture.|
| [OH_AudioCodecFormat](#oh_audiocodecformat) { OH_AUDIO_DEFAULT = 0, OH_AAC_LC = 3, OH_AUDIO_CODEC_FORMAT_BUTT } | Enumerates the audio encoding formats.|
| [OH_VideoCodecFormat](#oh_videocodecformat) {<br>OH_VIDEO_DEFAULT = 0, OH_H264 = 2, OH_H265 = 4, OH_MPEG4 = 6,<br>OH_VP8 = 8, OH_VP9 = 10, OH_VIDEO_CODEC_FORMAT_BUTT<br>} | Enumerates the video encoding formats.|
| [OH_DataType](#oh_datatype) { OH_ORIGINAL_STREAM = 0, OH_ENCODED_STREAM = 1, OH_CAPTURE_FILE = 2, OH_INVAILD = -1 } | Enumerates the data types of screen capture streams.|
| [OH_VideoSourceType](#oh_videosourcetype) { OH_VIDEO_SOURCE_SURFACE_YUV = 0, OH_VIDEO_SOURCE_SURFACE_ES, OH_VIDEO_SOURCE_SURFACE_RGBA, OH_VIDEO_SOURCE_BUTT } | Enumerates the video source formats.|
| [OH_ContainerFormatType](#oh_containerformattype) { CFT_MPEG_4A = 0, CFT_MPEG_4 = 1 } | Enumerates the types of files generated during screen capture.<br>**NOTE**: This enum is reserved and will be provided in later versions.|
| [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) {<br>AV_SCREEN_CAPTURE_ERR_BASE = 0, AV_SCREEN_CAPTURE_ERR_OK = AV_SCREEN_CAPTURE_ERR_BASE, AV_SCREEN_CAPTURE_ERR_NO_MEMORY = AV_SCREEN_CAPTURE_ERR_BASE + 1, AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT = AV_SCREEN_CAPTURE_ERR_BASE + 2,<br>AV_SCREEN_CAPTURE_ERR_INVALID_VAL = AV_SCREEN_CAPTURE_ERR_BASE + 3, AV_SCREEN_CAPTURE_ERR_IO = AV_SCREEN_CAPTURE_ERR_BASE + 4, AV_SCREEN_CAPTURE_ERR_TIMEOUT = AV_SCREEN_CAPTURE_ERR_BASE + 5, AV_SCREEN_CAPTURE_ERR_UNKNOWN = AV_SCREEN_CAPTURE_ERR_BASE + 6,<br>AV_SCREEN_CAPTURE_ERR_SERVICE_DIED = AV_SCREEN_CAPTURE_ERR_BASE + 7, AV_SCREEN_CAPTURE_ERR_INVALID_STATE = AV_SCREEN_CAPTURE_ERR_BASE + 8, AV_SCREEN_CAPTURE_ERR_UNSUPPORT = AV_SCREEN_CAPTURE_ERR_BASE + 9, AV_SCREEN_CAPTURE_ERR_EXTEND_START = AV_SCREEN_CAPTURE_ERR_BASE + 100<br>} | Enumerates the error codes generated during screen recording.|
### Functions
| Name| Description|
| -------- | -------- |
| [OH_AVScreenCapture_Create](#oh_avscreencapture_create) (void) | Creates an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCapture_Init](#oh_avscreencapture_init) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture, [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) config) | Initializes parameters related to an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCapture_StartScreenCapture](#oh_avscreencapture_startscreencapture) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Starts screen capture and collects original streams. After calling this function, the application can use the callback listeners **OH_AVScreenCaptureOnAudioBufferAvailable** and **OH_AVScreenCaptureOnVideoBufferAvailable** to check whether streams are generated.|
| [OH_AVScreenCapture_StopScreenCapture](#oh_avscreencapture_stopscreencapture) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Stops screen capture. This function is used in pair with **OH_AVScreenCapture_StartScreenCapture**. After calling this function, the application stops screen capture or screen share and releases the microphone.|
| [OH_AVScreenCapture_StartScreenRecording](#oh_avscreencapture_startscreenrecording) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Starts screen recording and collects encoded streams.<br>**NOTE**: This function is reserved and will be provided in later versions.|
| [OH_AVScreenCapture_StopScreenRecording](#oh_avscreencapture_stopscreenrecording) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Stops screen recording. This function is used in pair with **OH_AVScreenCapture_StartScreenRecording**.<br>**NOTE**: This function is reserved and will be provided in later versions.|
| [OH_AVScreenCapture_AcquireAudioBuffer](#oh_avscreencapture_acquireaudiobuffer) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture, [OH_AudioBuffer](_o_h___audio_buffer.md) \*\*audiobuffer, [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) type) | Obtains an audio buffer. When calling this function, the application must allocate the memory of the corresponding struct size to the audio buffer.|
| [OH_AVScreenCapture_AcquireVideoBuffer](#oh_avscreencapture_acquirevideobuffer) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture, int32_t \*fence, int64_t \*timestamp, struct [OH_Rect](_o_h___rect.md) \*region) | Obtains a video buffer. An application can call this function to obtain information such as the video buffer and timestamp.|
| [OH_AVScreenCapture_ReleaseAudioBuffer](#oh_avscreencapture_releaseaudiobuffer) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture, [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) type) | Releases an audio buffer.|
| [OH_AVScreenCapture_ReleaseVideoBuffer](#oh_avscreencapture_releasevideobuffer) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Releases a video buffer.|
| [OH_AVScreenCapture_SetCallback](#oh_avscreencapture_setcallback) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture, struct [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) callback) | Sets a callback to listen for available video buffers and audio buffers and errors that occur during the function calling.|
| [OH_AVScreenCapture_Release](#oh_avscreencapture_release) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Releases an **OH_AVScreenCapture** instance. This function is used in pair with **OH_AVScreenCapture_Create**.|
| [OH_AVScreenCapture_SetMicrophoneEnabled](#oh_avscreencapture_setmicrophoneenabled) (struct [OH_AVScreenCapture](#oh_avscreencapture) \*capture, bool isMicrophone) | Enables or disables the microphone.|
## Type Description
### OH_AudioBuffer
```
typedef struct OH_AudioBuffer OH_AudioBuffer
```
**Description**
Defines the configuration such as the size, type, and timestamp of audio data.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AudioCaptureInfo
```
typedef struct OH_AudioCaptureInfo OH_AudioCaptureInfo
```
**Description**
Defines audio capture information.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AudioCaptureSourceType
```
typedef enum OH_AudioCaptureSourceType OH_AudioCaptureSourceType
```
**Description**
Defines an enum that enumerates the audio source types during screen capture.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AudioCodecFormat
```
typedef enum OH_AudioCodecFormat OH_AudioCodecFormat
```
**Description**
Defines an enum that enumerates the audio encoding formats.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AudioEncInfo
```
typedef struct OH_AudioEncInfo OH_AudioEncInfo
```
**Description**
Defines audio encoding information.
> **NOTE**
>
> This type is reserved and will be provided in later versions.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AudioInfo
```
typedef struct OH_AudioInfo OH_AudioInfo
```
**Description**
Defines audio capture parameters.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AVSCREEN_CAPTURE_ErrCode
```
typedef enum OH_AVSCREEN_CAPTURE_ErrCode OH_AVSCREEN_CAPTURE_ErrCode
```
**Description**
Defines an enum that enumerates the error codes generated during screen recording.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AVScreenCapture
```
typedef struct OH_AVScreenCapture OH_AVScreenCapture
```
**Description**
Defines a screen capture instance used to obtain original video and audio streams.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AVScreenCaptureCallback
```
typedef struct OH_AVScreenCaptureCallback OH_AVScreenCaptureCallback
```
**Description**
Defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance. To ensure the normal running of **OH_AVScreenCapture**, you must register the instance of this struct with the **OH_AVScreenCapture** instance and process the information reported by the callback functions.
**Parameters**
| Name| Description|
| -------- | -------- |
| onError | Pointer to a callback function that is called when an error occurs during the running of an **OH_AVScreenCapture** instance. For details, see [OH_AVScreenCaptureOnError](#oh_avscreencaptureonerror).|
| onAudioBufferAvailable | Pointer to a callback function that is called when an audio buffer is available during the running of an **OH_AVScreenCapture** instance. For details, see [OH_AVScreenCaptureOnAudioBufferAvailable](#oh_avscreencaptureonaudiobufferavailable).|
| onVideoBufferAvailable | Pointer to a callback function that is called when a video buffer is available during the running of an **OH_AVScreenCapture** instance. For details, see [OH_AVScreenCaptureOnVideoBufferAvailable](#oh_avscreencaptureonvideobufferavailable).|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AVScreenCaptureConfig
```
typedef struct OH_AVScreenCaptureConfig OH_AVScreenCaptureConfig
```
**Description**
Defines the screen capture configuration.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AVScreenCaptureOnAudioBufferAvailable
```
typedef void(* OH_AVScreenCaptureOnAudioBufferAvailable) (OH_AVScreenCapture *capture, bool isReady, OH_AudioCaptureSourceType type)
```
**Description**
Defines a pointer to a callback function that is called when an audio buffer is available during the running of an **OH_AVScreenCapture** instance.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| isReady | Whether the audio buffer is available.|
| type | Audio source type.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AVScreenCaptureOnError
```
typedef void(* OH_AVScreenCaptureOnError) (OH_AVScreenCapture *capture, int32_t errorCode)
```
**Description**
Defines a pointer to a callback function that is called when an error occurs during the running of an **OH_AVScreenCapture** instance.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| errorCode | Error code.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_AVScreenCaptureOnVideoBufferAvailable
```
typedef void(* OH_AVScreenCaptureOnVideoBufferAvailable) (OH_AVScreenCapture *capture, bool isReady)
```
**Description**
Defines a pointer to a callback function that is called when a video buffer is available during the running of an **OH_AVScreenCapture** instance.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| isReady | Whether the video buffer is available.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_CaptureMode
```
typedef enum OH_CaptureModeOH_CaptureMode
```
**Description**
Defines an enum that enumerates the screen capture modes.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_ContainerFormatType
```
typedef enum OH_ContainerFormatType OH_ContainerFormatType
```
**Description**
Defines an enum that enumerates the types of files generated during screen capture.
> **NOTE**
>
> This type is reserved and will be provided in later versions.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_DataType
```
typedef enum OH_DataType OH_DataType
```
**Description**
Defines an enum that enumerates the data types of screen capture streams.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_NativeBuffer
```
typedef struct OH_NativeBuffer OH_NativeBuffer
```
**Description**
Defines the native video stream class for screen capture.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_RecorderInfo
```
typedef struct OH_RecorderInfo OH_RecorderInfo
```
**Description**
Defines recording file information.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_Rect
```
typedef struct OH_Rect OH_Rect
```
**Description**
Defines the width, height, and image information of the rectangle used for screen capture.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_VideoCaptureInfo
```
typedef struct OH_VideoCaptureInfo OH_VideoCaptureInfo
```
**Description**
Defines video capture information.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_VideoCodecFormat
```
typedef enum OH_VideoCodecFormat OH_VideoCodecFormat
```
**Description**
Defines an enum that enumerates the video encoding formats.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_VideoEncInfo
```
typedef struct OH_VideoEncInfo OH_VideoEncInfo
```
**Description**
Defines video encoding parameters.
> **NOTE**
>
> This type is reserved and will be provided in later versions.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_VideoInfo
```
typedef struct OH_VideoInfo OH_VideoInfo
```
**Description**
Defines video capture parameters.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
### OH_VideoSourceType
```
typedef enum OH_VideoSourceType OH_VideoSourceType
```
**Description**
Defines an enum that enumerates the video source formats.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
## Enum Description
### OH_AudioCaptureSourceType
```
enum OH_AudioCaptureSourceType
```
**Description**
Enumerates the audio source types during screen capture.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| OH_SOURCE_INVALID | Invalid audio source.|
| OH_SOURCE_DEFAULT | Default audio source. The default value is **MIC**.|
| OH_MIC | External audio streams recorded by the microphone.|
| OH_ALL_PLAYBACK | All internal audio streams played by the system.|
| OH_APP_PLAYBACK | Internal audio streams played by a specified application.|
### OH_AudioCodecFormat
```
enum OH_AudioCodecFormat
```
**Description**
Enumerates the audio encoding formats.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| OH_AUDIO_DEFAULT | Default audio encoding format. The default value is **AAC_LC**.|
| OH_AAC_LC | AAC_LC audio encoding.|
| OH_AUDIO_CODEC_FORMAT_BUTT | Invalid format.|
### OH_AVSCREEN_CAPTURE_ErrCode
```
enum OH_AVSCREEN_CAPTURE_ErrCode
```
**Description**
Enumerates the error codes generated during screen recording.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| AV_SCREEN_CAPTURE_ERR_BASE | Basic value returned when an API call error occurs.|
| AV_SCREEN_CAPTURE_ERR_OK | Operation successful.|
| AV_SCREEN_CAPTURE_ERR_NO_MEMORY | Memory insufficient.|
| AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT | Operation not allowed.|
| AV_SCREEN_CAPTURE_ERR_INVALID_VAL | Invalid parameter.|
| AV_SCREEN_CAPTURE_ERR_IO | Abnormal input and output streams.|
| AV_SCREEN_CAPTURE_ERR_TIMEOUT | Network timeout.|
| AV_SCREEN_CAPTURE_ERR_UNKNOWN | Unknown error.|
| AV_SCREEN_CAPTURE_ERR_SERVICE_DIED | Media service terminated.|
| AV_SCREEN_CAPTURE_ERR_INVALID_STATE | Unsupported operation in this state.|
| AV_SCREEN_CAPTURE_ERR_UNSUPPORT | Unsupported interface.|
| AV_SCREEN_CAPTURE_ERR_EXTEND_START | Unexpected error.|
### OH_CaptureMode
```
enum OH_CaptureMode
```
**Description**
Enumerates the screen capture modes.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| OH_CAPTURE_HOME_SCREEN | To capture the home screen.|
| OH_CAPTURE_SPECIFIED_SCREEN | To capture a specified screen.<br>**NOTE**: This value is reserved and will be provided in later versions.|
| OH_CAPTURE_SPECIFIED_WINDOW | To capture a specified window.<br>**NOTE**: This value is reserved and will be provided in later versions.|
| OH_CAPTURE_INVAILD | Invalid mode.|
### OH_ContainerFormatType
```
enum OH_ContainerFormatType
```
**Description**
Enumerates the types of files generated during screen capture.
> **NOTE**
>
> This enum is reserved and will be provided in later versions.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| CFT_MPEG_4A | Audio format M4A.|
| CFT_MPEG_4 | Video format MP4.|
### OH_DataType
```
enum OH_DataType
```
**Description**
Enumerates the data types of screen capture streams.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| OH_ORIGINAL_STREAM | Original stream format, such as YUV, RGBA, and PCM.|
| OH_ENCODED_STREAM | Encoded stream format, such as H.264 and AAC.<br>**NOTE**: This value is reserved and will be provided in later versions.|
| OH_CAPTURE_FILE | Format of the recording file. The value can be **mp4**.<br>**NOTE**: This value is reserved and will be provided in later versions.|
| OH_INVAILD | Invalid format.|
### OH_VideoCodecFormat
```
enum OH_VideoCodecFormat
```
**Description**
Enumerates the video encoding formats.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| OH_VIDEO_DEFAULT | Default video encoding format. The default value is **H.264**.|
| OH_H264 | H.264.|
| OH_H265 | H.265/HEVC.|
| OH_MPEG4 | MPEG4.|
| OH_VP8 | VP8.|
| OH_VP9 | VP9.|
| OH_VIDEO_CODEC_FORMAT_BUTT | Invalid format.|
### OH_VideoSourceType
```
enum OH_VideoSourceType
```
**Description**
Enumerates the video source formats.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| OH_VIDEO_SOURCE_SURFACE_YUV | YUV format.|
| OH_VIDEO_SOURCE_SURFACE_ES | Raw format.|
| OH_VIDEO_SOURCE_SURFACE_RGBA | RGBA format.|
| OH_VIDEO_SOURCE_BUTT | Invalid format.|
## Function Description
### OH_AVScreenCapture_AcquireAudioBuffer()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_AcquireAudioBuffer (struct OH_AVScreenCapture * capture, OH_AudioBuffer ** audiobuffer, OH_AudioCaptureSourceType type )
```
**Description**
Obtains an audio buffer. When calling this function, the application must allocate the memory of the corresponding struct size to the audio buffer.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| audiobuffer | Pointer to the struct for storing the audio buffer. This struct is used to obtain the information about the audio buffer and the timestamp of the buffer.|
| type | Type of the audio buffer, which is used to distinguish external streams recorded by the microphone from internal streams played by the system. For details, see [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype).|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_AcquireVideoBuffer()
```
OH_NativeBuffer* OH_AVScreenCapture_AcquireVideoBuffer (struct OH_AVScreenCapture * capture, int32_t * fence, int64_t * timestamp, struct OH_Rect * region )
```
**Description**
Obtains a video buffer. An application can call this function to obtain information such as the video buffer and timestamp. After the buffer is no longer needed, call **OH_AVScreenCapture_ReleaseVideoBuffer** to release it.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| fence | Pointer to parameters for synchronization display.|
| timestamp | Pointer to the timestamp of the video frame.|
| region | Pointer to the coordinates related to video display.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns an **OH_NativeBuffer** object if the operation is successful. The application can call the APIs provided by the **OH_NativeBuffer** object to obtain information such as the video buffer and resolution.
### OH_AVScreenCapture_Create()
```
struct OH_AVScreenCapture* OH_AVScreenCapture_Create (void )
```
**Description**
Creates an **OH_AVScreenCapture** instance. You can release the instance by calling **OH_AVScreenCapture_Release**.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns the pointer to an **OH_AVScreenCapture** instance.
### OH_AVScreenCapture_Init()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_Init (struct OH_AVScreenCapture * capture, OH_AVScreenCaptureConfig config )
```
**Description**
Initializes **OH_AVScreenCapture** parameters, including audio microphone sampling parameters, audio capture parameters (optional), and video resolution parameters.
To call this function, you must configure the **ohos.permission.MICROPHONE** and **ohos.permission.CAPTURE_SCREEN** permissions. Otherwise, the initialization fails and screen capture cannot be performed properly.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| config | Parameters related to screen capture initialization.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_Release()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_Release (struct OH_AVScreenCapture * capture)
```
**Description**
Releases an **OH_AVScreenCapture** instance. This function is used in pair with **OH_AVScreenCapture_Create**.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_ReleaseAudioBuffer()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseAudioBuffer (struct OH_AVScreenCapture * capture, OH_AudioCaptureSourceType type )
```
**Description**
Releases an audio buffer. After the audio buffer is no longer needed, call this function to release it.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| type | Type of the audio buffer, which is used to distinguish external streams recorded by the microphone from internal streams played by the system.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_ReleaseVideoBuffer()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseVideoBuffer (struct OH_AVScreenCapture * capture)
```
**Description**
Releases a video buffer. After the video buffer is no longer needed, call this function to release it.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_SetCallback()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCallback (struct OH_AVScreenCapture * capture, struct OH_AVScreenCaptureCallback callback )
```
**Description**
Sets a callback to listen for available video buffers and audio buffers and errors that occur during the function calling.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| callback | [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) struct, which stores related callback function pointers.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_SetMicrophoneEnabled()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetMicrophoneEnabled (struct OH_AVScreenCapture * capture, bool isMicrophone )
```
**Description**
Enables or disables the microphone. When **isMicrophone** is set to **true**, the microphone is enabled, and the original PCM data of the microphone can be obtained by calling **OH_AVScreenCapture_StartScreenRecording** and **OH_AVScreenCapture_AcquireAudioBuffer**. When **isMicrophone** is set to **false**, the obtained audio data is silent data.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| isMicrophone | Whether to enable the microphone.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_StartScreenCapture()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StartScreenCapture (struct OH_AVScreenCapture * capture)
```
**Description**
Starts screen capture and collects original streams. After calling this function, the application can use the callback listeners **OH_AVScreenCaptureOnAudioBufferAvailable** and **OH_AVScreenCaptureOnVideoBufferAvailable** to check whether streams are generated.
The application can obtain the original streams of screen capture by calling **OH_AVScreenCapture_AcquireAudioBuffer** and **OH_AVScreenCapture_ReleaseVideoBuffer**.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_StartScreenRecording()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StartScreenRecording (struct OH_AVScreenCapture * capture)
```
**Description**
Starts screen recording and collects encoded streams.
> **NOTE**
>
> This function is reserved and will be provided in later versions.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_StopScreenCapture()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StopScreenCapture (struct OH_AVScreenCapture * capture)
```
**Description**
Stops screen capture. This function is used in pair with **OH_AVScreenCapture_StartScreenCapture**. After calling this function, the application stops screen capture or screen share and releases the microphone.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_StopScreenRecording()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StopScreenRecording (struct OH_AVScreenCapture * capture)
```
**Description**
Stops screen recording. This function is used in pair with **OH_AVScreenCapture_StartScreenRecording**.
> **NOTE**
>
> This function is reserved and will be provided in later versions.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
# OH_AVScreenCaptureCallback
## Overview
The **OH_AVScreenCaptureCallback** struct defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance. To ensure the normal running of **OH_AVScreenCapture**, you must register the instance of this struct with the **OH_AVScreenCapture** instance and process the information reported by the callback functions.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| **onError** | [OH_AVScreenCaptureOnError](_a_v_screen_capture.md#oh_avscreencaptureonerror) |
| **onAudioBufferAvailable** | [OH_AVScreenCaptureOnAudioBufferAvailable](_a_v_screen_capture.md#oh_avscreencaptureonaudiobufferavailable) |
| **onVideoBufferAvailable** | [OH_AVScreenCaptureOnVideoBufferAvailable](_a_v_screen_capture.md#oh_avscreencaptureonvideobufferavailable) |
# OH_AVScreenCaptureConfig
## Overview
The **OH_AVScreenCaptureConfig** struct defines the screen capture configuration.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [captureMode](#capturemode) | [OH_CaptureMode](_a_v_screen_capture.md#oh_capturemode)<br>Defines the screen capture mode.|
| [dataType](#datatype) | [OH_DataType](_a_v_screen_capture.md#oh_datatype)<br>Defines the data type of the screen capture stream.|
| [audioInfo](#audioinfo) | [OH_AudioInfo](_o_h___audio_info.md)<br>Defines audio capture parameters.|
| [videoInfo](#videoinfo) | [OH_VideoInfo](_o_h___video_info.md)<br>Defines video capture parameters.|
| [recorderInfo](#recorderinfo) | [OH_RecorderInfo](_o_h___recorder_info.md)<br>Defines recording file parameters. This member variable is mandatory when the data type is **OH_CAPTURE_FILE**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
## Member Variable Description
### audioInfo
```
OH_AudioInfo OH_AVScreenCaptureConfig::audioInfo
```
**Description**
Defines audio capture parameters.
### captureMode
```
OH_CaptureMode OH_AVScreenCaptureConfig::captureMode
```
**Description**
Defines the screen capture mode.
### dataType
```
OH_DataType OH_AVScreenCaptureConfig::dataType
```
**Description**
Defines the data type of the screen capture stream.
### recorderInfo
```
OH_RecorderInfo OH_AVScreenCaptureConfig::recorderInfo
```
**Description**
Defines recording file parameters. This member variable is mandatory when the data type is **OH_CAPTURE_FILE**.
> **NOTE**
>
> This member variable is reserved and will be provided in later versions.
### videoInfo
```
OH_VideoInfo OH_AVScreenCaptureConfig::videoInfo
```
**Description**
Defines video capture parameters.
# OH_AudioBuffer
## Overview
The **OH_AudioBuffer** struct defines the configuration such as the size, type, and timestamp of audio data.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [buf](#buf) | Defines the pointer to an audio buffer.|
| [size](#size) | Defines the size of the audio buffer.|
| [timestamp](#timestamp) | Defines the timestamp of the audio buffer.|
| [type](#type) | Defines the type of the audio capture source.|
## Member Variable Description
### buf
```
uint8_t* OH_AudioBuffer::buf
```
**Description**
Defines the pointer to an audio buffer.
### size
```
int32_t OH_AudioBuffer::size
```
**Description**
Defines the size of the audio buffer.
### timestamp
```
int64_t OH_AudioBuffer::timestamp
```
**Description**
Defines the timestamp of the audio buffer.
### type
```
OH_AudioCaptureSourceType OH_AudioBuffer::type
```
**Description**
Defines the type of the audio capture source.
# OH_AudioCaptureInfo
## Overview
The **OH_AudioCaptureInfo** struct defines audio capture information.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [audioSampleRate](#audiosamplerate) | int32_t<br>Defines the audio sampling rate. For details about the supported rates, see **OH_AudioCapturer_GetSamplingRate**.|
| [audioChannels](#audiochannels) | int32_t<br>Defines the number of audio channels.|
| [audioSource](#audiosource) | [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype)<br>Defines the audio source.|
## Member Variable Description
### audioChannels
```
int32_t OH_AudioCaptureInfo::audioChannels
```
**Description**
Defines the number of audio channels.
### audioSampleRate
```
int32_t OH_AudioCaptureInfo::audioSampleRate
```
**Description**
Defines the audio sampling rate. For details about the supported rates, see **OH_AudioCapturer_GetSamplingRate**.
### audioSource
```
OH_AudioCaptureSourceType OH_AudioCaptureInfo::audioSource
```
**Description**
Defines the audio source.
# OH_AudioEncInfo
## Overview
The **OH_AudioEncInfo** struct defines audio encoding information.
> **NOTE**
>
> This struct is reserved and will be provided in later versions.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [audioBitrate](#audiobitrate) | int32_t<br>Defines the audio bit rate.|
| [audioCodecformat](#audiocodecformat) | [OH_AudioCodecFormat](_a_v_screen_capture.md#oh_audiocodecformat)<br>Defines the audio codec format.|
## Member Variable Description
### audioBitrate
```
int32_t OH_AudioEncInfo::audioBitrate
```
**Description**
Defines the audio bit rate.
### audioCodecformat
```
OH_AudioCodecFormat OH_AudioEncInfo::audioCodecformat
```
**Description**
Defines the audio codec format.
# OH_AudioInfo
## Overview
The **OH_AudioInfo** struct defines audio capture parameters.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [micCapInfo](#miccapinfo) | [OH_AudioCaptureInfo](_o_h___audio_capture_info.md)<br>Defines the audio parameters of the microphone.|
| [innerCapInfo](#innercapinfo) | [OH_AudioCaptureInfo](_o_h___audio_capture_info.md)<br>Defines the audio parameters for internal capture.|
| [audioEncInfo](#audioencinfo) | [OH_AudioEncInfo](_o_h___audio_enc_info.md)<br>Defines the audio encoding information. This member variable does not need to be set when **dataType** is set to **OH_ORIGINAL_STREAM**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
## Member Variable Description
### audioEncInfo
```
OH_AudioEncInfo OH_AudioInfo::audioEncInfo
```
**Description**
Defines the audio encoding information. This member variable does not need to be set when **dataType** is set to **OH_ORIGINAL_STREAM**.
> **NOTE**
>
> This struct is reserved and will be provided in later versions.
### innerCapInfo
```
OH_AudioCaptureInfo OH_AudioInfo::innerCapInfo
```
**Description**
Defines the audio parameters for internal capture.
### micCapInfo
```
OH_AudioCaptureInfo OH_AudioInfo::micCapInfo
```
**Description**
Defines the audio parameters of the microphone.
# OH_RecorderInfo
## Overview
The **OH_RecorderInfo** struct defines recording file information.
> **NOTE**
>
> This struct is reserved and will be provided in later versions.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [url](#url) | Defines the URL of the recording file.|
| [urlLen](#urllen) | Defines the URL length.|
| [fileFormat](#fileformat) | Defines the format of the recording file.|
## Member Variable Description
### fileFormat
```
OH_ContainerFormatType OH_RecorderInfo::fileFormat
```
**Description**
Defines the format of the recording file.
### url
```
char* OH_RecorderInfo::url
```
**Description**
Defines the URL of the recording file.
### urlLen
```
uint32_t OH_RecorderInfo::urlLen
```
**Description**
Defines the URL length.
# OH_Rect
## Overview
The **OH_Rect** struct defines the width, height, and image information of the rectangle used for screen capture.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [x](#x) | int32_t<br>Defines the X coordinate of the screen capture rectangle.|
| [y](#y) | int32_t<br>Defines the Y coordinate of the screen capture rectangle.|
| [width](#width) | int32_t<br>Defines the width of the screen capture rectangle.|
| [height](#height) | int32_t<br>Defines the height of the screen capture rectangle.|
## Member Variable Description
### height
```
int32_t OH_Rect::height
```
**Description**
Defines the height of the screen capture rectangle.
### width
```
int32_t OH_Rect::width
```
**Description**
Defines the width of the screen capture rectangle.
### x
```
int32_t OH_Rect::x
```
**Description**
Defines the X coordinate of the screen capture rectangle.
### y
```
int32_t OH_Rect::y
```
**Description**
Defines the Y coordinate of the screen capture rectangle.
# OH_VideoCaptureInfo
## Overview
The **OH_VideoCaptureInfo** struct defines video capture information.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [displayId](#displayid) | uint64_t<br>Defines the ID of the physical screen to capture. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_SCREEN**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
| [missionIDs](#missionids) | int32_t \*<br>Defines the mission ID list. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_WINDOW**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
| [missionIDsLen](#missionidslen) | int32_t<br>Defines the length of the mission ID list. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_WINDOW**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
| [videoFrameWidth](#videoframewidth) | int32_t<br>Defines the width of the captured video.|
| [videoFrameHeight](#videoframeheight) | int32_t<br>Defines the height of the captured video.|
| [videoSource](#videosource) | [OH_VideoSourceType](_a_v_screen_capture.md#oh_videosourcetype)<br>Defines the video source type. Currently, only RGBA is supported.|
## Member Variable Description
### displayId
```
uint64_t OH_VideoCaptureInfo::displayId
```
**Description**
Defines the ID of the physical screen to capture. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_SCREEN**.
> **NOTE**
>
> This member variable is reserved and will be provided in later versions.
### missionIDs
```
int32_t* OH_VideoCaptureInfo::missionIDs
```
**Description**
Defines the mission ID list. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_WINDOW**.
> **NOTE**
>
> This member variable is reserved and will be provided in later versions.
### missionIDsLen
```
int32_t OH_VideoCaptureInfo::missionIDsLen
```
**Description**
Defines the length of the mission ID list. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_WINDOW**.
> **NOTE**
>
> This member variable is reserved and will be provided in later versions.
### videoFrameHeight
```
int32_t OH_VideoCaptureInfo::videoFrameHeight
```
**Description**
Defines the height of the captured video.
### videoFrameWidth
```
int32_t OH_VideoCaptureInfo::videoFrameWidth
```
**Description**
Defines the width of the captured video.
### videoSource
```
OH_VideoSourceType OH_VideoCaptureInfo::videoSource
```
**Description**
Defines the video source type. Currently, only RGBA is supported.
# OH_VideoEncInfo
## Overview
The **OH_VideoEncInfo** struct defines video encoding parameters.
> **NOTE**
>
> This struct is reserved and will be provided in later versions.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [videoCodec](#videocodec) | [OH_VideoCodecFormat](_a_v_screen_capture.md#oh_videocodecformat)<br>Defines the video encoding format.|
| [videoBitrate](#videobitrate) | int32_t<br>Defines the video bit rate.|
| [videoFrameRate](#videoframerate) | int32_t<br>Defines the video frame rate.|
## Member Variable Description
### videoBitrate
```
int32_t OH_VideoEncInfo::videoBitrate
```
**Description**
Defines the video bit rate.
### videoCodec
```
OH_VideoCodecFormat OH_VideoEncInfo::videoCodec
```
**Description**
Defines the video encoding format.
### videoFrameRate
```
int32_t OH_VideoEncInfo::videoFrameRate
```
**Description**
Defines the video frame rate.
# OH_VideoInfo
## Overview
The **OH_VideoInfo** struct defines video capture parameters.
**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [videoCapInfo](#videocapinfo) | [OH_VideoCaptureInfo](_o_h___video_capture_info.md)<br>Defines video capture information.|
| [videoEncInfo](#videoencinfo) | [OH_VideoEncInfo](_o_h___video_enc_info.md)<br>Defines video encoding parameters.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
## Member Variable Description
### videoCapInfo
```
OH_VideoCaptureInfo OH_VideoInfo::videoCapInfo
```
**Description**
Defines video capture information.
### videoEncInfo
```
OH_VideoEncInfo OH_VideoInfo::videoEncInfo
```
**Description**
Defines video encoding parameters.
> **NOTE**
>
> This member variable is reserved and will be provided in later versions.
......@@ -53,7 +53,7 @@ The **OHAudio** module provides native APIs of the audio module.
| [OH_AudioStream_SampleFormat](#oh_audiostream_sampleformat) { AUDIOSTREAM_SAMPLE_U8 = 0, AUDIOSTREAM_SAMPLE_S16LE = 1, AUDIOSTREAM_SAMPLE_S24LE = 2, AUDIOSTREAM_SAMPLE_S32LE = 3 } | Enumerates the sampling formats of audio streams.|
| [OH_AudioStream_EncodingType](#oh_audiostream_encodingtype) { **AUDIOSTREAM_ENCODING_TYPE_RAW** = 0 } | Enumerates the encoding types of audio streams.|
| [OH_AudioStream_Usage](#oh_audiostream_usage) { **AUDIOSTREAM_USAGE_UNKNOWN** = 0, **AUDIOSTREAM_USAGE_MUSIC** = 1, **AUDIOSTREAM_USAGE_COMMUNICATION** = 2, **AUDIOSTREAM_USAGE_GAME** = 11 } | Enumerates the usage scenarios of audio output streams.|
| [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) { AUDIOSTREAM_LATENCY_MODE_NORMAL } | Enumerates the latency modes of audio streams.|
| [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) { AUDIOSTREAM_LATENCY_MODE_NORMAL = 0, AUDIOSTREAM_LATENCY_MODE_FAST = 1} | Enumerates the latency modes of audio streams.|
| [OH_AudioStream_State](#oh_audiostream_state) {<br>AUDIOSTREAM_STATE_INVALID = -1, AUDIOSTREAM_STATE_PREPARED = 1, AUDIOSTREAM_STATE_RUNNING = 2, AUDIOSTREAM_STATE_STOPPED = 3,<br>AUDIOSTREAM_STATE_RELEASED = 4, AUDIOSTREAM_STATE_PAUSED = 5<br>} | Enumerates the audio stream states.|
| [OH_AudioStream_SourceType](#oh_audiostream_sourcetype) { **AUDIOSTREAM_SOURCE_TYPE_INVALID** = -1, **AUDIOSTREAM_SOURCE_TYPE_MIC**, **AUDIOSTREAM_SOURCE_TYPE_VOICE_RECOGNITION** = 1, **AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION** = 7 } | Enumerates the usage scenarios of audio input streams.|
......@@ -255,6 +255,7 @@ Enumerates the latency modes of audio streams.
| Value| Description|
| -------- | -------- |
| AUDIOSTREAM_LATENCY_MODE_NORMAL | Normal latency mode.|
| AUDIOSTREAM_LATENCY_MODE_FAST | Low latency mode.|
### OH_AudioStream_Result
......
# OHOS::Media::OhosImageComponent
## Overview
The **OHOS::Media::OhosImageComponent** struct defines the information about an image component.
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [byteBuffer](#bytebuffer) | Buffer that stores the pixel data.|
| [size](#size) | Size of the pixel data in the memory.|
| [componentType](#componenttype) | Type of the pixel data.|
| [rowStride](#rowstride) | Row stride of the pixel data.|
| [pixelStride](#pixelstride) | Pixel stride of the pixel data.|
## Member Variable Description
### byteBuffer
```
uint8_t* OHOS::Media::OhosImageComponent::byteBuffer
```
**Description**
Buffer that stores the pixel data.
### componentType
```
int32_t OHOS::Media::OhosImageComponent::componentType
```
**Description**
Type of the pixel data.
### pixelStride
```
int32_t OHOS::Media::OhosImageComponent::pixelStride
```
**Description**
Pixel stride of the pixel data.
### rowStride
```
int32_t OHOS::Media::OhosImageComponent::rowStride
```
**Description**
Row stride of the pixel data.
### size
```
size_t OHOS::Media::OhosImageComponent::size
```
**Description**
Size of the pixel data in the memory.
# OHOS::Media::OhosImageRect
## Overview
The **OHOS::Media::OhosImageRect** struct defines the information about an image rectangle.
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [x](#x) | X coordinate of the rectangle.|
| [y](#y) | Y coordinate of the rectangle.|
| [width](#width) | Width of the rectangle, in pixels.|
| [height](#height) | Height of the rectangle, in pixels.|
## Member Variable Description
### height
```
int32_t OHOS::Media::OhosImageRect::height
```
**Description**
Height of the rectangle, in pixels.
### width
```
int32_t OHOS::Media::OhosImageRect::width
```
**Description**
Width of the rectangle, in pixels.
### x
```
int32_t OHOS::Media::OhosImageRect::x
```
**Description**
X coordinate of the rectangle.
### y
```
int32_t OHOS::Media::OhosImageRect::y
```
**Description**
Y coordinate of the rectangle.
# OHOS::Media::OhosPixelMapInfo
## Overview
The **OHOS::Media::OhosPixelMapInfo** struct defines the information about a pixel map.
**Since**
8
**Deprecated from**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [width](#width) | Image width, in pixels.|
| [height](#height) | Image height, in pixels.|
| [rowSize](#rowsize) | Number of bytes per row.|
| [pixelFormat](#pixelformat) | Pixel format.|
## Member Variable Description
### height
```
uint32_t OHOS::Media::OhosPixelMapInfo::height
```
**Description**
Image height, in pixels.
### pixelFormat
```
int32_t OHOS::Media::OhosPixelMapInfo::pixelFormat
```
**Description**
Pixel format.
### rowSize
```
uint32_t OHOS::Media::OhosPixelMapInfo::rowSize
```
**Description**
Number of bytes per row.
### width
```
uint32_t OHOS::Media::OhosPixelMapInfo::width
```
**Description**
Image width, in pixels.
# OhosImageDecodingOps
## Overview
The **OhosImageDecodingOps** struct defines the options for decoding an image source. It is used in [OH_ImageSource_CreatePixelMap](image.md#oh_imagesource_createpixelmap) and [OH_ImageSource_CreatePixelMapList](image.md#oh_imagesource_createpixelmaplist).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [editable](image.md#editable) | Defines whether the output pixel map is editable.|
| [pixelFormat](image.md#pixelformat-23) | Defines the pixel format of the output pixel map.|
| [fitDensity](image.md#fitdensity) | Defines the pixel density of the output pixel map.|
| [index](image.md#index) | Defines the index of the output pixel map.|
| [sampleSize](image.md#samplesize) | Defines the size of the sample.|
| [rotate](image.md#rotate) | Defines the decoding rotation option.|
| [size](image.md#size-27) | Defines the pixel width and height of the output pixel map.|
| [region](image.md#region) | Defines the region of the output pixel map.|
# OhosImageReceiverInfo
## Overview
The **OhosImageReceiverInfo** struct defines the information about an image receiver.
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| width | Default width of the image received by the consumer, in pixels.|
| height | Default height of the image received by the consumer, in pixels.|
| format | Image format **OHOS_IMAGE_FORMAT_JPEG** created by using the receiver.|
| capicity | Maximum number of images that can be cached.|
# OhosImageRegion
## Overview
The **OhosImageRegion** struct defines the region of an image source to decode. It is used in [OhosImageDecodingOps](_ohos_image_decoding_ops.md), [OH_ImageSource_CreatePixelMap](image.md#oh_imagesource_createpixelmap), and [OH_ImageSource_CreatePixelMapList](image.md#oh_imagesource_createpixelmaplist).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [x](image.md#x) | Defines the X coordinate of the start point, in pixels.|
| [y](image.md#y) | Defines the Y coordinate of the start point, in pixels.|
| [width](image.md#width) | Defines the width of the region, in pixels.|
| [height](image.md#height) | Defines the height of the region, in pixels.|
# OhosImageSize
## Overview
The **OhosImageSize** struct defines the image size.
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [width](#width) | Defines the image width, in pixels.|
| [height](#height) | Defines the image height, in pixels.|
## Member Variable Description
### height
```
int32_t OhosImageSize::height
```
**Description**
Defines the image height, in pixels.
### width
```
int32_t OhosImageSize::width
```
**Description**
Defines the image width, in pixels.
# OhosImageSource
## Overview
The **OhosImageSource** struct defines the input resource of an image source. Only one type of resource is accepted at a time. The image source is obtained by calling [OH_ImageSource_Create](image.md#oh_imagesource_create).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [uri](image.md#uri) = nullptr | Defines a pointer to the image source URI. Only a file URI or Base64 URI is accepted.|
| [uriSize](image.md#urisize) = 0 | Defines the length of the image source URI.|
| [fd](image.md#fd) = -1 | Defines the descriptor of the image source.|
| [buffer](image.md#buffer-12) = nullptr | Defines a pointer to the image source buffer. Only a formatted packet buffer or Base64 buffer is accepted.|
| [bufferSize](image.md#buffersize-12) = 0 | Defines the size of the image source buffer.|
# OhosImageSourceDelayTimeList
## Overview
The **OhosImageSourceDelayTimeList** struct defines the delay time list of an image source. The delay time list is obtained by calling [OH_ImageSource_GetDelayTime](image.md#oh_imagesource_getdelaytime).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [delayTimeList](image.md#delaytimelist) | Defines a pointer to the head of the image source delay time list.|
| [size](image.md#size-47) = 0 | Defines the size of the image source delay time list.|
# OhosImageSourceInfo
## Overview
The **OhosImageSourceInfo** struct defines the image source information, which is obtained by calling [OH_ImageSource_GetImageInfo](image.md#oh_imagesource_getimageinfo).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [pixelFormat](image.md#pixelformat-33) | Defines the pixel format of the image source. It is set in [OH_ImageSource_Create()](image.md#oh_imagesource_create).|
| [colorSpace](image.md#colorspace) | Defines the color space of the image source.|
| [alphaType](image.md#alphatype) | Defines the alpha type of the image source.|
| [density](image.md#density-22) | Defines the image density of the image source. It is set in [OH_ImageSource_Create()](image.md#oh_imagesource_create).|
| [size](image.md#size-37) | Defines the pixel width and height of the image source.|
# OhosImageSourceOps
## Overview
The **OhosImageSourceOps** struct defines the image source options. It is used in [OH_ImageSource_Create](image.md#oh_imagesource_create) and [OH_ImageSource_CreateIncremental](image.md#oh_imagesource_createincremental).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [density](image.md#density-12) | Defines the pixel density of the image source.|
| [pixelFormat](image.md#pixelformat-13) | Defines the pixel format of the image source. It is usually used to describe the YUV buffer.|
| [size](image.md#size-17) | Defines the pixel width and height of the image source.|
# OhosImageSourceProperty
## Overview
The **OhosImageSourceProperty** struct defines the property string (in key-value format) of an image source. It is used in [OH_ImageSource_GetImageProperty](image.md#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](image.md#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [value](image.md#value) = nullptr | Defines a pointer to the head of the property string.|
| [size](image.md#size-77) = 0 | Defines the size of the property string.|
# OhosImageSourceSupportedFormat
## Overview
The **OhosImageSourceSupportedFormat** struct defines the format string supported by an image source. It is used in [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) and [OH_ImageSource_GetSupportedFormats](image.md#oh_imagesource_getsupportedformats).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [format](image.md#format) = nullptr | Defines a pointer to the head of the format string.|
| [size](image.md#size-57) = 0 | Defines the size of the format string.|
# OhosImageSourceSupportedFormatList
## Overview
The OhosImageSourceSupportedFormatList struct defines the format string list supported by an image source. It is obtained by calling [OH_ImageSource_GetSupportedFormats](image.md#oh_imagesource_getsupportedformats).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [supportedFormatList](image.md#supportedformatlist) = nullptr | Defines a double pointer to the head of the format string list.|
| [size](image.md#size-67) = 0 | Defines the size of the format string list.|
# OhosImageSourceUpdateData
## Overview
The **OhosImageSourceUpdateData** struct defines the update data option of the image source. It is obtained by calling [OH_ImageSource_UpdateData](image.md#oh_imagesource_updatedata).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [buffer](image.md#buffer-22) = nullptr | Defines a pointer to the buffer for storing the update data.|
| [bufferSize](image.md#buffersize-22) = 0 | Defines the size of the buffer.|
| [offset](image.md#offset) = 0 | Defines the offset of the update data in the buffer.|
| [updateLength](image.md#updatelength) = 0 | Defines the length of the update data in the buffer.|
| [isCompleted](image.md#iscompleted) = 0 | Defines whether the image source data update is completed.|
......@@ -3,7 +3,7 @@
## Overview
Defines the options used for creating a pixel map.
The **OhosPixelMapCreateOps** struct defines the options used for creating a pixel map.
**Since**
......@@ -19,14 +19,14 @@ Defines the options used for creating a pixel map.
### Member Variables
| Name| Description|
| 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.|
| [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.|
## Member Variable Description
......@@ -34,10 +34,10 @@ Defines the options used for creating a pixel map.
### alphaType
```
uint32_t OhosPixelMapCreateOps::alphaType
```
**Description**
Alpha type of the image.
......@@ -45,10 +45,10 @@ Alpha type of the image.
### editable
```
uint32_t OhosPixelMapCreateOps::editable
```
**Description**
Editing type of the image.
......@@ -56,10 +56,10 @@ Editing type of the image.
### height
```
uint32_t OhosPixelMapCreateOps::height
```
**Description**
Image height, in pixels.
......@@ -67,10 +67,10 @@ Image height, in pixels.
### pixelFormat
```
int32_t OhosPixelMapCreateOps::pixelFormat
```
**Description**
Image format.
......@@ -78,10 +78,10 @@ Image format.
### scaleMode
```
uint32_t OhosPixelMapCreateOps::scaleMode
```
**Description**
Scale mode of the image.
......@@ -89,10 +89,10 @@ Scale mode of the image.
### width
```
uint32_t OhosPixelMapCreateOps::width
```
**Description**
Image width, in pixels.
\ No newline at end of file
Image width, in pixels.
# OhosPixelMapInfos
## Overview
The **OhosPixelMapInfos** struct defines the information about a pixel map.
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [width](#width) | Image width, in pixels.|
| [height](#height) | Image height, in pixels.|
| [rowSize](#rowsize) | Number of bytes per row.|
| [pixelFormat](#pixelformat) | Pixel format.|
## Member Variable Description
### height
```
uint32_t OhosPixelMapInfos::height
```
**Description**
Image height, in pixels.
### pixelFormat
```
int32_t OhosPixelMapInfos::pixelFormat
```
**Description**
Pixel format.
### rowSize
```
uint32_t OhosPixelMapInfos::rowSize
```
**Description**
Number of bytes per row.
### width
```
uint32_t OhosPixelMapInfos::width
```
**Description**
Image width, in pixels.
# Image
Provides APIs for obtaining pixel map data and information.
## Overview
@Syscap SystemCapability.Multimedia.Image
The **Image** package provides APIs for accessing the **Image** module. For example, you can use the APIs to obtain image data, pixel map data, and pixel map information.
\@Syscap SystemCapability.Multimedia.Image
**Since**
......@@ -18,732 +19,4089 @@ Provides APIs for obtaining pixel map data and information.
| Name| Description|
| -------- | -------- |
| [image_pixel_map_napi.h](image__pixel__map__napi_8h.md) | Declares the APIs that can lock, access, and unlock a pixel map.<br>**File to include**: <multimedia/image_framework/image_pixel_map_napi.h><br>**Library**: libpixelmap_ndk.z.so|
| [image_mdk.h](image__mdk_8h.md) | Declares the functions that access the image rectangle, size, format, and component data.<br>**File to include**: &lt;multimedia/image_framework/image_mdk.h&gt;<br>**Library**: libimage_ndk.z.so |
| [image_mdk_common.h](image__mdk__common_8h.md) | Declares the common enums and structs used by the image interface.<br>**File to include**: &lt;multimedia/image_framework/image_mdk_common.h&gt;<br>**Library**: libimage_ndk.z.so|
| [image_pixel_map_mdk.h](image__pixel__map__mdk_8h.md) | Declares the APIs that can lock, access, and unlock a pixel map.<br>**File to include**: &lt;multimedia/image_framework/image_pixel_map_mdk.h&gt;<br>**Library**: libpixelmap_ndk.z.so|
| [image_pixel_map_napi.h](image__pixel__map__napi_8h.md) | Declares the APIs that can lock, access, and unlock a pixel map.<br>**File to include**: &lt;multimedia/image_framework/image_pixel_map_napi.h&gt;<br>**Library**: libpixelmap_ndk.z.so|
| [image_receiver_mdk.h](image__receiver__mdk_8h.md) | Declares the APIs for obtaining image data from the native layer.<br>**File to include**: &lt;multimedia/image_framework/image_receiver_mdk.h&gt;<br>**Library**: libimage_receiver_ndk.z.so|
| [image_source_mdk.h](image__source__mdk_8h.md) | Declares the APIs for decoding an image source into a pixel map.<br>**File to include**: &lt;multimedia/image_framework/image_source_mdk.h&gt;<br>**Library**: libimage_source_ndk.z.so |
### Structs
| 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.|
| [OHOS::Media::OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) | Defines the information about an image rectangle.|
| [OHOS::Media::OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) | Defines the information about an image component.|
| [OhosImageSize](_ohos_image_size.md) | Defines the image size.|
| [OhosPixelMapInfos](_ohos_pixel_map_infos.md) | Defines the information about a pixel map.|
| [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md) | Defines the options for creating a pixel map.|
| [OHOS::Media::OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) | Defines the information about a pixel map.|
| [OhosImageReceiverInfo](_ohos_image_receiver_info.md) | Defines the information about an image receiver.|
| [OhosImageRegion](_ohos_image_region.md) | Defines the region of an image source to decode.|
| [OhosImageSourceOps](_ohos_image_source_ops.md) | Defines the image source options.|
| [OhosImageDecodingOps](_ohos_image_decoding_ops.md) | Defines the options for decoding an image source.|
| [OhosImageSourceInfo](_ohos_image_source_info.md) | Defines the information about an image source.|
| [OhosImageSource](_ohos_image_source.md) | Defines the input resource of an image source. Only one type of resource is accepted at a time.|
| [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md) | Defines the delay time list of an image source.|
| [OhosImageSourceSupportedFormat](_ohos_image_source_supported_format.md) | Defines the format string supported by an image source.|
| [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) | Defines the format string list supported by an image source.|
| [OhosImageSourceProperty](_ohos_image_source_property.md) | Defines the property string (in key-value format) of an image source.|
| [OhosImageSourceUpdateData](_ohos_image_source_update_data.md) | Defines the update data of an image source.|
### Types
| Name| Description|
| -------- | -------- |
| [NativePixelMap](#nativepixelmap) | Defines the data type name of the native pixel map.|
| [OHOS::Media::ImageNative](#imagenative) | Defines an image object at the native layer.|
| [NativePixelMap](#nativepixelmap) | Defines the data type name of the pixel map at the native layer.|
| [OhosPixelMapInfos](#ohospixelmapinfos) | Defines the information about a pixel map.|
| [ImageReceiverNative](#imagereceivernative) | Defines the data type name of the image receiver at the native layer.|
| (\*[OH_Image_Receiver_On_Callback](#oh_image_receiver_on_callback)) () | Defines the callbacks for the image interface at the native layer.|
| [ImageSourceNative](#imagesourcenative) | Defines an image source object at the native layer.|
### Macros
| Name| Description|
| -------- | -------- |
| **IMAGE_RESULT_BASE** 62980096 | Defines the basic value returned by the interface. |
### Enums
| Name| Description|
| -------- | -------- |
| { OHOS_IMAGE_RESULT_SUCCESS = 0, OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | Enumerates the error codes returned by the functions.|
| { 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.|
| { OHOS::Media::OHOS_IMAGE_FORMAT_YCBCR_422_SP = 1000,<br>OHOS::Media::OHOS_IMAGE_FORMAT_JPEG = 2000, } | Enumerates the image formats.|
| { OHOS::Media::OHOS_IMAGE_COMPONENT_FORMAT_YUV_Y = 1,<br>OHOS::Media::OHOS_IMAGE_COMPONENT_FORMAT_YUV_U = 2,<br>OHOS::Media::OHOS_IMAGE_COMPONENT_FORMAT_YUV_V = 3,<br>OHOS::Media::OHOS_IMAGE_COMPONENT_FORMAT_JPEG = 4, } | Enumerates the image components.|
| [IRNdkErrCode](#irndkerrcode) {<br>IMAGE_RESULT_SUCCESS = 0,<br>IMAGE_RESULT_BAD_PARAMETER = -1,<br>IMAGE_RESULT_IMAGE_RESULT_BASE = IMAGE_RESULT_BASE,<br>IMAGE_RESULT_ERR_IPC = IMAGE_RESULT_BASE + 1,<br>IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST = IMAGE_RESULT_BASE + 2,<br>IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL = IMAGE_RESULT_BASE + 3,<br>IMAGE_RESULT_DECODE_ABNORMAL = IMAGE_RESULT_BASE + 4,<br>IMAGE_RESULT_DATA_ABNORMAL = IMAGE_RESULT_BASE + 5,<br>IMAGE_RESULT_MALLOC_ABNORMAL = IMAGE_RESULT_BASE + 6,<br>IMAGE_RESULT_DATA_UNSUPPORT = IMAGE_RESULT_BASE + 7,<br>IMAGE_RESULT_INIT_ABNORMAL = IMAGE_RESULT_BASE + 8,<br>IMAGE_RESULT_GET_DATA_ABNORMAL = IMAGE_RESULT_BASE + 9,<br>IMAGE_RESULT_TOO_LARGE = IMAGE_RESULT_BASE + 10,<br>IMAGE_RESULT_TRANSFORM = IMAGE_RESULT_BASE + 11,<br>IMAGE_RESULT_COLOR_CONVERT = IMAGE_RESULT_BASE + 12,<br>IMAGE_RESULT_CROP = IMAGE_RESULT_BASE + 13,<br>IMAGE_RESULT_SOURCE_DATA = IMAGE_RESULT_BASE + 14,<br>IMAGE_RESULT_SOURCE_DATA_INCOMPLETE = IMAGE_RESULT_BASE + 15,<br>IMAGE_RESULT_MISMATCHED_FORMAT = IMAGE_RESULT_BASE + 16,<br>IMAGE_RESULT_UNKNOWN_FORMAT = IMAGE_RESULT_BASE + 17,<br>IMAGE_RESULT_SOURCE_UNRESOLVED = IMAGE_RESULT_BASE + 18,<br>IMAGE_RESULT_INVALID_PARAMETER = IMAGE_RESULT_BASE + 19,<br>IMAGE_RESULT_DECODE_FAILED = IMAGE_RESULT_BASE + 20,<br>IMAGE_RESULT_PLUGIN_REGISTER_FAILED = IMAGE_RESULT_BASE + 21,<br>IMAGE_RESULT_PLUGIN_CREATE_FAILED = IMAGE_RESULT_BASE + 22,<br>IMAGE_RESULT_ENCODE_FAILED = IMAGE_RESULT_BASE + 23,<br>IMAGE_RESULT_ADD_PIXEL_MAP_FAILED = IMAGE_RESULT_BASE + 24,<br>IMAGE_RESULT_HW_DECODE_UNSUPPORT = IMAGE_RESULT_BASE + 25,<br>IMAGE_RESULT_DECODE_HEAD_ABNORMAL = IMAGE_RESULT_BASE + 26,<br>IMAGE_RESULT_DECODE_EXIF_UNSUPPORT = IMAGE_RESULT_BASE + 27,<br>IMAGE_RESULT_PROPERTY_NOT_EXIST = IMAGE_RESULT_BASE + 28,<br>IMAGE_RESULT_MEDIA_DATA_UNSUPPORT = IMAGE_RESULT_BASE + 30,<br>IMAGE_RESULT_MEDIA_TOO_LARGE = IMAGE_RESULT_BASE + 31,<br>IMAGE_RESULT_MEDIA_MALLOC_FAILED = IMAGE_RESULT_BASE + 32,<br>IMAGE_RESULT_MEDIA_END_OF_STREAM = IMAGE_RESULT_BASE + 33,<br>IMAGE_RESULT_MEDIA_IO_ABNORMAL = IMAGE_RESULT_BASE + 34,<br>IMAGE_RESULT_MEDIA_MALFORMED = IMAGE_RESULT_BASE + 35,<br>IMAGE_RESULT_MEDIA_BUFFER_TOO_SMALL = IMAGE_RESULT_BASE + 36,<br>IMAGE_RESULT_MEDIA_OUT_OF_RANGE = IMAGE_RESULT_BASE + 37,<br>IMAGE_RESULT_MEDIA_STATUS_ABNORMAL = IMAGE_RESULT_BASE + 38,<br>IMAGE_RESULT_MEDIA_VALUE_INVALID = IMAGE_RESULT_BASE + 39,<br>IMAGE_RESULT_MEDIA_NULL_POINTER = IMAGE_RESULT_BASE + 40,<br>IMAGE_RESULT_MEDIA_INVALID_OPERATION = IMAGE_RESULT_BASE + 41,<br>IMAGE_RESULT_MEDIA_ERR_PLAYER_NOT_INIT = IMAGE_RESULT_BASE + 42,<br>IMAGE_RESULT_MEDIA_EARLY_PREPARE = IMAGE_RESULT_BASE + 43,<br>IMAGE_RESULT_MEDIA_SEEK_ERR = IMAGE_RESULT_BASE + 44,<br>IMAGE_RESULT_MEDIA_PERMISSION_DENIED = IMAGE_RESULT_BASE + 45,<br>IMAGE_RESULT_MEDIA_DEAD_OBJECT = IMAGE_RESULT_BASE + 46,<br>IMAGE_RESULT_MEDIA_TIMED_OUT = IMAGE_RESULT_BASE + 47,<br>IMAGE_RESULT_MEDIA_TRACK_NOT_ALL_SUPPORTED = IMAGE_RESULT_BASE + 48,<br>IMAGE_RESULT_MEDIA_ADAPTER_INIT_FAILED = IMAGE_RESULT_BASE + 49,<br>IMAGE_RESULT_MEDIA_WRITE_PARCEL_FAIL = IMAGE_RESULT_BASE + 50,<br>IMAGE_RESULT_MEDIA_READ_PARCEL_FAIL = IMAGE_RESULT_BASE + 51,<br>IMAGE_RESULT_MEDIA_NO_AVAIL_BUFFER = IMAGE_RESULT_BASE + 52,<br>IMAGE_RESULT_MEDIA_INVALID_PARAM = IMAGE_RESULT_BASE + 53, IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_EXIST = IMAGE_RESULT_BASE + 54,<br>IMAGE_RESULT_MEDIA_CREATE_CODEC_ADAPTER_FAILED = IMAGE_RESULT_BASE + 55,<br>IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_INIT = IMAGE_RESULT_BASE + 56,<br>IMAGE_RESULT_MEDIA_ZCODEC_CREATE_FAILED = IMAGE_RESULT_BASE + 57,<br>IMAGE_RESULT_MEDIA_ZCODEC_NOT_EXIST = IMAGE_RESULT_BASE + 58,<br>IMAGE_RESULT_MEDIA_JNI_CLASS_NOT_EXIST = IMAGE_RESULT_BASE + 59,<br>IMAGE_RESULT_MEDIA_JNI_METHOD_NOT_EXIST = IMAGE_RESULT_BASE + 60,<br>IMAGE_RESULT_MEDIA_JNI_NEW_OBJ_FAILED = IMAGE_RESULT_BASE + 61,<br>IMAGE_RESULT_MEDIA_JNI_COMMON_ERROR = IMAGE_RESULT_BASE + 62,<br>IMAGE_RESULT_MEDIA_DISTRIBUTE_NOT_SUPPORT = IMAGE_RESULT_BASE + 63,<br>IMAGE_RESULT_MEDIA_SOURCE_NOT_SET = IMAGE_RESULT_BASE + 64,<br>IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_INIT = IMAGE_RESULT_BASE + 65,<br>IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_EXIST = IMAGE_RESULT_BASE + 66,<br>IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT = IMAGE_RESULT_BASE + 67,<br>IMAGE_RESULT_MEDIA_RTSP_CAPTURE_NOT_INIT = IMAGE_RESULT_BASE + 68,<br>IMAGE_RESULT_MEDIA_RTSP_SOURCE_URL_INVALID = IMAGE_RESULT_BASE + 69,<br>IMAGE_RESULT_MEDIA_RTSP_VIDEO_TRACK_NOT_FOUND = IMAGE_RESULT_BASE + 70,<br>IMAGE_RESULT_MEDIA_RTSP_CAMERA_NUM_REACH_MAX = IMAGE_RESULT_BASE + 71,<br>IMAGE_RESULT_MEDIA_SET_VOLUME = IMAGE_RESULT_BASE + 72,<br>IMAGE_RESULT_MEDIA_NUMBER_OVERFLOW = IMAGE_RESULT_BASE + 73,<br>IMAGE_RESULT_MEDIA_DIS_PLAYER_UNSUPPORTED = IMAGE_RESULT_BASE + 74,<br>IMAGE_RESULT_MEDIA_DENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 75,<br>IMAGE_RESULT_MEDIA_ENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 76,<br>IMAGE_RESULT_MEDIA_READ_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 150,<br>IMAGE_RESULT_MEDIA_WRITE_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 151,<br>IMAGE_RESULT_MEDIA_PIXELMAP_NOT_ALLOW_MODIFY = IMAGE_RESULT_BASE + 152,<br>IMAGE_RESULT_MEDIA_CONFIG_FAILED = IMAGE_RESULT_BASE + 153,<br>IMAGE_RESULT_JNI_ENV_ABNORMAL = IMAGE_RESULT_BASE + 154,<br>IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED = IMAGE_RESULT_BASE + 155,<br>IMAGE_RESULT_CREATE_SURFACE_FAILED = IMAGE_RESULT_BASE + 156,<br>IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED = IMAGE_RESULT_BASE + 157,<br>IMAGE_RESULT_GET_SURFACE_FAILED = IMAGE_RESULT_BASE + 158,<br>IMAGE_RESULT_SURFACE_ACQUIRE_BUFFER_FAILED = IMAGE_RESULT_BASE + 159,<br>IMAGE_RESULT_SURFACE_REQUEST_BUFFER_FAILED = IMAGE_RESULT_BASE + 160,<br>IMAGE_RESULT_REGISTER_LISTENER_FAILED = IMAGE_RESULT_BASE + 161,<br>IMAGE_RESULT_REGISTER_BUFFER_FAILED = IMAGE_RESULT_BASE + 162,<br>IMAGE_RESULT_FREAD_FAILED = IMAGE_RESULT_BASE + 163,<br>IMAGE_RESULT_PEEK_FAILED = IMAGE_RESULT_BASE + 164,<br>IMAGE_RESULT_SEEK_FAILED = IMAGE_RESULT_BASE + 165,<br>IMAGE_RESULT_STREAM_SIZE_ERROR = IMAGE_RESULT_BASE + 166,<br>IMAGE_RESULT_FILE_FD_ERROR = IMAGE_RESULT_BASE + 167,<br>IMAGE_RESULT_FILE_DAMAGED = IMAGE_RESULT_BASE + 168,<br>IMAGE_RESULT_CREATE_DECODER_FAILED = IMAGE_RESULT_BASE + 169,<br>IMAGE_RESULT_CREATE_ENCODER_FAILED = IMAGE_RESULT_BASE + 170,<br>IMAGE_RESULT_CHECK_FORMAT_ERROR = IMAGE_RESULT_BASE + 171,<br>IMAGE_RESULT_THIRDPART_SKIA_ERROR = IMAGE_RESULT_BASE + 172,<br>IMAGE_RESULT_HW_DECODE_FAILED = IMAGE_RESULT_BASE + 173,<br>IMAGE_RESULT_ALLOCATER_TYPE_ERROR = IMAGE_RESULT_BASE + 174,<br>IMAGE_RESULT_ALPHA_TYPE_ERROR = IMAGE_RESULT_BASE + 175,<br>IMAGE_RESULT_INDEX_INVALID = IMAGE_RESULT_BASE + 176,<br>IMAGE_RESULT_MEDIA_UNKNOWN = IMAGE_RESULT_BASE + 200<br>} | Enumerates the return values that may be used by the interface.|
| { OHOS_PIXEL_MAP_ALPHA_TYPE_UNKNOWN = 0,<br>OHOS_PIXEL_MAP_ALPHA_TYPE_OPAQUE = 1,<br>OHOS_PIXEL_MAP_ALPHA_TYPE_PREMUL = 2,<br>OHOS_PIXEL_MAP_ALPHA_TYPE_UNPREMUL = 3 } | Enumerates the pixel map alpha types.|
| { OHOS_PIXEL_MAP_READ_ONLY = 0,<br>OHOS_PIXEL_MAP_EDITABLE = 1 } | Enumerates the pixel map editing types.|
| { OHOS::Media::OHOS_IMAGE_RESULT_SUCCESS = 0,<br>OHOS::Media::OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | Enumerates the error codes returned by the functions.|
| { OHOS::Media::OHOS_PIXEL_MAP_FORMAT_NONE = 0,<br>OHOS::Media::OHOS_PIXEL_MAP_FORMAT_RGBA_8888 = 3,<br>OHOS::Media::OHOS_PIXEL_MAP_FORMAT_RGB_565 = 2 } | Enumerates the pixel map formats.|
| { OHOS::Media::OHOS_PIXEL_MAP_SCALE_MODE_FIT_TARGET_SIZE = 0,<br>OHOS::Media::OHOS_PIXEL_MAP_SCALE_MODE_CENTER_CROP = 1 } | Enumerates the pixel map scale modes.|
### Functions
| Name| Description|
| -------- | -------- |
| [OH_GetImageInfo](#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) struct.|
| [OH_AccessPixels](#oh_accesspixels) (napi_env env, napi_value value, void \*\*addrPtr) | Obtains the memory address of a **PixelMap** object and locks the memory.|
| [OH_UnAccessPixels](#oh_unaccesspixels) (napi_env env, napi_value value) | Unlocks the memory of a **PixelMap** object. This function is used with [OH_AccessPixels](#oh_accesspixels) in pairs.|
| [OHOS::Media::OH_Image_InitImageNative](#oh_image_initimagenative) (napi_env env, napi_value source) | Parses an **ImageNative** object from an **Image** object at the JavaScript native layer.|
| [OHOS::Media::OH_Image_ClipRect](#oh_image_cliprect) (const [ImageNative](#imagenative) \*native, struct [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) \*rect) | Obtains [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Size](#oh_image_size) (const [ImageNative](#imagenative) \*native, struct [OhosImageSize](_ohos_image_size.md) \*size) | Obtains [OhosImageSize](_ohos_image_size.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Format](#oh_image_format) (const [ImageNative](#imagenative) \*native, int32_t \*format) | Obtains the image format of an **ImageNative** object.|
| [OHOS::Media::OH_Image_GetComponent](#oh_image_getcomponent) (const [ImageNative](#imagenative) \*native, int32_t componentType, struct [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) \*componentNative) | Obtains [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Release](#oh_image_release) ([ImageNative](#imagenative) \*native) | Releases an **ImageNative** object.|
| [OH_PixelMap_CreatePixelMap](#oh_pixelmap_createpixelmap) (napi_env env, [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md) info, void \*buf, size_t len, napi_value \*res) | Creates a **PixelMap** object.|
| [OH_PixelMap_CreateAlphaPixelMap](#oh_pixelmap_createalphapixelmap) (napi_env env, napi_value source, napi_value \*alpha) | Creates a **PixelMap** object that contains only alpha channel information.|
| [OH_PixelMap_InitNativePixelMap](#oh_pixelmap_initnativepixelmap) (napi_env env, napi_value source) | Initializes a **PixelMap** object.|
| [OH_PixelMap_GetBytesNumberPerRow](#oh_pixelmap_getbytesnumberperrow) (const [NativePixelMap](#nativepixelmap) \*native, int32_t \*num) | Obtains the number of bytes per row of a **PixelMap** object.|
| [OH_PixelMap_GetIsEditable](#oh_pixelmap_getiseditable) (const [NativePixelMap](#nativepixelmap) \*native, int32_t \*[editable](image__pixel__map__napi_8h.md#editable)) | Checks whether a **PixelMap** object is editable.|
| [OH_PixelMap_IsSupportAlpha](#oh_pixelmap_issupportalpha) (const [NativePixelMap](#nativepixelmap) \*native, int32_t \*alpha) | Checks whether a **PixelMap** object supports alpha channels.|
| [OH_PixelMap_SetAlphaAble](#oh_pixelmap_setalphaable) (const [NativePixelMap](#nativepixelmap) \*native, int32_t alpha) | Sets an alpha channel for a **PixelMap** object.|
| [OH_PixelMap_GetDensity](#oh_pixelmap_getdensity) (const [NativePixelMap](#nativepixelmap) \*native, int32_t \*density) | Obtains the pixel density of a **PixelMap** object.|
| [OH_PixelMap_SetDensity](#oh_pixelmap_setdensity) (const [NativePixelMap](#nativepixelmap) \*native, int32_t density) | Sets the pixel density for a **PixelMap** object.|
| [OH_PixelMap_SetOpacity](#oh_pixelmap_setopacity) (const [NativePixelMap](#nativepixelmap) \*native, float opacity) | Sets the opacity for a **PixelMap** object.|
| [OH_PixelMap_Scale](#oh_pixelmap_scale) (const [NativePixelMap](#nativepixelmap) \*native, float x, float y) | Scales a **PixelMap** object.|
| [OH_PixelMap_Translate](#oh_pixelmap_translate) (const [NativePixelMap](#nativepixelmap) \*native, float x, float y) | Translates a **PixelMap** object.|
| [OH_PixelMap_Rotate](#oh_pixelmap_rotate) (const [NativePixelMap](#nativepixelmap) \*native, float angle) | Rotates a **PixelMap** object.|
| [OH_PixelMap_Flip](#oh_pixelmap_flip) (const [NativePixelMap](#nativepixelmap) \*native, int32_t x, int32_t y) | Flips a **PixelMap** object.|
| [OH_PixelMap_Crop](#oh_pixelmap_crop) (const [NativePixelMap](#nativepixelmap) \*native, int32_t x, int32_t y, int32_t [width](image__pixel__map__napi_8h.md#width), int32_t [height](image__pixel__map__napi_8h.md#height)) | Crops a **PixelMap** object.|
| [OH_PixelMap_GetBytesNumberPerRow](#oh_pixelmap_getbytesnumberperrow) (const [NativePixelMap](#nativepixelmap) \*native, int32_t \*num) | Obtains the number of bytes per row of a **NativePixelMap** object.|
| [OH_PixelMap_GetIsEditable](#oh_pixelmap_getiseditable) (const [NativePixelMap](#nativepixelmap) \*native, int32_t \*editable) | Checks whether a **NativePixelMap** object is editable.|
| [OH_PixelMap_IsSupportAlpha](#oh_pixelmap_issupportalpha) (const [NativePixelMap](#nativepixelmap) \*native, int32_t \*alpha) | Checks whether a **NativePixelMap** object supports alpha channels.|
| [OH_PixelMap_SetAlphaAble](#oh_pixelmap_setalphaable) (const [NativePixelMap](#nativepixelmap) \*native, int32_t alpha) | Sets an alpha channel for a **NativePixelMap** object.|
| [OH_PixelMap_GetDensity](#oh_pixelmap_getdensity) (const [NativePixelMap](#nativepixelmap) \*native, int32_t \*density) | Obtains the pixel density of a **NativePixelMap** object.|
| [OH_PixelMap_SetDensity](#oh_pixelmap_setdensity) (const [NativePixelMap](#nativepixelmap) \*native, int32_t density) | Sets the pixel density for a **NativePixelMap** object.|
| [OH_PixelMap_SetOpacity](#oh_pixelmap_setopacity) (const [NativePixelMap](#nativepixelmap) \*native, float opacity) | Sets the opacity for a **NativePixelMap** object.|
| [OH_PixelMap_Scale](#oh_pixelmap_scale) (const [NativePixelMap](#nativepixelmap) \*native, float x, float y) | Scales a **NativePixelMap** object.|
| [OH_PixelMap_Translate](#oh_pixelmap_translate) (const [NativePixelMap](#nativepixelmap) \*native, float x, float y) | Translates a **NativePixelMap** object.|
| [OH_PixelMap_Rotate](#oh_pixelmap_rotate) (const [NativePixelMap](#nativepixelmap) \*native, float angle) | Rotates a **NativePixelMap** object.|
| [OH_PixelMap_Flip](#oh_pixelmap_flip) (const [NativePixelMap](#nativepixelmap) \*native, int32_t x, int32_t y) | Flips a **NativePixelMap** object.|
| [OH_PixelMap_Crop](#oh_pixelmap_crop) (const [NativePixelMap](#nativepixelmap) \*native, int32_t x, int32_t y, int32_t width, int32_t height) | Crops a **NativePixelMap** object.|
| [OH_PixelMap_GetImageInfo](#oh_pixelmap_getimageinfo) (const [NativePixelMap](#nativepixelmap) \*native, [OhosPixelMapInfos](_ohos_pixel_map_infos.md) \*info) | Obtains the image information of a **NativePixelMap** object.|
| [OH_PixelMap_AccessPixels](#oh_pixelmap_accesspixels) (const [NativePixelMap](#nativepixelmap) \*native, void \*\*addr) | Obtains the memory address of a **NativePixelMap** object and locks the memory.|
| [OH_PixelMap_UnAccessPixels](#oh_pixelmap_unaccesspixels) (const [NativePixelMap](#nativepixelmap) \*native) | Unlocks the memory of a **NativePixelMap** object. This function is used with [OH_PixelMap_AccessPixels](#oh_pixelmap_accesspixels) in pairs.|
| [OHOS::Media::OH_GetImageInfo](#oh_getimageinfo) (napi_env env, napi_value value, [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) \*info) | Obtains the information about a **PixelMap** object and stores the information to the [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) struct.|
| [OHOS::Media::OH_AccessPixels](#oh_accesspixels) (napi_env env, napi_value value, void \*\*addrPtr) | Obtains the memory address of a **PixelMap** object and locks the memory.|
| [OHOS::Media::OH_UnAccessPixels](#oh_unaccesspixels) (napi_env env, napi_value value) | Unlocks the memory of a **PixelMap** object. This function is used with **OH_AccessPixels** in pairs.|
| [OH_Image_Receiver_CreateImageReceiver](#oh_image_receiver_createimagereceiver) (napi_env env, struct [OhosImageReceiverInfo](_ohos_image_receiver_info.md) info, napi_value \*res) | Creates an **ImageReceiver** object at the application layer.|
| [OH_Image_Receiver_InitImageReceiverNative](#oh_image_receiver_initimagereceivernative) (napi_env env, napi_value source) | Initializes an [ImageReceiverNative](#imagereceivernative) object through an **ImageReceiver** object.|
| [OH_Image_Receiver_GetReceivingSurfaceId](#oh_image_receiver_getreceivingsurfaceid) (const [ImageReceiverNative](#imagereceivernative) \*native, char \*id, size_t len) | Obtains the receiver ID through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_ReadLatestImage](#oh_image_receiver_readlatestimage) (const [ImageReceiverNative](#imagereceivernative) \*native, napi_value \*image) | Obtains the latest image through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_ReadNextImage](#oh_image_receiver_readnextimage) (const [ImageReceiverNative](#imagereceivernative) \*native, napi_value \*image) | Obtains the next image through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_On](#oh_image_receiver_on) (const [ImageReceiverNative](#imagereceivernative) \*native, [OH_Image_Receiver_On_Callback](#oh_image_receiver_on_callback) callback) | Registers an [OH_Image_Receiver_On_Callback](#oh_image_receiver_on_callback) callback. This callback is triggered whenever a new image is received.|
| [OH_Image_Receiver_GetSize](#oh_image_receiver_getsize) (const [ImageReceiverNative](#imagereceivernative) \*native, struct [OhosImageSize](_ohos_image_size.md) \*size) | Obtains the size of the image receiver through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_GetCapacity](#oh_image_receiver_getcapacity) (const [ImageReceiverNative](#imagereceivernative) \*native, int32_t \*capacity) | Obtains the capacity of the image receiver through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_GetFormat](#oh_image_receiver_getformat) (const [ImageReceiverNative](#imagereceivernative) \*native, int32_t \*format) | Obtains the format of the image receiver through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_Release](#oh_image_receiver_release) ([ImageReceiverNative](#imagereceivernative) \*native) | Releases an [ImageReceiverNative](#imagereceivernative) object. Note: This function is not used to release an **ImageReceiver** object.|
| [OH_ImageSource_Create](#oh_imagesource_create) (napi_env env, struct [OhosImageSource](_ohos_image_source.md) \*src, struct [OhosImageSourceOps](_ohos_image_source_ops.md) \*ops, napi_value \*res) | Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs.|
| [OH_ImageSource_CreateIncremental](#oh_imagesource_createincremental) (napi_env env, struct [OhosImageSource](_ohos_image_source.md) \*source, struct [OhosImageSourceOps](_ohos_image_source_ops.md) \*ops, napi_value \*res) | Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs. The image source data will be updated through **OH_ImageSource_UpdateData**.|
| [OH_ImageSource_GetSupportedFormats](#oh_imagesource_getsupportedformats) (struct [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) \*res) | Obtains all supported decoding formats.|
| [OH_ImageSource_InitNative](#oh_imagesource_initnative) (napi_env env, napi_value source) | Converts an **ImageSource** object at the JavaScript native layer to an [ImageSourceNative](#imagesourcenative) object.|
| [OH_ImageSource_CreatePixelMap](#oh_imagesource_createpixelmap) (const [ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageDecodingOps](_ohos_image_decoding_ops.md) \*ops, napi_value \*res) | Decodes an **ImageSourceNative** object to obtain a **PixelMap** object at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.|
| [OH_ImageSource_CreatePixelMapList](#oh_imagesource_createpixelmaplist) (const [ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageDecodingOps](_ohos_image_decoding_ops.md) \*ops, napi_value \*res) | Decodes an **ImageSourceNative** object to obtain all **PixelMap** objects at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.|
| [OH_ImageSource_GetDelayTime](#oh_imagesource_getdelaytime) (const [ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md) \*res) | Obtains the delay time list from an **ImageSourceNative** object (such as GIF image source).|
| [OH_ImageSource_GetFrameCount](#oh_imagesource_getframecount) (const [ImageSourceNative](#imagesourcenative) \*native, uint32_t \*res) | Obtains the number of frames from an **ImageSourceNative** object.|
| [OH_ImageSource_GetImageInfo](#oh_imagesource_getimageinfo) (const [ImageSourceNative](#imagesourcenative) \*native, int32_t index, struct [OhosImageSourceInfo](_ohos_image_source_info.md) \*info) | Obtains image source information from an **ImageSourceNative** object by index.|
| [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) (const [ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageSourceProperty](_ohos_image_source_property.md) \*key, struct [OhosImageSourceProperty](_ohos_image_source_property.md) \*value) | Obtains the value of an image property from an **ImageSourceNative** object.|
| [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty) (const [ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageSourceProperty](_ohos_image_source_property.md) \*key, struct [OhosImageSourceProperty](_ohos_image_source_property.md) \*value) | Modifies the value of an image property of an **ImageSourceNative** object.|
| [OH_ImageSource_UpdateData](#oh_imagesource_updatedata) (const [ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageSourceUpdateData](_ohos_image_source_update_data.md) \*data) | Updates the data of an **ImageSourceNative** object.|
| [OH_ImageSource_Release](#oh_imagesource_release) ([ImageSourceNative](#imagesourcenative) \*native) | Releases an **ImageSourceNative** object.|
### Variables
| Name| Description|
| -------- | -------- |
| [OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE](#ohos_image_property_bits_per_sample) = "BitsPerSample" | Defines a pointer to bits per sample, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_ORIENTATION](#ohos_image_property_orientation) = "Orientation" | Defines a pointer to the orientation, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_IMAGE_LENGTH](#ohos_image_property_image_length) = "ImageLength" | Defines a pointer to the image length, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_IMAGE_WIDTH](#ohos_image_property_image_width) = "ImageWidth" | Defines a pointer to the image width, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_GPS_LATITUDE](#ohos_image_property_gps_latitude) = "GPSLatitude" | Defines a pointer to the GPS latitude, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_GPS_LONGITUDE](#ohos_image_property_gps_longitude) = "GPSLongitude" | Defines a pointer to the GPS longitude, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF](#ohos_image_property_gps_latitude_ref) = "GPSLatitudeRef" | Defines a pointer to the GPS latitude reference information, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF](#ohos_image_property_gps_longitude_ref) = "GPSLongitudeRef" | Defines a pointer to the GPS longitude reference information, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL](#ohos_image_property_date_time_original) = "DateTimeOriginal" | Defines a pointer to the created date and time, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_EXPOSURE_TIME](#ohos_image_property_exposure_time) = "ExposureTime" | Defines a pointer to the exposure time, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_SCENE_TYPE](#ohos_image_property_scene_type) = "SceneType" | Defines a pointer to the scene type, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS](#ohos_image_property_iso_speed_ratings) = "ISOSpeedRatings" | Defines a pointer to the ISO speed ratings, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_F_NUMBER](#ohos_image_property_f_number) = "FNumber" | Defines a pointer to the f-number of the image, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL](#ohos_image_property_compressed_bits_per_pixel) = "CompressedBitsPerPixel" | Defines a pointer to the compressed bits per pixel, one of the image properties.|
| [OhosImageRegion::x](#x) | Defines the X coordinate of the start point, in pixels.|
| [OhosImageRegion::y](#y) | Defines the Y coordinate of the start point, in pixels.|
| [OhosImageRegion::width](#width) | Defines the width of the region, in pixels.|
| [OhosImageRegion::height](#height) | Defines the height of the region, in pixels.|
| [OhosImageSourceOps::density](#density-12) | Defines the pixel density of the image source.|
| [OhosImageSourceOps::pixelFormat](#pixelformat-13) | Defines the pixel format of the image source. It is usually used to describe the YUV buffer.|
| [OhosImageSourceOps::size](#size-17) | Defines the pixel width and height of the image source.|
| [OhosImageDecodingOps::editable](#editable) | Defines whether the output pixel map is editable.|
| [OhosImageDecodingOps::pixelFormat](#pixelformat-23) | Defines the pixel format of the output pixel map.|
| [OhosImageDecodingOps::fitDensity](#fitdensity) | Defines the pixel density of the output pixel map.|
| [OhosImageDecodingOps::index](#index) | Defines the index of the output pixel map.|
| [OhosImageDecodingOps::sampleSize](#samplesize) | Defines the size of the sample.|
| [OhosImageDecodingOps::rotate](#rotate) | Defines the decoding rotation option.|
| [OhosImageDecodingOps::size](#size-27) | Defines the pixel width and height of the output pixel map.|
| [OhosImageDecodingOps::region](#region) | Defines the region of the output pixel map.|
| [OhosImageSourceInfo::pixelFormat](#pixelformat-33) | Defines the pixel format of the image source. It is set in [OH_ImageSource_Create](#oh_imagesource_create).|
| [OhosImageSourceInfo::colorSpace](#colorspace) | Defines the color space of the image source.|
| [OhosImageSourceInfo::alphaType](#alphatype) | Defines the alpha type of the image source.|
| [OhosImageSourceInfo::density](#density-22) | Defines the image density of the image source. It is set in [OH_ImageSource_Create](#oh_imagesource_create).|
| [OhosImageSourceInfo::size](#size-37) | Defines the pixel width and height of the image source.|
| [OhosImageSource::uri](#uri) = nullptr | Defines a pointer to the image source URI. Only a file URI or Base64 URI is accepted.|
| [OhosImageSource::uriSize](#urisize) = 0 | Defines the length of the image source URI.|
| [OhosImageSource::fd](#fd) = -1 | Defines the descriptor of the image source.|
| [OhosImageSource::buffer](#buffer-12) = nullptr | Defines a pointer to the image source buffer. Only a formatted packet buffer or Base64 buffer is accepted.|
| [OhosImageSource::bufferSize](#buffersize-12) = 0 | Defines the size of the image source buffer.|
| [OhosImageSourceDelayTimeList::delayTimeList](#delaytimelist) | Defines a pointer to the head of the image source delay time list.|
| [OhosImageSourceDelayTimeList::size](#size-47) = 0 | Defines the size of the image source delay time list.|
| [OhosImageSourceSupportedFormat::format](#format) = nullptr | Defines a pointer to the head of the format string.|
| [OhosImageSourceSupportedFormat::size](#size-57) = 0 | Defines the size of the format string.|
| [OhosImageSourceSupportedFormatList::supportedFormatList](#supportedformatlist) = nullptr | Defines a double pointer to the head of the format string list.|
| [OhosImageSourceSupportedFormatList::size](#size-67) = 0 | Defines the size of the format string list.|
| [OhosImageSourceProperty::value](#value) = nullptr | Defines a pointer to the head of the property string.|
| [OhosImageSourceProperty::size](#size-77) = 0 | Defines the size of the property string.|
| [OhosImageSourceUpdateData::buffer](#buffer-22) = nullptr | Defines a pointer to the buffer for storing the update data.|
| [OhosImageSourceUpdateData::bufferSize](#buffersize-22) = 0 | Defines the size of the buffer.|
| [OhosImageSourceUpdateData::offset](#offset) = 0 | Defines the offset of the update data in the buffer.|
| [OhosImageSourceUpdateData::updateLength](#updatelength) = 0 | Defines the length of the update data in the buffer.|
| [OhosImageSourceUpdateData::isCompleted](#iscompleted) = 0 | Defines whether the image source data update is completed.|
## Type Description
### NativePixelMap
### ImageNative
```
typedef struct NativePixelMap
typedef struct ImageNative_ OHOS::Media::ImageNative
```
**Description**
Defines the data type name of the native pixel map.
Defines an image object at the native layer.
**Since**
10
## Enum Description
### ImageReceiverNative
```
typedef struct ImageReceiverNative_ ImageReceiverNative
```
### anonymous enum
**Description**
Defines the data type name of the image receiver at the native layer.
**Since**
10
### ImageSourceNative
```
anonymous enum
typedef struct ImageSourceNative_ ImageSourceNative
```
**Description**
Enumerates the error codes returned by the functions.
Defines an image source object at the native layer.
| Value| Description|
| -------- | -------- |
| OHOS_IMAGE_RESULT_SUCCESS| Operation success.|
| OHOS_IMAGE_RESULT_BAD_PARAMETER| Invalid value.|
\@Syscap SystemCapability.Multimedia.Image
**Since**
8
10
### anonymous enum
### NativePixelMap
```
anonymous enum
typedef struct NativePixelMap_ NativePixelMap
```
**Description**
Enumerates the pixel formats.
**Description**
| Value| Description|
| -------- | -------- |
| OHOS_PIXEL_MAP_FORMAT_NONE| Unknown format.|
| OHOS_PIXEL_MAP_FORMAT_RGBA_8888| 32-bit RGBA, with 8 bits each for R (red), G (green), B (blue), and A (alpha). The data is stored from the most significant bit to the least significant bit.|
| OHOS_PIXEL_MAP_FORMAT_RGB_565| 16-bit RGB, with 5, 6, and 5 bits for R, G, and B, respectively. The storage sequence is from the most significant bit to the least significant bit.|
Defines the data type name of the pixel map at the native layer.
**Since**
8
10
### anonymous enum
### OH_Image_Receiver_On_Callback
```
anonymous enum
typedef void(* OH_Image_Receiver_On_Callback) ()
```
**Description**
Enumerates the pixel map alpha types.
**Description**
| Value| Description|
| -------- | -------- |
| OHOS_PIXEL_MAP_ALPHA_TYPE_UNKNOWN| Unknown format.|
| OHOS_PIXEL_MAP_ALPHA_TYPE_OPAQUE| Opaque format.|
| OHOS_PIXEL_MAP_ALPHA_TYPE_PREMUL| Premultiplied format.|
| OHOS_PIXEL_MAP_ALPHA_TYPE_UNPREMUL| Unpremultiplied format.|
Defines the callbacks for the image interface at the native layer.
**Since**
10
### anonymous enum
### OhosPixelMapInfos
```
anonymous enum
typedef struct OhosPixelMapInfosOhosPixelMapInfos
```
**Description**
Enumerates the pixel map scale modes.
**Description**
| Value| Description|
| -------- | -------- |
| OHOS_PIXEL_MAP_SCALE_MODE_FIT_TARGET_SIZE| Adaptation to the target image size.|
| OHOS_PIXEL_MAP_SCALE_MODE_CENTER_CROP| Cropping the center portion of an image to the target size.|
Defines the information about a pixel map.
**Since**
10
### anonymous enum
## Enum Description
### anonymous enum [1/3]
```
anonymous enum
```
**Description**
Enumerates the pixel map editing types.
Enumerates the image formats.
**Since**
10
| Value| Description|
| -------- | -------- |
| OHOS_PIXEL_MAP_READ_ONLY| Read-only.|
| OHOS_PIXEL_MAP_EDITABLE| Editable.|
| OHOS_IMAGE_FORMAT_YCBCR_422_SP | YCbCr422 semi-planar format.|
| OHOS_IMAGE_FORMAT_JPEG | JPEG encoding format.|
**Since**
10
### anonymous enum [2/3]
```
anonymous enum
```
## Function Description
**Description**
Enumerates the pixel map alpha types.
**Since**
10
| Value| Description|
| -------- | -------- |
| OHOS_PIXEL_MAP_ALPHA_TYPE_UNKNOWN | Unknown format.|
| OHOS_PIXEL_MAP_ALPHA_TYPE_OPAQUE | Opaque format.|
| OHOS_PIXEL_MAP_ALPHA_TYPE_PREMUL | Premultiplied format.|
| OHOS_PIXEL_MAP_ALPHA_TYPE_UNPREMUL | Unpremultiplied format.|
### OH_AccessPixels()
### anonymous enum [3/3]
```
int32_t OH_AccessPixels (napi_env env, napi_value value, void ** addrPtr )
anonymous enum
```
**Description**
Obtains the memory address of a **PixelMap** object and locks the memory.
Enumerates the error codes returned by the functions.
After the function is executed successfully, **\*addrPtr** is the address of the memory to be accessed. After the access operation is complete, you must use [OH_UnAccessPixels](#oh_unaccesspixels) to unlock the memory. Otherwise, the resources in the memory cannot be released. After the memory is unlocked, its address cannot be accessed or operated.
**Since**
**Parameters**
8
| Name| Description|
**Deprecated from**
10
| Value| Description|
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| value | Indicates the **PixelMap** object at the application layer.|
| addrPtr | Indicates the double pointer to the memory address.|
| OHOS_IMAGE_RESULT_SUCCESS | Operation success.|
| OHOS_IMAGE_RESULT_BAD_PARAMETER | Invalid parameter.|
**See**
UnAccessPixels
### anonymous enum [1/3]
**Returns**
```
anonymous enum
```
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful; returns an error code otherwise.
**Description**
Enumerates the image components.
**Since**
8
10
| Value| Description|
| -------- | -------- |
| OHOS_IMAGE_COMPONENT_FORMAT_YUV_Y | Luminance component.|
| OHOS_IMAGE_COMPONENT_FORMAT_YUV_U | Chrominance component - blue projection.|
| OHOS_IMAGE_COMPONENT_FORMAT_YUV_V | Chrominance component - red projection.|
| OHOS_IMAGE_COMPONENT_FORMAT_JPEG | JPEG format.|
### OH_GetImageInfo()
### anonymous enum [2/3]
```
struct OhosPixelMapCreateOps OH_GetImageInfo (napi_env env, napi_value value, OhosPixelMapInfo * info )
anonymous enum
```
**Description**
Obtains the **PixelMap** information and stores the information to the [OhosPixelMapInfo](_ohos_pixel_map_info.md) struct.
Enumerates the pixel map editing types.
**Parameters**
**Since**
| Name| Description|
10
| Value| Description|
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| value | Indicates the **PixelMap** object at the application layer.|
| info | Indicates the pointer to the object that stores the information obtained. For details, see [OhosPixelMapInfo](_ohos_pixel_map_info.md).|
| OHOS_PIXEL_MAP_READ_ONLY | Read-only.|
| OHOS_PIXEL_MAP_EDITABLE | Editable.|
**Returns**
Returns **0** if the information is obtained and stored successfully; returns an error code otherwise.
### anonymous enum [3/3]
**See**
```
anonymous enum
```
**Description**
[OhosPixelMapInfo](_ohos_pixel_map_info.md)
Enumerates the pixel map formats.
**Since**
8
**Deprecated from**
### OH_PixelMap_CreateAlphaPixelMap()
10
| Value| Description|
| -------- | -------- |
| OHOS_PIXEL_MAP_FORMAT_NONE | Unknown format.|
| OHOS_PIXEL_MAP_FORMAT_RGBA_8888 | 32-bit RGBA, with 8 bits each for R (red), G (green), B (blue), and A (alpha). The data is stored from the most significant bit to the least significant bit.|
| OHOS_PIXEL_MAP_FORMAT_RGB_565 | 16-bit RGB, with 5, 6, and 5 bits for R, G, and B, respectively. The storage sequence is from the most significant bit to the least significant bit.|
### anonymous enum
```
int32_t OH_PixelMap_CreateAlphaPixelMap (napi_env env, napi_value source, napi_value * alpha )
anonymous enum
```
**Description**
Creates a **PixelMap** object that contains only alpha channel information.
Enumerates the pixel map scale modes.
**Parameters**
**Since**
| Name| Description|
10
| Value| Description|
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| source | Indicates the options for setting the **PixelMap** object.|
| alpha | Indicates the pointer to the alpha channel.|
| OHOS_PIXEL_MAP_SCALE_MODE_FIT_TARGET_SIZE | Adapting to the target image size.|
| OHOS_PIXEL_MAP_SCALE_MODE_CENTER_CROP | Cropping the center portion of an image to the target size.|
**Returns**
Returns a **PixelMap** object if the operation is successful; returns an error code otherwise.
### IRNdkErrCode
**See**
```
enum IRNdkErrCode
```
CreateAlphaPixelMap
**Description**
Enumerates the return values that may be used by the interface.
**Since**
10
| Value| Description|
| -------- | -------- |
| IMAGE_RESULT_SUCCESS | Operation success.|
| IMAGE_RESULT_BAD_PARAMETER | Invalid parameter.|
| IMAGE_RESULT_IMAGE_RESULT_BASE | Operation failed.|
| IMAGE_RESULT_ERR_IPC | IPC error.|
| IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST | Failed to share the memory.|
| IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL | Abnormal data in the shared memory.|
| IMAGE_RESULT_DECODE_ABNORMAL | Failed to decode the image.|
| IMAGE_RESULT_DATA_ABNORMAL | Abnormal input data.|
| IMAGE_RESULT_MALLOC_ABNORMAL | an error occurs during memory allocation.|
| IMAGE_RESULT_DATA_UNSUPPORT | The image type is not supported.|
| IMAGE_RESULT_INIT_ABNORMAL | Failed to initialize the image.|
| IMAGE_RESULT_GET_DATA_ABNORMAL | An error occurs during image data retrieval.|
| IMAGE_RESULT_TOO_LARGE | The image is too large.|
| IMAGE_RESULT_TRANSFORM | An error occurs during image transformation.|
| IMAGE_RESULT_COLOR_CONVERT | An error occurs during image color conversion.|
| IMAGE_RESULT_CROP | An error occurs during image cropping.|
| IMAGE_RESULT_SOURCE_DATA | The image source data is incorrect.|
| IMAGE_RESULT_SOURCE_DATA_INCOMPLETE | The image source data is incomplete.|
| IMAGE_RESULT_MISMATCHED_FORMAT | The image format does not match.|
| IMAGE_RESULT_UNKNOWN_FORMAT | Unknown image format.|
| IMAGE_RESULT_SOURCE_UNRESOLVED | The image source is not parsed.|
| IMAGE_RESULT_INVALID_PARAMETER | Invalid image parameter.|
| IMAGE_RESULT_DECODE_FAILED | Failed to decode the image.|
| IMAGE_RESULT_PLUGIN_REGISTER_FAILED | Failed to register the plug-in.|
| IMAGE_RESULT_PLUGIN_CREATE_FAILED | Failed to create the plug-in.|
| IMAGE_RESULT_ENCODE_FAILED | Failed to encode the image.|
| IMAGE_RESULT_ADD_PIXEL_MAP_FAILED | Failed to add the pixel map.|
| IMAGE_RESULT_HW_DECODE_UNSUPPORT | Hardware decoding is not supported.|
| IMAGE_RESULT_DECODE_HEAD_ABNORMAL | Failed to decode the image header.|
| IMAGE_RESULT_DECODE_EXIF_UNSUPPORT | Exchangeable Image File (EXIF) is not supported for image decoding.|
| IMAGE_RESULT_PROPERTY_NOT_EXIST | The image property does not exist.|
| IMAGE_RESULT_MEDIA_DATA_UNSUPPORT | The media type is not supported.|
| IMAGE_RESULT_MEDIA_TOO_LARGE | The media is too large.|
| IMAGE_RESULT_MEDIA_MALLOC_FAILED | Memory allocation failed.|
| IMAGE_RESULT_MEDIA_END_OF_STREAM | Failed to end the media data stream.|
| IMAGE_RESULT_MEDIA_IO_ABNORMAL | Abnormal input and output streams.|
| IMAGE_RESULT_MEDIA_MALFORMED | The media service functions abnormally.|
| IMAGE_RESULT_MEDIA_BUFFER_TOO_SMALL | The media data is too small.|
| IMAGE_RESULT_MEDIA_OUT_OF_RANGE | The media is out of range.|
| IMAGE_RESULT_MEDIA_STATUS_ABNORMAL | Abnormal media status.|
| IMAGE_RESULT_MEDIA_VALUE_INVALID | Invalid media value.|
| IMAGE_RESULT_MEDIA_NULL_POINTER | Media operation failed.|
| IMAGE_RESULT_MEDIA_INVALID_OPERATION | Invalid media operation.|
| IMAGE_RESULT_MEDIA_ERR_PLAYER_NOT_INIT | an error occurs during media initialization.|
| IMAGE_RESULT_MEDIA_EARLY_PREPARE | Media preprocessing is carried out too early.|
| IMAGE_RESULT_MEDIA_SEEK_ERR | The seek operation failed.|
| IMAGE_RESULT_MEDIA_PERMISSION_DENIED | Permission denied.|
| IMAGE_RESULT_MEDIA_DEAD_OBJECT | The media object is deregistered.|
| IMAGE_RESULT_MEDIA_TIMED_OUT | A timeout occurs.|
| IMAGE_RESULT_MEDIA_TRACK_NOT_ALL_SUPPORTED | The media capability is not supported.|
| IMAGE_RESULT_MEDIA_ADAPTER_INIT_FAILED | Failed to initialize the media adapter.|
| IMAGE_RESULT_MEDIA_WRITE_PARCEL_FAIL | Failed to write data to the parcel.|
| IMAGE_RESULT_MEDIA_READ_PARCEL_FAIL | Failed to read data from the parcel.|
| IMAGE_RESULT_MEDIA_NO_AVAIL_BUFFER | Invalid data.|
| IMAGE_RESULT_MEDIA_INVALID_PARAM | Invalid parameters.|
| IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_EXIST | The media codec adapter does not exist.|
| IMAGE_RESULT_MEDIA_CREATE_CODEC_ADAPTER_FAILED | Failed to create the media codec adapter.|
| IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_INIT | The media codec adapter is not initialized.|
| IMAGE_RESULT_MEDIA_ZCODEC_CREATE_FAILED | Failed to create the media codec.|
| IMAGE_RESULT_MEDIA_ZCODEC_NOT_EXIST | The media codec does not exist.|
| IMAGE_RESULT_MEDIA_JNI_CLASS_NOT_EXIST | The media JNI layer class does not exist.|
| IMAGE_RESULT_MEDIA_JNI_METHOD_NOT_EXIST | The media JNI layer method does not exist.|
| IMAGE_RESULT_MEDIA_JNI_NEW_OBJ_FAILED | Failed to create the object at the media JNI layer.|
| IMAGE_RESULT_MEDIA_JNI_COMMON_ERROR | The media JNI layer is abnormal.|
| IMAGE_RESULT_MEDIA_DISTRIBUTE_NOT_SUPPORT | The distributed feature is not supported.|
| IMAGE_RESULT_MEDIA_SOURCE_NOT_SET | The media source is not set.|
| IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_INIT | The media RTSP adapter is not initialized.|
| IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_EXIST | The media RTSP adapter does not exist.|
| IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT | The media does not support the RTSP surface.|
| IMAGE_RESULT_MEDIA_RTSP_CAPTURE_NOT_INIT | Failed to initialize the media RTSP capturer.|
| IMAGE_RESULT_MEDIA_RTSP_SOURCE_URL_INVALID | Invalid media RTSP source path.|
| IMAGE_RESULT_MEDIA_RTSP_VIDEO_TRACK_NOT_FOUND | No video capability is found in the media RTSP.|
| IMAGE_RESULT_MEDIA_RTSP_CAMERA_NUM_REACH_MAX | The maximum number of RTSP cameras has been reached.|
| IMAGE_RESULT_MEDIA_SET_VOLUME | Failed to set the volume.|
| IMAGE_RESULT_MEDIA_NUMBER_OVERFLOW | The number of operations overflows.|
| IMAGE_RESULT_MEDIA_DIS_PLAYER_UNSUPPORTED | The distributed media player is not supported.|
| IMAGE_RESULT_MEDIA_DENCODE_ICC_FAILED | Failed to decode the ICC.|
| IMAGE_RESULT_MEDIA_ENCODE_ICC_FAILED | Failed to encode the ICC.|
| IMAGE_RESULT_MEDIA_READ_PIXELMAP_FAILED | Failed to read the pixel map.|
| IMAGE_RESULT_MEDIA_WRITE_PIXELMAP_FAILED | Failed to write the pixel map.|
| IMAGE_RESULT_MEDIA_PIXELMAP_NOT_ALLOW_MODIFY | The pixel map cannot be modified.|
| IMAGE_RESULT_MEDIA_CONFIG_FAILED | Configuration failed.|
| IMAGE_RESULT_JNI_ENV_ABNORMAL | The JNI environment is abnormal.|
| IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED | Failed to allocate memory for the surface.|
| IMAGE_RESULT_CREATE_SURFACE_FAILED | Failed to create the surface.|
| IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED | Failed to obtain parameters from the surface.|
| IMAGE_RESULT_GET_SURFACE_FAILED | Failed to obtain the surface.|
| IMAGE_RESULT_SURFACE_ACQUIRE_BUFFER_FAILED | Failed to apply for a buffer.|
| IMAGE_RESULT_SURFACE_REQUEST_BUFFER_FAILED | Failed to request a buffer.|
| IMAGE_RESULT_REGISTER_LISTENER_FAILED | Failed to register the listener.|
| IMAGE_RESULT_REGISTER_BUFFER_FAILED | Failed to register the buffer.|
| IMAGE_RESULT_FREAD_FAILED | Failed to read the file.|
| IMAGE_RESULT_PEEK_FAILED | Failed to peek the file.|
| IMAGE_RESULT_SEEK_FAILED | Failed to seek the file.|
| IMAGE_RESULT_STREAM_SIZE_ERROR | The data stream is damaged.|
| IMAGE_RESULT_FILE_FD_ERROR | The file descriptor is damaged.|
| IMAGE_RESULT_FILE_DAMAGED | The file is damaged.|
| IMAGE_RESULT_CREATE_DECODER_FAILED | Failed to create a decoder.|
| IMAGE_RESULT_CREATE_ENCODER_FAILED | Failed to create an encoder.|
| IMAGE_RESULT_CHECK_FORMAT_ERROR | Failed to check the format.|
| IMAGE_RESULT_THIRDPART_SKIA_ERROR | Skia decoding failed.|
| IMAGE_RESULT_HW_DECODE_FAILED | Hardware decoding failed.|
| IMAGE_RESULT_ALLOCATER_TYPE_ERROR | Failed to verify the memory type.|
| IMAGE_RESULT_ALPHA_TYPE_ERROR | Failed to verify the alpha type.|
| IMAGE_RESULT_INDEX_INVALID | Invalid parameter.|
| IMAGE_RESULT_MEDIA_UNKNOWN | Unknown error.|
## Function Description
### OH_PixelMap_CreatePixelMap()
### OH_AccessPixels()
```
int32_t OH_PixelMap_CreatePixelMap (napi_env env, OhosPixelMapCreateOps info, void * buf, size_t len, napi_value * res )
int32_t OHOS::Media::OH_AccessPixels (napi_env env, napi_value value, void ** addrPtr )
```
**Description**
Creates a **PixelMap** object.
Obtains the memory address of a **PixelMap** object and locks the memory.
**\*addrPtr** is the memory address obtained. After finishing the access, you must use **OH_UnAccessPixels** to unlock the memory. Then the memory cannot be accessed or operated.
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| info | Indicates the options for setting the **PixelMap** object.|
| buf | Indicates the pointer to the buffer of the image.|
| len | Indicates the image size.|
| res | Indicates the pointer to the **PixelMap** object at the application layer.|
| env | Pointer to the NAPI environment.|
| value | **PixelMap** object at the application layer.|
| addrPtr | Double pointer to the memory address.|
**Returns**
Returns a **PixelMap** object if the operation is successful; returns an error code otherwise.
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful; returns an error code otherwise.
**See**
**Since**
CreatePixelMap
8
**Since**
**Deprecated from**
10
**See**
UnAccessPixels
### OH_PixelMap_Crop()
### OH_GetImageInfo()
```
int32_t OH_PixelMap_Crop (const NativePixelMap * native, int32_t x, int32_t y, int32_t width, int32_t height )
int32_t OHOS::Media::OH_GetImageInfo (napi_env env, napi_value value, OhosPixelMapInfo * info )
```
**Description**
Crops a **PixelMap** object.
Obtains the information about a **PixelMap** object and stores the information to the [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) struct.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| x | Indicates the x-coordinate of the upper left corner of the target image.|
| y | Indicates the y-coordinate of the upper left corner of the target image.|
| width | Indicates the width of the cropped region.|
| height | Indicates the height of the cropped region.|
| env | Pointer to the NAPI environment.|
| value | **PixelMap** object at the application layer.|
| info | Pointer to the object that stores the information obtained. For details, see [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md).|
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
Returns **0** if the information is obtained and stored successfully; returns an error code otherwise.
**See**
**Since**
Crop
8
**Since**
**Deprecated from**
10
**See**
[OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md)
### OH_PixelMap_Flip()
### OH_Image_ClipRect()
```
int32_t OH_PixelMap_Flip (const NativePixelMap * native, int32_t x, int32_t y )
int32_t OHOS::Media::OH_Image_ClipRect (const ImageNative * native, struct OhosImageRect * rect )
```
**Description**
Flips a **PixelMap** object.
Obtains [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) of an **ImageNative** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| x | Specifies whether to flip around the x axis.|
| y | Specifies whether to flip around the y axis.|
| native | Pointer to an **ImageNative** object.|
| rect | Pointer to the [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) object obtained.|
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
**See**
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Flip
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED** if parameters fail to be obtained from the surface.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
**Since**
10
**See**
ImageNative, [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md)
### OH_PixelMap_GetBytesNumberPerRow()
### OH_Image_Format()
```
int32_t OH_PixelMap_GetBytesNumberPerRow (const NativePixelMap * native, int32_t * num )
int32_t OHOS::Media::OH_Image_Format (const ImageNative * native, int32_t * format )
```
**Description**
Obtains the number of bytes per row of a **PixelMap** object.
Obtains the image format of an **ImageNative** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| num | Indicates the pointer to the number of bytes per row of the **PixelMap** object.|
| native | Pointer to an **ImageNative** object.|
| format | Pointer to the image format obtained.|
**Returns**
Returns the number of bytes per row of the **PixelMap** object if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
**See**
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
GetBytesNumberPerRow
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED** if parameters fail to be obtained from the surface.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
**Since**
10
### OH_PixelMap_GetDensity()
**See**
ImageNative
### OH_Image_GetComponent()
```
int32_t OH_PixelMap_GetDensity (const NativePixelMap * native, int32_t * density )
int32_t OHOS::Media::OH_Image_GetComponent (const ImageNative * native, int32_t componentType, struct OhosImageComponent * componentNative )
```
**Description**
Obtains the pixel density of a **PixelMap** object.
Obtains [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) of an **ImageNative** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| density | Indicates the pointer to the pixel density.|
| native | Pointer to an **ImageNative** object.|
| componentType | Type of the component.|
| componentNative | Pointer to the [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) object obtained.|
**Returns**
Returns the pixel density if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
**See**
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
GetDensity
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED** if parameters fail to be obtained from the surface.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
**Since**
10
**See**
### OH_PixelMap_GetIsEditable()
ImageNative, [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md)
### OH_Image_InitImageNative()
```
int32_t OH_PixelMap_GetIsEditable (const NativePixelMap * native, int32_t * editable )
ImageNative* OHOS::Media::OH_Image_InitImageNative (napi_env env, napi_value source )
```
**Description**
Checks whether a **PixelMap** object is editable.
Parses an **ImageNative** object from an **Image** object at the JavaScript native layer.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| editable | Indicates the pointer to the editing type of the **PixelMap** object.|
| env | Pointer to the JNI environment.|
| source | **Image** object at the JavaScript native layer.|
**Returns**
Returns an enumerated value that indicates the editing type of the **PixelMap** object if the operation is successful; returns an error code otherwise.
**See**
GetIsEditable
Returns a pointer to the **ImageNative** object if the operation is successful; returns a null pointer otherwise.
**Since**
10
**See**
ImageNative, OH_Image_Release
### OH_PixelMap_InitNativePixelMap()
### OH_Image_Receiver_CreateImageReceiver()
```
NativePixelMap* OH_PixelMap_InitNativePixelMap (napi_env env, napi_value source )
int32_t OH_Image_Receiver_CreateImageReceiver (napi_env env, struct OhosImageReceiverInfo info, napi_value * res )
```
**Description**
Initializes a **PixelMap** object.
Creates an **ImageReceiver** object at the application layer.
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| source | Indicates the options for setting the **PixelMap** object.|
| env | Pointer to the NAPI environment.|
| info | Options for setting the **ImageReceiver** object.|
| res | Pointer to the **ImageReceiver** object at the application layer.|
**Returns**
Returns a pointer to the **NativePixelMap** object if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
**See**
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
InitNativePixelMap
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if parameters fail to be obtained from the surface.
Returns **IMAGE_RESULT_CREATE_SURFACE_FAILED** if the surface fails to be created.
Returns **IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED** if the buffer fails to be allocated to the surface.
Returns **IMAGE_RESULT_GET_SURFACE_FAILED** if the surface fails to be obtained.
Returns **IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT** if the media RTSP surface is not supported.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_MEDIA_DATA_UNSUPPORT** if the media type is not supported.
**Since**
10
**See**
[OhosImageReceiverInfo](_ohos_image_receiver_info.md)
### OH_PixelMap_IsSupportAlpha()
### OH_Image_Receiver_GetCapacity()
```
int32_t OH_PixelMap_IsSupportAlpha (const NativePixelMap * native, int32_t * alpha )
int32_t OH_Image_Receiver_GetCapacity (const ImageReceiverNative * native, int32_t * capacity )
```
**Description**
Checks whether a **PixelMap** object supports alpha channels.
Obtains the capacity of the image receiver through an [ImageReceiverNative](#imagereceivernative) object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| alpha | Indicates the pointer to the support for alpha channels.|
| native | Pointer to an [ImageReceiverNative](#imagereceivernative) object.|
| capacity | Pointer to the capacity obtained.|
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
**See**
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
IsSupportAlpha
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
**Since**
10
**See**
[ImageReceiverNative](#imagereceivernative), [OhosImageSize](_ohos_image_size.md)
### OH_PixelMap_Rotate()
### OH_Image_Receiver_GetFormat()
```
int32_t OH_PixelMap_Rotate (const NativePixelMap * native, float angle )
int32_t OH_Image_Receiver_GetFormat (const ImageReceiverNative * native, int32_t * format )
```
**Description**
Rotates a **PixelMap** object.
Obtains the format of the image receiver through an [ImageReceiverNative](#imagereceivernative) object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| angle | Indicates the angle to rotate.|
| native | Pointer to an [ImageReceiverNative](#imagereceivernative) object.|
| format | Pointer to the format obtained.|
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
**See**
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Rotate
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
**Since**
10
**See**
### OH_PixelMap_Scale()
[ImageReceiverNative](#imagereceivernative)
### OH_Image_Receiver_GetReceivingSurfaceId()
```
int32_t OH_PixelMap_Scale (const NativePixelMap * native, float x, float y )
int32_t OH_Image_Receiver_GetReceivingSurfaceId (const ImageReceiverNative * native, char * id, size_t len )
```
**Description**
Scales a **PixelMap** object.
Obtains the receiver ID through an [ImageReceiverNative](#imagereceivernative) object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| x | Indicates the scaling ratio of the width.|
| y | Indicates the scaling ratio of the height.|
| native | Pointer to an [ImageReceiverNative](#imagereceivernative) object.|
| id | Pointer to the buffer that stores the ID string obtained.|
| len | Size of the buffer.|
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
**See**
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Scale
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if parameters fail to be obtained from the surface.
Returns **IMAGE_RESULT_GET_SURFACE_FAILED** if the surface fails to be obtained.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_MEDIA_DATA_UNSUPPORT** if the media type is not supported.
**Since**
10
**See**
[ImageReceiverNative](#imagereceivernative)
### OH_PixelMap_SetAlphaAble()
### OH_Image_Receiver_GetSize()
```
int32_t OH_PixelMap_SetAlphaAble (const NativePixelMap * native, int32_t alpha )
int32_t OH_Image_Receiver_GetSize (const ImageReceiverNative * native, struct OhosImageSize * size )
```
**Description**
Sets an alpha channel for a **PixelMap** object.
Obtains the size of the image receiver through an [ImageReceiverNative](#imagereceivernative) object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| alpha | Indicates the alpha channel to set.|
| native | Pointer to an [ImageReceiverNative](#imagereceivernative) object.|
| size | Pointer to the [OhosImageSize](_ohos_image_size.md) object obtained.|
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
**Since**
10
**See**
SetAlphaAble
[ImageReceiverNative](#imagereceivernative), [OH_Image_Receiver_On_Callback](#oh_image_receiver_on_callback)
### OH_Image_Receiver_InitImageReceiverNative()
```
ImageReceiverNative* OH_Image_Receiver_InitImageReceiverNative (napi_env env, napi_value source )
```
**Description**
Initializes an [ImageReceiverNative](#imagereceivernative) object through an **ImageReceiver** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Pointer to the NAPI environment.|
| source | **ImageReceiver** object.|
**Returns**
Returns a pointer to the [ImageReceiverNative](#imagereceivernative) object obtained if the operation is successful; returns a null pointer otherwise.
**Since**
10
**See**
### OH_PixelMap_SetDensity()
[ImageReceiverNative](#imagereceivernative), [OH_Image_Receiver_Release](#oh_image_receiver_release)
### OH_Image_Receiver_On()
```
int32_t OH_PixelMap_SetDensity (const NativePixelMap * native, int32_t density )
int32_t OH_Image_Receiver_On (const ImageReceiverNative * native, OH_Image_Receiver_On_Callback callback )
```
**Description**
Sets the pixel density for a **PixelMap** object.
Registers an [OH_Image_Receiver_On_Callback](#oh_image_receiver_on_callback) callback. This callback is triggered whenever a new image is received.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| density | Indicates the pixel density to set.|
| native | Pointer to an [ImageReceiverNative](#imagereceivernative) object.|
| callback | [OH_Image_Receiver_On_Callback](#oh_image_receiver_on_callback) callback to register.|
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if parameters fail to be obtained from the surface.
Returns **IMAGE_RESULT_GET_SURFACE_FAILED** if the surface fails to be obtained.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_MEDIA_DATA_UNSUPPORT** if the media type is not supported.
**Since**
10
**See**
GetDensity
[ImageReceiverNative](#imagereceivernative)
### OH_Image_Receiver_ReadLatestImage()
```
int32_t OH_Image_Receiver_ReadLatestImage (const ImageReceiverNative * native, napi_value * image )
```
**Description**
Obtains the latest image through an [ImageReceiverNative](#imagereceivernative) object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageReceiverNative](#imagereceivernative) object.|
| image | Pointer to an **Image** object at the application layer.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if parameters fail to be obtained from the surface.
Returns **IMAGE_RESULT_CREATE_SURFACE_FAILED** if the surface fails to be created.
Returns **IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED** if the buffer fails to be allocated to the surface.
Returns **IMAGE_RESULT_GET_SURFACE_FAILED** if the surface fails to be obtained.
Returns **IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT** if the media RTSP surface is not supported.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_MEDIA_DATA_UNSUPPORT** if the media type is not supported.
**Since**
10
**See**
[ImageReceiverNative](#imagereceivernative)
### OH_PixelMap_SetOpacity()
### OH_Image_Receiver_ReadNextImage()
```
int32_t OH_PixelMap_SetOpacity (const NativePixelMap * native, float opacity )
int32_t OH_Image_Receiver_ReadNextImage (const ImageReceiverNative * native, napi_value * image )
```
**Description**
Sets the opacity for a **PixelMap** object.
Obtains the next image through an [ImageReceiverNative](#imagereceivernative) object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| opacity | Indicates the opacity to set.|
| native | Pointer to an [ImageReceiverNative](#imagereceivernative) object.|
| image | Pointer to an **Image** object at the application layer.|
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if parameters fail to be obtained from the surface.
Returns **IMAGE_RESULT_CREATE_SURFACE_FAILED** if the surface fails to be created.
Returns **IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED** if the buffer fails to be allocated to the surface.
Returns **IMAGE_RESULT_GET_SURFACE_FAILED** if the surface fails to be obtained.
Returns **IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT** if the media RTSP surface is not supported.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_MEDIA_DATA_UNSUPPORT** if the media type is not supported.
**Since**
10
**See**
SetOpacity
[ImageReceiverNative](#imagereceivernative)
### OH_Image_Receiver_Release()
```
int32_t OH_Image_Receiver_Release (ImageReceiverNative * native)
```
**Description**
Releases an [ImageReceiverNative](#imagereceivernative) object. Note: This function is not used to release an **ImageReceiver** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageReceiverNative](#imagereceivernative) object.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
**Since**
10
**See**
### OH_PixelMap_Translate()
[ImageReceiverNative](#imagereceivernative)
### OH_Image_Release()
```
int32_t OH_PixelMap_Translate (const NativePixelMap * native, float x, float y )
int32_t OHOS::Media::OH_Image_Release (ImageNative * native)
```
**Description**
Translates a **PixelMap** object.
Releases an **ImageNative** object. Note: This function is not used to release an **Image** object at the JavaScript native API. It is used to release an **ImageNative** object parsed by calling **OH_Image_InitImageNative**.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| x | Indicates the horizontal distance to translate.|
| y | Indicates the vertical distance to translate.|
| native | Pointer to an **ImageNative** object.|
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
**Since**
10
**See**
Translate
ImageNative, OH_Image_InitImageNative
### OH_Image_Size()
```
int32_t OHOS::Media::OH_Image_Size (const ImageNative * native, struct OhosImageSize * size )
```
**Description**
Obtains [OhosImageSize](_ohos_image_size.md) of an **ImageNative** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an **ImageNative** object.|
| size | Pointer to the [OhosImageSize](_ohos_image_size.md) object obtained.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED** if parameters fail to be obtained from the surface.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
**Since**
10
**See**
ImageNative, [OhosImageSize](_ohos_image_size.md)
### OH_UnAccessPixels()
### OH_ImageSource_Create()
```
int32_t OH_UnAccessPixels (napi_env env, napi_value value )
int32_t OH_ImageSource_Create (napi_env env, struct OhosImageSource * src, struct OhosImageSourceOps * ops, napi_value * res )
```
**Description**
Unlocks the memory of a **PixelMap** object. This function is used with [OH_AccessPixels](#oh_accesspixels) in pairs.
Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| value | Indicates the **PixelMap** object at the application layer.|
| env | Pointer to the JNI environment.|
| src | Pointer to the input resource of the image source. For details, see [OhosImageSource](_ohos_image_source.md).|
| ops | Pointer to the options for creating the image source. For details, see [OhosImageSourceOps](_ohos_image_source_ops.md).|
| res | Pointer to an **ImageSource** object at the JavaScript native layer.|
**Returns**
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_SOURCE_DATA_INCOMPLETE** if the image source data is incomplete.
Returns **IMAGE_RESULT_SOURCE_DATA** if the image source data is incorrect.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_TOO_LARGE** if the image is too large.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
Returns **IMAGE_RESULT_FILE_DAMAGED** if the file is damaged.
Returns **IMAGE_RESULT_FILE_FD_ERROR** if the file descriptor is incorrect.
Returns **IMAGE_RESULT_STREAM_SIZE_ERROR** if the data stream is incorrect.
Returns **IMAGE_RESULT_SEEK_FAILED** if seeking the file fails.
Returns **IMAGE_RESULT_PEEK_FAILED** if peeking the file fails.
Returns **IMAGE_RESULT_FREAD_FAILED** if reading the file fails.
**Since**
10
**See**
AccessPixels
[OhosImageSource](_ohos_image_source.md), [OhosImageSourceOps](_ohos_image_source_ops.md)
### OH_ImageSource_CreateIncremental()
```
int32_t OH_ImageSource_CreateIncremental (napi_env env, struct OhosImageSource * source, struct OhosImageSourceOps * ops, napi_value * res )
```
**Description**
Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs. The image source data will be updated through **OH_ImageSource_UpdateData**.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Pointer to the JNI environment.|
| src | Pointer to the input resource of the image source. Only the buffer type is accepted. For details, see [OhosImageSource](_ohos_image_source.md).|
| ops | Pointer to the options for creating the image source. For details, see [OhosImageSourceOps](_ohos_image_source_ops.md).|
| res | Pointer to an **ImageSource** object at the JavaScript native layer.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_SOURCE_DATA_INCOMPLETE** if the image source data is incomplete.
Returns **IMAGE_RESULT_SOURCE_DATA** if the image source data is incorrect.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_TOO_LARGE** if the image is too large.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
Returns **IMAGE_RESULT_FILE_DAMAGED** if the file is damaged.
Returns **IMAGE_RESULT_FILE_FD_ERROR** if the file descriptor is incorrect.
Returns **IMAGE_RESULT_STREAM_SIZE_ERROR** if the data stream is incorrect.
Returns **IMAGE_RESULT_SEEK_FAILED** if seeking the file fails.
Returns **IMAGE_RESULT_PEEK_FAILED** if peeking the file fails.
Returns **IMAGE_RESULT_FREAD_FAILED** if reading the file fails.
**Since**
8
\ No newline at end of file
10
**See**
[OhosImageSource](_ohos_image_source.md), [OhosImageSourceOps](_ohos_image_source_ops.md), [OH_ImageSource_UpdateData](#oh_imagesource_updatedata)
### OH_ImageSource_CreatePixelMap()
```
int32_t OH_ImageSource_CreatePixelMap (const ImageSourceNative * native, struct OhosImageDecodingOps * ops, napi_value * res )
```
**Description**
Decodes an **ImageSourceNative** object to obtain a **PixelMap** object at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| ops | Pointer to the options for decoding the image source. For details, see [OhosImageDecodingOps](_ohos_image_decoding_ops.md).|
| res | Pointer to a **PixelMap** object at the JavaScript native layer.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_CREATE_ENCODER_FAILED** if the encoder fails to be created.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if the image is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_INIT_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_ENCODE_FAILED** if the pixel map fails to be added.
Returns **IMAGE_RESULT_HW_DECODE_UNSUPPORT** if hardware decoding is not supported.
Returns **IMAGE_RESULT_HW_DECODE_FAILED** if hardware decoding fails.
Returns **IMAGE_RESULT_ERR_IPC** if IPC fails.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative), [OhosImageDecodingOps](_ohos_image_decoding_ops.md)
### OH_ImageSource_CreatePixelMapList()
```
int32_t OH_ImageSource_CreatePixelMapList (const ImageSourceNative * native, struct OhosImageDecodingOps * ops, napi_value * res )
```
**Description**
Decodes an **ImageSourceNative** object to obtain all **PixelMap** objects at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| ops | Pointer to the options for decoding the image source. For details, see [OhosImageDecodingOps](_ohos_image_decoding_ops.md).|
| res | Pointer to **PixelMap** objects at the JavaScript native layer.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_CREATE_ENCODER_FAILED** if the encoder fails to be created.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if the image is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_INIT_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_ENCODE_FAILED** if the pixel map fails to be added.
Returns **IMAGE_RESULT_HW_DECODE_UNSUPPORT** if hardware decoding is not supported.
Returns **IMAGE_RESULT_HW_DECODE_FAILED** if hardware decoding fails.
Returns **IMAGE_RESULT_ERR_IPC** if IPC fails.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative), [OhosImageDecodingOps](_ohos_image_decoding_ops.md)
### OH_ImageSource_GetDelayTime()
```
int32_t OH_ImageSource_GetDelayTime (const ImageSourceNative * native, struct OhosImageSourceDelayTimeList * res )
```
**Description**
Obtains the delay time list from an **ImageSourceNative** object (such as GIF image source).
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| res | Pointer to the [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md) object obtained. When the input **delayTimeList** is a null pointer and **size** is **0**, the size of the delay time list is returned through **size** in **res**. To obtain the complete delay time list, a space greater than **size** is required.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative), [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md)
### OH_ImageSource_GetFrameCount()
```
int32_t OH_ImageSource_GetFrameCount (const ImageSourceNative * native, uint32_t * res )
```
**Description**
Obtains the number of frames from an **ImageSourceNative** object.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| res | Pointer to the frame count.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative)
### OH_ImageSource_GetImageInfo()
```
int32_t OH_ImageSource_GetImageInfo (const ImageSourceNative * native, int32_t index, struct OhosImageSourceInfo * info )
```
**Description**
Obtains image source information from an **ImageSourceNative** object by index.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| index | Index.|
| info | Pointer to the [OhosImageSourceInfo](_ohos_image_source_info.md) object obtained.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative), [OhosImageSourceInfo](_ohos_image_source_info.md)
### OH_ImageSource_GetImageProperty()
```
int32_t OH_ImageSource_GetImageProperty (const ImageSourceNative * native, struct OhosImageSourceProperty * key, struct OhosImageSourceProperty * value )
```
**Description**
Obtains the value of an image property from an **ImageSourceNative** object.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| key | Pointer to the property. For details, see [OhosImageSourceProperty](_ohos_image_source_property.md).|
| value | Pointer to the [OhosImageSourceProperty](_ohos_image_source_property.md) object obtained. If the input **value** is a null pointer and **size** is **0**, the size of the property value is returned through **size** in **value**. To obtain the complete property value, a space greater than **size** is required.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative), [OhosImageSourceProperty](_ohos_image_source_property.md)
### OH_ImageSource_GetSupportedFormats()
```
int32_t OH_ImageSource_GetSupportedFormats (struct OhosImageSourceSupportedFormatList * res)
```
**Description**
Obtains all supported decoding formats.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| res | Pointer to the [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) struct. If the input **supportedFormatList** is a null pointer and **size** is 0, the size of the supported formats is returned through **size** in **res**.<br>To obtain all formats, a space larger than **size** is required. In addition, sufficient space must be reserved for each format supported.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
**Since**
10
**See**
[OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md), [OhosImageSourceSupportedFormat](_ohos_image_source_supported_format.md)
### OH_ImageSource_InitNative()
```
ImageSourceNative* OH_ImageSource_InitNative (napi_env env, napi_value source )
```
**Description**
Converts an **ImageSource** object at the JavaScript native layer to an [ImageSourceNative](#imagesourcenative) object.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Pointer to the JNI environment.|
| source | Pointer to an **ImageSource** object at the JavaScript native layer.|
**Returns**
Returns a pointer to the [ImageSourceNative](#imagesourcenative) object if the operation is successful; returns a null pointer otherwise.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative), [OH_ImageSource_Release](#oh_imagesource_release)
### OH_ImageSource_ModifyImageProperty()
```
int32_t OH_ImageSource_ModifyImageProperty (const ImageSourceNative * native, struct OhosImageSourceProperty * key, struct OhosImageSourceProperty * value )
```
**Description**
Modifies the value of an image property of an **ImageSourceNative** object.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| key | Pointer to the [OhosImageSourceProperty](_ohos_image_source_property.md) object obtained.|
| value | Pointer to the new value of the property.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative), [OhosImageSourceProperty](_ohos_image_source_property.md)
### OH_ImageSource_Release()
```
int32_t OH_ImageSource_Release (ImageSourceNative * native)
```
**Description**
Releases an **ImageSourceNative** object.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative), [OH_ImageSource_Create](#oh_imagesource_create), [OH_ImageSource_CreateIncremental](#oh_imagesource_createincremental)
### OH_ImageSource_UpdateData()
```
int32_t OH_ImageSource_UpdateData (const ImageSourceNative * native, struct OhosImageSourceUpdateData * data )
```
**Description**
Updates the data of an **ImageSourceNative** object.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| data | Pointer to the update data. For details, see [OhosImageSourceUpdateData](_ohos_image_source_update_data.md).|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_CREATE_ENCODER_FAILED** if the encoder fails to be created.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if the image is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_INIT_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_ENCODE_FAILED** if the pixel map fails to be added.
Returns **IMAGE_RESULT_HW_DECODE_UNSUPPORT** if hardware decoding is not supported.
Returns **IMAGE_RESULT_HW_DECODE_FAILED** if hardware decoding fails.
Returns **IMAGE_RESULT_ERR_IPC** if IPC fails.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
[ImageSourceNative](#imagesourcenative), [OhosImageSourceUpdateData](_ohos_image_source_update_data.md)
### OH_PixelMap_AccessPixels()
```
int32_t OH_PixelMap_AccessPixels (const NativePixelMap * native, void ** addr )
```
**Description**
Obtains the memory address of a **NativePixelMap** object and locks the memory.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| addr | Double pointer to the memory address.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
AccessPixels
### OH_PixelMap_CreateAlphaPixelMap()
```
int32_t OH_PixelMap_CreateAlphaPixelMap (napi_env env, napi_value source, napi_value * alpha )
```
**Description**
Creates a **PixelMap** object that contains only alpha channel information.
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Pointer to the NAPI environment.|
| source | Options for setting the **PixelMap** object.|
| alpha | Pointer to the alpha channel.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_CREATE_ENCODER_FAILED** if the encoder fails to be created.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_INIT_ABNORMAL** if the image fails to be initialized.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_ENCODE_FAILED** if the pixel map fails to be added to the image.
Returns **IMAGE_RESULT_HW_DECODE_UNSUPPORT** if hardware decoding is not supported.
Returns **IMAGE_RESULT_HW_DECODE_FAILED** if hardware decoding fails.
Returns **IMAGE_RESULT_INDEX_INVALID** if IPC fails.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
CreateAlphaPixelMap
### OH_PixelMap_CreatePixelMap()
```
int32_t OH_PixelMap_CreatePixelMap (napi_env env, OhosPixelMapCreateOps info, void * buf, size_t len, napi_value * res )
```
**Description**
Creates a **PixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Pointer to the NAPI environment.|
| info | Options for setting the **PixelMap** object.|
| buf | Pointer to the buffer of the image.|
| len | Image size.|
| res | Pointer to the **PixelMap** object at the application layer.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_CREATE_ENCODER_FAILED** if the encoder fails to be created.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_INIT_ABNORMAL** if the image fails to be initialized.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_ENCODE_FAILED** if the pixel map fails to be added to the image.
Returns **IMAGE_RESULT_HW_DECODE_UNSUPPORT** if hardware decoding is not supported.
Returns **IMAGE_RESULT_HW_DECODE_FAILED** if hardware decoding fails.
Returns **IMAGE_RESULT_INDEX_INVALID** if IPC fails.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
CreatePixelMap
### OH_PixelMap_Crop()
```
int32_t OH_PixelMap_Crop (const NativePixelMap * native, int32_t x, int32_t y, int32_t width, int32_t height )
```
**Description**
Crops a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| x | X-coordinate of the upper left corner of the target image.|
| y | Y-coordinate of the upper left corner of the target image.|
| width | Width of the cropped region.|
| height | Height of the cropped region.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
Crop
### OH_PixelMap_Flip()
```
int32_t OH_PixelMap_Flip (const NativePixelMap * native, int32_t x, int32_t y )
```
**Description**
Flips a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| x | Whether to flip around the x axis.|
| y | Whether to flip around the y axis.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
Flip
### OH_PixelMap_GetBytesNumberPerRow()
```
int32_t OH_PixelMap_GetBytesNumberPerRow (const NativePixelMap * native, int32_t * num )
```
**Description**
Obtains the number of bytes per row of a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| num | Pointer to the number of bytes per row.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
**Since**
10
**See**
GetBytesNumberPerRow
### OH_PixelMap_GetDensity()
```
int32_t OH_PixelMap_GetDensity (const NativePixelMap * native, int32_t * density )
```
**Description**
Obtains the pixel density of a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| density | Pointer to the pixel density.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
**Since**
10
**See**
GetDensity
### OH_PixelMap_GetImageInfo()
```
int32_t OH_PixelMap_GetImageInfo (const NativePixelMap * native, OhosPixelMapInfos * info )
```
**Description**
Obtains the image information of a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| info | Pointer to the image information.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
[OhosPixelMapInfos](_ohos_pixel_map_infos.md)
### OH_PixelMap_GetIsEditable()
```
int32_t OH_PixelMap_GetIsEditable (const NativePixelMap * native, int32_t * editable )
```
**Description**
Checks whether a **NativePixelMap** object is editable.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| editable | Pointer to the editing type of the **NativePixelMap** object.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
**Since**
10
**See**
GetIsEditable
### OH_PixelMap_InitNativePixelMap()
```
NativePixelMap* OH_PixelMap_InitNativePixelMap (napi_env env, napi_value source )
```
**Description**
Initializes a **PixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Pointer to the NAPI environment.|
| source | Options for setting the **PixelMap** object.|
**Returns**
Returns a pointer to the **NativePixelMap** object if the operation is successful; returns an error code otherwise.
**Since**
10
**See**
InitNativePixelMap
### OH_PixelMap_IsSupportAlpha()
```
int32_t OH_PixelMap_IsSupportAlpha (const NativePixelMap * native, int32_t * alpha )
```
**Description**
Checks whether a **NativePixelMap** object supports alpha channels.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| alpha | Pointer to the support for alpha channels.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
**Since**
10
**See**
IsSupportAlpha
### OH_PixelMap_Rotate()
```
int32_t OH_PixelMap_Rotate (const NativePixelMap * native, float angle )
```
**Description**
Rotates a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| angle | Angle to rotate.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
Rotate
### OH_PixelMap_Scale()
```
int32_t OH_PixelMap_Scale (const NativePixelMap * native, float x, float y )
```
**Description**
Scales a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| x | Scaling ratio of the width.|
| y | Scaling ratio of the height.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_INIT_ABNORMAL** if the image fails to be initialized.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
Scale
### OH_PixelMap_SetAlphaAble()
```
int32_t OH_PixelMap_SetAlphaAble (const NativePixelMap * native, int32_t alpha )
```
**Description**
Sets an alpha channel for a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| alpha | Alpha channel to set.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
**Since**
10
**See**
SetAlphaAble
### OH_PixelMap_SetDensity()
```
int32_t OH_PixelMap_SetDensity (const NativePixelMap * native, int32_t density )
```
**Description**
Sets the pixel density for a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| density | Pixel density to set.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
**Since**
10
**See**
GetDensity
### OH_PixelMap_SetOpacity()
```
int32_t OH_PixelMap_SetOpacity (const NativePixelMap * native, float opacity )
```
**Description**
Sets the opacity for a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| opacity | Opacity to set.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
**Since**
10
**See**
SetOpacity
### OH_PixelMap_Translate()
```
int32_t OH_PixelMap_Translate (const NativePixelMap * native, float x, float y )
```
**Description**
Translates a **NativePixelMap** object.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
| x | Horizontal distance to translate.|
| y | Vertical distance to translate.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
Translate
### OH_PixelMap_UnAccessPixels()
```
int32_t OH_PixelMap_UnAccessPixels (const NativePixelMap * native)
```
**Description**
Unlocks the memory of a **NativePixelMap** object. This function is used with [OH_PixelMap_AccessPixels](#oh_pixelmap_accesspixels) in pairs.
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to a **NativePixelMap** object.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if an error occurs during memory allocation.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the image type is not supported.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if the property is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
**Since**
10
**See**
UnAccessPixels
### OH_UnAccessPixels()
```
int32_t OHOS::Media::OH_UnAccessPixels (napi_env env, napi_value value )
```
**Description**
Unlocks the memory of a **PixelMap** object. This function is used with **OH_AccessPixels** in pairs.
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Pointer to the NAPI environment.|
| value | **PixelMap** object at the application layer.|
**Returns**
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful; returns an error code otherwise.
**Since**
8
**Deprecated from**
10
**See**
AccessPixels
## Variable Description
### alphaType
```
int32_t OhosImageSourceInfo::alphaType
```
**Description**
Defines the alpha type of the image source.
**Since**
10
### buffer [1/2]
```
uint8_t* OhosImageSource::buffer = nullptr
```
**Description**
Defines a pointer to the image source buffer. Only a formatted packet buffer or Base64 buffer is accepted.
**Since**
10
### buffer [2/2]
```
uint8_t* OhosImageSourceUpdateData::buffer = nullptr
```
**Description**
Defines a pointer to the buffer for storing the update data.
**Since**
10
### bufferSize [1/2]
```
size_t OhosImageSource::bufferSize = 0
```
**Description**
Defines the size of the image source buffer.
**Since**
10
### bufferSize [2/2]
```
size_t OhosImageSourceUpdateData::bufferSize = 0
```
**Description**
Defines the size of the buffer.
**Since**
10
### colorSpace
```
int32_t OhosImageSourceInfo::colorSpace
```
**Description**
Defines the color space of the image source.
**Since**
10
### delayTimeList
```
int32_t* OhosImageSourceDelayTimeList::delayTimeList
```
**Description**
Defines a pointer to the head of the image source delay time list.
**Since**
10
### density [1/2]
```
int32_t OhosImageSourceOps::density
```
**Description**
Defines the pixel density of the image source.
**Since**
10
### density [2/2]
```
int32_t OhosImageSourceInfo::density
```
**Description**
Defines the image density of the image source. It is set in [OH_ImageSource_Create](#oh_imagesource_create).
**Since**
10
### editable
```
int8_t OhosImageDecodingOps::editable
```
**Description**
Defines whether the output pixel map is editable.
**Since**
10
### fd
```
int32_t OhosImageSource::fd = -1
```
**Description**
Defines the descriptor of the image source.
**Since**
10
### fitDensity
```
int32_t OhosImageDecodingOps::fitDensity
```
**Description**
Defines the pixel density of the output pixel map.
**Since**
10
### format
```
char* OhosImageSourceSupportedFormat::format = nullptr
```
**Description**
Defines a pointer to the head of the format string.
**Since**
10
### height
```
int32_t OhosImageRegion::height
```
**Description**
Defines the height of the region, in pixels.
**Since**
10
### index
```
uint32_t OhosImageDecodingOps::index
```
**Description**
Defines the index of the output pixel map.
**Since**
10
### isCompleted
```
int8_t OhosImageSourceUpdateData::isCompleted = 0
```
**Description**
Defines whether the image source data update is completed.
**Since**
10
### offset
```
uint32_t OhosImageSourceUpdateData::offset = 0
```
**Description**
Defines the offset of the update data in the buffer.
**Since**
10
### OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE
```
const char* OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE = "BitsPerSample"
```
**Description**
Defines a pointer to bits per sample, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL
```
const char* OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL = "CompressedBitsPerPixel"
```
**Description**
Defines a pointer to the compressed bits per pixel, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL
```
const char* OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL = "DateTimeOriginal"
```
**Description**
Defines a pointer to the created date and time, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_EXPOSURE_TIME
```
const char* OHOS_IMAGE_PROPERTY_EXPOSURE_TIME = "ExposureTime"
```
**Description**
Defines a pointer to the exposure time, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_F_NUMBER
```
const char* OHOS_IMAGE_PROPERTY_F_NUMBER = "FNumber"
```
**Description**
Defines a pointer to the f-number of the image, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_GPS_LATITUDE
```
const char* OHOS_IMAGE_PROPERTY_GPS_LATITUDE = "GPSLatitude"
```
**Description**
Defines a pointer to the GPS latitude, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF
```
const char* OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF = "GPSLatitudeRef"
```
**Description**
Defines a pointer to the GPS latitude reference information, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_GPS_LONGITUDE
```
const char* OHOS_IMAGE_PROPERTY_GPS_LONGITUDE = "GPSLongitude"
```
**Description**
Defines a pointer to the GPS longitude, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF
```
const char* OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF = "GPSLongitudeRef"
```
**Description**
Defines a pointer to the GPS longitude reference information, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_IMAGE_LENGTH
```
const char* OHOS_IMAGE_PROPERTY_IMAGE_LENGTH = "ImageLength"
```
**Description**
Defines a pointer to the image length, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_IMAGE_WIDTH
```
const char* OHOS_IMAGE_PROPERTY_IMAGE_WIDTH = "ImageWidth"
```
**Description**
Defines a pointer to the image width, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS
```
const char* OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS = "ISOSpeedRatings"
```
**Description**
Defines a pointer to the ISO speed ratings, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_ORIENTATION
```
const char* OHOS_IMAGE_PROPERTY_ORIENTATION = "Orientation"
```
**Description**
Defines a pointer to the orientation, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### OHOS_IMAGE_PROPERTY_SCENE_TYPE
```
const char* OHOS_IMAGE_PROPERTY_SCENE_TYPE = "SceneType"
```
**Description**
Defines a pointer to the scene type, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### pixelFormat [1/3]
```
int32_t OhosImageSourceOps::pixelFormat
```
**Description**
Defines the pixel format of the image source. It is usually used to describe the YUV buffer.
**Since**
10
### pixelFormat [2/3]
```
int32_t OhosImageDecodingOps::pixelFormat
```
**Description**
Defines the pixel format of the output pixel map.
**Since**
10
### pixelFormat [3/3]
```
int32_t OhosImageSourceInfo::pixelFormat
```
**Description**
Defines the pixel format of the image source. It is set in [OH_ImageSource_Create](#oh_imagesource_create).
**Since**
10
### region
```
struct OhosImageRegion OhosImageDecodingOps::region
```
**Description**
Defines the region of the output pixel map.
**Since**
10
### rotate
```
uint32_t OhosImageDecodingOps::rotate
```
**Description**
Defines the decoding rotation.
**Since**
10
### sampleSize
```
uint32_t OhosImageDecodingOps::sampleSize
```
**Description**
Defines the size of the sample.
**Since**
10
### size [1/7]
```
struct OhosImageSize OhosImageSourceOps::size
```
**Description**
Defines the pixel width and height of the image source.
**Since**
10
### size [2/7]
```
struct OhosImageSize OhosImageDecodingOps::size
```
**Description**
Defines the pixel width and height of the output pixel map.
**Since**
10
### size [3/7]
```
struct OhosImageSize OhosImageSourceInfo::size
```
**Description**
Defines the pixel width and height of the image source.
**Since**
10
### size [4/7]
```
size_t OhosImageSourceDelayTimeList::size = 0
```
**Description**
Defines the size of the image source delay time list.
**Since**
10
### size [5/7]
```
size_t OhosImageSourceSupportedFormat::size = 0
```
**Description**
Defines the size of the format string.
**Since**
10
### size [6/7]
```
size_t OhosImageSourceSupportedFormatList::size = 0
```
**Description**
Defines the size of the format string list.
**Since**
10
### size [7/7]
```
size_t OhosImageSourceProperty::size = 0
```
**Description**
Defines the size of the property string.
**Since**
10
### supportedFormatList
```
struct OhosImageSourceSupportedFormat** OhosImageSourceSupportedFormatList::supportedFormatList = nullptr
```
**Description**
Defines a double pointer to the head of the format string list.
**Since**
10
### updateLength
```
uint32_t OhosImageSourceUpdateData::updateLength = 0
```
**Description**
Defines the length of the update data in the buffer.
**Since**
10
### uri
```
char* OhosImageSource::uri = nullptr
```
**Description**
Defines a pointer to the image source URI. Only a file URI or Base64 URI is accepted.
**Since**
10
### uriSize
```
size_t OhosImageSource::uriSize = 0
```
**Description**
Defines the length of the image source URI.
**Since**
10
### value
```
char* OhosImageSourceProperty::value = nullptr
```
**Description**
Defines a pointer to the head of the property string.
**Since**
10
### width
```
int32_t OhosImageRegion::width
```
**Description**
Defines the width of the region, in pixels.
**Since**
10
### x
```
int32_t OhosImageRegion::x
```
**Description**
Defines the X coordinate of the start point, in pixels.
**Since**
10
### y
```
int32_t OhosImageRegion::y
```
**Description**
Defines the Y coordinate of the start point, in pixels.
**Since**
10
# image_mdk.h
## Overview
The **image_mdk.h** file declares the functions that access the image rectangle, size, format, and component data.
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OHOS::Media::OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) | Defines the information about an image rectangle.|
| [OHOS::Media::OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) | Defines the information about an image component.|
### Types
| Name| Description|
| -------- | -------- |
| [OHOS::Media::ImageNative](image.md#imagenative) | Defines an image object at the native layer.|
### Enums
| Name| Description|
| -------- | -------- |
| { [OHOS::Media::OHOS_IMAGE_FORMAT_YCBCR_422_SP](image.md) = 1000,<br>[OHOS::Media::OHOS_IMAGE_FORMAT_JPEG](image.md) = 2000, } | Enumerates the image formats.|
| { [OHOS::Media::OHOS_IMAGE_COMPONENT_FORMAT_YUV_Y](image.md) = 1,<br>[OHOS::Media::OHOS_IMAGE_COMPONENT_FORMAT_YUV_U](image.md) = 2,<br>[OHOS::Media::OHOS_IMAGE_COMPONENT_FORMAT_YUV_V](image.md) = 3,<br>[OHOS::Media::OHOS_IMAGE_COMPONENT_FORMAT_JPEG](image.md) = 4, } | Enumerates the image components.|
### Functions
| Name| Description|
| -------- | -------- |
| [OHOS::Media::OH_Image_InitImageNative](image.md#oh_image_initimagenative) (napi_env env, napi_value source) | Parses an **ImageNative** object from an **Image** object at the JavaScript native layer.|
| [OHOS::Media::OH_Image_ClipRect](image.md#oh_image_cliprect) (const [ImageNative](image.md#imagenative) \*native, struct [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) \*rect) | Obtains [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Size](image.md#oh_image_size) (const [ImageNative](image.md#imagenative) \*native, struct [OhosImageSize](_ohos_image_size.md) \*size) | Obtains [OhosImageSize](_ohos_image_size.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Format](image.md#oh_image_format) (const [ImageNative](image.md#imagenative) \*native, int32_t \*format) | Obtains the image format of an **ImageNative** object.|
| [OHOS::Media::OH_Image_GetComponent](image.md#oh_image_getcomponent) (const [ImageNative](image.md#imagenative) \*native, int32_t componentType, struct [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) \*componentNative) | Obtains [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Release](image.md#oh_image_release) ([ImageNative](image.md#imagenative) \*native) | Releases an **ImageNative** object.|
# image_mdk_common.h
## Overview
The image_mdk_common.h file declares the common enums and structs used by the image interface.
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OhosImageSize](_ohos_image_size.md) | Defines the image size.|
### Macros
| Name| Description|
| -------- | -------- |
| **IMAGE_RESULT_BASE** 62980096 | Defines the basic value returned by the interface. |
### Enums
| Name| Description|
| -------- | -------- |
| [IRNdkErrCode](image.md#irndkerrcode) {<br>IMAGE_RESULT_SUCCESS = 0,<br>IMAGE_RESULT_BAD_PARAMETER = -1,<br>IMAGE_RESULT_IMAGE_RESULT_BASE = IMAGE_RESULT_BASE,<br>IMAGE_RESULT_ERR_IPC = IMAGE_RESULT_BASE + 1,<br>IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST = IMAGE_RESULT_BASE + 2,<br>IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL = IMAGE_RESULT_BASE + 3,<br>IMAGE_RESULT_DECODE_ABNORMAL = IMAGE_RESULT_BASE + 4,<br>IMAGE_RESULT_DATA_ABNORMAL = IMAGE_RESULT_BASE + 5,<br>IMAGE_RESULT_MALLOC_ABNORMAL = IMAGE_RESULT_BASE + 6,<br>IMAGE_RESULT_DATA_UNSUPPORT = IMAGE_RESULT_BASE + 7,<br>IMAGE_RESULT_INIT_ABNORMAL = IMAGE_RESULT_BASE + 8,<br>IMAGE_RESULT_GET_DATA_ABNORMAL = IMAGE_RESULT_BASE + 9,<br>IMAGE_RESULT_TOO_LARGE = IMAGE_RESULT_BASE + 10,<br>IMAGE_RESULT_TRANSFORM = IMAGE_RESULT_BASE + 11,<br>IMAGE_RESULT_COLOR_CONVERT = IMAGE_RESULT_BASE + 12,<br>IMAGE_RESULT_CROP = IMAGE_RESULT_BASE + 13,<br>IMAGE_RESULT_SOURCE_DATA = IMAGE_RESULT_BASE + 14,<br>IMAGE_RESULT_SOURCE_DATA_INCOMPLETE = IMAGE_RESULT_BASE + 15,<br>IMAGE_RESULT_MISMATCHED_FORMAT = IMAGE_RESULT_BASE + 16,<br>IMAGE_RESULT_UNKNOWN_FORMAT = IMAGE_RESULT_BASE + 17,<br>IMAGE_RESULT_SOURCE_UNRESOLVED = IMAGE_RESULT_BASE + 18,<br>IMAGE_RESULT_INVALID_PARAMETER = IMAGE_RESULT_BASE + 19,<br>IMAGE_RESULT_DECODE_FAILED = IMAGE_RESULT_BASE + 20,<br>IMAGE_RESULT_PLUGIN_REGISTER_FAILED = IMAGE_RESULT_BASE + 21,<br>IMAGE_RESULT_PLUGIN_CREATE_FAILED = IMAGE_RESULT_BASE + 22,<br>IMAGE_RESULT_ENCODE_FAILED = IMAGE_RESULT_BASE + 23,<br>IMAGE_RESULT_ADD_PIXEL_MAP_FAILED = IMAGE_RESULT_BASE + 24,<br>IMAGE_RESULT_HW_DECODE_UNSUPPORT = IMAGE_RESULT_BASE + 25,<br>IMAGE_RESULT_DECODE_HEAD_ABNORMAL = IMAGE_RESULT_BASE + 26,<br>IMAGE_RESULT_DECODE_EXIF_UNSUPPORT = IMAGE_RESULT_BASE + 27,<br>IMAGE_RESULT_PROPERTY_NOT_EXIST = IMAGE_RESULT_BASE + 28,<br>IMAGE_RESULT_MEDIA_DATA_UNSUPPORT = IMAGE_RESULT_BASE + 30,<br>IMAGE_RESULT_MEDIA_TOO_LARGE = IMAGE_RESULT_BASE + 31,<br>IMAGE_RESULT_MEDIA_MALLOC_FAILED = IMAGE_RESULT_BASE + 32,<br>IMAGE_RESULT_MEDIA_END_OF_STREAM = IMAGE_RESULT_BASE + 33,<br>IMAGE_RESULT_MEDIA_IO_ABNORMAL = IMAGE_RESULT_BASE + 34,<br>IMAGE_RESULT_MEDIA_MALFORMED = IMAGE_RESULT_BASE + 35,<br>IMAGE_RESULT_MEDIA_BUFFER_TOO_SMALL = IMAGE_RESULT_BASE + 36,<br>IMAGE_RESULT_MEDIA_OUT_OF_RANGE = IMAGE_RESULT_BASE + 37,<br>IMAGE_RESULT_MEDIA_STATUS_ABNORMAL = IMAGE_RESULT_BASE + 38,<br>IMAGE_RESULT_MEDIA_VALUE_INVALID = IMAGE_RESULT_BASE + 39,<br>IMAGE_RESULT_MEDIA_NULL_POINTER = IMAGE_RESULT_BASE + 40,<br>IMAGE_RESULT_MEDIA_INVALID_OPERATION = IMAGE_RESULT_BASE + 41,<br>IMAGE_RESULT_MEDIA_ERR_PLAYER_NOT_INIT = IMAGE_RESULT_BASE + 42,<br>IMAGE_RESULT_MEDIA_EARLY_PREPARE = IMAGE_RESULT_BASE + 43,<br>IMAGE_RESULT_MEDIA_SEEK_ERR = IMAGE_RESULT_BASE + 44,<br>IMAGE_RESULT_MEDIA_PERMISSION_DENIED = IMAGE_RESULT_BASE + 45,<br>IMAGE_RESULT_MEDIA_DEAD_OBJECT = IMAGE_RESULT_BASE + 46,<br>IMAGE_RESULT_MEDIA_TIMED_OUT = IMAGE_RESULT_BASE + 47,<br>IMAGE_RESULT_MEDIA_TRACK_NOT_ALL_SUPPORTED = IMAGE_RESULT_BASE + 48,<br>IMAGE_RESULT_MEDIA_ADAPTER_INIT_FAILED = IMAGE_RESULT_BASE + 49,<br>IMAGE_RESULT_MEDIA_WRITE_PARCEL_FAIL = IMAGE_RESULT_BASE + 50,<br>IMAGE_RESULT_MEDIA_READ_PARCEL_FAIL = IMAGE_RESULT_BASE + 51,<br>IMAGE_RESULT_MEDIA_NO_AVAIL_BUFFER = IMAGE_RESULT_BASE + 52,<br>IMAGE_RESULT_MEDIA_INVALID_PARAM = IMAGE_RESULT_BASE + 53, IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_EXIST = IMAGE_RESULT_BASE + 54,<br>IMAGE_RESULT_MEDIA_CREATE_CODEC_ADAPTER_FAILED = IMAGE_RESULT_BASE + 55,<br>IMAGE_RESULT_MEDIA_CODEC_ADAPTER_NOT_INIT = IMAGE_RESULT_BASE + 56,<br>IMAGE_RESULT_MEDIA_ZCODEC_CREATE_FAILED = IMAGE_RESULT_BASE + 57,<br>IMAGE_RESULT_MEDIA_ZCODEC_NOT_EXIST = IMAGE_RESULT_BASE + 58,<br>IMAGE_RESULT_MEDIA_JNI_CLASS_NOT_EXIST = IMAGE_RESULT_BASE + 59,<br>IMAGE_RESULT_MEDIA_JNI_METHOD_NOT_EXIST = IMAGE_RESULT_BASE + 60,<br>IMAGE_RESULT_MEDIA_JNI_NEW_OBJ_FAILED = IMAGE_RESULT_BASE + 61,<br>IMAGE_RESULT_MEDIA_JNI_COMMON_ERROR = IMAGE_RESULT_BASE + 62,<br>IMAGE_RESULT_MEDIA_DISTRIBUTE_NOT_SUPPORT = IMAGE_RESULT_BASE + 63,<br>IMAGE_RESULT_MEDIA_SOURCE_NOT_SET = IMAGE_RESULT_BASE + 64,<br>IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_INIT = IMAGE_RESULT_BASE + 65,<br>IMAGE_RESULT_MEDIA_RTSP_ADAPTER_NOT_EXIST = IMAGE_RESULT_BASE + 66,<br>IMAGE_RESULT_MEDIA_RTSP_SURFACE_UNSUPPORT = IMAGE_RESULT_BASE + 67,<br>IMAGE_RESULT_MEDIA_RTSP_CAPTURE_NOT_INIT = IMAGE_RESULT_BASE + 68,<br>IMAGE_RESULT_MEDIA_RTSP_SOURCE_URL_INVALID = IMAGE_RESULT_BASE + 69,<br>IMAGE_RESULT_MEDIA_RTSP_VIDEO_TRACK_NOT_FOUND = IMAGE_RESULT_BASE + 70,<br>IMAGE_RESULT_MEDIA_RTSP_CAMERA_NUM_REACH_MAX = IMAGE_RESULT_BASE + 71,<br>IMAGE_RESULT_MEDIA_SET_VOLUME = IMAGE_RESULT_BASE + 72,<br>IMAGE_RESULT_MEDIA_NUMBER_OVERFLOW = IMAGE_RESULT_BASE + 73,<br>IMAGE_RESULT_MEDIA_DIS_PLAYER_UNSUPPORTED = IMAGE_RESULT_BASE + 74,<br>IMAGE_RESULT_MEDIA_DENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 75,<br>IMAGE_RESULT_MEDIA_ENCODE_ICC_FAILED = IMAGE_RESULT_BASE + 76,<br>IMAGE_RESULT_MEDIA_READ_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 150,<br>IMAGE_RESULT_MEDIA_WRITE_PIXELMAP_FAILED = IMAGE_RESULT_BASE + 151,<br>IMAGE_RESULT_MEDIA_PIXELMAP_NOT_ALLOW_MODIFY = IMAGE_RESULT_BASE + 152,<br>IMAGE_RESULT_MEDIA_CONFIG_FAILED = IMAGE_RESULT_BASE + 153,<br>IMAGE_RESULT_JNI_ENV_ABNORMAL = IMAGE_RESULT_BASE + 154,<br>IMAGE_RESULT_SURFACE_GRALLOC_BUFFER_FAILED = IMAGE_RESULT_BASE + 155,<br>IMAGE_RESULT_CREATE_SURFACE_FAILED = IMAGE_RESULT_BASE + 156,<br>IMAGE_RESULT_SURFACE_GET_PARAMETER_FAILED = IMAGE_RESULT_BASE + 157,<br>IMAGE_RESULT_GET_SURFACE_FAILED = IMAGE_RESULT_BASE + 158,<br>IMAGE_RESULT_SURFACE_ACQUIRE_BUFFER_FAILED = IMAGE_RESULT_BASE + 159,<br>IMAGE_RESULT_SURFACE_REQUEST_BUFFER_FAILED = IMAGE_RESULT_BASE + 160,<br>IMAGE_RESULT_REGISTER_LISTENER_FAILED = IMAGE_RESULT_BASE + 161,<br>IMAGE_RESULT_REGISTER_BUFFER_FAILED = IMAGE_RESULT_BASE + 162,<br>IMAGE_RESULT_FREAD_FAILED = IMAGE_RESULT_BASE + 163,<br>IMAGE_RESULT_PEEK_FAILED = IMAGE_RESULT_BASE + 164,<br>IMAGE_RESULT_SEEK_FAILED = IMAGE_RESULT_BASE + 165,<br>IMAGE_RESULT_STREAM_SIZE_ERROR = IMAGE_RESULT_BASE + 166,<br>IMAGE_RESULT_FILE_FD_ERROR = IMAGE_RESULT_BASE + 167,<br>IMAGE_RESULT_FILE_DAMAGED = IMAGE_RESULT_BASE + 168,<br>IMAGE_RESULT_CREATE_DECODER_FAILED = IMAGE_RESULT_BASE + 169,<br>IMAGE_RESULT_CREATE_ENCODER_FAILED = IMAGE_RESULT_BASE + 170,<br>IMAGE_RESULT_CHECK_FORMAT_ERROR = IMAGE_RESULT_BASE + 171,<br>IMAGE_RESULT_THIRDPART_SKIA_ERROR = IMAGE_RESULT_BASE + 172,<br>IMAGE_RESULT_HW_DECODE_FAILED = IMAGE_RESULT_BASE + 173,<br>IMAGE_RESULT_ALLOCATER_TYPE_ERROR = IMAGE_RESULT_BASE + 174,<br>IMAGE_RESULT_ALPHA_TYPE_ERROR = IMAGE_RESULT_BASE + 175,<br>IMAGE_RESULT_INDEX_INVALID = IMAGE_RESULT_BASE + 176,<br>IMAGE_RESULT_MEDIA_UNKNOWN = IMAGE_RESULT_BASE + 200<br>} | Enumerates the return values that may be used by the interface.|
# image_pixel_map_mdk.h
## Overview
The **image_pixel_map_mdk.h** file declares the APIs that can lock, access, and unlock a pixel map. Need link **libpixelmapndk.z.so**
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OhosPixelMapInfos](_ohos_pixel_map_infos.md) | Defines the pixel map information.|
| [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md) | Defines the options for creating a pixel map.|
### Types
| Name| Description|
| -------- | -------- |
| [NativePixelMap](image.md#nativepixelmap) | Defines the data type name of the pixel map at the native layer.|
| [OhosPixelMapInfos](image.md#ohospixelmapinfos) | Defines the pixel map information.|
### Enums
| Name| Description|
| -------- | -------- |
| { [OHOS_PIXEL_MAP_ALPHA_TYPE_UNKNOWN](image.md) = 0,<br>[OHOS_PIXEL_MAP_ALPHA_TYPE_OPAQUE](image.md) = 1,<br>[OHOS_PIXEL_MAP_ALPHA_TYPE_PREMUL](image.md) = 2,<br>[OHOS_PIXEL_MAP_ALPHA_TYPE_UNPREMUL](image.md) = 3 } | Enumerates the pixel map alpha types.|
| { [OHOS_PIXEL_MAP_READ_ONLY](image.md) = 0,<br>[OHOS_PIXEL_MAP_EDITABLE](image.md) = 1 } | Enumerates the pixel map editing types.|
### Functions
| Name| Description|
| -------- | -------- |
| [OH_PixelMap_CreatePixelMap](image.md#oh_pixelmap_createpixelmap) (napi_env env, [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md) info, void \*buf, size_t len, napi_value \*res) | Creates a **PixelMap** object.|
| [OH_PixelMap_CreateAlphaPixelMap](image.md#oh_pixelmap_createalphapixelmap) (napi_env env, napi_value source, napi_value \*alpha) | Creates a **PixelMap** object that contains only alpha channel information.|
| [OH_PixelMap_InitNativePixelMap](image.md#oh_pixelmap_initnativepixelmap) (napi_env env, napi_value source) | Initializes a **PixelMap** object.|
| [OH_PixelMap_GetBytesNumberPerRow](image.md#oh_pixelmap_getbytesnumberperrow) (const [NativePixelMap](image.md#nativepixelmap) \*native, int32_t \*num) | Obtains the number of bytes per row of a **NativePixelMap** object.|
| [OH_PixelMap_GetIsEditable](image.md#oh_pixelmap_getiseditable) (const [NativePixelMap](image.md#nativepixelmap) \*native, int32_t \*editable) | Checks whether a **NativePixelMap** object is editable.|
| [OH_PixelMap_IsSupportAlpha](image.md#oh_pixelmap_issupportalpha) (const [NativePixelMap](image.md#nativepixelmap) \*native, int32_t \*alpha) | Checks whether a **NativePixelMap** object supports alpha channels.|
| [OH_PixelMap_SetAlphaAble](image.md#oh_pixelmap_setalphaable) (const [NativePixelMap](image.md#nativepixelmap) \*native, int32_t alpha) | Sets an alpha channel for a **NativePixelMap** object.|
| [OH_PixelMap_GetDensity](image.md#oh_pixelmap_getdensity) (const [NativePixelMap](image.md#nativepixelmap) \*native, int32_t \*density) | Obtains the pixel density of a **NativePixelMap** object.|
| [OH_PixelMap_SetDensity](image.md#oh_pixelmap_setdensity) (const [NativePixelMap](image.md#nativepixelmap) \*native, int32_t density) | Sets the pixel density for a **NativePixelMap** object.|
| [OH_PixelMap_SetOpacity](image.md#oh_pixelmap_setopacity) (const [NativePixelMap](image.md#nativepixelmap) \*native, float opacity) | Sets the opacity for a **NativePixelMap** object.|
| [OH_PixelMap_Scale](image.md#oh_pixelmap_scale) (const [NativePixelMap](image.md#nativepixelmap) \*native, float x, float y) | Scales a **NativePixelMap** object.|
| [OH_PixelMap_Translate](image.md#oh_pixelmap_translate) (const [NativePixelMap](image.md#nativepixelmap) \*native, float x, float y) | Translates a **NativePixelMap** object.|
| [OH_PixelMap_Rotate](image.md#oh_pixelmap_rotate) (const [NativePixelMap](image.md#nativepixelmap) \*native, float angle) | Rotates a **NativePixelMap** object.|
| [OH_PixelMap_Flip](image.md#oh_pixelmap_flip) (const [NativePixelMap](image.md#nativepixelmap) \*native, int32_t x, int32_t y) | Flips a **NativePixelMap** object.|
| [OH_PixelMap_Crop](image.md#oh_pixelmap_crop) (const [NativePixelMap](image.md#nativepixelmap) \*native, int32_t x, int32_t y, int32_t width, int32_t height) | Crops a **NativePixelMap** object.|
| [OH_PixelMap_GetImageInfo](image.md#oh_pixelmap_getimageinfo) (const [NativePixelMap](image.md#nativepixelmap) \*native, [OhosPixelMapInfos](_ohos_pixel_map_infos.md) \*info) | Obtains the image information of a **NativePixelMap** object.|
| [OH_PixelMap_AccessPixels](image.md#oh_pixelmap_accesspixels) (const [NativePixelMap](image.md#nativepixelmap) \*native, void \*\*addr) | Obtains the memory address of a **NativePixelMap** object and locks the memory.|
| [OH_PixelMap_UnAccessPixels](image.md#oh_pixelmap_unaccesspixels) (const [NativePixelMap](image.md#nativepixelmap) \*native) | Unlocks the memory of a **NativePixelMap** object. This function is used with [OH_PixelMap_AccessPixels](image.md#oh_pixelmap_accesspixels) in pairs.|
......@@ -3,12 +3,13 @@
## Overview
Declares the APIs that can lock, access, and unlock pixel map data.
The **image_pixel_map_napi.h** file declares the APIs that can lock, access, and unlock a pixel map.
**Since**
**Since:**
8
**Related Modules:**
**Related Modules**
[Image](image.md)
......@@ -18,107 +19,24 @@ Declares the APIs that can lock, access, and unlock pixel map data.
### Structs
| Name | Description |
| 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
| [OHOS::Media::OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) | Defines the pixel map information.|
| Name | Description |
| -------- | -------- |
| [NativePixelMap](image.md#nativepixelmap) | Defines the data type name of the native pixel map. |
### Enums
| Name | Description |
| Name| Description|
| -------- | -------- |
| { 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. |
| { [OHOS::Media::OHOS_IMAGE_RESULT_SUCCESS](image.md) = 0,<br>[OHOS::Media::OHOS_IMAGE_RESULT_BAD_PARAMETER](image.md) = -1 } | Enumerates the error codes returned by the functions.|
| { [OHOS::Media::OHOS_PIXEL_MAP_FORMAT_NONE](image.md) = 0,<br>[OHOS::Media::OHOS_PIXEL_MAP_FORMAT_RGBA_8888](image.md) = 3,<br>[OHOS::Media::OHOS_PIXEL_MAP_FORMAT_RGB_565](image.md) = 2 } | Enumerates the pixel map formats.|
| { [OHOS::Media::OHOS_PIXEL_MAP_SCALE_MODE_FIT_TARGET_SIZE](image.md) = 0,<br>[OHOS::Media::OHOS_PIXEL_MAP_SCALE_MODE_CENTER_CROP](image.md) = 1 } | Enumerates the pixel map scale modes.|
### Functions
| Name | Description |
| -------- | -------- |
| [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 |
| 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.
| [OHOS::Media::OH_GetImageInfo](image.md#oh_getimageinfo) (napi_env env, napi_value value, [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) \*info) | Obtains the information about a **PixelMap** object and stores the information to the [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) struct.|
| [OHOS::Media::OH_AccessPixels](image.md#oh_accesspixels) (napi_env env, napi_value value, void \*\*addrPtr) | Obtains the memory address of a **PixelMap** object and locks the memory.|
| [OHOS::Media::OH_UnAccessPixels](image.md#oh_unaccesspixels) (napi_env env, napi_value value) | Unlocks the memory of a **PixelMap** object. This function is used with **OH_AccessPixels** in pairs.|
# image_receiver_mdk.h
## Overview
The **image_receiver_mdk.h** file declares the APIs for obtaining image data from the native layer.
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OhosImageReceiverInfo](_ohos_image_receiver_info.md) | Defines the information about an image receiver.|
### Types
| Name| Description|
| -------- | -------- |
| [ImageReceiverNative](image.md#imagereceivernative) | Defines the data type name of the image receiver at the native layer.|
| (\*[OH_Image_Receiver_On_Callback](image.md#oh_image_receiver_on_callback)) () | Defines the callbacks for the image interface at the native layer.|
### Functions
| Name| Description|
| -------- | -------- |
| [OH_Image_Receiver_CreateImageReceiver](image.md#oh_image_receiver_createimagereceiver) (napi_env env, struct [OhosImageReceiverInfo](_ohos_image_receiver_info.md) info, napi_value \*res) | Creates an **ImageReceiver** object at the application layer.|
| [OH_Image_Receiver_InitImageReceiverNative](image.md#oh_image_receiver_initimagereceivernative) (napi_env env, napi_value source) | Initializes an [ImageReceiverNative](image.md#imagereceivernative) object through an **ImageReceiver** object.|
| [OH_Image_Receiver_GetReceivingSurfaceId](image.md#oh_image_receiver_getreceivingsurfaceid) (const [ImageReceiverNative](image.md#imagereceivernative) \*native, char \*id, size_t len) | Obtains the receiver ID through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_ReadLatestImage](image.md#oh_image_receiver_readlatestimage) (const [ImageReceiverNative](image.md#imagereceivernative) \*native, napi_value \*image) | Obtains the latest image through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_ReadNextImage](image.md#oh_image_receiver_readnextimage) (const [ImageReceiverNative](image.md#imagereceivernative) \*native, napi_value \*image) | Obtains the next image through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_On](image.md#oh_image_receiver_on) (const [ImageReceiverNative](image.md#imagereceivernative) \*native, [OH_Image_Receiver_On_Callback](image.md#oh_image_receiver_on_callback) callback) | Registers an [OH_Image_Receiver_On_Callback](image.md#oh_image_receiver_on_callback) callback. This callback is triggered whenever a new image is received.|
| [OH_Image_Receiver_GetSize](image.md#oh_image_receiver_getsize) (const [ImageReceiverNative](image.md#imagereceivernative) \*native, struct [OhosImageSize](_ohos_image_size.md) \*size) | Obtains the size of the image receiver through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_GetCapacity](image.md#oh_image_receiver_getcapacity) (const [ImageReceiverNative](image.md#imagereceivernative) \*native, int32_t \*capacity) | Obtains the capacity of the image receiver through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_GetFormat](image.md#oh_image_receiver_getformat) (const [ImageReceiverNative](image.md#imagereceivernative) \*native, int32_t \*format) | Obtains the format of the image receiver through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_Release](image.md#oh_image_receiver_release) ([ImageReceiverNative](image.md#imagereceivernative) \*native) | Releases an [ImageReceiverNative](image.md#imagereceivernative) object.|
# image_source_mdk.h
## Overview
The **image_source_mdk.h** file declares the APIs for decoding an image source into a pixel map.
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OhosImageRegion](_ohos_image_region.md) | Defines the region of an image source to decode.|
| [OhosImageSourceOps](_ohos_image_source_ops.md) | Defines the image source options.|
| [OhosImageDecodingOps](_ohos_image_decoding_ops.md) | Defines the options for decoding an image source.|
| [OhosImageSourceInfo](_ohos_image_source_info.md) | Defines the information about an image source.|
| [OhosImageSource](_ohos_image_source.md) | Defines the input resource of an image source. Only one type of resource is accepted at a time.|
| [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md) | Defines the delay time list of an image source.|
| [OhosImageSourceSupportedFormat](_ohos_image_source_supported_format.md) | Defines the format string supported by an image source.|
| [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) | Defines the format string list supported by an image source.|
| [OhosImageSourceProperty](_ohos_image_source_property.md) | Defines the property string (in key-value format) of an image source.|
| [OhosImageSourceUpdateData](_ohos_image_source_update_data.md) | Defines the update data of an image source.|
### Types
| Name| Description|
| -------- | -------- |
| [ImageSourceNative](image.md#imagesourcenative) | Defines an image source object at the native layer.|
### Functions
| Name| Description|
| -------- | -------- |
| [OH_ImageSource_Create](image.md#oh_imagesource_create) (napi_env env, struct [OhosImageSource](_ohos_image_source.md) \*src, struct [OhosImageSourceOps](_ohos_image_source_ops.md) \*ops, napi_value \*res) | Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs.|
| [OH_ImageSource_CreateIncremental](image.md#oh_imagesource_createincremental) (napi_env env, struct [OhosImageSource](_ohos_image_source.md) \*source, struct [OhosImageSourceOps](_ohos_image_source_ops.md) \*ops, napi_value \*res) | Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs. The image source data will be updated through **OH_ImageSource_UpdateData**.|
| [OH_ImageSource_GetSupportedFormats](image.md#oh_imagesource_getsupportedformats) (struct [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) \*res) | Obtains all supported decoding formats.|
| \*[OH_ImageSource_InitNative](image.md#oh_imagesource_initnative) (napi_env env, napi_value source) | Converts an **ImageSource** object at the JavaScript native layer to an [ImageSourceNative](image.md#imagesourcenative) object.|
| [OH_ImageSource_CreatePixelMap](image.md#oh_imagesource_createpixelmap) (const [ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageDecodingOps](_ohos_image_decoding_ops.md) \*ops, napi_value \*res) | Decodes an **ImageSourceNative** object to obtain a **PixelMap** object at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.|
| [OH_ImageSource_CreatePixelMapList](image.md#oh_imagesource_createpixelmaplist) (const [ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageDecodingOps](_ohos_image_decoding_ops.md) \*ops, napi_value \*res) | Decodes an **ImageSourceNative** object to obtain all **PixelMap** objects at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.|
| [OH_ImageSource_GetDelayTime](image.md#oh_imagesource_getdelaytime) (const [ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md) \*res) | Obtains the delay time list from an **ImageSourceNative** object (such as GIF image source).|
| [OH_ImageSource_GetFrameCount](image.md#oh_imagesource_getframecount) (const [ImageSourceNative](image.md#imagesourcenative) \*native, uint32_t \*res) | Obtains the number of frames from an **ImageSourceNative** object.|
| [OH_ImageSource_GetImageInfo](image.md#oh_imagesource_getimageinfo) (const [ImageSourceNative](image.md#imagesourcenative) \*native, int32_t index, struct [OhosImageSourceInfo](_ohos_image_source_info.md) \*info) | Obtains image source information from an **ImageSourceNative** object by index.|
| [OH_ImageSource_GetImageProperty](image.md#oh_imagesource_getimageproperty) (const [ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageSourceProperty](_ohos_image_source_property.md) \*key, struct [OhosImageSourceProperty](_ohos_image_source_property.md) \*value) | Obtains the value of an image property from an **ImageSourceNative** object.|
| [OH_ImageSource_ModifyImageProperty](image.md#oh_imagesource_modifyimageproperty) (const [ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageSourceProperty](_ohos_image_source_property.md) \*key, struct [OhosImageSourceProperty](_ohos_image_source_property.md) \*value) | Modifies the value of an image property of an **ImageSourceNative** object.|
| [OH_ImageSource_UpdateData](image.md#oh_imagesource_updatedata) (const [ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageSourceUpdateData](_ohos_image_source_update_data.md) \*data) | Updates the data of an **ImageSourceNative** object.|
| [OH_ImageSource_Release](image.md#oh_imagesource_release) ([ImageSourceNative](image.md#imagesourcenative) \*native) | Releases an **ImageSourceNative** object.|
### Variables
| Name| Description|
| -------- | -------- |
| \*[OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE](image.md#ohos_image_property_bits_per_sample) = "BitsPerSample" | Defines a pointer to bits per sample, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_ORIENTATION](image.md#ohos_image_property_orientation) = "Orientation" | Defines a pointer to the orientation, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_IMAGE_LENGTH](image.md#ohos_image_property_image_length) = "ImageLength" | Defines a pointer to the image length, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_IMAGE_WIDTH](image.md#ohos_image_property_image_width) = "ImageWidth" | Defines a pointer to the image width, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_GPS_LATITUDE](image.md#ohos_image_property_gps_latitude) = "GPSLatitude" | Defines a pointer to the GPS latitude, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_GPS_LONGITUDE](image.md#ohos_image_property_gps_longitude) = "GPSLongitude" | Defines a pointer to the GPS longitude, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF](image.md#ohos_image_property_gps_latitude_ref) = "GPSLatitudeRef" | Defines a pointer to the GPS latitude reference information, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF](image.md#ohos_image_property_gps_longitude_ref) = "GPSLongitudeRef" | Defines a pointer to the GPS longitude reference information, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL](image.md#ohos_image_property_date_time_original) = "DateTimeOriginal" | Defines a pointer to the created date and time, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_EXPOSURE_TIME](image.md#ohos_image_property_exposure_time) = "ExposureTime" | Defines a pointer to the exposure time, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_SCENE_TYPE](image.md#ohos_image_property_scene_type) = "SceneType" | Defines a pointer to the scene type, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS](image.md#ohos_image_property_iso_speed_ratings) = "ISOSpeedRatings" | Defines a pointer to the ISO speed ratings, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_F_NUMBER](image.md#ohos_image_property_f_number) = "FNumber" | Defines a pointer to the f-number of the image, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL](image.md#ohos_image_property_compressed_bits_per_pixel) = "CompressedBitsPerPixel" | Defines a pointer to the compressed bits per pixel, one of the image properties.|
......@@ -47,6 +47,6 @@ The **native_audiostream_base.h** file declares the basic data structure of **OH
| [OH_AudioStream_SampleFormat](_o_h_audio.md#oh_audiostream_sampleformat) { [AUDIOSTREAM_SAMPLE_U8](_o_h_audio.md) = 0, [AUDIOSTREAM_SAMPLE_S16LE](_o_h_audio.md) = 1, [AUDIOSTREAM_SAMPLE_S24LE](_o_h_audio.md) = 2, [AUDIOSTREAM_SAMPLE_S32LE](_o_h_audio.md) = 3 } | Enumerates the sampling formats of audio streams.|
| [OH_AudioStream_EncodingType](_o_h_audio.md#oh_audiostream_encodingtype) { **AUDIOSTREAM_ENCODING_TYPE_RAW** = 0 } | Enumerates the encoding types of audio streams.|
| [OH_AudioStream_Usage](_o_h_audio.md#oh_audiostream_usage) { **AUDIOSTREAM_USAGE_UNKNOWN** = 0, **AUDIOSTREAM_USAGE_MUSIC** = 1, **AUDIOSTREAM_USAGE_COMMUNICATION** = 2, **AUDIOSTREAM_USAGE_GAME** = 11 } | Enumerates the usage scenarios of audio output streams.|
| [OH_AudioStream_LatencyMode](_o_h_audio.md#oh_audiostream_latencymode) { [AUDIOSTREAM_LATENCY_MODE_NORMAL](_o_h_audio.md) } | Enumerates the latency modes of audio streams.|
| [OH_AudioStream_LatencyMode](_o_h_audio.md#oh_audiostream_latencymode) { [AUDIOSTREAM_LATENCY_MODE_NORMAL](_o_h_audio.md) = 0, [AUDIOSTREAM_LATENCY_MODE_FAST](_o_h_audio.md) = 1 } | Enumerates the latency modes of audio streams.|
| [OH_AudioStream_State](_o_h_audio.md#oh_audiostream_state) {<br>[AUDIOSTREAM_STATE_INVALID](_o_h_audio.md) = -1, [AUDIOSTREAM_STATE_PREPARED](_o_h_audio.md) = 1, [AUDIOSTREAM_STATE_RUNNING](_o_h_audio.md) = 2, [AUDIOSTREAM_STATE_STOPPED](_o_h_audio.md) = 3,<br>[AUDIOSTREAM_STATE_RELEASED](_o_h_audio.md) = 4, [AUDIOSTREAM_STATE_PAUSED](_o_h_audio.md) = 5<br>} | Enumerates the audio stream states.|
| [OH_AudioStream_SourceType](_o_h_audio.md#oh_audiostream_sourcetype) { **AUDIOSTREAM_SOURCE_TYPE_INVALID** = -1, **AUDIOSTREAM_SOURCE_TYPE_MIC**, **AUDIOSTREAM_SOURCE_TYPE_VOICE_RECOGNITION** = 1, **AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION** = 7 } | Enumerates the usage scenarios of audio input streams.|
# native_avscreen_capture.h
## Overview
The **native_avscreen_capture.h** file declares the native APIs used to create an **OH_AVScreenCapture** instance.
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Functions
| Name| Description|
| -------- | -------- |
| [OH_AVScreenCapture_Create](_a_v_screen_capture.md#oh_avscreencapture_create) (void) | Creates an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCapture_Init](_a_v_screen_capture.md#oh_avscreencapture_init) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) config) | Initializes parameters related to an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCapture_StartScreenCapture](_a_v_screen_capture.md#oh_avscreencapture_startscreencapture) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Starts screen capture and collects original streams. After calling this function, the application can use the callback listeners **OH_AVScreenCaptureOnAudioBufferAvailable** and **OH_AVScreenCaptureOnVideoBufferAvailable** to check whether streams are generated.|
| [OH_AVScreenCapture_StopScreenCapture](_a_v_screen_capture.md#oh_avscreencapture_stopscreencapture) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Stops screen capture. This function is used in pair with **OH_AVScreenCapture_StartScreenCapture**. After calling this function, the application stops screen capture or screen share and releases the microphone.|
| [OH_AVScreenCapture_StartScreenRecording](_a_v_screen_capture.md#oh_avscreencapture_startscreenrecording) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Starts screen recording and collects encoded streams.<br>**NOTE**: This function is reserved and will be provided in later versions.|
| [OH_AVScreenCapture_StopScreenRecording](_a_v_screen_capture.md#oh_avscreencapture_stopscreenrecording) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Stops screen recording. This function is used in pair with **OH_AVScreenCapture_StartScreenRecording**.<br>**NOTE**: This function is reserved and will be provided in later versions.|
| [OH_AVScreenCapture_AcquireAudioBuffer](_a_v_screen_capture.md#oh_avscreencapture_acquireaudiobuffer) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, [OH_AudioBuffer](_o_h___audio_buffer.md) \*\*audiobuffer, [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) type) | Obtains an audio buffer. When calling this function, the application must allocate the memory of the corresponding struct size to the audio buffer.|
| [OH_AVScreenCapture_AcquireVideoBuffer](_a_v_screen_capture.md#oh_avscreencapture_acquirevideobuffer) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, int32_t \*fence, int64_t \*timestamp, struct [OH_Rect](_o_h___rect.md) \*region) | Obtains a video buffer. An application can call this function to obtain information such as the video buffer and timestamp.|
| [OH_AVScreenCapture_ReleaseAudioBuffer](_a_v_screen_capture.md#oh_avscreencapture_releaseaudiobuffer) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) type) | Releases an audio buffer.|
| [OH_AVScreenCapture_ReleaseVideoBuffer](_a_v_screen_capture.md#oh_avscreencapture_releasevideobuffer) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Releases a video buffer.|
| [OH_AVScreenCapture_SetCallback](_a_v_screen_capture.md#oh_avscreencapture_setcallback) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, struct [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) callback) | Sets a callback to listen for available video buffers and audio buffers and errors that occur during the function calling.|
| [OH_AVScreenCapture_Release](_a_v_screen_capture.md#oh_avscreencapture_release) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Releases an **OH_AVScreenCapture** instance. This function is used in pair with **OH_AVScreenCapture_Create**.|
| [OH_AVScreenCapture_SetMicrophoneEnabled](_a_v_screen_capture.md#oh_avscreencapture_setmicrophoneenabled) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, bool isMicrophone) | Enables or disables the microphone.|
# native_avscreen_capture_base.h
## Overview
The **native_avscreen_capture_base.h** file declares the common structs, character constants, and enums used for running screen capture.
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OH_AudioCaptureInfo](_o_h___audio_capture_info.md) | Defines audio capturing information.|
| [OH_AudioEncInfo](_o_h___audio_enc_info.md) | Defines audio encoding information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_AudioInfo](_o_h___audio_info.md) | Defines audio capturing parameters.|
| [OH_VideoCaptureInfo](_o_h___video_capture_info.md) | Defines video capturing information.|
| [OH_VideoEncInfo](_o_h___video_enc_info.md) | Defines video encoding information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_VideoInfo](_o_h___video_info.md) | Defines video capturing parameters.|
| [OH_RecorderInfo](_o_h___recorder_info.md) | Defines recording file information.|
| [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) | Defines the screen capture configuration.|
| [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.|
| [OH_Rect](_o_h___rect.md) | Defines the width, height, and image information of the rectangle used for screen capture.|
| [OH_AudioBuffer](_o_h___audio_buffer.md) | Defines the configuration such as the size, type, and timestamp of audio data.|
### Types
| Name| Description|
| -------- | -------- |
| [OH_NativeBuffer](_a_v_screen_capture.md#oh_nativebuffer) | Defines the native video stream class for screen capture.|
| [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) | Defines a screen capture instance used to obtain original video and audio streams.|
| [OH_CaptureMode](_a_v_screen_capture.md#oh_capturemode) | Defines an enum that enumerates the screen capture modes.|
| [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) | Defines an enum that enumerates the audio source types during screen capture.|
| [OH_AudioCodecFormat](_a_v_screen_capture.md#oh_audiocodecformat) | Defines an enum that enumerates the audio encoding formats.|
| [OH_VideoCodecFormat](_a_v_screen_capture.md#oh_videocodecformat) | Defines an enum that enumerates the video encoding formats.|
| [OH_DataType](_a_v_screen_capture.md#oh_datatype) | Defines an enum that enumerates the data types of screen capture streams.|
| [OH_VideoSourceType](_a_v_screen_capture.md#oh_videosourcetype) | Defines an enum that enumerates the video source formats.|
| [OH_ContainerFormatType](_a_v_screen_capture.md#oh_containerformattype) | Defines an enum that enumerates the types of files generated during screen capture.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_AudioCaptureInfo](_a_v_screen_capture.md#oh_audiocaptureinfo) | Defines audio capturing information.|
| [OH_AudioEncInfo](_a_v_screen_capture.md#oh_audioencinfo) | Defines audio encoding information.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_AudioInfo](_a_v_screen_capture.md#oh_audioinfo) | Defines audio capturing parameters.|
| [OH_VideoCaptureInfo](_a_v_screen_capture.md#oh_videocaptureinfo) | Defines video capturing information.|
| [OH_VideoEncInfo](_a_v_screen_capture.md#oh_videoencinfo) | Defines video encoding information.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_VideoInfo](_a_v_screen_capture.md#oh_videoinfo) | Defines video capturing parameters.|
| [OH_RecorderInfo](_a_v_screen_capture.md#oh_recorderinfo) | Defines recording file information.|
| [OH_AVScreenCaptureConfig](_a_v_screen_capture.md#oh_avscreencaptureconfig) | Defines the screen recording configuration.|
| (\*[OH_AVScreenCaptureOnError](_a_v_screen_capture.md#oh_avscreencaptureonerror)) ([OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, int32_t errorCode) | Defines a pointer to a callback function that is called when an error occurs during the running of an **OH_AVScreenCapture** instance.|
| (\*[OH_AVScreenCaptureOnAudioBufferAvailable](_a_v_screen_capture.md#oh_avscreencaptureonaudiobufferavailable)) ([OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, bool isReady, [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) type) | Defines a pointer to a callback function that is called when an audio buffer is available during the running of an **OH_AVScreenCapture** instance.|
| (\*[OH_AVScreenCaptureOnVideoBufferAvailable](_a_v_screen_capture.md#oh_avscreencaptureonvideobufferavailable)) ([OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, bool isReady) | Defines a pointer to a callback function that is called when a video buffer is available during the running of an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCaptureCallback](_a_v_screen_capture.md#oh_avscreencapturecallback) | Defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.|
| [OH_Rect](_a_v_screen_capture.md#oh_rect) | Defines the width, height, and image information of the rectangle used for screen capture.|
| [OH_AudioBuffer](_a_v_screen_capture.md#oh_audiobuffer) | Defines the configuration such as the size, type, and timestamp of audio data.|
### Enums
| Name| Description|
| -------- | -------- |
| [OH_CaptureMode](_a_v_screen_capture.md#oh_capturemode) { [OH_CAPTURE_HOME_SCREEN](_a_v_screen_capture.md) = 0, [OH_CAPTURE_SPECIFIED_SCREEN](_a_v_screen_capture.md) = 1, [OH_CAPTURE_SPECIFIED_WINDOW](_a_v_screen_capture.md) = 2, [OH_CAPTURE_INVAILD](_a_v_screen_capture.md) = -1 } | Enumerates the screen capture modes.|
| [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) {<br>[OH_SOURCE_INVALID](_a_v_screen_capture.md) = -1, [OH_SOURCE_DEFAULT](_a_v_screen_capture.md) = 0, [OH_MIC](_a_v_screen_capture.md) = 1, [OH_ALL_PLAYBACK](_a_v_screen_capture.md) = 2,<br>[OH_APP_PLAYBACK](_a_v_screen_capture.md) = 3<br>} | Enumerates the audio source types during screen capture.|
| [OH_AudioCodecFormat](_a_v_screen_capture.md#oh_audiocodecformat) { [OH_AUDIO_DEFAULT](_a_v_screen_capture.md) = 0, [OH_AAC_LC](_a_v_screen_capture.md) = 3, [OH_AUDIO_CODEC_FORMAT_BUTT](_a_v_screen_capture.md) } | Enumerates the audio encoding formats.|
| [OH_VideoCodecFormat](_a_v_screen_capture.md#oh_videocodecformat) {<br>[OH_VIDEO_DEFAULT](_a_v_screen_capture.md) = 0, [OH_H264](_a_v_screen_capture.md) = 2, [OH_H265](_a_v_screen_capture.md) = 4, [OH_MPEG4](_a_v_screen_capture.md) = 6,<br>[OH_VP8](_a_v_screen_capture.md) = 8, [OH_VP9](_a_v_screen_capture.md) = 10, [OH_VIDEO_CODEC_FORMAT_BUTT](_a_v_screen_capture.md)<br>} | Enumerates the video encoding formats.|
| [OH_DataType](_a_v_screen_capture.md#oh_datatype) { [OH_ORIGINAL_STREAM](_a_v_screen_capture.md) = 0, [OH_ENCODED_STREAM](_a_v_screen_capture.md) = 1, [OH_CAPTURE_FILE](_a_v_screen_capture.md) = 2, OH_INVAILD = -1 } | Enumerates the data sources of screen capture streams.|
| [OH_VideoSourceType](_a_v_screen_capture.md#oh_videosourcetype) { [OH_VIDEO_SOURCE_SURFACE_YUV](_a_v_screen_capture.md) = 0, [OH_VIDEO_SOURCE_SURFACE_ES](_a_v_screen_capture.md), [OH_VIDEO_SOURCE_SURFACE_RGBA](_a_v_screen_capture.md), [OH_VIDEO_SOURCE_BUTT](_a_v_screen_capture.md) } | Enumerates the video source formats.|
| [OH_ContainerFormatType](_a_v_screen_capture.md#oh_containerformattype) { [CFT_MPEG_4A](_a_v_screen_capture.md) = 0, [CFT_MPEG_4](_a_v_screen_capture.md) = 1 } | Enumerates the types of files generated during screen capture.<br>**NOTE**: This enum is reserved and will be provided in later versions.|
# native_avscreen_capture_errors.h
## Overview
The **native_avscreen_capture_errors.h** file declares the error codes generated during screen capture.
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Types
| Name| Description|
| -------- | -------- |
| [OH_AVSCREEN_CAPTURE_ErrCode](_a_v_screen_capture.md#oh_avscreen_capture_errcode) | Defines an enum that enumerates the error codes generated during screen recording.|
### Enums
| Name| Description|
| -------- | -------- |
| [OH_AVSCREEN_CAPTURE_ErrCode](_a_v_screen_capture.md#oh_avscreen_capture_errcode) {<br>[AV_SCREEN_CAPTURE_ERR_BASE](_a_v_screen_capture.md) = 0, [AV_SCREEN_CAPTURE_ERR_OK](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE, [AV_SCREEN_CAPTURE_ERR_NO_MEMORY](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 1, [AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 2,<br>[AV_SCREEN_CAPTURE_ERR_INVALID_VAL](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 3, [AV_SCREEN_CAPTURE_ERR_IO](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 4, [AV_SCREEN_CAPTURE_ERR_TIMEOUT](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 5, [AV_SCREEN_CAPTURE_ERR_UNKNOWN](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 6,<br>[AV_SCREEN_CAPTURE_ERR_SERVICE_DIED](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 7, [AV_SCREEN_CAPTURE_ERR_INVALID_STATE](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 8, [AV_SCREEN_CAPTURE_ERR_UNSUPPORT](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 9, [AV_SCREEN_CAPTURE_ERR_EXTEND_START](_a_v_screen_capture.md) = AV_SCREEN_CAPTURE_ERR_BASE + 100<br>} | Enumerates the error codes generated during screen recording.|
......@@ -399,6 +399,7 @@
- [Asynchronous Concurrency Overview](arkts-utils/async-concurrency-overview.md)
- [Single I/O Task Development](arkts-utils/single-io-development.md)
- Using Multithread Concurrency for Development
- [Multithread Concurrency Overview](arkts-utils/multi-thread-concurrency-overview.md)
- [Comparison Between TaskPool and Worker](arkts-utils/taskpool-vs-worker.md)
- [CPU Intensive Task Development](arkts-utils/cpu-intensive-task-development.md)
- [I/O Intensive Task Development](arkts-utils/io-intensive-task-development.md)
......@@ -507,6 +508,7 @@
- Best Practices
- [Camera Photographing Sample](media/camera-shooting-case.md)
- [Camera Recording Sample](media/camera-recording-case.md)
- [Using Performance Improvement Features (for System Applications Only)](media/camera-performance-improvement.md)
- Image
- [Image Overview](media/image-overview.md)
- [Image Decoding](media/image-decoding.md)
......@@ -542,9 +544,9 @@
- [hapsigner Guide](security/hapsigntool-guidelines.md)
- [HarmonyAppProvision Configuration File](security/app-provision-structure.md)
- AI
- [AI Development](./ai/ai-overview.md)
- [Using MindSpore Lite JavaScript APIs to Develop AI Applications](./ai/mindspore-guidelines-based-js.md)
- [Using MindSpore Lite Native APIs to Develop AI Applications](./ai/mindspore-guidelines-based-native.md)
- [AI Development](ai/ai-overview.md)
- [Using MindSpore Lite JavaScript APIs to Develop AI Applications](ai/mindspore-guidelines-based-js.md)
- [Using MindSpore Lite Native APIs to Develop AI Applications](ai/mindspore-guidelines-based-native.md)
- Connectivity
- Network Management
- [Network Management Overview](connectivity/net-mgmt-overview.md)
......@@ -622,12 +624,12 @@
- [Setting the Security Level of a Distributed File](file-management/set-security-label.md)
- [Accessing Files Across Devices](file-management/file-access-across-devices.md)
- Background Task Management
- [Background Task Overview](task-management/background-task-overview.md)
- [Transient Task](task-management/transient-task.md)
- [Continuous Task](task-management/continuous-task.md)
- [Deferred Task](task-management/work-scheduler.md)
- [Agent-powered Reminder](task-management/agent-powered-reminder.md)
- [Requesting Efficiency Resources (for Privileged System Applications Only)](task-management/efficiency-resource-request.md)
- [Background Task Overview](task-management/background-task-overview.md)
- [Transient Task](task-management/transient-task.md)
- [Continuous Task](task-management/continuous-task.md)
- [Deferred Task](task-management/work-scheduler.md)
- [Agent-powered Reminder](task-management/agent-powered-reminder.md)
- [Requesting Efficiency Resources (for Privileged System Applications Only)](task-management/efficiency-resource-request.md)
- Device Management
- USB Service
- [USB Service Overview](device/usb-overview.md)
......@@ -678,6 +680,7 @@
- Native APIs
- [Using Native APIs in Application Projects](napi/napi-guidelines.md)
- Graphics
- [XComponent Development](napi/xcomponent-guidelines.md)
- [Drawing Development](napi/drawing-guidelines.md)
- [NativeBuffer Development](napi/native-buffer-guidelines.md)
- [NativeImage Development](napi/native-image-guidelines.md)
......@@ -692,6 +695,8 @@
- [Connecting the Neural Network Runtime to an AI Inference Framework](napi/neural-network-runtime-guidelines.md)
- Memory Management
- [Purgeable Memory Development](napi/purgeable-memory-guidelines.md)
- Device Management
- [USB DDK Development](napi/usb-ddk-guidelines.md)
- Tools
- [DevEco Studio (OpenHarmony) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- Debugging Tools
......@@ -905,17 +910,18 @@
- UI Page
- [@ohos.animator (Animator)](reference/apis/js-apis-animator.md)
- [@ohos.arkui.componentSnapshot (Component Snapshot)](reference/apis/js-apis-arkui-componentSnapshot.md)
- [@ohos.arkui.dragController (DragController)](reference/apis/js-apis-arkui-dragController.md)
- [@ohos.arkui.drawableDescriptor (DrawableDescriptor)](reference/apis/js-apis-arkui-drawableDescriptor.md)
- [@ohos.arkui.inspector (Layout Callback)](reference/apis/js-apis-arkui-inspector.md)
- [@ohos.arkui.UIContext (UIContext)](reference/apis/js-apis-arkui-UIContext.md)
- [@ohos.curves (Interpolation Calculation)](reference/apis/js-apis-curve.md)
- [@ohos.font (Custom Font Registration)](reference/apis/js-apis-font.md)
- [@ohos.matrix4 (Matrix Transformation)](reference/apis/js-apis-matrix4.md)
- [@ohos.measure (Text Measurement)](reference/apis/js-apis-measure.md)
- [@ohos.mediaquery (Media Query)](reference/apis/js-apis-mediaquery.md)
- [@ohos.pluginComponent (PluginComponentManager)](reference/apis/js-apis-plugincomponent.md)
- [@ohos.promptAction (Prompt)](reference/apis/js-apis-promptAction.md)
- [@ohos.router (Page Routing)](reference/apis/js-apis-router.md)
- [@ohos.measure (Text Measurement)](reference/apis/js-apis-measure.md)
- [@ohos.uiAppearance (UI Appearance)](reference/apis/js-apis-uiappearance.md)
- Graphics
- [@ohos.animation.windowAnimationManager (Window Animation Management)](reference/apis/js-apis-windowAnimationManager.md)
......@@ -983,8 +989,8 @@
- [@ohos.file.fileuri (File URI)](reference/apis/js-apis-file-fileuri.md)
- [@ohos.file.fs (File Management)](reference/apis/js-apis-file-fs.md)
- [@ohos.file.hash (File Hash Processing)](reference/apis/js-apis-file-hash.md)
- [@ohos.file.picker (File Picker)](reference/apis/js-apis-file-picker.md)
- [@ohos.file.photoAccessHelper (Album Management)](reference/apis/js-apis-photoAccessHelper.md)
- [@ohos.file.picker (File Picker)](reference/apis/js-apis-file-picker.md)
- [@ohos.file.securityLabel (Data Label)](reference/apis/js-apis-file-securityLabel.md)
- [@ohos.file.statvfs (File System Space Statistics)](reference/apis/js-apis-file-statvfs.md)
- [@ohos.file.storageStatistics (Application Storage Statistics)](reference/apis/js-apis-file-storage-statistics.md)
......@@ -1013,8 +1019,18 @@
- [@ohos.net.webSocket (WebSocket Connection)](reference/apis/js-apis-webSocket.md)
- [@ohos.request (Upload and Download)](reference/apis/js-apis-request.md)
- Connectivity
- [@ohos.bluetooth.a2dp (Bluetooth A2DP Module) (Recommended)](reference/apis/js-apis-bluetooth-a2dp.md)
- [@ohos.bluetooth.access (Bluetooth Access Module) (Recommended)](reference/apis/js-apis-bluetooth-access.md)
- [@ohos.bluetooth.baseProfile (Bluetooth baseProfile Module) (Recommended)](reference/apis/js-apis-bluetooth-baseProfile.md)
- [@ohos.bluetooth.ble (Bluetooth BLE Module) (Recommended)](reference/apis/js-apis-bluetooth-ble.md)
- [@ohos.bluetooth.connection (Bluetooth connection Module) (Recommended)](reference/apis/js-apis-bluetooth-connection.md)
- [@ohos.bluetooth.constant (Bluetooth constant Module) (Recommended)](reference/apis/js-apis-bluetooth-constant.md)
- [@ohos.bluetooth.hfp (Bluetooth hfp Module) (Recommended)](reference/apis/js-apis-bluetooth-hfp.md)
- [@ohos.bluetooth.hid (Bluetooth hid Module) (Recommended)](reference/apis/js-apis-bluetooth-hid.md)
- [@ohos.bluetooth.pan (Bluetooth pan Module) (Recommended)](reference/apis/js-apis-bluetooth-pan.md)
- [@ohos.bluetooth.socket (Bluetooth socket Module) (Recommended)](reference/apis/js-apis-bluetooth-socket.md)
- [@ohos.bluetooth (Bluetooth) (To Be Deprecated Soon)](reference/apis/js-apis-bluetooth.md)
- [@ohos.bluetoothManager (Bluetooth) (Recommended)](reference/apis/js-apis-bluetoothManager.md)
- [@ohos.bluetoothManager (Bluetooth) (To Be Deprecated Soon)](reference/apis/js-apis-bluetoothManager.md)
- [@ohos.connectedTag (Active Tags)](reference/apis/js-apis-connectedTag.md)
- [@ohos.nfc.cardEmulation (Standard NFC Card Emulation)](reference/apis/js-apis-cardEmulation.md)
- [@ohos.nfc.controller (Standard NFC)](reference/apis/js-apis-nfcController.md)
......@@ -1089,7 +1105,6 @@
- [@ohos.multimodalInput.touchEvent (Touch Event)](reference/apis/js-apis-touchevent.md)
- [@ohos.multimodalInput.shortKey (Shortcut Key)](reference/apis/js-apis-shortKey.md)
- [@ohos.power (System Power Management)](reference/apis/js-apis-power.md)
- [@ohos.resourceschedule.deviceStandby (Device Standby)](reference/apis/js-apis-resourceschedule-deviceStandby.md)
- [@ohos.runningLock (Runninglock)](reference/apis/js-apis-runninglock.md)
- [@ohos.sensor (Sensor)](reference/apis/js-apis-sensor.md)
- [@ohos.settings (Data Item Settings)](reference/apis/js-apis-settings.md)
......@@ -1380,6 +1395,7 @@
- [Component Transition](reference/arkui-ts/ts-transition-animation-component.md)
- [Transition of Shared Elements](reference/arkui-ts/ts-transition-animation-shared-elements.md)
- [Implicit Shared Element Transition](reference/arkui-ts/ts-transition-animation-geometrytransition.md)
- [Motion Path Animation](reference/arkui-ts/ts-motion-path-animation.md)
- Global UI Methods
- Pop-up Window
- [Alert Dialog Box](reference/arkui-ts/ts-methods-alert-dialog-box.md)
......@@ -1629,6 +1645,7 @@
- [Network Connection Management Error Codes](reference/errorcodes/errorcode-net-connection.md)
- [Ethernet Connection Error Codes](reference/errorcodes/errorcode-net-ethernet.md)
- [Network Sharing Error Codes](reference/errorcodes/errorcode-net-sharing.md)
- [Policy Management Error Codes](reference/errorcodes/errorcode-net-policy.md)
- [mDNS Error Codes](reference/errorcodes/errorcode-net-mdns.md)
- [Traffic Management Error Codes](reference/errorcodes/errorcode-net-statistics.md)
- Connectivity
......@@ -1698,11 +1715,13 @@
- [AVDemuxer](reference/native-apis/_a_v_demuxer.md)
- [AVSource](reference/native-apis/_a_v_source.md)
- [OHAudio](reference/native-apis/_o_h_audio.md)
- [AVScreenCapture](reference/native-apis/_a_v_screen_capture.md)
- [HuksKeyApi](reference/native-apis/_huks_key_api.md)
- [HuksParamSetApi](reference/native-apis/_huks_param_set_api.md)
- [HuksTypeApi](reference/native-apis/_huks_type_api.md)
- [Init](reference/native-apis/init.md)
- [Memory](reference/native-apis/memory.md)
- [UsbDdk](reference/native-apis/_usb_ddk.md)
- [Hitrace](reference/native-apis/_hitrace.md)
- [Vulkan](reference/native-apis/_vulkan.md)
- Header Files
......@@ -1717,11 +1736,17 @@
- [drawing_text_typography.h](reference/native-apis/drawing__text__typography_8h.md)
- [drawing_types.h](reference/native-apis/drawing__types_8h.md)
- [external_window.h](reference/native-apis/external__window_8h.md)
- [image_mdk.h](reference/native-apis/image__mdk_8h.md)
- [image_mdk_common.h](reference/native-apis/image__mdk__common_8h.md)
- [image_pixel_map_mdk.h](reference/native-apis/image__pixel__map__mdk_8h.md)
- [image_pixel_map_napi.h](reference/native-apis/image__pixel__map__napi_8h.md)
- [image_receiver_mdk.h](reference/native-apis/image__receiver__mdk_8h.md)
- [image_source_mdk.h](reference/native-apis/image__source__mdk_8h.md)
- [log.h](reference/native-apis/log_8h.md)
- [native_buffer.h](reference/native-apis/native__buffer_8h.md)
- [native_image.h](reference/native-apis/native__image_8h.md)
- [native_interface_xcomponent.h](reference/native-apis/native__interface__xcomponent_8h.md)
- [native_xcomponent_key_event.h](reference/native-apis/native__xcomponent__key__event_8h.md)
- [native_vsync.h](reference/native-apis/native__vsync_8h.md)
- [raw_dir.h](reference/native-apis/raw__dir_8h.md)
- [raw_file_manager.h](reference/native-apis/raw__file__manager_8h.md)
......@@ -1752,6 +1777,9 @@
- [native_audiorenderer.h](reference/native-apis/native__audiorenderer_8h.md)
- [native_audiostream_base.h](reference/native-apis/native__audiostream__base_8h.md)
- [native_audiostreambuilder.h](reference/native-apis/native__audiostreambuilder_8h.md)
- [native_avscreen_capture.h](reference/native-apis/native__avscreen__capture_8h.md)
- [native_avscreen_capture_base.h](reference/native-apis/native__avscreen__capture__base_8h.md)
- [native_avscreen_capture_errors.h](reference/native-apis/native__avscreen__capture__errors_8h.md)
- [native_huks_api.h](reference/native-apis/native__huks__api_8h.md)
- [native_huks_param.h](reference/native-apis/native__huks__param_8h.md)
- [native_huks_type.h](reference/native-apis/native__huks__type_8h.md)
......@@ -1763,6 +1791,8 @@
- [relational_store.h](reference/native-apis/relational__store_8h.md)
- [syscap_ndk.h](reference/native-apis/syscap__ndk_8h.md)
- [purgeable_memory.h](reference/native-apis/purgeable__memory_8h.md)
- [usb_ddk_api.h](reference/native-apis/usb__ddk__api_8h.md)
- [usb_ddk_types.h](reference/native-apis/usb__ddk__types_8h.md)
- [trace.h](reference/native-apis/trace_8h.md)
- [vulkan_ohos.h](reference/native-apis/vulkan__ohos_8h.md)
- Structs
......@@ -1775,8 +1805,23 @@
- [OH_NativeXComponent_TouchPoint](reference/native-apis/_o_h___native_x_component___touch_point.md)
- [OHExtDataHandle](reference/native-apis/_o_h_ext_data_handle.md)
- [OHHDRMetaData](reference/native-apis/_o_h_h_d_r_meta_data.md)
- [OHOS::Media::OhosImageComponent](reference/native-apis/_o_h_o_s_1_1_media_1_1_ohos_image_component.md)
- [OHOS::Media::OhosImageRect](reference/native-apis/_o_h_o_s_1_1_media_1_1_ohos_image_rect.md)
- [OHOS::Media::OhosPixelMapInfo](reference/native-apis/_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md)
- [OhosImageDecodingOps](reference/native-apis/_ohos_image_decoding_ops.md)
- [OhosImageReceiverInfo](reference/native-apis/_ohos_image_receiver_info.md)
- [OhosImageRegion](reference/native-apis/_ohos_image_region.md)
- [OhosImageSize](reference/native-apis/_ohos_image_size.md)
- [OhosImageSource](reference/native-apis/_ohos_image_source.md)
- [OhosImageSourceDelayTimeList](reference/native-apis/_ohos_image_source_delay_time_list.md)
- [OhosImageSourceInfo](reference/native-apis/_ohos_image_source_info.md)
- [OhosImageSourceOps](reference/native-apis/_ohos_image_source_ops.md)
- [OhosImageSourceProperty](reference/native-apis/_ohos_image_source_property.md)
- [OhosImageSourceSupportedFormat](reference/native-apis/_ohos_image_source_supported_format.md)
- [OhosImageSourceSupportedFormatList](reference/native-apis/_ohos_image_source_supported_format_list.md)
- [OhosImageSourceUpdateData](reference/native-apis/_ohos_image_source_update_data.md)
- [OhosPixelMapCreateOps](reference/native-apis/_ohos_pixel_map_create_ops.md)
- [OhosPixelMapInfo](reference/native-apis/_ohos_pixel_map_info.md)
- [OhosPixelMapInfos](reference/native-apis/_ohos_pixel_map_infos.md)
- [RawFileDescriptor](reference/native-apis/_raw_file_descriptor.md)
- [Region](reference/native-apis/_region.md)
- [Rect](reference/native-apis/_rect.md)
......@@ -1792,6 +1837,17 @@
- [OH_AVRange](reference/native-apis/_o_h___a_v_range.md)
- [OH_AudioCapturer_Callbacks_Struct](reference/native-apis/_o_h___audio_capturer___callbacks___struct.md)
- [OH_AudioRenderer_Callbacks_Struct](reference/native-apis/_o_h___audio_renderer___callbacks___struct.md)
- [OH_AudioBuffer](reference/native-apis/_o_h___audio_buffer.md)
- [OH_AudioCaptureInfo](reference/native-apis/_o_h___audio_capture_info.md)
- [OH_AudioEncInfo](reference/native-apis/_o_h___audio_enc_info.md)
- [OH_AudioInfo](reference/native-apis/_o_h___audio_info.md)
- [OH_AVScreenCaptureCallback](reference/native-apis/_o_h___a_v_screen_capture_callback.md)
- [OH_AVScreenCaptureConfig](reference/native-apis/_o_h___a_v_screen_capture_config.md)
- [OH_RecorderInfo](reference/native-apis/_o_h___recorder_info.md)
- [OH_Rect](reference/native-apis/_o_h___rect.md)
- [OH_VideoCaptureInfo](reference/native-apis/_o_h___video_capture_info.md)
- [OH_VideoEncInfo](reference/native-apis/_o_h___video_enc_info.md)
- [OH_VideoInfo](reference/native-apis/_o_h___video_info.md)
- [OH_Huks_Blob](reference/native-apis/_o_h___huks___blob.md)
- [OH_Huks_CertChain](reference/native-apis/_o_h___huks___cert_chain.md)
- [OH_Huks_KeyInfo](reference/native-apis/_o_h___huks___key_info.md)
......@@ -1810,6 +1866,17 @@
- [OH_Rdb_Store](reference/native-apis/_o_h___rdb___store.md)
- [OH_VBucket](reference/native-apis/_o_h___v_bucket.md)
- [OH_VObject](reference/native-apis/_o_h___v_object.md)
- [UsbConfigDescriptor](reference/native-apis/_usb_config_descriptor.md)
- [UsbControlRequestSetup](reference/native-apis/_usb_control_request_setup.md)
- [UsbDdkConfigDescriptor](reference/native-apis/_usb_ddk_config_descriptor.md)
- [UsbDdkEndpointDescriptor](reference/native-apis/_usb_ddk_endpoint_descriptor.md)
- [UsbDdkInterface](reference/native-apis/_usb_ddk_interface.md)
- [UsbDdkInterfaceDescriptor](reference/native-apis/_usb_ddk_interface_descriptor.md)
- [UsbDeviceDescriptor](reference/native-apis/_usb_device_descriptor.md)
- [UsbDeviceMemMap](reference/native-apis/_usb_device_mem_map.md)
- [UsbEndpointDescriptor](reference/native-apis/_usb_endpoint_descriptor.md)
- [UsbInterfaceDescriptor](reference/native-apis/_usb_interface_descriptor.md)
- [UsbRequestPipe](reference/native-apis/_usb_request_pipe.md)
- [VkExternalFormatOHOS](reference/native-apis/_vk_external_format_o_h_o_s.md)
- [VkImportNativeBufferInfoOHOS](reference/native-apis/_vk_import_native_buffer_info_o_h_o_s.md)
- [VkMemoryGetNativeBufferInfoOHOS](reference/native-apis/_vk_memory_get_native_buffer_info_o_h_o_s.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册