From cb382939d94fb2ce01d5f1476504ccc8cd587b1e Mon Sep 17 00:00:00 2001 From: jango Date: Wed, 5 Mar 2025 10:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5master=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jango --- api/@ohos.multimedia.camera.d.ts | 7093 +++++++++++++++++++++++------- 1 file changed, 5445 insertions(+), 1648 deletions(-) diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 3fa999982e..3560623ddd 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -18,7 +18,7 @@ * @kit CameraKit */ -import { ErrorCallback, AsyncCallback } from './@ohos.base'; +import { ErrorCallback, AsyncCallback, Callback } from './@ohos.base'; import type Context from './application/BaseContext'; import image from './@ohos.multimedia.image'; import type colorSpaceManager from './@ohos.graphics.colorSpaceManager'; @@ -89,6 +89,39 @@ declare namespace camera { CAMERA_STATUS_UNAVAILABLE = 3 } + /** + * Enum for fold status. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + enum FoldStatus { + /** + * Non-foldable status. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + NON_FOLDABLE = 0, + + /** + * Expanded status. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + EXPANDED = 1, + + /** + * Folded status. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + FOLDED = 2 + } + /** * Profile for camera streams. * @@ -150,6 +183,7 @@ declare namespace camera { /** * Video profile. * + * @extends Profile * @typedef VideoProfile * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 @@ -204,6 +238,17 @@ declare namespace camera { */ readonly videoProfiles: Array; + /** + * Depth profiles. + * + * @type { Array } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly depthProfiles: Array; + /** * All the supported metadata Object Types. * @@ -506,6 +551,15 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Determine whether camera mute is supported. + * + * @returns { boolean } Is camera mute supported. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ isCameraMuteSupported(): boolean; /** @@ -515,9 +569,26 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 10 + * @deprecated since 12 + * @useinstead ohos.multimedia.camera.CameraManager#muteCameraPersistent */ muteCamera(mute: boolean): void; + /** + * Mutes or unmutes camera for persistence purpose. + * + * @permission ohos.camera.CAMERA_CONTROL + * @param { boolean } mute - Mute camera if TRUE, otherwise unmute camera. + * @param { PolicyType } type - Type for indicating the calling role. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + muteCameraPersistent(mute: boolean, type: PolicyType): void; + /** * Creates a CameraInput instance by camera. * @@ -591,6 +662,20 @@ declare namespace camera { */ createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput; + /** + * Creates a PreviewOutput instance without profile. + * You can use this method to create a preview output instance without a profile, This instance can + * only be used in a preconfiged session. + * + * @param { string } surfaceId - Surface object id used in camera preview output. + * @returns { PreviewOutput } The PreviewOutput instance. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + createPreviewOutput(surfaceId: string): PreviewOutput; + /** * Creates a PhotoOutput instance. * @@ -620,6 +705,8 @@ declare namespace camera { * Creates a PhotoOutput instance without surfaceId. * Call PhotoOutput capture interface will give a callback, * {@link on(type: 'photoAvailable', callback: AsyncCallback)} + * You can use this method to create a photo output instance without a profile, This instance can + * only be used in a preconfiged session. * * @param { Profile } profile - Photo output profile. * @returns { PhotoOutput } The PhotoOutput instance. @@ -628,7 +715,7 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @since 12 */ - createPhotoOutput(profile: Profile): PhotoOutput; + createPhotoOutput(profile?: Profile): PhotoOutput; /** * Creates a VideoOutput instance. @@ -653,6 +740,20 @@ declare namespace camera { */ createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput; + /** + * Creates a VideoOutput instance without profile. + * You can use this method to create a video output instance without a profile, This instance can + * only be used in a preconfiged session. + * + * @param { string } surfaceId - Surface object id used in camera video output. + * @returns { VideoOutput } The VideoOutput instance. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + createVideoOutput(surfaceId: string): VideoOutput; + /** * Creates a MetadataOutput instance. * @@ -674,6 +775,19 @@ declare namespace camera { */ createMetadataOutput(metadataObjectTypes: Array): MetadataOutput; + /** + * Creates a DepthDataOutput instance. + * + * @param { DepthProfile } profile - Depth data profile. + * @returns { DepthDataOutput } The DepthDataOutput instance. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + createDepthDataOutput(profile: DepthProfile): DepthDataOutput; + /** * Gets a CaptureSession instance. * @@ -691,6 +805,9 @@ declare namespace camera { * * @param { SceneMode } mode - Scene mode. * @returns { T } The specific Session instance by specific scene mode. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; + * 3. Parameter verification failed. * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @since 11 @@ -717,6 +834,26 @@ declare namespace camera { */ off(type: 'cameraStatus', callback?: AsyncCallback): void; + /** + * Subscribes fold status change event callback. + * + * @param { 'foldStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the fold status change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + on(type: 'foldStatusChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from fold status change event callback. + * + * @param { 'foldStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the fold status change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + off(type: 'foldStatusChange', callback?: AsyncCallback): void; + /** * Subscribes camera mute change event callback. * @@ -726,6 +863,16 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Subscribes camera mute change event callback. + * + * @param { 'cameraMute' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the camera mute change. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ on(type: 'cameraMute', callback: AsyncCallback): void; /** @@ -737,6 +884,16 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Unsubscribes from camera mute change event callback. + * + * @param { 'cameraMute' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the camera mute change. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ off(type: 'cameraMute', callback?: AsyncCallback): void; /** @@ -756,7 +913,7 @@ declare namespace camera { * * @param { CameraDevice } camera - Camera device. * @returns { boolean } Whether prelaunch is supported. - * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi @@ -800,6 +957,15 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Enable the camera to prelaunch and start. + * This function is called when the user clicks the system camera icon to start the camera application. + * + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ prelaunch(): void; /** @@ -839,6 +1005,8 @@ declare namespace camera { */ /** * Creates a deferred PreviewOutput instance. + * You can use the method to create deferred preview output without profile, then you must add this output + * to a session which already preconfiged. * * @param { Profile } profile - Preview output profile. * @returns { PreviewOutput } the PreviewOutput instance. @@ -848,7 +1016,7 @@ declare namespace camera { * @systemapi * @since 12 */ - createDeferredPreviewOutput(profile: Profile): PreviewOutput; + createDeferredPreviewOutput(profile?: Profile): PreviewOutput; /** * Check if the device has a torch. @@ -1017,6 +1185,35 @@ declare namespace camera { status: CameraStatus; } + /** + * Fold status info. + * + * @typedef FoldStatusInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + interface FoldStatusInfo { + /** + * Gets supported camera devices under the current fold status. + * + * @type { Array } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + readonly supportedCameras: Array; + + /** + * Current fold status. + * + * @type { FoldStatus } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + readonly foldStatus: FoldStatus; + } + /** * Enum for camera position. * @@ -1090,6 +1287,7 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 12 + * @deprecated since 12 */ CAMERA_POSITION_FOLD_INNER = 3 } @@ -1184,6 +1382,13 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Enum for remote camera device type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 15 + */ enum HostDeviceType { /** * Indicates an unknown device camera. @@ -1192,6 +1397,12 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Indicates an unknown device camera. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 15 + */ UNKNOWN_TYPE = 0, /** @@ -1201,6 +1412,12 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Indicates a smartphone camera. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 15 + */ PHONE = 0x0E, /** @@ -1210,6 +1427,12 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Indicates a tablet camera. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 15 + */ TABLET = 0x11 } @@ -1270,6 +1493,14 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Camera remote camera device name attribute. + * + * @type { string } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 15 + */ readonly hostDeviceName: string; /** @@ -1281,6 +1512,14 @@ declare namespace camera { * @systemapi * @since 10 */ + /** + * Camera remote camera device type attribute. + * + * @type { HostDeviceType } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 15 + */ readonly hostDeviceType: HostDeviceType; /** @@ -1292,6 +1531,17 @@ declare namespace camera { * @since 12 */ readonly cameraOrientation: number; + + /** + * Camera device retractable attribute + * + * @type { boolean } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 18 + */ + readonly isRetractable?: boolean; } /** @@ -1372,6 +1622,7 @@ declare namespace camera { * Open camera. * * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400102 - Operation not allowed. * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. * @throws { BusinessError } 7400201 - Camera service fatal error. @@ -1413,6 +1664,20 @@ declare namespace camera { */ close(): Promise; + /** + * Delay close camera. + * + * @param { number } time - delay time for turning off camera. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 18 + */ + closeDelayed(time: number): Promise; + /** * Subscribes to error events. * @@ -1434,6 +1699,30 @@ declare namespace camera { * @since 10 */ off(type: 'error', camera: CameraDevice, callback?: ErrorCallback): void; + + /** + * Subscribes to camera occlusion detection results. + * + * @param { 'cameraOcclusionDetection' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get detection results. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'cameraOcclusionDetection', callback: AsyncCallback): void; + + /** + * Unsubscribes from camera occlusion detection results. + * + * @param { 'cameraOcclusionDetection' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get detection results. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'cameraOcclusionDetection', callback?: AsyncCallback): void; } /** @@ -1506,95 +1795,193 @@ declare namespace camera { SLOW_MOTION_VIDEO = 7, /** - * High resolution mode. + * Macro photo mode. * * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - HIGH_RESOLUTION_PHOTO = 11, + MACRO_PHOTO = 8, /** - * Secure camera mode. + * Macro video mode. * * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - SECURE_PHOTO = 12 - } + MACRO_VIDEO = 9, - /** - * Enum for camera format type. - * - * @enum { number } - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - enum CameraFormat { /** - * RGBA 8888 Format. + * Light painting photo mode. * * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - CAMERA_FORMAT_RGBA_8888 = 3, + LIGHT_PAINTING_PHOTO = 10, /** - * Digital negative Format. + * High resolution mode. * * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - CAMERA_FORMAT_DNG = 4, + HIGH_RESOLUTION_PHOTO = 11, /** - * YUV 420 Format. + * Secure camera mode. * * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @since 12 */ - CAMERA_FORMAT_YUV_420_SP = 1003, + SECURE_PHOTO = 12, /** - * JPEG Format. + * Quick shot mode. * * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - CAMERA_FORMAT_JPEG = 2000, + QUICK_SHOT_PHOTO = 13, /** - * YCBCR P010 Format. + * Aperture video mode. * * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 12 */ - CAMERA_FORMAT_YCBCR_P010, + APERTURE_VIDEO = 14, /** - * YCRCB P010 Format. + * Panorama photo camera mode. * * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 12 */ - CAMERA_FORMAT_YCRCB_P010 - } + PANORAMA_PHOTO = 15, - /** - * Enum for flash mode. - * - * @enum { number } - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - enum FlashMode { /** - * Close mode. + * Timelapse photo camera mode. * * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ + * @systemapi + * @since 12 + */ + TIME_LAPSE_PHOTO = 16, + + /** + * Fluorescence photo mode. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + FLUORESCENCE_PHOTO = 17 + } + + /** + * Enum for camera format type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + enum CameraFormat { + /** + * RGBA 8888 Format. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + CAMERA_FORMAT_RGBA_8888 = 3, + + /** + * Digital negative Format. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + CAMERA_FORMAT_DNG = 4, + + /** + * YUV 420 Format. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + CAMERA_FORMAT_YUV_420_SP = 1003, + + /** + * JPEG Format. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + CAMERA_FORMAT_JPEG = 2000, + + /** + * YCBCR P010 Format. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + CAMERA_FORMAT_YCBCR_P010, + + /** + * YCRCB P010 Format. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + CAMERA_FORMAT_YCRCB_P010, + + /** + * HEIC Format. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + CAMERA_FORMAT_HEIC = 2003, + + /** + * Depth Data Format: float 16. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + CAMERA_FORMAT_DEPTH_16 = 3000, + + /** + * Depth Data Format: float 32. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + CAMERA_FORMAT_DEPTH_32 = 3001 + } + + /** + * Enum for flash mode. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + enum FlashMode { + /** + * Close mode. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ FLASH_MODE_CLOSE = 0, /** @@ -1635,6 +2022,7 @@ declare namespace camera { * Check whether lcd flash is needed. * * @type { boolean } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 @@ -1645,6 +2033,7 @@ declare namespace camera { * Compensate value for lcd flash. * * @type { number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 @@ -1716,6 +2105,7 @@ declare namespace camera { /** * Flash object. * + * @extends FlashQuery * @interface Flash * @syscap SystemCapability.Multimedia.Camera.Core * @since 11 @@ -1740,6 +2130,18 @@ declare namespace camera { * @since 11 */ setFlashMode(flashMode: FlashMode): void; + + /** + * Enable lcd flash. + * + * @param { boolean } enabled - Target lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enableLcdFlash(enabled: boolean): void; } /** @@ -1887,6 +2289,7 @@ declare namespace camera { /** * AutoExposure object. * + * @extends AutoExposureQuery * @interface AutoExposure * @syscap SystemCapability.Multimedia.Camera.Core * @since 11 @@ -2071,6 +2474,111 @@ declare namespace camera { FOCUS_STATE_UNFOCUSED = 2 } + /** + * Enum for focus range type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + enum FocusRangeType { + /** + * Automatic focus range type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + AUTO = 0, + + /** + * Focus on near objects primarily. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + NEAR = 1 + } + + /** + * Enum for focus driven type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + enum FocusDrivenType { + /** + * Automatic focus driven type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + AUTO = 0, + + /** + * Face focus driven type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + FACE = 1 + } + + /** + * Enum for focus tracking mode. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + enum FocusTrackingMode { + /** + * Automatic focus tracking mode. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + AUTO = 0 + } + + /** + * Focus tracking info. + * + * @typedef FocusTrackingInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + interface FocusTrackingInfo { + /** + * mode of focus tracking. + * + * @type { FocusTrackingMode } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + trackingMode: FocusTrackingMode; + + /** + * region of focus tracking. + * + * @type { Rect } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + trackingRegion: Rect; + } + /** * Focus Query object. * @@ -2111,11 +2619,44 @@ declare namespace camera { * @since 12 */ isFocusAssistSupported(): boolean; + + /** + * Checks whether a specified focus range type is supported. + * + * @param { FocusRangeType } type - Focus range type. + * @returns { boolean } Is the focus range type supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + isFocusRangeTypeSupported(type: FocusRangeType): boolean; + + /** + * Checks whether a specified focus driven type is supported. + * + * @param { FocusDrivenType } type - Focus driven type. + * @returns { boolean } Is the focus driven type supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + isFocusDrivenTypeSupported(type: FocusDrivenType): boolean; } /** * Focus object. * + * @extends FocusQuery * @interface Focus * @syscap SystemCapability.Multimedia.Camera.Core * @since 11 @@ -2195,6 +2736,64 @@ declare namespace camera { * @since 12 */ setFocusAssist(enabled: boolean): void; + + /** + * Gets current focus range type. + * + * @returns { FocusRangeType } The current focus range type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + getFocusRange(): FocusRangeType; + + /** + * Sets focus range type. + * + * @param { FocusRangeType } type - Target focus range type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + setFocusRange(type: FocusRangeType): void; + + /** + * Gets current focus driven type. + * + * @returns { FocusDrivenType } The current focus driven type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + getFocusDriven(): FocusDrivenType; + + /** + * Sets focus driven type. + * + * @param { FocusDrivenType } type - Target focus driven type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + setFocusDriven(type: FocusDrivenType): void; } /** @@ -2293,7 +2892,16 @@ declare namespace camera { * @systemapi * @since 12 */ - MANUAL = 5 + MANUAL = 5, + + /** + * Lock white balance mode. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + LOCKED = 6 } /** @@ -2335,6 +2943,7 @@ declare namespace camera { /** * WhiteBalance object. * + * @extends WhiteBalanceQuery * @interface WhiteBalance * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi @@ -2429,6 +3038,7 @@ declare namespace camera { /** * ManualIso object. * + * @extends ManualIsoQuery * @interface ManualIso * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi @@ -2571,6 +3181,7 @@ declare namespace camera { /** * Zoom object. * + * extends ZoomQuery * @interface Zoom * @syscap SystemCapability.Multimedia.Camera.Core * @since 11 @@ -2700,7 +3311,7 @@ declare namespace camera { * Check whether the specified video stabilization mode is supported. * * @param { VideoStabilizationMode } vsMode - Video Stabilization mode. - * @returns { boolean } Is flash mode supported. + * @returns { boolean } Is video stabilization mode supported. * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @since 11 @@ -2710,7 +3321,7 @@ declare namespace camera { * Move to StabilizationQuery interface from Stabilization since 12. * * @param { VideoStabilizationMode } vsMode - Video Stabilization mode. - * @returns { boolean } Is flash mode supported. + * @returns { boolean } Is video stabilization mode supported. * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core * @since 12 @@ -2721,6 +3332,7 @@ declare namespace camera { /** * Stabilization object. * + * @extends StabilizationQuery * @interface Stabilization * @syscap SystemCapability.Multimedia.Camera.Core * @since 11 @@ -2748,42 +3360,79 @@ declare namespace camera { } /** - * Enumerates the camera beauty effect types. + * Enumerates the camera portrait theme types. * * @enum { number } * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 14 */ - enum BeautyType { + enum PortraitThemeType { /** - * Auto beauty type. + * Natural portrait theme type. * * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 14 */ - AUTO = 0, + NATURAL = 0, /** - * Skin smooth beauty type. + * Delicate portrait theme type. * * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 14 */ - SKIN_SMOOTH = 1, + DELICATE = 1, /** - * Face slender beauty type. + * Stylish portrait theme type. * * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 14 */ - FACE_SLENDER = 2, + STYLISH = 2 + } - /** + /** + * Enumerates the camera beauty effect types. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + enum BeautyType { + /** + * Auto beauty type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + AUTO = 0, + + /** + * Skin smooth beauty type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + SKIN_SMOOTH = 1, + + /** + * Face slender beauty type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + FACE_SLENDER = 2, + + /** * Skin tone beauty type. * * @syscap SystemCapability.Multimedia.Camera.Core @@ -2849,11 +3498,36 @@ declare namespace camera { * @since 12 */ getSupportedBeautyRange(type: BeautyType): Array; + + /** + * Gets supported portrait theme type. + * + * @returns { Array } Lists of portrait theme types + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 14 + */ + getSupportedPortraitThemeTypes(): Array; + + /** + * Checks whether portrait theme is supported. + * + * @returns { boolean } Is portrait theme supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 14 + */ + isPortraitThemeSupported(): boolean; } /** * Beauty object. * + * @extends BeautyQuery * @interface Beauty * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi @@ -2885,6 +3559,95 @@ declare namespace camera { * @since 11 */ setBeauty(type: BeautyType, value: number): void; + + /** + * Sets a portrait theme type for a camera device. + * + * @param { PortraitThemeType } type - The type of portrait theme. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 14 + */ + setPortraitThemeType(type: PortraitThemeType): void; + } + + /** + * EffectSuggestion object. + * + * @typedef EffectSuggestion + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface EffectSuggestion { + + /** + * Checks whether effect suggestion is supported. + * + * @returns { boolean } Is the effect suggestion supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + isEffectSuggestionSupported(): boolean; + + /** + * Enable effect suggestion for session. + * + * @param { boolean } enabled enable effect suggestion for session if TRUE.. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enableEffectSuggestion(enabled: boolean): void; + + /** + * Gets supported effect suggestion types. + * + * @returns { Array } The array of the effect suggestion types. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + getSupportedEffectSuggestionTypes(): Array; + + /** + * Set the range of effect suggestion type and enable status. + * The application should fully set all data when it starts up. + * + * @param { Array } status - The array of the effect suggestion status. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + setEffectSuggestionStatus(status: Array): void; + + /** + * Update the enable status of the effect suggestion type. + * + * @param { EffectSuggestionType } type - The type of effect suggestion. + * @param { boolean } enabled - The status of effect suggestion type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + updateEffectSuggestion(type: EffectSuggestionType, enabled: boolean): void; } /** @@ -2933,7 +3696,26 @@ declare namespace camera { BLACK_WHITE = 3 } + /** + * Enum for policy type + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enum PolicyType { /** + * PRIVACY type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + PRIVACY = 1, + } + + /** * Color Effect Query object. * * @interface ColorEffectQuery @@ -2969,6 +3751,7 @@ declare namespace camera { /** * Color effect object. * + * @extends ColorEffectQuery * @interface ColorEffect * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi @@ -3022,6 +3805,7 @@ declare namespace camera { /** * Color Management object. * + * @extends ColorManagementQuery * @interface ColorManagement * @syscap SystemCapability.Multimedia.Camera.Core * @since 12 @@ -3051,6 +3835,79 @@ declare namespace camera { setColorSpace(colorSpace: colorSpaceManager.ColorSpace): void; } + /** + * Auto Device Switch Query object. + * + * @interface AutoDeviceSwitchQuery + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + interface AutoDeviceSwitchQuery { + /** + * Check whether auto device switch is supported. + * + * @returns { boolean } Is auto device switch supported. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + isAutoDeviceSwitchSupported(): boolean; + } + + /** + * Auto Device Switch object. + * + * @extends AutoDeviceSwitchQuery + * @interface AutoDeviceSwitch + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + interface AutoDeviceSwitch extends AutoDeviceSwitchQuery { + /** + * Enable auto device switch for session. + * + * @param { boolean } enabled - enable auto device switch if TRUE. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; + * 3. Parameters verification failed. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + enableAutoDeviceSwitch(enabled: boolean): void; + } + + /** + * Auto Device Switch Status. + * + * @typedef AutoDeviceSwitchStatus + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + interface AutoDeviceSwitchStatus { + /** + * Notify whether device is switched. + * + * @type { boolean } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + readonly isDeviceSwitched: boolean; + + /** + * Notify whether device capability is changed. + * + * @type { boolean } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + readonly isDeviceCapabilityChanged: boolean; + } + /** * Macro Query object. * @@ -3085,6 +3942,7 @@ declare namespace camera { /** * Macro object. * + * @extends MacroQuery * @interface Macro * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi @@ -3115,6 +3973,25 @@ declare namespace camera { enableMacro(enabled: boolean): void; } + /** + * Enum for usage type used in capture session. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enum UsageType { + /** + * Bokeh usage type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + BOKEH = 0 + } + /** * Session object. * @@ -3365,6 +4242,36 @@ declare namespace camera { * @since 11 */ release(): Promise; + + /** + * Set usage for the capture session. + * + * @param { UsageType } usage - The capture session usage. + * @param { boolean } enabled - Enable usage for session if TRUE. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + setUsage(usage: UsageType, enabled: boolean): void; + + /** + * Get the supported camera output capability set. + * + * @param { CameraDevice } camera - Camera device. + * @returns { Array } The array of the output capability. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + getCameraOutputCapabilities(camera: CameraDevice): Array; } /** @@ -3937,251 +4844,328 @@ declare namespace camera { } /** - * Enum for feature type used in scene detection. + * Types of preconfig, which used to configure session conveniently. + * Preconfig type contains common use cases of camera output. * * @enum { number } * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 12 */ - enum SceneFeatureType { + enum PreconfigType { /** - * Feature for boost moon capture. + * 720P output for preconfig. * * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 12 */ - MOON_CAPTURE_BOOST = 0 - } + PRECONFIG_720P = 0, - /** - * Feature Detection Result. - * - * @typedef SceneFeatureDetectionResult - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - interface SceneFeatureDetectionResult { /** - * Detected feature type. + * 1080P output for preconfig. * - * @type { SceneFeatureType } - * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 12 */ - readonly featureType: SceneFeatureType; + PRECONFIG_1080P = 1, /** - * Check whether feature is detected. + * 4K output for preconfig. * - * @type { boolean } - * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 12 */ - readonly detected: boolean; - } + PRECONFIG_4K = 2, - /** - * Scene detection query. - * - * @interface SceneDetectionQuery - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - interface SceneDetectionQuery { /** - * Check whether specified feature is supported. + * high quality output for preconfig. * - * @param { SceneFeatureType } type - Specified feature type. - * @returns { boolean } - Is specified feature supported. - * @throws { BusinessError } 202 - Not System Application, only throw in session usage. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 12 */ - isSceneFeatureSupported(type: SceneFeatureType): boolean; + PRECONFIG_HIGH_QUALITY = 3 } /** - * Scene detection. + * The aspect ratios of preconfig, which used to configure session conveniently. * - * @interface SceneDetection + * @enum { number } * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 12 */ - interface SceneDetection extends SceneDetectionQuery { + enum PreconfigRatio { /** - * Enable specified feature. + * Aspect ratio 1:1 for preconfig. * - * @param { SceneFeatureType } type - Specified feature type. - * @param { boolean } enabled - Target feature status. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 12 */ - enableSceneFeature(type: SceneFeatureType, enabled: boolean): void; + PRECONFIG_RATIO_1_1 = 0, + + /** + * Aspect ratio 4:3 for preconfig. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + PRECONFIG_RATIO_4_3 = 1, + + /** + * Aspect ratio 16:9 for preconfig. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + PRECONFIG_RATIO_16_9 = 2 } /** - * Photo session object for system hap. + * Enum for feature type used in scene detection. * - * @interface PhotoSessionForSys + * @enum { number } * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ - interface PhotoSessionForSys extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection { - } + enum SceneFeatureType { + /** + * Feature for boost moon capture. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + MOON_CAPTURE_BOOST = 0, - /** - * Photo session object. - * - * @interface PhotoSession - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 - */ - interface PhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement { /** - * Subscribes to error events. + * Feature for tripod detection. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 13 */ - on(type: 'error', callback: ErrorCallback): void; + TRIPOD_DETECTION = 1, /** - * Unsubscribes from error events. + * Feature for low light boost. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 13 */ - off(type: 'error', callback?: ErrorCallback): void; + LOW_LIGHT_BOOST = 2 + } + /** + * Feature Detection Result. + * + * @typedef SceneFeatureDetectionResult + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface SceneFeatureDetectionResult { /** - * Subscribes focus state change event callback. + * Detected feature type. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @type { SceneFeatureType } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 12 */ - on(type: 'focusStateChange', callback: AsyncCallback): void; + readonly featureType: SceneFeatureType; /** - * Unsubscribes from focus state change event callback. + * Check whether feature is detected. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @type { boolean } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 12 */ - off(type: 'focusStateChange', callback?: AsyncCallback): void; + readonly detected: boolean; + } + /** + * Enum for tripod status. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enum TripodStatus { /** - * Subscribes zoom info event callback. + * Invalid tripod status. * - * @param { 'smoothZoomInfoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the zoom info. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 13 */ - on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; + INVALID = 0, /** - * Unsubscribes from zoom info event callback. + * Tripod is active. * - * @param { 'smoothZoomInfoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the zoom info. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 13 */ - off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + ACTIVE = 1, /** - * Subscribes camera macro status event callback. + * Enter tripod stabilization state. * - * @param { 'macroStatusChanged' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - on(type: 'macroStatusChanged', callback: AsyncCallback): void; + ENTERING = 2, /** - * Unsubscribes camera macro status event callback. + * Exit tripod stabilization state. * - * @param { 'macroStatusChanged' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - off(type: 'macroStatusChanged', callback?: AsyncCallback): void; + EXITING = 3, + } + /** + * Tripod detection result. + * + * @extends SceneFeatureDetectionResult + * @interface TripodDetectionResult + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface TripodDetectionResult extends SceneFeatureDetectionResult { /** - * Subscribes to feature detection results. + * tripod status. * - * @param { 'featureDetection' } type - Event type. - * @param { SceneFeatureType } featureType - Feature type. - * @param { AsyncCallback } callback - Callback used to get the detection result. - * @throws { BusinessError } 202 - Not System Application. + * @type { TripodStatus } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly tripodStatus: TripodStatus; + } + + /** + * Scene detection query. + * + * @interface SceneDetectionQuery + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface SceneDetectionQuery { + /** + * Check whether specified feature is supported. + * + * @param { SceneFeatureType } type - Specified feature type. + * @returns { boolean } - Is specified feature supported. + * @throws { BusinessError } 202 - Not System Application, only throw in session usage. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'featureDetection', featureType: SceneFeatureType, callback: AsyncCallback): void; + isSceneFeatureSupported(type: SceneFeatureType): boolean; + } + /** + * Scene detection. + * + * @extends SceneDetectionQuery + * @interface SceneDetection + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface SceneDetection extends SceneDetectionQuery { /** - * Unsubscribes from feature detection result. + * Enable specified feature. * - * @param { 'featureDetection' } type - Event type. - * @param { SceneFeatureType } featureType - Feature type. - * @param { AsyncCallback } callback - Callback used to get the detection result. + * @param { SceneFeatureType } type - Specified feature type. + * @param { boolean } enabled - Target feature status. * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'featureDetection', featureType: SceneFeatureType, callback?: AsyncCallback): void; + enableSceneFeature(type: SceneFeatureType, enabled: boolean): void; } /** - * Video session object for system hap. + * Photo session object for system hap. * - * @interface VideoSessionForSys + * @extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection, EffectSuggestion + * @interface PhotoSessionForSys * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 11 */ - interface VideoSessionForSys extends VideoSession, Beauty, ColorEffect, ColorManagement, Macro { + /** + * Photo session object for system hap. + * + * @extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection, EffectSuggestion, DepthFusion + * @interface PhotoSessionForSys + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 14 + */ + interface PhotoSessionForSys extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection, EffectSuggestion, DepthFusion { } /** - * Video session object. + * Photo session object. * - * @interface VideoSession + * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement + * @interface PhotoSession * @syscap SystemCapability.Multimedia.Camera.Core * @since 11 */ - interface VideoSession extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement { + /** + * Photo session object. + * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement, AutoDeviceSwitch + * @interface PhotoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + interface PhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement, AutoDeviceSwitch { + /** + * Gets whether the choosed preconfig type can be used to configure photo session. + * Must choose preconfig type from {@link PreconfigType}. + * + * @param { PreconfigType } preconfigType - preconfig type. + * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, + * default value {@link PreconfigRatio#PRECONFIG_RATIO_4_3}. + * @returns { boolean } Whether the choosed preconfig type can be used. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + canPreconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): boolean; + + /** + * Configure photo session with the preconfig type. + * Must choose preconfig type from {@link PreconfigType}. + * + * @param { PreconfigType } preconfigType - preconfig type. + * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, + * default value {@link PreconfigRatio#PRECONFIG_RATIO_4_3} + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + preconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): void; + /** * Subscribes to error events. * @@ -4265,361 +5249,220 @@ declare namespace camera { * @since 11 */ off(type: 'macroStatusChanged', callback?: AsyncCallback): void; - } - /** - * Enumerates the camera portrait effects. - * - * @enum { number } - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 10 - */ - enum PortraitEffect { /** - * portrait effect off. + * Subscribes to feature detection results. * + * @param { 'featureDetection' } type - Event type. + * @param { SceneFeatureType } featureType - Feature type. + * @param { AsyncCallback } callback - Callback used to get the detection result. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 12 */ - OFF = 0, + on(type: 'featureDetection', featureType: SceneFeatureType, callback: AsyncCallback): void; /** - * circular blurring for portrait. + * Unsubscribes from feature detection result. * + * @param { 'featureDetection' } type - Event type. + * @param { SceneFeatureType } featureType - Feature type. + * @param { AsyncCallback } callback - Callback used to get the detection result. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 12 */ - CIRCLES = 1, + off(type: 'featureDetection', featureType: SceneFeatureType, callback?: AsyncCallback): void; /** - * heart blurring for portrait. + * Subscribes to effect suggestion event callback. * + * @param { 'effectSuggestionChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ - HEART = 2, + on(type: 'effectSuggestionChange', callback: AsyncCallback): void; /** - * rotated blurring for portrait. + * Unsubscribes from effect suggestion event callback. * + * @param { 'effectSuggestionChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ - ROTATED = 3, + off(type: 'effectSuggestionChange', callback?: AsyncCallback): void; /** - * studio blurring for portrait. + * Subscribes to auto device switch status event callback. * + * @param { 'autoDeviceSwitchStatusChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 + * @since 13 */ - STUDIO = 4, + on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback): void; /** - * theater blurring for portrait. + * Unsubscribes to auto device switch status event callback. * + * @param { 'autoDeviceSwitchStatusChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 + * @since 13 */ - THEATER = 5 - } + off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback): void; - /** - * Portrait Query object. - * - * @interface PortraitQuery - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - interface PortraitQuery { - /** - * Gets supported portrait effect. - * - * @returns { Array } List of portrait effect. - * @throws { BusinessError } 7400103 - Session not config. - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 10 - */ /** - * Gets supported portrait effect. - * Move to Portrait interface from PortraitPhotoSession interface since 11. + * Subscribes to lcd flash status. * - * @returns { Array } List of portrait effect. + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ + on(type: 'lcdFlashStatus', callback: AsyncCallback): void; + /** - * Gets supported portrait effect. - * Move to PortraitQuery interface from Portrait interface since 12. + * Unsubscribes from lcd flash status. * - * @returns { Array } List of portrait effect. + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 13 */ - getSupportedPortraitEffects(): Array; - } + off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; - /** - * Portrait object. - * - * @interface Portrait - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - interface Portrait extends PortraitQuery { - /** - * Gets the portrait effect in use. - * - * @returns { PortraitEffect } The portrait effect in use. - * @throws { BusinessError } 7400103 - Session not config. - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 10 - */ /** - * Gets the portrait effect in use. - * Move to Portrait interface from PortraitPhotoSession interface since 11. + * Gets session functions. * - * @returns { PortraitEffect } The portrait effect in use. + * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. + * @returns { Array } List of session functions. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - getPortraitEffect(): PortraitEffect; + getSessionFunctions(outputCapability: CameraOutputCapability): Array; /** - * Sets a portrait effect for a camera device. - * - * @param { PortraitEffect } effect - Effect Portrait effect to set. - * @throws { BusinessError } 7400103 - Session not config. - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 10 - */ - /** - * Sets a portrait effect for a camera device. - * Move to Portrait interface from PortraitPhotoSession interface since 11. + * Gets session conflict functions. * - * @param { PortraitEffect } effect - Effect Portrait effect to set. + * @returns { Array } List of session conflict functions. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - setPortraitEffect(effect: PortraitEffect): void; + getSessionConflictFunctions(): Array; } /** - * Zoom range. + * Video session object for system hap. * - * @typedef ZoomRange + * @extends VideoSession, Beauty, ColorEffect, ColorManagement, Macro + * @interface VideoSessionForSys * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 11 */ - interface ZoomRange { - /** - * Min zoom value. - * - * @type { number } - * @readonly - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - readonly min: number; - - /** - * Max zoom value. - * - * @type { number } - * @readonly - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - readonly max: number; - } - /** - * Physical Aperture object + * Video session object for system hap. * - * @typedef PhysicalAperture + * @extends VideoSession, Beauty, ColorEffect, ColorManagement, Macro, Aperture, ColorReservation + * @interface VideoSessionForSys * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 15 */ - interface PhysicalAperture { - /** - * Zoom Range of the specific physical aperture. - * - * @type { ZoomRange } - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - zoomRange: ZoomRange; - - /** - * The supported physical apertures. - * - * @type { Array } - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - apertures: Array; + interface VideoSessionForSys extends VideoSession, Beauty, ColorEffect, ColorManagement, Macro, Aperture, ColorReservation { } /** - * Aperture Query object. + * Enum for quality prioritization. * - * @interface ApertureQuery + * @enum { number } * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 + * @since 14 */ - interface ApertureQuery { - /** - * Gets the supported virtual apertures. - * - * @returns { Array } The array of supported virtual apertures. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ + enum QualityPrioritization { /** - * Gets the supported virtual apertures. - * Move to ApertureQuery interface from Aperture since 12. + * High quality priority. * - * @returns { Array } The array of supported virtual apertures. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 + * @since 14 */ - getSupportedVirtualApertures(): Array; + HIGH_QUALITY = 0, /** - * Gets the supported physical apertures. - * - * @returns { Array } The array of supported physical apertures. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - /** - * Gets the supported physical apertures. - * Move to ApertureQuery interface from Aperture since 12. + * Power balance priority. * - * @returns { Array } The array of supported physical apertures. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 + * @since 14 */ - getSupportedPhysicalApertures(): Array; + POWER_BALANCE = 1 } /** - * Aperture object. + * Video session object. * - * @interface Aperture + * @extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement + * @interface VideoSession * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 11 */ - interface Aperture extends ApertureQuery { - /** - * Gets current virtual aperture value. - * - * @returns { number } The current virtual aperture value. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - getVirtualAperture(): number; - - /** - * Sets virtual aperture value. - * - * @param { number } aperture - virtual aperture value - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - setVirtualAperture(aperture: number): void; - + /** + * Video session object. + * + * @interface VideoSession + * @extends AutoDeviceSwitch + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + interface VideoSession extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement, AutoDeviceSwitch { /** - * Gets current physical aperture value. + * Gets whether the choosed preconfig type can be used to configure video session. + * Must choose preconfig type from {@link PreconfigType}. * - * @returns { number } The current physical aperture value. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. + * @param { PreconfigType } preconfigType - preconfig type. + * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, + * default value {@link PreconfigRatio#PRECONFIG_RATIO_16_9}. + * @returns { boolean } Whether the choosed preconfig type can be used. + * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 + * @since 12 */ - getPhysicalAperture(): number; + canPreconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): boolean; /** - * Sets physical aperture value. + * Configure video session with the preconfig type. + * Must choose preconfig type from {@link PreconfigType}. * - * @param { number } aperture - physical aperture value - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. + * @param { PreconfigType } preconfigType - preconfig type. + * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, + * default value {@link PreconfigRatio#PRECONFIG_RATIO_16_9}. + * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 + * @since 12 */ - setPhysicalAperture(aperture: number): void; - } + preconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): void; - /** - * Portrait Photo session object. - * - * @interface PortraitPhotoSession - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - interface PortraitPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, Beauty, ColorEffect, ColorManagement, Portrait, Aperture { /** * Subscribes to error events. * * @param { 'error' } type - Event type. * @param { ErrorCallback } callback - Callback used to get the capture session errors. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 11 */ on(type: 'error', callback: ErrorCallback): void; @@ -4630,7 +5473,6 @@ declare namespace camera { * @param { 'error' } type - Event type. * @param { ErrorCallback } callback - Callback used to get the capture session errors. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 11 */ off(type: 'error', callback?: ErrorCallback): void; @@ -4641,7 +5483,6 @@ declare namespace camera { * @param { 'focusStateChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the focus state change. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 11 */ on(type: 'focusStateChange', callback: AsyncCallback): void; @@ -4652,7 +5493,6 @@ declare namespace camera { * @param { 'focusStateChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the focus state change. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 11 */ off(type: 'focusStateChange', callback?: AsyncCallback): void; @@ -4663,7 +5503,6 @@ declare namespace camera { * @param { 'smoothZoomInfoAvailable' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the zoom info. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 11 */ on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; @@ -4674,482 +5513,499 @@ declare namespace camera { * @param { 'smoothZoomInfoAvailable' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the zoom info. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi * @since 11 */ off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; - } - /** - * ManualExposure Query object. - * - * @interface ManualExposureQuery - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - interface ManualExposureQuery { /** - * Gets the supported manual exposure range. + * Subscribes camera macro status event callback. * - * @returns { Array } The array of manual exposure range. + * @param { 'macroStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 11 */ - /** - * Gets the supported manual exposure range. - * Move to ManualExposureQuery from ManualExposure since 12. + on(type: 'macroStatusChanged', callback: AsyncCallback): void; + + /** + * Unsubscribes camera macro status event callback. * - * @returns { Array } The array of manual exposure range. + * @param { 'macroStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - getSupportedExposureRange(): Array; - } + off(type: 'macroStatusChanged', callback?: AsyncCallback): void; - /** - * ManualExposure object. - * - * @interface ManualExposure - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - interface ManualExposure extends ManualExposureQuery { /** - * Gets current exposure value. + * Subscribes to lcd flash status. * - * @returns { number } The current exposure value. + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ + on(type: 'lcdFlashStatus', callback: AsyncCallback): void; + /** - * Gets current exposure value. + * Unsubscribes from lcd flash status. * - * @returns { number } The current exposure value. + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 13 */ - getExposure(): number; + off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; /** - * Sets Exposure value. + * Subscribes to auto device switch status event callback. * - * @param { number } exposure - Exposure value + * @param { 'autoDeviceSwitchStatusChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback): void; + + /** + * Unsubscribes to auto device switch status event callback. + * + * @param { 'autoDeviceSwitchStatusChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback): void; + + /** + * Subscribes to focus tracking info event callback. + * + * @param { 'focusTrackingInfoAvailable' } type - Event type. + * @param { Callback } callback - Callback used to get the focus tracking info. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 15 */ + on(type: 'focusTrackingInfoAvailable', callback: Callback): void; + /** - * Sets Exposure value. + * Unsubscribes from focus tracking info event callback. * - * @param { number } exposure - Exposure value + * @param { 'focusTrackingInfoAvailable' } type - Event type. + * @param { Callback } callback - Callback used to get the focus tracking info. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400102 - Operation not allowed. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 15 */ - setExposure(exposure: number): void; - } + off(type: 'focusTrackingInfoAvailable', callback?: Callback): void; - /** - * Night photo session object. - * - * @interface NightPhotoSession - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - interface NightPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Beauty, ColorManagement, ManualExposure { /** - * Subscribes to error events. + * Gets session functions. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. + * @returns { Array } List of session functions. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - on(type: 'error', callback: ErrorCallback): void; + getSessionFunctions(outputCapability: CameraOutputCapability): Array; /** - * Unsubscribes from error events. + * Gets session conflict functions. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @returns { Array } List of session conflict functions. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - off(type: 'error', callback?: ErrorCallback): void; + getSessionConflictFunctions(): Array; /** - * Subscribes focus state change event callback. + * Sets quality prioritization. + * Setting to power balance reduces video quality to conserve power, suitable for long-duration recordings where + * video quality is less critical. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @param { QualityPrioritization } quality - Target quality prioritization, with a default of HIGH_QUALITY. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 7400103 - Session not config. The session has not been committed or configured. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 + * @since 14 */ - on(type: 'focusStateChange', callback: AsyncCallback): void; + setQualityPrioritization(quality : QualityPrioritization) : void; + } + /** + * Enumerates the camera portrait effects. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + enum PortraitEffect { /** - * Unsubscribes from focus state change event callback. + * portrait effect off. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 10 */ - off(type: 'focusStateChange', callback?: AsyncCallback): void; + OFF = 0, /** - * Subscribes zoom info event callback. + * circular blurring for portrait. * - * @param { 'smoothZoomInfoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the zoom info. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 10 */ - on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; + CIRCLES = 1, /** - * Unsubscribes from zoom info event callback. + * heart blurring for portrait. * - * @param { 'smoothZoomInfoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the zoom info. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 11 */ - off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + HEART = 2, /** - * Subscribes to lcd flash status. + * rotated blurring for portrait. * - * @param { 'lcdFlashStatus' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the lcd flash status. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - on(type: 'lcdFlashStatus', callback: AsyncCallback): void; + ROTATED = 3, /** - * Unsubscribes from lcd flash status. + * studio blurring for portrait. * - * @param { 'lcdFlashStatus' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the lcd flash status. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; - } + STUDIO = 4, - /** - * ISO info object - * - * @typedef IsoInfo - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - interface IsoInfo { /** - * ISO value. + * theater blurring for portrait. * - * @type { ?number } - * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - readonly iso?: number; + THEATER = 5 } /** - * Exposure info object + * Portrait Query object. * - * @typedef ExposureInfo + * @interface PortraitQuery * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - interface ExposureInfo { + interface PortraitQuery { /** - * Exposure time value. + * Gets supported portrait effect. * - * @type { ?number } - * @readonly + * @returns { Array } List of portrait effect. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 10 */ - readonly exposureTime?: number; - } - - /** - * Aperture info object - * - * @typedef ApertureInfo - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - interface ApertureInfo { /** - * Aperture value. + * Gets supported portrait effect. + * Move to Portrait interface from PortraitPhotoSession interface since 11. * - * @type { ?number } - * @readonly + * @returns { Array } List of portrait effect. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - readonly aperture?: number; - } - - /** - * Lumination info object - * - * @typedef LuminationInfo - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - interface LuminationInfo { /** - * Lumination value. + * Gets supported portrait effect. + * Move to PortraitQuery interface from Portrait interface since 12. * - * @type { ?number } - * @readonly + * @returns { Array } List of portrait effect. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - readonly lumination?: number; + getSupportedPortraitEffects(): Array; } /** - * Professional photo session object. + * Portrait object. * - * @interface ProfessionalPhotoSession + * @extends PortraitQuery + * @interface Portrait * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - interface ProfessionalPhotoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { + interface Portrait extends PortraitQuery { /** - * Subscribes to error events. + * Gets the portrait effect in use. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. - * @throws { BusinessError } 202 - Not System Application. + * @returns { PortraitEffect } The portrait effect in use. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 10 */ - on(type: 'error', callback: ErrorCallback): void; - /** - * Unsubscribes from error events. + * Gets the portrait effect in use. + * Move to Portrait interface from PortraitPhotoSession interface since 11. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @returns { PortraitEffect } The portrait effect in use. * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - off(type: 'error', callback?: ErrorCallback): void; + getPortraitEffect(): PortraitEffect; /** - * Subscribes focus state change event callback. + * Sets a portrait effect for a camera device. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. - * @throws { BusinessError } 202 - Not System Application. + * @param { PortraitEffect } effect - Effect Portrait effect to set. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 10 */ - on(type: 'focusStateChange', callback: AsyncCallback): void; - /** - * Unsubscribes from focus state change event callback. + * Sets a portrait effect for a camera device. + * Move to Portrait interface from PortraitPhotoSession interface since 11. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @param { PortraitEffect } effect - Effect Portrait effect to set. * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - off(type: 'focusStateChange', callback?: AsyncCallback): void; + setPortraitEffect(effect: PortraitEffect): void; + } + /** + * Zoom range. + * + * @typedef ZoomRange + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + interface ZoomRange { /** - * Subscribes zoom info event callback. + * Min zoom value. * - * @param { 'smoothZoomInfoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the zoom info. - * @throws { BusinessError } 202 - Not System Application. + * @type { number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; + readonly min: number; /** - * Unsubscribes from zoom info event callback. + * Max zoom value. * - * @param { 'smoothZoomInfoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the zoom info. - * @throws { BusinessError } 202 - Not System Application. + * @type { number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + readonly max: number; + } + /** + * Physical Aperture object + * + * @typedef PhysicalAperture + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + interface PhysicalAperture { /** - * Subscribes ISO info event callback. + * Zoom Range of the specific physical aperture. * - * @param { 'isoInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the ISO info. - * @throws { BusinessError } 202 - Not System Application. + * @type { ZoomRange } * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - on(type: 'isoInfo', callback: AsyncCallback): void; + zoomRange: ZoomRange; /** - * Unsubscribes from ISO info event callback. + * The supported physical apertures. * - * @param { 'isoInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the ISO info. - * @throws { BusinessError } 202 - Not System Application. + * @type { Array } * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - off(type: 'isoInfo', callback?: AsyncCallback): void; + apertures: Array; + } + /** + * Aperture Query object. + * + * @interface ApertureQuery + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface ApertureQuery { /** - * Subscribes exposure info event callback. + * Gets the supported virtual apertures. * - * @param { 'exposureInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @returns { Array } The array of supported virtual apertures. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + /** + * Gets the supported virtual apertures. + * Move to ApertureQuery interface from Aperture since 12. + * + * @returns { Array } The array of supported virtual apertures. * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'exposureInfo', callback: AsyncCallback): void; + getSupportedVirtualApertures(): Array; /** - * Unsubscribes from exposure info event callback. + * Gets the supported physical apertures. * - * @param { 'exposureInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @returns { Array } The array of supported physical apertures. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + /** + * Gets the supported physical apertures. + * Move to ApertureQuery interface from Aperture since 12. + * + * @returns { Array } The array of supported physical apertures. * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'exposureInfo', callback?: AsyncCallback): void; + getSupportedPhysicalApertures(): Array; + } + /** + * Aperture object. + * + * @extends ApertureQuery + * @interface Aperture + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + interface Aperture extends ApertureQuery { /** - * Subscribes aperture info event callback. + * Gets current virtual aperture value. * - * @param { 'apertureInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the aperture info. + * @returns { number } The current virtual aperture value. * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - on(type: 'apertureInfo', callback: AsyncCallback): void; + getVirtualAperture(): number; /** - * Unsubscribes from aperture info event callback. + * Sets virtual aperture value. * - * @param { 'apertureInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the aperture info. + * @param { number } aperture - virtual aperture value * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - off(type: 'apertureInfo', callback?: AsyncCallback): void; + setVirtualAperture(aperture: number): void; /** - * Subscribes lumination info event callback. + * Gets current physical aperture value. * - * @param { 'luminationInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @returns { number } The current physical aperture value. * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - on(type: 'luminationInfo', callback: AsyncCallback): void; + getPhysicalAperture(): number; /** - * Unsubscribes from lumination info event callback. + * Sets physical aperture value. * - * @param { 'luminationInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @param { number } aperture - physical aperture value * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - off(type: 'luminationInfo', callback?: AsyncCallback): void; + setPhysicalAperture(aperture: number): void; } /** - * Professional video session object. - * - * @interface ProfessionalVideoSession - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - interface ProfessionalVideoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { + * Portrait Photo session object. + * + * @extends Session, Flash, AutoExposure, Focus, Zoom, Beauty, ColorEffect, ColorManagement, Portrait, Aperture + * @interface PortraitPhotoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + interface PortraitPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, Beauty, ColorEffect, ColorManagement, Portrait, Aperture { /** * Subscribes to error events. * * @param { 'error' } type - Event type. * @param { ErrorCallback } callback - Callback used to get the capture session errors. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ on(type: 'error', callback: ErrorCallback): void; @@ -5158,10 +6014,9 @@ declare namespace camera { * * @param { 'error' } type - Event type. * @param { ErrorCallback } callback - Callback used to get the capture session errors. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ off(type: 'error', callback?: ErrorCallback): void; @@ -5170,10 +6025,9 @@ declare namespace camera { * * @param { 'focusStateChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the focus state change. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ on(type: 'focusStateChange', callback: AsyncCallback): void; @@ -5182,10 +6036,9 @@ declare namespace camera { * * @param { 'focusStateChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the focus state change. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ off(type: 'focusStateChange', callback?: AsyncCallback): void; @@ -5194,10 +6047,9 @@ declare namespace camera { * * @param { 'smoothZoomInfoAvailable' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the zoom info. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; @@ -5206,183 +6058,253 @@ declare namespace camera { * * @param { 'smoothZoomInfoAvailable' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the zoom info. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; /** - * Subscribes ISO info event callback. + * Subscribes to lcd flash status. * - * @param { 'isoInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the ISO info. + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 13 */ - on(type: 'isoInfo', callback: AsyncCallback): void; + on(type: 'lcdFlashStatus', callback: AsyncCallback): void; /** - * Unsubscribes from ISO info event callback. + * Unsubscribes from lcd flash status. * - * @param { 'isoInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the ISO info. + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 13 */ - off(type: 'isoInfo', callback?: AsyncCallback): void; + off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; /** - * Subscribes exposure info event callback. + * Gets session functions. * - * @param { 'exposureInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. + * @returns { Array } List of session functions. * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 13 */ - on(type: 'exposureInfo', callback: AsyncCallback): void; + getSessionFunctions(outputCapability: CameraOutputCapability): Array; /** - * Unsubscribes from exposure info event callback. + * Gets session conflict functions. * - * @param { 'exposureInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @returns { Array } List of session conflict functions. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 13 */ - off(type: 'exposureInfo', callback?: AsyncCallback): void; + getSessionConflictFunctions(): Array; + } - /** - * Subscribes aperture info event callback. + /** + * Aperture video session object. * - * @param { 'apertureInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the aperture info. - * @throws { BusinessError } 202 - Not System Application. + * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Aperture + * @interface ApertureVideoSession * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'apertureInfo', callback: AsyncCallback): void; - + interface ApertureVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Aperture { /** - * Unsubscribes from aperture info event callback. + * Subscribes to error events. * - * @param { 'apertureInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the aperture info. + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'apertureInfo', callback?: AsyncCallback): void; + on(type: 'error', callback: ErrorCallback): void; /** - * Subscribes lumination info event callback. + * Unsubscribes from error events. * - * @param { 'luminationInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'luminationInfo', callback: AsyncCallback): void; + off(type: 'error', callback?: ErrorCallback): void; /** - * Unsubscribes from lumination info event callback. + * Subscribes focus state change event callback. * - * @param { 'luminationInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'luminationInfo', callback?: AsyncCallback): void; - } + on(type: 'focusStateChange', callback: AsyncCallback): void; - /** - * Enum for slow motion status. - * - * @enum { number } - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - enum SlowMotionStatus { /** - * Slow motion disabled. + * Unsubscribes from focus state change event callback. * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - DISABLED = 0, + off(type: 'focusStateChange', callback?: AsyncCallback): void; /** - * Slow motion ready. + * Subscribes zoom info event callback. * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - READY = 1, + on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; /** - * Slow motion video start. + * Unsubscribes from zoom info event callback. * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - VIDEO_START = 2, + off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + } + /** + * ManualExposure Query object. + * + * @interface ManualExposureQuery + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface ManualExposureQuery { /** - * Slow motion video done. + * Gets the supported manual exposure range. + * + * @returns { Array } The array of manual exposure range. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + /** + * Gets the supported manual exposure range. + * Move to ManualExposureQuery from ManualExposure since 12. * + * @returns { Array } The array of manual exposure range. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - VIDEO_DONE = 3, + getSupportedExposureRange(): Array; + } + /** + * ManualExposure object. + * + * @extends ManualExposureQuery + * @interface ManualExposure + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + interface ManualExposure extends ManualExposureQuery { /** - * Slow motion finished. + * Gets current exposure value. + * + * @returns { number } The current exposure value. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + /** + * Gets current exposure value. * + * @returns { number } The current exposure value. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - FINISHED = 4 + getExposure(): number; + + /** + * Sets Exposure value. + * + * @param { number } exposure - Exposure value + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + /** + * Sets Exposure value. + * + * @param { number } exposure - Exposure value + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + setExposure(exposure: number): void; } /** - * Slow motion video session object. + * Night photo session object. * - * @interface SlowMotionVideoSession + * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Beauty, ColorManagement, ManualExposure + * @interface NightPhotoSession * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ - interface SlowMotionVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect { + interface NightPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Beauty, ColorManagement, ManualExposure { /** * Subscribes to error events. * * @param { 'error' } type - Event type. * @param { ErrorCallback } callback - Callback used to get the capture session errors. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ on(type: 'error', callback: ErrorCallback): void; @@ -5391,10 +6313,9 @@ declare namespace camera { * * @param { 'error' } type - Event type. * @param { ErrorCallback } callback - Callback used to get the capture session errors. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ off(type: 'error', callback?: ErrorCallback): void; @@ -5403,10 +6324,9 @@ declare namespace camera { * * @param { 'focusStateChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the focus state change. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ on(type: 'focusStateChange', callback: AsyncCallback): void; @@ -5415,10 +6335,9 @@ declare namespace camera { * * @param { 'focusStateChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the focus state change. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ off(type: 'focusStateChange', callback?: AsyncCallback): void; @@ -5427,10 +6346,9 @@ declare namespace camera { * * @param { 'smoothZoomInfoAvailable' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the zoom info. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; @@ -5439,130 +6357,130 @@ declare namespace camera { * * @param { 'smoothZoomInfoAvailable' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the zoom info. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 11 */ off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; /** - * Determine whether camera slow motion detection is supported. - * - * @returns { boolean } Is camera slow motion detection supported. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - isSlowMotionDetectionSupported(): boolean; - - /** - * Set slow motion detection area. - * - * @param { Rect } area - Detection area. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400103 - Session not config. - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - setSlowMotionDetectionArea(area: Rect): void; - - /** - * Subscribes slow motion status callback. + * Subscribes to lcd flash status. * - * @param { 'slowMotionStatus' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the slow motion status. + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'slowMotionStatus', callback: AsyncCallback): void; + on(type: 'lcdFlashStatus', callback: AsyncCallback): void; /** - * Unsubscribes slow motion status callback. + * Unsubscribes from lcd flash status. * - * @param { 'slowMotionStatus' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the slow motion status. + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'slowMotionStatus', callback?: AsyncCallback): void; + off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; } /** - * High resolution session object. + * ISO info object * - * @interface HighResolutionPhotoSession + * @typedef IsoInfo * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - interface HighResolutionPhotoSession extends Session, AutoExposure, Focus { + interface IsoInfo { /** - * Subscribes to error events. + * ISO value. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. - * @throws { BusinessError } 202 - Not System Application. + * @type { ?number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'error', callback: ErrorCallback): void; + readonly iso?: number; + } + /** + * Exposure info object + * + * @typedef ExposureInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface ExposureInfo { /** - * Unsubscribes from error events. + * Exposure time value. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. - * @throws { BusinessError } 202 - Not System Application. + * @type { ?number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'error', callback?: ErrorCallback): void; + readonly exposureTime?: number; + } + /** + * Aperture info object + * + * @typedef ApertureInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface ApertureInfo { /** - * Subscribes focus state change event callback. + * Aperture value. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. - * @throws { BusinessError } 202 - Not System Application. + * @type { ?number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'focusStateChange', callback: AsyncCallback): void; + readonly aperture?: number; + } + /** + * Lumination info object + * + * @typedef LuminationInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface LuminationInfo { /** - * Unsubscribes from focus state change event callback. + * Lumination value. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. - * @throws { BusinessError } 202 - Not System Application. + * @type { ?number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'focusStateChange', callback?: AsyncCallback): void; + readonly lumination?: number; } /** - * Macro photo session object. + * Professional photo session object. * - * @interface MacroPhotoSession + * @interface ProfessionalPhotoSession * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - interface MacroPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus { + interface ProfessionalPhotoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { /** * Subscribes to error events. * @@ -5634,116 +6552,122 @@ declare namespace camera { * @since 12 */ off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; - } - /** - * Macro video session object. - * - * @interface MacroVideoSession - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 12 - */ - interface MacroVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus { /** - * Subscribes to error events. + * Subscribes ISO info event callback. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the ISO info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'error', callback: ErrorCallback): void; + on(type: 'isoInfoChange', callback: AsyncCallback): void; /** - * Unsubscribes from error events. + * Unsubscribes from ISO info event callback. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the ISO info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'error', callback?: ErrorCallback): void; + off(type: 'isoInfoChange', callback?: AsyncCallback): void; /** - * Subscribes focus state change event callback. + * Subscribes exposure info event callback. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the exposure info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'focusStateChange', callback: AsyncCallback): void; + on(type: 'exposureInfoChange', callback: AsyncCallback): void; /** - * Unsubscribes from focus state change event callback. + * Unsubscribes from exposure info event callback. * - * @param { 'focusStateChange' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the exposure info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'focusStateChange', callback?: AsyncCallback): void; + off(type: 'exposureInfoChange', callback?: AsyncCallback): void; /** - * Subscribes zoom info event callback. + * Subscribes aperture info event callback. * - * @param { 'smoothZoomInfoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @param { 'apertureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the aperture info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; + on(type: 'apertureInfoChange', callback: AsyncCallback): void; /** - * Unsubscribes from zoom info event callback. + * Unsubscribes from aperture info event callback. * - * @param { 'smoothZoomInfoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @param { 'apertureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the aperture info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; - } + off(type: 'apertureInfoChange', callback?: AsyncCallback): void; - /** - * Secure camera session object. - * - * @interface SecureSession - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 12 - */ - interface SecureSession extends Session, Flash, AutoExposure, Focus, Zoom { /** - * Add Secure output for camera. + * Subscribes lumination info event callback. * - * @param { PreviewOutput } previewOutput - Specify the output as a secure flow. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400102 - Operation not allowed. - * @throws { BusinessError } 7400103 - Session not config. + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - addSecureOutput(previewOutput: PreviewOutput): void; + on(type: 'luminationInfoChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from lumination info event callback. + * + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'luminationInfoChange', callback?: AsyncCallback): void; + } + /** + * Professional video session object. + * + * @extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture + * @interface ProfessionalVideoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface ProfessionalVideoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { /** * Subscribes to error events. * * @param { 'error' } type - Event type. * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ on(type: 'error', callback: ErrorCallback): void; @@ -5753,953 +6677,3732 @@ declare namespace camera { * * @param { 'error' } type - Event type. * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ off(type: 'error', callback?: ErrorCallback): void; /** - * Subscribes focus status change event callback. + * Subscribes focus state change event callback. * * @param { 'focusStateChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ on(type: 'focusStateChange', callback: AsyncCallback): void; /** - * Unsubscribes from focus status change event callback. + * Unsubscribes from focus state change event callback. * * @param { 'focusStateChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ off(type: 'focusStateChange', callback?: AsyncCallback): void; - } - /** - * Camera output object. - * - * @interface CameraOutput - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - interface CameraOutput { /** - * Release output instance. + * Subscribes zoom info event callback. * - * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - release(callback: AsyncCallback): void; + on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; /** - * Release output instance. + * Unsubscribes from zoom info event callback. * - * @returns { Promise } Promise used to return the result. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - release(): Promise; - } + off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; - /** - * SketchStatusData object - * - * @typedef SketchStatusData - * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 - */ - interface SketchStatusData { /** - * Status of the sketch stream. - * 0 is stop, and 1 is start. + * Subscribes ISO info event callback. * - * @type { number } + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the ISO info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ - status: number; + on(type: 'isoInfoChange', callback: AsyncCallback): void; /** - * The zoom ratio of the sketch stream. + * Unsubscribes from ISO info event callback. * - * @type { number } + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the ISO info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ - sketchRatio: number; - } + off(type: 'isoInfoChange', callback?: AsyncCallback): void; - /** - * Preview output object. - * - * @interface PreviewOutput - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - interface PreviewOutput extends CameraOutput { /** - * Start output instance. + * Subscribes exposure info event callback. * - * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 7400103 - Session not config. + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - * @deprecated since 11 - * @useinstead ohos.multimedia.camera.Session#start + * @systemapi + * @since 12 */ - start(callback: AsyncCallback): void; + on(type: 'exposureInfoChange', callback: AsyncCallback): void; /** - * Start output instance. + * Unsubscribes from exposure info event callback. * - * @returns { Promise } Promise used to return the result. - * @throws { BusinessError } 7400103 - Session not config. + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - * @deprecated since 11 - * @useinstead ohos.multimedia.camera.Session#start + * @systemapi + * @since 12 */ - start(): Promise; + off(type: 'exposureInfoChange', callback?: AsyncCallback): void; /** - * Stop output instance. + * Subscribes aperture info event callback. * - * @param { AsyncCallback } callback - Callback used to return the result. + * @param { 'apertureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the aperture info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - * @deprecated since 11 - * @useinstead ohos.multimedia.camera.Session#stop + * @systemapi + * @since 12 */ - stop(callback: AsyncCallback): void; + on(type: 'apertureInfoChange', callback: AsyncCallback): void; /** - * Stop output instance. + * Unsubscribes from aperture info event callback. * - * @returns { Promise } Promise used to return the result. + * @param { 'apertureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the aperture info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - * @deprecated since 11 - * @useinstead ohos.multimedia.camera.Session#stop + * @systemapi + * @since 12 */ - stop(): Promise; + off(type: 'apertureInfoChange', callback?: AsyncCallback): void; /** - * Subscribes frame start event callback. + * Subscribes lumination info event callback. * - * @param { 'frameStart' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - on(type: 'frameStart', callback: AsyncCallback): void; + on(type: 'luminationInfoChange', callback: AsyncCallback): void; /** - * Unsubscribes from frame start event callback. + * Unsubscribes from lumination info event callback. * - * @param { 'frameStart' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - off(type: 'frameStart', callback?: AsyncCallback): void; + off(type: 'luminationInfoChange', callback?: AsyncCallback): void; + } + /** + * Enum for slow motion status. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enum SlowMotionStatus { /** - * Subscribes frame end event callback. + * Slow motion disabled. * - * @param { 'frameEnd' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - on(type: 'frameEnd', callback: AsyncCallback): void; + DISABLED = 0, /** - * Unsubscribes from frame end event callback. + * Slow motion ready. * - * @param { 'frameEnd' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - off(type: 'frameEnd', callback?: AsyncCallback): void; + READY = 1, /** - * Subscribes to error events. + * Slow motion video start. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the preview output errors. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - on(type: 'error', callback: ErrorCallback): void; + VIDEO_START = 2, /** - * Unsubscribes from error events. + * Slow motion video done. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the preview output errors. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - off(type: 'error', callback?: ErrorCallback): void; - - /** - * Get supported frame rates which can be set during session running. - * - * @returns { Array } The array of supported frame rate range. - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 12 - */ - getSupportedFrameRates(): Array + VIDEO_DONE = 3, /** - * Set a frame rate range. + * Slow motion finished. * - * @param { number } minFps - Minimum frame rate per second. - * @param { number } maxFps - Maximum frame rate per second. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - setFrameRate(minFps: number, maxFps: number): void + FINISHED = 4 + } + /** + * Slow motion video session object. + * + * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect + * @interface SlowMotionVideoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface SlowMotionVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect { /** - * Get active frame rate range which has been set before. + * Subscribes to error events. * - * @returns { FrameRateRange } The active frame rate range. + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - getActiveFrameRate(): FrameRateRange; + on(type: 'error', callback: ErrorCallback): void; /** - * Adds a deferred surface. + * Unsubscribes from error events. * - * @param { string } surfaceId - Surface object id used in camera photo output. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 12 */ - addDeferredSurface(surfaceId: string): void; + off(type: 'error', callback?: ErrorCallback): void; /** - * Determine whether camera sketch is supported. + * Subscribes focus state change event callback. * - * @returns { boolean } Is camera sketch supported. + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ - isSketchSupported(): boolean; + on(type: 'focusStateChange', callback: AsyncCallback): void; /** - * Gets the specific zoom ratio when sketch stream open. + * Unsubscribes from focus state change event callback. * - * @returns { number } The specific zoom ratio of sketch. + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ - getSketchRatio(): number; + off(type: 'focusStateChange', callback?: AsyncCallback): void; /** - * Enable sketch for camera. + * Subscribes zoom info event callback. * - * @param { boolean } enabled - enable sketch for camera if TRUE. + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ + on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; + /** - * Enable sketch for camera. + * Unsubscribes from zoom info event callback. * - * @param { boolean } enabled - enable sketch for camera if TRUE. + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400102 - Operation not allowed. - * @throws { BusinessError } 7400103 - Session not config. - * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - enableSketch(enabled: boolean): void; + off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; /** - * Attach surface to the sketch stream. + * Determine whether camera slow motion detection is supported. * - * @param { string } surfaceId - Surface object id used in sketch stream. + * @returns { boolean } Is camera slow motion detection supported. * @throws { BusinessError } 202 - Not System Application. * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ + isSlowMotionDetectionSupported(): boolean; + /** - * Attach surface to the sketch stream. + * Set slow motion detection area. * - * @param { string } surfaceId - Surface object id used in sketch stream. + * @param { Rect } area - Detection area. * @throws { BusinessError } 202 - Not System Application. * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. * @throws { BusinessError } 7400103 - Session not config. - * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - attachSketchSurface(surfaceId: string): void; + setSlowMotionDetectionArea(area: Rect): void; /** - * Subscribes sketch status changed event callback. + * Subscribes slow motion status callback. * - * @param { 'sketchStatusChanged' } type - Event type. - * @param { AsyncCallback } callback - Callback used to sketch status data. + * @param { 'slowMotionStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the slow motion status. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ - on(type: 'sketchStatusChanged', callback: AsyncCallback): void; + on(type: 'slowMotionStatus', callback: AsyncCallback): void; /** - * Unsubscribes sketch status changed event callback. + * Unsubscribes slow motion status callback. * - * @param { 'sketchStatusChanged' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get sketch status data. + * @param { 'slowMotionStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the slow motion status. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 12 */ - off(type: 'sketchStatusChanged', callback?: AsyncCallback): void; + off(type: 'slowMotionStatus', callback?: AsyncCallback): void; } /** - * Enumerates the image rotation angles. + * High resolution session object. * - * @enum { number } + * @extends Session, AutoExposure, Focus + * @interface HighResolutionPhotoSession * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - enum ImageRotation { + interface HighResolutionPhotoSession extends Session, AutoExposure, Focus { /** - * The capture image rotates 0 degrees. + * Subscribes to error events. * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - ROTATION_0 = 0, + on(type: 'error', callback: ErrorCallback): void; /** - * The capture image rotates 90 degrees. + * Unsubscribes from error events. * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - ROTATION_90 = 90, + off(type: 'error', callback?: ErrorCallback): void; /** - * The capture image rotates 180 degrees. + * Subscribes focus state change event callback. * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - ROTATION_180 = 180, + on(type: 'focusStateChange', callback: AsyncCallback): void; /** - * The capture image rotates 270 degrees. + * Unsubscribes from focus state change event callback. * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - ROTATION_270 = 270 + off(type: 'focusStateChange', callback?: AsyncCallback): void; } /** - * Photo capture location + * Macro photo session object. * - * @typedef Location + * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus + * @interface MacroPhotoSession * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - interface Location { + /** + * Macro photo session object. + * + * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, DepthFusion + * @interface MacroPhotoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 14 + */ + interface MacroPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, DepthFusion { /** - * Latitude. + * Subscribes to error events. * - * @type { number } + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - latitude: number; + on(type: 'error', callback: ErrorCallback): void; /** - * Longitude. + * Unsubscribes from error events. * - * @type { number } + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - longitude: number; + off(type: 'error', callback?: ErrorCallback): void; /** - * Altitude. + * Subscribes focus state change event callback. * - * @type { number } + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - altitude: number; - } + on(type: 'focusStateChange', callback: AsyncCallback): void; - /** - * Enumerates the image quality levels. - * - * @enum { number } - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - enum QualityLevel { /** - * High image quality. + * Unsubscribes from focus state change event callback. * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - QUALITY_LEVEL_HIGH = 0, + off(type: 'focusStateChange', callback?: AsyncCallback): void; /** - * Medium image quality. + * Subscribes zoom info event callback. * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - QUALITY_LEVEL_MEDIUM = 1, + on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; /** - * Low image quality. + * Unsubscribes from zoom info event callback. * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ + * @systemapi + * @since 12 + */ + off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + } + + /** + * Macro video session object. + * + * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus + * @interface MacroVideoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface MacroVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus { + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Subscribes focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'focusStateChange', callback?: AsyncCallback): void; + + /** + * Subscribes zoom info event callback. + * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; + + /** + * Unsubscribes from zoom info event callback. + * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + } + + /** + * Secure camera session object. + * + * @extends Session, Flash, AutoExposure, Focus, Zoom + * @interface SecureSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + interface SecureSession extends Session, Flash, AutoExposure, Focus, Zoom { + /** + * Add Secure output for camera. + * + * @param { PreviewOutput } previewOutput - Specify the output as a secure flow. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + addSecureOutput(previewOutput: PreviewOutput): void; + + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Subscribes focus status change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from focus status change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + off(type: 'focusStateChange', callback?: AsyncCallback): void; + } + + /** + * Light painting photo session object. + * + * @extends Session, Flash, Focus, Zoom, ColorEffect + * @interface LightPaintingPhotoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface LightPaintingPhotoSession extends Session, Flash, Focus, Zoom, ColorEffect { + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Subscribes focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'focusStateChange', callback?: AsyncCallback): void; + + /** + * Subscribes zoom info event callback. + * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; + + /** + * Unsubscribes from zoom info event callback. + * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + + /** + * Gets the light painting type in use. + * + * @returns { LightPaintingType } The light painting type in use. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + getLightPaintingType(): LightPaintingType; + + /** + * Sets a light painting type for a camera device. + * + * @param { LightPaintingType } type - Light painting type to set. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + setLightPaintingType(type: LightPaintingType): void; + + /** + * Gets supported light painting types. + * + * @returns { Array } List of light painting types. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + getSupportedLightPaintingTypes(): Array; + } + + /** + * Quick shot photo session object. + * + * @extends Session, AutoExposure, ColorEffect, ColorManagement, EffectSuggestion, Flash, Focus, Zoom + * @interface QuickShotPhotoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface QuickShotPhotoSession extends Session, AutoExposure, ColorEffect, ColorManagement, EffectSuggestion, Flash, Focus, Zoom { + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Subscribes to effect suggestion event callback. + * + * @param { 'effectSuggestionChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'effectSuggestionChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from effect suggestion event callback. + * + * @param { 'effectSuggestionChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'effectSuggestionChange', callback?: AsyncCallback): void; + + /** + * Subscribes focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'focusStateChange', callback?: AsyncCallback): void; + + /** + * Subscribes zoom info event callback. + * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; + + /** + * Unsubscribes from zoom info event callback. + * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + } + + /** + * Panorama photo session object. + * + * @extends Session, Focus, AutoExposure, WhiteBalance, ColorEffect + * @interface PanoramaPhotoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface PanoramaPhotoSession extends Session, Focus, AutoExposure, WhiteBalance, ColorEffect { + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Subscribes focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'focusStateChange', callback?: AsyncCallback): void; + } + + /** + * Fluorescence photo session object. + * + * @extends Session, AutoExposure, Focus, Zoom + * @interface FluorescencePhotoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface FluorescencePhotoSession extends Session, AutoExposure, Focus, Zoom { + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Subscribes focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + off(type: 'focusStateChange', callback?: AsyncCallback): void; + } + + /** + * Photo Functions object. + * + * @extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery + * @interface PhotoFunctions + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface PhotoFunctions extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery { + } + + /** + * Video Functions object. + * + * @extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, StabilizationQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery + * @interface VideoFunctions + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface VideoFunctions extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, StabilizationQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery { + } + + /** + * Portrait Photo Functions object. + * + * @extends FlashQuery, AutoExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, PortraitQuery, ApertureQuery, SceneDetectionQuery + * @interface PortraitPhotoFunctions + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface PortraitPhotoFunctions extends FlashQuery, AutoExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, PortraitQuery, ApertureQuery, SceneDetectionQuery { + } + + /** + * Photo Conflict Functions object. + * + * @extends ZoomQuery, MacroQuery + * @interface PhotoConflictFunctions + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface PhotoConflictFunctions extends ZoomQuery, MacroQuery { + } + + /** + * Video Conflict Functions object. + * + * @extends ZoomQuery, MacroQuery + * @interface VideoConflictFunctions + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface VideoConflictFunctions extends ZoomQuery, MacroQuery { + } + + /** + * Portrait Photo Conflict Functions object. + * + * @interface PortraitPhotoFunctions + * @extends ZoomQuery, PortraitQuery, ApertureQuery + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface PortraitPhotoConflictFunctions extends ZoomQuery, PortraitQuery, ApertureQuery { + } + + /** + * Camera output object. + * + * @interface CameraOutput + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + interface CameraOutput { + /** + * Release output instance. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + release(callback: AsyncCallback): void; + + /** + * Release output instance. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + release(): Promise; + } + + /** + * SketchStatusData object + * + * @typedef SketchStatusData + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + interface SketchStatusData { + /** + * Status of the sketch stream. + * 0 is stop, and 1 is start. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + status: number; + + /** + * The zoom ratio of the sketch stream. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + sketchRatio: number; + } + + /** + * Preview output object. + * + * @extends CameraOutput + * @interface PreviewOutput + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + interface PreviewOutput extends CameraOutput { + /** + * Start output instance. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + * @deprecated since 11 + * @useinstead ohos.multimedia.camera.Session#start + */ + start(callback: AsyncCallback): void; + + /** + * Start output instance. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + * @deprecated since 11 + * @useinstead ohos.multimedia.camera.Session#start + */ + start(): Promise; + + /** + * Stop output instance. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + * @deprecated since 11 + * @useinstead ohos.multimedia.camera.Session#stop + */ + stop(callback: AsyncCallback): void; + + /** + * Stop output instance. + * + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + * @deprecated since 11 + * @useinstead ohos.multimedia.camera.Session#stop + */ + stop(): Promise; + + /** + * Subscribes frame start event callback. + * + * @param { 'frameStart' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + on(type: 'frameStart', callback: AsyncCallback): void; + + /** + * Unsubscribes from frame start event callback. + * + * @param { 'frameStart' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + off(type: 'frameStart', callback?: AsyncCallback): void; + + /** + * Subscribes frame end event callback. + * + * @param { 'frameEnd' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + on(type: 'frameEnd', callback: AsyncCallback): void; + + /** + * Unsubscribes from frame end event callback. + * + * @param { 'frameEnd' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + off(type: 'frameEnd', callback?: AsyncCallback): void; + + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the preview output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the preview output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Get supported frame rates which can be set during session running. + * + * @returns { Array } The array of supported frame rate range. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getSupportedFrameRates(): Array + + /** + * Set a frame rate range. + * + * @param { number } minFps - Minimum frame rate per second. + * @param { number } maxFps - Maximum frame rate per second. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + setFrameRate(minFps: number, maxFps: number): void + + /** + * Get active frame rate range which has been set before. + * + * @returns { FrameRateRange } The active frame rate range. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getActiveFrameRate(): FrameRateRange; + + /** + * Gets the preview rotation angle. + * + * @param { number } displayRotation - The current display rotation angle. + * @returns { ImageRotation } The preview rotation angle. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getPreviewRotation(displayRotation: number): ImageRotation; + + /** + * Sets the preview rotation angle. + * + * @param { ImageRotation } previewRotation - Preview display rotation angle. + * @param { boolean } isDisplayLocked - TRUE means the display is locked, if not set, the default is FALSE. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + setPreviewRotation(previewRotation: ImageRotation, isDisplayLocked?: boolean): void; + + /** + * Gets the current preconfig type if you had already call preconfig interface. + * + * @returns { Profile } The current preconfig type. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getActiveProfile(): Profile; + + /** + * Adds a deferred surface. + * + * @param { string } surfaceId - Surface object id used in camera photo output. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + /** + * Adds a deferred surface. + * + * @param { string } surfaceId - Surface object id used in camera photo output. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + addDeferredSurface(surfaceId: string): void; + + /** + * Determine whether camera sketch is supported. + * + * @returns { boolean } Is camera sketch supported. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + isSketchSupported(): boolean; + + /** + * Gets the specific zoom ratio when sketch stream open. + * + * @returns { number } The specific zoom ratio of sketch. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + getSketchRatio(): number; + + /** + * Enable sketch for camera. + * + * @param { boolean } enabled - enable sketch for camera if TRUE. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + /** + * Enable sketch for camera. + * + * @param { boolean } enabled - enable sketch for camera if TRUE. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enableSketch(enabled: boolean): void; + + /** + * Attach surface to the sketch stream. + * + * @param { string } surfaceId - Surface object id used in sketch stream. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + /** + * Attach surface to the sketch stream. + * + * @param { string } surfaceId - Surface object id used in sketch stream. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + attachSketchSurface(surfaceId: string): void; + + /** + * Subscribes sketch status changed event callback. + * + * @param { 'sketchStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to sketch status data. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + on(type: 'sketchStatusChanged', callback: AsyncCallback): void; + + /** + * Unsubscribes sketch status changed event callback. + * + * @param { 'sketchStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get sketch status data. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + off(type: 'sketchStatusChanged', callback?: AsyncCallback): void; + } + + /** + * Enum for effect suggestion. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enum EffectSuggestionType { + /** + * None. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + EFFECT_SUGGESTION_NONE = 0, + /** + * Portrait. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + EFFECT_SUGGESTION_PORTRAIT = 1, + /** + * Food. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + EFFECT_SUGGESTION_FOOD = 2, + + /** + * Sky. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + EFFECT_SUGGESTION_SKY = 3, + + /** + * Sunrise and sunset. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + EFFECT_SUGGESTION_SUNRISE_SUNSET = 4 + } + + /** + * Effect suggestion status + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + class EffectSuggestionStatus { + /** + * Effect Suggestion type. + * + * @type { EffectSuggestionType } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + type: EffectSuggestionType; + /** + * Effect Suggestion type status. + * + * @type { boolean } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + status: boolean; + } + + /** + * Enumerates the image rotation angles. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + enum ImageRotation { + /** + * The capture image rotates 0 degrees. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + ROTATION_0 = 0, + + /** + * The capture image rotates 90 degrees. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + ROTATION_90 = 90, + + /** + * The capture image rotates 180 degrees. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + ROTATION_180 = 180, + + /** + * The capture image rotates 270 degrees. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + ROTATION_270 = 270 + } + + /** + * Photo capture location + * + * @typedef Location + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + interface Location { + /** + * Latitude. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + latitude: number; + + /** + * Longitude. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + longitude: number; + + /** + * Altitude. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + altitude: number; + } + + /** + * Enumerates the image quality levels. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + enum QualityLevel { + /** + * High image quality. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + QUALITY_LEVEL_HIGH = 0, + + /** + * Medium image quality. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + QUALITY_LEVEL_MEDIUM = 1, + + /** + * Low image quality. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ QUALITY_LEVEL_LOW = 2 } /** - * Photo capture options to set. + * Photo capture options to set. + * + * @typedef PhotoCaptureSetting + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + interface PhotoCaptureSetting { + /** + * Photo image quality. + * + * @type { ?QualityLevel } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + quality?: QualityLevel; + + /** + * Photo rotation. + * + * @type { ?ImageRotation } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + rotation?: ImageRotation; + + /** + * Photo location. + * + * @type { ?Location } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + location?: Location; + + /** + * Set the mirror photo function switch, default to false. + * + * @type { ?boolean } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + mirror?: boolean; + } + + /** + * Enumerates the delivery image types. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + enum DeferredDeliveryImageType { + /** + * Undefer image delivery. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + NONE = 0, + + /** + * Defer photo delivery when capturing photos. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + PHOTO = 1, + + /** + * Defer video delivery when capturing videos. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + VIDEO = 2 + } + + /** + * Photo object + * + * @typedef Photo + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + interface Photo { + /** + * Main image. + * + * @type { image.Image } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + main: image.Image; + + /** + * Raw image. + * + * @type { ?image.Image } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + raw?: image.Image; + + /** + * Depth data. + * + * @type { DepthData } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + depthData?: DepthData; + + /** + * Release Photo object. + * + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + release(): Promise; + } + + /** + * DeferredPhotoProxy object + * + * @typedef DeferredPhotoProxy + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + interface DeferredPhotoProxy { + /** + * Thumbnail image. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + getThumbnail(): Promise; + + /** + * Release DeferredPhotoProxy object. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + release(): Promise; + } + + /** + * Enumerates the camera video codec type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + enum VideoCodecType { + /** + * Codec type AVC. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + AVC = 0, + + /** + * Codec type HEVC. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + HEVC = 1 + } + + /** + * Photo output object. + * + * @extends CameraOutput + * @interface PhotoOutput + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + interface PhotoOutput extends CameraOutput { + /** + * Start capture output. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + capture(callback: AsyncCallback): void; + + /** + * Start capture output. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + capture(): Promise; + + /** + * Start capture output. + * + * @param { PhotoCaptureSetting } setting - Photo capture settings. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + capture(setting: PhotoCaptureSetting, callback: AsyncCallback): void; + + /** + * Start capture output. + * + * @param { PhotoCaptureSetting } setting - Photo capture settings. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + /** + * Start capture output. + * Remove optional param. + * + * @param { PhotoCaptureSetting } setting - Photo capture settings. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + capture(setting: PhotoCaptureSetting): Promise; + + /** + * Start burst capture. + * + * @param { PhotoCaptureSetting } setting - Photo capture settings. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + burstCapture(setting: PhotoCaptureSetting): Promise; + + /** + * Confirm capture in Night mode or end burst capture. + * + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + confirmCapture(); + + /** + * Confirm if the raw image delivery is supported + * + * @returns { boolean } TRUE if the type of delivery image is support. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + isRawDeliverySupported(): boolean; + + /** + * Enable raw image image delivery. + * + * @param { boolean } enabled - Target state for raw image delivery. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enableRawDelivery(enabled: boolean): void; + + /** + * Confirm if the deferred image delivery supported in the specific device. + * + * @param { DeferredDeliveryImageType } type - Type of delivery image. + * @returns { boolean } TRUE if the type of delivery image is support. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + isDeferredImageDeliverySupported(type: DeferredDeliveryImageType): boolean; + + /** + * Confirm if the deferred image delivery enabled. + * + * @param { DeferredDeliveryImageType } type - Type of delivery image. + * @returns { boolean } TRUE if the type of delivery image is enable. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + isDeferredImageDeliveryEnabled(type: DeferredDeliveryImageType): boolean; + + /** + * Sets the image type for deferred image delivery. + * + * @param { DeferredDeliveryImageType } type - Type of delivery image. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + deferImageDelivery(type: DeferredDeliveryImageType): void; + + /** + * Check if the depth data delivery is supported. + * + * @returns { boolean } TRUE if the type of delivery image is enabled. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + isDepthDataDeliverySupported(): boolean; + + /** + * Enable depth data delivery. + * + * @param { boolean } enabled - Target state for depth data delivery. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enableDepthDataDelivery(enabled: boolean): void; + + /** + * Get supported moving photo video codec types. + * + * @returns { Array } An array of supported video codec types for moving photo. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + getSupportedMovingPhotoVideoCodecTypes(): Array; + + /** + * Sets codec type for moving photo, default to AVC. + * + * @param { VideoCodecType } codecType - Codec type for moving photo. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + setMovingPhotoVideoCodecType(codecType: VideoCodecType): void; + + /** + * Subscribes photo available event callback. + * + * @param { 'photoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the Photo. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + on(type: 'photoAvailable', callback: AsyncCallback): void; + + /** + * Unsubscribes photo available event callback. + * + * @param { 'photoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the Photo. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + off(type: 'photoAvailable', callback?: AsyncCallback): void; + + /** + * Subscribes deferred photo proxy available event callback. + * + * @param { 'deferredPhotoProxyAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the DeferredPhotoProxy. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + on(type: 'deferredPhotoProxyAvailable', callback: AsyncCallback): void; + + /** + * Unsubscribes deferred photo proxy available event callback. + * + * @param { 'deferredPhotoProxyAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the DeferredPhotoProxy. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 11 + */ + off(type: 'deferredPhotoProxyAvailable', callback?: AsyncCallback): void; + + /** + * Subscribes photo asset event callback. + * + * @param { 'photoAssetAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the asset. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + on(type: 'photoAssetAvailable', callback: AsyncCallback): void; + + /** + * Unsubscribes photo asset event callback. + * + * @param { 'photoAssetAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the asset. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + off(type: 'photoAssetAvailable', callback?: AsyncCallback): void; + + /** + * Check whether to support mirror photo. + * + * @returns { boolean } Is the mirror supported. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + isMirrorSupported(): boolean; + + /** + * Enable mirror for photo capture. + * + * @param { boolean } enabled - enable photo mirror if TRUE. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + enableMirror(enabled: boolean): void; + + /** + * Subscribes capture start event callback. + * + * @param { 'captureStart' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the capture ID. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + * @deprecated since 11 + * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo + */ + on(type: 'captureStart', callback: AsyncCallback): void; + + /** + * Unsubscribes from capture start event callback. + * + * @param { 'captureStart' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the capture ID. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + * @deprecated since 11 + * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo + */ + off(type: 'captureStart', callback?: AsyncCallback): void; + + /** + * Subscribes capture start event callback. + * + * @param { 'captureStartWithInfo' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the capture start info. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + on(type: 'captureStartWithInfo', callback: AsyncCallback): void; + + /** + * Unsubscribes from capture start event callback. + * + * @param { 'captureStartWithInfo' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the capture start info. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + off(type: 'captureStartWithInfo', callback?: AsyncCallback): void; + + /** + * Subscribes frame shutter event callback. + * + * @param { 'frameShutter' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the frame shutter information. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + on(type: 'frameShutter', callback: AsyncCallback): void; + + /** + * Unsubscribes from frame shutter event callback. + * + * @param { 'frameShutter' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the frame shutter information. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + off(type: 'frameShutter', callback?: AsyncCallback): void; + + /** + * Subscribes frame shutter end event callback. + * + * @param { 'frameShutterEnd' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the frame shutter end information. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + on(type: 'frameShutterEnd', callback: AsyncCallback): void; + + /** + * Unsubscribes from frame shutter end event callback. + * + * @param { 'frameShutterEnd' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the frame shutter end information. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + off(type: 'frameShutterEnd', callback?: AsyncCallback): void; + + /** + * Subscribes capture end event callback. + * + * @param { 'captureEnd' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the capture end information. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + on(type: 'captureEnd', callback: AsyncCallback): void; + + /** + * Unsubscribes from capture end event callback. + * + * @param { 'captureEnd' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the capture end information. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + off(type: 'captureEnd', callback?: AsyncCallback): void; + + /** + * Subscribes capture ready event callback. After receiving the callback, can proceed to the next capture + * + * @param { 'captureReady' } type - Event type. + * @param { AsyncCallback } callback - Callback used to notice capture ready. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + on(type: 'captureReady', callback: AsyncCallback): void; + + /** + * Unsubscribes from capture ready event callback. + * + * @param { 'captureReady' } type - Event type. + * @param { AsyncCallback } callback - Callback used to notice capture ready. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + off(type: 'captureReady', callback?: AsyncCallback): void; + + /** + * Subscribes estimated capture duration event callback. + * + * @param { 'estimatedCaptureDuration' } type - Event type. + * @param { AsyncCallback } callback - Callback used to notify the estimated capture duration (in milliseconds). + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + on(type: 'estimatedCaptureDuration', callback: AsyncCallback): void; + + /** + * Unsubscribes from estimated capture duration event callback. + * + * @param { 'estimatedCaptureDuration' } type - Event type. + * @param { AsyncCallback } callback - Callback used to notify the estimated capture duration (in milliseconds). + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + off(type: 'estimatedCaptureDuration', callback?: AsyncCallback): void; + + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the photo output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the photo output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Gets the current preconfig type if you had already call preconfig interface. + * + * @returns { Profile } The current preconfig type. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getActiveProfile(): Profile; + + /** + * Checks whether PhotoOutput supports quick thumbnail. + * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. + * + * @returns { boolean } Whether quick thumbnail is supported. + * @throws { BusinessError } 7400104 - session is not running. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + /** + * Checks whether PhotoOutput supports quick thumbnail. + * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. + * + * @returns { boolean } Whether quick thumbnail is supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400104 - session is not running. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + isQuickThumbnailSupported(): boolean; + + /** + * Enables or disables quick thumbnail. + * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. + * To avoid stream reconfiguration and performance loss, + * you are advised to call the method before Session.commitConfig(). + * + * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. + * @throws { BusinessError } 7400104 - session is not running. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + /** + * Enables or disables quick thumbnail. + * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. + * To avoid stream reconfiguration and performance loss, + * you are advised to call the method before Session.commitConfig(). + * + * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - session is not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enableQuickThumbnail(enabled: boolean): void; + + /** + * Subscribes to camera thumbnail events. + * This method is valid only after enableQuickThumbnail(true) is called. + * + * @param { 'quickThumbnail' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the quick thumbnail. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + on(type: 'quickThumbnail', callback: AsyncCallback): void; + + /** + * Unsubscribes from camera thumbnail events. + * This method is valid only after enableQuickThumbnail(true) is called. + * + * @param { 'quickThumbnail' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the quick thumbnail. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 10 + */ + off(type: 'quickThumbnail', callback?: AsyncCallback): void; + + /** + * Confirm if the auto high quality photo supported. + * + * @returns { boolean } TRUE if the auto high quality photo is supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400104 - session is not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + isAutoHighQualityPhotoSupported(): boolean; + + /** + * Enable auto high quality photo. + * + * @param { boolean } enabled - Target state for auto high quality photo. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - session is not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enableAutoHighQualityPhoto(enabled: boolean): void; + + /** + * Confirm if the auto cloud image enhancement is supported. + * + * @returns { boolean } TRUE if the auto cloud image enhancement is supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + isAutoCloudImageEnhancementSupported(): boolean; + + /** + * Enable auto cloud image enhancement + * + * @param { boolean } enabled - Target state for auto cloud image enhancement. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enableAutoCloudImageEnhancement(enabled: boolean): void; + + /** + * Confirm if moving photo supported. + * + * @returns { boolean } TRUE if the moving photo is supported. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + isMovingPhotoSupported(): boolean; + + /** + * Enable moving photo. + * + * @permission ohos.permission.MICROPHONE + * @param { boolean } enabled - Target state for moving photo. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + enableMovingPhoto(enabled: boolean): void; + + /** + * Gets the photo rotation angle. + * + * @param { number } deviceDegree - The current device rotation degree. + * @returns { ImageRotation } The photo rotation angle. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getPhotoRotation(deviceDegree: number): ImageRotation; + + /** + * Confirm if offline processing is supported. + * + * @returns { boolean } TRUE if the type of offline is supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 18 + */ + isOfflineSupported(): boolean; + + /** + * Enable offline processing. + * + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400104 - session is not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 18 + */ + enableOffline(): void; + + /** + * Subscribes offline Delivery finished events. + * This method is valid only after enableOffline() is called. + * + * @param { 'offlineDeliveryFinished' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get offline Delivery finished events. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 18 + */ + on(type: 'offlineDeliveryFinished', callback: AsyncCallback): void; + + /** + * Unsubscribes offline Delivery finished events. + * This method is valid only after enableOffline() is called. + * + * @param { 'offlineDeliveryFinished' } type - Event type. + * @param { AsyncCallback} callback - Callback used to get offline Delivery finished events. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 18 + */ + off(type: 'offlineDeliveryFinished', callback?: AsyncCallback): void + } + + /** + * Frame shutter callback info. + * + * @typedef FrameShutterInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + interface FrameShutterInfo { + /** + * Capture id. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + captureId: number; + /** + * Timestamp for frame. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + timestamp: number; + } + + /** + * Frame shutter end callback info. + * + * @typedef FrameShutterEndInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + interface FrameShutterEndInfo { + /** + * Capture id. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + captureId: number; + } + + /** + * Capture start info. + * + * @typedef CaptureStartInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + interface CaptureStartInfo { + /** + * Capture id. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + captureId: number; + /** + * Time(in milliseconds) is the shutter time for the photo. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 11 + */ + time: number; + } + + /** + * Capture end info. + * + * @typedef CaptureEndInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + interface CaptureEndInfo { + /** + * Capture id. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + captureId: number; + /** + * Frame count. + * + * @type { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + frameCount: number; + } + + /** + * Deferred video enhancement info. + * + * @typedef DeferredVideoEnhancementInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface DeferredVideoEnhancementInfo { + /** + * Check whether deferred video enhancement available. + * + * @type { boolean } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly isDeferredVideoEnhancementAvailable: boolean; + /** + * Video identifier. + * + * @type { ?string } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly videoId?: string; + } + + /** + * Video output object. + * + * extends CameraOutput + * @interface VideoOutput + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + interface VideoOutput extends CameraOutput { + /** + * Start video output. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + start(callback: AsyncCallback): void; + + /** + * Start video output. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + start(): Promise; + + /** + * Stop video output. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + stop(callback: AsyncCallback): void; + + /** + * Stop video output. + * + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + stop(): Promise; + + /** + * Determine whether video mirror is supported. + * + * @returns { boolean } Is video mirror supported. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + /** + * Determine whether video mirror is supported. + * + * @returns { boolean } Is video mirror supported. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 15 + */ + isMirrorSupported(): boolean; + + /** + * Enable mirror for video capture. + * + * @param { boolean } enabled - enable video mirror if TRUE. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + /** + * Enable mirror for video capture. + * + * @param { boolean } enabled - enable video mirror if TRUE. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 15 + */ + enableMirror(enabled: boolean): void; + + /** + * Get supported frame rates which can be set during session running. + * + * @returns { Array } The array of supported frame rate range. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getSupportedFrameRates(): Array + + /** + * Set a frame rate range. + * + * @param { number } minFps - Minimum frame rate per second. + * @param { number } maxFps - Maximum frame rate per second. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + setFrameRate(minFps: number, maxFps: number): void + + /** + * Get active frame rate range which has been set before. + * + * @returns { FrameRateRange } The active frame rate range. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getActiveFrameRate(): FrameRateRange; + + /** + * Gets the video rotation angle. + * + * @param { number } deviceDegree - The current device rotation degree. + * @returns { ImageRotation } The video rotation angle. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getVideoRotation(deviceDegree: number): ImageRotation; + + /** + * Confirm if auto deferred video enhancement is supported in the specific device. + * + * @returns { boolean } TRUE if auto deferred video enhancement is supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + isAutoDeferredVideoEnhancementSupported(): boolean; + + /** + * Confirm if auto deferred video enhancement is enabled. + * + * @returns { boolean } TRUE if auto deferred video enhancement is enabled. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + isAutoDeferredVideoEnhancementEnabled(): boolean; + + /** + * Enable auto deferred video enhancement if needed. + * + * @param { boolean } enabled - Status of auto deferred video enhancement. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enableAutoDeferredVideoEnhancement(enabled: boolean): void; + + /** + * Get supported video rotations. + * + * @returns { Array } The array of supported video rotations. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 14 + */ + getSupportedRotations(): Array; + + /** + * Determine whether video rotation is supported. + * + * @returns { boolean } Is video rotation supported. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 14 + */ + isRotationSupported(): boolean; + + /** + * Set a video rotation. + * + * @param { ImageRotation } rotation - The rotation angle. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 14 + */ + setRotation(rotation: ImageRotation): void; + + /** + * Determine whether auto frame rate is supported. + * + * @returns { boolean } Is auto frame rate supported. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 18 + */ + isAutoVideoFrameRateSupported(): boolean; + + /** + * Enable auto frame rate for video capture. + * + * @param { boolean } enabled - enable auto frame rate if TRUE. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 401 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 18 + */ + enableAutoVideoFrameRate(enabled: boolean): void; + + /** + * Subscribes deferred video enhancement info callback. + * + * @param { 'deferredVideoEnhancementInfo' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + on(type: 'deferredVideoEnhancementInfo', callback: AsyncCallback): void; + + /** + * Unsubscribes from deferred video enhancement info callback. + * + * @param { 'deferredVideoEnhancementInfo' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + off(type: 'deferredVideoEnhancementInfo', callback?: AsyncCallback): void; + + /** + * Subscribes frame start event callback. + * + * @param { 'frameStart' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + on(type: 'frameStart', callback: AsyncCallback): void; + + /** + * Unsubscribes from frame start event callback. + * + * @param { 'frameStart' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + off(type: 'frameStart', callback?: AsyncCallback): void; + + /** + * Subscribes frame end event callback. + * + * @param { 'frameEnd' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + on(type: 'frameEnd', callback: AsyncCallback): void; + + /** + * Unsubscribes from frame end event callback. + * + * @param { 'frameEnd' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + off(type: 'frameEnd', callback?: AsyncCallback): void; + + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Gets the current preconfig type if you had already call preconfig interface. + * + * @returns { VideoProfile } The current preconfig type. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + */ + getActiveProfile(): VideoProfile; + + /** + * Get supported video meta types. + * @returns { Array } The array of supported video meta type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + getSupportedVideoMetaTypes(): Array; + + /** + * Attach a meta surface to VideoOutput. + * @param { string } surfaceId - Surface object id used for receiving meta infos. + * @param { VideoMetaType } type - Video meta type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + attachMetaSurface(surfaceId: string, type: VideoMetaType): void; + } + + /** + * Video meta type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enum VideoMetaType { + /** + * Video meta type for storing maker info. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + VIDEO_META_MAKER_INFO = 0, + } + + /** + * Metadata object type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + enum MetadataObjectType { + /** + * Face detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + FACE_DETECTION = 0, + + /** + * Human body detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + HUMAN_BODY = 1, + + /** + * Cat face detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + CAT_FACE = 2, + + /** + * Cat body detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + CAT_BODY = 3, + + /** + * Dog face detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + DOG_FACE = 4, + + /** + * Dog body detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + DOG_BODY = 5, + + /** + * Salient detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + SALIENT_DETECTION = 6, + + /** + * Barcode detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + BAR_CODE_DETECTION = 7 + } + + /** + * Enum for light painting tabletype. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enum LightPaintingType { + /** + * Traffic trails effect. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + TRAFFIC_TRAILS = 0, + + /** + * Star trails effect. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + STAR_TRAILS = 1, + + /** + * Silky water effect. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + SILKY_WATER = 2, + + /** + * Light graffiti effect. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + LIGHT_GRAFFITI = 3 + } + + /** + * Rectangle definition. * - * @typedef PhotoCaptureSetting + * @typedef Rect * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 */ - interface PhotoCaptureSetting { + interface Rect { /** - * Photo image quality. + * X coordinator of top left point. * - * @type { ?QualityLevel } + * @type { number } * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 */ - quality?: QualityLevel; - + topLeftX: number; /** - * Photo rotation. + * Y coordinator of top left point. * - * @type { ?ImageRotation } + * @type { number } * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 */ - rotation?: ImageRotation; - + topLeftY: number; /** - * Photo location. + * Width of this rectangle. * - * @type { ?Location } + * @type { number } * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 */ - location?: Location; - + width: number; /** - * Set the mirror photo function switch, default to false. + * Height of this rectangle. * - * @type { ?boolean } + * @type { number } * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 */ - mirror?: boolean; + height: number; } /** - * Enumerates the delivery image types. + * Enum for emotion type. * * @enum { number } * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - enum DeferredDeliveryImageType { + enum Emotion { /** - * Undefer image delivery. + * Emotion type: Neutral. * * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - NONE = 0, + NEUTRAL = 0, /** - * Defer photo delivery when capturing photos. + * Emotion type: Sadness. * * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - PHOTO = 1, + SADNESS = 1, /** - * Defer video delivery when capturing videos. + * Emotion type: Smile. * * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - VIDEO = 2 + SMILE = 2, + + /** + * Emotion type: Surprise. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + SURPRISE = 3 } /** - * Photo object + * Metadata object basis. * - * @typedef Photo + * @typedef MetadataObject * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @since 10 */ - interface Photo { + interface MetadataObject { /** - * Main image. + * Metadata object type. * - * @type { image.Image } + * @type { MetadataObjectType } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @since 10 */ - main: image.Image; - + readonly type: MetadataObjectType; /** - * Raw image. + * Metadata object timestamp in milliseconds. * - * @type { ?image.Image } + * @type { number } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + readonly timestamp: number; + /** + * The axis-aligned bounding box of detected metadata object. + * + * @type { Rect } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + readonly boundingBox: Rect; + /** + * Metadata object id. + * + * @type { number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 13 */ - raw?: image.Image; - + readonly objectId: number; /** - * Release Photo object. + * Confidence for the detected type. * - * @returns { Promise } Promise used to return the result. + * @type { number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 13 */ - release(): Promise; + readonly confidence: number; } /** - * DeferredPhotoProxy object + * Metadata object for face. * - * @typedef DeferredPhotoProxy + * @typedef MetadataFaceObject + * @extends MetadataObject * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - interface DeferredPhotoProxy { + interface MetadataFaceObject extends MetadataObject { /** - * Thumbnail image. + * Bounding box for left eye. * - * @returns { Promise } Promise used to return the result. - * @throws { BusinessError } 202 - Not System Application. + * @type { Rect } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - getThumbnail(): Promise; + readonly leftEyeBoundingBox: Rect; /** - * Release DeferredPhotoProxy object. + * Bounding box for right eye. * - * @returns { Promise } Promise used to return the result. - * @throws { BusinessError } 202 - Not System Application. + * @type { Rect } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - release(): Promise; - } - + readonly rightEyeBoundingBox: Rect; - /** - * Photo output object. - * - * @interface PhotoOutput - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - interface PhotoOutput extends CameraOutput { /** - * Start capture output. + * Emotion type for face. * - * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 7400104 - Session not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @type { Emotion } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - capture(callback: AsyncCallback): void; + readonly emotion: Emotion; /** - * Start capture output. + * Emotion confidence. * - * @returns { Promise } Promise used to return the result. - * @throws { BusinessError } 7400104 - Session not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @type { number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - capture(): Promise; + readonly emotionConfidence: number; /** - * Start capture output. + * Pitch angle for face. * - * @param { PhotoCaptureSetting } setting - Photo capture settings. - * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400104 - Session not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @type { number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - capture(setting: PhotoCaptureSetting, callback: AsyncCallback): void; + readonly pitchAngle: number; /** - * Start capture output. + * Yaw angle for face. * - * @param { PhotoCaptureSetting } setting - Photo capture settings. - * @returns { Promise } Promise used to return the result. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400104 - Session not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @type { number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ + readonly yawAngle: number; + /** - * Start capture output. - * Remove optional param. + * Roll angle for face. * - * @param { PhotoCaptureSetting } setting - Photo capture settings. - * @returns { Promise } Promise used to return the result. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400104 - Session not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @type { number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 13 */ - capture(setting: PhotoCaptureSetting): Promise; + readonly rollAngle: number; + } + + /** + * Metadata object for human body. + * + * @typedef MetadataHumanBodyObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataHumanBodyObject extends MetadataObject { + } + /** + * Metadata object for cat face. + * + * @typedef MetadataCatFaceObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataCatFaceObject extends MetadataObject { /** - * Confirm capture in Night mode. + * Bounding box for left eye. * - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400104 - Session not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @type { Rect } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - confirmCapture(); + readonly leftEyeBoundingBox: Rect; /** - * Confirm if the deferred image delivery supported in the specific device. + * Bounding box for right eye. * - * @param { DeferredDeliveryImageType } type - Type of delivery image. - * @returns { boolean } TRUE if the type of delivery image is support. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400104 - Session not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @type { Rect } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - isDeferredImageDeliverySupported(type: DeferredDeliveryImageType): boolean; + readonly rightEyeBoundingBox: Rect; + } + + /** + * Metadata object for cat body. + * + * @typedef MetadataCatBodyObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataCatBodyObject extends MetadataObject { + } + /** + * Metadata object for dog face. + * + * @typedef MetadataDogFaceObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataDogFaceObject extends MetadataObject { /** - * Confirm if the deferred image delivery enabled. + * Bounding box for left eye. * - * @param { DeferredDeliveryImageType } type - Type of delivery image. - * @returns { boolean } TRUE if the type of delivery image is enable. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400104 - Session not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @type { Rect } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - isDeferredImageDeliveryEnabled(type: DeferredDeliveryImageType): boolean; + readonly leftEyeBoundingBox: Rect; /** - * Sets the image type for deferred image delivery. + * Bounding box for right eye. * - * @param { DeferredDeliveryImageType } type - Type of delivery image. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400104 - Session not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @type { Rect } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - deferImageDelivery(type: DeferredDeliveryImageType): void; + readonly rightEyeBoundingBox: Rect; + } + + /** + * Metadata object for dog body. + * + * @typedef MetadataDogBodyObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataDogBodyObject extends MetadataObject { + } + + /** + * Metadata object for salient detection. + * + * @typedef MetadataSalientDetectionObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataSalientDetectionObject extends MetadataObject { + } - /** - * Subscribes photo available event callback. - * - * @param { 'photoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the Photo. - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 - */ - on(type: 'photoAvailable', callback: AsyncCallback): void; + /** + * Metadata object for barcode. + * + * @extends MetadataObject + * @typedef MetadataBarcodeObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 14 + */ + interface MetadataBarcodeObject extends MetadataObject { + } + /** + * Camera Occlusion Detection Result. + * + * @typedef CameraOcclusionDetectionResult + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface CameraOcclusionDetectionResult { /** - * Unsubscribes photo available event callback. + * Check whether camera is occluded. * - * @param { 'photoAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the Photo. + * @type { boolean } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 12 */ - off(type: 'photoAvailable', callback?: AsyncCallback): void; + readonly isCameraOccluded: boolean; /** - * Subscribes deferred photo proxy available event callback. + * Check whether camera lens is dirty. * - * @param { 'deferredPhotoProxyAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the DeferredPhotoProxy. - * @throws { BusinessError } 202 - Not System Application. + * @type { boolean } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 11 + * @since 13 */ - on(type: 'deferredPhotoProxyAvailable', callback: AsyncCallback): void; + readonly isCameraLensDirty: boolean; + } + /** + * Metadata Output object + * + * extends CameraOutput + * @interface MetadataOutput + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 10 + */ + interface MetadataOutput extends CameraOutput { /** - * Unsubscribes deferred photo proxy available event callback. + * Start output metadata * - * @param { 'deferredPhotoProxyAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the DeferredPhotoProxy. - * @throws { BusinessError } 202 - Not System Application. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @systemapi - * @since 11 + * @since 10 */ - off(type: 'deferredPhotoProxyAvailable', callback?: AsyncCallback): void; + start(callback: AsyncCallback): void; /** - * Subscribes photo asset event callback. + * Start output metadata * - * @param { 'photoAssetAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the asset. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 12 + * @since 10 */ - on(type: 'photoAssetAvailable', callback: AsyncCallback): void; + start(): Promise; /** - * Unsubscribes photo asset event callback. + * Stop output metadata * - * @param { 'photoAssetAvailable' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the asset. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 12 + * @since 10 */ - off(type: 'photoAssetAvailable', callback?: AsyncCallback): void; + stop(callback: AsyncCallback): void; /** - * Check whether to support mirror photo. + * Stop output metadata * - * @returns { boolean } Is the mirror supported. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 */ - isMirrorSupported(): boolean; + stop(): Promise; /** - * Subscribes capture start event callback. + * Add metadata object types. * - * @param { 'captureStart' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the capture ID. + * @param { Array } types - Object types to be added. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - * @deprecated since 11 - * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo + * @systemapi + * @since 13 */ - on(type: 'captureStart', callback: AsyncCallback): void; + addMetadataObjectTypes(types: Array): void; /** - * Unsubscribes from capture start event callback. + * Remove metadata object types. * - * @param { 'captureStart' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the capture ID. + * @param { Array } types - Object types to be removed. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - * @deprecated since 11 - * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo + * @systemapi + * @since 13 */ - off(type: 'captureStart', callback?: AsyncCallback): void; + removeMetadataObjectTypes(types: Array): void; /** - * Subscribes capture start event callback. + * Subscribes to metadata objects available event callback. * - * @param { 'captureStartWithInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the capture start info. + * @param { 'metadataObjectsAvailable' } type - Event type. + * @param { AsyncCallback> } callback - Callback used to get the available metadata objects. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @since 10 */ - on(type: 'captureStartWithInfo', callback: AsyncCallback): void; + on(type: 'metadataObjectsAvailable', callback: AsyncCallback>): void; /** - * Unsubscribes from capture start event callback. + * Unsubscribes from metadata objects available event callback. * - * @param { 'captureStartWithInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the capture start info. + * @param { 'metadataObjectsAvailable' } type - Event type. + * @param { AsyncCallback> } callback - Callback used to get the available metadata objects. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @since 10 */ - off(type: 'captureStartWithInfo', callback?: AsyncCallback): void; + off(type: 'metadataObjectsAvailable', callback?: AsyncCallback>): void; /** - * Subscribes frame shutter event callback. + * Subscribes to error events. * - * @param { 'frameShutter' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the frame shutter information. + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the video output errors. * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 */ - on(type: 'frameShutter', callback: AsyncCallback): void; + on(type: 'error', callback: ErrorCallback): void; /** - * Unsubscribes from frame shutter event callback. + * Unsubscribes from error events. * - * @param { 'frameShutter' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the frame shutter information. + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the video output errors. * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 */ - off(type: 'frameShutter', callback?: AsyncCallback): void; + off(type: 'error', callback?: ErrorCallback): void; + } + /** + * Enumerates the timelapse recording state. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enum TimeLapseRecordState { /** - * Subscribes frame shutter end event callback. + * TimeLapse idle state. * - * @param { 'frameShutterEnd' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the frame shutter end information. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - on(type: 'frameShutterEnd', callback: AsyncCallback): void; + IDLE = 0, /** - * Unsubscribes from frame shutter end event callback. + * TimeLapse recording state. * - * @param { 'frameShutterEnd' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the frame shutter end information. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - off(type: 'frameShutterEnd', callback?: AsyncCallback): void; + RECORDING = 1 + } + /** + * Enumerates the timelapse preview type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enum TimeLapsePreviewType { /** - * Subscribes capture end event callback. + * TimeLapse dark preview. * - * @param { 'captureEnd' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the capture end information. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - on(type: 'captureEnd', callback: AsyncCallback): void; + DARK = 1, /** - * Unsubscribes from capture end event callback. + * TimeLapse Light preview. * - * @param { 'captureEnd' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the capture end information. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - off(type: 'captureEnd', callback?: AsyncCallback): void; + LIGHT = 2 + } + /** + * Try AE information. + * + * @typedef TryAEInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface TryAEInfo { /** - * Subscribes capture ready event callback. After receiving the callback, can proceed to the next capture + * Determine whether try AE is done. * - * @param { 'captureReady' } type - Event type. - * @param { AsyncCallback } callback - Callback used to notice capture ready. + * @type { boolean } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - on(type: 'captureReady', callback: AsyncCallback): void; + readonly isTryAEDone: boolean; /** - * Unsubscribes from capture ready event callback. + * Determine whether AE hint is needed. * - * @param { 'captureReady' } type - Event type. - * @param { AsyncCallback } callback - Callback used to notice capture ready. + * @type { ?boolean } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - off(type: 'captureReady', callback?: AsyncCallback): void; + readonly isTryAEHintNeeded?: boolean; /** - * Subscribes estimated capture duration event callback. + * Timelapse preview type. * - * @param { 'estimatedCaptureDuration' } type - Event type. - * @param { AsyncCallback } callback - Callback used to notify the estimated capture duration (in milliseconds). + * @type { ?TimeLapsePreviewType } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - on(type: 'estimatedCaptureDuration', callback: AsyncCallback): void; + readonly previewType?: TimeLapsePreviewType; /** - * Unsubscribes from estimated capture duration event callback. + * Timelapse capture interval. * - * @param { 'estimatedCaptureDuration' } type - Event type. - * @param { AsyncCallback } callback - Callback used to notify the estimated capture duration (in milliseconds). + * @type { ?number } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - off(type: 'estimatedCaptureDuration', callback?: AsyncCallback): void; + readonly captureInterval?: number; + } + /** + * Timelapse photo session object. + * + * @extends Session, Focus, ManualFocus, AutoExposure, ManualExposure, ManualIso, WhiteBalance, Zoom, ColorEffect + * @interface TimeLapsePhotoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface TimeLapsePhotoSession extends Session, Focus, ManualFocus, AutoExposure, ManualExposure, ManualIso, WhiteBalance, Zoom, ColorEffect { /** * Subscribes to error events. * * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the photo output errors. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ on(type: 'error', callback: ErrorCallback): void; @@ -6707,581 +10410,675 @@ declare namespace camera { * Unsubscribes from error events. * * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the photo output errors. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ off(type: 'error', callback?: ErrorCallback): void; /** - * Checks whether PhotoOutput supports quick thumbnail. - * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. + * Subscribes focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from focus state change event callback. * - * @returns { boolean } Whether quick thumbnail is supported. - * @throws { BusinessError } 7400104 - session is not running. + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 12 */ + off(type: 'focusStateChange', callback?: AsyncCallback): void; + /** - * Checks whether PhotoOutput supports quick thumbnail. - * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. + * Subscribes ISO info event callback. * - * @returns { boolean } Whether quick thumbnail is supported. + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the ISO info. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400104 - session is not running. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - isQuickThumbnailSupported(): boolean; + on(type: 'isoInfoChange', callback: AsyncCallback): void; /** - * Enables or disables quick thumbnail. - * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. - * To avoid stream reconfiguration and performance loss, - * you are advised to call the method before Session.commitConfig(). - * - * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. - * @throws { BusinessError } 7400104 - session is not running. + * Unsubscribes from ISO info event callback. + * + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the ISO info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 12 */ + off(type: 'isoInfoChange', callback?: AsyncCallback): void; + /** - * Enables or disables quick thumbnail. - * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. - * To avoid stream reconfiguration and performance loss, - * you are advised to call the method before Session.commitConfig(). - * - * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. + * Subscribes exposure info event callback. + * + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the exposure info. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400104 - session is not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - enableQuickThumbnail(enabled: boolean): void; + on(type: 'exposureInfoChange', callback: AsyncCallback): void; /** - * Subscribes to camera thumbnail events. - * This method is valid only after enableQuickThumbnail(true) is called. + * Unsubscribes from exposure info event callback. * - * @param { 'quickThumbnail' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the quick thumbnail. + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 12 */ - on(type: 'quickThumbnail', callback: AsyncCallback): void; + off(type: 'exposureInfoChange', callback?: AsyncCallback): void; /** - * Unsubscribes from camera thumbnail events. - * This method is valid only after enableQuickThumbnail(true) is called. + * Subscribes lumination info event callback. * - * @param { 'quickThumbnail' } type - Event type. - * @param { AsyncCallback } callback - Callback used to get the quick thumbnail. + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 10 + * @since 12 */ - off(type: 'quickThumbnail', callback?: AsyncCallback): void; + on(type: 'luminationInfoChange', callback: AsyncCallback): void; /** - * Confirm if the auto high quality photo supported. + * Unsubscribes from lumination info event callback. * - * @returns { boolean } TRUE if the auto high quality photo is supported. + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lumination info. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400104 - session is not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - isAutoHighQualityPhotoSupported(): boolean; + off(type: 'luminationInfoChange', callback?: AsyncCallback): void; /** - * Enable auto high quality photo. + * Check whether try AE is needed. * - * @param { boolean } enabled - Target state for auto high quality photo. + * @returns { boolean } Is try AE needed. * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400104 - session is not running. - * @throws { BusinessError } 7400201 - Camera service fatal error. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - enableAutoHighQualityPhoto(enabled: boolean): void; + isTryAENeeded(): boolean; /** - * Confirm if moving photo supported. + * Start try AE. * - * @returns { boolean } TRUE if the moving photo is supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - isMovingPhotoSupported(): boolean; + startTryAE(): void; /** - * Enable moving photo. + * Stop try AE. * - * @permission ohos.permission.MICROPHONE - * @param { boolean } enabled - Target state for moving photo. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - enableMovingPhoto(enabled: boolean): void; - } + stopTryAE(): void; - /** - * Frame shutter callback info. - * - * @typedef FrameShutterInfo - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - interface FrameShutterInfo { /** - * Capture id. + * Subscribes try AE info event callback. * - * @type { number } + * @param { 'tryAEInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the try AE info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - captureId: number; + on(type: 'tryAEInfoChange', callback: AsyncCallback): void; + /** - * Timestamp for frame. + * Unsubscribes from try AE info event callback. * - * @type { number } + * @param { 'tryAEInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the try AE info. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - timestamp: number; - } + off(type: 'tryAEInfoChange', callback?: AsyncCallback): void; - /** - * Frame shutter end callback info. - * - * @typedef FrameShutterEndInfo - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 12 - */ - interface FrameShutterEndInfo { /** - * Capture id. + * Gets supported timelapse interval range. * - * @type { number } + * @returns { Array } Timelapse interval range. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi * @since 12 */ - captureId: number; - } + getSupportedTimeLapseIntervalRange(): Array; - /** - * Capture start info. - * - * @typedef CaptureStartInfo - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 - */ - interface CaptureStartInfo { /** - * Capture id. + * Gets the timelapse interval in use. * - * @type { number } + * @returns { number } the timelapse interval in use. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 12 */ - captureId: number; + getTimeLapseInterval(): number; + /** - * Time(in milliseconds) is the shutter time for the photo. + * Sets a timelapse interval for a camera device. * - * @type { number } + * @param { number } interval The timelapse interval. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 11 + * @systemapi + * @since 12 */ - time: number; - } + setTimeLapseInterval(interval: number): void; - /** - * Capture end info. - * - * @typedef CaptureEndInfo - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - interface CaptureEndInfo { /** - * Capture id. + * Gets the timelapse recording state in use. * - * @type { number } + * @returns { TimeLapseRecordState } the timelapse recording state in use. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - captureId: number; + getTimeLapseRecordState(): TimeLapseRecordState; + /** - * Frame count. + * Sets a timelapse recording state. * - * @type { number } + * @param { TimeLapseRecordState } state The timelapse recording state. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - frameCount: number; - } + setTimeLapseRecordState(state: TimeLapseRecordState): void; - /** - * Video output object. - * - * @interface VideoOutput - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - interface VideoOutput extends CameraOutput { /** - * Start video output. + * Gets the timelapse preview type in use. * - * @param { AsyncCallback } callback - Callback used to return the result. + * @returns { TimeLapsePreviewType } the timelapse preview type in use. + * @throws { BusinessError } 202 - Not System Application. * @throws { BusinessError } 7400103 - Session not config. - * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - start(callback: AsyncCallback): void; + getTimeLapsePreviewType(): TimeLapsePreviewType; /** - * Start video output. + * Sets a timelapse preview type. * - * @returns { Promise } Promise used to return the result. + * @param { TimeLapsePreviewType } type The timelapse preview type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. * @throws { BusinessError } 7400103 - Session not config. - * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 12 */ - start(): Promise; + setTimeLapsePreviewType(type: TimeLapsePreviewType): void; + } + /** + * Enum for Depth Data Accuracy. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enum DepthDataAccuracy { /** - * Stop video output. + * Relative accuracy depth data. * - * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - stop(callback: AsyncCallback): void; + DEPTH_DATA_ACCURACY_RELATIVE = 0, /** - * Stop video output. + * Absolute accuracy depth data. * - * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - stop(): Promise; + DEPTH_DATA_ACCURACY_ABSOLUTE = 1 + } + /** + * Enum for Depth Data Quality Level. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enum DepthDataQualityLevel { /** - * Determine whether video mirror is supported. + * Depth data quality is bad. * - * @returns { boolean } Is video mirror supported. - * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 13 */ - isMirrorSupported(): boolean; + DEPTH_DATA_QUALITY_BAD = 0, /** - * Enable mirror for video capture. + * Depth data quality is fair. * - * @param { boolean } enabled - enable video mirror if TRUE. - * @throws { BusinessError } 202 - Not System Application. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400103 - Session not config. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since 12 + * @since 13 */ - enableMirror(enabled: boolean): void; + DEPTH_DATA_QUALITY_FAIR = 1, /** - * Get supported frame rates which can be set during session running. + * Depth data quality is good. * - * @returns { Array } The array of supported frame rate range. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 12 + * @systemapi + * @since 13 */ - getSupportedFrameRates(): Array + DEPTH_DATA_QUALITY_GOOD = 2 + } + /** + * Depth Profile. + * + * @interface DepthProfile + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface DepthProfile { /** - * Set a frame rate range. + * Depth data format. * - * @param { number } minFps - Minimum frame rate per second. - * @param { number } maxFps - Maximum frame rate per second. - * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. - * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. + * @type { CameraFormat } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 12 + * @systemapi + * @since 13 */ - setFrameRate(minFps: number, maxFps: number): void + readonly format: CameraFormat; /** - * Get active frame rate range which has been set before. + * Depth data accuracy. * - * @returns { FrameRateRange } The active frame rate range. + * @type { DepthDataAccuracy } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 12 + * @systemapi + * @since 13 */ - getActiveFrameRate(): FrameRateRange; + readonly dataAccuracy: DepthDataAccuracy; /** - * Subscribes frame start event callback. + * Depth data resolution. * - * @param { 'frameStart' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. + * @type { Size } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - on(type: 'frameStart', callback: AsyncCallback): void; + readonly size: Size; + } + /** + * Depth Data. + * + * @interface DepthData. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface DepthData { /** - * Unsubscribes from frame start event callback. + * Depth data format. * - * @param { 'frameStart' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. + * @type { CameraFormat } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - off(type: 'frameStart', callback?: AsyncCallback): void; + readonly format: CameraFormat; /** - * Subscribes frame end event callback. + * Depth data map. * - * @param { 'frameEnd' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. + * @type { image.PixelMap } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - on(type: 'frameEnd', callback: AsyncCallback): void; + readonly depthMap: image.PixelMap; /** - * Unsubscribes from frame end event callback. + * Depth data quality level. * - * @param { 'frameEnd' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. + * @type { DepthDataQualityLevel } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - off(type: 'frameEnd', callback?: AsyncCallback): void; + readonly qualityLevel: DepthDataQualityLevel; /** - * Subscribes to error events. + * Depth data accuracy. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @type { DepthDataAccuracy } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - on(type: 'error', callback: ErrorCallback): void; + readonly dataAccuracy: DepthDataAccuracy; /** - * Unsubscribes from error events. + * Release depth data object. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - off(type: 'error', callback?: ErrorCallback): void; + release(): Promise; } /** - * Metadata object type. + * Depth Data Output object * - * @enum { number } + * @extends CameraOutput + * @interface DepthDataOutput * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - enum MetadataObjectType { + interface DepthDataOutput extends CameraOutput { /** - * Face detection type. + * Start depth data output. * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - FACE_DETECTION = 0 - } + start(): Promise; - /** - * Rectangle definition. - * - * @typedef Rect - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - interface Rect { /** - * X coordinator of top left point. + * Stop depth data output. * - * @type { number } + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - topLeftX: number; + stop(): Promise; + /** - * Y coordinator of top left point. + * Subscribes to depth data objects available event callback. * - * @type { number } + * @param { 'depthDataAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the available DepthData objects. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - topLeftY: number; + on(type: 'depthDataAvailable', callback: AsyncCallback): void; + /** - * Width of this rectangle. + * Unsubscribes from depth data objects available event callback. * - * @type { number } + * @param { 'depthDataAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the available DepthData objects. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - width: number; + off(type: 'depthDataAvailable', callback?: AsyncCallback): void; + /** - * Height of this rectangle. + * Subscribes to error events. * - * @type { number } + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 13 */ - height: number; + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + off(type: 'error', callback?: ErrorCallback): void; } /** - * Metadata object basis. + * Depth Fusion Query object. * - * @typedef MetadataObject + * @interface DepthFusionQuery * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 14 */ - interface MetadataObject { - /** - * Metadata object type. - * - * @type { MetadataObjectType } - * @readonly - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - readonly type: MetadataObjectType; + interface DepthFusionQuery { /** - * Metadata object timestamp in milliseconds. + * Checks whether a depth fusion is supported. * - * @type { number } - * @readonly + * @returns { boolean } Is the depth fusion supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 14 */ - readonly timestamp: number; + isDepthFusionSupported(): boolean; + /** - * The axis-aligned bounding box of detected metadata object. + * Query the depth fusion threshold. * - * @type { Rect } - * @readonly + * @returns { Array } The depth fusion threshold. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 14 */ - readonly boundingBox: Rect; + getDepthFusionThreshold(): Array; } /** - * Metadata Output object + * Depth Fusion object. * - * @interface MetadataOutput + * @extends DepthFusionQuery + * @interface DepthFusion * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 14 */ - interface MetadataOutput extends CameraOutput { + interface DepthFusion extends DepthFusionQuery { /** - * Start output metadata + * Confirm if the depth fusion enabled. * - * @param { AsyncCallback } callback - Callback used to return the result. + * @returns { boolean } TRUE if the depth fusion is enable. + * @throws { BusinessError } 202 - Not System Application. * @throws { BusinessError } 7400103 - Session not config. - * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 14 */ - start(callback: AsyncCallback): void; + isDepthFusionEnabled(): boolean; /** - * Start output metadata + * Enable depth fusion. * - * @returns { Promise } Promise used to return the result. + * @param { boolean } enabled - Target state for depth fusion. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. * @throws { BusinessError } 7400103 - Session not config. * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 - */ - start(): Promise; - - /** - * Stop output metadata - * - * @param { AsyncCallback } callback - Callback used to return the result. - * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 14 */ - stop(callback: AsyncCallback): void; + enableDepthFusion(enabled: boolean): void; + } + /** + * Enum for color reservation type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + enum ColorReservationType { /** - * Stop output metadata + * None. * - * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 15 */ - stop(): Promise; + NONE = 0, /** - * Subscribes to metadata objects available event callback. + * Portrait color reservation. * - * @param { 'metadataObjectsAvailable' } type - Event type. - * @param { AsyncCallback> } callback - Callback used to get the available metadata objects. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 15 */ - on(type: 'metadataObjectsAvailable', callback: AsyncCallback>): void; + PORTRAIT = 1 + } + /** + * Color Reservation Query object. + * + * @interface ColorReservationQuery + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + interface ColorReservationQuery { /** - * Unsubscribes from metadata objects available event callback. + * Gets supported color reservation types. * - * @param { 'metadataObjectsAvailable' } type - Event type. - * @param { AsyncCallback> } callback - Callback used to get the available metadata objects. + * @returns { Array } Array of supported color reservation types. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 15 */ - off(type: 'metadataObjectsAvailable', callback?: AsyncCallback>): void; + getSupportedColorReservationTypes(): Array; + } + /** + * Color Reservation object. + * + * @extends ColorReservationQuery + * @interface ColorReservation + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 15 + */ + interface ColorReservation extends ColorReservationQuery { /** - * Subscribes to error events. + * Gets the current color reservation type. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @returns { ColorReservationType } The current color reservation type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 15 */ - on(type: 'error', callback: ErrorCallback): void; + getColorReservation(): ColorReservationType; /** - * Unsubscribes from error events. + * Sets the color reservation type. * - * @param { 'error' } type - Event type. - * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @param { ColorReservationType } type - The color reservation type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 10 + * @systemapi + * @since 15 */ - off(type: 'error', callback?: ErrorCallback): void; + setColorReservation(type: ColorReservationType): void; } } -- Gitee