> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs provided by this module are system APIs.
## Modules to Import
## Modules to Import
...
@@ -476,10 +477,10 @@ Listens for camera status changes. This API uses an asynchronous callback to ret
...
@@ -476,10 +477,10 @@ Listens for camera status changes. This API uses an asynchronous callback to ret
| type | string | Yes | Event type. The value is fixed at **'cameraStatus'**. The callback function returns the camera information, including the device and device status (available or unavailable). The event can be listened for only when a **CameraManager** instance is obtained.|
| type | string | Yes | Event type. The value is fixed at **'cameraStatus'**. The event can be listened for when a **CameraManager** instance is obtained. This event is triggered and the corresponding information is returned only when the device is enabled or disabled.|
| callback | AsyncCallback<[CameraStatusInfo](#camerastatusinfo)\> | Yes | Callback used to return the camera status change. |
| callback | AsyncCallback<[CameraStatusInfo](#camerastatusinfo)\> | Yes | Callback used to return the camera status change.| |
**Example**
**Example**
...
@@ -504,8 +505,8 @@ This is a system API.
...
@@ -504,8 +505,8 @@ This is a system API.
| Name | Type | Mandatory| Description |
| Name | Type | Mandatory| Description |
| -------- | --------------- | ---- | --------- |
| -------- | --------------- | ---- | --------- |
| type | string | Yes | Event type. The value is fixed at **'cameraMute'**. The callback function returns the mute status changes. The event can be listened for only when a **CameraManager** instance is obtained.|
| type | string | Yes | Event type. The value is fixed at **'cameraMute'**, indicating the camera mute status. The event can be listened for when a **CameraManager** instance is obtained. This event is triggered and the status is returned when the camera is enabled or disabled.|
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the camera mute status. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the mute status. The value **true** means that the camera is enabled, and **false** means that the camera is disabled. |
**Example**
**Example**
...
@@ -727,7 +728,7 @@ Listens for **CameraInput** errors. This API uses a callback to return the resul
...
@@ -727,7 +728,7 @@ Listens for **CameraInput** errors. This API uses a callback to return the resul
| type | string | Yes | Event type. The value is fixed at **'error'**. The callback function returns an error code, for example, an error code indicating that the device is unavailable or a conflict occurs. The event can be listened for only when a **CameraInput** instance is obtained.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **CameraInput** instance is created. This event is triggered and the result is returned when an error occurs on the camera. For example, if the device is unavailable or a conflict occurs, the error information is returned.|
| FOCUS_MODE_MANUAL | 0 | Manual focus. The focal length of the camera can be manually set to change the focus position. However, the focal point cannot be set. |
| FOCUS_MODE_CONTINUOUS_AUTO | 1 | Continuous auto focus.|
| FOCUS_MODE_CONTINUOUS_AUTO | 1 | Continuous auto focus. The focal point cannot be set.|
| FOCUS_MODE_AUTO | 2 | Auto focus. |
| FOCUS_MODE_AUTO | 2 | Auto focus. The focal point can be set by calling [setFocusPoint](#setfocuspoint), and auto focus is performed once based on the focal point. After the auto focus operation is complete (regardless of whether the focus is successful or fails), the focus mode is locked. To enable the camera to initiate another auto focus, the application must call **CONTINUOUS_AUTO** again. |
| FOCUS_MODE_LOCKED | 3 | Focus locked. |
| FOCUS_MODE_LOCKED | 3 | Focus locked. The focal point cannot be set. |
## FocusState
## FocusState
...
@@ -1391,7 +1392,9 @@ try {
...
@@ -1391,7 +1392,9 @@ try {
setMeteringPoint(point: Point): void
setMeteringPoint(point: Point): void
Sets the metering point for the device.
Sets the metering point, which is the center point of the metering rectangle. The metering point must be in the coordinate system (0-1), where the upper left corner is {0, 0} and the lower right corner is {1, 1}.
The coordinate system is based on the horizontal device direction with the device's charging port on the right. If the layout of the preview screen of an application is based on the vertical direction with the charging port on the lower side, the layout width and height are {w, h}, and the touch point is {x, y}, then the coordinate point after conversion is {y/h, 1-x/w}.
Sets an exposure compensation value for the device.
Sets an exposure compensation value (EV).
Before the setting, you are advised to use **[getExposureBiasRange](#getexposurebiasrange)** to obtain the supported values.
Before the setting, you are advised to use **[getExposureBiasRange](#getexposurebiasrange)** to obtain the supported values.
...
@@ -1590,7 +1593,9 @@ try {
...
@@ -1590,7 +1593,9 @@ try {
setFocusPoint(point: Point): void
setFocusPoint(point: Point): void
Sets a focal point for the device.
Sets the focal point. The focal point must be in the coordinate system (0-1), where the upper left corner is {0, 0} and the lower right corner is {1, 1}.
The coordinate system is based on the horizontal device direction with the device's charging port on the right. If the layout of the preview screen of an application is based on the vertical direction with the charging port on the lower side, the layout width and height are {w, h}, and the touch point is {x, y}, then the coordinate point after conversion is {y/h, 1-x/w}.
| type | string | Yes | Event type. The value is fixed at **'focusStateChange'**. The callback function returns the focus state change. The event can be listened for only when the session is created.|
| type | string | Yes | Event type. The value is fixed at **'focusStateChange'**. The event can be listened for when a session is created. This event is triggered only when the camera focus state changes in auto focus mode.|
| callback | AsyncCallback<[FocusState](#focusstate)\> | Yes | Callback used to return the focus state change. |
| callback | AsyncCallback<[FocusState](#focusstate)\> | Yes | Callback used to return the focus state change. |
**Example**
**Example**
...
@@ -1872,7 +1877,7 @@ Listens for **CaptureSession** errors. This API uses a callback to return the er
...
@@ -1872,7 +1877,7 @@ Listens for **CaptureSession** errors. This API uses a callback to return the er
| type | string | Yes | Event type. The value is fixed at **'error'**. The callback function returns the error code corresponding to an error that occurs during the call of a **CaptureSession** API, for example, **beginConfig()**, **commitConfig()**, or **addInput()**.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a session is created. This event is triggered and the error message is returned when an error occurs during the calling of a session-related API such as **beginConfig()**, **commitConfig()**, and **addInput**.|
| callback | ErrorCallback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | ErrorCallback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
**Example**
**Example**
...
@@ -2053,8 +2058,8 @@ Listens for preview frame start events. This API uses an asynchronous callback t
...
@@ -2053,8 +2058,8 @@ Listens for preview frame start events. This API uses an asynchronous callback t
| type | string | Yes | Event type. The value is fixed at **'frameStart'**. The callback is invoked when the preview on the first frame starts. This event can be listened for only when a **previewOutput** instance is created.|
| type | string | Yes | Event type. The value is fixed at **'frameStart'**. The event can be listened for when a **previewOutput** instance is created. This event is triggered and returned when the bottom layer starts exposure for the first time.|
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. The preview starts as long as this event is returned. |
**Example**
**Example**
...
@@ -2076,8 +2081,8 @@ Listens for preview frame end events. This API uses an asynchronous callback to
...
@@ -2076,8 +2081,8 @@ Listens for preview frame end events. This API uses an asynchronous callback to
| type | string | Yes | Event type. The value is fixed at **'frameEnd'**. The callback is invoked when the preview on the last frame ends. This event can be listened for only when a **previewOutput** instance is created.|
| type | string | Yes | Event type. The value is fixed at **'frameEnd'**. The event can be listened for when a **previewOutput** instance is created. This event is triggered and returned when the last frame of preview ends.|
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. The preview ends as long as this event is returned. |
**Example**
**Example**
...
@@ -2097,9 +2102,9 @@ Listens for **PreviewOutput** errors. This API uses a callback to return the err
...
@@ -2097,9 +2102,9 @@ Listens for **PreviewOutput** errors. This API uses a callback to return the err
| type | string | Yes | Event type. The value is fixed at **'error'**. The callback function returns the error code corresponding to an error that occurs during the call of a **PreviewOutput** API, for example,**start()** or **release()**.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **previewOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the use of a preview-related API such as**start()** or **release()**.|
| callback | ErrorCallback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | ErrorCallback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
**Example**
**Example**
...
@@ -2366,7 +2371,7 @@ Listens for shooting start events. This API uses an asynchronous callback to ret
...
@@ -2366,7 +2371,7 @@ Listens for shooting start events. This API uses an asynchronous callback to ret
| type | string | Yes | Event type. The value is fixed at **'captureStart'**. The callback function returns the shooting start event.|
| type | string | Yes | Event type. The value is fixed at **'captureStart'**. The event can be listened for when a **photoOutput** instance is created. This event is triggered and returned when the bottom layer starts exposure each time a photo is taken.|
| callback | AsyncCallback<number\> | Yes | Callback used to return the capture ID. |
| callback | AsyncCallback<number\> | Yes | Callback used to return the capture ID. |
**Example**
**Example**
...
@@ -2387,10 +2392,10 @@ Listens for frame shutter events. This API uses an asynchronous callback to retu
...
@@ -2387,10 +2392,10 @@ Listens for frame shutter events. This API uses an asynchronous callback to retu
| type | string | Yes | Event type. The value is fixed at **'frameShutter'**. The callback function returns the captured frame information (captureId and time).|
| type | string | Yes | Event type. The value is fixed at **'frameShutter'**. The event can be listened for when a **photoOutput** instance is created.|
| callback | AsyncCallback<[FrameShutterInfo](#frameshutterinfo)\> | Yes | Callback used to return the result. |
| callback | AsyncCallback<[FrameShutterInfo](#frameshutterinfo)\> | Yes | Callback used to return the result. A new photographing request can be delivered as long as this event is returned. |
**Example**
**Example**
...
@@ -2411,9 +2416,9 @@ Listens for shooting end events. This API uses an asynchronous callback to retur
...
@@ -2411,9 +2416,9 @@ Listens for shooting end events. This API uses an asynchronous callback to retur
| type | string | Yes | Event type. The value is fixed at **'captureEnd'**. The callback function returns the shooting end event.|
| type | string | Yes | Event type. The value is fixed at **'captureEnd'**. The event can be listened for when a **photoOutput** instance is created. This event is triggered and the corresponding information is returned when the photographing is complete.|
| callback | AsyncCallback<[CaptureEndInfo](#captureendinfo)\> | Yes | Callback used to return the result. |
| callback | AsyncCallback<[CaptureEndInfo](#captureendinfo)\> | Yes | Callback used to return the result. |
**Example**
**Example**
...
@@ -2435,9 +2440,9 @@ Listens for **PhotoOutput** errors. This API uses a callback to return the error
...
@@ -2435,9 +2440,9 @@ Listens for **PhotoOutput** errors. This API uses a callback to return the error
| type | string | Yes | Event type. The value is fixed at **'error'**. The callback function returns an error code when an API call fails.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **photoOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the calling of a photographing-related API.|
| callback | ErrorCallback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | ErrorCallback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
**Example**
**Example**
...
@@ -2637,8 +2642,8 @@ Listens for video recording start events. This API uses an asynchronous callback
...
@@ -2637,8 +2642,8 @@ Listens for video recording start events. This API uses an asynchronous callback
| type | string | Yes | Event type. The value is fixed at **'frameStart'**. The callback is invoked when the recording on the first frame of an image starts.|
| type | string | Yes | Event type. The value is fixed at **'frameStart'**. The event can be listened for when a **videoOutput** instance is created. The event is triggered and the corresponding information is returned when the bottom layer starts exposure for the first time.|
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. The recording starts as long as this event is returned. |
**Example**
**Example**
...
@@ -2660,8 +2665,8 @@ Listens for video recording stop events. This API uses an asynchronous callback
...
@@ -2660,8 +2665,8 @@ Listens for video recording stop events. This API uses an asynchronous callback
| type | string | Yes | Event type. The value is fixed at **'frameEnd'**. The callback is invoked when the recording on the last frame of an image stops.|
| type | string | Yes | Event type. The value is fixed at **'frameEnd'**. The event can be listened for when a **videoOutput** instance is created. This event is triggered and returned when the last frame of recording is complete.|
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. The recording ends as long as this event is returned. |
**Example**
**Example**
...
@@ -2681,9 +2686,9 @@ Listens for errors that occur during video recording. This API uses a callback t
...
@@ -2681,9 +2686,9 @@ Listens for errors that occur during video recording. This API uses a callback t
| type | string | Yes | Event type. The value is fixed at **'error'**. The callback function returns the error code corresponding to an error that occurs during the call of a **VideoOutput** API, for example, **start()** or**release()**.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **videoOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the calling of a recording-related API such as **start()** and**release()**.|
| callback | Callback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | Callback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
**Example**
**Example**
...
@@ -2808,9 +2813,9 @@ Listens for metadata objects. This API uses an asynchronous callback to return t
...
@@ -2808,9 +2813,9 @@ Listens for metadata objects. This API uses an asynchronous callback to return t
| type | string | Yes | Event type. The value is fixed at **'metadataObjectsAvailable'**. The callback function returns the valid metadata. This event can be listened for only when a **MetadataOutput** instance is created.|
| type | string | Yes | Event type. The value is fixed at **'metadataObjectsAvailable'**. The event can be listened for when a **metadataOutput** instance is created. This event is triggered and the corresponding metadata is returned when valid metadata is detected.|
| callback | Callback<Array<[MetadataObject](#metadataobject)\>\> | Yes | Callback used to return the metadata.|
| callback | Callback<Array<[MetadataObject](#metadataobject)\>\> | Yes | Callback used to return the metadata.|
**Example**
**Example**
...
@@ -2831,9 +2836,9 @@ Listens for metadata errors. This API uses an asynchronous callback to return th
...
@@ -2831,9 +2836,9 @@ Listens for metadata errors. This API uses an asynchronous callback to return th
| type | string | Yes | Event type. The value is fixed at **'error'**. The callback function returns the error code corresponding to an error that occurs during the call of a **MetadataOutput** instance API, for example, **start()** or**release()**.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **metadataOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the calling of a metadata-related API such as **start()** and**release()**.|
| callback | Callback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | Callback<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
**Example**
**Example**
...
@@ -2852,7 +2857,7 @@ Enumerates the metadata object types.
...
@@ -2852,7 +2857,7 @@ Enumerates the metadata object types.
| FACE_DETECTION | 0 | Face detection. The detection point must be in the coordinate system (0-1), where the upper left corner is {0, 0} and the lower right corner is {1, 1}.<br> The coordinate system is based on the horizontal device direction with the device's charging port on the right.<br> If the layout of a preview screen of an application is based on the vertical direction with the charging port on the lower side,<br> the layout width and height are {w, h} and the return point is {x, y}, then the coordinate point after conversion is {1-y, x}.|