1/* 2* Copyright (C) 2024 Huawei Device Co., Ltd. 3* Licensed under the Apache License, Version 2.0 (the "License"); 4* you may not use this file except in compliance with the License. 5* You may obtain a copy of the License at 6* 7* http://www.apache.org/licenses/LICENSE-2.0 8* 9* Unless required by applicable law or agreed to in writing, software 10* distributed under the License is distributed on an "AS IS" BASIS, 11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12* See the License for the specific language governing permissions and 13* limitations under the License. 14*/ 15 16/** 17* @file 18* @kit CameraKit 19*/ 20 21import { ErrorCallback, AsyncCallback } from './@ohos.base'; 22import type Context from './application/BaseContext'; 23import image from './@ohos.multimedia.image'; 24import type colorSpaceManager from './@ohos.graphics.colorSpaceManager'; 25import photoAccessHelper from './@ohos.file.photoAccessHelper'; 26 27/** 28* @namespace camera 29* @syscap SystemCapability.Multimedia.Camera.Core 30* @since 10 31*/ 32/** 33* @namespace camera 34* @syscap SystemCapability.Multimedia.Camera.Core 35* @atomicservice 36* @since 12 37*/ 38declare namespace camera { 39/** 40* Creates a CameraManager instance. 41* 42* @param { Context } context - Current application context. 43* @returns { CameraManager } CameraManager instance. 44* @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 45* @throws { BusinessError } 7400201 - Camera service fatal error. 46* @syscap SystemCapability.Multimedia.Camera.Core 47* @since 10 48*/ 49function getCameraManager(context: Context): CameraManager; 50 51 /** 52 * Enum for camera status. 53 * 54 * @enum { number } 55 * @syscap SystemCapability.Multimedia.Camera.Core 56 * @since 10 57 */ 58 enum CameraStatus { 59 /** 60 * Appear status. 61 * 62 * @syscap SystemCapability.Multimedia.Camera.Core 63 * @since 10 64 */ 65 CAMERA_STATUS_APPEAR = 0, 66 67 /** 68 * Disappear status. 69 * 70 * @syscap SystemCapability.Multimedia.Camera.Core 71 * @since 10 72 */ 73 CAMERA_STATUS_DISAPPEAR = 1, 74 75 /** 76 * Available status. 77 * 78 * @syscap SystemCapability.Multimedia.Camera.Core 79 * @since 10 80 */ 81 CAMERA_STATUS_AVAILABLE = 2, 82 83 /** 84 * Unavailable status. 85 * 86 * @syscap SystemCapability.Multimedia.Camera.Core 87 * @since 10 88 */ 89 CAMERA_STATUS_UNAVAILABLE = 3 90 } 91 92 /** 93 * Enum for fold status. 94 * 95 * @enum { number } 96 * @syscap SystemCapability.Multimedia.Camera.Core 97 * @since 12 98 */ 99 enum FoldStatus { 100 /** 101 * Non-foldable status. 102 * 103 * @syscap SystemCapability.Multimedia.Camera.Core 104 * @since 12 105 */ 106 NON_FOLDABLE = 0, 107 108 /** 109 * Expanded status. 110 * 111 * @syscap SystemCapability.Multimedia.Camera.Core 112 * @since 12 113 */ 114 EXPANDED = 1, 115 116 /** 117 * Folded status. 118 * 119 * @syscap SystemCapability.Multimedia.Camera.Core 120 * @since 12 121 */ 122 FOLDED = 2 123 } 124 125 /** 126 * Profile for camera streams. 127 * 128 * @typedef Profile 129 * @syscap SystemCapability.Multimedia.Camera.Core 130 * @since 10 131 */ 132 interface Profile { 133 /** 134 * Camera format. 135 * 136 * @type { CameraFormat } 137 * @readonly 138 * @syscap SystemCapability.Multimedia.Camera.Core 139 * @since 10 140 */ 141 readonly format: CameraFormat; 142 143 /** 144 * Picture size. 145 * 146 * @type { Size } 147 * @readonly 148 * @syscap SystemCapability.Multimedia.Camera.Core 149 * @since 10 150 */ 151 readonly size: Size; 152 } 153 154 /** 155 * Frame rate range. 156 * 157 * @typedef FrameRateRange 158 * @syscap SystemCapability.Multimedia.Camera.Core 159 * @since 10 160 */ 161 interface FrameRateRange { 162 /** 163 * Min frame rate. 164 * 165 * @type { number } 166 * @readonly 167 * @syscap SystemCapability.Multimedia.Camera.Core 168 * @since 10 169 */ 170 readonly min: number; 171 172 /** 173 * Max frame rate. 174 * 175 * @type { number } 176 * @readonly 177 * @syscap SystemCapability.Multimedia.Camera.Core 178 * @since 10 179 */ 180 readonly max: number; 181 } 182 183 /** 184 * Video profile. 185 * 186 * @typedef VideoProfile 187 * @syscap SystemCapability.Multimedia.Camera.Core 188 * @since 10 189 */ 190 interface VideoProfile extends Profile { 191 /** 192 * Frame rate in unit fps (frames per second). 193 * 194 * @type { FrameRateRange } 195 * @readonly 196 * @syscap SystemCapability.Multimedia.Camera.Core 197 * @since 10 198 */ 199 readonly frameRateRange: FrameRateRange; 200 } 201 202 /** 203 * Camera output capability. 204 * 205 * @typedef CameraOutputCapability 206 * @syscap SystemCapability.Multimedia.Camera.Core 207 * @since 10 208 */ 209 interface CameraOutputCapability { 210 /** 211 * Preview profiles. 212 * 213 * @type { Array<Profile> } 214 * @readonly 215 * @syscap SystemCapability.Multimedia.Camera.Core 216 * @since 10 217 */ 218 readonly previewProfiles: Array<Profile>; 219 220 /** 221 * Photo profiles. 222 * 223 * @type { Array<Profile> } 224 * @readonly 225 * @syscap SystemCapability.Multimedia.Camera.Core 226 * @since 10 227 */ 228 readonly photoProfiles: Array<Profile>; 229 230 /** 231 * Video profiles. 232 * 233 * @type { Array<VideoProfile> } 234 * @readonly 235 * @syscap SystemCapability.Multimedia.Camera.Core 236 * @since 10 237 */ 238 readonly videoProfiles: Array<VideoProfile>; 239 240 /** 241 * Depth profiles. 242 * 243 * @type { Array<DepthProfile> } 244 * @readonly 245 * @syscap SystemCapability.Multimedia.Camera.Core 246 * @systemapi 247 * @since 13 248 */ 249 readonly depthProfiles: Array<DepthProfile>; 250 251 /** 252 * All the supported metadata Object Types. 253 * 254 * @type { Array<MetadataObjectType> } 255 * @readonly 256 * @syscap SystemCapability.Multimedia.Camera.Core 257 * @since 10 258 */ 259 readonly supportedMetadataObjectTypes: Array<MetadataObjectType>; 260 } 261 262 /** 263 * Enum for camera error code. 264 * 265 * @enum { number } 266 * @syscap SystemCapability.Multimedia.Camera.Core 267 * @since 10 268 */ 269 enum CameraErrorCode { 270 /** 271 * Parameter missing or parameter type incorrect. 272 * 273 * @syscap SystemCapability.Multimedia.Camera.Core 274 * @since 10 275 */ 276 INVALID_ARGUMENT = 7400101, 277 278 /** 279 * Operation not allowed. 280 * 281 * @syscap SystemCapability.Multimedia.Camera.Core 282 * @since 10 283 */ 284 OPERATION_NOT_ALLOWED = 7400102, 285 286 /** 287 * Session not config. 288 * 289 * @syscap SystemCapability.Multimedia.Camera.Core 290 * @since 10 291 */ 292 SESSION_NOT_CONFIG = 7400103, 293 294 /** 295 * Session not running. 296 * 297 * @syscap SystemCapability.Multimedia.Camera.Core 298 * @since 10 299 */ 300 SESSION_NOT_RUNNING = 7400104, 301 302 /** 303 * Session config locked. 304 * 305 * @syscap SystemCapability.Multimedia.Camera.Core 306 * @since 10 307 */ 308 SESSION_CONFIG_LOCKED = 7400105, 309 310 /** 311 * Device setting locked. 312 * 313 * @syscap SystemCapability.Multimedia.Camera.Core 314 * @since 10 315 */ 316 DEVICE_SETTING_LOCKED = 7400106, 317 318 /** 319 * Can not use camera cause of conflict. 320 * 321 * @syscap SystemCapability.Multimedia.Camera.Core 322 * @since 10 323 */ 324 CONFLICT_CAMERA = 7400107, 325 326 /** 327 * Camera disabled cause of security reason. 328 * 329 * @syscap SystemCapability.Multimedia.Camera.Core 330 * @since 10 331 */ 332 DEVICE_DISABLED = 7400108, 333 334 /** 335 * Can not use camera cause of preempted. 336 * 337 * @syscap SystemCapability.Multimedia.Camera.Core 338 * @since 10 339 */ 340 DEVICE_PREEMPTED = 7400109, 341 342 /** 343 * Unresolved conflicts with current configurations. 344 * 345 * @syscap SystemCapability.Multimedia.Camera.Core 346 * @since 12 347 */ 348 UNRESOLVED_CONFLICTS_WITH_CURRENT_CONFIGURATIONS = 7400110, 349 350 /** 351 * Camera service fatal error. 352 * 353 * @syscap SystemCapability.Multimedia.Camera.Core 354 * @since 10 355 */ 356 SERVICE_FATAL_ERROR = 7400201 357 } 358 359 /** 360 * Enum for restore parameter. 361 * 362 * @enum { number } 363 * @syscap SystemCapability.Multimedia.Camera.Core 364 * @systemapi 365 * @since 11 366 */ 367 enum RestoreParamType { 368 /** 369 * No need set restore Stream Parameter, only prelaunch camera device. 370 * 371 * @syscap SystemCapability.Multimedia.Camera.Core 372 * @systemapi 373 * @since 11 374 */ 375 NO_NEED_RESTORE_PARAM = 0, 376 377 /** 378 * Presistent default parameter, long-lasting effect after T minutes. 379 * 380 * @syscap SystemCapability.Multimedia.Camera.Core 381 * @systemapi 382 * @since 11 383 */ 384 PRESISTENT_DEFAULT_PARAM = 1, 385 386 /** 387 * Transient active parameter, which has a higher priority than PRESISTENT_DEFAULT_PARAM when both exist. 388 * 389 * @syscap SystemCapability.Multimedia.Camera.Core 390 * @systemapi 391 * @since 11 392 */ 393 TRANSIENT_ACTIVE_PARAM = 2 394 } 395 396 /** 397 * Setting parameter for stream. 398 * 399 * @typedef SettingParam 400 * @syscap SystemCapability.Multimedia.Camera.Core 401 * @systemapi 402 * @since 11 403 */ 404 interface SettingParam { 405 /** 406 * Skin smooth level value for restore. 407 * 408 * @type { number } 409 * @syscap SystemCapability.Multimedia.Camera.Core 410 * @systemapi 411 * @since 11 412 */ 413 skinSmoothLevel: number; 414 415 /** 416 * Face slender value for restore. 417 * 418 * @type { number } 419 * @syscap SystemCapability.Multimedia.Camera.Core 420 * @systemapi 421 * @since 11 422 */ 423 faceSlender: number; 424 425 /** 426 * Skin tone value for restore. 427 * 428 * @type { number } 429 * @syscap SystemCapability.Multimedia.Camera.Core 430 * @systemapi 431 * @since 11 432 */ 433 skinTone: number; 434 } 435 436 /** 437 * Prelaunch config object. 438 * 439 * @typedef PrelaunchConfig 440 * @syscap SystemCapability.Multimedia.Camera.Core 441 * @systemapi 442 * @since 10 443 */ 444 interface PrelaunchConfig { 445 /** 446 * Camera instance. 447 * 448 * @type { CameraDevice } 449 * @syscap SystemCapability.Multimedia.Camera.Core 450 * @systemapi 451 * @since 10 452 */ 453 cameraDevice: CameraDevice; 454 455 /** 456 * Restore parameter type. 457 * 458 * @type { ?RestoreParamType } 459 * @syscap SystemCapability.Multimedia.Camera.Core 460 * @systemapi 461 * @since 11 462 */ 463 restoreParamType?: RestoreParamType; 464 465 /** 466 * Begin active time. 467 * 468 * @type { ?number } 469 * @syscap SystemCapability.Multimedia.Camera.Core 470 * @systemapi 471 * @since 11 472 */ 473 activeTime?: number; 474 475 /** 476 * Setting parameter. 477 * 478 * @type { ?SettingParam } 479 * @syscap SystemCapability.Multimedia.Camera.Core 480 * @systemapi 481 * @since 11 482 */ 483 settingParam?: SettingParam; 484 } 485 486 /** 487 * Camera manager object. 488 * 489 * @interface CameraManager 490 * @syscap SystemCapability.Multimedia.Camera.Core 491 * @since 10 492 */ 493 interface CameraManager { 494 /** 495 * Gets supported camera descriptions. 496 * 497 * @returns { Array<CameraDevice> } An array of supported cameras. 498 * @syscap SystemCapability.Multimedia.Camera.Core 499 * @since 10 500 */ 501 getSupportedCameras(): Array<CameraDevice>; 502 503 /** 504 * Gets supported output capability for specific camera. 505 * 506 * @param { CameraDevice } camera - Camera device. 507 * @returns { CameraOutputCapability } The camera output capability. 508 * @syscap SystemCapability.Multimedia.Camera.Core 509 * @since 10 510 * @deprecated since 11 511 * @useinstead ohos.multimedia.camera.CameraManager#getSupportedOutputCapability 512 */ 513 getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability; 514 515 /** 516 * Gets supported scene mode for specific camera. 517 * 518 * @param { CameraDevice } camera - Camera device. 519 * @returns { Array<SceneMode> } An array of supported scene mode of camera. 520 * @syscap SystemCapability.Multimedia.Camera.Core 521 * @since 11 522 */ 523 getSupportedSceneModes(camera: CameraDevice): Array<SceneMode>; 524 525 /** 526 * Gets supported output capability for specific camera. 527 * 528 * @param { CameraDevice } camera - Camera device. 529 * @param { SceneMode } mode - Scene mode. 530 * @returns { CameraOutputCapability } The camera output capability. 531 * @syscap SystemCapability.Multimedia.Camera.Core 532 * @since 11 533 */ 534 getSupportedOutputCapability(camera: CameraDevice, mode: SceneMode): CameraOutputCapability; 535 536 /** 537 * Determine whether camera is muted. 538 * 539 * @returns { boolean } Is camera muted. 540 * @syscap SystemCapability.Multimedia.Camera.Core 541 * @since 10 542 */ 543 isCameraMuted(): boolean; 544 545 /** 546 * Determine whether camera mute is supported. 547 * 548 * @returns { boolean } Is camera mute supported. 549 * @syscap SystemCapability.Multimedia.Camera.Core 550 * @systemapi 551 * @since 10 552 */ 553 /** 554 * Determine whether camera mute is supported. 555 * 556 * @returns { boolean } Is camera mute supported. 557 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 558 * @syscap SystemCapability.Multimedia.Camera.Core 559 * @systemapi 560 * @since 13 561 */ 562 isCameraMuteSupported(): boolean; 563 564 /** 565 * Mute camera. 566 * 567 * @param { boolean } mute - Mute camera if TRUE, otherwise unmute camera. 568 * @syscap SystemCapability.Multimedia.Camera.Core 569 * @systemapi 570 * @since 10 571 * @deprecated since 12 572 * @useinstead ohos.multimedia.camera.CameraManager#muteCameraPersistent 573 */ 574 muteCamera(mute: boolean): void; 575 576 /** 577 * Mutes or unmutes camera for persistence purpose. 578 * 579 * @permission ohos.camera.CAMERA_CONTROL 580 * @param { boolean } mute - Mute camera if TRUE, otherwise unmute camera. 581 * @param { PolicyType } type - Type for indicating the calling role. 582 * @throws { BusinessError } 201 - Permission denied. 583 * @throws { BusinessError } 202 - Not System Application. 584 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 585 * @syscap SystemCapability.Multimedia.Camera.Core 586 * @systemapi 587 * @since 12 588 */ 589 muteCameraPersistent(mute: boolean, type: PolicyType): void; 590 591 /** 592 * Creates a CameraInput instance by camera. 593 * 594 * @permission ohos.permission.CAMERA 595 * @param { CameraDevice } camera - Camera device used to create the instance. 596 * @returns { CameraInput } The CameraInput instance. 597 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 598 * @syscap SystemCapability.Multimedia.Camera.Core 599 * @since 10 600 */ 601 /** 602 * Creates a CameraInput instance by camera. 603 * 604 * @permission ohos.permission.CAMERA 605 * @param { CameraDevice } camera - Camera device used to create the instance. 606 * @returns { CameraInput } The CameraInput instance. 607 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 608 * @throws { BusinessError } 7400102 - Operation not allowed. 609 * @throws { BusinessError } 7400201 - Camera service fatal error. 610 * @syscap SystemCapability.Multimedia.Camera.Core 611 * @since 12 612 */ 613 createCameraInput(camera: CameraDevice): CameraInput; 614 615 /** 616 * Creates a CameraInput instance by camera position and type. 617 * 618 * @permission ohos.permission.CAMERA 619 * @param { CameraPosition } position - Target camera position. 620 * @param { CameraType } type - Target camera type. 621 * @returns { CameraInput } The CameraInput instance. 622 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 623 * @syscap SystemCapability.Multimedia.Camera.Core 624 * @since 10 625 */ 626 /** 627 * Creates a CameraInput instance by camera position and type. 628 * 629 * @permission ohos.permission.CAMERA 630 * @param { CameraPosition } position - Target camera position. 631 * @param { CameraType } type - Target camera type. 632 * @returns { CameraInput } The CameraInput instance. 633 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 634 * @throws { BusinessError } 7400102 - Operation not allowed. 635 * @throws { BusinessError } 7400201 - Camera service fatal error. 636 * @syscap SystemCapability.Multimedia.Camera.Core 637 * @since 12 638 */ 639 createCameraInput(position: CameraPosition, type: CameraType): CameraInput; 640 641 /** 642 * Creates a PreviewOutput instance. 643 * 644 * @param { Profile } profile - Preview output profile. 645 * @param { string } surfaceId - Surface object id used in camera photo output. 646 * @returns { PreviewOutput } The PreviewOutput instance. 647 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 648 * @syscap SystemCapability.Multimedia.Camera.Core 649 * @since 10 650 */ 651 /** 652 * Creates a PreviewOutput instance. 653 * 654 * @param { Profile } profile - Preview output profile. 655 * @param { string } surfaceId - Surface object id used in camera photo output. 656 * @returns { PreviewOutput } The PreviewOutput instance. 657 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 658 * @throws { BusinessError } 7400201 - Camera service fatal error. 659 * @syscap SystemCapability.Multimedia.Camera.Core 660 * @since 12 661 */ 662 createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput; 663 664 /** 665 * Creates a PreviewOutput instance without profile. 666 * You can use this method to create a preview output instance without a profile, This instance can 667 * only be used in a preconfiged session. 668 * 669 * @param { string } surfaceId - Surface object id used in camera preview output. 670 * @returns { PreviewOutput } The PreviewOutput instance. 671 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 672 * @throws { BusinessError } 7400201 - Camera service fatal error. 673 * @syscap SystemCapability.Multimedia.Camera.Core 674 * @since 12 675 */ 676 createPreviewOutput(surfaceId: string): PreviewOutput; 677 678 /** 679 * Creates a PhotoOutput instance. 680 * 681 * @param { Profile } profile - Photo output profile. 682 * @param { string } surfaceId - Surface object id used in camera photo output. 683 * @returns { PhotoOutput } The PhotoOutput instance. 684 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 685 * @syscap SystemCapability.Multimedia.Camera.Core 686 * @since 10 687 * @deprecated since 11 688 * @useinstead ohos.multimedia.camera.CameraManager#createPhotoOutput 689 */ 690 createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput; 691 692 /** 693 * Creates a PhotoOutput instance without surfaceId. 694 * Call PhotoOutput capture interface will give a callback, 695 * {@link on(type: 'photoAvailable', callback: AsyncCallback<Photo>)} 696 * 697 * @param { Profile } profile - Photo output profile. 698 * @returns { PhotoOutput } The PhotoOutput instance. 699 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 700 * @syscap SystemCapability.Multimedia.Camera.Core 701 * @since 11 702 */ 703 /** 704 * Creates a PhotoOutput instance without surfaceId. 705 * Call PhotoOutput capture interface will give a callback, 706 * {@link on(type: 'photoAvailable', callback: AsyncCallback<Photo>)} 707 * You can use this method to create a photo output instance without a profile, This instance can 708 * only be used in a preconfiged session. 709 * 710 * @param { Profile } profile - Photo output profile. 711 * @returns { PhotoOutput } The PhotoOutput instance. 712 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 713 * @throws { BusinessError } 7400201 - Camera service fatal error. 714 * @syscap SystemCapability.Multimedia.Camera.Core 715 * @since 12 716 */ 717 createPhotoOutput(profile?: Profile): PhotoOutput; 718 719 /** 720 * Creates a VideoOutput instance. 721 * 722 * @param { VideoProfile } profile - Video profile. 723 * @param { string } surfaceId - Surface object id used in camera video output. 724 * @returns { VideoOutput } The VideoOutput instance. 725 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 726 * @syscap SystemCapability.Multimedia.Camera.Core 727 * @since 10 728 */ 729 /** 730 * Creates a VideoOutput instance. 731 * 732 * @param { VideoProfile } profile - Video profile. 733 * @param { string } surfaceId - Surface object id used in camera video output. 734 * @returns { VideoOutput } The VideoOutput instance. 735 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 736 * @throws { BusinessError } 7400201 - Camera service fatal error. 737 * @syscap SystemCapability.Multimedia.Camera.Core 738 * @since 12 739 */ 740 createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput; 741 742 /** 743 * Creates a VideoOutput instance without profile. 744 * You can use this method to create a video output instance without a profile, This instance can 745 * only be used in a preconfiged session. 746 * 747 * @param { string } surfaceId - Surface object id used in camera video output. 748 * @returns { VideoOutput } The VideoOutput instance. 749 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 750 * @throws { BusinessError } 7400201 - Camera service fatal error. 751 * @syscap SystemCapability.Multimedia.Camera.Core 752 * @since 12 753 */ 754 createVideoOutput(surfaceId: string): VideoOutput; 755 756 /** 757 * Creates a MetadataOutput instance. 758 * 759 * @param { Array<MetadataObjectType> } metadataObjectTypes - Array of MetadataObjectType. 760 * @returns { MetadataOutput } The MetadataOutput instance. 761 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 762 * @syscap SystemCapability.Multimedia.Camera.Core 763 * @since 10 764 */ 765 /** 766 * Creates a MetadataOutput instance. 767 * 768 * @param { Array<MetadataObjectType> } metadataObjectTypes - Array of MetadataObjectType. 769 * @returns { MetadataOutput } The MetadataOutput instance. 770 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 771 * @throws { BusinessError } 7400201 - Camera service fatal error. 772 * @syscap SystemCapability.Multimedia.Camera.Core 773 * @since 12 774 */ 775 createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): MetadataOutput; 776 777 /** 778 * Creates a DepthDataOutput instance. 779 * 780 * @param { DepthProfile } profile - Depth data profile. 781 * @returns { DepthDataOutput } The DepthDataOutput instance. 782 * @throws { BusinessError } 202 - Not System Application. 783 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 784 * @syscap SystemCapability.Multimedia.Camera.Core 785 * @systemapi 786 * @since 13 787 */ 788 createDepthDataOutput(profile: DepthProfile): DepthDataOutput; 789 790 /** 791 * Gets a CaptureSession instance. 792 * 793 * @returns { CaptureSession } The CaptureSession instance. 794 * @throws { BusinessError } 7400201 - Camera service fatal error. 795 * @syscap SystemCapability.Multimedia.Camera.Core 796 * @since 10 797 * @deprecated since 11 798 * @useinstead ohos.multimedia.camera.CameraManager#createSession 799 */ 800 createCaptureSession(): CaptureSession; 801 802 /** 803 * Gets a Session instance by specific scene mode. 804 * 805 * @param { SceneMode } mode - Scene mode. 806 * @returns { T } The specific Session instance by specific scene mode. 807 * @throws { BusinessError } 401 - Parameter error. Possible causes: 808 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 809 * 3. Parameter verification failed. 810 * @throws { BusinessError } 7400201 - Camera service fatal error. 811 * @syscap SystemCapability.Multimedia.Camera.Core 812 * @since 11 813 */ 814 createSession<T extends Session>(mode: SceneMode): T; 815 816 /** 817 * Subscribes camera status change event callback. 818 * 819 * @param { 'cameraStatus' } type - Event type. 820 * @param { AsyncCallback<CameraStatusInfo> } callback - Callback used to get the camera status change. 821 * @syscap SystemCapability.Multimedia.Camera.Core 822 * @since 10 823 */ 824 on(type: 'cameraStatus', callback: AsyncCallback<CameraStatusInfo>): void; 825 826 /** 827 * Unsubscribes from camera status change event callback. 828 * 829 * @param { 'cameraStatus' } type - Event type. 830 * @param { AsyncCallback<CameraStatusInfo> } callback - Callback used to get the camera status change. 831 * @syscap SystemCapability.Multimedia.Camera.Core 832 * @since 10 833 */ 834 off(type: 'cameraStatus', callback?: AsyncCallback<CameraStatusInfo>): void; 835 836 /** 837 * Subscribes fold status change event callback. 838 * 839 * @param { 'foldStatusChanged' } type - Event type. 840 * @param { AsyncCallback<FoldStatusInfo> } callback - Callback used to get the fold status change. 841 * @syscap SystemCapability.Multimedia.Camera.Core 842 * @since 12 843 */ 844 on(type: 'foldStatusChange', callback: AsyncCallback<FoldStatusInfo>): void; 845 846 /** 847 * Unsubscribes from fold status change event callback. 848 * 849 * @param { 'foldStatusChanged' } type - Event type. 850 * @param { AsyncCallback<FoldStatusInfo> } callback - Callback used to get the fold status change. 851 * @syscap SystemCapability.Multimedia.Camera.Core 852 * @since 12 853 */ 854 off(type: 'foldStatusChange', callback?: AsyncCallback<FoldStatusInfo>): void; 855 856 /** 857 * Subscribes camera mute change event callback. 858 * 859 * @param { 'cameraMute' } type - Event type. 860 * @param { AsyncCallback<boolean> } callback - Callback used to get the camera mute change. 861 * @syscap SystemCapability.Multimedia.Camera.Core 862 * @systemapi 863 * @since 10 864 */ 865 /** 866 * Subscribes camera mute change event callback. 867 * 868 * @param { 'cameraMute' } type - Event type. 869 * @param { AsyncCallback<boolean> } callback - Callback used to get the camera mute change. 870 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 871 * @syscap SystemCapability.Multimedia.Camera.Core 872 * @systemapi 873 * @since 13 874 */ 875 on(type: 'cameraMute', callback: AsyncCallback<boolean>): void; 876 877 /** 878 * Unsubscribes from camera mute change event callback. 879 * 880 * @param { 'cameraMute' } type - Event type. 881 * @param { AsyncCallback<boolean> } callback - Callback used to get the camera mute change. 882 * @syscap SystemCapability.Multimedia.Camera.Core 883 * @systemapi 884 * @since 10 885 */ 886 /** 887 * Unsubscribes from camera mute change event callback. 888 * 889 * @param { 'cameraMute' } type - Event type. 890 * @param { AsyncCallback<boolean> } callback - Callback used to get the camera mute change. 891 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 892 * @syscap SystemCapability.Multimedia.Camera.Core 893 * @systemapi 894 * @since 13 895 */ 896 off(type: 'cameraMute', callback?: AsyncCallback<boolean>): void; 897 898 /** 899 * Determines whether the camera device supports prelaunch. 900 * This function must be called in prior to the setPrelaunchConfig and prelaunch functions. 901 * 902 * @param { CameraDevice } camera - Camera device. 903 * @returns { boolean } Whether prelaunch is supported. 904 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 905 * @syscap SystemCapability.Multimedia.Camera.Core 906 * @systemapi 907 * @since 10 908 */ 909 /** 910 * Determines whether the camera device supports prelaunch. 911 * This function must be called in prior to the setPrelaunchConfig and prelaunch functions. 912 * 913 * @param { CameraDevice } camera - Camera device. 914 * @returns { boolean } Whether prelaunch is supported. 915 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 916 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 917 * @syscap SystemCapability.Multimedia.Camera.Core 918 * @systemapi 919 * @since 12 920 */ 921 isPrelaunchSupported(camera: CameraDevice): boolean; 922 923 /** 924 * Sets the camera prelaunch configuration. 925 * The configuration is sent to the camera service when you exit the camera or change the configuration next time. 926 * 927 * @permission ohos.permission.CAMERA 928 * @param { PrelaunchConfig } prelaunchConfig - Prelaunch configuration info. 929 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 930 * @throws { BusinessError } 7400102 - Operation not allowed. 931 * @syscap SystemCapability.Multimedia.Camera.Core 932 * @systemapi 933 * @since 10 934 */ 935 /** 936 * Sets the camera prelaunch configuration. 937 * The configuration is sent to the camera service when you exit the camera or change the configuration next time. 938 * 939 * @permission ohos.permission.CAMERA 940 * @param { PrelaunchConfig } prelaunchConfig - Prelaunch configuration info. 941 * @throws { BusinessError } 202 - Not System Application. 942 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 943 * @throws { BusinessError } 7400102 - Operation not allowed. 944 * @throws { BusinessError } 7400201 - Camera service fatal error. 945 * @syscap SystemCapability.Multimedia.Camera.Core 946 * @systemapi 947 * @since 12 948 */ 949 setPrelaunchConfig(prelaunchConfig: PrelaunchConfig): void; 950 951 /** 952 * Enable the camera to prelaunch and start. 953 * This function is called when the user clicks the system camera icon to start the camera application. 954 * 955 * @syscap SystemCapability.Multimedia.Camera.Core 956 * @systemapi 957 * @since 10 958 */ 959 /** 960 * Enable the camera to prelaunch and start. 961 * This function is called when the user clicks the system camera icon to start the camera application. 962 * 963 * @throws { BusinessError } 202 - Not System Application. 964 * @syscap SystemCapability.Multimedia.Camera.Core 965 * @systemapi 966 * @since 13 967 */ 968 prelaunch(): void; 969 970 /** 971 * Prepare the camera resources. 972 * This function is called when the user touch down the camera switch icon in camera application. 973 * 974 * @param { string } cameraId - The camera to prepare. 975 * @throws { BusinessError } 202 - Not System Application. 976 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 977 * @syscap SystemCapability.Multimedia.Camera.Core 978 * @systemapi 979 * @since 11 980 */ 981 /** 982 * Prepare the camera resources. 983 * This function is called when the user touch down the camera switch icon in camera application. 984 * 985 * @param { string } cameraId - The camera to prepare. 986 * @throws { BusinessError } 202 - Not System Application. 987 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 988 * @throws { BusinessError } 7400201 - Camera service fatal error. 989 * @syscap SystemCapability.Multimedia.Camera.Core 990 * @systemapi 991 * @since 12 992 */ 993 preSwitchCamera(cameraId: string): void; 994 995 /** 996 * Creates a deferred PreviewOutput instance. 997 * 998 * @param { Profile } profile - Preview output profile. 999 * @returns { PreviewOutput } the PreviewOutput instance. 1000 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1001 * @syscap SystemCapability.Multimedia.Camera.Core 1002 * @systemapi 1003 * @since 10 1004 */ 1005 /** 1006 * Creates a deferred PreviewOutput instance. 1007 * You can use the method to create deferred preview output without profile, then you must add this output 1008 * to a session which already preconfiged. 1009 * 1010 * @param { Profile } profile - Preview output profile. 1011 * @returns { PreviewOutput } the PreviewOutput instance. 1012 * @throws { BusinessError } 202 - Not System Application. 1013 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1014 * @syscap SystemCapability.Multimedia.Camera.Core 1015 * @systemapi 1016 * @since 12 1017 */ 1018 createDeferredPreviewOutput(profile?: Profile): PreviewOutput; 1019 1020 /** 1021 * Check if the device has a torch. 1022 * 1023 * @returns { boolean } this value that specifies whether the device has a torch. 1024 * @syscap SystemCapability.Multimedia.Camera.Core 1025 * @since 11 1026 */ 1027 isTorchSupported(): boolean; 1028 1029 /** 1030 * Check if a specifies torch mode is supported. 1031 * @param { TorchMode } mode - torch mode. 1032 * @returns { boolean } is torch mode supported. 1033 * @syscap SystemCapability.Multimedia.Camera.Core 1034 * @since 11 1035 */ 1036 isTorchModeSupported(mode: TorchMode): boolean; 1037 1038 /** 1039 * Get current torch mode. 1040 * 1041 * @returns { TorchMode } torch mode. 1042 * @syscap SystemCapability.Multimedia.Camera.Core 1043 * @since 11 1044 */ 1045 getTorchMode(): TorchMode; 1046 1047 /** 1048 * Set torch mode to the device. 1049 * 1050 * @param { TorchMode } mode - torch mode. 1051 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1052 * @syscap SystemCapability.Multimedia.Camera.Core 1053 * @since 11 1054 */ 1055 /** 1056 * Set torch mode to the device. 1057 * 1058 * @param { TorchMode } mode - torch mode. 1059 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1060 * @throws { BusinessError } 7400102 - Operation not allowed. 1061 * @throws { BusinessError } 7400201 - Camera service fatal error. 1062 * @syscap SystemCapability.Multimedia.Camera.Core 1063 * @since 12 1064 */ 1065 setTorchMode(mode: TorchMode): void; 1066 1067 /** 1068 * Subscribes torch status change event callback. 1069 * 1070 * @param { 'torchStatusChange' } type - Event type 1071 * @param { AsyncCallback<TorchStatusInfo> } callback - Callback used to return the torch status change 1072 * @syscap SystemCapability.Multimedia.Camera.Core 1073 * @since 11 1074 */ 1075 on(type: 'torchStatusChange', callback: AsyncCallback<TorchStatusInfo>): void; 1076 1077 /** 1078 * Unsubscribes torch status change event callback. 1079 * 1080 * @param { 'torchStatusChange' } type - Event type 1081 * @param { AsyncCallback<TorchStatusInfo> } callback - Callback used to return the torch status change 1082 * @syscap SystemCapability.Multimedia.Camera.Core 1083 * @since 11 1084 */ 1085 off(type: 'torchStatusChange', callback?: AsyncCallback<TorchStatusInfo>): void; 1086 } 1087 1088 /** 1089 * Torch status info. 1090 * 1091 * @typedef TorchStatusInfo 1092 * @syscap SystemCapability.Multimedia.Camera.Core 1093 * @since 11 1094 */ 1095 interface TorchStatusInfo { 1096 /** 1097 * is torch available 1098 * 1099 * @type { boolean } 1100 * @readonly 1101 * @syscap SystemCapability.Multimedia.Camera.Core 1102 * @since 11 1103 */ 1104 readonly isTorchAvailable: boolean; 1105 1106 /** 1107 * is torch active 1108 * 1109 * @type { boolean } 1110 * @readonly 1111 * @syscap SystemCapability.Multimedia.Camera.Core 1112 * @since 11 1113 */ 1114 readonly isTorchActive: boolean; 1115 1116 /** 1117 * the current torch brightness level. 1118 * 1119 * @type { number } 1120 * @readonly 1121 * @syscap SystemCapability.Multimedia.Camera.Core 1122 * @since 11 1123 */ 1124 readonly torchLevel: number; 1125 } 1126 1127 /** 1128 * Enum for torch mode. 1129 * 1130 * @enum { number } 1131 * @syscap SystemCapability.Multimedia.Camera.Core 1132 * @since 11 1133 */ 1134 enum TorchMode { 1135 /** 1136 * The device torch is always off. 1137 * 1138 * @syscap SystemCapability.Multimedia.Camera.Core 1139 * @since 11 1140 */ 1141 OFF = 0, 1142 1143 /** 1144 * The device torch is always on. 1145 * 1146 * @syscap SystemCapability.Multimedia.Camera.Core 1147 * @since 11 1148 */ 1149 ON = 1, 1150 1151 /** 1152 * The device continuously monitors light levels and uses the torch when necessary. 1153 * 1154 * @syscap SystemCapability.Multimedia.Camera.Core 1155 * @since 11 1156 */ 1157 AUTO = 2 1158 } 1159 1160 /** 1161 * Camera status info. 1162 * 1163 * @typedef CameraStatusInfo 1164 * @syscap SystemCapability.Multimedia.Camera.Core 1165 * @since 10 1166 */ 1167 interface CameraStatusInfo { 1168 /** 1169 * Camera instance. 1170 * 1171 * @type { CameraDevice } 1172 * @syscap SystemCapability.Multimedia.Camera.Core 1173 * @since 10 1174 */ 1175 camera: CameraDevice; 1176 1177 /** 1178 * Current camera status. 1179 * 1180 * @type { CameraStatus } 1181 * @syscap SystemCapability.Multimedia.Camera.Core 1182 * @since 10 1183 */ 1184 status: CameraStatus; 1185 } 1186 1187 /** 1188 * Fold status info. 1189 * 1190 * @typedef FoldStatusInfo 1191 * @syscap SystemCapability.Multimedia.Camera.Core 1192 * @since 12 1193 */ 1194 interface FoldStatusInfo { 1195 /** 1196 * Gets supported camera devices under the current fold status. 1197 * 1198 * @type { Array<CameraDevice> } 1199 * @readonly 1200 * @syscap SystemCapability.Multimedia.Camera.Core 1201 * @since 12 1202 */ 1203 readonly supportedCameras: Array<CameraDevice>; 1204 1205 /** 1206 * Current fold status. 1207 * 1208 * @type { FoldStatus } 1209 * @readonly 1210 * @syscap SystemCapability.Multimedia.Camera.Core 1211 * @since 12 1212 */ 1213 readonly foldStatus: FoldStatus; 1214 } 1215 1216 /** 1217 * Enum for camera position. 1218 * 1219 * @enum { number } 1220 * @syscap SystemCapability.Multimedia.Camera.Core 1221 * @since 10 1222 */ 1223 /** 1224 * Enum for camera position. 1225 * 1226 * @enum { number } 1227 * @syscap SystemCapability.Multimedia.Camera.Core 1228 * @atomicservice 1229 * @since 12 1230 */ 1231 enum CameraPosition { 1232 /** 1233 * Unspecified position. 1234 * 1235 * @syscap SystemCapability.Multimedia.Camera.Core 1236 * @since 10 1237 */ 1238 /** 1239 * Unspecified position. 1240 * 1241 * @syscap SystemCapability.Multimedia.Camera.Core 1242 * @atomicservice 1243 * @since 12 1244 */ 1245 CAMERA_POSITION_UNSPECIFIED = 0, 1246 1247 /** 1248 * Back position. 1249 * 1250 * @syscap SystemCapability.Multimedia.Camera.Core 1251 * @since 10 1252 */ 1253 /** 1254 * Back position. 1255 * 1256 * @syscap SystemCapability.Multimedia.Camera.Core 1257 * @atomicservice 1258 * @since 12 1259 */ 1260 CAMERA_POSITION_BACK = 1, 1261 1262 /** 1263 * Front position. 1264 * 1265 * @syscap SystemCapability.Multimedia.Camera.Core 1266 * @since 10 1267 */ 1268 /** 1269 * Front position. 1270 * 1271 * @syscap SystemCapability.Multimedia.Camera.Core 1272 * @atomicservice 1273 * @since 12 1274 */ 1275 CAMERA_POSITION_FRONT = 2, 1276 1277 /** 1278 * Camera that is inner position when the device is folded. 1279 * 1280 * @syscap SystemCapability.Multimedia.Camera.Core 1281 * @since 11 1282 */ 1283 /** 1284 * Camera that is inner position when the device is folded. 1285 * 1286 * @syscap SystemCapability.Multimedia.Camera.Core 1287 * @atomicservice 1288 * @since 12 1289 * @deprecated since 12 1290 */ 1291 CAMERA_POSITION_FOLD_INNER = 3 1292 } 1293 1294 /** 1295 * Enum for camera type. 1296 * 1297 * @enum { number } 1298 * @syscap SystemCapability.Multimedia.Camera.Core 1299 * @since 10 1300 */ 1301 enum CameraType { 1302 /** 1303 * Default camera type 1304 * 1305 * @syscap SystemCapability.Multimedia.Camera.Core 1306 * @since 10 1307 */ 1308 CAMERA_TYPE_DEFAULT = 0, 1309 1310 /** 1311 * Wide camera 1312 * 1313 * @syscap SystemCapability.Multimedia.Camera.Core 1314 * @since 10 1315 */ 1316 CAMERA_TYPE_WIDE_ANGLE = 1, 1317 1318 /** 1319 * Ultra wide camera 1320 * 1321 * @syscap SystemCapability.Multimedia.Camera.Core 1322 * @since 10 1323 */ 1324 CAMERA_TYPE_ULTRA_WIDE = 2, 1325 1326 /** 1327 * Telephoto camera 1328 * 1329 * @syscap SystemCapability.Multimedia.Camera.Core 1330 * @since 10 1331 */ 1332 CAMERA_TYPE_TELEPHOTO = 3, 1333 1334 /** 1335 * True depth camera 1336 * 1337 * @syscap SystemCapability.Multimedia.Camera.Core 1338 * @since 10 1339 */ 1340 CAMERA_TYPE_TRUE_DEPTH = 4 1341 } 1342 1343 /** 1344 * Enum for camera connection type. 1345 * 1346 * @enum { number } 1347 * @syscap SystemCapability.Multimedia.Camera.Core 1348 * @since 10 1349 */ 1350 enum ConnectionType { 1351 /** 1352 * Built-in camera. 1353 * 1354 * @syscap SystemCapability.Multimedia.Camera.Core 1355 * @since 10 1356 */ 1357 CAMERA_CONNECTION_BUILT_IN = 0, 1358 1359 /** 1360 * Camera connected using USB 1361 * 1362 * @syscap SystemCapability.Multimedia.Camera.Core 1363 * @since 10 1364 */ 1365 CAMERA_CONNECTION_USB_PLUGIN = 1, 1366 1367 /** 1368 * Remote camera 1369 * 1370 * @syscap SystemCapability.Multimedia.Camera.Core 1371 * @since 10 1372 */ 1373 CAMERA_CONNECTION_REMOTE = 2 1374 } 1375 1376 /** 1377 * Enum for remote camera device type. 1378 * 1379 * @enum { number } 1380 * @syscap SystemCapability.Multimedia.Camera.Core 1381 * @systemapi 1382 * @since 10 1383 */ 1384 /** 1385 * Enum for remote camera device type. 1386 * 1387 * @enum { number } 1388 * @syscap SystemCapability.Multimedia.Camera.Core 1389 * @since 16 1390 */ 1391 enum HostDeviceType { 1392 /** 1393 * Indicates an unknown device camera. 1394 * 1395 * @syscap SystemCapability.Multimedia.Camera.Core 1396 * @systemapi 1397 * @since 10 1398 */ 1399 /** 1400 * Indicates an unknown device camera. 1401 * 1402 * @syscap SystemCapability.Multimedia.Camera.Core 1403 * @since 16 1404 */ 1405 UNKNOWN_TYPE = 0, 1406 1407 /** 1408 * Indicates a smartphone camera. 1409 * 1410 * @syscap SystemCapability.Multimedia.Camera.Core 1411 * @systemapi 1412 * @since 10 1413 */ 1414 /** 1415 * Indicates a smartphone camera. 1416 * 1417 * @syscap SystemCapability.Multimedia.Camera.Core 1418 * @since 16 1419 */ 1420 PHONE = 0x0E, 1421 1422 /** 1423 * Indicates a tablet camera. 1424 * 1425 * @syscap SystemCapability.Multimedia.Camera.Core 1426 * @systemapi 1427 * @since 10 1428 */ 1429 /** 1430 * Indicates a tablet camera. 1431 * 1432 * @syscap SystemCapability.Multimedia.Camera.Core 1433 * @since 16 1434 */ 1435 TABLET = 0x11 1436 } 1437 1438 /** 1439 * Camera device object. 1440 * 1441 * @typedef CameraDevice 1442 * @syscap SystemCapability.Multimedia.Camera.Core 1443 * @since 10 1444 */ 1445 interface CameraDevice { 1446 /** 1447 * Camera id attribute. 1448 * 1449 * @type { string } 1450 * @readonly 1451 * @syscap SystemCapability.Multimedia.Camera.Core 1452 * @since 10 1453 */ 1454 readonly cameraId: string; 1455 1456 /** 1457 * Camera position attribute. 1458 * 1459 * @type { CameraPosition } 1460 * @readonly 1461 * @syscap SystemCapability.Multimedia.Camera.Core 1462 * @since 10 1463 */ 1464 readonly cameraPosition: CameraPosition; 1465 1466 /** 1467 * Camera type attribute. 1468 * 1469 * @type { CameraType } 1470 * @readonly 1471 * @syscap SystemCapability.Multimedia.Camera.Core 1472 * @since 10 1473 */ 1474 readonly cameraType: CameraType; 1475 1476 /** 1477 * Camera connection type attribute. 1478 * 1479 * @type { ConnectionType } 1480 * @readonly 1481 * @syscap SystemCapability.Multimedia.Camera.Core 1482 * @since 10 1483 */ 1484 readonly connectionType: ConnectionType; 1485 1486 /** 1487 * Camera remote camera device name attribute. 1488 * 1489 * @type { string } 1490 * @readonly 1491 * @syscap SystemCapability.Multimedia.Camera.Core 1492 * @systemapi 1493 * @since 10 1494 */ 1495 /** 1496 * Camera remote camera device name attribute. 1497 * 1498 * @type { string } 1499 * @readonly 1500 * @syscap SystemCapability.Multimedia.Camera.Core 1501 * @since 16 1502 */ 1503 readonly hostDeviceName: string; 1504 1505 /** 1506 * Camera remote camera device type attribute. 1507 * 1508 * @type { HostDeviceType } 1509 * @readonly 1510 * @syscap SystemCapability.Multimedia.Camera.Core 1511 * @systemapi 1512 * @since 10 1513 */ 1514 /** 1515 * Camera remote camera device type attribute. 1516 * 1517 * @type { HostDeviceType } 1518 * @readonly 1519 * @syscap SystemCapability.Multimedia.Camera.Core 1520 * @since 16 1521 */ 1522 readonly hostDeviceType: HostDeviceType; 1523 1524 /** 1525 * Camera sensor orientation attribute. 1526 * 1527 * @type { number } 1528 * @readonly 1529 * @syscap SystemCapability.Multimedia.Camera.Core 1530 * @since 12 1531 */ 1532 readonly cameraOrientation: number; 1533 } 1534 1535 /** 1536 * Size parameter. 1537 * 1538 * @typedef Size 1539 * @syscap SystemCapability.Multimedia.Camera.Core 1540 * @since 10 1541 */ 1542 interface Size { 1543 /** 1544 * Height. 1545 * 1546 * @type { number } 1547 * @syscap SystemCapability.Multimedia.Camera.Core 1548 * @since 10 1549 */ 1550 height: number; 1551 1552 /** 1553 * Width. 1554 * 1555 * @type { number } 1556 * @syscap SystemCapability.Multimedia.Camera.Core 1557 * @since 10 1558 */ 1559 width: number; 1560 } 1561 1562 /** 1563 * Point parameter. 1564 * 1565 * @typedef Point 1566 * @syscap SystemCapability.Multimedia.Camera.Core 1567 * @since 10 1568 */ 1569 interface Point { 1570 /** 1571 * x co-ordinate 1572 * 1573 * @type { number } 1574 * @syscap SystemCapability.Multimedia.Camera.Core 1575 * @since 10 1576 */ 1577 x: number; 1578 1579 /** 1580 * y co-ordinate 1581 * 1582 * @type { number } 1583 * @syscap SystemCapability.Multimedia.Camera.Core 1584 * @since 10 1585 */ 1586 y: number; 1587 } 1588 1589 /** 1590 * Camera input object. 1591 * 1592 * @interface CameraInput 1593 * @syscap SystemCapability.Multimedia.Camera.Core 1594 * @since 10 1595 */ 1596 interface CameraInput { 1597 /** 1598 * Open camera. 1599 * 1600 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1601 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 1602 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 1603 * @throws { BusinessError } 7400201 - Camera service fatal error. 1604 * @syscap SystemCapability.Multimedia.Camera.Core 1605 * @since 10 1606 */ 1607 open(callback: AsyncCallback<void>): void; 1608 1609 /** 1610 * Open camera. 1611 * 1612 * @returns { Promise<void> } Promise used to return the result. 1613 * @throws { BusinessError } 7400102 - Operation not allowed. 1614 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 1615 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 1616 * @throws { BusinessError } 7400201 - Camera service fatal error. 1617 * @syscap SystemCapability.Multimedia.Camera.Core 1618 * @since 10 1619 */ 1620 open(): Promise<void>; 1621 1622 /** 1623 * Open camera. 1624 * 1625 * @param { boolean } isSecureEnabled - Enable secure camera. 1626 * @returns { Promise<bigint> } Promise used to return the result. 1627 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 1628 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 1629 * @throws { BusinessError } 7400201 - Camera service fatal error. 1630 * @syscap SystemCapability.Multimedia.Camera.Core 1631 * @since 12 1632 */ 1633 open(isSecureEnabled: boolean): Promise<bigint>; 1634 1635 /** 1636 * Close camera. 1637 * 1638 * @param { AsyncCallback<void> } callback - Callback used to return the result. 1639 * @throws { BusinessError } 7400201 - Camera service fatal error. 1640 * @syscap SystemCapability.Multimedia.Camera.Core 1641 * @since 10 1642 */ 1643 close(callback: AsyncCallback<void>): void; 1644 1645 /** 1646 * Close camera. 1647 * 1648 * @returns { Promise<void> } Promise used to return the result. 1649 * @throws { BusinessError } 7400201 - Camera service fatal error. 1650 * @syscap SystemCapability.Multimedia.Camera.Core 1651 * @since 10 1652 */ 1653 close(): Promise<void>; 1654 1655 /** 1656 * Subscribes to error events. 1657 * 1658 * @param { 'error' } type - Event type. 1659 * @param { CameraDevice } camera - Camera device. 1660 * @param { ErrorCallback } callback - Callback used to get the camera input errors. 1661 * @syscap SystemCapability.Multimedia.Camera.Core 1662 * @since 10 1663 */ 1664 on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; 1665 1666 /** 1667 * Unsubscribes from error events. 1668 * 1669 * @param { 'error' } type - Event type. 1670 * @param { CameraDevice } camera - Camera device. 1671 * @param { ErrorCallback } callback - Callback used to get the camera input errors. 1672 * @syscap SystemCapability.Multimedia.Camera.Core 1673 * @since 10 1674 */ 1675 off(type: 'error', camera: CameraDevice, callback?: ErrorCallback): void; 1676 1677 /** 1678 * Subscribes to camera occlusion detection results. 1679 * 1680 * @param { 'cameraOcclusionDetection' } type - Event type. 1681 * @param { AsyncCallback<CameraOcclusionDetectionResult> } callback - Callback used to get detection results. 1682 * @throws { BusinessError } 202 - Not System Application. 1683 * @syscap SystemCapability.Multimedia.Camera.Core 1684 * @systemapi 1685 * @since 12 1686 */ 1687 on(type: 'cameraOcclusionDetection', callback: AsyncCallback<CameraOcclusionDetectionResult>): void; 1688 1689 /** 1690 * Unsubscribes from camera occlusion detection results. 1691 * 1692 * @param { 'cameraOcclusionDetection' } type - Event type. 1693 * @param { AsyncCallback<CameraOcclusionDetectionResult> } callback - Callback used to get detection results. 1694 * @throws { BusinessError } 202 - Not System Application. 1695 * @syscap SystemCapability.Multimedia.Camera.Core 1696 * @systemapi 1697 * @since 12 1698 */ 1699 off(type: 'cameraOcclusionDetection', callback?: AsyncCallback<CameraOcclusionDetectionResult>): void; 1700 } 1701 1702 /** 1703 * Enumerates the camera scene modes. 1704 * 1705 * @enum { number } 1706 * @syscap SystemCapability.Multimedia.Camera.Core 1707 * @since 11 1708 */ 1709 enum SceneMode { 1710 /** 1711 * Normal photo mode. 1712 * 1713 * @syscap SystemCapability.Multimedia.Camera.Core 1714 * @since 11 1715 */ 1716 NORMAL_PHOTO = 1, 1717 1718 /** 1719 * Normal video mode. 1720 * 1721 * @syscap SystemCapability.Multimedia.Camera.Core 1722 * @since 11 1723 */ 1724 NORMAL_VIDEO = 2, 1725 1726 /** 1727 * Portrait photo mode. 1728 * 1729 * @syscap SystemCapability.Multimedia.Camera.Core 1730 * @systemapi 1731 * @since 11 1732 */ 1733 PORTRAIT_PHOTO = 3, 1734 1735 /** 1736 * Night photo mode. 1737 * 1738 * @syscap SystemCapability.Multimedia.Camera.Core 1739 * @systemapi 1740 * @since 11 1741 */ 1742 NIGHT_PHOTO = 4, 1743 1744 /** 1745 * Professional photo mode. 1746 * 1747 * @syscap SystemCapability.Multimedia.Camera.Core 1748 * @systemapi 1749 * @since 12 1750 */ 1751 PROFESSIONAL_PHOTO = 5, 1752 1753 /** 1754 * Professional video mode. 1755 * 1756 * @syscap SystemCapability.Multimedia.Camera.Core 1757 * @systemapi 1758 * @since 12 1759 */ 1760 PROFESSIONAL_VIDEO = 6, 1761 1762 /** 1763 * Slow motion video mode. 1764 * 1765 * @syscap SystemCapability.Multimedia.Camera.Core 1766 * @systemapi 1767 * @since 12 1768 */ 1769 SLOW_MOTION_VIDEO = 7, 1770 1771 /** 1772 * Macro photo mode. 1773 * 1774 * @syscap SystemCapability.Multimedia.Camera.Core 1775 * @systemapi 1776 * @since 12 1777 */ 1778 MACRO_PHOTO = 8, 1779 1780 /** 1781 * Macro video mode. 1782 * 1783 * @syscap SystemCapability.Multimedia.Camera.Core 1784 * @systemapi 1785 * @since 12 1786 */ 1787 MACRO_VIDEO = 9, 1788 1789 /** 1790 * Light painting photo mode. 1791 * 1792 * @syscap SystemCapability.Multimedia.Camera.Core 1793 * @systemapi 1794 * @since 12 1795 */ 1796 LIGHT_PAINTING_PHOTO = 10, 1797 1798 /** 1799 * High resolution mode. 1800 * 1801 * @syscap SystemCapability.Multimedia.Camera.Core 1802 * @systemapi 1803 * @since 12 1804 */ 1805 HIGH_RESOLUTION_PHOTO = 11, 1806 1807 /** 1808 * Secure camera mode. 1809 * 1810 * @syscap SystemCapability.Multimedia.Camera.Core 1811 * @since 12 1812 */ 1813 SECURE_PHOTO = 12, 1814 1815 /** 1816 * Quick shot mode. 1817 * 1818 * @syscap SystemCapability.Multimedia.Camera.Core 1819 * @systemapi 1820 * @since 12 1821 */ 1822 QUICK_SHOT_PHOTO = 13, 1823 1824 /** 1825 * Aperture video mode. 1826 * 1827 * @syscap SystemCapability.Multimedia.Camera.Core 1828 * @systemapi 1829 * @since 12 1830 */ 1831 APERTURE_VIDEO = 14, 1832 1833 /** 1834 * Panorama photo camera mode. 1835 * 1836 * @syscap SystemCapability.Multimedia.Camera.Core 1837 * @systemapi 1838 * @since 12 1839 */ 1840 PANORAMA_PHOTO = 15, 1841 1842 /** 1843 * Timelapse photo camera mode. 1844 * 1845 * @syscap SystemCapability.Multimedia.Camera.Core 1846 * @systemapi 1847 * @since 12 1848 */ 1849 TIME_LAPSE_PHOTO = 16, 1850 1851 /** 1852 * Fluorescence photo mode. 1853 * 1854 * @syscap SystemCapability.Multimedia.Camera.Core 1855 * @systemapi 1856 * @since 13 1857 */ 1858 FLUORESCENCE_PHOTO = 17 1859 } 1860 1861 /** 1862 * Enum for camera format type. 1863 * 1864 * @enum { number } 1865 * @syscap SystemCapability.Multimedia.Camera.Core 1866 * @since 10 1867 */ 1868 enum CameraFormat { 1869 /** 1870 * RGBA 8888 Format. 1871 * 1872 * @syscap SystemCapability.Multimedia.Camera.Core 1873 * @since 10 1874 */ 1875 CAMERA_FORMAT_RGBA_8888 = 3, 1876 1877 /** 1878 * Digital negative Format. 1879 * 1880 * @syscap SystemCapability.Multimedia.Camera.Core 1881 * @systemapi 1882 * @since 12 1883 */ 1884 CAMERA_FORMAT_DNG = 4, 1885 1886 /** 1887 * YUV 420 Format. 1888 * 1889 * @syscap SystemCapability.Multimedia.Camera.Core 1890 * @since 10 1891 */ 1892 CAMERA_FORMAT_YUV_420_SP = 1003, 1893 1894 /** 1895 * JPEG Format. 1896 * 1897 * @syscap SystemCapability.Multimedia.Camera.Core 1898 * @since 10 1899 */ 1900 CAMERA_FORMAT_JPEG = 2000, 1901 1902 /** 1903 * YCBCR P010 Format. 1904 * 1905 * @syscap SystemCapability.Multimedia.Camera.Core 1906 * @since 11 1907 */ 1908 CAMERA_FORMAT_YCBCR_P010, 1909 1910 /** 1911 * YCRCB P010 Format. 1912 * 1913 * @syscap SystemCapability.Multimedia.Camera.Core 1914 * @since 11 1915 */ 1916 CAMERA_FORMAT_YCRCB_P010, 1917 1918 /** 1919 * HEIC Format. 1920 * 1921 * @syscap SystemCapability.Multimedia.Camera.Core 1922 * @since 13 1923 */ 1924 CAMERA_FORMAT_HEIC = 2003, 1925 1926 /** 1927 * Depth Data Format: float 16. 1928 * 1929 * @syscap SystemCapability.Multimedia.Camera.Core 1930 * @systemapi 1931 * @since 13 1932 */ 1933 CAMERA_FORMAT_DEPTH_16 = 3000, 1934 1935 /** 1936 * Depth Data Format: float 32. 1937 * 1938 * @syscap SystemCapability.Multimedia.Camera.Core 1939 * @systemapi 1940 * @since 13 1941 */ 1942 CAMERA_FORMAT_DEPTH_32 = 3001 1943 } 1944 1945 /** 1946 * Enum for flash mode. 1947 * 1948 * @enum { number } 1949 * @syscap SystemCapability.Multimedia.Camera.Core 1950 * @since 10 1951 */ 1952 enum FlashMode { 1953 /** 1954 * Close mode. 1955 * 1956 * @syscap SystemCapability.Multimedia.Camera.Core 1957 * @since 10 1958 */ 1959 FLASH_MODE_CLOSE = 0, 1960 1961 /** 1962 * Open mode. 1963 * 1964 * @syscap SystemCapability.Multimedia.Camera.Core 1965 * @since 10 1966 */ 1967 FLASH_MODE_OPEN = 1, 1968 1969 /** 1970 * Auto mode. 1971 * 1972 * @syscap SystemCapability.Multimedia.Camera.Core 1973 * @since 10 1974 */ 1975 FLASH_MODE_AUTO = 2, 1976 1977 /** 1978 * Always open mode. 1979 * 1980 * @syscap SystemCapability.Multimedia.Camera.Core 1981 * @since 10 1982 */ 1983 FLASH_MODE_ALWAYS_OPEN = 3 1984 } 1985 1986 /** 1987 * LCD Flash Status. 1988 * 1989 * @typedef LcdFlashStatus 1990 * @syscap SystemCapability.Multimedia.Camera.Core 1991 * @systemapi 1992 * @since 12 1993 */ 1994 interface LcdFlashStatus { 1995 /** 1996 * Check whether lcd flash is needed. 1997 * 1998 * @type { boolean } 1999 * @syscap SystemCapability.Multimedia.Camera.Core 2000 * @systemapi 2001 * @since 12 2002 */ 2003 readonly isLcdFlashNeeded: boolean; 2004 2005 /** 2006 * Compensate value for lcd flash. 2007 * 2008 * @type { number } 2009 * @syscap SystemCapability.Multimedia.Camera.Core 2010 * @systemapi 2011 * @since 12 2012 */ 2013 readonly lcdCompensation: number; 2014 } 2015 2016 /** 2017 * Flash Query object. 2018 * 2019 * @interface FlashQuery 2020 * @syscap SystemCapability.Multimedia.Camera.Core 2021 * @since 12 2022 */ 2023 interface FlashQuery { 2024 /** 2025 * Check if device has flash light. 2026 * 2027 * @returns { boolean } The flash light support status. 2028 * @throws { BusinessError } 7400103 - Session not config. 2029 * @syscap SystemCapability.Multimedia.Camera.Core 2030 * @since 11 2031 */ 2032 /** 2033 * Check if device has flash light. 2034 * Move to FlashQuery interface from Flash since 12. 2035 * 2036 * @returns { boolean } The flash light support status. 2037 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2038 * @syscap SystemCapability.Multimedia.Camera.Core 2039 * @since 12 2040 */ 2041 hasFlash(): boolean; 2042 2043 /** 2044 * Checks whether a specified flash mode is supported. 2045 * 2046 * @param { FlashMode } flashMode - Flash mode 2047 * @returns { boolean } Is the flash mode supported. 2048 * @throws { BusinessError } 7400103 - Session not config. 2049 * @syscap SystemCapability.Multimedia.Camera.Core 2050 * @since 11 2051 */ 2052 /** 2053 * Checks whether a specified flash mode is supported. 2054 * Move to FlashQuery interface from Flash since 12. 2055 * 2056 * @param { FlashMode } flashMode - Flash mode 2057 * @returns { boolean } Is the flash mode supported. 2058 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2059 * @syscap SystemCapability.Multimedia.Camera.Core 2060 * @since 12 2061 */ 2062 isFlashModeSupported(flashMode: FlashMode): boolean; 2063 2064 /** 2065 * Checks whether lcd flash is supported. 2066 * 2067 * @returns { boolean } Is lcd flash supported. 2068 * @throws { BusinessError } 202 - Not System Application. 2069 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2070 * @syscap SystemCapability.Multimedia.Camera.Core 2071 * @systemapi 2072 * @since 12 2073 */ 2074 isLcdFlashSupported(): boolean; 2075 } 2076 2077 /** 2078 * Flash object. 2079 * 2080 * @interface Flash 2081 * @syscap SystemCapability.Multimedia.Camera.Core 2082 * @since 11 2083 */ 2084 interface Flash extends FlashQuery { 2085 /** 2086 * Gets current flash mode. 2087 * 2088 * @returns { FlashMode } The current flash mode. 2089 * @throws { BusinessError } 7400103 - Session not config. 2090 * @syscap SystemCapability.Multimedia.Camera.Core 2091 * @since 11 2092 */ 2093 getFlashMode(): FlashMode; 2094 2095 /** 2096 * Sets flash mode. 2097 * 2098 * @param { FlashMode } flashMode - Target flash mode. 2099 * @throws { BusinessError } 7400103 - Session not config. 2100 * @syscap SystemCapability.Multimedia.Camera.Core 2101 * @since 11 2102 */ 2103 setFlashMode(flashMode: FlashMode): void; 2104 2105 /** 2106 * Enable lcd flash. 2107 * 2108 * @param { boolean } enabled - Target lcd flash status. 2109 * @throws { BusinessError } 202 - Not System Application. 2110 * @throws { BusinessError } 7400103 - Session not config. 2111 * @syscap SystemCapability.Multimedia.Camera.Core 2112 * @systemapi 2113 * @since 13 2114 */ 2115 enableLcdFlash(enabled: boolean): void; 2116 } 2117 2118 /** 2119 * Enum for exposure mode. 2120 * 2121 * @enum { number } 2122 * @syscap SystemCapability.Multimedia.Camera.Core 2123 * @since 10 2124 */ 2125 enum ExposureMode { 2126 /** 2127 * Lock exposure mode. 2128 * 2129 * @syscap SystemCapability.Multimedia.Camera.Core 2130 * @since 10 2131 */ 2132 EXPOSURE_MODE_LOCKED = 0, 2133 2134 /** 2135 * Auto exposure mode. 2136 * 2137 * @syscap SystemCapability.Multimedia.Camera.Core 2138 * @since 10 2139 */ 2140 EXPOSURE_MODE_AUTO = 1, 2141 2142 /** 2143 * Continuous automatic exposure. 2144 * 2145 * @syscap SystemCapability.Multimedia.Camera.Core 2146 * @since 10 2147 */ 2148 EXPOSURE_MODE_CONTINUOUS_AUTO = 2, 2149 2150 /** 2151 * Manual exposure mode. 2152 * 2153 * @syscap SystemCapability.Multimedia.Camera.Core 2154 * @systemapi 2155 * @since 12 2156 */ 2157 EXPOSURE_MODE_MANUAL = 3 2158 } 2159 2160 /** 2161 * Enum for exposure metering mode. 2162 * 2163 * @enum { number } 2164 * @syscap SystemCapability.Multimedia.Camera.Core 2165 * @systemapi 2166 * @since 12 2167 */ 2168 enum ExposureMeteringMode { 2169 /** 2170 * Matrix metering. 2171 * 2172 * @syscap SystemCapability.Multimedia.Camera.Core 2173 * @systemapi 2174 * @since 12 2175 */ 2176 MATRIX = 0, 2177 2178 /** 2179 * Center metering. 2180 * 2181 * @syscap SystemCapability.Multimedia.Camera.Core 2182 * @systemapi 2183 * @since 12 2184 */ 2185 CENTER = 1, 2186 2187 /** 2188 * Spot metering. 2189 * 2190 * @syscap SystemCapability.Multimedia.Camera.Core 2191 * @systemapi 2192 * @since 12 2193 */ 2194 SPOT = 2 2195 } 2196 2197 /** 2198 * AutoExposureQuery object. 2199 * 2200 * @interface AutoExposureQuery 2201 * @syscap SystemCapability.Multimedia.Camera.Core 2202 * @since 12 2203 */ 2204 interface AutoExposureQuery { 2205 /** 2206 * Checks whether a specified exposure mode is supported. 2207 * 2208 * @param { ExposureMode } aeMode - Exposure mode 2209 * @returns { boolean } Is the exposure mode supported. 2210 * @throws { BusinessError } 7400103 - Session not config. 2211 * @syscap SystemCapability.Multimedia.Camera.Core 2212 * @since 11 2213 */ 2214 /** 2215 * Checks whether a specified exposure mode is supported. 2216 * Move to AutoExposureQuery interface from AutoExposure interface since 12. 2217 * 2218 * @param { ExposureMode } aeMode - Exposure mode 2219 * @returns { boolean } Is the exposure mode supported. 2220 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2221 * @syscap SystemCapability.Multimedia.Camera.Core 2222 * @since 12 2223 */ 2224 isExposureModeSupported(aeMode: ExposureMode): boolean; 2225 2226 /** 2227 * Query the exposure compensation range. 2228 * 2229 * @returns { Array<number> } The array of compensation range. 2230 * @throws { BusinessError } 7400103 - Session not config. 2231 * @syscap SystemCapability.Multimedia.Camera.Core 2232 * @since 11 2233 */ 2234 /** 2235 * Query the exposure compensation range. 2236 * Move to AutoExposureQuery interface from AutoExposure interface since 12. 2237 * 2238 * @returns { Array<number> } The array of compensation range. 2239 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2240 * @syscap SystemCapability.Multimedia.Camera.Core 2241 * @since 12 2242 */ 2243 getExposureBiasRange(): Array<number>; 2244 2245 /** 2246 * Checks whether a specified exposure metering mode is supported. 2247 * 2248 * @param { ExposureMeteringMode } aeMeteringMode - Exposure metering mode 2249 * @returns { boolean } Is the exposure metering mode supported. 2250 * @throws { BusinessError } 202 - Not System Application. 2251 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2252 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2253 * @syscap SystemCapability.Multimedia.Camera.Core 2254 * @systemapi 2255 * @since 12 2256 */ 2257 isExposureMeteringModeSupported(aeMeteringMode: ExposureMeteringMode): boolean; 2258 } 2259 2260 /** 2261 * AutoExposure object. 2262 * 2263 * @interface AutoExposure 2264 * @syscap SystemCapability.Multimedia.Camera.Core 2265 * @since 11 2266 */ 2267 interface AutoExposure extends AutoExposureQuery { 2268 /** 2269 * Gets current exposure mode. 2270 * 2271 * @returns { ExposureMode } The current exposure mode. 2272 * @throws { BusinessError } 7400103 - Session not config. 2273 * @syscap SystemCapability.Multimedia.Camera.Core 2274 * @since 11 2275 */ 2276 getExposureMode(): ExposureMode; 2277 2278 /** 2279 * Sets Exposure mode. 2280 * 2281 * @param { ExposureMode } aeMode - Exposure mode 2282 * @throws { BusinessError } 7400103 - Session not config. 2283 * @syscap SystemCapability.Multimedia.Camera.Core 2284 * @since 11 2285 */ 2286 setExposureMode(aeMode: ExposureMode): void; 2287 2288 /** 2289 * Gets current metering point. 2290 * 2291 * @returns { Point } The current metering point. 2292 * @throws { BusinessError } 7400103 - Session not config. 2293 * @syscap SystemCapability.Multimedia.Camera.Core 2294 * @since 11 2295 */ 2296 getMeteringPoint(): Point; 2297 2298 /** 2299 * Set the center point of the metering area. 2300 * 2301 * @param { Point } point - metering point 2302 * @throws { BusinessError } 7400103 - Session not config. 2303 * @syscap SystemCapability.Multimedia.Camera.Core 2304 * @since 11 2305 */ 2306 setMeteringPoint(point: Point): void; 2307 2308 /** 2309 * Query the exposure compensation range. 2310 * 2311 * @returns { Array<number> } The array of compensation range. 2312 * @throws { BusinessError } 7400103 - Session not config. 2313 * @syscap SystemCapability.Multimedia.Camera.Core 2314 * @since 11 2315 */ 2316 getExposureBiasRange(): Array<number>; 2317 2318 /** 2319 * Set exposure compensation. 2320 * 2321 * @param { number } exposureBias - Exposure compensation 2322 * @throws { BusinessError } 7400103 - Session not config. 2323 * @syscap SystemCapability.Multimedia.Camera.Core 2324 * @since 11 2325 */ 2326 /** 2327 * Set exposure compensation. 2328 * 2329 * @param { number } exposureBias - Exposure compensation 2330 * @throws { BusinessError } 7400102 - Operation not allowed. 2331 * @throws { BusinessError } 7400103 - Session not config. 2332 * @syscap SystemCapability.Multimedia.Camera.Core 2333 * @since 12 2334 */ 2335 setExposureBias(exposureBias: number): void; 2336 2337 /** 2338 * Query the exposure value. 2339 * 2340 * @returns { number } The exposure value. 2341 * @throws { BusinessError } 7400103 - Session not config. 2342 * @syscap SystemCapability.Multimedia.Camera.Core 2343 * @since 11 2344 */ 2345 getExposureValue(): number; 2346 2347 /** 2348 * Gets current exposure metering mode. 2349 * 2350 * @returns { ExposureMeteringMode } The current exposure metering mode. 2351 * @throws { BusinessError } 202 - Not System Application. 2352 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2353 * @syscap SystemCapability.Multimedia.Camera.Core 2354 * @systemapi 2355 * @since 12 2356 */ 2357 getExposureMeteringMode(): ExposureMeteringMode; 2358 2359 /** 2360 * Sets exposure metering mode. 2361 * 2362 * @param { ExposureMeteringMode } aeMeteringMode - Exposure metering mode 2363 * @throws { BusinessError } 202 - Not System Application. 2364 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2365 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2366 * @syscap SystemCapability.Multimedia.Camera.Core 2367 * @systemapi 2368 * @since 12 2369 */ 2370 setExposureMeteringMode(aeMeteringMode: ExposureMeteringMode): void; 2371 } 2372 2373 /** 2374 * Enum for focus mode. 2375 * 2376 * @enum { number } 2377 * @syscap SystemCapability.Multimedia.Camera.Core 2378 * @since 10 2379 */ 2380 enum FocusMode { 2381 /** 2382 * Manual mode. 2383 * 2384 * @syscap SystemCapability.Multimedia.Camera.Core 2385 * @since 10 2386 */ 2387 FOCUS_MODE_MANUAL = 0, 2388 2389 /** 2390 * Continuous auto mode. 2391 * 2392 * @syscap SystemCapability.Multimedia.Camera.Core 2393 * @since 10 2394 */ 2395 FOCUS_MODE_CONTINUOUS_AUTO = 1, 2396 2397 /** 2398 * Auto mode. 2399 * 2400 * @syscap SystemCapability.Multimedia.Camera.Core 2401 * @since 10 2402 */ 2403 FOCUS_MODE_AUTO = 2, 2404 2405 /** 2406 * Locked mode. 2407 * 2408 * @syscap SystemCapability.Multimedia.Camera.Core 2409 * @since 10 2410 */ 2411 FOCUS_MODE_LOCKED = 3 2412 } 2413 2414 /** 2415 * Enum for focus state. 2416 * 2417 * @enum { number } 2418 * @syscap SystemCapability.Multimedia.Camera.Core 2419 * @since 10 2420 */ 2421 enum FocusState { 2422 /** 2423 * Scan state. 2424 * 2425 * @syscap SystemCapability.Multimedia.Camera.Core 2426 * @since 10 2427 */ 2428 FOCUS_STATE_SCAN = 0, 2429 2430 /** 2431 * Focused state. 2432 * 2433 * @syscap SystemCapability.Multimedia.Camera.Core 2434 * @since 10 2435 */ 2436 FOCUS_STATE_FOCUSED = 1, 2437 2438 /** 2439 * Unfocused state. 2440 * 2441 * @syscap SystemCapability.Multimedia.Camera.Core 2442 * @since 10 2443 */ 2444 FOCUS_STATE_UNFOCUSED = 2 2445 } 2446 2447 /** 2448 * Focus Query object. 2449 * 2450 * @interface FocusQuery 2451 * @syscap SystemCapability.Multimedia.Camera.Core 2452 * @since 12 2453 */ 2454 interface FocusQuery { 2455 /** 2456 * Checks whether a specified focus mode is supported. 2457 * 2458 * @param { FocusMode } afMode - Focus mode. 2459 * @returns { boolean } Is the focus mode supported. 2460 * @throws { BusinessError } 7400103 - Session not config. 2461 * @syscap SystemCapability.Multimedia.Camera.Core 2462 * @since 11 2463 */ 2464 /** 2465 * Checks whether a specified focus mode is supported. 2466 * Move to FocusQuery interface from Focus interface since 12. 2467 * 2468 * @param { FocusMode } afMode - Focus mode. 2469 * @returns { boolean } Is the focus mode supported. 2470 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2471 * @syscap SystemCapability.Multimedia.Camera.Core 2472 * @since 12 2473 */ 2474 isFocusModeSupported(afMode: FocusMode): boolean; 2475 2476 /** 2477 * Checks whether a focus assist is supported. 2478 * 2479 * @returns { boolean } Is the focus assist supported. 2480 * @throws { BusinessError } 202 - Not System Application. 2481 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2482 * @syscap SystemCapability.Multimedia.Camera.Core 2483 * @systemapi 2484 * @since 12 2485 */ 2486 isFocusAssistSupported(): boolean; 2487 } 2488 2489 /** 2490 * Focus object. 2491 * 2492 * @interface Focus 2493 * @syscap SystemCapability.Multimedia.Camera.Core 2494 * @since 11 2495 */ 2496 interface Focus extends FocusQuery { 2497 /** 2498 * Gets current focus mode. 2499 * 2500 * @returns { FocusMode } The current focus mode. 2501 * @throws { BusinessError } 7400103 - Session not config. 2502 * @syscap SystemCapability.Multimedia.Camera.Core 2503 * @since 11 2504 */ 2505 getFocusMode(): FocusMode; 2506 2507 /** 2508 * Sets focus mode. 2509 * 2510 * @param { FocusMode } afMode - Target focus mode. 2511 * @throws { BusinessError } 7400103 - Session not config. 2512 * @syscap SystemCapability.Multimedia.Camera.Core 2513 * @since 11 2514 */ 2515 setFocusMode(afMode: FocusMode): void; 2516 2517 /** 2518 * Sets focus point. 2519 * 2520 * @param { Point } point - Target focus point. 2521 * @throws { BusinessError } 7400103 - Session not config. 2522 * @syscap SystemCapability.Multimedia.Camera.Core 2523 * @since 11 2524 */ 2525 setFocusPoint(point: Point): void; 2526 2527 /** 2528 * Gets current focus point. 2529 * 2530 * @returns { Point } The current focus point. 2531 * @throws { BusinessError } 7400103 - Session not config. 2532 * @syscap SystemCapability.Multimedia.Camera.Core 2533 * @since 11 2534 */ 2535 getFocusPoint(): Point; 2536 2537 /** 2538 * Gets current focal length. 2539 * 2540 * @returns { number } The current focal point. 2541 * @throws { BusinessError } 7400103 - Session not config. 2542 * @syscap SystemCapability.Multimedia.Camera.Core 2543 * @since 11 2544 */ 2545 getFocalLength(): number; 2546 2547 /** 2548 * Gets current focus assist. 2549 * 2550 * @returns { boolean } The current focus assist. 2551 * @throws { BusinessError } 202 - Not System Application. 2552 * @throws { BusinessError } 7400103 - Session not config. 2553 * @syscap SystemCapability.Multimedia.Camera.Core 2554 * @systemapi 2555 * @since 12 2556 */ 2557 getFocusAssist(): boolean; 2558 2559 /** 2560 * Sets focus assist. 2561 * 2562 * @param { boolean } enabled - Enable focus assist if TRUE. 2563 * @throws { BusinessError } 202 - Not System Application. 2564 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2565 * @throws { BusinessError } 7400103 - Session not config. 2566 * @syscap SystemCapability.Multimedia.Camera.Core 2567 * @systemapi 2568 * @since 12 2569 */ 2570 setFocusAssist(enabled: boolean): void; 2571 } 2572 2573 /** 2574 * ManualFocus object. 2575 * 2576 * @interface ManualFocus 2577 * @syscap SystemCapability.Multimedia.Camera.Core 2578 * @systemapi 2579 * @since 12 2580 */ 2581 interface ManualFocus { 2582 /** 2583 * Gets current focus distance. 2584 * 2585 * @returns { number } The current focus distance. 2586 * @throws { BusinessError } 202 - Not System Application. 2587 * @throws { BusinessError } 7400103 - Session not config. 2588 * @syscap SystemCapability.Multimedia.Camera.Core 2589 * @systemapi 2590 * @since 12 2591 */ 2592 getFocusDistance(): number; 2593 2594 /** 2595 * Sets focus distance. 2596 * 2597 * @param { number } distance - Focus distance 2598 * @throws { BusinessError } 202 - Not System Application. 2599 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2600 * @throws { BusinessError } 7400103 - Session not config. 2601 * @syscap SystemCapability.Multimedia.Camera.Core 2602 * @systemapi 2603 * @since 12 2604 */ 2605 setFocusDistance(distance: number): void; 2606 } 2607 2608 /** 2609 * Enumerates the camera white balance modes. 2610 * 2611 * @enum { number } 2612 * @syscap SystemCapability.Multimedia.Camera.Core 2613 * @systemapi 2614 * @since 12 2615 */ 2616 enum WhiteBalanceMode { 2617 /** 2618 * Auto white balance mode. 2619 * 2620 * @syscap SystemCapability.Multimedia.Camera.Core 2621 * @systemapi 2622 * @since 12 2623 */ 2624 AUTO = 0, 2625 2626 /** 2627 * Cloudy white balance mode. 2628 * 2629 * @syscap SystemCapability.Multimedia.Camera.Core 2630 * @systemapi 2631 * @since 12 2632 */ 2633 CLOUDY = 1, 2634 2635 /** 2636 * Incandescent white balance mode. 2637 * 2638 * @syscap SystemCapability.Multimedia.Camera.Core 2639 * @systemapi 2640 * @since 12 2641 */ 2642 INCANDESCENT = 2, 2643 2644 /** 2645 * Fluorescent white balance mode. 2646 * 2647 * @syscap SystemCapability.Multimedia.Camera.Core 2648 * @systemapi 2649 * @since 12 2650 */ 2651 FLUORESCENT = 3, 2652 2653 /** 2654 * Daylight white balance mode. 2655 * 2656 * @syscap SystemCapability.Multimedia.Camera.Core 2657 * @systemapi 2658 * @since 12 2659 */ 2660 DAYLIGHT = 4, 2661 2662 /** 2663 * Manual white balance mode. 2664 * 2665 * @syscap SystemCapability.Multimedia.Camera.Core 2666 * @systemapi 2667 * @since 12 2668 */ 2669 MANUAL = 5, 2670 2671 /** 2672 * Lock white balance mode. 2673 * 2674 * @syscap SystemCapability.Multimedia.Camera.Core 2675 * @systemapi 2676 * @since 12 2677 */ 2678 LOCKED = 6 2679 } 2680 2681 /** 2682 * White Balance Query object. 2683 * 2684 * @interface WhiteBalanceQuery 2685 * @syscap SystemCapability.Multimedia.Camera.Core 2686 * @systemapi 2687 * @since 12 2688 */ 2689 interface WhiteBalanceQuery { 2690 /** 2691 * Checks whether a specified white balance mode is supported. 2692 * 2693 * @param { WhiteBalanceMode } mode - White balance mode. 2694 * @returns { boolean } Is the white balance mode supported. 2695 * @throws { BusinessError } 202 - Not System Application. 2696 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2697 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2698 * @syscap SystemCapability.Multimedia.Camera.Core 2699 * @systemapi 2700 * @since 12 2701 */ 2702 isWhiteBalanceModeSupported(mode: WhiteBalanceMode): boolean; 2703 2704 /** 2705 * Query the white balance mode range. 2706 * 2707 * @returns { Array<number> } The array of white balance mode range. 2708 * @throws { BusinessError } 202 - Not System Application. 2709 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2710 * @syscap SystemCapability.Multimedia.Camera.Core 2711 * @systemapi 2712 * @since 12 2713 */ 2714 getWhiteBalanceRange(): Array<number>; 2715 } 2716 2717 /** 2718 * WhiteBalance object. 2719 * 2720 * @interface WhiteBalance 2721 * @syscap SystemCapability.Multimedia.Camera.Core 2722 * @systemapi 2723 * @since 12 2724 */ 2725 interface WhiteBalance extends WhiteBalanceQuery { 2726 /** 2727 * Gets current white balance mode. 2728 * 2729 * @returns { WhiteBalanceMode } The current white balance mode. 2730 * @throws { BusinessError } 202 - Not System Application. 2731 * @throws { BusinessError } 7400103 - Session not config. 2732 * @syscap SystemCapability.Multimedia.Camera.Core 2733 * @systemapi 2734 * @since 12 2735 */ 2736 getWhiteBalanceMode(): WhiteBalanceMode; 2737 2738 /** 2739 * Sets white balance mode. 2740 * 2741 * @param { WhiteBalanceMode } mode - Target white balance mode. 2742 * @throws { BusinessError } 202 - Not System Application. 2743 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2744 * @throws { BusinessError } 7400103 - Session not config. 2745 * @syscap SystemCapability.Multimedia.Camera.Core 2746 * @systemapi 2747 * @since 12 2748 */ 2749 setWhiteBalanceMode(mode: WhiteBalanceMode): void; 2750 2751 /** 2752 * Gets current white balance. 2753 * 2754 * @returns { number } The current white balance. 2755 * @throws { BusinessError } 202 - Not System Application. 2756 * @throws { BusinessError } 7400103 - Session not config. 2757 * @syscap SystemCapability.Multimedia.Camera.Core 2758 * @systemapi 2759 * @since 12 2760 */ 2761 getWhiteBalance(): number; 2762 2763 /** 2764 * Sets white balance. 2765 * 2766 * @param { number } whiteBalance - White balance. 2767 * @throws { BusinessError } 202 - Not System Application. 2768 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2769 * @throws { BusinessError } 7400103 - Session not config. 2770 * @syscap SystemCapability.Multimedia.Camera.Core 2771 * @systemapi 2772 * @since 12 2773 */ 2774 setWhiteBalance(whiteBalance: number): void; 2775 } 2776 2777 /** 2778 * Manual ISO Query object. 2779 * 2780 * @interface ManualIsoQuery 2781 * @syscap SystemCapability.Multimedia.Camera.Core 2782 * @systemapi 2783 * @since 12 2784 */ 2785 interface ManualIsoQuery { 2786 /** 2787 * Checks whether ISO is supported. 2788 * 2789 * @returns { boolean } Is the ISO supported. 2790 * @throws { BusinessError } 202 - Not System Application. 2791 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2792 * @syscap SystemCapability.Multimedia.Camera.Core 2793 * @systemapi 2794 * @since 12 2795 */ 2796 isManualIsoSupported(): boolean; 2797 2798 /** 2799 * Get the ISO range. 2800 * 2801 * @returns { Array<number> } The array of ISO range. 2802 * @throws { BusinessError } 202 - Not System Application. 2803 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2804 * @syscap SystemCapability.Multimedia.Camera.Core 2805 * @systemapi 2806 * @since 12 2807 */ 2808 getIsoRange(): Array<number>; 2809 } 2810 2811 /** 2812 * ManualIso object. 2813 * 2814 * @interface ManualIso 2815 * @syscap SystemCapability.Multimedia.Camera.Core 2816 * @systemapi 2817 * @since 12 2818 */ 2819 interface ManualIso extends ManualIsoQuery { 2820 /** 2821 * Gets current ISO. 2822 * 2823 * @returns { number } The current ISO. 2824 * @throws { BusinessError } 202 - Not System Application. 2825 * @throws { BusinessError } 7400103 - Session not config. 2826 * @syscap SystemCapability.Multimedia.Camera.Core 2827 * @systemapi 2828 * @since 12 2829 */ 2830 getIso(): number; 2831 2832 /** 2833 * Sets ISO. 2834 * 2835 * @param { number } iso - ISO 2836 * @throws { BusinessError } 202 - Not System Application. 2837 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2838 * @throws { BusinessError } 7400103 - Session not config. 2839 * @syscap SystemCapability.Multimedia.Camera.Core 2840 * @systemapi 2841 * @since 12 2842 */ 2843 setIso(iso: number): void; 2844 } 2845 2846 /** 2847 * Enum for smooth zoom mode. 2848 * 2849 * @enum { number } 2850 * @syscap SystemCapability.Multimedia.Camera.Core 2851 * @since 11 2852 */ 2853 enum SmoothZoomMode { 2854 /** 2855 * Normal zoom mode. 2856 * 2857 * @syscap SystemCapability.Multimedia.Camera.Core 2858 * @since 11 2859 */ 2860 NORMAL = 0 2861 } 2862 2863 /** 2864 * SmoothZoomInfo object 2865 * 2866 * @typedef SmoothZoomInfo 2867 * @syscap SystemCapability.Multimedia.Camera.Core 2868 * @since 11 2869 */ 2870 interface SmoothZoomInfo { 2871 /** 2872 * The duration of smooth zoom. 2873 * 2874 * @type { number } 2875 * @syscap SystemCapability.Multimedia.Camera.Core 2876 * @since 11 2877 */ 2878 duration: number; 2879 } 2880 2881 /** 2882 * ZoomPointInfo object. 2883 * 2884 * @typedef ZoomPointInfo 2885 * @syscap SystemCapability.Multimedia.Camera.Core 2886 * @systemapi 2887 * @since 12 2888 */ 2889 interface ZoomPointInfo { 2890 /** 2891 * The zoom ratio value. 2892 * 2893 * @type { number } 2894 * @readonly 2895 * @syscap SystemCapability.Multimedia.Camera.Core 2896 * @systemapi 2897 * @since 12 2898 */ 2899 readonly zoomRatio: number; 2900 2901 /** 2902 * The equivalent focal Length. 2903 * 2904 * @type { number } 2905 * @readonly 2906 * @syscap SystemCapability.Multimedia.Camera.Core 2907 * @systemapi 2908 * @since 12 2909 */ 2910 readonly equivalentFocalLength: number; 2911 } 2912 2913 /** 2914 * Zoom query object. 2915 * 2916 * @interface ZoomQuery 2917 * @syscap SystemCapability.Multimedia.Camera.Core 2918 * @since 12 2919 */ 2920 interface ZoomQuery { 2921 /** 2922 * Gets all supported zoom ratio range. 2923 * 2924 * @returns { Array<number> } The zoom ratio range. 2925 * @throws { BusinessError } 7400103 - Session not config. 2926 * @syscap SystemCapability.Multimedia.Camera.Core 2927 * @since 11 2928 */ 2929 /** 2930 * Gets all supported zoom ratio range. 2931 * Move to ZoomQuery interface from Zoom since 12. 2932 * 2933 * @returns { Array<number> } The zoom ratio range. 2934 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2935 * @syscap SystemCapability.Multimedia.Camera.Core 2936 * @since 12 2937 */ 2938 getZoomRatioRange(): Array<number>; 2939 2940 /** 2941 * Gets all important zoom ratio infos. 2942 * 2943 * @returns { Array<ZoomPointInfo> } The zoom point infos. 2944 * @throws { BusinessError } 202 - Not System Application. 2945 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 2946 * @syscap SystemCapability.Multimedia.Camera.Core 2947 * @systemapi 2948 * @since 12 2949 */ 2950 getZoomPointInfos(): Array<ZoomPointInfo>; 2951 } 2952 2953 /** 2954 * Zoom object. 2955 * 2956 * @interface Zoom 2957 * @syscap SystemCapability.Multimedia.Camera.Core 2958 * @since 11 2959 */ 2960 interface Zoom extends ZoomQuery { 2961 /** 2962 * Gets zoom ratio. 2963 * 2964 * @returns { number } The zoom ratio value. 2965 * @throws { BusinessError } 7400103 - Session not config. 2966 * @syscap SystemCapability.Multimedia.Camera.Core 2967 * @since 11 2968 */ 2969 /** 2970 * Gets zoom ratio. 2971 * 2972 * @returns { number } The zoom ratio value. 2973 * @throws { BusinessError } 7400103 - Session not config. 2974 * @throws { BusinessError } 7400201 - Camera service fatal error. 2975 * @syscap SystemCapability.Multimedia.Camera.Core 2976 * @since 12 2977 */ 2978 getZoomRatio(): number; 2979 2980 /** 2981 * Sets zoom ratio. 2982 * 2983 * @param { number } zoomRatio - Target zoom ratio. 2984 * @throws { BusinessError } 7400103 - Session not config. 2985 * @syscap SystemCapability.Multimedia.Camera.Core 2986 * @since 11 2987 */ 2988 setZoomRatio(zoomRatio: number): void; 2989 2990 /** 2991 * Sets target zoom ratio by smooth method. 2992 * 2993 * @param { number } targetRatio - Target zoom ratio. 2994 * @param { SmoothZoomMode } mode - Smooth zoom mode. 2995 * @throws { BusinessError } 7400103 - Session not config. 2996 * @syscap SystemCapability.Multimedia.Camera.Core 2997 * @since 11 2998 */ 2999 setSmoothZoom(targetRatio: number, mode?: SmoothZoomMode): void; 3000 3001 /** 3002 * Notify device to prepare for zoom. 3003 * 3004 * @throws { BusinessError } 202 - Not System Application. 3005 * @throws { BusinessError } 7400103 - Session not config. 3006 * @syscap SystemCapability.Multimedia.Camera.Core 3007 * @systemapi 3008 * @since 11 3009 */ 3010 prepareZoom(): void; 3011 3012 /** 3013 * Notify device of zoom completion. 3014 * 3015 * @throws { BusinessError } 202 - Not System Application. 3016 * @throws { BusinessError } 7400103 - Session not config. 3017 * @syscap SystemCapability.Multimedia.Camera.Core 3018 * @systemapi 3019 * @since 11 3020 */ 3021 unprepareZoom(): void; 3022 } 3023 3024 /** 3025 * Enum for video stabilization mode. 3026 * 3027 * @enum { number } 3028 * @syscap SystemCapability.Multimedia.Camera.Core 3029 * @since 10 3030 */ 3031 enum VideoStabilizationMode { 3032 /** 3033 * Turn off video stablization. 3034 * 3035 * @syscap SystemCapability.Multimedia.Camera.Core 3036 * @since 10 3037 */ 3038 OFF = 0, 3039 3040 /** 3041 * LOW mode provides basic stabilization effect. 3042 * 3043 * @syscap SystemCapability.Multimedia.Camera.Core 3044 * @since 10 3045 */ 3046 LOW = 1, 3047 3048 /** 3049 * MIDDLE mode means algorithms can achieve better effects than LOW mode. 3050 * 3051 * @syscap SystemCapability.Multimedia.Camera.Core 3052 * @since 10 3053 */ 3054 MIDDLE = 2, 3055 3056 /** 3057 * HIGH mode means algorithms can achieve better effects than MIDDLE mode. 3058 * 3059 * @syscap SystemCapability.Multimedia.Camera.Core 3060 * @since 10 3061 */ 3062 HIGH = 3, 3063 3064 /** 3065 * Camera HDF can select mode automatically. 3066 * 3067 * @syscap SystemCapability.Multimedia.Camera.Core 3068 * @since 10 3069 */ 3070 AUTO = 4 3071 } 3072 3073 /** 3074 * Stabilization Query object. 3075 * 3076 * @interface StabilizationQuery 3077 * @syscap SystemCapability.Multimedia.Camera.Core 3078 * @since 12 3079 */ 3080 interface StabilizationQuery { 3081 /** 3082 * Check whether the specified video stabilization mode is supported. 3083 * 3084 * @param { VideoStabilizationMode } vsMode - Video Stabilization mode. 3085 * @returns { boolean } Is flash mode supported. 3086 * @throws { BusinessError } 7400103 - Session not config. 3087 * @syscap SystemCapability.Multimedia.Camera.Core 3088 * @since 11 3089 */ 3090 /** 3091 * Check whether the specified video stabilization mode is supported. 3092 * Move to StabilizationQuery interface from Stabilization since 12. 3093 * 3094 * @param { VideoStabilizationMode } vsMode - Video Stabilization mode. 3095 * @returns { boolean } Is flash mode supported. 3096 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3097 * @syscap SystemCapability.Multimedia.Camera.Core 3098 * @since 12 3099 */ 3100 isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean; 3101 } 3102 3103 /** 3104 * Stabilization object. 3105 * 3106 * @interface Stabilization 3107 * @syscap SystemCapability.Multimedia.Camera.Core 3108 * @since 11 3109 */ 3110 interface Stabilization extends StabilizationQuery { 3111 /** 3112 * Query the video stabilization mode currently in use. 3113 * 3114 * @returns { VideoStabilizationMode } The current video stabilization mode. 3115 * @throws { BusinessError } 7400103 - Session not config. 3116 * @syscap SystemCapability.Multimedia.Camera.Core 3117 * @since 11 3118 */ 3119 getActiveVideoStabilizationMode(): VideoStabilizationMode; 3120 3121 /** 3122 * Set video stabilization mode. 3123 * 3124 * @param { VideoStabilizationMode } mode - video stabilization mode to set. 3125 * @throws { BusinessError } 7400103 - Session not config. 3126 * @syscap SystemCapability.Multimedia.Camera.Core 3127 * @since 11 3128 */ 3129 setVideoStabilizationMode(mode: VideoStabilizationMode): void; 3130 } 3131 3132 /** 3133 * Enumerates the camera beauty effect types. 3134 * 3135 * @enum { number } 3136 * @syscap SystemCapability.Multimedia.Camera.Core 3137 * @systemapi 3138 * @since 10 3139 */ 3140 enum BeautyType { 3141 /** 3142 * Auto beauty type. 3143 * 3144 * @syscap SystemCapability.Multimedia.Camera.Core 3145 * @systemapi 3146 * @since 10 3147 */ 3148 AUTO = 0, 3149 3150 /** 3151 * Skin smooth beauty type. 3152 * 3153 * @syscap SystemCapability.Multimedia.Camera.Core 3154 * @systemapi 3155 * @since 10 3156 */ 3157 SKIN_SMOOTH = 1, 3158 3159 /** 3160 * Face slender beauty type. 3161 * 3162 * @syscap SystemCapability.Multimedia.Camera.Core 3163 * @systemapi 3164 * @since 10 3165 */ 3166 FACE_SLENDER = 2, 3167 3168 /** 3169 * Skin tone beauty type. 3170 * 3171 * @syscap SystemCapability.Multimedia.Camera.Core 3172 * @systemapi 3173 * @since 10 3174 */ 3175 SKIN_TONE = 3 3176 } 3177 3178 /** 3179 * Beauty Query object. 3180 * 3181 * @interface BeautyQuery 3182 * @syscap SystemCapability.Multimedia.Camera.Core 3183 * @systemapi 3184 * @since 12 3185 */ 3186 interface BeautyQuery { 3187 /** 3188 * Gets supported beauty effect types. 3189 * 3190 * @returns { Array<BeautyType> } List of beauty effect types. 3191 * @throws { BusinessError } 202 - Not System Application. 3192 * @throws { BusinessError } 7400103 - Session not config. 3193 * @syscap SystemCapability.Multimedia.Camera.Core 3194 * @systemapi 3195 * @since 11 3196 */ 3197 /** 3198 * Gets supported beauty effect types. 3199 * Move to BeautyQuery from Beauty since 12. 3200 * 3201 * @returns { Array<BeautyType> } List of beauty effect types. 3202 * @throws { BusinessError } 202 - Not System Application. 3203 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3204 * @syscap SystemCapability.Multimedia.Camera.Core 3205 * @systemapi 3206 * @since 12 3207 */ 3208 getSupportedBeautyTypes(): Array<BeautyType>; 3209 3210 /** 3211 * Gets the specific beauty effect type range. 3212 * 3213 * @param { BeautyType } type - The type of beauty effect. 3214 * @returns { Array<number> } The array of the specific beauty effect range. 3215 * @throws { BusinessError } 202 - Not System Application. 3216 * @throws { BusinessError } 7400103 - Session not config. 3217 * @syscap SystemCapability.Multimedia.Camera.Core 3218 * @systemapi 3219 * @since 11 3220 */ 3221 /** 3222 * Gets the specific beauty effect type range. 3223 * Move to BeautyQuery from Beauty since 12. 3224 * 3225 * @param { BeautyType } type - The type of beauty effect. 3226 * @returns { Array<number> } The array of the specific beauty effect range. 3227 * @throws { BusinessError } 202 - Not System Application. 3228 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3229 * @syscap SystemCapability.Multimedia.Camera.Core 3230 * @systemapi 3231 * @since 12 3232 */ 3233 getSupportedBeautyRange(type: BeautyType): Array<number>; 3234 } 3235 3236 /** 3237 * Beauty object. 3238 * 3239 * @interface Beauty 3240 * @syscap SystemCapability.Multimedia.Camera.Core 3241 * @systemapi 3242 * @since 11 3243 */ 3244 interface Beauty extends BeautyQuery { 3245 /** 3246 * Gets the beauty effect in use. 3247 * 3248 * @param { BeautyType } type - The type of beauty effect. 3249 * @returns { number } the beauty effect in use. 3250 * @throws { BusinessError } 202 - Not System Application. 3251 * @throws { BusinessError } 7400103 - Session not config. 3252 * @syscap SystemCapability.Multimedia.Camera.Core 3253 * @systemapi 3254 * @since 11 3255 */ 3256 getBeauty(type: BeautyType): number; 3257 3258 /** 3259 * Sets a beauty effect for a camera device. 3260 * 3261 * @param { BeautyType } type - The type of beauty effect. 3262 * @param { number } value The number of beauty effect. 3263 * @throws { BusinessError } 202 - Not System Application. 3264 * @throws { BusinessError } 7400103 - Session not config. 3265 * @syscap SystemCapability.Multimedia.Camera.Core 3266 * @systemapi 3267 * @since 11 3268 */ 3269 setBeauty(type: BeautyType, value: number): void; 3270 } 3271 3272 /** 3273 * EffectSuggestion object. 3274 * 3275 * @typedef EffectSuggestion 3276 * @syscap SystemCapability.Multimedia.Camera.Core 3277 * @systemapi 3278 * @since 12 3279 */ 3280 interface EffectSuggestion { 3281 3282 /** 3283 * Checks whether effect suggestion is supported. 3284 * 3285 * @returns { boolean } Is the effect suggestion supported. 3286 * @throws { BusinessError } 202 - Not System Application. 3287 * @throws { BusinessError } 7400103 - Session not config. 3288 * @syscap SystemCapability.Multimedia.Camera.Core 3289 * @systemapi 3290 * @since 12 3291 */ 3292 isEffectSuggestionSupported(): boolean; 3293 3294 /** 3295 * Enable effect suggestion for session. 3296 * 3297 * @param { boolean } enabled enable effect suggestion for session if TRUE.. 3298 * @throws { BusinessError } 202 - Not System Application. 3299 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3300 * @throws { BusinessError } 7400103 - Session not config. 3301 * @syscap SystemCapability.Multimedia.Camera.Core 3302 * @systemapi 3303 * @since 12 3304 */ 3305 enableEffectSuggestion(enabled: boolean): void; 3306 3307 /** 3308 * Gets supported effect suggestion types. 3309 * 3310 * @returns { Array<EffectSuggestionType> } The array of the effect suggestion types. 3311 * @throws { BusinessError } 202 - Not System Application. 3312 * @throws { BusinessError } 7400103 - Session not config. 3313 * @syscap SystemCapability.Multimedia.Camera.Core 3314 * @systemapi 3315 * @since 12 3316 */ 3317 getSupportedEffectSuggestionTypes(): Array<EffectSuggestionType>; 3318 3319 /** 3320 * Set the range of effect suggestion type and enable status. 3321 * The application should fully set all data when it starts up. 3322 * 3323 * @param { Array<EffectSuggestionStatus> } status - The array of the effect suggestion status. 3324 * @throws { BusinessError } 202 - Not System Application. 3325 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3326 * @throws { BusinessError } 7400103 - Session not config. 3327 * @syscap SystemCapability.Multimedia.Camera.Core 3328 * @systemapi 3329 * @since 12 3330 */ 3331 setEffectSuggestionStatus(status: Array<EffectSuggestionStatus>): void; 3332 3333 /** 3334 * Update the enable status of the effect suggestion type. 3335 * 3336 * @param { EffectSuggestionType } type - The type of effect suggestion. 3337 * @param { boolean } enabled - The status of effect suggestion type. 3338 * @throws { BusinessError } 202 - Not System Application. 3339 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3340 * @throws { BusinessError } 7400103 - Session not config. 3341 * @syscap SystemCapability.Multimedia.Camera.Core 3342 * @systemapi 3343 * @since 12 3344 */ 3345 updateEffectSuggestion(type: EffectSuggestionType, enabled: boolean): void; 3346 } 3347 3348 /** 3349 * Enumerates the camera color effect types. 3350 * 3351 * @enum { number } 3352 * @syscap SystemCapability.Multimedia.Camera.Core 3353 * @systemapi 3354 * @since 11 3355 */ 3356 enum ColorEffectType { 3357 /** 3358 * Normal color effect type. 3359 * 3360 * @syscap SystemCapability.Multimedia.Camera.Core 3361 * @systemapi 3362 * @since 11 3363 */ 3364 NORMAL = 0, 3365 3366 /** 3367 * Bright color effect type. 3368 * 3369 * @syscap SystemCapability.Multimedia.Camera.Core 3370 * @systemapi 3371 * @since 11 3372 */ 3373 BRIGHT = 1, 3374 3375 /** 3376 * Soft color effect type. 3377 * 3378 * @syscap SystemCapability.Multimedia.Camera.Core 3379 * @systemapi 3380 * @since 11 3381 */ 3382 SOFT = 2, 3383 3384 /** 3385 * Black white color effect type. 3386 * 3387 * @syscap SystemCapability.Multimedia.Camera.Core 3388 * @systemapi 3389 * @since 12 3390 */ 3391 BLACK_WHITE = 3 3392 } 3393 3394 /** 3395 * Enum for policy type 3396 * 3397 * @enum { number } 3398 * @syscap SystemCapability.Multimedia.Camera.Core 3399 * @systemapi 3400 * @since 12 3401 */ 3402 enum PolicyType { 3403 /** 3404 * PRIVACY type. 3405 * 3406 * @syscap SystemCapability.Multimedia.Camera.Core 3407 * @systemapi 3408 * @since 12 3409 */ 3410 PRIVACY = 1, 3411 } 3412 3413 /** 3414 * Color Effect Query object. 3415 * 3416 * @interface ColorEffectQuery 3417 * @syscap SystemCapability.Multimedia.Camera.Core 3418 * @systemapi 3419 * @since 12 3420 */ 3421 interface ColorEffectQuery { 3422 /** 3423 * Gets supported color effect types. 3424 * 3425 * @returns { Array<ColorEffectType> } List of color effect types. 3426 * @throws { BusinessError } 202 - Not System Application. 3427 * @throws { BusinessError } 7400103 - Session not config. 3428 * @syscap SystemCapability.Multimedia.Camera.Core 3429 * @systemapi 3430 * @since 11 3431 */ 3432 /** 3433 * Gets supported color effect types. 3434 * Move to ColorEffectQuery from ColorEffect since 12. 3435 * 3436 * @returns { Array<ColorEffectType> } List of color effect types. 3437 * @throws { BusinessError } 202 - Not System Application. 3438 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3439 * @syscap SystemCapability.Multimedia.Camera.Core 3440 * @systemapi 3441 * @since 12 3442 */ 3443 getSupportedColorEffects(): Array<ColorEffectType>; 3444 } 3445 3446 /** 3447 * Color effect object. 3448 * 3449 * @interface ColorEffect 3450 * @syscap SystemCapability.Multimedia.Camera.Core 3451 * @systemapi 3452 * @since 11 3453 */ 3454 interface ColorEffect extends ColorEffectQuery { 3455 /** 3456 * Gets the specific color effect type. 3457 * 3458 * @returns { ColorEffectType } The array of the specific color effect type. 3459 * @throws { BusinessError } 202 - Not System Application. 3460 * @throws { BusinessError } 7400103 - Session not config. 3461 * @syscap SystemCapability.Multimedia.Camera.Core 3462 * @systemapi 3463 * @since 11 3464 */ 3465 getColorEffect(): ColorEffectType; 3466 3467 /** 3468 * Sets a color effect for a camera device. 3469 * 3470 * @param { ColorEffectType } type - The type of color effect. 3471 * @throws { BusinessError } 202 - Not System Application. 3472 * @throws { BusinessError } 7400103 - Session not config. 3473 * @syscap SystemCapability.Multimedia.Camera.Core 3474 * @systemapi 3475 * @since 11 3476 */ 3477 setColorEffect(type: ColorEffectType): void; 3478 } 3479 3480 /** 3481 * Color Management Query object. 3482 * 3483 * @interface ColorManagementQuery 3484 * @syscap SystemCapability.Multimedia.Camera.Core 3485 * @since 12 3486 */ 3487 interface ColorManagementQuery { 3488 /** 3489 * Gets the supported color space types. 3490 * 3491 * @returns { Array<colorSpaceManager.ColorSpace> } The array of the supported color space for the session. 3492 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3493 * @syscap SystemCapability.Multimedia.Camera.Core 3494 * @since 12 3495 */ 3496 getSupportedColorSpaces(): Array<colorSpaceManager.ColorSpace>; 3497 } 3498 3499 /** 3500 * Color Management object. 3501 * 3502 * @interface ColorManagement 3503 * @syscap SystemCapability.Multimedia.Camera.Core 3504 * @since 12 3505 */ 3506 interface ColorManagement extends ColorManagementQuery { 3507 /** 3508 * Gets the specific color space type. 3509 * 3510 * @returns { colorSpaceManager.ColorSpace } Current color space. 3511 * @throws { BusinessError } 7400103 - Session not config. 3512 * @syscap SystemCapability.Multimedia.Camera.Core 3513 * @since 12 3514 */ 3515 getActiveColorSpace(): colorSpaceManager.ColorSpace; 3516 3517 /** 3518 * Sets a color space for the session. 3519 * 3520 * @param { colorSpaceManager.ColorSpace } colorSpace - The type of color space. 3521 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3522 * @throws { BusinessError } 7400102 - The colorSpace does not match the format. 3523 * @throws { BusinessError } 7400103 - Session not config. 3524 * @throws { BusinessError } 7400201 - Camera service fatal error. 3525 * @syscap SystemCapability.Multimedia.Camera.Core 3526 * @since 12 3527 */ 3528 setColorSpace(colorSpace: colorSpaceManager.ColorSpace): void; 3529 } 3530 3531 /** 3532 * Auto Device Switch Query object. 3533 * 3534 * @interface AutoDeviceSwitchQuery 3535 * @syscap SystemCapability.Multimedia.Camera.Core 3536 * @since 13 3537 */ 3538 interface AutoDeviceSwitchQuery { 3539 /** 3540 * Check whether auto device switch is supported. 3541 * 3542 * @returns { boolean } Is auto device switch supported. 3543 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3544 * @syscap SystemCapability.Multimedia.Camera.Core 3545 * @since 13 3546 */ 3547 isAutoDeviceSwitchSupported(): boolean; 3548 } 3549 3550 /** 3551 * Auto Device Switch object. 3552 * 3553 * @interface AutoDeviceSwitch 3554 * @extends AutoDeviceSwitchQuery 3555 * @syscap SystemCapability.Multimedia.Camera.Core 3556 * @since 13 3557 */ 3558 interface AutoDeviceSwitch extends AutoDeviceSwitchQuery { 3559 /** 3560 * Enable auto device switch for session. 3561 * 3562 * @param { boolean } enabled - enable auto device switch if TRUE. 3563 * @throws { BusinessError } 401 - Parameter error. Possible causes: 3564 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3565 * 3. Parameters verification failed. 3566 * @throws { BusinessError } 7400102 - Operation not allowed. 3567 * @throws { BusinessError } 7400103 - Session not config. 3568 * @throws { BusinessError } 7400201 - Camera service fatal error. 3569 * @syscap SystemCapability.Multimedia.Camera.Core 3570 * @since 13 3571 */ 3572 enableAutoDeviceSwitch(enabled: boolean): void; 3573 } 3574 3575 /** 3576 * Auto Device Switch Status. 3577 * 3578 * @typedef AutoDeviceSwitchStatus 3579 * @syscap SystemCapability.Multimedia.Camera.Core 3580 * @since 13 3581 */ 3582 interface AutoDeviceSwitchStatus { 3583 /** 3584 * Notify whether device is switched. 3585 * 3586 * @type { boolean } 3587 * @readonly 3588 * @syscap SystemCapability.Multimedia.Camera.Core 3589 * @since 13 3590 */ 3591 readonly isDeviceSwitched: boolean; 3592 3593 /** 3594 * Notify whether device capability is changed. 3595 * 3596 * @type { boolean } 3597 * @readonly 3598 * @syscap SystemCapability.Multimedia.Camera.Core 3599 * @since 13 3600 */ 3601 readonly isDeviceCapabilityChanged: boolean; 3602 } 3603 3604 /** 3605 * Macro Query object. 3606 * 3607 * @interface MacroQuery 3608 * @syscap SystemCapability.Multimedia.Camera.Core 3609 * @systemapi 3610 * @since 12 3611 */ 3612 interface MacroQuery { 3613 /** 3614 * Determine whether camera macro is supported. 3615 * 3616 * @returns { boolean } Is camera macro supported. 3617 * @throws { BusinessError } 202 - Not System Application. 3618 * @syscap SystemCapability.Multimedia.Camera.Core 3619 * @systemapi 3620 * @since 11 3621 */ 3622 /** 3623 * Determine whether camera macro is supported. 3624 * Move to MacroQuery interface from Macro since 12. 3625 * 3626 * @returns { boolean } Is camera macro supported. 3627 * @throws { BusinessError } 202 - Not System Application. 3628 * @syscap SystemCapability.Multimedia.Camera.Core 3629 * @systemapi 3630 * @since 12 3631 */ 3632 isMacroSupported(): boolean; 3633 } 3634 3635 /** 3636 * Macro object. 3637 * 3638 * @interface Macro 3639 * @syscap SystemCapability.Multimedia.Camera.Core 3640 * @systemapi 3641 * @since 11 3642 */ 3643 interface Macro extends MacroQuery { 3644 /** 3645 * Enable macro for camera. 3646 * 3647 * @param { boolean } enabled - enable macro for camera if TRUE. 3648 * @throws { BusinessError } 202 - Not System Application. 3649 * @throws { BusinessError } 7400103 - Session not config. 3650 * @syscap SystemCapability.Multimedia.Camera.Core 3651 * @systemapi 3652 * @since 11 3653 */ 3654 /** 3655 * Enable macro for camera. 3656 * 3657 * @param { boolean } enabled - enable macro for camera if TRUE. 3658 * @throws { BusinessError } 202 - Not System Application. 3659 * @throws { BusinessError } 7400102 - Operation not allowed. 3660 * @throws { BusinessError } 7400103 - Session not config. 3661 * @syscap SystemCapability.Multimedia.Camera.Core 3662 * @systemapi 3663 * @since 12 3664 */ 3665 enableMacro(enabled: boolean): void; 3666 } 3667 3668 /** 3669 * Enum for usage type used in capture session. 3670 * 3671 * @enum { number } 3672 * @syscap SystemCapability.Multimedia.Camera.Core 3673 * @systemapi 3674 * @since 13 3675 */ 3676 enum UsageType { 3677 /** 3678 * Bokeh usage type. 3679 * 3680 * @syscap SystemCapability.Multimedia.Camera.Core 3681 * @systemapi 3682 * @since 13 3683 */ 3684 BOKEH = 0 3685 } 3686 3687 /** 3688 * Session object. 3689 * 3690 * @interface Session 3691 * @syscap SystemCapability.Multimedia.Camera.Core 3692 * @since 11 3693 */ 3694 interface Session { 3695 /** 3696 * Begin capture session config. 3697 * 3698 * @throws { BusinessError } 7400105 - Session config locked. 3699 * @syscap SystemCapability.Multimedia.Camera.Core 3700 * @since 11 3701 */ 3702 /** 3703 * Begin capture session config. 3704 * 3705 * @throws { BusinessError } 7400105 - Session config locked. 3706 * @throws { BusinessError } 7400201 - Camera service fatal error. 3707 * @syscap SystemCapability.Multimedia.Camera.Core 3708 * @since 12 3709 */ 3710 beginConfig(): void; 3711 3712 /** 3713 * Commit capture session config. 3714 * 3715 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3716 * @throws { BusinessError } 7400102 - Operation not allowed. 3717 * @throws { BusinessError } 7400201 - Camera service fatal error. 3718 * @syscap SystemCapability.Multimedia.Camera.Core 3719 * @since 11 3720 */ 3721 commitConfig(callback: AsyncCallback<void>): void; 3722 3723 /** 3724 * Commit capture session config. 3725 * 3726 * @returns { Promise<void> } Promise used to return the result. 3727 * @throws { BusinessError } 7400102 - Operation not allowed. 3728 * @throws { BusinessError } 7400201 - Camera service fatal error. 3729 * @syscap SystemCapability.Multimedia.Camera.Core 3730 * @since 11 3731 */ 3732 commitConfig(): Promise<void>; 3733 3734 /** 3735 * Determines whether the camera input can be added into the session. 3736 * This method is valid between Session.beginConfig() and Session.commitConfig(). 3737 * 3738 * @param { CameraInput } cameraInput - Target camera input to add. 3739 * @returns { boolean } You can add the input into the session. 3740 * @syscap SystemCapability.Multimedia.Camera.Core 3741 * @since 11 3742 */ 3743 canAddInput(cameraInput: CameraInput): boolean; 3744 3745 /** 3746 * Adds a camera input. 3747 * This method is valid between Session.beginConfig() and Session.commitConfig(). 3748 * 3749 * @param { CameraInput } cameraInput - Target camera input to add. 3750 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3751 * @throws { BusinessError } 7400102 - Operation not allowed. 3752 * @throws { BusinessError } 7400103 - Session not config. 3753 * @syscap SystemCapability.Multimedia.Camera.Core 3754 * @since 11 3755 */ 3756 /** 3757 * Adds a camera input. 3758 * This method is valid between Session.beginConfig() and Session.commitConfig(). 3759 * 3760 * @param { CameraInput } cameraInput - Target camera input to add. 3761 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3762 * @throws { BusinessError } 7400102 - Operation not allowed. 3763 * @throws { BusinessError } 7400103 - Session not config. 3764 * @throws { BusinessError } 7400201 - Camera service fatal error. 3765 * @syscap SystemCapability.Multimedia.Camera.Core 3766 * @since 12 3767 */ 3768 addInput(cameraInput: CameraInput): void; 3769 3770 /** 3771 * Removes a camera input. 3772 * This method is valid between Session.beginConfig() and Session.commitConfig(). 3773 * 3774 * @param { CameraInput } cameraInput - Target camera input to remove. 3775 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3776 * @throws { BusinessError } 7400102 - Operation not allowed. 3777 * @throws { BusinessError } 7400103 - Session not config. 3778 * @syscap SystemCapability.Multimedia.Camera.Core 3779 * @since 11 3780 */ 3781 /** 3782 * Removes a camera input. 3783 * This method is valid between Session.beginConfig() and Session.commitConfig(). 3784 * 3785 * @param { CameraInput } cameraInput - Target camera input to remove. 3786 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3787 * @throws { BusinessError } 7400102 - Operation not allowed. 3788 * @throws { BusinessError } 7400103 - Session not config. 3789 * @throws { BusinessError } 7400201 - Camera service fatal error. 3790 * @syscap SystemCapability.Multimedia.Camera.Core 3791 * @since 12 3792 */ 3793 removeInput(cameraInput: CameraInput): void; 3794 3795 /** 3796 * Determines whether the camera output can be added into the session. 3797 * This method is valid after Session.addInput(cameraInput) and before Session.commitConfig(). 3798 * 3799 * @param { CameraOutput } cameraOutput - Target camera output to add. 3800 * @returns { boolean } You can add the output into the session. 3801 * @syscap SystemCapability.Multimedia.Camera.Core 3802 * @since 11 3803 */ 3804 canAddOutput(cameraOutput: CameraOutput): boolean; 3805 3806 /** 3807 * Adds a camera output. 3808 * This method is valid after Session.addInput(cameraInput) and before Session.commitConfig(). 3809 * 3810 * @param { CameraOutput } cameraOutput - Target camera output to add. 3811 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3812 * @throws { BusinessError } 7400102 - Operation not allowed. 3813 * @throws { BusinessError } 7400103 - Session not config. 3814 * @syscap SystemCapability.Multimedia.Camera.Core 3815 * @since 11 3816 */ 3817 /** 3818 * Adds a camera output. 3819 * This method is valid after Session.addInput(cameraInput) and before Session.commitConfig(). 3820 * 3821 * @param { CameraOutput } cameraOutput - Target camera output to add. 3822 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3823 * @throws { BusinessError } 7400102 - Operation not allowed. 3824 * @throws { BusinessError } 7400103 - Session not config. 3825 * @throws { BusinessError } 7400201 - Camera service fatal error. 3826 * @syscap SystemCapability.Multimedia.Camera.Core 3827 * @since 12 3828 */ 3829 addOutput(cameraOutput: CameraOutput): void; 3830 3831 /** 3832 * Removes a camera output. 3833 * This method is valid between Session.beginConfig() and Session.commitConfig(). 3834 * 3835 * @param { CameraOutput } cameraOutput - Target camera output to remove. 3836 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3837 * @throws { BusinessError } 7400102 - Operation not allowed. 3838 * @throws { BusinessError } 7400103 - Session not config. 3839 * @syscap SystemCapability.Multimedia.Camera.Core 3840 * @since 11 3841 */ 3842 /** 3843 * Removes a camera output. 3844 * This method is valid between Session.beginConfig() and Session.commitConfig(). 3845 * 3846 * @param { CameraOutput } cameraOutput - Target camera output to remove. 3847 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3848 * @throws { BusinessError } 7400102 - Operation not allowed. 3849 * @throws { BusinessError } 7400103 - Session not config. 3850 * @throws { BusinessError } 7400201 - Camera service fatal error. 3851 * @syscap SystemCapability.Multimedia.Camera.Core 3852 * @since 12 3853 */ 3854 removeOutput(cameraOutput: CameraOutput): void; 3855 3856 /** 3857 * Starts capture session. 3858 * 3859 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3860 * @throws { BusinessError } 7400103 - Session not config. 3861 * @throws { BusinessError } 7400201 - Camera service fatal error. 3862 * @syscap SystemCapability.Multimedia.Camera.Core 3863 * @since 11 3864 */ 3865 /** 3866 * Starts capture session. 3867 * 3868 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3869 * @throws { BusinessError } 7400102 - Operation not allowed. 3870 * @throws { BusinessError } 7400103 - Session not config. 3871 * @throws { BusinessError } 7400201 - Camera service fatal error. 3872 * @syscap SystemCapability.Multimedia.Camera.Core 3873 * @since 12 3874 */ 3875 start(callback: AsyncCallback<void>): void; 3876 3877 /** 3878 * Starts capture session. 3879 * 3880 * @returns { Promise<void> } Promise used to return the result. 3881 * @throws { BusinessError } 7400103 - Session not config. 3882 * @throws { BusinessError } 7400201 - Camera service fatal error. 3883 * @syscap SystemCapability.Multimedia.Camera.Core 3884 * @since 11 3885 */ 3886 /** 3887 * Starts capture session. 3888 * 3889 * @returns { Promise<void> } Promise used to return the result. 3890 * @throws { BusinessError } 7400102 - Operation not allowed. 3891 * @throws { BusinessError } 7400103 - Session not config. 3892 * @throws { BusinessError } 7400201 - Camera service fatal error. 3893 * @syscap SystemCapability.Multimedia.Camera.Core 3894 * @since 12 3895 */ 3896 start(): Promise<void>; 3897 3898 /** 3899 * Stops capture session. 3900 * 3901 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3902 * @throws { BusinessError } 7400201 - Camera service fatal error. 3903 * @syscap SystemCapability.Multimedia.Camera.Core 3904 * @since 11 3905 */ 3906 stop(callback: AsyncCallback<void>): void; 3907 3908 /** 3909 * Stops capture session. 3910 * 3911 * @returns { Promise<void> } Promise used to return the result. 3912 * @throws { BusinessError } 7400201 - Camera service fatal error. 3913 * @syscap SystemCapability.Multimedia.Camera.Core 3914 * @since 11 3915 */ 3916 stop(): Promise<void>; 3917 3918 /** 3919 * Release capture session instance. 3920 * 3921 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3922 * @throws { BusinessError } 7400201 - Camera service fatal error. 3923 * @syscap SystemCapability.Multimedia.Camera.Core 3924 * @since 11 3925 */ 3926 release(callback: AsyncCallback<void>): void; 3927 3928 /** 3929 * Release capture session instance. 3930 * 3931 * @returns { Promise<void> } Promise used to return the result. 3932 * @throws { BusinessError } 7400201 - Camera service fatal error. 3933 * @syscap SystemCapability.Multimedia.Camera.Core 3934 * @since 11 3935 */ 3936 release(): Promise<void>; 3937 3938 /** 3939 * Set usage for the capture session. 3940 * 3941 * @param { UsageType } usage - The capture session usage. 3942 * @param { boolean } enabled - Enable usage for session if TRUE. 3943 * @throws { BusinessError } 202 - Not System Application. 3944 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3945 * @throws { BusinessError } 7400102 - Operation not allowed. 3946 * @throws { BusinessError } 7400103 - Session not config. 3947 * @throws { BusinessError } 7400201 - Camera service fatal error. 3948 * @syscap SystemCapability.Multimedia.Camera.Core 3949 * @systemapi 3950 * @since 13 3951 */ 3952 setUsage(usage: UsageType, enabled: boolean): void; 3953 3954 /** 3955 * Get the supported camera output capability set. 3956 * 3957 * @param { CameraDevice } camera - Camera device. 3958 * @returns { Array<CameraOutputCapability> } The array of the output capability. 3959 * @throws { BusinessError } 202 - Not System Application. 3960 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3961 * @throws { BusinessError } 7400201 - Camera service fatal error. 3962 * @syscap SystemCapability.Multimedia.Camera.Core 3963 * @systemapi 3964 * @since 13 3965 */ 3966 getCameraOutputCapabilities(camera: CameraDevice): Array<CameraOutputCapability>; 3967 } 3968 3969 /** 3970 * Capture session object. 3971 * 3972 * @interface CaptureSession 3973 * @syscap SystemCapability.Multimedia.Camera.Core 3974 * @since 10 3975 * @deprecated since 11 3976 * @useinstead ohos.multimedia.camera.VideoSession 3977 */ 3978 interface CaptureSession { 3979 /** 3980 * Begin capture session config. 3981 * 3982 * @throws { BusinessError } 7400105 - Session config locked. 3983 * @syscap SystemCapability.Multimedia.Camera.Core 3984 * @since 10 3985 * @deprecated since 11 3986 * @useinstead ohos.multimedia.camera.Session#beginConfig 3987 */ 3988 beginConfig(): void; 3989 3990 /** 3991 * Commit capture session config. 3992 * 3993 * @param { AsyncCallback<void> } callback - Callback used to return the result. 3994 * @throws { BusinessError } 7400102 - Operation not allowed. 3995 * @throws { BusinessError } 7400201 - Camera service fatal error. 3996 * @syscap SystemCapability.Multimedia.Camera.Core 3997 * @since 10 3998 * @deprecated since 11 3999 * @useinstead ohos.multimedia.camera.Session#commitConfig 4000 */ 4001 commitConfig(callback: AsyncCallback<void>): void; 4002 4003 /** 4004 * Commit capture session config. 4005 * 4006 * @returns { Promise<void> } Promise used to return the result. 4007 * @throws { BusinessError } 7400102 - Operation not allowed. 4008 * @throws { BusinessError } 7400201 - Camera service fatal error. 4009 * @syscap SystemCapability.Multimedia.Camera.Core 4010 * @since 10 4011 * @deprecated since 11 4012 * @useinstead ohos.multimedia.camera.Session#commitConfig 4013 */ 4014 commitConfig(): Promise<void>; 4015 4016 /** 4017 * Adds a camera input. 4018 * 4019 * @param { CameraInput } cameraInput - Target camera input to add. 4020 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4021 * @throws { BusinessError } 7400102 - Operation not allowed. 4022 * @syscap SystemCapability.Multimedia.Camera.Core 4023 * @since 10 4024 * @deprecated since 11 4025 * @useinstead ohos.multimedia.camera.Session#addInput 4026 */ 4027 addInput(cameraInput: CameraInput): void; 4028 4029 /** 4030 * Removes a camera input. 4031 * 4032 * @param { CameraInput } cameraInput - Target camera input to remove. 4033 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4034 * @throws { BusinessError } 7400102 - Operation not allowed. 4035 * @syscap SystemCapability.Multimedia.Camera.Core 4036 * @since 10 4037 * @deprecated since 11 4038 * @useinstead ohos.multimedia.camera.Session#removeInput 4039 */ 4040 removeInput(cameraInput: CameraInput): void; 4041 4042 /** 4043 * Adds a camera output. 4044 * 4045 * @param { CameraOutput } cameraOutput - Target camera output to add. 4046 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4047 * @throws { BusinessError } 7400102 - Operation not allowed. 4048 * @syscap SystemCapability.Multimedia.Camera.Core 4049 * @since 10 4050 * @deprecated since 11 4051 * @useinstead ohos.multimedia.camera.Session#addOutput 4052 */ 4053 addOutput(cameraOutput: CameraOutput): void; 4054 4055 /** 4056 * Removes a camera output. 4057 * 4058 * @param { CameraOutput } cameraOutput - Target camera output to remove. 4059 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4060 * @throws { BusinessError } 7400102 - Operation not allowed. 4061 * @syscap SystemCapability.Multimedia.Camera.Core 4062 * @since 10 4063 * @deprecated since 11 4064 * @useinstead ohos.multimedia.camera.Session#removeOutput 4065 */ 4066 removeOutput(cameraOutput: CameraOutput): void; 4067 4068 /** 4069 * Starts capture session. 4070 * 4071 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4072 * @throws { BusinessError } 7400103 - Session not config. 4073 * @throws { BusinessError } 7400201 - Camera service fatal error. 4074 * @syscap SystemCapability.Multimedia.Camera.Core 4075 * @since 10 4076 * @deprecated since 11 4077 * @useinstead ohos.multimedia.camera.Session#start 4078 */ 4079 start(callback: AsyncCallback<void>): void; 4080 4081 /** 4082 * Starts capture session. 4083 * 4084 * @returns { Promise<void> } Promise used to return the result. 4085 * @throws { BusinessError } 7400103 - Session not config. 4086 * @throws { BusinessError } 7400201 - Camera service fatal error. 4087 * @syscap SystemCapability.Multimedia.Camera.Core 4088 * @since 10 4089 * @deprecated since 11 4090 * @useinstead ohos.multimedia.camera.Session#start 4091 */ 4092 start(): Promise<void>; 4093 4094 /** 4095 * Stops capture session. 4096 * 4097 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4098 * @throws { BusinessError } 7400201 - Camera service fatal error. 4099 * @syscap SystemCapability.Multimedia.Camera.Core 4100 * @since 10 4101 * @deprecated since 11 4102 * @useinstead ohos.multimedia.camera.Session#stop 4103 */ 4104 stop(callback: AsyncCallback<void>): void; 4105 4106 /** 4107 * Stops capture session. 4108 * 4109 * @returns { Promise<void> } Promise used to return the result. 4110 * @throws { BusinessError } 7400201 - Camera service fatal error. 4111 * @syscap SystemCapability.Multimedia.Camera.Core 4112 * @since 10 4113 * @deprecated since 11 4114 * @useinstead ohos.multimedia.camera.Session#stop 4115 */ 4116 stop(): Promise<void>; 4117 4118 /** 4119 * Release capture session instance. 4120 * 4121 * @param { AsyncCallback<void> } callback - Callback used to return the result. 4122 * @throws { BusinessError } 7400201 - Camera service fatal error. 4123 * @syscap SystemCapability.Multimedia.Camera.Core 4124 * @since 10 4125 * @deprecated since 11 4126 * @useinstead ohos.multimedia.camera.Session#release 4127 */ 4128 release(callback: AsyncCallback<void>): void; 4129 4130 /** 4131 * Release capture session instance. 4132 * 4133 * @returns { Promise<void> } Promise used to return the result. 4134 * @throws { BusinessError } 7400201 - Camera service fatal error. 4135 * @syscap SystemCapability.Multimedia.Camera.Core 4136 * @since 10 4137 * @deprecated since 11 4138 * @useinstead ohos.multimedia.camera.Session#release 4139 */ 4140 release(): Promise<void>; 4141 4142 /** 4143 * Check if device has flash light. 4144 * 4145 * @returns { boolean } The flash light support status. 4146 * @throws { BusinessError } 7400103 - Session not config. 4147 * @syscap SystemCapability.Multimedia.Camera.Core 4148 * @since 10 4149 * @deprecated since 11 4150 * @useinstead ohos.multimedia.camera.Flash#hasFlash 4151 */ 4152 hasFlash(): boolean; 4153 4154 /** 4155 * Checks whether a specified flash mode is supported. 4156 * 4157 * @param { FlashMode } flashMode - Flash mode 4158 * @returns { boolean } Is the flash mode supported. 4159 * @throws { BusinessError } 7400103 - Session not config. 4160 * @syscap SystemCapability.Multimedia.Camera.Core 4161 * @since 10 4162 * @deprecated since 11 4163 * @useinstead ohos.multimedia.camera.Flash#isFlashModeSupported 4164 */ 4165 isFlashModeSupported(flashMode: FlashMode): boolean; 4166 4167 /** 4168 * Gets current flash mode. 4169 * 4170 * @returns { FlashMode } The current flash mode. 4171 * @throws { BusinessError } 7400103 - Session not config. 4172 * @syscap SystemCapability.Multimedia.Camera.Core 4173 * @since 10 4174 * @deprecated since 11 4175 * @useinstead ohos.multimedia.camera.Flash#getFlashMode 4176 */ 4177 getFlashMode(): FlashMode; 4178 4179 /** 4180 * Sets flash mode. 4181 * 4182 * @param { FlashMode } flashMode - Target flash mode. 4183 * @throws { BusinessError } 7400103 - Session not config. 4184 * @syscap SystemCapability.Multimedia.Camera.Core 4185 * @since 10 4186 * @deprecated since 11 4187 * @useinstead ohos.multimedia.camera.Flash#setFlashMode 4188 */ 4189 setFlashMode(flashMode: FlashMode): void; 4190 4191 /** 4192 * Checks whether a specified exposure mode is supported. 4193 * 4194 * @param { ExposureMode } aeMode - Exposure mode 4195 * @returns { boolean } Is the exposure mode supported. 4196 * @throws { BusinessError } 7400103 - Session not config. 4197 * @syscap SystemCapability.Multimedia.Camera.Core 4198 * @since 10 4199 * @deprecated since 11 4200 * @useinstead ohos.multimedia.camera.AutoExposure#isExposureModeSupported 4201 */ 4202 isExposureModeSupported(aeMode: ExposureMode): boolean; 4203 4204 /** 4205 * Gets current exposure mode. 4206 * 4207 * @returns { ExposureMode } The current exposure mode. 4208 * @throws { BusinessError } 7400103 - Session not config. 4209 * @syscap SystemCapability.Multimedia.Camera.Core 4210 * @since 10 4211 * @deprecated since 11 4212 * @useinstead ohos.multimedia.camera.AutoExposure#getExposureMode 4213 */ 4214 getExposureMode(): ExposureMode; 4215 4216 /** 4217 * Sets Exposure mode. 4218 * 4219 * @param { ExposureMode } aeMode - Exposure mode 4220 * @throws { BusinessError } 7400103 - Session not config. 4221 * @syscap SystemCapability.Multimedia.Camera.Core 4222 * @since 10 4223 * @deprecated since 11 4224 * @useinstead ohos.multimedia.camera.AutoExposure#setExposureMode 4225 */ 4226 setExposureMode(aeMode: ExposureMode): void; 4227 4228 /** 4229 * Gets current metering point. 4230 * 4231 * @returns { Point } The current metering point. 4232 * @throws { BusinessError } 7400103 - Session not config. 4233 * @syscap SystemCapability.Multimedia.Camera.Core 4234 * @since 10 4235 * @deprecated since 11 4236 * @useinstead ohos.multimedia.camera.AutoExposure#getMeteringPoint 4237 */ 4238 getMeteringPoint(): Point; 4239 4240 /** 4241 * Set the center point of the metering area. 4242 * 4243 * @param { Point } point - metering point 4244 * @throws { BusinessError } 7400103 - Session not config. 4245 * @syscap SystemCapability.Multimedia.Camera.Core 4246 * @since 10 4247 * @deprecated since 11 4248 * @useinstead ohos.multimedia.camera.AutoExposure#setMeteringPoint 4249 */ 4250 setMeteringPoint(point: Point): void; 4251 4252 /** 4253 * Query the exposure compensation range. 4254 * 4255 * @returns { Array<number> } The array of compensation range. 4256 * @throws { BusinessError } 7400103 - Session not config. 4257 * @syscap SystemCapability.Multimedia.Camera.Core 4258 * @since 10 4259 * @deprecated since 11 4260 * @useinstead ohos.multimedia.camera.AutoExposure#getExposureBiasRange 4261 */ 4262 getExposureBiasRange(): Array<number>; 4263 4264 /** 4265 * Set exposure compensation. 4266 * 4267 * @param { number } exposureBias - Exposure compensation 4268 * @throws { BusinessError } 7400103 - Session not config. 4269 * @syscap SystemCapability.Multimedia.Camera.Core 4270 * @since 10 4271 * @deprecated since 11 4272 * @useinstead ohos.multimedia.camera.AutoExposure#setExposureBias 4273 */ 4274 setExposureBias(exposureBias: number): void; 4275 4276 /** 4277 * Query the exposure value. 4278 * 4279 * @returns { number } The exposure value. 4280 * @throws { BusinessError } 7400103 - Session not config. 4281 * @syscap SystemCapability.Multimedia.Camera.Core 4282 * @since 10 4283 * @deprecated since 11 4284 * @useinstead ohos.multimedia.camera.AutoExposure#getExposureValue 4285 */ 4286 getExposureValue(): number; 4287 4288 /** 4289 * Checks whether a specified focus mode is supported. 4290 * 4291 * @param { FocusMode } afMode - Focus mode. 4292 * @returns { boolean } Is the focus mode supported. 4293 * @throws { BusinessError } 7400103 - Session not config. 4294 * @syscap SystemCapability.Multimedia.Camera.Core 4295 * @since 10 4296 * @deprecated since 11 4297 * @useinstead ohos.multimedia.camera.Focus#isFocusModeSupported 4298 */ 4299 isFocusModeSupported(afMode: FocusMode): boolean; 4300 4301 /** 4302 * Gets current focus mode. 4303 * 4304 * @returns { FocusMode } The current focus mode. 4305 * @throws { BusinessError } 7400103 - Session not config. 4306 * @syscap SystemCapability.Multimedia.Camera.Core 4307 * @since 10 4308 * @deprecated since 11 4309 * @useinstead ohos.multimedia.camera.Focus#getFocusMode 4310 */ 4311 getFocusMode(): FocusMode; 4312 4313 /** 4314 * Sets focus mode. 4315 * 4316 * @param { FocusMode } afMode - Target focus mode. 4317 * @throws { BusinessError } 7400103 - Session not config. 4318 * @syscap SystemCapability.Multimedia.Camera.Core 4319 * @since 10 4320 * @deprecated since 11 4321 * @useinstead ohos.multimedia.camera.Focus#setFocusMode 4322 */ 4323 setFocusMode(afMode: FocusMode): void; 4324 4325 /** 4326 * Sets focus point. 4327 * 4328 * @param { Point } point - Target focus point. 4329 * @throws { BusinessError } 7400103 - Session not config. 4330 * @syscap SystemCapability.Multimedia.Camera.Core 4331 * @since 10 4332 * @deprecated since 11 4333 * @useinstead ohos.multimedia.camera.Focus#setFocusPoint 4334 */ 4335 setFocusPoint(point: Point): void; 4336 4337 /** 4338 * Gets current focus point. 4339 * 4340 * @returns { Point } The current focus point. 4341 * @throws { BusinessError } 7400103 - Session not config. 4342 * @syscap SystemCapability.Multimedia.Camera.Core 4343 * @since 10 4344 * @deprecated since 11 4345 * @useinstead ohos.multimedia.camera.Focus#getFocusPoint 4346 */ 4347 getFocusPoint(): Point; 4348 4349 /** 4350 * Gets current focal length. 4351 * 4352 * @returns { number } The current focal point. 4353 * @throws { BusinessError } 7400103 - Session not config. 4354 * @syscap SystemCapability.Multimedia.Camera.Core 4355 * @since 10 4356 * @deprecated since 11 4357 * @useinstead ohos.multimedia.camera.Focus#getFocalLength 4358 */ 4359 getFocalLength(): number; 4360 4361 /** 4362 * Gets all supported zoom ratio range. 4363 * 4364 * @returns { Array<number> } The zoom ratio range. 4365 * @throws { BusinessError } 7400103 - Session not config. 4366 * @syscap SystemCapability.Multimedia.Camera.Core 4367 * @since 10 4368 * @deprecated since 11 4369 * @useinstead ohos.multimedia.camera.Zoom#getZoomRatioRange 4370 */ 4371 getZoomRatioRange(): Array<number>; 4372 4373 /** 4374 * Gets zoom ratio. 4375 * 4376 * @returns { number } The zoom ratio value. 4377 * @throws { BusinessError } 7400103 - Session not config. 4378 * @syscap SystemCapability.Multimedia.Camera.Core 4379 * @since 10 4380 * @deprecated since 11 4381 * @useinstead ohos.multimedia.camera.Zoom#getZoomRatio 4382 */ 4383 getZoomRatio(): number; 4384 4385 /** 4386 * Sets zoom ratio. 4387 * 4388 * @param { number } zoomRatio - Target zoom ratio. 4389 * @throws { BusinessError } 7400103 - Session not config. 4390 * @syscap SystemCapability.Multimedia.Camera.Core 4391 * @since 10 4392 * @deprecated since 11 4393 * @useinstead ohos.multimedia.camera.Zoom#setZoomRatio 4394 */ 4395 setZoomRatio(zoomRatio: number): void; 4396 4397 /** 4398 * Check whether the specified video stabilization mode is supported. 4399 * 4400 * @param { VideoStabilizationMode } vsMode - Video Stabilization mode. 4401 * @returns { boolean } Is flash mode supported. 4402 * @throws { BusinessError } 7400103 - Session not config. 4403 * @syscap SystemCapability.Multimedia.Camera.Core 4404 * @since 10 4405 * @deprecated since 11 4406 * @useinstead ohos.multimedia.camera.Stabilization#isVideoStabilizationModeSupported 4407 */ 4408 isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean; 4409 4410 /** 4411 * Query the video stabilization mode currently in use. 4412 * 4413 * @returns { VideoStabilizationMode } The current video stabilization mode. 4414 * @throws { BusinessError } 7400103 - Session not config. 4415 * @syscap SystemCapability.Multimedia.Camera.Core 4416 * @since 10 4417 * @deprecated since 11 4418 * @useinstead ohos.multimedia.camera.Stabilization#getActiveVideoStabilizationMode 4419 */ 4420 getActiveVideoStabilizationMode(): VideoStabilizationMode; 4421 4422 /** 4423 * Set video stabilization mode. 4424 * 4425 * @param { VideoStabilizationMode } mode - video stabilization mode to set. 4426 * @throws { BusinessError } 7400103 - Session not config. 4427 * @syscap SystemCapability.Multimedia.Camera.Core 4428 * @since 10 4429 * @deprecated since 11 4430 * @useinstead ohos.multimedia.camera.Stabilization#setVideoStabilizationMode 4431 */ 4432 setVideoStabilizationMode(mode: VideoStabilizationMode): void; 4433 4434 /** 4435 * Subscribes focus status change event callback. 4436 * 4437 * @param { 'focusStateChange' } type - Event type. 4438 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 4439 * @syscap SystemCapability.Multimedia.Camera.Core 4440 * @since 10 4441 * @deprecated since 11 4442 * @useinstead ohos.multimedia.camera.VideoSession#on 4443 */ 4444 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 4445 4446 /** 4447 * Unsubscribes from focus status change event callback. 4448 * 4449 * @param { 'focusStateChange' } type - Event type. 4450 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 4451 * @syscap SystemCapability.Multimedia.Camera.Core 4452 * @since 10 4453 * @deprecated since 11 4454 * @useinstead ohos.multimedia.camera.VideoSession#off 4455 */ 4456 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 4457 4458 /** 4459 * Subscribes to error events. 4460 * 4461 * @param { 'error' } type - Event type. 4462 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 4463 * @syscap SystemCapability.Multimedia.Camera.Core 4464 * @since 10 4465 * @deprecated since 11 4466 * @useinstead ohos.multimedia.camera.VideoSession#on 4467 */ 4468 on(type: 'error', callback: ErrorCallback): void; 4469 4470 /** 4471 * Unsubscribes from error events. 4472 * 4473 * @param { 'error' } type - Event type. 4474 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 4475 * @syscap SystemCapability.Multimedia.Camera.Core 4476 * @since 10 4477 * @deprecated since 11 4478 * @useinstead ohos.multimedia.camera.VideoSession#off 4479 */ 4480 off(type: 'error', callback?: ErrorCallback): void; 4481 4482 /** 4483 * Gets supported beauty effect types. 4484 * 4485 * @returns { Array<BeautyType> } List of beauty effect types. 4486 * @throws { BusinessError } 7400103 - Session not config. 4487 * @syscap SystemCapability.Multimedia.Camera.Core 4488 * @systemapi 4489 * @since 10 4490 * @deprecated since 11 4491 * @useinstead ohos.multimedia.camera.Beauty#getSupportedBeautyTypes 4492 */ 4493 getSupportedBeautyTypes(): Array<BeautyType>; 4494 4495 /** 4496 * Gets the specific beauty effect type range. 4497 * 4498 * @param { BeautyType } type - The type of beauty effect. 4499 * @returns { Array<number> } The array of the specific beauty effect range. 4500 * @throws { BusinessError } 7400103 - Session not config. 4501 * @syscap SystemCapability.Multimedia.Camera.Core 4502 * @systemapi 4503 * @since 10 4504 * @deprecated since 11 4505 * @useinstead ohos.multimedia.camera.Beauty#getSupportedBeautyRange 4506 */ 4507 getSupportedBeautyRange(type: BeautyType): Array<number>; 4508 4509 /** 4510 * Gets the beauty effect in use. 4511 * 4512 * @param { BeautyType } type - The type of beauty effect. 4513 * @returns { number } the beauty effect in use. 4514 * @throws { BusinessError } 7400103 - Session not config. 4515 * @syscap SystemCapability.Multimedia.Camera.Core 4516 * @systemapi 4517 * @since 10 4518 * @deprecated since 11 4519 * @useinstead ohos.multimedia.camera.Beauty#getBeauty 4520 */ 4521 getBeauty(type: BeautyType): number; 4522 4523 /** 4524 * Sets a beauty effect for a camera device. 4525 * 4526 * @param { BeautyType } type - The type of beauty effect. 4527 * @param { number } value The number of beauty effect. 4528 * @throws { BusinessError } 7400103 - Session not config. 4529 * @syscap SystemCapability.Multimedia.Camera.Core 4530 * @systemapi 4531 * @since 10 4532 * @deprecated since 11 4533 * @useinstead ohos.multimedia.camera.Beauty#setBeauty 4534 */ 4535 setBeauty(type: BeautyType, value: number): void; 4536 } 4537 4538 /** 4539 * Types of preconfig, which used to configure session conveniently. 4540 * Preconfig type contains common use cases of camera output. 4541 * 4542 * @enum { number } 4543 * @syscap SystemCapability.Multimedia.Camera.Core 4544 * @since 12 4545 */ 4546 enum PreconfigType { 4547 /** 4548 * 720P output for preconfig. 4549 * 4550 * @syscap SystemCapability.Multimedia.Camera.Core 4551 * @since 12 4552 */ 4553 PRECONFIG_720P = 0, 4554 4555 /** 4556 * 1080P output for preconfig. 4557 * 4558 * @syscap SystemCapability.Multimedia.Camera.Core 4559 * @since 12 4560 */ 4561 PRECONFIG_1080P = 1, 4562 4563 /** 4564 * 4K output for preconfig. 4565 * 4566 * @syscap SystemCapability.Multimedia.Camera.Core 4567 * @since 12 4568 */ 4569 PRECONFIG_4K = 2, 4570 4571 /** 4572 * high quality output for preconfig. 4573 * 4574 * @syscap SystemCapability.Multimedia.Camera.Core 4575 * @since 12 4576 */ 4577 PRECONFIG_HIGH_QUALITY = 3 4578 } 4579 4580 /** 4581 * The aspect ratios of preconfig, which used to configure session conveniently. 4582 * 4583 * @enum { number } 4584 * @syscap SystemCapability.Multimedia.Camera.Core 4585 * @since 12 4586 */ 4587 enum PreconfigRatio { 4588 /** 4589 * Aspect ratio 1:1 for preconfig. 4590 * 4591 * @syscap SystemCapability.Multimedia.Camera.Core 4592 * @since 12 4593 */ 4594 PRECONFIG_RATIO_1_1 = 0, 4595 4596 /** 4597 * Aspect ratio 4:3 for preconfig. 4598 * 4599 * @syscap SystemCapability.Multimedia.Camera.Core 4600 * @since 12 4601 */ 4602 PRECONFIG_RATIO_4_3 = 1, 4603 4604 /** 4605 * Aspect ratio 16:9 for preconfig. 4606 * 4607 * @syscap SystemCapability.Multimedia.Camera.Core 4608 * @since 12 4609 */ 4610 PRECONFIG_RATIO_16_9 = 2 4611 } 4612 4613 /** 4614 * Enum for feature type used in scene detection. 4615 * 4616 * @enum { number } 4617 * @syscap SystemCapability.Multimedia.Camera.Core 4618 * @systemapi 4619 * @since 12 4620 */ 4621 enum SceneFeatureType { 4622 /** 4623 * Feature for boost moon capture. 4624 * 4625 * @syscap SystemCapability.Multimedia.Camera.Core 4626 * @systemapi 4627 * @since 12 4628 */ 4629 MOON_CAPTURE_BOOST = 0, 4630 4631 /** 4632 * Feature for tripod detection. 4633 * 4634 * @syscap SystemCapability.Multimedia.Camera.Core 4635 * @systemapi 4636 * @since 13 4637 */ 4638 TRIPOD_DETECTION = 1, 4639 4640 /** 4641 * Feature for low light boost. 4642 * 4643 * @syscap SystemCapability.Multimedia.Camera.Core 4644 * @systemapi 4645 * @since 13 4646 */ 4647 LOW_LIGHT_BOOST = 2 4648 } 4649 4650 /** 4651 * Feature Detection Result. 4652 * 4653 * @typedef SceneFeatureDetectionResult 4654 * @syscap SystemCapability.Multimedia.Camera.Core 4655 * @systemapi 4656 * @since 12 4657 */ 4658 interface SceneFeatureDetectionResult { 4659 /** 4660 * Detected feature type. 4661 * 4662 * @type { SceneFeatureType } 4663 * @readonly 4664 * @syscap SystemCapability.Multimedia.Camera.Core 4665 * @systemapi 4666 * @since 12 4667 */ 4668 readonly featureType: SceneFeatureType; 4669 4670 /** 4671 * Check whether feature is detected. 4672 * 4673 * @type { boolean } 4674 * @readonly 4675 * @syscap SystemCapability.Multimedia.Camera.Core 4676 * @systemapi 4677 * @since 12 4678 */ 4679 readonly detected: boolean; 4680 } 4681 4682 /** 4683 * Enum for tripod status. 4684 * 4685 * @enum { number } 4686 * @syscap SystemCapability.Multimedia.Camera.Core 4687 * @systemapi 4688 * @since 13 4689 */ 4690 enum TripodStatus { 4691 /** 4692 * Invalid tripod status. 4693 * 4694 * @syscap SystemCapability.Multimedia.Camera.Core 4695 * @systemapi 4696 * @since 13 4697 */ 4698 INVALID = 0, 4699 4700 /** 4701 * Tripod is active. 4702 * 4703 * @syscap SystemCapability.Multimedia.Camera.Core 4704 * @systemapi 4705 * @since 13 4706 */ 4707 ACTIVE = 1, 4708 4709 /** 4710 * Enter tripod stabilization state. 4711 * 4712 * @syscap SystemCapability.Multimedia.Camera.Core 4713 * @systemapi 4714 * @since 13 4715 */ 4716 ENTERING = 2, 4717 4718 /** 4719 * Exit tripod stabilization state. 4720 * 4721 * @syscap SystemCapability.Multimedia.Camera.Core 4722 * @systemapi 4723 * @since 13 4724 */ 4725 EXITING = 3, 4726 } 4727 4728 /** 4729 * Tripod detection result. 4730 * 4731 * @interface TripodDetectionResult 4732 * @extends SceneFeatureDetectionResult 4733 * @syscap SystemCapability.Multimedia.Camera.Core 4734 * @systemapi 4735 * @since 13 4736 */ 4737 interface TripodDetectionResult extends SceneFeatureDetectionResult { 4738 /** 4739 * tripod status. 4740 * 4741 * @type { TripodStatus } 4742 * @readonly 4743 * @syscap SystemCapability.Multimedia.Camera.Core 4744 * @systemapi 4745 * @since 13 4746 */ 4747 readonly tripodStatus: TripodStatus; 4748 } 4749 4750 /** 4751 * Scene detection query. 4752 * 4753 * @interface SceneDetectionQuery 4754 * @syscap SystemCapability.Multimedia.Camera.Core 4755 * @systemapi 4756 * @since 12 4757 */ 4758 interface SceneDetectionQuery { 4759 /** 4760 * Check whether specified feature is supported. 4761 * 4762 * @param { SceneFeatureType } type - Specified feature type. 4763 * @returns { boolean } - Is specified feature supported. 4764 * @throws { BusinessError } 202 - Not System Application, only throw in session usage. 4765 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4766 * @syscap SystemCapability.Multimedia.Camera.Core 4767 * @systemapi 4768 * @since 12 4769 */ 4770 isSceneFeatureSupported(type: SceneFeatureType): boolean; 4771 } 4772 4773 /** 4774 * Scene detection. 4775 * 4776 * @interface SceneDetection 4777 * @syscap SystemCapability.Multimedia.Camera.Core 4778 * @systemapi 4779 * @since 12 4780 */ 4781 interface SceneDetection extends SceneDetectionQuery { 4782 /** 4783 * Enable specified feature. 4784 * 4785 * @param { SceneFeatureType } type - Specified feature type. 4786 * @param { boolean } enabled - Target feature status. 4787 * @throws { BusinessError } 202 - Not System Application. 4788 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4789 * @syscap SystemCapability.Multimedia.Camera.Core 4790 * @systemapi 4791 * @since 12 4792 */ 4793 enableSceneFeature(type: SceneFeatureType, enabled: boolean): void; 4794 } 4795 4796 /** 4797 * Photo session object for system hap. 4798 * 4799 * @interface PhotoSessionForSys 4800 * @extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection, EffectSuggestion 4801 * @syscap SystemCapability.Multimedia.Camera.Core 4802 * @systemapi 4803 * @since 11 4804 */ 4805 /** 4806 * Photo session object for system hap. 4807 * 4808 * @interface PhotoSessionForSys 4809 * @extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection, EffectSuggestion, DepthFusion 4810 * @syscap SystemCapability.Multimedia.Camera.Core 4811 * @systemapi 4812 * @since 14 4813 */ 4814 interface PhotoSessionForSys extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection, EffectSuggestion, DepthFusion { 4815 } 4816 4817 /** 4818 * Photo session object. 4819 * 4820 * @interface PhotoSession 4821 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement 4822 * @syscap SystemCapability.Multimedia.Camera.Core 4823 * @since 11 4824 */ 4825 /** 4826 * Photo session object. 4827 * 4828 * @interface PhotoSession 4829 * @extends AutoDeviceSwitch 4830 * @syscap SystemCapability.Multimedia.Camera.Core 4831 * @since 13 4832 */ 4833 interface PhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement, AutoDeviceSwitch { 4834 /** 4835 * Gets whether the choosed preconfig type can be used to configure photo session. 4836 * Must choose preconfig type from {@link PreconfigType}. 4837 * 4838 * @param { PreconfigType } preconfigType - preconfig type. 4839 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 4840 * default value {@link PreconfigRatio#PRECONFIG_RATIO_4_3}. 4841 * @returns { boolean } Whether the choosed preconfig type can be used. 4842 * @throws { BusinessError } 7400201 - Camera service fatal error. 4843 * @syscap SystemCapability.Multimedia.Camera.Core 4844 * @since 12 4845 */ 4846 canPreconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): boolean; 4847 4848 /** 4849 * Configure photo session with the preconfig type. 4850 * Must choose preconfig type from {@link PreconfigType}. 4851 * 4852 * @param { PreconfigType } preconfigType - preconfig type. 4853 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 4854 * default value {@link PreconfigRatio#PRECONFIG_RATIO_4_3} 4855 * @throws { BusinessError } 7400201 - Camera service fatal error. 4856 * @syscap SystemCapability.Multimedia.Camera.Core 4857 * @since 12 4858 */ 4859 preconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): void; 4860 4861 /** 4862 * Subscribes to error events. 4863 * 4864 * @param { 'error' } type - Event type. 4865 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 4866 * @syscap SystemCapability.Multimedia.Camera.Core 4867 * @since 11 4868 */ 4869 on(type: 'error', callback: ErrorCallback): void; 4870 4871 /** 4872 * Unsubscribes from error events. 4873 * 4874 * @param { 'error' } type - Event type. 4875 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 4876 * @syscap SystemCapability.Multimedia.Camera.Core 4877 * @since 11 4878 */ 4879 off(type: 'error', callback?: ErrorCallback): void; 4880 4881 /** 4882 * Subscribes focus state change event callback. 4883 * 4884 * @param { 'focusStateChange' } type - Event type. 4885 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 4886 * @syscap SystemCapability.Multimedia.Camera.Core 4887 * @since 11 4888 */ 4889 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 4890 4891 /** 4892 * Unsubscribes from focus state change event callback. 4893 * 4894 * @param { 'focusStateChange' } type - Event type. 4895 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 4896 * @syscap SystemCapability.Multimedia.Camera.Core 4897 * @since 11 4898 */ 4899 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 4900 4901 /** 4902 * Subscribes zoom info event callback. 4903 * 4904 * @param { 'smoothZoomInfoAvailable' } type - Event type. 4905 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 4906 * @syscap SystemCapability.Multimedia.Camera.Core 4907 * @since 11 4908 */ 4909 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 4910 4911 /** 4912 * Unsubscribes from zoom info event callback. 4913 * 4914 * @param { 'smoothZoomInfoAvailable' } type - Event type. 4915 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 4916 * @syscap SystemCapability.Multimedia.Camera.Core 4917 * @since 11 4918 */ 4919 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 4920 4921 /** 4922 * Subscribes camera macro status event callback. 4923 * 4924 * @param { 'macroStatusChanged' } type - Event type. 4925 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 4926 * @throws { BusinessError } 202 - Not System Application. 4927 * @syscap SystemCapability.Multimedia.Camera.Core 4928 * @systemapi 4929 * @since 11 4930 */ 4931 on(type: 'macroStatusChanged', callback: AsyncCallback<boolean>): void; 4932 4933 /** 4934 * Unsubscribes camera macro status event callback. 4935 * 4936 * @param { 'macroStatusChanged' } type - Event type. 4937 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 4938 * @throws { BusinessError } 202 - Not System Application. 4939 * @syscap SystemCapability.Multimedia.Camera.Core 4940 * @systemapi 4941 * @since 11 4942 */ 4943 off(type: 'macroStatusChanged', callback?: AsyncCallback<boolean>): void; 4944 4945 /** 4946 * Subscribes to feature detection results. 4947 * 4948 * @param { 'featureDetection' } type - Event type. 4949 * @param { SceneFeatureType } featureType - Feature type. 4950 * @param { AsyncCallback<SceneFeatureDetectionResult> } callback - Callback used to get the detection result. 4951 * @throws { BusinessError } 202 - Not System Application. 4952 * @syscap SystemCapability.Multimedia.Camera.Core 4953 * @systemapi 4954 * @since 12 4955 */ 4956 on(type: 'featureDetection', featureType: SceneFeatureType, callback: AsyncCallback<SceneFeatureDetectionResult>): void; 4957 4958 /** 4959 * Unsubscribes from feature detection result. 4960 * 4961 * @param { 'featureDetection' } type - Event type. 4962 * @param { SceneFeatureType } featureType - Feature type. 4963 * @param { AsyncCallback<SceneFeatureDetectionResult> } callback - Callback used to get the detection result. 4964 * @throws { BusinessError } 202 - Not System Application. 4965 * @syscap SystemCapability.Multimedia.Camera.Core 4966 * @systemapi 4967 * @since 12 4968 */ 4969 off(type: 'featureDetection', featureType: SceneFeatureType, callback?: AsyncCallback<SceneFeatureDetectionResult>): void; 4970 4971 /** 4972 * Subscribes to effect suggestion event callback. 4973 * 4974 * @param { 'effectSuggestionChange' } type - Event type. 4975 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 4976 * @syscap SystemCapability.Multimedia.Camera.Core 4977 * @systemapi 4978 * @since 12 4979 */ 4980 on(type: 'effectSuggestionChange', callback: AsyncCallback<EffectSuggestionType>): void; 4981 4982 /** 4983 * Unsubscribes from effect suggestion event callback. 4984 * 4985 * @param { 'effectSuggestionChange' } type - Event type. 4986 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 4987 * @syscap SystemCapability.Multimedia.Camera.Core 4988 * @systemapi 4989 * @since 12 4990 */ 4991 off(type: 'effectSuggestionChange', callback?: AsyncCallback<EffectSuggestionType>): void; 4992 4993 /** 4994 * Subscribes to auto device switch status event callback. 4995 * 4996 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 4997 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 4998 * @syscap SystemCapability.Multimedia.Camera.Core 4999 * @since 13 5000 */ 5001 on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback<AutoDeviceSwitchStatus>): void; 5002 5003 /** 5004 * Unsubscribes to auto device switch status event callback. 5005 * 5006 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 5007 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 5008 * @syscap SystemCapability.Multimedia.Camera.Core 5009 * @since 13 5010 */ 5011 off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback<AutoDeviceSwitchStatus>): void; 5012 5013 /** 5014 * Subscribes to lcd flash status. 5015 * 5016 * @param { 'lcdFlashStatus' } type - Event type. 5017 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5018 * @throws { BusinessError } 202 - Not System Application. 5019 * @syscap SystemCapability.Multimedia.Camera.Core 5020 * @systemapi 5021 * @since 13 5022 */ 5023 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 5024 5025 /** 5026 * Unsubscribes from lcd flash status. 5027 * 5028 * @param { 'lcdFlashStatus' } type - Event type. 5029 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5030 * @throws { BusinessError } 202 - Not System Application. 5031 * @syscap SystemCapability.Multimedia.Camera.Core 5032 * @systemapi 5033 * @since 13 5034 */ 5035 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 5036 5037 /** 5038 * Gets session functions. 5039 * 5040 * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. 5041 * @returns { Array<PhotoFunctions> } List of session functions. 5042 * @throws { BusinessError } 202 - Not System Application. 5043 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 5044 * @syscap SystemCapability.Multimedia.Camera.Core 5045 * @systemapi 5046 * @since 13 5047 */ 5048 getSessionFunctions(outputCapability: CameraOutputCapability): Array<PhotoFunctions>; 5049 5050 /** 5051 * Gets session conflict functions. 5052 * 5053 * @returns { Array<PhotoConflictFunctions> } List of session conflict functions. 5054 * @throws { BusinessError } 202 - Not System Application. 5055 * @syscap SystemCapability.Multimedia.Camera.Core 5056 * @systemapi 5057 * @since 13 5058 */ 5059 getSessionConflictFunctions(): Array<PhotoConflictFunctions>; 5060 } 5061 5062 /** 5063 * Video session object for system hap. 5064 * 5065 * @interface VideoSessionForSys 5066 * @syscap SystemCapability.Multimedia.Camera.Core 5067 * @systemapi 5068 * @since 11 5069 */ 5070 interface VideoSessionForSys extends VideoSession, Beauty, ColorEffect, ColorManagement, Macro { 5071 } 5072 5073 /** 5074 * Video session object. 5075 * 5076 * @interface VideoSession 5077 * @extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement 5078 * @syscap SystemCapability.Multimedia.Camera.Core 5079 * @since 11 5080 */ 5081 /** 5082 * Video session object. 5083 * 5084 * @interface VideoSession 5085 * @extends AutoDeviceSwitch 5086 * @syscap SystemCapability.Multimedia.Camera.Core 5087 * @since 13 5088 */ 5089 interface VideoSession extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement, AutoDeviceSwitch { 5090 /** 5091 * Gets whether the choosed preconfig type can be used to configure video session. 5092 * Must choose preconfig type from {@link PreconfigType}. 5093 * 5094 * @param { PreconfigType } preconfigType - preconfig type. 5095 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 5096 * default value {@link PreconfigRatio#PRECONFIG_RATIO_16_9}. 5097 * @returns { boolean } Whether the choosed preconfig type can be used. 5098 * @throws { BusinessError } 7400201 - Camera service fatal error. 5099 * @syscap SystemCapability.Multimedia.Camera.Core 5100 * @since 12 5101 */ 5102 canPreconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): boolean; 5103 5104 /** 5105 * Configure video session with the preconfig type. 5106 * Must choose preconfig type from {@link PreconfigType}. 5107 * 5108 * @param { PreconfigType } preconfigType - preconfig type. 5109 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 5110 * default value {@link PreconfigRatio#PRECONFIG_RATIO_16_9}. 5111 * @throws { BusinessError } 7400201 - Camera service fatal error. 5112 * @syscap SystemCapability.Multimedia.Camera.Core 5113 * @since 12 5114 */ 5115 preconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): void; 5116 5117 /** 5118 * Subscribes to error events. 5119 * 5120 * @param { 'error' } type - Event type. 5121 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5122 * @syscap SystemCapability.Multimedia.Camera.Core 5123 * @since 11 5124 */ 5125 on(type: 'error', callback: ErrorCallback): void; 5126 5127 /** 5128 * Unsubscribes from error events. 5129 * 5130 * @param { 'error' } type - Event type. 5131 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5132 * @syscap SystemCapability.Multimedia.Camera.Core 5133 * @since 11 5134 */ 5135 off(type: 'error', callback?: ErrorCallback): void; 5136 5137 /** 5138 * Subscribes focus state change event callback. 5139 * 5140 * @param { 'focusStateChange' } type - Event type. 5141 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5142 * @syscap SystemCapability.Multimedia.Camera.Core 5143 * @since 11 5144 */ 5145 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 5146 5147 /** 5148 * Unsubscribes from focus state change event callback. 5149 * 5150 * @param { 'focusStateChange' } type - Event type. 5151 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5152 * @syscap SystemCapability.Multimedia.Camera.Core 5153 * @since 11 5154 */ 5155 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 5156 5157 /** 5158 * Subscribes zoom info event callback. 5159 * 5160 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5161 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5162 * @syscap SystemCapability.Multimedia.Camera.Core 5163 * @since 11 5164 */ 5165 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 5166 5167 /** 5168 * Unsubscribes from zoom info event callback. 5169 * 5170 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5171 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5172 * @syscap SystemCapability.Multimedia.Camera.Core 5173 * @since 11 5174 */ 5175 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 5176 5177 /** 5178 * Subscribes camera macro status event callback. 5179 * 5180 * @param { 'macroStatusChanged' } type - Event type. 5181 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 5182 * @throws { BusinessError } 202 - Not System Application. 5183 * @syscap SystemCapability.Multimedia.Camera.Core 5184 * @systemapi 5185 * @since 11 5186 */ 5187 on(type: 'macroStatusChanged', callback: AsyncCallback<boolean>): void; 5188 5189 /** 5190 * Unsubscribes camera macro status event callback. 5191 * 5192 * @param { 'macroStatusChanged' } type - Event type. 5193 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 5194 * @throws { BusinessError } 202 - Not System Application. 5195 * @syscap SystemCapability.Multimedia.Camera.Core 5196 * @systemapi 5197 * @since 11 5198 */ 5199 off(type: 'macroStatusChanged', callback?: AsyncCallback<boolean>): void; 5200 5201 /** 5202 * Subscribes to lcd flash status. 5203 * 5204 * @param { 'lcdFlashStatus' } type - Event type. 5205 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5206 * @throws { BusinessError } 202 - Not System Application. 5207 * @syscap SystemCapability.Multimedia.Camera.Core 5208 * @systemapi 5209 * @since 13 5210 */ 5211 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 5212 5213 /** 5214 * Unsubscribes from lcd flash status. 5215 * 5216 * @param { 'lcdFlashStatus' } type - Event type. 5217 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5218 * @throws { BusinessError } 202 - Not System Application. 5219 * @syscap SystemCapability.Multimedia.Camera.Core 5220 * @systemapi 5221 * @since 13 5222 */ 5223 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 5224 5225 /** 5226 * Subscribes to auto device switch status event callback. 5227 * 5228 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 5229 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 5230 * @syscap SystemCapability.Multimedia.Camera.Core 5231 * @since 13 5232 */ 5233 on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback<AutoDeviceSwitchStatus>): void; 5234 5235 /** 5236 * Unsubscribes to auto device switch status event callback. 5237 * 5238 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 5239 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 5240 * @syscap SystemCapability.Multimedia.Camera.Core 5241 * @since 13 5242 */ 5243 off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback<AutoDeviceSwitchStatus>): void; 5244 5245 /** 5246 * Gets session functions. 5247 * 5248 * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. 5249 * @returns { Array<VideoFunctions> } List of session functions. 5250 * @throws { BusinessError } 202 - Not System Application. 5251 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 5252 * @syscap SystemCapability.Multimedia.Camera.Core 5253 * @systemapi 5254 * @since 13 5255 */ 5256 getSessionFunctions(outputCapability: CameraOutputCapability): Array<VideoFunctions>; 5257 5258 /** 5259 * Gets session conflict functions. 5260 * 5261 * @returns { Array<VideoConflictFunctions> } List of session conflict functions. 5262 * @throws { BusinessError } 202 - Not System Application. 5263 * @syscap SystemCapability.Multimedia.Camera.Core 5264 * @systemapi 5265 * @since 13 5266 */ 5267 getSessionConflictFunctions(): Array<VideoConflictFunctions>; 5268 } 5269 5270 /** 5271 * Enumerates the camera portrait effects. 5272 * 5273 * @enum { number } 5274 * @syscap SystemCapability.Multimedia.Camera.Core 5275 * @systemapi 5276 * @since 10 5277 */ 5278 enum PortraitEffect { 5279 /** 5280 * portrait effect off. 5281 * 5282 * @syscap SystemCapability.Multimedia.Camera.Core 5283 * @systemapi 5284 * @since 10 5285 */ 5286 OFF = 0, 5287 5288 /** 5289 * circular blurring for portrait. 5290 * 5291 * @syscap SystemCapability.Multimedia.Camera.Core 5292 * @systemapi 5293 * @since 10 5294 */ 5295 CIRCLES = 1, 5296 5297 /** 5298 * heart blurring for portrait. 5299 * 5300 * @syscap SystemCapability.Multimedia.Camera.Core 5301 * @systemapi 5302 * @since 11 5303 */ 5304 HEART = 2, 5305 5306 /** 5307 * rotated blurring for portrait. 5308 * 5309 * @syscap SystemCapability.Multimedia.Camera.Core 5310 * @systemapi 5311 * @since 11 5312 */ 5313 ROTATED = 3, 5314 5315 /** 5316 * studio blurring for portrait. 5317 * 5318 * @syscap SystemCapability.Multimedia.Camera.Core 5319 * @systemapi 5320 * @since 11 5321 */ 5322 STUDIO = 4, 5323 5324 /** 5325 * theater blurring for portrait. 5326 * 5327 * @syscap SystemCapability.Multimedia.Camera.Core 5328 * @systemapi 5329 * @since 11 5330 */ 5331 THEATER = 5 5332 } 5333 5334 /** 5335 * Portrait Query object. 5336 * 5337 * @interface PortraitQuery 5338 * @syscap SystemCapability.Multimedia.Camera.Core 5339 * @systemapi 5340 * @since 12 5341 */ 5342 interface PortraitQuery { 5343 /** 5344 * Gets supported portrait effect. 5345 * 5346 * @returns { Array<PortraitEffect> } List of portrait effect. 5347 * @throws { BusinessError } 7400103 - Session not config. 5348 * @syscap SystemCapability.Multimedia.Camera.Core 5349 * @systemapi 5350 * @since 10 5351 */ 5352 /** 5353 * Gets supported portrait effect. 5354 * Move to Portrait interface from PortraitPhotoSession interface since 11. 5355 * 5356 * @returns { Array<PortraitEffect> } List of portrait effect. 5357 * @throws { BusinessError } 202 - Not System Application. 5358 * @throws { BusinessError } 7400103 - Session not config. 5359 * @syscap SystemCapability.Multimedia.Camera.Core 5360 * @systemapi 5361 * @since 11 5362 */ 5363 /** 5364 * Gets supported portrait effect. 5365 * Move to PortraitQuery interface from Portrait interface since 12. 5366 * 5367 * @returns { Array<PortraitEffect> } List of portrait effect. 5368 * @throws { BusinessError } 202 - Not System Application. 5369 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5370 * @syscap SystemCapability.Multimedia.Camera.Core 5371 * @systemapi 5372 * @since 12 5373 */ 5374 getSupportedPortraitEffects(): Array<PortraitEffect>; 5375 } 5376 5377 /** 5378 * Portrait object. 5379 * 5380 * @interface Portrait 5381 * @syscap SystemCapability.Multimedia.Camera.Core 5382 * @systemapi 5383 * @since 11 5384 */ 5385 interface Portrait extends PortraitQuery { 5386 /** 5387 * Gets the portrait effect in use. 5388 * 5389 * @returns { PortraitEffect } The portrait effect in use. 5390 * @throws { BusinessError } 7400103 - Session not config. 5391 * @syscap SystemCapability.Multimedia.Camera.Core 5392 * @systemapi 5393 * @since 10 5394 */ 5395 /** 5396 * Gets the portrait effect in use. 5397 * Move to Portrait interface from PortraitPhotoSession interface since 11. 5398 * 5399 * @returns { PortraitEffect } The portrait effect in use. 5400 * @throws { BusinessError } 202 - Not System Application. 5401 * @throws { BusinessError } 7400103 - Session not config. 5402 * @syscap SystemCapability.Multimedia.Camera.Core 5403 * @systemapi 5404 * @since 11 5405 */ 5406 getPortraitEffect(): PortraitEffect; 5407 5408 /** 5409 * Sets a portrait effect for a camera device. 5410 * 5411 * @param { PortraitEffect } effect - Effect Portrait effect to set. 5412 * @throws { BusinessError } 7400103 - Session not config. 5413 * @syscap SystemCapability.Multimedia.Camera.Core 5414 * @systemapi 5415 * @since 10 5416 */ 5417 /** 5418 * Sets a portrait effect for a camera device. 5419 * Move to Portrait interface from PortraitPhotoSession interface since 11. 5420 * 5421 * @param { PortraitEffect } effect - Effect Portrait effect to set. 5422 * @throws { BusinessError } 202 - Not System Application. 5423 * @throws { BusinessError } 7400103 - Session not config. 5424 * @syscap SystemCapability.Multimedia.Camera.Core 5425 * @systemapi 5426 * @since 11 5427 */ 5428 setPortraitEffect(effect: PortraitEffect): void; 5429 } 5430 5431 /** 5432 * Zoom range. 5433 * 5434 * @typedef ZoomRange 5435 * @syscap SystemCapability.Multimedia.Camera.Core 5436 * @systemapi 5437 * @since 11 5438 */ 5439 interface ZoomRange { 5440 /** 5441 * Min zoom value. 5442 * 5443 * @type { number } 5444 * @readonly 5445 * @syscap SystemCapability.Multimedia.Camera.Core 5446 * @systemapi 5447 * @since 11 5448 */ 5449 readonly min: number; 5450 5451 /** 5452 * Max zoom value. 5453 * 5454 * @type { number } 5455 * @readonly 5456 * @syscap SystemCapability.Multimedia.Camera.Core 5457 * @systemapi 5458 * @since 11 5459 */ 5460 readonly max: number; 5461 } 5462 5463 /** 5464 * Physical Aperture object 5465 * 5466 * @typedef PhysicalAperture 5467 * @syscap SystemCapability.Multimedia.Camera.Core 5468 * @systemapi 5469 * @since 11 5470 */ 5471 interface PhysicalAperture { 5472 /** 5473 * Zoom Range of the specific physical aperture. 5474 * 5475 * @type { ZoomRange } 5476 * @syscap SystemCapability.Multimedia.Camera.Core 5477 * @systemapi 5478 * @since 11 5479 */ 5480 zoomRange: ZoomRange; 5481 5482 /** 5483 * The supported physical apertures. 5484 * 5485 * @type { Array<number> } 5486 * @syscap SystemCapability.Multimedia.Camera.Core 5487 * @systemapi 5488 * @since 11 5489 */ 5490 apertures: Array<number>; 5491 } 5492 5493 /** 5494 * Aperture Query object. 5495 * 5496 * @interface ApertureQuery 5497 * @syscap SystemCapability.Multimedia.Camera.Core 5498 * @systemapi 5499 * @since 12 5500 */ 5501 interface ApertureQuery { 5502 /** 5503 * Gets the supported virtual apertures. 5504 * 5505 * @returns { Array<number> } The array of supported virtual apertures. 5506 * @throws { BusinessError } 202 - Not System Application. 5507 * @throws { BusinessError } 7400103 - Session not config. 5508 * @syscap SystemCapability.Multimedia.Camera.Core 5509 * @systemapi 5510 * @since 11 5511 */ 5512 /** 5513 * Gets the supported virtual apertures. 5514 * Move to ApertureQuery interface from Aperture since 12. 5515 * 5516 * @returns { Array<number> } The array of supported virtual apertures. 5517 * @throws { BusinessError } 202 - Not System Application. 5518 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5519 * @syscap SystemCapability.Multimedia.Camera.Core 5520 * @systemapi 5521 * @since 12 5522 */ 5523 getSupportedVirtualApertures(): Array<number>; 5524 5525 /** 5526 * Gets the supported physical apertures. 5527 * 5528 * @returns { Array<PhysicalAperture> } The array of supported physical apertures. 5529 * @throws { BusinessError } 202 - Not System Application. 5530 * @throws { BusinessError } 7400103 - Session not config. 5531 * @syscap SystemCapability.Multimedia.Camera.Core 5532 * @systemapi 5533 * @since 11 5534 */ 5535 /** 5536 * Gets the supported physical apertures. 5537 * Move to ApertureQuery interface from Aperture since 12. 5538 * 5539 * @returns { Array<PhysicalAperture> } The array of supported physical apertures. 5540 * @throws { BusinessError } 202 - Not System Application. 5541 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5542 * @syscap SystemCapability.Multimedia.Camera.Core 5543 * @systemapi 5544 * @since 12 5545 */ 5546 getSupportedPhysicalApertures(): Array<PhysicalAperture>; 5547 } 5548 5549 /** 5550 * Aperture object. 5551 * 5552 * @interface Aperture 5553 * @syscap SystemCapability.Multimedia.Camera.Core 5554 * @systemapi 5555 * @since 11 5556 */ 5557 interface Aperture extends ApertureQuery { 5558 /** 5559 * Gets current virtual aperture value. 5560 * 5561 * @returns { number } The current virtual aperture value. 5562 * @throws { BusinessError } 202 - Not System Application. 5563 * @throws { BusinessError } 7400103 - Session not config. 5564 * @syscap SystemCapability.Multimedia.Camera.Core 5565 * @systemapi 5566 * @since 11 5567 */ 5568 getVirtualAperture(): number; 5569 5570 /** 5571 * Sets virtual aperture value. 5572 * 5573 * @param { number } aperture - virtual aperture value 5574 * @throws { BusinessError } 202 - Not System Application. 5575 * @throws { BusinessError } 7400103 - Session not config. 5576 * @syscap SystemCapability.Multimedia.Camera.Core 5577 * @systemapi 5578 * @since 11 5579 */ 5580 setVirtualAperture(aperture: number): void; 5581 5582 /** 5583 * Gets current physical aperture value. 5584 * 5585 * @returns { number } The current physical aperture value. 5586 * @throws { BusinessError } 202 - Not System Application. 5587 * @throws { BusinessError } 7400103 - Session not config. 5588 * @syscap SystemCapability.Multimedia.Camera.Core 5589 * @systemapi 5590 * @since 11 5591 */ 5592 getPhysicalAperture(): number; 5593 5594 /** 5595 * Sets physical aperture value. 5596 * 5597 * @param { number } aperture - physical aperture value 5598 * @throws { BusinessError } 202 - Not System Application. 5599 * @throws { BusinessError } 7400103 - Session not config. 5600 * @syscap SystemCapability.Multimedia.Camera.Core 5601 * @systemapi 5602 * @since 11 5603 */ 5604 setPhysicalAperture(aperture: number): void; 5605 } 5606 5607 /** 5608 * Portrait Photo session object. 5609 * 5610 * @interface PortraitPhotoSession 5611 * @syscap SystemCapability.Multimedia.Camera.Core 5612 * @systemapi 5613 * @since 11 5614 */ 5615 interface PortraitPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, Beauty, ColorEffect, ColorManagement, Portrait, Aperture { 5616 /** 5617 * Subscribes to error events. 5618 * 5619 * @param { 'error' } type - Event type. 5620 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5621 * @syscap SystemCapability.Multimedia.Camera.Core 5622 * @systemapi 5623 * @since 11 5624 */ 5625 on(type: 'error', callback: ErrorCallback): void; 5626 5627 /** 5628 * Unsubscribes from error events. 5629 * 5630 * @param { 'error' } type - Event type. 5631 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5632 * @syscap SystemCapability.Multimedia.Camera.Core 5633 * @systemapi 5634 * @since 11 5635 */ 5636 off(type: 'error', callback?: ErrorCallback): void; 5637 5638 /** 5639 * Subscribes focus state change event callback. 5640 * 5641 * @param { 'focusStateChange' } type - Event type. 5642 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5643 * @syscap SystemCapability.Multimedia.Camera.Core 5644 * @systemapi 5645 * @since 11 5646 */ 5647 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 5648 5649 /** 5650 * Unsubscribes from focus state change event callback. 5651 * 5652 * @param { 'focusStateChange' } type - Event type. 5653 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5654 * @syscap SystemCapability.Multimedia.Camera.Core 5655 * @systemapi 5656 * @since 11 5657 */ 5658 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 5659 5660 /** 5661 * Subscribes zoom info event callback. 5662 * 5663 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5664 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5665 * @syscap SystemCapability.Multimedia.Camera.Core 5666 * @systemapi 5667 * @since 11 5668 */ 5669 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 5670 5671 /** 5672 * Unsubscribes from zoom info event callback. 5673 * 5674 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5675 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5676 * @syscap SystemCapability.Multimedia.Camera.Core 5677 * @systemapi 5678 * @since 11 5679 */ 5680 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 5681 5682 /** 5683 * Subscribes to lcd flash status. 5684 * 5685 * @param { 'lcdFlashStatus' } type - Event type. 5686 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5687 * @throws { BusinessError } 202 - Not System Application. 5688 * @syscap SystemCapability.Multimedia.Camera.Core 5689 * @systemapi 5690 * @since 13 5691 */ 5692 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 5693 5694 /** 5695 * Unsubscribes from lcd flash status. 5696 * 5697 * @param { 'lcdFlashStatus' } type - Event type. 5698 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5699 * @throws { BusinessError } 202 - Not System Application. 5700 * @syscap SystemCapability.Multimedia.Camera.Core 5701 * @systemapi 5702 * @since 13 5703 */ 5704 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 5705 5706 /** 5707 * Gets session functions. 5708 * 5709 * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. 5710 * @returns { Array<PortraitPhotoFunctions> } List of session functions. 5711 * @throws { BusinessError } 202 - Not System Application. 5712 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 5713 * @syscap SystemCapability.Multimedia.Camera.Core 5714 * @systemapi 5715 * @since 13 5716 */ 5717 getSessionFunctions(outputCapability: CameraOutputCapability): Array<PortraitPhotoFunctions>; 5718 5719 /** 5720 * Gets session conflict functions. 5721 * 5722 * @returns { Array<PortraitPhotoConflictFunctions> } List of session conflict functions. 5723 * @throws { BusinessError } 202 - Not System Application. 5724 * @syscap SystemCapability.Multimedia.Camera.Core 5725 * @systemapi 5726 * @since 13 5727 */ 5728 getSessionConflictFunctions(): Array<PortraitPhotoConflictFunctions>; 5729 } 5730 5731 /** 5732 * Aperture video session object. 5733 * 5734 * @interface ApertureVideoSession 5735 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Aperture 5736 * @syscap SystemCapability.Multimedia.Camera.Core 5737 * @systemapi 5738 * @since 12 5739 */ 5740 interface ApertureVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Aperture { 5741 /** 5742 * Subscribes to error events. 5743 * 5744 * @param { 'error' } type - Event type. 5745 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5746 * @throws { BusinessError } 202 - Not System Application. 5747 * @syscap SystemCapability.Multimedia.Camera.Core 5748 * @systemapi 5749 * @since 12 5750 */ 5751 on(type: 'error', callback: ErrorCallback): void; 5752 5753 /** 5754 * Unsubscribes from error events. 5755 * 5756 * @param { 'error' } type - Event type. 5757 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5758 * @throws { BusinessError } 202 - Not System Application. 5759 * @syscap SystemCapability.Multimedia.Camera.Core 5760 * @systemapi 5761 * @since 12 5762 */ 5763 off(type: 'error', callback?: ErrorCallback): void; 5764 5765 /** 5766 * Subscribes focus state change event callback. 5767 * 5768 * @param { 'focusStateChange' } type - Event type. 5769 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5770 * @throws { BusinessError } 202 - Not System Application. 5771 * @syscap SystemCapability.Multimedia.Camera.Core 5772 * @systemapi 5773 * @since 12 5774 */ 5775 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 5776 5777 /** 5778 * Unsubscribes from focus state change event callback. 5779 * 5780 * @param { 'focusStateChange' } type - Event type. 5781 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5782 * @throws { BusinessError } 202 - Not System Application. 5783 * @syscap SystemCapability.Multimedia.Camera.Core 5784 * @systemapi 5785 * @since 12 5786 */ 5787 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 5788 5789 /** 5790 * Subscribes zoom info event callback. 5791 * 5792 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5793 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5794 * @throws { BusinessError } 202 - Not System Application. 5795 * @syscap SystemCapability.Multimedia.Camera.Core 5796 * @systemapi 5797 * @since 12 5798 */ 5799 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 5800 5801 /** 5802 * Unsubscribes from zoom info event callback. 5803 * 5804 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5805 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5806 * @throws { BusinessError } 202 - Not System Application. 5807 * @syscap SystemCapability.Multimedia.Camera.Core 5808 * @systemapi 5809 * @since 12 5810 */ 5811 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 5812 } 5813 5814 /** 5815 * ManualExposure Query object. 5816 * 5817 * @interface ManualExposureQuery 5818 * @syscap SystemCapability.Multimedia.Camera.Core 5819 * @systemapi 5820 * @since 12 5821 */ 5822 interface ManualExposureQuery { 5823 /** 5824 * Gets the supported manual exposure range. 5825 * 5826 * @returns { Array<number> } The array of manual exposure range. 5827 * @throws { BusinessError } 202 - Not System Application. 5828 * @throws { BusinessError } 7400103 - Session not config. 5829 * @syscap SystemCapability.Multimedia.Camera.Core 5830 * @systemapi 5831 * @since 11 5832 */ 5833 /** 5834 * Gets the supported manual exposure range. 5835 * Move to ManualExposureQuery from ManualExposure since 12. 5836 * 5837 * @returns { Array<number> } The array of manual exposure range. 5838 * @throws { BusinessError } 202 - Not System Application. 5839 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5840 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5841 * @syscap SystemCapability.Multimedia.Camera.Core 5842 * @systemapi 5843 * @since 12 5844 */ 5845 getSupportedExposureRange(): Array<number>; 5846 } 5847 5848 /** 5849 * ManualExposure object. 5850 * 5851 * @interface ManualExposure 5852 * @syscap SystemCapability.Multimedia.Camera.Core 5853 * @systemapi 5854 * @since 11 5855 */ 5856 interface ManualExposure extends ManualExposureQuery { 5857 /** 5858 * Gets current exposure value. 5859 * 5860 * @returns { number } The current exposure value. 5861 * @throws { BusinessError } 202 - Not System Application. 5862 * @throws { BusinessError } 7400103 - Session not config. 5863 * @syscap SystemCapability.Multimedia.Camera.Core 5864 * @systemapi 5865 * @since 11 5866 */ 5867 /** 5868 * Gets current exposure value. 5869 * 5870 * @returns { number } The current exposure value. 5871 * @throws { BusinessError } 202 - Not System Application. 5872 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5873 * @throws { BusinessError } 7400103 - Session not config. 5874 * @syscap SystemCapability.Multimedia.Camera.Core 5875 * @systemapi 5876 * @since 12 5877 */ 5878 getExposure(): number; 5879 5880 /** 5881 * Sets Exposure value. 5882 * 5883 * @param { number } exposure - Exposure value 5884 * @throws { BusinessError } 202 - Not System Application. 5885 * @throws { BusinessError } 7400103 - Session not config. 5886 * @syscap SystemCapability.Multimedia.Camera.Core 5887 * @systemapi 5888 * @since 11 5889 */ 5890 /** 5891 * Sets Exposure value. 5892 * 5893 * @param { number } exposure - Exposure value 5894 * @throws { BusinessError } 202 - Not System Application. 5895 * @throws { BusinessError } 7400102 - Operation not allowed. 5896 * @throws { BusinessError } 7400103 - Session not config. 5897 * @syscap SystemCapability.Multimedia.Camera.Core 5898 * @systemapi 5899 * @since 12 5900 */ 5901 setExposure(exposure: number): void; 5902 } 5903 5904 /** 5905 * Night photo session object. 5906 * 5907 * @interface NightPhotoSession 5908 * @syscap SystemCapability.Multimedia.Camera.Core 5909 * @systemapi 5910 * @since 11 5911 */ 5912 interface NightPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Beauty, ColorManagement, ManualExposure { 5913 /** 5914 * Subscribes to error events. 5915 * 5916 * @param { 'error' } type - Event type. 5917 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5918 * @syscap SystemCapability.Multimedia.Camera.Core 5919 * @systemapi 5920 * @since 11 5921 */ 5922 on(type: 'error', callback: ErrorCallback): void; 5923 5924 /** 5925 * Unsubscribes from error events. 5926 * 5927 * @param { 'error' } type - Event type. 5928 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5929 * @syscap SystemCapability.Multimedia.Camera.Core 5930 * @systemapi 5931 * @since 11 5932 */ 5933 off(type: 'error', callback?: ErrorCallback): void; 5934 5935 /** 5936 * Subscribes focus state change event callback. 5937 * 5938 * @param { 'focusStateChange' } type - Event type. 5939 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5940 * @syscap SystemCapability.Multimedia.Camera.Core 5941 * @systemapi 5942 * @since 11 5943 */ 5944 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 5945 5946 /** 5947 * Unsubscribes from focus state change event callback. 5948 * 5949 * @param { 'focusStateChange' } type - Event type. 5950 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5951 * @syscap SystemCapability.Multimedia.Camera.Core 5952 * @systemapi 5953 * @since 11 5954 */ 5955 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 5956 5957 /** 5958 * Subscribes zoom info event callback. 5959 * 5960 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5961 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5962 * @syscap SystemCapability.Multimedia.Camera.Core 5963 * @systemapi 5964 * @since 11 5965 */ 5966 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 5967 5968 /** 5969 * Unsubscribes from zoom info event callback. 5970 * 5971 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5972 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5973 * @syscap SystemCapability.Multimedia.Camera.Core 5974 * @systemapi 5975 * @since 11 5976 */ 5977 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 5978 5979 /** 5980 * Subscribes to lcd flash status. 5981 * 5982 * @param { 'lcdFlashStatus' } type - Event type. 5983 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5984 * @throws { BusinessError } 202 - Not System Application. 5985 * @syscap SystemCapability.Multimedia.Camera.Core 5986 * @systemapi 5987 * @since 12 5988 */ 5989 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 5990 5991 /** 5992 * Unsubscribes from lcd flash status. 5993 * 5994 * @param { 'lcdFlashStatus' } type - Event type. 5995 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5996 * @throws { BusinessError } 202 - Not System Application. 5997 * @syscap SystemCapability.Multimedia.Camera.Core 5998 * @systemapi 5999 * @since 12 6000 */ 6001 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 6002 } 6003 6004 /** 6005 * ISO info object 6006 * 6007 * @typedef IsoInfo 6008 * @syscap SystemCapability.Multimedia.Camera.Core 6009 * @systemapi 6010 * @since 12 6011 */ 6012 interface IsoInfo { 6013 /** 6014 * ISO value. 6015 * 6016 * @type { ?number } 6017 * @readonly 6018 * @syscap SystemCapability.Multimedia.Camera.Core 6019 * @systemapi 6020 * @since 12 6021 */ 6022 readonly iso?: number; 6023 } 6024 6025 /** 6026 * Exposure info object 6027 * 6028 * @typedef ExposureInfo 6029 * @syscap SystemCapability.Multimedia.Camera.Core 6030 * @systemapi 6031 * @since 12 6032 */ 6033 interface ExposureInfo { 6034 /** 6035 * Exposure time value. 6036 * 6037 * @type { ?number } 6038 * @readonly 6039 * @syscap SystemCapability.Multimedia.Camera.Core 6040 * @systemapi 6041 * @since 12 6042 */ 6043 readonly exposureTime?: number; 6044 } 6045 6046 /** 6047 * Aperture info object 6048 * 6049 * @typedef ApertureInfo 6050 * @syscap SystemCapability.Multimedia.Camera.Core 6051 * @systemapi 6052 * @since 12 6053 */ 6054 interface ApertureInfo { 6055 /** 6056 * Aperture value. 6057 * 6058 * @type { ?number } 6059 * @readonly 6060 * @syscap SystemCapability.Multimedia.Camera.Core 6061 * @systemapi 6062 * @since 12 6063 */ 6064 readonly aperture?: number; 6065 } 6066 6067 /** 6068 * Lumination info object 6069 * 6070 * @typedef LuminationInfo 6071 * @syscap SystemCapability.Multimedia.Camera.Core 6072 * @systemapi 6073 * @since 12 6074 */ 6075 interface LuminationInfo { 6076 /** 6077 * Lumination value. 6078 * 6079 * @type { ?number } 6080 * @readonly 6081 * @syscap SystemCapability.Multimedia.Camera.Core 6082 * @systemapi 6083 * @since 12 6084 */ 6085 readonly lumination?: number; 6086 } 6087 6088 /** 6089 * Professional photo session object. 6090 * 6091 * @interface ProfessionalPhotoSession 6092 * @syscap SystemCapability.Multimedia.Camera.Core 6093 * @systemapi 6094 * @since 12 6095 */ 6096 interface ProfessionalPhotoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { 6097 /** 6098 * Subscribes to error events. 6099 * 6100 * @param { 'error' } type - Event type. 6101 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6102 * @throws { BusinessError } 202 - Not System Application. 6103 * @syscap SystemCapability.Multimedia.Camera.Core 6104 * @systemapi 6105 * @since 12 6106 */ 6107 on(type: 'error', callback: ErrorCallback): void; 6108 6109 /** 6110 * Unsubscribes from error events. 6111 * 6112 * @param { 'error' } type - Event type. 6113 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6114 * @throws { BusinessError } 202 - Not System Application. 6115 * @syscap SystemCapability.Multimedia.Camera.Core 6116 * @systemapi 6117 * @since 12 6118 */ 6119 off(type: 'error', callback?: ErrorCallback): void; 6120 6121 /** 6122 * Subscribes focus state change event callback. 6123 * 6124 * @param { 'focusStateChange' } type - Event type. 6125 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6126 * @throws { BusinessError } 202 - Not System Application. 6127 * @syscap SystemCapability.Multimedia.Camera.Core 6128 * @systemapi 6129 * @since 12 6130 */ 6131 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6132 6133 /** 6134 * Unsubscribes from focus state change event callback. 6135 * 6136 * @param { 'focusStateChange' } type - Event type. 6137 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6138 * @throws { BusinessError } 202 - Not System Application. 6139 * @syscap SystemCapability.Multimedia.Camera.Core 6140 * @systemapi 6141 * @since 12 6142 */ 6143 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6144 6145 /** 6146 * Subscribes zoom info event callback. 6147 * 6148 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6149 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6150 * @throws { BusinessError } 202 - Not System Application. 6151 * @syscap SystemCapability.Multimedia.Camera.Core 6152 * @systemapi 6153 * @since 12 6154 */ 6155 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6156 6157 /** 6158 * Unsubscribes from zoom info event callback. 6159 * 6160 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6161 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6162 * @throws { BusinessError } 202 - Not System Application. 6163 * @syscap SystemCapability.Multimedia.Camera.Core 6164 * @systemapi 6165 * @since 12 6166 */ 6167 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6168 6169 /** 6170 * Subscribes ISO info event callback. 6171 * 6172 * @param { 'isoInfoChange' } type - Event type. 6173 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 6174 * @throws { BusinessError } 202 - Not System Application. 6175 * @syscap SystemCapability.Multimedia.Camera.Core 6176 * @systemapi 6177 * @since 12 6178 */ 6179 on(type: 'isoInfoChange', callback: AsyncCallback<IsoInfo>): void; 6180 6181 /** 6182 * Unsubscribes from ISO info event callback. 6183 * 6184 * @param { 'isoInfoChange' } type - Event type. 6185 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 6186 * @throws { BusinessError } 202 - Not System Application. 6187 * @syscap SystemCapability.Multimedia.Camera.Core 6188 * @systemapi 6189 * @since 12 6190 */ 6191 off(type: 'isoInfoChange', callback?: AsyncCallback<IsoInfo>): void; 6192 6193 /** 6194 * Subscribes exposure info event callback. 6195 * 6196 * @param { 'exposureInfoChange' } type - Event type. 6197 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 6198 * @throws { BusinessError } 202 - Not System Application. 6199 * @syscap SystemCapability.Multimedia.Camera.Core 6200 * @systemapi 6201 * @since 12 6202 */ 6203 on(type: 'exposureInfoChange', callback: AsyncCallback<ExposureInfo>): void; 6204 6205 /** 6206 * Unsubscribes from exposure info event callback. 6207 * 6208 * @param { 'exposureInfoChange' } type - Event type. 6209 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 6210 * @throws { BusinessError } 202 - Not System Application. 6211 * @syscap SystemCapability.Multimedia.Camera.Core 6212 * @systemapi 6213 * @since 12 6214 */ 6215 off(type: 'exposureInfoChange', callback?: AsyncCallback<ExposureInfo>): void; 6216 6217 /** 6218 * Subscribes aperture info event callback. 6219 * 6220 * @param { 'apertureInfoChange' } type - Event type. 6221 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 6222 * @throws { BusinessError } 202 - Not System Application. 6223 * @syscap SystemCapability.Multimedia.Camera.Core 6224 * @systemapi 6225 * @since 12 6226 */ 6227 on(type: 'apertureInfoChange', callback: AsyncCallback<ApertureInfo>): void; 6228 6229 /** 6230 * Unsubscribes from aperture info event callback. 6231 * 6232 * @param { 'apertureInfoChange' } type - Event type. 6233 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 6234 * @throws { BusinessError } 202 - Not System Application. 6235 * @syscap SystemCapability.Multimedia.Camera.Core 6236 * @systemapi 6237 * @since 12 6238 */ 6239 off(type: 'apertureInfoChange', callback?: AsyncCallback<ApertureInfo>): void; 6240 6241 /** 6242 * Subscribes lumination info event callback. 6243 * 6244 * @param { 'luminationInfoChange' } type - Event type. 6245 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 6246 * @throws { BusinessError } 202 - Not System Application. 6247 * @syscap SystemCapability.Multimedia.Camera.Core 6248 * @systemapi 6249 * @since 12 6250 */ 6251 on(type: 'luminationInfoChange', callback: AsyncCallback<LuminationInfo>): void; 6252 6253 /** 6254 * Unsubscribes from lumination info event callback. 6255 * 6256 * @param { 'luminationInfoChange' } type - Event type. 6257 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 6258 * @throws { BusinessError } 202 - Not System Application. 6259 * @syscap SystemCapability.Multimedia.Camera.Core 6260 * @systemapi 6261 * @since 12 6262 */ 6263 off(type: 'luminationInfoChange', callback?: AsyncCallback<LuminationInfo>): void; 6264 } 6265 6266 /** 6267 * Professional video session object. 6268 * 6269 * @interface ProfessionalVideoSession 6270 * @syscap SystemCapability.Multimedia.Camera.Core 6271 * @systemapi 6272 * @since 12 6273 */ 6274 interface ProfessionalVideoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { 6275 /** 6276 * Subscribes to error events. 6277 * 6278 * @param { 'error' } type - Event type. 6279 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6280 * @throws { BusinessError } 202 - Not System Application. 6281 * @syscap SystemCapability.Multimedia.Camera.Core 6282 * @systemapi 6283 * @since 12 6284 */ 6285 on(type: 'error', callback: ErrorCallback): void; 6286 6287 /** 6288 * Unsubscribes from error events. 6289 * 6290 * @param { 'error' } type - Event type. 6291 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6292 * @throws { BusinessError } 202 - Not System Application. 6293 * @syscap SystemCapability.Multimedia.Camera.Core 6294 * @systemapi 6295 * @since 12 6296 */ 6297 off(type: 'error', callback?: ErrorCallback): void; 6298 6299 /** 6300 * Subscribes focus state change event callback. 6301 * 6302 * @param { 'focusStateChange' } type - Event type. 6303 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6304 * @throws { BusinessError } 202 - Not System Application. 6305 * @syscap SystemCapability.Multimedia.Camera.Core 6306 * @systemapi 6307 * @since 12 6308 */ 6309 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6310 6311 /** 6312 * Unsubscribes from focus state change event callback. 6313 * 6314 * @param { 'focusStateChange' } type - Event type. 6315 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6316 * @throws { BusinessError } 202 - Not System Application. 6317 * @syscap SystemCapability.Multimedia.Camera.Core 6318 * @systemapi 6319 * @since 12 6320 */ 6321 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6322 6323 /** 6324 * Subscribes zoom info event callback. 6325 * 6326 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6327 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6328 * @throws { BusinessError } 202 - Not System Application. 6329 * @syscap SystemCapability.Multimedia.Camera.Core 6330 * @systemapi 6331 * @since 12 6332 */ 6333 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6334 6335 /** 6336 * Unsubscribes from zoom info event callback. 6337 * 6338 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6339 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6340 * @throws { BusinessError } 202 - Not System Application. 6341 * @syscap SystemCapability.Multimedia.Camera.Core 6342 * @systemapi 6343 * @since 12 6344 */ 6345 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6346 6347 /** 6348 * Subscribes ISO info event callback. 6349 * 6350 * @param { 'isoInfoChange' } type - Event type. 6351 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 6352 * @throws { BusinessError } 202 - Not System Application. 6353 * @syscap SystemCapability.Multimedia.Camera.Core 6354 * @systemapi 6355 * @since 12 6356 */ 6357 on(type: 'isoInfoChange', callback: AsyncCallback<IsoInfo>): void; 6358 6359 /** 6360 * Unsubscribes from ISO info event callback. 6361 * 6362 * @param { 'isoInfoChange' } type - Event type. 6363 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 6364 * @throws { BusinessError } 202 - Not System Application. 6365 * @syscap SystemCapability.Multimedia.Camera.Core 6366 * @systemapi 6367 * @since 12 6368 */ 6369 off(type: 'isoInfoChange', callback?: AsyncCallback<IsoInfo>): void; 6370 6371 /** 6372 * Subscribes exposure info event callback. 6373 * 6374 * @param { 'exposureInfoChange' } type - Event type. 6375 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 6376 * @throws { BusinessError } 202 - Not System Application. 6377 * @syscap SystemCapability.Multimedia.Camera.Core 6378 * @systemapi 6379 * @since 12 6380 */ 6381 on(type: 'exposureInfoChange', callback: AsyncCallback<ExposureInfo>): void; 6382 6383 /** 6384 * Unsubscribes from exposure info event callback. 6385 * 6386 * @param { 'exposureInfoChange' } type - Event type. 6387 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 6388 * @throws { BusinessError } 202 - Not System Application. 6389 * @syscap SystemCapability.Multimedia.Camera.Core 6390 * @systemapi 6391 * @since 12 6392 */ 6393 off(type: 'exposureInfoChange', callback?: AsyncCallback<ExposureInfo>): void; 6394 6395 /** 6396 * Subscribes aperture info event callback. 6397 * 6398 * @param { 'apertureInfoChange' } type - Event type. 6399 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 6400 * @throws { BusinessError } 202 - Not System Application. 6401 * @syscap SystemCapability.Multimedia.Camera.Core 6402 * @systemapi 6403 * @since 12 6404 */ 6405 on(type: 'apertureInfoChange', callback: AsyncCallback<ApertureInfo>): void; 6406 6407 /** 6408 * Unsubscribes from aperture info event callback. 6409 * 6410 * @param { 'apertureInfoChange' } type - Event type. 6411 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 6412 * @throws { BusinessError } 202 - Not System Application. 6413 * @syscap SystemCapability.Multimedia.Camera.Core 6414 * @systemapi 6415 * @since 12 6416 */ 6417 off(type: 'apertureInfoChange', callback?: AsyncCallback<ApertureInfo>): void; 6418 6419 /** 6420 * Subscribes lumination info event callback. 6421 * 6422 * @param { 'luminationInfoChange' } type - Event type. 6423 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 6424 * @throws { BusinessError } 202 - Not System Application. 6425 * @syscap SystemCapability.Multimedia.Camera.Core 6426 * @systemapi 6427 * @since 12 6428 */ 6429 on(type: 'luminationInfoChange', callback: AsyncCallback<LuminationInfo>): void; 6430 6431 /** 6432 * Unsubscribes from lumination info event callback. 6433 * 6434 * @param { 'luminationInfoChange' } type - Event type. 6435 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 6436 * @throws { BusinessError } 202 - Not System Application. 6437 * @syscap SystemCapability.Multimedia.Camera.Core 6438 * @systemapi 6439 * @since 12 6440 */ 6441 off(type: 'luminationInfoChange', callback?: AsyncCallback<LuminationInfo>): void; 6442 } 6443 6444 /** 6445 * Enum for slow motion status. 6446 * 6447 * @enum { number } 6448 * @syscap SystemCapability.Multimedia.Camera.Core 6449 * @systemapi 6450 * @since 12 6451 */ 6452 enum SlowMotionStatus { 6453 /** 6454 * Slow motion disabled. 6455 * 6456 * @syscap SystemCapability.Multimedia.Camera.Core 6457 * @systemapi 6458 * @since 12 6459 */ 6460 DISABLED = 0, 6461 6462 /** 6463 * Slow motion ready. 6464 * 6465 * @syscap SystemCapability.Multimedia.Camera.Core 6466 * @systemapi 6467 * @since 12 6468 */ 6469 READY = 1, 6470 6471 /** 6472 * Slow motion video start. 6473 * 6474 * @syscap SystemCapability.Multimedia.Camera.Core 6475 * @systemapi 6476 * @since 12 6477 */ 6478 VIDEO_START = 2, 6479 6480 /** 6481 * Slow motion video done. 6482 * 6483 * @syscap SystemCapability.Multimedia.Camera.Core 6484 * @systemapi 6485 * @since 12 6486 */ 6487 VIDEO_DONE = 3, 6488 6489 /** 6490 * Slow motion finished. 6491 * 6492 * @syscap SystemCapability.Multimedia.Camera.Core 6493 * @systemapi 6494 * @since 12 6495 */ 6496 FINISHED = 4 6497 } 6498 6499 /** 6500 * Slow motion video session object. 6501 * 6502 * @interface SlowMotionVideoSession 6503 * @syscap SystemCapability.Multimedia.Camera.Core 6504 * @systemapi 6505 * @since 12 6506 */ 6507 interface SlowMotionVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect { 6508 /** 6509 * Subscribes to error events. 6510 * 6511 * @param { 'error' } type - Event type. 6512 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6513 * @throws { BusinessError } 202 - Not System Application. 6514 * @syscap SystemCapability.Multimedia.Camera.Core 6515 * @systemapi 6516 * @since 12 6517 */ 6518 on(type: 'error', callback: ErrorCallback): void; 6519 6520 /** 6521 * Unsubscribes from error events. 6522 * 6523 * @param { 'error' } type - Event type. 6524 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6525 * @throws { BusinessError } 202 - Not System Application. 6526 * @syscap SystemCapability.Multimedia.Camera.Core 6527 * @systemapi 6528 * @since 12 6529 */ 6530 off(type: 'error', callback?: ErrorCallback): void; 6531 6532 /** 6533 * Subscribes focus state change event callback. 6534 * 6535 * @param { 'focusStateChange' } type - Event type. 6536 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6537 * @throws { BusinessError } 202 - Not System Application. 6538 * @syscap SystemCapability.Multimedia.Camera.Core 6539 * @systemapi 6540 * @since 12 6541 */ 6542 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6543 6544 /** 6545 * Unsubscribes from focus state change event callback. 6546 * 6547 * @param { 'focusStateChange' } type - Event type. 6548 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6549 * @throws { BusinessError } 202 - Not System Application. 6550 * @syscap SystemCapability.Multimedia.Camera.Core 6551 * @systemapi 6552 * @since 12 6553 */ 6554 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6555 6556 /** 6557 * Subscribes zoom info event callback. 6558 * 6559 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6560 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6561 * @throws { BusinessError } 202 - Not System Application. 6562 * @syscap SystemCapability.Multimedia.Camera.Core 6563 * @systemapi 6564 * @since 12 6565 */ 6566 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6567 6568 /** 6569 * Unsubscribes from zoom info event callback. 6570 * 6571 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6572 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6573 * @throws { BusinessError } 202 - Not System Application. 6574 * @syscap SystemCapability.Multimedia.Camera.Core 6575 * @systemapi 6576 * @since 12 6577 */ 6578 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6579 6580 /** 6581 * Determine whether camera slow motion detection is supported. 6582 * 6583 * @returns { boolean } Is camera slow motion detection supported. 6584 * @throws { BusinessError } 202 - Not System Application. 6585 * @throws { BusinessError } 7400103 - Session not config. 6586 * @syscap SystemCapability.Multimedia.Camera.Core 6587 * @systemapi 6588 * @since 12 6589 */ 6590 isSlowMotionDetectionSupported(): boolean; 6591 6592 /** 6593 * Set slow motion detection area. 6594 * 6595 * @param { Rect } area - Detection area. 6596 * @throws { BusinessError } 202 - Not System Application. 6597 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6598 * @throws { BusinessError } 7400103 - Session not config. 6599 * @syscap SystemCapability.Multimedia.Camera.Core 6600 * @systemapi 6601 * @since 12 6602 */ 6603 setSlowMotionDetectionArea(area: Rect): void; 6604 6605 /** 6606 * Subscribes slow motion status callback. 6607 * 6608 * @param { 'slowMotionStatus' } type - Event type. 6609 * @param { AsyncCallback<SlowMotionStatus> } callback - Callback used to get the slow motion status. 6610 * @throws { BusinessError } 202 - Not System Application. 6611 * @syscap SystemCapability.Multimedia.Camera.Core 6612 * @systemapi 6613 * @since 12 6614 */ 6615 on(type: 'slowMotionStatus', callback: AsyncCallback<SlowMotionStatus>): void; 6616 6617 /** 6618 * Unsubscribes slow motion status callback. 6619 * 6620 * @param { 'slowMotionStatus' } type - Event type. 6621 * @param { AsyncCallback<SlowMotionStatus> } callback - Callback used to get the slow motion status. 6622 * @throws { BusinessError } 202 - Not System Application. 6623 * @syscap SystemCapability.Multimedia.Camera.Core 6624 * @systemapi 6625 * @since 12 6626 */ 6627 off(type: 'slowMotionStatus', callback?: AsyncCallback<SlowMotionStatus>): void; 6628 } 6629 6630 /** 6631 * High resolution session object. 6632 * 6633 * @interface HighResolutionPhotoSession 6634 * @syscap SystemCapability.Multimedia.Camera.Core 6635 * @systemapi 6636 * @since 12 6637 */ 6638 interface HighResolutionPhotoSession extends Session, AutoExposure, Focus { 6639 /** 6640 * Subscribes to error events. 6641 * 6642 * @param { 'error' } type - Event type. 6643 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6644 * @throws { BusinessError } 202 - Not System Application. 6645 * @syscap SystemCapability.Multimedia.Camera.Core 6646 * @systemapi 6647 * @since 12 6648 */ 6649 on(type: 'error', callback: ErrorCallback): void; 6650 6651 /** 6652 * Unsubscribes from error events. 6653 * 6654 * @param { 'error' } type - Event type. 6655 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6656 * @throws { BusinessError } 202 - Not System Application. 6657 * @syscap SystemCapability.Multimedia.Camera.Core 6658 * @systemapi 6659 * @since 12 6660 */ 6661 off(type: 'error', callback?: ErrorCallback): void; 6662 6663 /** 6664 * Subscribes focus state change event callback. 6665 * 6666 * @param { 'focusStateChange' } type - Event type. 6667 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6668 * @throws { BusinessError } 202 - Not System Application. 6669 * @syscap SystemCapability.Multimedia.Camera.Core 6670 * @systemapi 6671 * @since 12 6672 */ 6673 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6674 6675 /** 6676 * Unsubscribes from focus state change event callback. 6677 * 6678 * @param { 'focusStateChange' } type - Event type. 6679 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6680 * @throws { BusinessError } 202 - Not System Application. 6681 * @syscap SystemCapability.Multimedia.Camera.Core 6682 * @systemapi 6683 * @since 12 6684 */ 6685 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6686 } 6687 6688 /** 6689 * Macro photo session object. 6690 * 6691 * @interface MacroPhotoSession 6692 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus 6693 * @syscap SystemCapability.Multimedia.Camera.Core 6694 * @systemapi 6695 * @since 12 6696 */ 6697 /** 6698 * Macro photo session object. 6699 * 6700 * @interface MacroPhotoSession 6701 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, DepthFusion 6702 * @syscap SystemCapability.Multimedia.Camera.Core 6703 * @systemapi 6704 * @since 14 6705 */ 6706 interface MacroPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, DepthFusion { 6707 /** 6708 * Subscribes to error events. 6709 * 6710 * @param { 'error' } type - Event type. 6711 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6712 * @throws { BusinessError } 202 - Not System Application. 6713 * @syscap SystemCapability.Multimedia.Camera.Core 6714 * @systemapi 6715 * @since 12 6716 */ 6717 on(type: 'error', callback: ErrorCallback): void; 6718 6719 /** 6720 * Unsubscribes from error events. 6721 * 6722 * @param { 'error' } type - Event type. 6723 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6724 * @throws { BusinessError } 202 - Not System Application. 6725 * @syscap SystemCapability.Multimedia.Camera.Core 6726 * @systemapi 6727 * @since 12 6728 */ 6729 off(type: 'error', callback?: ErrorCallback): void; 6730 6731 /** 6732 * Subscribes focus state change event callback. 6733 * 6734 * @param { 'focusStateChange' } type - Event type. 6735 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6736 * @throws { BusinessError } 202 - Not System Application. 6737 * @syscap SystemCapability.Multimedia.Camera.Core 6738 * @systemapi 6739 * @since 12 6740 */ 6741 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6742 6743 /** 6744 * Unsubscribes from focus state change event callback. 6745 * 6746 * @param { 'focusStateChange' } type - Event type. 6747 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6748 * @throws { BusinessError } 202 - Not System Application. 6749 * @syscap SystemCapability.Multimedia.Camera.Core 6750 * @systemapi 6751 * @since 12 6752 */ 6753 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6754 6755 /** 6756 * Subscribes zoom info event callback. 6757 * 6758 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6759 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6760 * @throws { BusinessError } 202 - Not System Application. 6761 * @syscap SystemCapability.Multimedia.Camera.Core 6762 * @systemapi 6763 * @since 12 6764 */ 6765 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6766 6767 /** 6768 * Unsubscribes from zoom info event callback. 6769 * 6770 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6771 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6772 * @throws { BusinessError } 202 - Not System Application. 6773 * @syscap SystemCapability.Multimedia.Camera.Core 6774 * @systemapi 6775 * @since 12 6776 */ 6777 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6778 } 6779 6780 /** 6781 * Macro video session object. 6782 * 6783 * @interface MacroVideoSession 6784 * @syscap SystemCapability.Multimedia.Camera.Core 6785 * @systemapi 6786 * @since 12 6787 */ 6788 interface MacroVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus { 6789 /** 6790 * Subscribes to error events. 6791 * 6792 * @param { 'error' } type - Event type. 6793 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6794 * @throws { BusinessError } 202 - Not System Application. 6795 * @syscap SystemCapability.Multimedia.Camera.Core 6796 * @systemapi 6797 * @since 12 6798 */ 6799 on(type: 'error', callback: ErrorCallback): void; 6800 6801 /** 6802 * Unsubscribes from error events. 6803 * 6804 * @param { 'error' } type - Event type. 6805 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6806 * @throws { BusinessError } 202 - Not System Application. 6807 * @syscap SystemCapability.Multimedia.Camera.Core 6808 * @systemapi 6809 * @since 12 6810 */ 6811 off(type: 'error', callback?: ErrorCallback): void; 6812 6813 /** 6814 * Subscribes focus state change event callback. 6815 * 6816 * @param { 'focusStateChange' } type - Event type. 6817 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6818 * @throws { BusinessError } 202 - Not System Application. 6819 * @syscap SystemCapability.Multimedia.Camera.Core 6820 * @systemapi 6821 * @since 12 6822 */ 6823 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6824 6825 /** 6826 * Unsubscribes from focus state change event callback. 6827 * 6828 * @param { 'focusStateChange' } type - Event type. 6829 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6830 * @throws { BusinessError } 202 - Not System Application. 6831 * @syscap SystemCapability.Multimedia.Camera.Core 6832 * @systemapi 6833 * @since 12 6834 */ 6835 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6836 6837 /** 6838 * Subscribes zoom info event callback. 6839 * 6840 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6841 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6842 * @throws { BusinessError } 202 - Not System Application. 6843 * @syscap SystemCapability.Multimedia.Camera.Core 6844 * @systemapi 6845 * @since 12 6846 */ 6847 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6848 6849 /** 6850 * Unsubscribes from zoom info event callback. 6851 * 6852 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6853 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6854 * @throws { BusinessError } 202 - Not System Application. 6855 * @syscap SystemCapability.Multimedia.Camera.Core 6856 * @systemapi 6857 * @since 12 6858 */ 6859 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6860 } 6861 6862 /** 6863 * Secure camera session object. 6864 * 6865 * @interface SecureSession 6866 * @syscap SystemCapability.Multimedia.Camera.Core 6867 * @since 12 6868 */ 6869 interface SecureSession extends Session, Flash, AutoExposure, Focus, Zoom { 6870 /** 6871 * Add Secure output for camera. 6872 * 6873 * @param { PreviewOutput } previewOutput - Specify the output as a secure flow. 6874 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6875 * @throws { BusinessError } 7400102 - Operation not allowed. 6876 * @throws { BusinessError } 7400103 - Session not config. 6877 * @syscap SystemCapability.Multimedia.Camera.Core 6878 * @since 12 6879 */ 6880 addSecureOutput(previewOutput: PreviewOutput): void; 6881 6882 /** 6883 * Subscribes to error events. 6884 * 6885 * @param { 'error' } type - Event type. 6886 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6887 * @syscap SystemCapability.Multimedia.Camera.Core 6888 * @since 12 6889 */ 6890 on(type: 'error', callback: ErrorCallback): void; 6891 6892 /** 6893 * Unsubscribes from error events. 6894 * 6895 * @param { 'error' } type - Event type. 6896 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6897 * @syscap SystemCapability.Multimedia.Camera.Core 6898 * @since 12 6899 */ 6900 off(type: 'error', callback?: ErrorCallback): void; 6901 6902 /** 6903 * Subscribes focus status change event callback. 6904 * 6905 * @param { 'focusStateChange' } type - Event type. 6906 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6907 * @syscap SystemCapability.Multimedia.Camera.Core 6908 * @since 12 6909 */ 6910 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6911 6912 /** 6913 * Unsubscribes from focus status change event callback. 6914 * 6915 * @param { 'focusStateChange' } type - Event type. 6916 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6917 * @syscap SystemCapability.Multimedia.Camera.Core 6918 * @since 12 6919 */ 6920 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6921 } 6922 6923 /** 6924 * Light painting photo session object. 6925 * 6926 * @interface LightPaintingPhotoSession 6927 * @extends Session, Flash, Focus, Zoom, ColorEffect 6928 * @syscap SystemCapability.Multimedia.Camera.Core 6929 * @systemapi 6930 * @since 12 6931 */ 6932 interface LightPaintingPhotoSession extends Session, Flash, Focus, Zoom, ColorEffect { 6933 /** 6934 * Subscribes to error events. 6935 * 6936 * @param { 'error' } type - Event type. 6937 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6938 * @throws { BusinessError } 202 - Not System Application. 6939 * @syscap SystemCapability.Multimedia.Camera.Core 6940 * @systemapi 6941 * @since 12 6942 */ 6943 on(type: 'error', callback: ErrorCallback): void; 6944 6945 /** 6946 * Unsubscribes from error events. 6947 * 6948 * @param { 'error' } type - Event type. 6949 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6950 * @throws { BusinessError } 202 - Not System Application. 6951 * @syscap SystemCapability.Multimedia.Camera.Core 6952 * @systemapi 6953 * @since 12 6954 */ 6955 off(type: 'error', callback?: ErrorCallback): void; 6956 6957 /** 6958 * Subscribes focus state change event callback. 6959 * 6960 * @param { 'focusStateChange' } type - Event type. 6961 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6962 * @throws { BusinessError } 202 - Not System Application. 6963 * @syscap SystemCapability.Multimedia.Camera.Core 6964 * @systemapi 6965 * @since 12 6966 */ 6967 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6968 6969 /** 6970 * Unsubscribes from focus state change event callback. 6971 * 6972 * @param { 'focusStateChange' } type - Event type. 6973 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6974 * @throws { BusinessError } 202 - Not System Application. 6975 * @syscap SystemCapability.Multimedia.Camera.Core 6976 * @systemapi 6977 * @since 12 6978 */ 6979 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6980 6981 /** 6982 * Subscribes zoom info event callback. 6983 * 6984 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6985 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6986 * @throws { BusinessError } 202 - Not System Application. 6987 * @syscap SystemCapability.Multimedia.Camera.Core 6988 * @systemapi 6989 * @since 12 6990 */ 6991 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6992 6993 /** 6994 * Unsubscribes from zoom info event callback. 6995 * 6996 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6997 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6998 * @throws { BusinessError } 202 - Not System Application. 6999 * @syscap SystemCapability.Multimedia.Camera.Core 7000 * @systemapi 7001 * @since 12 7002 */ 7003 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 7004 7005 /** 7006 * Gets the light painting type in use. 7007 * 7008 * @returns { LightPaintingType } The light painting type in use. 7009 * @throws { BusinessError } 202 - Not System Application. 7010 * @throws { BusinessError } 7400103 - Session not config. 7011 * @syscap SystemCapability.Multimedia.Camera.Core 7012 * @systemapi 7013 * @since 12 7014 */ 7015 getLightPaintingType(): LightPaintingType; 7016 7017 /** 7018 * Sets a light painting type for a camera device. 7019 * 7020 * @param { LightPaintingType } type - Light painting type to set. 7021 * @throws { BusinessError } 202 - Not System Application. 7022 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7023 * @throws { BusinessError } 7400103 - Session not config. 7024 * @syscap SystemCapability.Multimedia.Camera.Core 7025 * @systemapi 7026 * @since 12 7027 */ 7028 setLightPaintingType(type: LightPaintingType): void; 7029 7030 /** 7031 * Gets supported light painting types. 7032 * 7033 * @returns { Array<LightPaintingType> } List of light painting types. 7034 * @throws { BusinessError } 202 - Not System Application. 7035 * @throws { BusinessError } 7400103 - Session not config. 7036 * @syscap SystemCapability.Multimedia.Camera.Core 7037 * @systemapi 7038 * @since 12 7039 */ 7040 getSupportedLightPaintingTypes(): Array<LightPaintingType>; 7041 } 7042 7043 /** 7044 * Quick shot photo session object. 7045 * 7046 * @interface QuickShotPhotoSession 7047 * @extends Session, AutoExposure, ColorEffect, ColorManagement, EffectSuggestion, Flash, Focus, Zoom 7048 * @syscap SystemCapability.Multimedia.Camera.Core 7049 * @systemapi 7050 * @since 12 7051 */ 7052 interface QuickShotPhotoSession extends Session, AutoExposure, ColorEffect, ColorManagement, EffectSuggestion, Flash, Focus, Zoom { 7053 /** 7054 * Subscribes to error events. 7055 * 7056 * @param { 'error' } type - Event type. 7057 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7058 * @throws { BusinessError } 202 - Not System Application. 7059 * @syscap SystemCapability.Multimedia.Camera.Core 7060 * @systemapi 7061 * @since 12 7062 */ 7063 on(type: 'error', callback: ErrorCallback): void; 7064 7065 /** 7066 * Unsubscribes from error events. 7067 * 7068 * @param { 'error' } type - Event type. 7069 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7070 * @throws { BusinessError } 202 - Not System Application. 7071 * @syscap SystemCapability.Multimedia.Camera.Core 7072 * @systemapi 7073 * @since 12 7074 */ 7075 off(type: 'error', callback?: ErrorCallback): void; 7076 7077 /** 7078 * Subscribes to effect suggestion event callback. 7079 * 7080 * @param { 'effectSuggestionChange' } type - Event type. 7081 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 7082 * @throws { BusinessError } 202 - Not System Application. 7083 * @syscap SystemCapability.Multimedia.Camera.Core 7084 * @systemapi 7085 * @since 12 7086 */ 7087 on(type: 'effectSuggestionChange', callback: AsyncCallback<EffectSuggestionType>): void; 7088 7089 /** 7090 * Unsubscribes from effect suggestion event callback. 7091 * 7092 * @param { 'effectSuggestionChange' } type - Event type. 7093 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 7094 * @throws { BusinessError } 202 - Not System Application. 7095 * @syscap SystemCapability.Multimedia.Camera.Core 7096 * @systemapi 7097 * @since 12 7098 */ 7099 off(type: 'effectSuggestionChange', callback?: AsyncCallback<EffectSuggestionType>): void; 7100 7101 /** 7102 * Subscribes focus state change event callback. 7103 * 7104 * @param { 'focusStateChange' } type - Event type. 7105 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7106 * @throws { BusinessError } 202 - Not System Application. 7107 * @syscap SystemCapability.Multimedia.Camera.Core 7108 * @systemapi 7109 * @since 12 7110 */ 7111 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 7112 7113 /** 7114 * Unsubscribes from focus state change event callback. 7115 * 7116 * @param { 'focusStateChange' } type - Event type. 7117 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7118 * @throws { BusinessError } 202 - Not System Application. 7119 * @syscap SystemCapability.Multimedia.Camera.Core 7120 * @systemapi 7121 * @since 12 7122 */ 7123 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 7124 7125 /** 7126 * Subscribes zoom info event callback. 7127 * 7128 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7129 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7130 * @throws { BusinessError } 202 - Not System Application. 7131 * @syscap SystemCapability.Multimedia.Camera.Core 7132 * @systemapi 7133 * @since 12 7134 */ 7135 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 7136 7137 /** 7138 * Unsubscribes from zoom info event callback. 7139 * 7140 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7141 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7142 * @throws { BusinessError } 202 - Not System Application. 7143 * @syscap SystemCapability.Multimedia.Camera.Core 7144 * @systemapi 7145 * @since 12 7146 */ 7147 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 7148 } 7149 7150 /** 7151 * Panorama photo session object. 7152 * 7153 * @interface PanoramaPhotoSession 7154 * @extends Session, Focus, AutoExposure, WhiteBalance, ColorEffect 7155 * @syscap SystemCapability.Multimedia.Camera.Core 7156 * @systemapi 7157 * @since 12 7158 */ 7159 interface PanoramaPhotoSession extends Session, Focus, AutoExposure, WhiteBalance, ColorEffect { 7160 /** 7161 * Subscribes to error events. 7162 * 7163 * @param { 'error' } type - Event type. 7164 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7165 * @throws { BusinessError } 202 - Not System Application. 7166 * @syscap SystemCapability.Multimedia.Camera.Core 7167 * @systemapi 7168 * @since 12 7169 */ 7170 on(type: 'error', callback: ErrorCallback): void; 7171 7172 /** 7173 * Unsubscribes from error events. 7174 * 7175 * @param { 'error' } type - Event type. 7176 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7177 * @throws { BusinessError } 202 - Not System Application. 7178 * @syscap SystemCapability.Multimedia.Camera.Core 7179 * @systemapi 7180 * @since 12 7181 */ 7182 off(type: 'error', callback?: ErrorCallback): void; 7183 7184 /** 7185 * Subscribes focus state change event callback. 7186 * 7187 * @param { 'focusStateChange' } type - Event type. 7188 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7189 * @throws { BusinessError } 202 - Not System Application. 7190 * @syscap SystemCapability.Multimedia.Camera.Core 7191 * @systemapi 7192 * @since 12 7193 */ 7194 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 7195 7196 /** 7197 * Unsubscribes from focus state change event callback. 7198 * 7199 * @param { 'focusStateChange' } type - Event type. 7200 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7201 * @throws { BusinessError } 202 - Not System Application. 7202 * @syscap SystemCapability.Multimedia.Camera.Core 7203 * @systemapi 7204 * @since 12 7205 */ 7206 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 7207 } 7208 7209 /** 7210 * Fluorescence photo session object. 7211 * 7212 * @interface FluorescencePhotoSession 7213 * @syscap SystemCapability.Multimedia.Camera.Core 7214 * @systemapi 7215 * @since 13 7216 */ 7217 interface FluorescencePhotoSession extends Session, AutoExposure, Focus, Zoom { 7218 /** 7219 * Subscribes to error events. 7220 * 7221 * @param { 'error' } type - Event type. 7222 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7223 * @throws { BusinessError } 202 - Not System Application. 7224 * @syscap SystemCapability.Multimedia.Camera.Core 7225 * @systemapi 7226 * @since 13 7227 */ 7228 on(type: 'error', callback: ErrorCallback): void; 7229 7230 /** 7231 * Unsubscribes from error events. 7232 * 7233 * @param { 'error' } type - Event type. 7234 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7235 * @throws { BusinessError } 202 - Not System Application. 7236 * @syscap SystemCapability.Multimedia.Camera.Core 7237 * @systemapi 7238 * @since 13 7239 */ 7240 off(type: 'error', callback?: ErrorCallback): void; 7241 7242 /** 7243 * Subscribes focus state change event callback. 7244 * 7245 * @param { 'focusStateChange' } type - Event type. 7246 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7247 * @throws { BusinessError } 202 - Not System Application. 7248 * @syscap SystemCapability.Multimedia.Camera.Core 7249 * @systemapi 7250 * @since 13 7251 */ 7252 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 7253 7254 /** 7255 * Unsubscribes from focus state change event callback. 7256 * 7257 * @param { 'focusStateChange' } type - Event type. 7258 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7259 * @throws { BusinessError } 202 - Not System Application. 7260 * @syscap SystemCapability.Multimedia.Camera.Core 7261 * @systemapi 7262 * @since 13 7263 */ 7264 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 7265 } 7266 7267 /** 7268 * Photo Functions object. 7269 * 7270 * @interface PhotoFunctions 7271 * @extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery 7272 * @syscap SystemCapability.Multimedia.Camera.Core 7273 * @systemapi 7274 * @since 13 7275 */ 7276 interface PhotoFunctions extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery { 7277 } 7278 7279 /** 7280 * Video Functions object. 7281 * 7282 * @interface VideoFunctions 7283 * @extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, StabilizationQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery 7284 * @syscap SystemCapability.Multimedia.Camera.Core 7285 * @systemapi 7286 * @since 13 7287 */ 7288 interface VideoFunctions extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, StabilizationQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery { 7289 } 7290 7291 /** 7292 * Portrait Photo Functions object. 7293 * 7294 * @interface PortraitPhotoFunctions 7295 * @extends FlashQuery, AutoExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, PortraitQuery, ApertureQuery, SceneDetectionQuery 7296 * @syscap SystemCapability.Multimedia.Camera.Core 7297 * @systemapi 7298 * @since 13 7299 */ 7300 interface PortraitPhotoFunctions extends FlashQuery, AutoExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, PortraitQuery, ApertureQuery, SceneDetectionQuery { 7301 } 7302 7303 /** 7304 * Photo Conflict Functions object. 7305 * 7306 * @interface PhotoConflictFunctions 7307 * @extends ZoomQuery, MacroQuery 7308 * @syscap SystemCapability.Multimedia.Camera.Core 7309 * @systemapi 7310 * @since 13 7311 */ 7312 interface PhotoConflictFunctions extends ZoomQuery, MacroQuery { 7313 } 7314 7315 /** 7316 * Video Conflict Functions object. 7317 * 7318 * @interface VideoConflictFunctions 7319 * @extends ZoomQuery, MacroQuery 7320 * @syscap SystemCapability.Multimedia.Camera.Core 7321 * @systemapi 7322 * @since 13 7323 */ 7324 interface VideoConflictFunctions extends ZoomQuery, MacroQuery { 7325 } 7326 7327 /** 7328 * Portrait Photo Conflict Functions object. 7329 * 7330 * @interface PortraitPhotoFunctions 7331 * @extends ZoomQuery, PortraitQuery, ApertureQuery 7332 * @syscap SystemCapability.Multimedia.Camera.Core 7333 * @systemapi 7334 * @since 13 7335 */ 7336 interface PortraitPhotoConflictFunctions extends ZoomQuery, PortraitQuery, ApertureQuery { 7337 } 7338 7339 /** 7340 * Camera output object. 7341 * 7342 * @interface CameraOutput 7343 * @syscap SystemCapability.Multimedia.Camera.Core 7344 * @since 10 7345 */ 7346 interface CameraOutput { 7347 /** 7348 * Release output instance. 7349 * 7350 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7351 * @throws { BusinessError } 7400201 - Camera service fatal error. 7352 * @syscap SystemCapability.Multimedia.Camera.Core 7353 * @since 10 7354 */ 7355 release(callback: AsyncCallback<void>): void; 7356 7357 /** 7358 * Release output instance. 7359 * 7360 * @returns { Promise<void> } Promise used to return the result. 7361 * @throws { BusinessError } 7400201 - Camera service fatal error. 7362 * @syscap SystemCapability.Multimedia.Camera.Core 7363 * @since 10 7364 */ 7365 release(): Promise<void>; 7366 } 7367 7368 /** 7369 * SketchStatusData object 7370 * 7371 * @typedef SketchStatusData 7372 * @syscap SystemCapability.Multimedia.Camera.Core 7373 * @systemapi 7374 * @since 11 7375 */ 7376 interface SketchStatusData { 7377 /** 7378 * Status of the sketch stream. 7379 * 0 is stop, and 1 is start. 7380 * 7381 * @type { number } 7382 * @syscap SystemCapability.Multimedia.Camera.Core 7383 * @systemapi 7384 * @since 11 7385 */ 7386 status: number; 7387 7388 /** 7389 * The zoom ratio of the sketch stream. 7390 * 7391 * @type { number } 7392 * @syscap SystemCapability.Multimedia.Camera.Core 7393 * @systemapi 7394 * @since 11 7395 */ 7396 sketchRatio: number; 7397 } 7398 7399 /** 7400 * Preview output object. 7401 * 7402 * @interface PreviewOutput 7403 * @syscap SystemCapability.Multimedia.Camera.Core 7404 * @since 10 7405 */ 7406 interface PreviewOutput extends CameraOutput { 7407 /** 7408 * Start output instance. 7409 * 7410 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7411 * @throws { BusinessError } 7400103 - Session not config. 7412 * @syscap SystemCapability.Multimedia.Camera.Core 7413 * @since 10 7414 * @deprecated since 11 7415 * @useinstead ohos.multimedia.camera.Session#start 7416 */ 7417 start(callback: AsyncCallback<void>): void; 7418 7419 /** 7420 * Start output instance. 7421 * 7422 * @returns { Promise<void> } Promise used to return the result. 7423 * @throws { BusinessError } 7400103 - Session not config. 7424 * @syscap SystemCapability.Multimedia.Camera.Core 7425 * @since 10 7426 * @deprecated since 11 7427 * @useinstead ohos.multimedia.camera.Session#start 7428 */ 7429 start(): Promise<void>; 7430 7431 /** 7432 * Stop output instance. 7433 * 7434 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7435 * @syscap SystemCapability.Multimedia.Camera.Core 7436 * @since 10 7437 * @deprecated since 11 7438 * @useinstead ohos.multimedia.camera.Session#stop 7439 */ 7440 stop(callback: AsyncCallback<void>): void; 7441 7442 /** 7443 * Stop output instance. 7444 * 7445 * @returns { Promise<void> } Promise used to return the result. 7446 * @syscap SystemCapability.Multimedia.Camera.Core 7447 * @since 10 7448 * @deprecated since 11 7449 * @useinstead ohos.multimedia.camera.Session#stop 7450 */ 7451 stop(): Promise<void>; 7452 7453 /** 7454 * Subscribes frame start event callback. 7455 * 7456 * @param { 'frameStart' } type - Event type. 7457 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7458 * @syscap SystemCapability.Multimedia.Camera.Core 7459 * @since 10 7460 */ 7461 on(type: 'frameStart', callback: AsyncCallback<void>): void; 7462 7463 /** 7464 * Unsubscribes from frame start event callback. 7465 * 7466 * @param { 'frameStart' } type - Event type. 7467 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7468 * @syscap SystemCapability.Multimedia.Camera.Core 7469 * @since 10 7470 */ 7471 off(type: 'frameStart', callback?: AsyncCallback<void>): void; 7472 7473 /** 7474 * Subscribes frame end event callback. 7475 * 7476 * @param { 'frameEnd' } type - Event type. 7477 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7478 * @syscap SystemCapability.Multimedia.Camera.Core 7479 * @since 10 7480 */ 7481 on(type: 'frameEnd', callback: AsyncCallback<void>): void; 7482 7483 /** 7484 * Unsubscribes from frame end event callback. 7485 * 7486 * @param { 'frameEnd' } type - Event type. 7487 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7488 * @syscap SystemCapability.Multimedia.Camera.Core 7489 * @since 10 7490 */ 7491 off(type: 'frameEnd', callback?: AsyncCallback<void>): void; 7492 7493 /** 7494 * Subscribes to error events. 7495 * 7496 * @param { 'error' } type - Event type. 7497 * @param { ErrorCallback } callback - Callback used to get the preview output errors. 7498 * @syscap SystemCapability.Multimedia.Camera.Core 7499 * @since 10 7500 */ 7501 on(type: 'error', callback: ErrorCallback): void; 7502 7503 /** 7504 * Unsubscribes from error events. 7505 * 7506 * @param { 'error' } type - Event type. 7507 * @param { ErrorCallback } callback - Callback used to get the preview output errors. 7508 * @syscap SystemCapability.Multimedia.Camera.Core 7509 * @since 10 7510 */ 7511 off(type: 'error', callback?: ErrorCallback): void; 7512 7513 /** 7514 * Get supported frame rates which can be set during session running. 7515 * 7516 * @returns { Array<FrameRateRange> } The array of supported frame rate range. 7517 * @syscap SystemCapability.Multimedia.Camera.Core 7518 * @since 12 7519 */ 7520 getSupportedFrameRates(): Array<FrameRateRange> 7521 7522 /** 7523 * Set a frame rate range. 7524 * 7525 * @param { number } minFps - Minimum frame rate per second. 7526 * @param { number } maxFps - Maximum frame rate per second. 7527 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7528 * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. 7529 * @syscap SystemCapability.Multimedia.Camera.Core 7530 * @since 12 7531 */ 7532 setFrameRate(minFps: number, maxFps: number): void 7533 7534 /** 7535 * Get active frame rate range which has been set before. 7536 * 7537 * @returns { FrameRateRange } The active frame rate range. 7538 * @syscap SystemCapability.Multimedia.Camera.Core 7539 * @since 12 7540 */ 7541 getActiveFrameRate(): FrameRateRange; 7542 7543 /** 7544 * Gets the preview rotation angle. 7545 * 7546 * @param { number } displayRotation - The current display rotation angle. 7547 * @returns { ImageRotation } The preview rotation angle. 7548 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7549 * @throws { BusinessError } 7400201 - Camera service fatal error. 7550 * @syscap SystemCapability.Multimedia.Camera.Core 7551 * @since 12 7552 */ 7553 getPreviewRotation(displayRotation: number): ImageRotation; 7554 7555 /** 7556 * Sets the preview rotation angle. 7557 * 7558 * @param { ImageRotation } previewRotation - Preview display rotation angle. 7559 * @param { boolean } isDisplayLocked - TRUE means the display is locked, if not set, the default is FALSE. 7560 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7561 * @throws { BusinessError } 7400201 - Camera service fatal error. 7562 * @syscap SystemCapability.Multimedia.Camera.Core 7563 * @since 12 7564 */ 7565 setPreviewRotation(previewRotation: ImageRotation, isDisplayLocked?: boolean): void; 7566 7567 /** 7568 * Gets the current preconfig type if you had already call preconfig interface. 7569 * 7570 * @returns { Profile } The current preconfig type. 7571 * @throws { BusinessError } 7400201 - Camera service fatal error. 7572 * @syscap SystemCapability.Multimedia.Camera.Core 7573 * @since 12 7574 */ 7575 getActiveProfile(): Profile; 7576 7577 /** 7578 * Adds a deferred surface. 7579 * 7580 * @param { string } surfaceId - Surface object id used in camera photo output. 7581 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7582 * @syscap SystemCapability.Multimedia.Camera.Core 7583 * @systemapi 7584 * @since 10 7585 */ 7586 /** 7587 * Adds a deferred surface. 7588 * 7589 * @param { string } surfaceId - Surface object id used in camera photo output. 7590 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7591 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7592 * @syscap SystemCapability.Multimedia.Camera.Core 7593 * @systemapi 7594 * @since 13 7595 */ 7596 addDeferredSurface(surfaceId: string): void; 7597 7598 /** 7599 * Determine whether camera sketch is supported. 7600 * 7601 * @returns { boolean } Is camera sketch supported. 7602 * @throws { BusinessError } 202 - Not System Application. 7603 * @syscap SystemCapability.Multimedia.Camera.Core 7604 * @systemapi 7605 * @since 11 7606 */ 7607 isSketchSupported(): boolean; 7608 7609 /** 7610 * Gets the specific zoom ratio when sketch stream open. 7611 * 7612 * @returns { number } The specific zoom ratio of sketch. 7613 * @throws { BusinessError } 202 - Not System Application. 7614 * @throws { BusinessError } 7400103 - Session not config. 7615 * @syscap SystemCapability.Multimedia.Camera.Core 7616 * @systemapi 7617 * @since 11 7618 */ 7619 getSketchRatio(): number; 7620 7621 /** 7622 * Enable sketch for camera. 7623 * 7624 * @param { boolean } enabled - enable sketch for camera if TRUE. 7625 * @throws { BusinessError } 202 - Not System Application. 7626 * @throws { BusinessError } 7400103 - Session not config. 7627 * @syscap SystemCapability.Multimedia.Camera.Core 7628 * @systemapi 7629 * @since 11 7630 */ 7631 /** 7632 * Enable sketch for camera. 7633 * 7634 * @param { boolean } enabled - enable sketch for camera if TRUE. 7635 * @throws { BusinessError } 202 - Not System Application. 7636 * @throws { BusinessError } 7400102 - Operation not allowed. 7637 * @throws { BusinessError } 7400103 - Session not config. 7638 * @throws { BusinessError } 7400201 - Camera service fatal error. 7639 * @syscap SystemCapability.Multimedia.Camera.Core 7640 * @systemapi 7641 * @since 12 7642 */ 7643 enableSketch(enabled: boolean): void; 7644 7645 /** 7646 * Attach surface to the sketch stream. 7647 * 7648 * @param { string } surfaceId - Surface object id used in sketch stream. 7649 * @throws { BusinessError } 202 - Not System Application. 7650 * @throws { BusinessError } 7400103 - Session not config. 7651 * @syscap SystemCapability.Multimedia.Camera.Core 7652 * @systemapi 7653 * @since 11 7654 */ 7655 /** 7656 * Attach surface to the sketch stream. 7657 * 7658 * @param { string } surfaceId - Surface object id used in sketch stream. 7659 * @throws { BusinessError } 202 - Not System Application. 7660 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7661 * @throws { BusinessError } 7400103 - Session not config. 7662 * @throws { BusinessError } 7400201 - Camera service fatal error. 7663 * @syscap SystemCapability.Multimedia.Camera.Core 7664 * @systemapi 7665 * @since 12 7666 */ 7667 attachSketchSurface(surfaceId: string): void; 7668 7669 /** 7670 * Subscribes sketch status changed event callback. 7671 * 7672 * @param { 'sketchStatusChanged' } type - Event type. 7673 * @param { AsyncCallback<SketchStatusData> } callback - Callback used to sketch status data. 7674 * @throws { BusinessError } 202 - Not System Application. 7675 * @syscap SystemCapability.Multimedia.Camera.Core 7676 * @systemapi 7677 * @since 11 7678 */ 7679 on(type: 'sketchStatusChanged', callback: AsyncCallback<SketchStatusData>): void; 7680 7681 /** 7682 * Unsubscribes sketch status changed event callback. 7683 * 7684 * @param { 'sketchStatusChanged' } type - Event type. 7685 * @param { AsyncCallback<SketchStatusData> } callback - Callback used to get sketch status data. 7686 * @throws { BusinessError } 202 - Not System Application. 7687 * @syscap SystemCapability.Multimedia.Camera.Core 7688 * @systemapi 7689 * @since 11 7690 */ 7691 off(type: 'sketchStatusChanged', callback?: AsyncCallback<SketchStatusData>): void; 7692 } 7693 7694 /** 7695 * Enum for effect suggestion. 7696 * 7697 * @enum { number } 7698 * @syscap SystemCapability.Multimedia.Camera.Core 7699 * @systemapi 7700 * @since 12 7701 */ 7702 enum EffectSuggestionType { 7703 /** 7704 * None. 7705 * 7706 * @syscap SystemCapability.Multimedia.Camera.Core 7707 * @systemapi 7708 * @since 12 7709 */ 7710 EFFECT_SUGGESTION_NONE = 0, 7711 /** 7712 * Portrait. 7713 * 7714 * @syscap SystemCapability.Multimedia.Camera.Core 7715 * @systemapi 7716 * @since 12 7717 */ 7718 EFFECT_SUGGESTION_PORTRAIT = 1, 7719 /** 7720 * Food. 7721 * 7722 * @syscap SystemCapability.Multimedia.Camera.Core 7723 * @systemapi 7724 * @since 12 7725 */ 7726 EFFECT_SUGGESTION_FOOD = 2, 7727 7728 /** 7729 * Sky. 7730 * 7731 * @syscap SystemCapability.Multimedia.Camera.Core 7732 * @systemapi 7733 * @since 12 7734 */ 7735 EFFECT_SUGGESTION_SKY = 3, 7736 7737 /** 7738 * Sunrise and sunset. 7739 * 7740 * @syscap SystemCapability.Multimedia.Camera.Core 7741 * @systemapi 7742 * @since 12 7743 */ 7744 EFFECT_SUGGESTION_SUNRISE_SUNSET = 4 7745 } 7746 7747 /** 7748 * Effect suggestion status 7749 * 7750 * @syscap SystemCapability.Multimedia.Camera.Core 7751 * @systemapi 7752 * @since 12 7753 */ 7754 class EffectSuggestionStatus { 7755 /** 7756 * Effect Suggestion type. 7757 * 7758 * @type { EffectSuggestionType } 7759 * @syscap SystemCapability.Multimedia.Camera.Core 7760 * @systemapi 7761 * @since 12 7762 */ 7763 type: EffectSuggestionType; 7764 /** 7765 * Effect Suggestion type status. 7766 * 7767 * @type { boolean } 7768 * @syscap SystemCapability.Multimedia.Camera.Core 7769 * @systemapi 7770 * @since 12 7771 */ 7772 status: boolean; 7773 } 7774 7775 /** 7776 * Enumerates the image rotation angles. 7777 * 7778 * @enum { number } 7779 * @syscap SystemCapability.Multimedia.Camera.Core 7780 * @since 10 7781 */ 7782 enum ImageRotation { 7783 /** 7784 * The capture image rotates 0 degrees. 7785 * 7786 * @syscap SystemCapability.Multimedia.Camera.Core 7787 * @since 10 7788 */ 7789 ROTATION_0 = 0, 7790 7791 /** 7792 * The capture image rotates 90 degrees. 7793 * 7794 * @syscap SystemCapability.Multimedia.Camera.Core 7795 * @since 10 7796 */ 7797 ROTATION_90 = 90, 7798 7799 /** 7800 * The capture image rotates 180 degrees. 7801 * 7802 * @syscap SystemCapability.Multimedia.Camera.Core 7803 * @since 10 7804 */ 7805 ROTATION_180 = 180, 7806 7807 /** 7808 * The capture image rotates 270 degrees. 7809 * 7810 * @syscap SystemCapability.Multimedia.Camera.Core 7811 * @since 10 7812 */ 7813 ROTATION_270 = 270 7814 } 7815 7816 /** 7817 * Photo capture location 7818 * 7819 * @typedef Location 7820 * @syscap SystemCapability.Multimedia.Camera.Core 7821 * @since 10 7822 */ 7823 interface Location { 7824 /** 7825 * Latitude. 7826 * 7827 * @type { number } 7828 * @syscap SystemCapability.Multimedia.Camera.Core 7829 * @since 10 7830 */ 7831 latitude: number; 7832 7833 /** 7834 * Longitude. 7835 * 7836 * @type { number } 7837 * @syscap SystemCapability.Multimedia.Camera.Core 7838 * @since 10 7839 */ 7840 longitude: number; 7841 7842 /** 7843 * Altitude. 7844 * 7845 * @type { number } 7846 * @syscap SystemCapability.Multimedia.Camera.Core 7847 * @since 10 7848 */ 7849 altitude: number; 7850 } 7851 7852 /** 7853 * Enumerates the image quality levels. 7854 * 7855 * @enum { number } 7856 * @syscap SystemCapability.Multimedia.Camera.Core 7857 * @since 10 7858 */ 7859 enum QualityLevel { 7860 /** 7861 * High image quality. 7862 * 7863 * @syscap SystemCapability.Multimedia.Camera.Core 7864 * @since 10 7865 */ 7866 QUALITY_LEVEL_HIGH = 0, 7867 7868 /** 7869 * Medium image quality. 7870 * 7871 * @syscap SystemCapability.Multimedia.Camera.Core 7872 * @since 10 7873 */ 7874 QUALITY_LEVEL_MEDIUM = 1, 7875 7876 /** 7877 * Low image quality. 7878 * 7879 * @syscap SystemCapability.Multimedia.Camera.Core 7880 * @since 10 7881 */ 7882 QUALITY_LEVEL_LOW = 2 7883 } 7884 7885 /** 7886 * Photo capture options to set. 7887 * 7888 * @typedef PhotoCaptureSetting 7889 * @syscap SystemCapability.Multimedia.Camera.Core 7890 * @since 10 7891 */ 7892 interface PhotoCaptureSetting { 7893 /** 7894 * Photo image quality. 7895 * 7896 * @type { ?QualityLevel } 7897 * @syscap SystemCapability.Multimedia.Camera.Core 7898 * @since 10 7899 */ 7900 quality?: QualityLevel; 7901 7902 /** 7903 * Photo rotation. 7904 * 7905 * @type { ?ImageRotation } 7906 * @syscap SystemCapability.Multimedia.Camera.Core 7907 * @since 10 7908 */ 7909 rotation?: ImageRotation; 7910 7911 /** 7912 * Photo location. 7913 * 7914 * @type { ?Location } 7915 * @syscap SystemCapability.Multimedia.Camera.Core 7916 * @since 10 7917 */ 7918 location?: Location; 7919 7920 /** 7921 * Set the mirror photo function switch, default to false. 7922 * 7923 * @type { ?boolean } 7924 * @syscap SystemCapability.Multimedia.Camera.Core 7925 * @since 10 7926 */ 7927 mirror?: boolean; 7928 } 7929 7930 /** 7931 * Enumerates the delivery image types. 7932 * 7933 * @enum { number } 7934 * @syscap SystemCapability.Multimedia.Camera.Core 7935 * @systemapi 7936 * @since 11 7937 */ 7938 enum DeferredDeliveryImageType { 7939 /** 7940 * Undefer image delivery. 7941 * 7942 * @syscap SystemCapability.Multimedia.Camera.Core 7943 * @systemapi 7944 * @since 11 7945 */ 7946 NONE = 0, 7947 7948 /** 7949 * Defer photo delivery when capturing photos. 7950 * 7951 * @syscap SystemCapability.Multimedia.Camera.Core 7952 * @systemapi 7953 * @since 11 7954 */ 7955 PHOTO = 1, 7956 7957 /** 7958 * Defer video delivery when capturing videos. 7959 * 7960 * @syscap SystemCapability.Multimedia.Camera.Core 7961 * @systemapi 7962 * @since 11 7963 */ 7964 VIDEO = 2 7965 } 7966 7967 /** 7968 * Photo object 7969 * 7970 * @typedef Photo 7971 * @syscap SystemCapability.Multimedia.Camera.Core 7972 * @since 11 7973 */ 7974 interface Photo { 7975 /** 7976 * Main image. 7977 * 7978 * @type { image.Image } 7979 * @syscap SystemCapability.Multimedia.Camera.Core 7980 * @since 11 7981 */ 7982 main: image.Image; 7983 7984 /** 7985 * Raw image. 7986 * 7987 * @type { ?image.Image } 7988 * @syscap SystemCapability.Multimedia.Camera.Core 7989 * @systemapi 7990 * @since 12 7991 */ 7992 raw?: image.Image; 7993 7994 /** 7995 * Depth data. 7996 * 7997 * @type { DepthData } 7998 * @syscap SystemCapability.Multimedia.Camera.Core 7999 * @systemapi 8000 * @since 13 8001 */ 8002 depthData?: DepthData; 8003 8004 /** 8005 * Release Photo object. 8006 * 8007 * @returns { Promise<void> } Promise used to return the result. 8008 * @syscap SystemCapability.Multimedia.Camera.Core 8009 * @since 11 8010 */ 8011 release(): Promise<void>; 8012 } 8013 8014 /** 8015 * DeferredPhotoProxy object 8016 * 8017 * @typedef DeferredPhotoProxy 8018 * @syscap SystemCapability.Multimedia.Camera.Core 8019 * @systemapi 8020 * @since 11 8021 */ 8022 interface DeferredPhotoProxy { 8023 /** 8024 * Thumbnail image. 8025 * 8026 * @returns { Promise<image.PixelMap> } Promise used to return the result. 8027 * @throws { BusinessError } 202 - Not System Application. 8028 * @syscap SystemCapability.Multimedia.Camera.Core 8029 * @systemapi 8030 * @since 11 8031 */ 8032 getThumbnail(): Promise<image.PixelMap>; 8033 8034 /** 8035 * Release DeferredPhotoProxy object. 8036 * 8037 * @returns { Promise<void> } Promise used to return the result. 8038 * @throws { BusinessError } 202 - Not System Application. 8039 * @syscap SystemCapability.Multimedia.Camera.Core 8040 * @systemapi 8041 * @since 11 8042 */ 8043 release(): Promise<void>; 8044 } 8045 8046 /** 8047 * Enumerates the camera video codec type. 8048 * 8049 * @enum { number } 8050 * @syscap SystemCapability.Multimedia.Camera.Core 8051 * @since 13 8052 */ 8053 enum VideoCodecType { 8054 /** 8055 * Codec type AVC. 8056 * 8057 * @syscap SystemCapability.Multimedia.Camera.Core 8058 * @since 13 8059 */ 8060 AVC = 0, 8061 8062 /** 8063 * Codec type HEVC. 8064 * 8065 * @syscap SystemCapability.Multimedia.Camera.Core 8066 * @since 13 8067 */ 8068 HEVC = 1 8069 } 8070 8071 /** 8072 * Photo output object. 8073 * 8074 * @interface PhotoOutput 8075 * @syscap SystemCapability.Multimedia.Camera.Core 8076 * @since 10 8077 */ 8078 interface PhotoOutput extends CameraOutput { 8079 /** 8080 * Start capture output. 8081 * 8082 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8083 * @throws { BusinessError } 7400104 - Session not running. 8084 * @throws { BusinessError } 7400201 - Camera service fatal error. 8085 * @syscap SystemCapability.Multimedia.Camera.Core 8086 * @since 10 8087 */ 8088 capture(callback: AsyncCallback<void>): void; 8089 8090 /** 8091 * Start capture output. 8092 * 8093 * @returns { Promise<void> } Promise used to return the result. 8094 * @throws { BusinessError } 7400104 - Session not running. 8095 * @throws { BusinessError } 7400201 - Camera service fatal error. 8096 * @syscap SystemCapability.Multimedia.Camera.Core 8097 * @since 10 8098 */ 8099 capture(): Promise<void>; 8100 8101 /** 8102 * Start capture output. 8103 * 8104 * @param { PhotoCaptureSetting } setting - Photo capture settings. 8105 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8106 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8107 * @throws { BusinessError } 7400104 - Session not running. 8108 * @throws { BusinessError } 7400201 - Camera service fatal error. 8109 * @syscap SystemCapability.Multimedia.Camera.Core 8110 * @since 10 8111 */ 8112 capture(setting: PhotoCaptureSetting, callback: AsyncCallback<void>): void; 8113 8114 /** 8115 * Start capture output. 8116 * 8117 * @param { PhotoCaptureSetting } setting - Photo capture settings. 8118 * @returns { Promise<void> } Promise used to return the result. 8119 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8120 * @throws { BusinessError } 7400104 - Session not running. 8121 * @throws { BusinessError } 7400201 - Camera service fatal error. 8122 * @syscap SystemCapability.Multimedia.Camera.Core 8123 * @since 10 8124 */ 8125 /** 8126 * Start capture output. 8127 * Remove optional param. 8128 * 8129 * @param { PhotoCaptureSetting } setting - Photo capture settings. 8130 * @returns { Promise<void> } Promise used to return the result. 8131 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8132 * @throws { BusinessError } 7400104 - Session not running. 8133 * @throws { BusinessError } 7400201 - Camera service fatal error. 8134 * @syscap SystemCapability.Multimedia.Camera.Core 8135 * @since 11 8136 */ 8137 capture(setting: PhotoCaptureSetting): Promise<void>; 8138 8139 /** 8140 * Start burst capture. 8141 * 8142 * @param { PhotoCaptureSetting } setting - Photo capture settings. 8143 * @returns { Promise<void> } Promise used to return the result. 8144 * @throws { BusinessError } 202 - Not System Application. 8145 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8146 * @throws { BusinessError } 7400104 - Session not running. 8147 * @throws { BusinessError } 7400201 - Camera service fatal error. 8148 * @syscap SystemCapability.Multimedia.Camera.Core 8149 * @systemapi 8150 * @since 12 8151 */ 8152 burstCapture(setting: PhotoCaptureSetting): Promise<void>; 8153 8154 /** 8155 * Confirm capture in Night mode or end burst capture. 8156 * 8157 * @throws { BusinessError } 202 - Not System Application. 8158 * @throws { BusinessError } 7400104 - Session not running. 8159 * @throws { BusinessError } 7400201 - Camera service fatal error. 8160 * @syscap SystemCapability.Multimedia.Camera.Core 8161 * @systemapi 8162 * @since 11 8163 */ 8164 confirmCapture(); 8165 8166 /** 8167 * Confirm if the raw image delivery is supported 8168 * 8169 * @returns { boolean } TRUE if the type of delivery image is support. 8170 * @throws { BusinessError } 202 - Not System Application. 8171 * @throws { BusinessError } 7400104 - Session not running. 8172 * @throws { BusinessError } 7400201 - Camera service fatal error. 8173 * @syscap SystemCapability.Multimedia.Camera.Core 8174 * @systemapi 8175 * @since 13 8176 */ 8177 isRawDeliverySupported(): boolean; 8178 8179 /** 8180 * Enable raw image image delivery. 8181 * 8182 * @param { boolean } enabled - Target state for raw image delivery. 8183 * @throws { BusinessError } 202 - Not System Application. 8184 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8185 * @throws { BusinessError } 7400104 - Session not running. 8186 * @throws { BusinessError } 7400201 - Camera service fatal error. 8187 * @syscap SystemCapability.Multimedia.Camera.Core 8188 * @systemapi 8189 * @since 13 8190 */ 8191 enableRawDelivery(enabled: boolean): void; 8192 8193 /** 8194 * Confirm if the deferred image delivery supported in the specific device. 8195 * 8196 * @param { DeferredDeliveryImageType } type - Type of delivery image. 8197 * @returns { boolean } TRUE if the type of delivery image is support. 8198 * @throws { BusinessError } 202 - Not System Application. 8199 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8200 * @throws { BusinessError } 7400104 - Session not running. 8201 * @throws { BusinessError } 7400201 - Camera service fatal error. 8202 * @syscap SystemCapability.Multimedia.Camera.Core 8203 * @systemapi 8204 * @since 11 8205 */ 8206 isDeferredImageDeliverySupported(type: DeferredDeliveryImageType): boolean; 8207 8208 /** 8209 * Confirm if the deferred image delivery enabled. 8210 * 8211 * @param { DeferredDeliveryImageType } type - Type of delivery image. 8212 * @returns { boolean } TRUE if the type of delivery image is enable. 8213 * @throws { BusinessError } 202 - Not System Application. 8214 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8215 * @throws { BusinessError } 7400104 - Session not running. 8216 * @throws { BusinessError } 7400201 - Camera service fatal error. 8217 * @syscap SystemCapability.Multimedia.Camera.Core 8218 * @systemapi 8219 * @since 11 8220 */ 8221 isDeferredImageDeliveryEnabled(type: DeferredDeliveryImageType): boolean; 8222 8223 /** 8224 * Sets the image type for deferred image delivery. 8225 * 8226 * @param { DeferredDeliveryImageType } type - Type of delivery image. 8227 * @throws { BusinessError } 202 - Not System Application. 8228 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8229 * @throws { BusinessError } 7400104 - Session not running. 8230 * @throws { BusinessError } 7400201 - Camera service fatal error. 8231 * @syscap SystemCapability.Multimedia.Camera.Core 8232 * @systemapi 8233 * @since 11 8234 */ 8235 deferImageDelivery(type: DeferredDeliveryImageType): void; 8236 8237 /** 8238 * Check if the depth data delivery is supported. 8239 * 8240 * @returns { boolean } TRUE if the type of delivery image is enabled. 8241 * @throws { BusinessError } 202 - Not System Application. 8242 * @throws { BusinessError } 7400104 - Session not running. 8243 * @throws { BusinessError } 7400201 - Camera service fatal error. 8244 * @syscap SystemCapability.Multimedia.Camera.Core 8245 * @systemapi 8246 * @since 13 8247 */ 8248 isDepthDataDeliverySupported(): boolean; 8249 8250 /** 8251 * Enable depth data delivery. 8252 * 8253 * @param { boolean } enabled - Target state for depth data delivery. 8254 * @throws { BusinessError } 202 - Not System Application. 8255 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8256 * @throws { BusinessError } 7400104 - Session not running. 8257 * @throws { BusinessError } 7400201 - Camera service fatal error. 8258 * @syscap SystemCapability.Multimedia.Camera.Core 8259 * @systemapi 8260 * @since 13 8261 */ 8262 enableDepthDataDelivery(enabled: boolean): void; 8263 8264 /** 8265 * Get supported moving photo video codec types. 8266 * 8267 * @returns { Array<VideoCodecType> } An array of supported video codec types for moving photo. 8268 * @throws { BusinessError } 7400201 - Camera service fatal error. 8269 * @syscap SystemCapability.Multimedia.Camera.Core 8270 * @since 13 8271 */ 8272 getSupportedMovingPhotoVideoCodecTypes(): Array<VideoCodecType>; 8273 8274 /** 8275 * Sets codec type for moving photo, default to AVC. 8276 * 8277 * @param { VideoCodecType } codecType - Codec type for moving photo. 8278 * @throws { BusinessError } 7400201 - Camera service fatal error. 8279 * @syscap SystemCapability.Multimedia.Camera.Core 8280 * @since 13 8281 */ 8282 setMovingPhotoVideoCodecType(codecType: VideoCodecType): void; 8283 8284 /** 8285 * Subscribes photo available event callback. 8286 * 8287 * @param { 'photoAvailable' } type - Event type. 8288 * @param { AsyncCallback<Photo> } callback - Callback used to get the Photo. 8289 * @syscap SystemCapability.Multimedia.Camera.Core 8290 * @since 11 8291 */ 8292 on(type: 'photoAvailable', callback: AsyncCallback<Photo>): void; 8293 8294 /** 8295 * Unsubscribes photo available event callback. 8296 * 8297 * @param { 'photoAvailable' } type - Event type. 8298 * @param { AsyncCallback<Photo> } callback - Callback used to get the Photo. 8299 * @syscap SystemCapability.Multimedia.Camera.Core 8300 * @since 11 8301 */ 8302 off(type: 'photoAvailable', callback?: AsyncCallback<Photo>): void; 8303 8304 /** 8305 * Subscribes deferred photo proxy available event callback. 8306 * 8307 * @param { 'deferredPhotoProxyAvailable' } type - Event type. 8308 * @param { AsyncCallback<DeferredPhotoProxy> } callback - Callback used to get the DeferredPhotoProxy. 8309 * @throws { BusinessError } 202 - Not System Application. 8310 * @syscap SystemCapability.Multimedia.Camera.Core 8311 * @systemapi 8312 * @since 11 8313 */ 8314 on(type: 'deferredPhotoProxyAvailable', callback: AsyncCallback<DeferredPhotoProxy>): void; 8315 8316 /** 8317 * Unsubscribes deferred photo proxy available event callback. 8318 * 8319 * @param { 'deferredPhotoProxyAvailable' } type - Event type. 8320 * @param { AsyncCallback<DeferredPhotoProxy> } callback - Callback used to get the DeferredPhotoProxy. 8321 * @throws { BusinessError } 202 - Not System Application. 8322 * @syscap SystemCapability.Multimedia.Camera.Core 8323 * @systemapi 8324 * @since 11 8325 */ 8326 off(type: 'deferredPhotoProxyAvailable', callback?: AsyncCallback<DeferredPhotoProxy>): void; 8327 8328 /** 8329 * Subscribes photo asset event callback. 8330 * 8331 * @param { 'photoAssetAvailable' } type - Event type. 8332 * @param { AsyncCallback<photoAccessHelper.PhotoAsset> } callback - Callback used to get the asset. 8333 * @syscap SystemCapability.Multimedia.Camera.Core 8334 * @since 12 8335 */ 8336 on(type: 'photoAssetAvailable', callback: AsyncCallback<photoAccessHelper.PhotoAsset>): void; 8337 8338 /** 8339 * Unsubscribes photo asset event callback. 8340 * 8341 * @param { 'photoAssetAvailable' } type - Event type. 8342 * @param { AsyncCallback<photoAccessHelper.PhotoAsset> } callback - Callback used to get the asset. 8343 * @syscap SystemCapability.Multimedia.Camera.Core 8344 * @since 12 8345 */ 8346 off(type: 'photoAssetAvailable', callback?: AsyncCallback<photoAccessHelper.PhotoAsset>): void; 8347 8348 /** 8349 * Check whether to support mirror photo. 8350 * 8351 * @returns { boolean } Is the mirror supported. 8352 * @syscap SystemCapability.Multimedia.Camera.Core 8353 * @since 10 8354 */ 8355 isMirrorSupported(): boolean; 8356 8357 /** 8358 * Enable mirror for photo capture. 8359 * 8360 * @param { boolean } enabled - enable photo mirror if TRUE. 8361 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8362 * @throws { BusinessError } 7400103 - Session not config. 8363 * @throws { BusinessError } 7400201 - Camera service fatal error. 8364 * @syscap SystemCapability.Multimedia.Camera.Core 8365 * @since 13 8366 */ 8367 enableMirror(enabled: boolean): void; 8368 8369 /** 8370 * Subscribes capture start event callback. 8371 * 8372 * @param { 'captureStart' } type - Event type. 8373 * @param { AsyncCallback<number> } callback - Callback used to get the capture ID. 8374 * @syscap SystemCapability.Multimedia.Camera.Core 8375 * @since 10 8376 * @deprecated since 11 8377 * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo 8378 */ 8379 on(type: 'captureStart', callback: AsyncCallback<number>): void; 8380 8381 /** 8382 * Unsubscribes from capture start event callback. 8383 * 8384 * @param { 'captureStart' } type - Event type. 8385 * @param { AsyncCallback<number> } callback - Callback used to get the capture ID. 8386 * @syscap SystemCapability.Multimedia.Camera.Core 8387 * @since 10 8388 * @deprecated since 11 8389 * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo 8390 */ 8391 off(type: 'captureStart', callback?: AsyncCallback<number>): void; 8392 8393 /** 8394 * Subscribes capture start event callback. 8395 * 8396 * @param { 'captureStartWithInfo' } type - Event type. 8397 * @param { AsyncCallback<CaptureStartInfo> } callback - Callback used to get the capture start info. 8398 * @syscap SystemCapability.Multimedia.Camera.Core 8399 * @since 11 8400 */ 8401 on(type: 'captureStartWithInfo', callback: AsyncCallback<CaptureStartInfo>): void; 8402 8403 /** 8404 * Unsubscribes from capture start event callback. 8405 * 8406 * @param { 'captureStartWithInfo' } type - Event type. 8407 * @param { AsyncCallback<CaptureStartInfo> } callback - Callback used to get the capture start info. 8408 * @syscap SystemCapability.Multimedia.Camera.Core 8409 * @since 11 8410 */ 8411 off(type: 'captureStartWithInfo', callback?: AsyncCallback<CaptureStartInfo>): void; 8412 8413 /** 8414 * Subscribes frame shutter event callback. 8415 * 8416 * @param { 'frameShutter' } type - Event type. 8417 * @param { AsyncCallback<FrameShutterInfo> } callback - Callback used to get the frame shutter information. 8418 * @syscap SystemCapability.Multimedia.Camera.Core 8419 * @since 10 8420 */ 8421 on(type: 'frameShutter', callback: AsyncCallback<FrameShutterInfo>): void; 8422 8423 /** 8424 * Unsubscribes from frame shutter event callback. 8425 * 8426 * @param { 'frameShutter' } type - Event type. 8427 * @param { AsyncCallback<FrameShutterInfo> } callback - Callback used to get the frame shutter information. 8428 * @syscap SystemCapability.Multimedia.Camera.Core 8429 * @since 10 8430 */ 8431 off(type: 'frameShutter', callback?: AsyncCallback<FrameShutterInfo>): void; 8432 8433 /** 8434 * Subscribes frame shutter end event callback. 8435 * 8436 * @param { 'frameShutterEnd' } type - Event type. 8437 * @param { AsyncCallback<FrameShutterEndInfo> } callback - Callback used to get the frame shutter end information. 8438 * @syscap SystemCapability.Multimedia.Camera.Core 8439 * @since 12 8440 */ 8441 on(type: 'frameShutterEnd', callback: AsyncCallback<FrameShutterEndInfo>): void; 8442 8443 /** 8444 * Unsubscribes from frame shutter end event callback. 8445 * 8446 * @param { 'frameShutterEnd' } type - Event type. 8447 * @param { AsyncCallback<FrameShutterEndInfo> } callback - Callback used to get the frame shutter end information. 8448 * @syscap SystemCapability.Multimedia.Camera.Core 8449 * @since 12 8450 */ 8451 off(type: 'frameShutterEnd', callback?: AsyncCallback<FrameShutterEndInfo>): void; 8452 8453 /** 8454 * Subscribes capture end event callback. 8455 * 8456 * @param { 'captureEnd' } type - Event type. 8457 * @param { AsyncCallback<CaptureEndInfo> } callback - Callback used to get the capture end information. 8458 * @syscap SystemCapability.Multimedia.Camera.Core 8459 * @since 10 8460 */ 8461 on(type: 'captureEnd', callback: AsyncCallback<CaptureEndInfo>): void; 8462 8463 /** 8464 * Unsubscribes from capture end event callback. 8465 * 8466 * @param { 'captureEnd' } type - Event type. 8467 * @param { AsyncCallback<CaptureEndInfo> } callback - Callback used to get the capture end information. 8468 * @syscap SystemCapability.Multimedia.Camera.Core 8469 * @since 10 8470 */ 8471 off(type: 'captureEnd', callback?: AsyncCallback<CaptureEndInfo>): void; 8472 8473 /** 8474 * Subscribes capture ready event callback. After receiving the callback, can proceed to the next capture 8475 * 8476 * @param { 'captureReady' } type - Event type. 8477 * @param { AsyncCallback<void> } callback - Callback used to notice capture ready. 8478 * @syscap SystemCapability.Multimedia.Camera.Core 8479 * @since 12 8480 */ 8481 on(type: 'captureReady', callback: AsyncCallback<void>): void; 8482 8483 /** 8484 * Unsubscribes from capture ready event callback. 8485 * 8486 * @param { 'captureReady' } type - Event type. 8487 * @param { AsyncCallback<void> } callback - Callback used to notice capture ready. 8488 * @syscap SystemCapability.Multimedia.Camera.Core 8489 * @since 12 8490 */ 8491 off(type: 'captureReady', callback?: AsyncCallback<void>): void; 8492 8493 /** 8494 * Subscribes estimated capture duration event callback. 8495 * 8496 * @param { 'estimatedCaptureDuration' } type - Event type. 8497 * @param { AsyncCallback<number> } callback - Callback used to notify the estimated capture duration (in milliseconds). 8498 * @syscap SystemCapability.Multimedia.Camera.Core 8499 * @since 12 8500 */ 8501 on(type: 'estimatedCaptureDuration', callback: AsyncCallback<number>): void; 8502 8503 /** 8504 * Unsubscribes from estimated capture duration event callback. 8505 * 8506 * @param { 'estimatedCaptureDuration' } type - Event type. 8507 * @param { AsyncCallback<number> } callback - Callback used to notify the estimated capture duration (in milliseconds). 8508 * @syscap SystemCapability.Multimedia.Camera.Core 8509 * @since 12 8510 */ 8511 off(type: 'estimatedCaptureDuration', callback?: AsyncCallback<number>): void; 8512 8513 /** 8514 * Subscribes to error events. 8515 * 8516 * @param { 'error' } type - Event type. 8517 * @param { ErrorCallback } callback - Callback used to get the photo output errors. 8518 * @syscap SystemCapability.Multimedia.Camera.Core 8519 * @since 10 8520 */ 8521 on(type: 'error', callback: ErrorCallback): void; 8522 8523 /** 8524 * Unsubscribes from error events. 8525 * 8526 * @param { 'error' } type - Event type. 8527 * @param { ErrorCallback } callback - Callback used to get the photo output errors. 8528 * @syscap SystemCapability.Multimedia.Camera.Core 8529 * @since 10 8530 */ 8531 off(type: 'error', callback?: ErrorCallback): void; 8532 8533 /** 8534 * Gets the current preconfig type if you had already call preconfig interface. 8535 * 8536 * @returns { Profile } The current preconfig type. 8537 * @throws { BusinessError } 7400201 - Camera service fatal error. 8538 * @syscap SystemCapability.Multimedia.Camera.Core 8539 * @since 12 8540 */ 8541 getActiveProfile(): Profile; 8542 8543 /** 8544 * Checks whether PhotoOutput supports quick thumbnail. 8545 * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. 8546 * 8547 * @returns { boolean } Whether quick thumbnail is supported. 8548 * @throws { BusinessError } 7400104 - session is not running. 8549 * @syscap SystemCapability.Multimedia.Camera.Core 8550 * @systemapi 8551 * @since 10 8552 */ 8553 /** 8554 * Checks whether PhotoOutput supports quick thumbnail. 8555 * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. 8556 * 8557 * @returns { boolean } Whether quick thumbnail is supported. 8558 * @throws { BusinessError } 202 - Not System Application. 8559 * @throws { BusinessError } 7400104 - session is not running. 8560 * @syscap SystemCapability.Multimedia.Camera.Core 8561 * @systemapi 8562 * @since 12 8563 */ 8564 isQuickThumbnailSupported(): boolean; 8565 8566 /** 8567 * Enables or disables quick thumbnail. 8568 * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. 8569 * To avoid stream reconfiguration and performance loss, 8570 * you are advised to call the method before Session.commitConfig(). 8571 * 8572 * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. 8573 * @throws { BusinessError } 7400104 - session is not running. 8574 * @syscap SystemCapability.Multimedia.Camera.Core 8575 * @systemapi 8576 * @since 10 8577 */ 8578 /** 8579 * Enables or disables quick thumbnail. 8580 * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. 8581 * To avoid stream reconfiguration and performance loss, 8582 * you are advised to call the method before Session.commitConfig(). 8583 * 8584 * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. 8585 * @throws { BusinessError } 202 - Not System Application. 8586 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8587 * @throws { BusinessError } 7400104 - session is not running. 8588 * @throws { BusinessError } 7400201 - Camera service fatal error. 8589 * @syscap SystemCapability.Multimedia.Camera.Core 8590 * @systemapi 8591 * @since 12 8592 */ 8593 enableQuickThumbnail(enabled: boolean): void; 8594 8595 /** 8596 * Subscribes to camera thumbnail events. 8597 * This method is valid only after enableQuickThumbnail(true) is called. 8598 * 8599 * @param { 'quickThumbnail' } type - Event type. 8600 * @param { AsyncCallback<image.PixelMap> } callback - Callback used to get the quick thumbnail. 8601 * @syscap SystemCapability.Multimedia.Camera.Core 8602 * @systemapi 8603 * @since 10 8604 */ 8605 on(type: 'quickThumbnail', callback: AsyncCallback<image.PixelMap>): void; 8606 8607 /** 8608 * Unsubscribes from camera thumbnail events. 8609 * This method is valid only after enableQuickThumbnail(true) is called. 8610 * 8611 * @param { 'quickThumbnail' } type - Event type. 8612 * @param { AsyncCallback<image.PixelMap> } callback - Callback used to get the quick thumbnail. 8613 * @syscap SystemCapability.Multimedia.Camera.Core 8614 * @systemapi 8615 * @since 10 8616 */ 8617 off(type: 'quickThumbnail', callback?: AsyncCallback<image.PixelMap>): void; 8618 8619 /** 8620 * Confirm if the auto high quality photo supported. 8621 * 8622 * @returns { boolean } TRUE if the auto high quality photo is supported. 8623 * @throws { BusinessError } 202 - Not System Application. 8624 * @throws { BusinessError } 7400104 - session is not running. 8625 * @throws { BusinessError } 7400201 - Camera service fatal error. 8626 * @syscap SystemCapability.Multimedia.Camera.Core 8627 * @systemapi 8628 * @since 13 8629 */ 8630 isAutoHighQualityPhotoSupported(): boolean; 8631 8632 /** 8633 * Enable auto high quality photo. 8634 * 8635 * @param { boolean } enabled - Target state for auto high quality photo. 8636 * @throws { BusinessError } 202 - Not System Application. 8637 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8638 * @throws { BusinessError } 7400104 - session is not running. 8639 * @throws { BusinessError } 7400201 - Camera service fatal error. 8640 * @syscap SystemCapability.Multimedia.Camera.Core 8641 * @systemapi 8642 * @since 13 8643 */ 8644 enableAutoHighQualityPhoto(enabled: boolean): void; 8645 8646 /** 8647 * Confirm if the auto cloud image enhancement is supported. 8648 * 8649 * @returns { boolean } TRUE if the auto cloud image enhancement is supported. 8650 * @throws { BusinessError } 202 - Not System Application. 8651 * @throws { BusinessError } 7400201 - Camera service fatal error. 8652 * @syscap SystemCapability.Multimedia.Camera.Core 8653 * @systemapi 8654 * @since 13 8655 */ 8656 isAutoCloudImageEnhancementSupported(): boolean; 8657 8658 /** 8659 * Enable auto cloud image enhancement 8660 * 8661 * @param { boolean } enabled - Target state for auto cloud image enhancement. 8662 * @throws { BusinessError } 202 - Not System Application. 8663 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8664 * @throws { BusinessError } 7400201 - Camera service fatal error. 8665 * @syscap SystemCapability.Multimedia.Camera.Core 8666 * @systemapi 8667 * @since 13 8668 */ 8669 enableAutoCloudImageEnhancement(enabled: boolean): void; 8670 8671 /** 8672 * Confirm if moving photo supported. 8673 * 8674 * @returns { boolean } TRUE if the moving photo is supported. 8675 * @throws { BusinessError } 7400201 - Camera service fatal error. 8676 * @syscap SystemCapability.Multimedia.Camera.Core 8677 * @since 12 8678 */ 8679 isMovingPhotoSupported(): boolean; 8680 8681 /** 8682 * Enable moving photo. 8683 * 8684 * @permission ohos.permission.MICROPHONE 8685 * @param { boolean } enabled - Target state for moving photo. 8686 * @throws { BusinessError } 201 - permission denied. 8687 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8688 * @throws { BusinessError } 7400201 - Camera service fatal error. 8689 * @syscap SystemCapability.Multimedia.Camera.Core 8690 * @since 12 8691 */ 8692 enableMovingPhoto(enabled: boolean): void; 8693 8694 /** 8695 * Gets the photo rotation angle. 8696 * 8697 * @param { number } deviceDegree - The current device rotation degree. 8698 * @returns { ImageRotation } The photo rotation angle. 8699 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8700 * @throws { BusinessError } 7400201 - Camera service fatal error. 8701 * @syscap SystemCapability.Multimedia.Camera.Core 8702 * @since 12 8703 */ 8704 getPhotoRotation(deviceDegree: number): ImageRotation; 8705 } 8706 8707 /** 8708 * Frame shutter callback info. 8709 * 8710 * @typedef FrameShutterInfo 8711 * @syscap SystemCapability.Multimedia.Camera.Core 8712 * @since 10 8713 */ 8714 interface FrameShutterInfo { 8715 /** 8716 * Capture id. 8717 * 8718 * @type { number } 8719 * @syscap SystemCapability.Multimedia.Camera.Core 8720 * @since 10 8721 */ 8722 captureId: number; 8723 /** 8724 * Timestamp for frame. 8725 * 8726 * @type { number } 8727 * @syscap SystemCapability.Multimedia.Camera.Core 8728 * @since 10 8729 */ 8730 timestamp: number; 8731 } 8732 8733 /** 8734 * Frame shutter end callback info. 8735 * 8736 * @typedef FrameShutterEndInfo 8737 * @syscap SystemCapability.Multimedia.Camera.Core 8738 * @since 12 8739 */ 8740 interface FrameShutterEndInfo { 8741 /** 8742 * Capture id. 8743 * 8744 * @type { number } 8745 * @syscap SystemCapability.Multimedia.Camera.Core 8746 * @since 12 8747 */ 8748 captureId: number; 8749 } 8750 8751 /** 8752 * Capture start info. 8753 * 8754 * @typedef CaptureStartInfo 8755 * @syscap SystemCapability.Multimedia.Camera.Core 8756 * @since 11 8757 */ 8758 interface CaptureStartInfo { 8759 /** 8760 * Capture id. 8761 * 8762 * @type { number } 8763 * @syscap SystemCapability.Multimedia.Camera.Core 8764 * @since 11 8765 */ 8766 captureId: number; 8767 /** 8768 * Time(in milliseconds) is the shutter time for the photo. 8769 * 8770 * @type { number } 8771 * @syscap SystemCapability.Multimedia.Camera.Core 8772 * @since 11 8773 */ 8774 time: number; 8775 } 8776 8777 /** 8778 * Capture end info. 8779 * 8780 * @typedef CaptureEndInfo 8781 * @syscap SystemCapability.Multimedia.Camera.Core 8782 * @since 10 8783 */ 8784 interface CaptureEndInfo { 8785 /** 8786 * Capture id. 8787 * 8788 * @type { number } 8789 * @syscap SystemCapability.Multimedia.Camera.Core 8790 * @since 10 8791 */ 8792 captureId: number; 8793 /** 8794 * Frame count. 8795 * 8796 * @type { number } 8797 * @syscap SystemCapability.Multimedia.Camera.Core 8798 * @since 10 8799 */ 8800 frameCount: number; 8801 } 8802 8803 /** 8804 * Deferred video enhancement info. 8805 * 8806 * @typedef DeferredVideoEnhancementInfo 8807 * @syscap SystemCapability.Multimedia.Camera.Core 8808 * @systemapi 8809 * @since 13 8810 */ 8811 interface DeferredVideoEnhancementInfo { 8812 /** 8813 * Check whether deferred video enhancement available. 8814 * 8815 * @type { boolean } 8816 * @syscap SystemCapability.Multimedia.Camera.Core 8817 * @systemapi 8818 * @since 13 8819 * @readonly 8820 */ 8821 readonly isDeferredVideoEnhancementAvailable: boolean; 8822 /** 8823 * Video identifier. 8824 * 8825 * @type { ?string } 8826 * @syscap SystemCapability.Multimedia.Camera.Core 8827 * @systemapi 8828 * @since 13 8829 * @readonly 8830 */ 8831 readonly videoId?: string; 8832 } 8833 8834 /** 8835 * Video output object. 8836 * 8837 * @interface VideoOutput 8838 * @syscap SystemCapability.Multimedia.Camera.Core 8839 * @since 10 8840 */ 8841 interface VideoOutput extends CameraOutput { 8842 /** 8843 * Start video output. 8844 * 8845 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8846 * @throws { BusinessError } 7400103 - Session not config. 8847 * @throws { BusinessError } 7400201 - Camera service fatal error. 8848 * @syscap SystemCapability.Multimedia.Camera.Core 8849 * @since 10 8850 */ 8851 start(callback: AsyncCallback<void>): void; 8852 8853 /** 8854 * Start video output. 8855 * 8856 * @returns { Promise<void> } Promise used to return the result. 8857 * @throws { BusinessError } 7400103 - Session not config. 8858 * @throws { BusinessError } 7400201 - Camera service fatal error. 8859 * @syscap SystemCapability.Multimedia.Camera.Core 8860 * @since 10 8861 */ 8862 start(): Promise<void>; 8863 8864 /** 8865 * Stop video output. 8866 * 8867 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8868 * @syscap SystemCapability.Multimedia.Camera.Core 8869 * @since 10 8870 */ 8871 stop(callback: AsyncCallback<void>): void; 8872 8873 /** 8874 * Stop video output. 8875 * 8876 * @returns { Promise<void> } Promise used to return the result. 8877 * @syscap SystemCapability.Multimedia.Camera.Core 8878 * @since 10 8879 */ 8880 stop(): Promise<void>; 8881 8882 /** 8883 * Determine whether video mirror is supported. 8884 * 8885 * @returns { boolean } Is video mirror supported. 8886 * @throws { BusinessError } 202 - Not System Application. 8887 * @syscap SystemCapability.Multimedia.Camera.Core 8888 * @systemapi 8889 * @since 12 8890 */ 8891 isMirrorSupported(): boolean; 8892 8893 /** 8894 * Enable mirror for video capture. 8895 * 8896 * @param { boolean } enabled - enable video mirror if TRUE. 8897 * @throws { BusinessError } 202 - Not System Application. 8898 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8899 * @throws { BusinessError } 7400103 - Session not config. 8900 * @syscap SystemCapability.Multimedia.Camera.Core 8901 * @systemapi 8902 * @since 12 8903 */ 8904 enableMirror(enabled: boolean): void; 8905 8906 /** 8907 * Get supported frame rates which can be set during session running. 8908 * 8909 * @returns { Array<FrameRateRange> } The array of supported frame rate range. 8910 * @syscap SystemCapability.Multimedia.Camera.Core 8911 * @since 12 8912 */ 8913 getSupportedFrameRates(): Array<FrameRateRange> 8914 8915 /** 8916 * Set a frame rate range. 8917 * 8918 * @param { number } minFps - Minimum frame rate per second. 8919 * @param { number } maxFps - Maximum frame rate per second. 8920 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8921 * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. 8922 * @syscap SystemCapability.Multimedia.Camera.Core 8923 * @since 12 8924 */ 8925 setFrameRate(minFps: number, maxFps: number): void 8926 8927 /** 8928 * Get active frame rate range which has been set before. 8929 * 8930 * @returns { FrameRateRange } The active frame rate range. 8931 * @syscap SystemCapability.Multimedia.Camera.Core 8932 * @since 12 8933 */ 8934 getActiveFrameRate(): FrameRateRange; 8935 8936 /** 8937 * Gets the video rotation angle. 8938 * 8939 * @param { number } deviceDegree - The current device rotation degree. 8940 * @returns { ImageRotation } The video rotation angle. 8941 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8942 * @throws { BusinessError } 7400201 - Camera service fatal error. 8943 * @syscap SystemCapability.Multimedia.Camera.Core 8944 * @since 12 8945 */ 8946 getVideoRotation(deviceDegree: number): ImageRotation; 8947 8948 /** 8949 * Confirm if auto deferred video enhancement is supported in the specific device. 8950 * 8951 * @returns { boolean } TRUE if auto deferred video enhancement is supported. 8952 * @throws { BusinessError } 202 - Not System Application. 8953 * @throws { BusinessError } 7400201 - Camera service fatal error. 8954 * @syscap SystemCapability.Multimedia.Camera.Core 8955 * @systemapi 8956 * @since 13 8957 */ 8958 isAutoDeferredVideoEnhancementSupported(): boolean; 8959 8960 /** 8961 * Confirm if auto deferred video enhancement is enabled. 8962 * 8963 * @returns { boolean } TRUE if auto deferred video enhancement is enabled. 8964 * @throws { BusinessError } 202 - Not System Application. 8965 * @throws { BusinessError } 7400201 - Camera service fatal error. 8966 * @syscap SystemCapability.Multimedia.Camera.Core 8967 * @systemapi 8968 * @since 13 8969 */ 8970 isAutoDeferredVideoEnhancementEnabled(): boolean; 8971 8972 /** 8973 * Enable auto deferred video enhancement if needed. 8974 * 8975 * @param { boolean } enabled - Status of auto deferred video enhancement. 8976 * @throws { BusinessError } 202 - Not System Application. 8977 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8978 * @throws { BusinessError } 7400201 - Camera service fatal error. 8979 * @syscap SystemCapability.Multimedia.Camera.Core 8980 * @systemapi 8981 * @since 13 8982 */ 8983 enableAutoDeferredVideoEnhancement(enabled: boolean): void; 8984 8985 /** 8986 * Subscribes deferred video enhancement info callback. 8987 * 8988 * @param { 'deferredVideoEnhancementInfo' } type - Event type. 8989 * @param { AsyncCallback<DeferredVideoEnhanceInfo> } callback - Callback used to return the result. 8990 * @throws { BusinessError } 202 - Not System Application. 8991 * @syscap SystemCapability.Multimedia.Camera.Core 8992 * @systemapi 8993 * @since 13 8994 */ 8995 on(type: 'deferredVideoEnhancementInfo', callback: AsyncCallback<DeferredVideoEnhancementInfo>): void; 8996 8997 /** 8998 * Unsubscribes from deferred video enhancement info callback. 8999 * 9000 * @param { 'deferredVideoEnhancementInfo' } type - Event type. 9001 * @param { AsyncCallback<DeferredVideoEnhancementInfo> } callback - Callback used to return the result. 9002 * @throws { BusinessError } 202 - Not System Application. 9003 * @syscap SystemCapability.Multimedia.Camera.Core 9004 * @systemapi 9005 * @since 13 9006 */ 9007 off(type: 'deferredVideoEnhancementInfo', callback?: AsyncCallback<DeferredVideoEnhancementInfo>): void; 9008 9009 /** 9010 * Subscribes frame start event callback. 9011 * 9012 * @param { 'frameStart' } type - Event type. 9013 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9014 * @syscap SystemCapability.Multimedia.Camera.Core 9015 * @since 10 9016 */ 9017 on(type: 'frameStart', callback: AsyncCallback<void>): void; 9018 9019 /** 9020 * Unsubscribes from frame start event callback. 9021 * 9022 * @param { 'frameStart' } type - Event type. 9023 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9024 * @syscap SystemCapability.Multimedia.Camera.Core 9025 * @since 10 9026 */ 9027 off(type: 'frameStart', callback?: AsyncCallback<void>): void; 9028 9029 /** 9030 * Subscribes frame end event callback. 9031 * 9032 * @param { 'frameEnd' } type - Event type. 9033 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9034 * @syscap SystemCapability.Multimedia.Camera.Core 9035 * @since 10 9036 */ 9037 on(type: 'frameEnd', callback: AsyncCallback<void>): void; 9038 9039 /** 9040 * Unsubscribes from frame end event callback. 9041 * 9042 * @param { 'frameEnd' } type - Event type. 9043 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9044 * @syscap SystemCapability.Multimedia.Camera.Core 9045 * @since 10 9046 */ 9047 off(type: 'frameEnd', callback?: AsyncCallback<void>): void; 9048 9049 /** 9050 * Subscribes to error events. 9051 * 9052 * @param { 'error' } type - Event type. 9053 * @param { ErrorCallback } callback - Callback used to get the video output errors. 9054 * @syscap SystemCapability.Multimedia.Camera.Core 9055 * @since 10 9056 */ 9057 on(type: 'error', callback: ErrorCallback): void; 9058 9059 /** 9060 * Unsubscribes from error events. 9061 * 9062 * @param { 'error' } type - Event type. 9063 * @param { ErrorCallback } callback - Callback used to get the video output errors. 9064 * @syscap SystemCapability.Multimedia.Camera.Core 9065 * @since 10 9066 */ 9067 off(type: 'error', callback?: ErrorCallback): void; 9068 9069 /** 9070 * Gets the current preconfig type if you had already call preconfig interface. 9071 * 9072 * @returns { VideoProfile } The current preconfig type. 9073 * @throws { BusinessError } 7400201 - Camera service fatal error. 9074 * @syscap SystemCapability.Multimedia.Camera.Core 9075 * @since 12 9076 */ 9077 getActiveProfile(): VideoProfile; 9078 9079 /** 9080 * Get supported video meta types. 9081 * @returns { Array<VideoMetaType> } The array of supported video meta type. 9082 * @throws { BusinessError } 202 - Not System Application. 9083 * @throws { BusinessError } 7400201 - Camera service fatal error. 9084 * @syscap SystemCapability.Multimedia.Camera.Core 9085 * @systemapi 9086 * @since 12 9087 */ 9088 getSupportedVideoMetaTypes(): Array<VideoMetaType>; 9089 9090 /** 9091 * Attach a meta surface to VideoOutput. 9092 * @param { string } surfaceId - Surface object id used for receiving meta infos. 9093 * @param { VideoMetaType } type - Video meta type. 9094 * @throws { BusinessError } 202 - Not System Application. 9095 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9096 * @throws { BusinessError } 7400201 - Camera service fatal error. 9097 * @syscap SystemCapability.Multimedia.Camera.Core 9098 * @systemapi 9099 * @since 12 9100 */ 9101 attachMetaSurface(surfaceId: string, type: VideoMetaType): void; 9102 } 9103 9104 /** 9105 * Video meta type. 9106 * 9107 * @enum { number } 9108 * @syscap SystemCapability.Multimedia.Camera.Core 9109 * @systemapi 9110 * @since 12 9111 */ 9112 enum VideoMetaType { 9113 /** 9114 * Video meta type for storing maker info. 9115 * @syscap SystemCapability.Multimedia.Camera.Core 9116 * @systemapi 9117 * @since 12 9118 */ 9119 VIDEO_META_MAKER_INFO = 0, 9120 } 9121 9122 /** 9123 * Metadata object type. 9124 * 9125 * @enum { number } 9126 * @syscap SystemCapability.Multimedia.Camera.Core 9127 * @since 10 9128 */ 9129 enum MetadataObjectType { 9130 /** 9131 * Face detection type. 9132 * 9133 * @syscap SystemCapability.Multimedia.Camera.Core 9134 * @since 10 9135 */ 9136 FACE_DETECTION = 0, 9137 9138 /** 9139 * Human body detection type. 9140 * 9141 * @syscap SystemCapability.Multimedia.Camera.Core 9142 * @systemapi 9143 * @since 13 9144 */ 9145 HUMAN_BODY = 1, 9146 9147 /** 9148 * Cat face detection type. 9149 * 9150 * @syscap SystemCapability.Multimedia.Camera.Core 9151 * @systemapi 9152 * @since 13 9153 */ 9154 CAT_FACE = 2, 9155 9156 /** 9157 * Cat body detection type. 9158 * 9159 * @syscap SystemCapability.Multimedia.Camera.Core 9160 * @systemapi 9161 * @since 13 9162 */ 9163 CAT_BODY = 3, 9164 9165 /** 9166 * Dog face detection type. 9167 * 9168 * @syscap SystemCapability.Multimedia.Camera.Core 9169 * @systemapi 9170 * @since 13 9171 */ 9172 DOG_FACE = 4, 9173 9174 /** 9175 * Dog body detection type. 9176 * 9177 * @syscap SystemCapability.Multimedia.Camera.Core 9178 * @systemapi 9179 * @since 13 9180 */ 9181 DOG_BODY = 5, 9182 9183 /** 9184 * Salient detection type. 9185 * 9186 * @syscap SystemCapability.Multimedia.Camera.Core 9187 * @systemapi 9188 * @since 13 9189 */ 9190 SALIENT_DETECTION = 6, 9191 9192 /** 9193 * Barcode detection type. 9194 * 9195 * @syscap SystemCapability.Multimedia.Camera.Core 9196 * @systemapi 9197 * @since 13 9198 */ 9199 BAR_CODE_DETECTION = 7 9200 } 9201 9202 /** 9203 * Enum for light painting tabletype. 9204 * 9205 * @enum { number } 9206 * @syscap SystemCapability.Multimedia.Camera.Core 9207 * @systemapi 9208 * @since 12 9209 */ 9210 enum LightPaintingType { 9211 /** 9212 * Traffic trails effect. 9213 * 9214 * @syscap SystemCapability.Multimedia.Camera.Core 9215 * @systemapi 9216 * @since 12 9217 */ 9218 TRAFFIC_TRAILS = 0, 9219 9220 /** 9221 * Star trails effect. 9222 * 9223 * @syscap SystemCapability.Multimedia.Camera.Core 9224 * @systemapi 9225 * @since 12 9226 */ 9227 STAR_TRAILS = 1, 9228 9229 /** 9230 * Silky water effect. 9231 * 9232 * @syscap SystemCapability.Multimedia.Camera.Core 9233 * @systemapi 9234 * @since 12 9235 */ 9236 SILKY_WATER = 2, 9237 9238 /** 9239 * Light graffiti effect. 9240 * 9241 * @syscap SystemCapability.Multimedia.Camera.Core 9242 * @systemapi 9243 * @since 12 9244 */ 9245 LIGHT_GRAFFITI = 3 9246 } 9247 9248 /** 9249 * Rectangle definition. 9250 * 9251 * @typedef Rect 9252 * @syscap SystemCapability.Multimedia.Camera.Core 9253 * @since 10 9254 */ 9255 interface Rect { 9256 /** 9257 * X coordinator of top left point. 9258 * 9259 * @type { number } 9260 * @syscap SystemCapability.Multimedia.Camera.Core 9261 * @since 10 9262 */ 9263 topLeftX: number; 9264 /** 9265 * Y coordinator of top left point. 9266 * 9267 * @type { number } 9268 * @syscap SystemCapability.Multimedia.Camera.Core 9269 * @since 10 9270 */ 9271 topLeftY: number; 9272 /** 9273 * Width of this rectangle. 9274 * 9275 * @type { number } 9276 * @syscap SystemCapability.Multimedia.Camera.Core 9277 * @since 10 9278 */ 9279 width: number; 9280 /** 9281 * Height of this rectangle. 9282 * 9283 * @type { number } 9284 * @syscap SystemCapability.Multimedia.Camera.Core 9285 * @since 10 9286 */ 9287 height: number; 9288 } 9289 9290 /** 9291 * Enum for emotion type. 9292 * 9293 * @enum { number } 9294 * @syscap SystemCapability.Multimedia.Camera.Core 9295 * @systemapi 9296 * @since 13 9297 */ 9298 enum Emotion { 9299 /** 9300 * Emotion type: Neutral. 9301 * 9302 * @syscap SystemCapability.Multimedia.Camera.Core 9303 * @systemapi 9304 * @since 13 9305 */ 9306 NEUTRAL = 0, 9307 9308 /** 9309 * Emotion type: Sadness. 9310 * 9311 * @syscap SystemCapability.Multimedia.Camera.Core 9312 * @systemapi 9313 * @since 13 9314 */ 9315 SADNESS = 1, 9316 9317 /** 9318 * Emotion type: Smile. 9319 * 9320 * @syscap SystemCapability.Multimedia.Camera.Core 9321 * @systemapi 9322 * @since 13 9323 */ 9324 SMILE = 2, 9325 9326 /** 9327 * Emotion type: Surprise. 9328 * 9329 * @syscap SystemCapability.Multimedia.Camera.Core 9330 * @systemapi 9331 * @since 13 9332 */ 9333 SURPRISE = 3 9334 } 9335 9336 /** 9337 * Metadata object basis. 9338 * 9339 * @typedef MetadataObject 9340 * @syscap SystemCapability.Multimedia.Camera.Core 9341 * @since 10 9342 */ 9343 interface MetadataObject { 9344 /** 9345 * Metadata object type. 9346 * 9347 * @type { MetadataObjectType } 9348 * @readonly 9349 * @syscap SystemCapability.Multimedia.Camera.Core 9350 * @since 10 9351 */ 9352 readonly type: MetadataObjectType; 9353 /** 9354 * Metadata object timestamp in milliseconds. 9355 * 9356 * @type { number } 9357 * @readonly 9358 * @syscap SystemCapability.Multimedia.Camera.Core 9359 * @since 10 9360 */ 9361 readonly timestamp: number; 9362 /** 9363 * The axis-aligned bounding box of detected metadata object. 9364 * 9365 * @type { Rect } 9366 * @readonly 9367 * @syscap SystemCapability.Multimedia.Camera.Core 9368 * @since 10 9369 */ 9370 readonly boundingBox: Rect; 9371 /** 9372 * Metadata object id. 9373 * 9374 * @type { number } 9375 * @readonly 9376 * @syscap SystemCapability.Multimedia.Camera.Core 9377 * @systemapi 9378 * @since 13 9379 */ 9380 readonly objectId: number; 9381 /** 9382 * Confidence for the detected type. 9383 * 9384 * @type { number } 9385 * @readonly 9386 * @syscap SystemCapability.Multimedia.Camera.Core 9387 * @systemapi 9388 * @since 13 9389 */ 9390 readonly confidence: number; 9391 } 9392 9393 /** 9394 * Metadata object for face. 9395 * 9396 * @typedef MetadataFaceObject 9397 * @extends MetadataObject 9398 * @syscap SystemCapability.Multimedia.Camera.Core 9399 * @systemapi 9400 * @since 13 9401 */ 9402 interface MetadataFaceObject extends MetadataObject { 9403 /** 9404 * Bounding box for left eye. 9405 * 9406 * @type { Rect } 9407 * @readonly 9408 * @syscap SystemCapability.Multimedia.Camera.Core 9409 * @systemapi 9410 * @since 13 9411 */ 9412 readonly leftEyeBoundingBox: Rect; 9413 9414 /** 9415 * Bounding box for right eye. 9416 * 9417 * @type { Rect } 9418 * @readonly 9419 * @syscap SystemCapability.Multimedia.Camera.Core 9420 * @systemapi 9421 * @since 13 9422 */ 9423 readonly rightEyeBoundingBox: Rect; 9424 9425 /** 9426 * Emotion type for face. 9427 * 9428 * @type { Emotion } 9429 * @readonly 9430 * @syscap SystemCapability.Multimedia.Camera.Core 9431 * @systemapi 9432 * @since 13 9433 */ 9434 readonly emotion: Emotion; 9435 9436 /** 9437 * Emotion confidence. 9438 * 9439 * @type { number } 9440 * @readonly 9441 * @syscap SystemCapability.Multimedia.Camera.Core 9442 * @systemapi 9443 * @since 13 9444 */ 9445 readonly emotionConfidence: number; 9446 9447 /** 9448 * Pitch angle for face. 9449 * 9450 * @type { number } 9451 * @readonly 9452 * @syscap SystemCapability.Multimedia.Camera.Core 9453 * @systemapi 9454 * @since 13 9455 */ 9456 readonly pitchAngle: number; 9457 9458 /** 9459 * Yaw angle for face. 9460 * 9461 * @type { number } 9462 * @readonly 9463 * @syscap SystemCapability.Multimedia.Camera.Core 9464 * @systemapi 9465 * @since 13 9466 */ 9467 readonly yawAngle: number; 9468 9469 /** 9470 * Roll angle for face. 9471 * 9472 * @type { number } 9473 * @readonly 9474 * @syscap SystemCapability.Multimedia.Camera.Core 9475 * @systemapi 9476 * @since 13 9477 */ 9478 readonly rollAngle: number; 9479 } 9480 9481 /** 9482 * Metadata object for human body. 9483 * 9484 * @typedef MetadataHumanBodyObject 9485 * @extends MetadataObject 9486 * @syscap SystemCapability.Multimedia.Camera.Core 9487 * @systemapi 9488 * @since 13 9489 */ 9490 interface MetadataHumanBodyObject extends MetadataObject { 9491 } 9492 9493 /** 9494 * Metadata object for cat face. 9495 * 9496 * @typedef MetadataCatFaceObject 9497 * @extends MetadataObject 9498 * @syscap SystemCapability.Multimedia.Camera.Core 9499 * @systemapi 9500 * @since 13 9501 */ 9502 interface MetadataCatFaceObject extends MetadataObject { 9503 /** 9504 * Bounding box for left eye. 9505 * 9506 * @type { Rect } 9507 * @readonly 9508 * @syscap SystemCapability.Multimedia.Camera.Core 9509 * @systemapi 9510 * @since 13 9511 */ 9512 readonly leftEyeBoundingBox: Rect; 9513 9514 /** 9515 * Bounding box for right eye. 9516 * 9517 * @type { Rect } 9518 * @readonly 9519 * @syscap SystemCapability.Multimedia.Camera.Core 9520 * @systemapi 9521 * @since 13 9522 */ 9523 readonly rightEyeBoundingBox: Rect; 9524 } 9525 9526 /** 9527 * Metadata object for cat body. 9528 * 9529 * @typedef MetadataCatBodyObject 9530 * @extends MetadataObject 9531 * @syscap SystemCapability.Multimedia.Camera.Core 9532 * @systemapi 9533 * @since 13 9534 */ 9535 interface MetadataCatBodyObject extends MetadataObject { 9536 } 9537 9538 /** 9539 * Metadata object for dog face. 9540 * 9541 * @typedef MetadataDogFaceObject 9542 * @extends MetadataObject 9543 * @syscap SystemCapability.Multimedia.Camera.Core 9544 * @systemapi 9545 * @since 13 9546 */ 9547 interface MetadataDogFaceObject extends MetadataObject { 9548 /** 9549 * Bounding box for left eye. 9550 * 9551 * @type { Rect } 9552 * @readonly 9553 * @syscap SystemCapability.Multimedia.Camera.Core 9554 * @systemapi 9555 * @since 13 9556 */ 9557 readonly leftEyeBoundingBox: Rect; 9558 9559 /** 9560 * Bounding box for right eye. 9561 * 9562 * @type { Rect } 9563 * @readonly 9564 * @syscap SystemCapability.Multimedia.Camera.Core 9565 * @systemapi 9566 * @since 13 9567 */ 9568 readonly rightEyeBoundingBox: Rect; 9569 } 9570 9571 /** 9572 * Metadata object for dog body. 9573 * 9574 * @typedef MetadataDogBodyObject 9575 * @extends MetadataObject 9576 * @syscap SystemCapability.Multimedia.Camera.Core 9577 * @systemapi 9578 * @since 13 9579 */ 9580 interface MetadataDogBodyObject extends MetadataObject { 9581 } 9582 9583 /** 9584 * Metadata object for salient detection. 9585 * 9586 * @typedef MetadataSalientDetectionObject 9587 * @extends MetadataObject 9588 * @syscap SystemCapability.Multimedia.Camera.Core 9589 * @systemapi 9590 * @since 13 9591 */ 9592 interface MetadataSalientDetectionObject extends MetadataObject { 9593 } 9594 9595 /** 9596 * Camera Occlusion Detection Result. 9597 * 9598 * @typedef CameraOcclusionDetectionResult 9599 * @syscap SystemCapability.Multimedia.Camera.Core 9600 * @systemapi 9601 * @since 12 9602 */ 9603 interface CameraOcclusionDetectionResult { 9604 /** 9605 * Check whether camera is occluded. 9606 * 9607 * @type { boolean } 9608 * @readonly 9609 * @syscap SystemCapability.Multimedia.Camera.Core 9610 * @systemapi 9611 * @since 12 9612 */ 9613 readonly isCameraOccluded: boolean; 9614 9615 /** 9616 * Check whether camera lens is dirty. 9617 * 9618 * @type { boolean } 9619 * @readonly 9620 * @syscap SystemCapability.Multimedia.Camera.Core 9621 * @systemapi 9622 * @since 13 9623 */ 9624 readonly isCameraLensDirty: boolean; 9625 } 9626 9627 /** 9628 * Metadata Output object 9629 * 9630 * @interface MetadataOutput 9631 * @syscap SystemCapability.Multimedia.Camera.Core 9632 * @since 10 9633 */ 9634 interface MetadataOutput extends CameraOutput { 9635 /** 9636 * Start output metadata 9637 * 9638 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9639 * @throws { BusinessError } 7400103 - Session not config. 9640 * @throws { BusinessError } 7400201 - Camera service fatal error. 9641 * @syscap SystemCapability.Multimedia.Camera.Core 9642 * @since 10 9643 */ 9644 start(callback: AsyncCallback<void>): void; 9645 9646 /** 9647 * Start output metadata 9648 * 9649 * @returns { Promise<void> } Promise used to return the result. 9650 * @throws { BusinessError } 7400103 - Session not config. 9651 * @throws { BusinessError } 7400201 - Camera service fatal error. 9652 * @syscap SystemCapability.Multimedia.Camera.Core 9653 * @since 10 9654 */ 9655 start(): Promise<void>; 9656 9657 /** 9658 * Stop output metadata 9659 * 9660 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9661 * @syscap SystemCapability.Multimedia.Camera.Core 9662 * @since 10 9663 */ 9664 stop(callback: AsyncCallback<void>): void; 9665 9666 /** 9667 * Stop output metadata 9668 * 9669 * @returns { Promise<void> } Promise used to return the result. 9670 * @syscap SystemCapability.Multimedia.Camera.Core 9671 * @since 10 9672 */ 9673 stop(): Promise<void>; 9674 9675 /** 9676 * Add metadata object types. 9677 * 9678 * @param { Array<MetadataObjectType> } types - Object types to be added. 9679 * @throws { BusinessError } 202 - Not System Application. 9680 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9681 * @throws { BusinessError } 7400103 - Session not config. 9682 * @throws { BusinessError } 7400201 - Camera service fatal error. 9683 * @syscap SystemCapability.Multimedia.Camera.Core 9684 * @systemapi 9685 * @since 13 9686 */ 9687 addMetadataObjectTypes(types: Array<MetadataObjectType>): void; 9688 9689 /** 9690 * Remove metadata object types. 9691 * 9692 * @param { Array<MetadataObjectType> } types - Object types to be removed. 9693 * @throws { BusinessError } 202 - Not System Application. 9694 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9695 * @throws { BusinessError } 7400103 - Session not config. 9696 * @throws { BusinessError } 7400201 - Camera service fatal error. 9697 * @syscap SystemCapability.Multimedia.Camera.Core 9698 * @systemapi 9699 * @since 13 9700 */ 9701 removeMetadataObjectTypes(types: Array<MetadataObjectType>): void; 9702 9703 /** 9704 * Subscribes to metadata objects available event callback. 9705 * 9706 * @param { 'metadataObjectsAvailable' } type - Event type. 9707 * @param { AsyncCallback<Array<MetadataObject>> } callback - Callback used to get the available metadata objects. 9708 * @syscap SystemCapability.Multimedia.Camera.Core 9709 * @since 10 9710 */ 9711 on(type: 'metadataObjectsAvailable', callback: AsyncCallback<Array<MetadataObject>>): void; 9712 9713 /** 9714 * Unsubscribes from metadata objects available event callback. 9715 * 9716 * @param { 'metadataObjectsAvailable' } type - Event type. 9717 * @param { AsyncCallback<Array<MetadataObject>> } callback - Callback used to get the available metadata objects. 9718 * @syscap SystemCapability.Multimedia.Camera.Core 9719 * @since 10 9720 */ 9721 off(type: 'metadataObjectsAvailable', callback?: AsyncCallback<Array<MetadataObject>>): void; 9722 9723 /** 9724 * Subscribes to error events. 9725 * 9726 * @param { 'error' } type - Event type. 9727 * @param { ErrorCallback } callback - Callback used to get the video output errors. 9728 * @syscap SystemCapability.Multimedia.Camera.Core 9729 * @since 10 9730 */ 9731 on(type: 'error', callback: ErrorCallback): void; 9732 9733 /** 9734 * Unsubscribes from error events. 9735 * 9736 * @param { 'error' } type - Event type. 9737 * @param { ErrorCallback } callback - Callback used to get the video output errors. 9738 * @syscap SystemCapability.Multimedia.Camera.Core 9739 * @since 10 9740 */ 9741 off(type: 'error', callback?: ErrorCallback): void; 9742 } 9743 9744 /** 9745 * Enumerates the timelapse recording state. 9746 * 9747 * @enum { number } 9748 * @syscap SystemCapability.Multimedia.Camera.Core 9749 * @systemapi 9750 * @since 12 9751 */ 9752 enum TimeLapseRecordState { 9753 /** 9754 * TimeLapse idle state. 9755 * 9756 * @syscap SystemCapability.Multimedia.Camera.Core 9757 * @systemapi 9758 * @since 12 9759 */ 9760 IDLE = 0, 9761 9762 /** 9763 * TimeLapse recording state. 9764 * 9765 * @syscap SystemCapability.Multimedia.Camera.Core 9766 * @systemapi 9767 * @since 12 9768 */ 9769 RECORDING = 1 9770 } 9771 9772 /** 9773 * Enumerates the timelapse preview type. 9774 * 9775 * @enum { number } 9776 * @syscap SystemCapability.Multimedia.Camera.Core 9777 * @systemapi 9778 * @since 12 9779 */ 9780 enum TimeLapsePreviewType { 9781 /** 9782 * TimeLapse dark preview. 9783 * 9784 * @syscap SystemCapability.Multimedia.Camera.Core 9785 * @systemapi 9786 * @since 12 9787 */ 9788 DARK = 1, 9789 9790 /** 9791 * TimeLapse Light preview. 9792 * 9793 * @syscap SystemCapability.Multimedia.Camera.Core 9794 * @systemapi 9795 * @since 12 9796 */ 9797 LIGHT = 2 9798 } 9799 9800 /** 9801 * Try AE information. 9802 * 9803 * @typedef TryAEInfo 9804 * @syscap SystemCapability.Multimedia.Camera.Core 9805 * @systemapi 9806 * @since 12 9807 */ 9808 interface TryAEInfo { 9809 /** 9810 * Determine whether try AE is done. 9811 * 9812 * @type { boolean } 9813 * @readonly 9814 * @syscap SystemCapability.Multimedia.Camera.Core 9815 * @systemapi 9816 * @since 12 9817 */ 9818 readonly isTryAEDone: boolean; 9819 9820 /** 9821 * Determine whether AE hint is needed. 9822 * 9823 * @type { ?boolean } 9824 * @readonly 9825 * @syscap SystemCapability.Multimedia.Camera.Core 9826 * @systemapi 9827 * @since 12 9828 */ 9829 readonly isTryAEHintNeeded?: boolean; 9830 9831 /** 9832 * Timelapse preview type. 9833 * 9834 * @type { ?TimeLapsePreviewType } 9835 * @readonly 9836 * @syscap SystemCapability.Multimedia.Camera.Core 9837 * @systemapi 9838 * @since 12 9839 */ 9840 readonly previewType?: TimeLapsePreviewType; 9841 9842 /** 9843 * Timelapse capture interval. 9844 * 9845 * @type { ?number } 9846 * @readonly 9847 * @syscap SystemCapability.Multimedia.Camera.Core 9848 * @systemapi 9849 * @since 12 9850 */ 9851 readonly captureInterval?: number; 9852 } 9853 9854 /** 9855 * Timelapse photo session object. 9856 * 9857 * @interface TimeLapsePhotoSession 9858 * @syscap SystemCapability.Multimedia.Camera.Core 9859 * @systemapi 9860 * @since 12 9861 */ 9862 interface TimeLapsePhotoSession extends Session, Focus, ManualFocus, AutoExposure, ManualExposure, ManualIso, WhiteBalance, Zoom, ColorEffect { 9863 /** 9864 * Subscribes to error events. 9865 * 9866 * @param { 'error' } type - Event type. 9867 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9868 * @throws { BusinessError } 202 - Not System Application. 9869 * @syscap SystemCapability.Multimedia.Camera.Core 9870 * @systemapi 9871 * @since 12 9872 */ 9873 on(type: 'error', callback: ErrorCallback): void; 9874 9875 /** 9876 * Unsubscribes from error events. 9877 * 9878 * @param { 'error' } type - Event type. 9879 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9880 * @throws { BusinessError } 202 - Not System Application. 9881 * @syscap SystemCapability.Multimedia.Camera.Core 9882 * @systemapi 9883 * @since 12 9884 */ 9885 off(type: 'error', callback?: ErrorCallback): void; 9886 9887 /** 9888 * Subscribes focus state change event callback. 9889 * 9890 * @param { 'focusStateChange' } type - Event type. 9891 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9892 * @throws { BusinessError } 202 - Not System Application. 9893 * @syscap SystemCapability.Multimedia.Camera.Core 9894 * @systemapi 9895 * @since 12 9896 */ 9897 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 9898 9899 /** 9900 * Unsubscribes from focus state change event callback. 9901 * 9902 * @param { 'focusStateChange' } type - Event type. 9903 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9904 * @throws { BusinessError } 202 - Not System Application. 9905 * @syscap SystemCapability.Multimedia.Camera.Core 9906 * @systemapi 9907 * @since 12 9908 */ 9909 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 9910 9911 /** 9912 * Subscribes ISO info event callback. 9913 * 9914 * @param { 'isoInfoChange' } type - Event type. 9915 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 9916 * @throws { BusinessError } 202 - Not System Application. 9917 * @syscap SystemCapability.Multimedia.Camera.Core 9918 * @systemapi 9919 * @since 12 9920 */ 9921 on(type: 'isoInfoChange', callback: AsyncCallback<IsoInfo>): void; 9922 9923 /** 9924 * Unsubscribes from ISO info event callback. 9925 * 9926 * @param { 'isoInfoChange' } type - Event type. 9927 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 9928 * @throws { BusinessError } 202 - Not System Application. 9929 * @syscap SystemCapability.Multimedia.Camera.Core 9930 * @systemapi 9931 * @since 12 9932 */ 9933 off(type: 'isoInfoChange', callback?: AsyncCallback<IsoInfo>): void; 9934 9935 /** 9936 * Subscribes exposure info event callback. 9937 * 9938 * @param { 'exposureInfoChange' } type - Event type. 9939 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 9940 * @throws { BusinessError } 202 - Not System Application. 9941 * @syscap SystemCapability.Multimedia.Camera.Core 9942 * @systemapi 9943 * @since 12 9944 */ 9945 on(type: 'exposureInfoChange', callback: AsyncCallback<ExposureInfo>): void; 9946 9947 /** 9948 * Unsubscribes from exposure info event callback. 9949 * 9950 * @param { 'exposureInfoChange' } type - Event type. 9951 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 9952 * @throws { BusinessError } 202 - Not System Application. 9953 * @syscap SystemCapability.Multimedia.Camera.Core 9954 * @systemapi 9955 * @since 12 9956 */ 9957 off(type: 'exposureInfoChange', callback?: AsyncCallback<ExposureInfo>): void; 9958 9959 /** 9960 * Subscribes lumination info event callback. 9961 * 9962 * @param { 'luminationInfoChange' } type - Event type. 9963 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 9964 * @throws { BusinessError } 202 - Not System Application. 9965 * @syscap SystemCapability.Multimedia.Camera.Core 9966 * @systemapi 9967 * @since 12 9968 */ 9969 on(type: 'luminationInfoChange', callback: AsyncCallback<LuminationInfo>): void; 9970 9971 /** 9972 * Unsubscribes from lumination info event callback. 9973 * 9974 * @param { 'luminationInfoChange' } type - Event type. 9975 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 9976 * @throws { BusinessError } 202 - Not System Application. 9977 * @syscap SystemCapability.Multimedia.Camera.Core 9978 * @systemapi 9979 * @since 12 9980 */ 9981 off(type: 'luminationInfoChange', callback?: AsyncCallback<LuminationInfo>): void; 9982 9983 /** 9984 * Check whether try AE is needed. 9985 * 9986 * @returns { boolean } Is try AE needed. 9987 * @throws { BusinessError } 202 - Not System Application. 9988 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 9989 * @syscap SystemCapability.Multimedia.Camera.Core 9990 * @systemapi 9991 * @since 12 9992 */ 9993 isTryAENeeded(): boolean; 9994 9995 /** 9996 * Start try AE. 9997 * 9998 * @throws { BusinessError } 202 - Not System Application. 9999 * @throws { BusinessError } 7400103 - Session not config. 10000 * @throws { BusinessError } 7400201 - Camera service fatal error. 10001 * @syscap SystemCapability.Multimedia.Camera.Core 10002 * @systemapi 10003 * @since 12 10004 */ 10005 startTryAE(): void; 10006 10007 /** 10008 * Stop try AE. 10009 * 10010 * @throws { BusinessError } 202 - Not System Application. 10011 * @throws { BusinessError } 7400103 - Session not config. 10012 * @throws { BusinessError } 7400201 - Camera service fatal error. 10013 * @syscap SystemCapability.Multimedia.Camera.Core 10014 * @systemapi 10015 * @since 12 10016 */ 10017 stopTryAE(): void; 10018 10019 /** 10020 * Subscribes try AE info event callback. 10021 * 10022 * @param { 'tryAEInfoChange' } type - Event type. 10023 * @param { AsyncCallback<TryAEInfo> } callback - Callback used to get the try AE info. 10024 * @throws { BusinessError } 202 - Not System Application. 10025 * @syscap SystemCapability.Multimedia.Camera.Core 10026 * @systemapi 10027 * @since 12 10028 */ 10029 on(type: 'tryAEInfoChange', callback: AsyncCallback<TryAEInfo>): void; 10030 10031 /** 10032 * Unsubscribes from try AE info event callback. 10033 * 10034 * @param { 'tryAEInfoChange' } type - Event type. 10035 * @param { AsyncCallback<TryAEInfo> } callback - Callback used to get the try AE info. 10036 * @throws { BusinessError } 202 - Not System Application. 10037 * @syscap SystemCapability.Multimedia.Camera.Core 10038 * @systemapi 10039 * @since 12 10040 */ 10041 off(type: 'tryAEInfoChange', callback?: AsyncCallback<TryAEInfo>): void; 10042 10043 /** 10044 * Gets supported timelapse interval range. 10045 * 10046 * @returns { Array<number> } Timelapse interval range. 10047 * @throws { BusinessError } 202 - Not System Application. 10048 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 10049 * @syscap SystemCapability.Multimedia.Camera.Core 10050 * @systemapi 10051 * @since 12 10052 */ 10053 getSupportedTimeLapseIntervalRange(): Array<number>; 10054 10055 /** 10056 * Gets the timelapse interval in use. 10057 * 10058 * @returns { number } the timelapse interval in use. 10059 * @throws { BusinessError } 202 - Not System Application. 10060 * @throws { BusinessError } 7400103 - Session not config. 10061 * @syscap SystemCapability.Multimedia.Camera.Core 10062 * @systemapi 10063 * @since 12 10064 */ 10065 getTimeLapseInterval(): number; 10066 10067 /** 10068 * Sets a timelapse interval for a camera device. 10069 * 10070 * @param { number } interval The timelapse interval. 10071 * @throws { BusinessError } 202 - Not System Application. 10072 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10073 * @throws { BusinessError } 7400103 - Session not config. 10074 * @syscap SystemCapability.Multimedia.Camera.Core 10075 * @systemapi 10076 * @since 12 10077 */ 10078 setTimeLapseInterval(interval: number): void; 10079 10080 /** 10081 * Gets the timelapse recording state in use. 10082 * 10083 * @returns { TimeLapseRecordState } the timelapse recording state in use. 10084 * @throws { BusinessError } 202 - Not System Application. 10085 * @throws { BusinessError } 7400103 - Session not config. 10086 * @syscap SystemCapability.Multimedia.Camera.Core 10087 * @systemapi 10088 * @since 12 10089 */ 10090 getTimeLapseRecordState(): TimeLapseRecordState; 10091 10092 /** 10093 * Sets a timelapse recording state. 10094 * 10095 * @param { TimeLapseRecordState } state The timelapse recording state. 10096 * @throws { BusinessError } 202 - Not System Application. 10097 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10098 * @throws { BusinessError } 7400103 - Session not config. 10099 * @syscap SystemCapability.Multimedia.Camera.Core 10100 * @systemapi 10101 * @since 12 10102 */ 10103 setTimeLapseRecordState(state: TimeLapseRecordState): void; 10104 10105 /** 10106 * Gets the timelapse preview type in use. 10107 * 10108 * @returns { TimeLapsePreviewType } the timelapse preview type in use. 10109 * @throws { BusinessError } 202 - Not System Application. 10110 * @throws { BusinessError } 7400103 - Session not config. 10111 * @syscap SystemCapability.Multimedia.Camera.Core 10112 * @systemapi 10113 * @since 12 10114 */ 10115 getTimeLapsePreviewType(): TimeLapsePreviewType; 10116 10117 /** 10118 * Sets a timelapse preview type. 10119 * 10120 * @param { TimeLapsePreviewType } type The timelapse preview type. 10121 * @throws { BusinessError } 202 - Not System Application. 10122 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10123 * @throws { BusinessError } 7400103 - Session not config. 10124 * @syscap SystemCapability.Multimedia.Camera.Core 10125 * @systemapi 10126 * @since 12 10127 */ 10128 setTimeLapsePreviewType(type: TimeLapsePreviewType): void; 10129 } 10130 10131 /** 10132 * Enum for Depth Data Accuracy. 10133 * 10134 * @enum { number } 10135 * @syscap SystemCapability.Multimedia.Camera.Core 10136 * @systemapi 10137 * @since 13 10138 */ 10139 enum DepthDataAccuracy { 10140 /** 10141 * Relative accuracy depth data. 10142 * 10143 * @syscap SystemCapability.Multimedia.Camera.Core 10144 * @systemapi 10145 * @since 13 10146 */ 10147 DEPTH_DATA_ACCURACY_RELATIVE = 0, 10148 10149 /** 10150 * Absolute accuracy depth data. 10151 * 10152 * @syscap SystemCapability.Multimedia.Camera.Core 10153 * @systemapi 10154 * @since 13 10155 */ 10156 DEPTH_DATA_ACCURACY_ABSOLUTE = 1 10157 } 10158 10159 /** 10160 * Enum for Depth Data Quality Level. 10161 * 10162 * @enum { number } 10163 * @syscap SystemCapability.Multimedia.Camera.Core 10164 * @systemapi 10165 * @since 13 10166 */ 10167 enum DepthDataQualityLevel { 10168 /** 10169 * Depth data quality is bad. 10170 * 10171 * @syscap SystemCapability.Multimedia.Camera.Core 10172 * @systemapi 10173 * @since 13 10174 */ 10175 DEPTH_DATA_QUALITY_BAD = 0, 10176 10177 /** 10178 * Depth data quality is fair. 10179 * 10180 * @syscap SystemCapability.Multimedia.Camera.Core 10181 * @systemapi 10182 * @since 13 10183 */ 10184 DEPTH_DATA_QUALITY_FAIR = 1, 10185 10186 /** 10187 * Depth data quality is good. 10188 * 10189 * @syscap SystemCapability.Multimedia.Camera.Core 10190 * @systemapi 10191 * @since 13 10192 */ 10193 DEPTH_DATA_QUALITY_GOOD = 2 10194 } 10195 10196 /** 10197 * Depth Profile. 10198 * 10199 * @interface DepthProfile 10200 * @syscap SystemCapability.Multimedia.Camera.Core 10201 * @systemapi 10202 * @since 13 10203 */ 10204 interface DepthProfile { 10205 /** 10206 * Depth data format. 10207 * 10208 * @type { CameraFormat } 10209 * @readonly 10210 * @syscap SystemCapability.Multimedia.Camera.Core 10211 * @systemapi 10212 * @since 13 10213 */ 10214 readonly format: CameraFormat; 10215 10216 /** 10217 * Depth data accuracy. 10218 * 10219 * @type { DepthDataAccuracy } 10220 * @readonly 10221 * @syscap SystemCapability.Multimedia.Camera.Core 10222 * @systemapi 10223 * @since 13 10224 */ 10225 readonly dataAccuracy: DepthDataAccuracy; 10226 10227 /** 10228 * Depth data resolution. 10229 * 10230 * @type { Size } 10231 * @readonly 10232 * @syscap SystemCapability.Multimedia.Camera.Core 10233 * @systemapi 10234 * @since 13 10235 */ 10236 readonly size: Size; 10237 } 10238 10239 /** 10240 * Depth Data. 10241 * 10242 * @interface DepthData. 10243 * @syscap SystemCapability.Multimedia.Camera.Core 10244 * @systemapi 10245 * @since 13 10246 */ 10247 interface DepthData { 10248 /** 10249 * Depth data format. 10250 * 10251 * @type { CameraFormat } 10252 * @readonly 10253 * @syscap SystemCapability.Multimedia.Camera.Core 10254 * @systemapi 10255 * @since 13 10256 */ 10257 readonly format: CameraFormat; 10258 10259 /** 10260 * Depth data map. 10261 * 10262 * @type { image.PixelMap } 10263 * @readonly 10264 * @syscap SystemCapability.Multimedia.Camera.Core 10265 * @systemapi 10266 * @since 13 10267 */ 10268 readonly depthMap: image.PixelMap; 10269 10270 /** 10271 * Depth data quality level. 10272 * 10273 * @type { DepthDataQualityLevel } 10274 * @readonly 10275 * @syscap SystemCapability.Multimedia.Camera.Core 10276 * @systemapi 10277 * @since 13 10278 */ 10279 readonly qualityLevel: DepthDataQualityLevel; 10280 10281 /** 10282 * Depth data accuracy. 10283 * 10284 * @type { DepthDataAccuracy } 10285 * @readonly 10286 * @syscap SystemCapability.Multimedia.Camera.Core 10287 * @systemapi 10288 * @since 13 10289 */ 10290 readonly dataAccuracy: DepthDataAccuracy; 10291 10292 /** 10293 * Release depth data object. 10294 * 10295 * @returns { Promise<void> } Promise used to return the result. 10296 * @throws { BusinessError } 202 - Not System Application. 10297 * @syscap SystemCapability.Multimedia.Camera.Core 10298 * @systemapi 10299 * @since 13 10300 */ 10301 release(): Promise<void>; 10302 } 10303 10304 /** 10305 * Depth Data Output object 10306 * 10307 * @interface DepthDataOutput 10308 * @extends CameraOutput 10309 * @syscap SystemCapability.Multimedia.Camera.Core 10310 * @systemapi 10311 * @since 13 10312 */ 10313 interface DepthDataOutput extends CameraOutput { 10314 /** 10315 * Start depth data output. 10316 * 10317 * @returns { Promise<void> } Promise used to return the result. 10318 * @throws { BusinessError } 202 - Not System Application. 10319 * @throws { BusinessError } 7400103 - Session not config. 10320 * @throws { BusinessError } 7400201 - Camera service fatal error. 10321 * @syscap SystemCapability.Multimedia.Camera.Core 10322 * @systemapi 10323 * @since 13 10324 */ 10325 start(): Promise<void>; 10326 10327 /** 10328 * Stop depth data output. 10329 * 10330 * @returns { Promise<void> } Promise used to return the result. 10331 * @throws { BusinessError } 202 - Not System Application. 10332 * @throws { BusinessError } 7400103 - Session not config. 10333 * @throws { BusinessError } 7400201 - Camera service fatal error. 10334 * @syscap SystemCapability.Multimedia.Camera.Core 10335 * @systemapi 10336 * @since 13 10337 */ 10338 stop(): Promise<void>; 10339 10340 /** 10341 * Subscribes to depth data objects available event callback. 10342 * 10343 * @param { 'depthDataAvailable' } type - Event type. 10344 * @param { AsyncCallback<DepthData> } callback - Callback used to get the available DepthData objects. 10345 * @throws { BusinessError } 202 - Not System Application. 10346 * @syscap SystemCapability.Multimedia.Camera.Core 10347 * @systemapi 10348 * @since 13 10349 */ 10350 on(type: 'depthDataAvailable', callback: AsyncCallback<DepthData>): void; 10351 10352 /** 10353 * Unsubscribes from depth data objects available event callback. 10354 * 10355 * @param { 'depthDataAvailable' } type - Event type. 10356 * @param { AsyncCallback<DepthData> } callback - Callback used to get the available DepthData objects. 10357 * @throws { BusinessError } 202 - Not System Application. 10358 * @syscap SystemCapability.Multimedia.Camera.Core 10359 * @systemapi 10360 * @since 13 10361 */ 10362 off(type: 'depthDataAvailable', callback?: AsyncCallback<DepthData>): void; 10363 10364 /** 10365 * Subscribes to error events. 10366 * 10367 * @param { 'error' } type - Event type. 10368 * @param { ErrorCallback } callback - Callback used to get the video output errors. 10369 * @throws { BusinessError } 202 - Not System Application. 10370 * @syscap SystemCapability.Multimedia.Camera.Core 10371 * @systemapi 10372 * @since 13 10373 */ 10374 on(type: 'error', callback: ErrorCallback): void; 10375 10376 /** 10377 * Unsubscribes from error events. 10378 * 10379 * @param { 'error' } type - Event type. 10380 * @param { ErrorCallback } callback - Callback used to get the video output errors. 10381 * @throws { BusinessError } 202 - Not System Application. 10382 * @syscap SystemCapability.Multimedia.Camera.Core 10383 * @systemapi 10384 * @since 13 10385 */ 10386 off(type: 'error', callback?: ErrorCallback): void; 10387 } 10388 10389 /** 10390 * Depth Fusion Query object. 10391 * 10392 * @interface DepthFusionQuery 10393 * @syscap SystemCapability.Multimedia.Camera.Core 10394 * @systemapi 10395 * @since 14 10396 */ 10397 interface DepthFusionQuery { 10398 /** 10399 * Checks whether a depth fusion is supported. 10400 * 10401 * @returns { boolean } Is the depth fusion supported. 10402 * @throws { BusinessError } 202 - Not System Application. 10403 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 10404 * @syscap SystemCapability.Multimedia.Camera.Core 10405 * @systemapi 10406 * @since 14 10407 */ 10408 isDepthFusionSupported(): boolean; 10409 10410 /** 10411 * Query the depth fusion threshold. 10412 * 10413 * @returns { Array<number> } The depth fusion threshold. 10414 * @throws { BusinessError } 202 - Not System Application. 10415 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 10416 * @syscap SystemCapability.Multimedia.Camera.Core 10417 * @systemapi 10418 * @since 14 10419 */ 10420 getDepthFusionThreshold(): Array<number>; 10421 } 10422 10423 /** 10424 * Depth Fusion object. 10425 * 10426 * @interface DepthFusion 10427 * @extends DepthFusionQuery 10428 * @syscap SystemCapability.Multimedia.Camera.Core 10429 * @systemapi 10430 * @since 14 10431 */ 10432 interface DepthFusion extends DepthFusionQuery { 10433 /** 10434 * Confirm if the depth fusion enabled. 10435 * 10436 * @returns { boolean } TRUE if the depth fusion is enable. 10437 * @throws { BusinessError } 202 - Not System Application. 10438 * @throws { BusinessError } 7400103 - Session not config. 10439 * @syscap SystemCapability.Multimedia.Camera.Core 10440 * @systemapi 10441 * @since 14 10442 */ 10443 isDepthFusionEnabled(): boolean; 10444 10445 /** 10446 * Enable depth fusion. 10447 * 10448 * @param { boolean } enabled - Target state for depth fusion. 10449 * @throws { BusinessError } 202 - Not System Application. 10450 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10451 * @throws { BusinessError } 7400103 - Session not config. 10452 * @throws { BusinessError } 7400201 - Camera service fatal error. 10453 * @syscap SystemCapability.Multimedia.Camera.Core 10454 * @systemapi 10455 * @since 14 10456 */ 10457 enableDepthFusion(enabled: boolean): void; 10458 } 10459} 10460 10461export default camera; 10462