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, EffectSuggestion { 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 * Subscribes to effect suggestion event callback. 5247 * 5248 * @param { 'effectSuggestionChange' } type - Event type. 5249 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 5250 * @syscap SystemCapability.Multimedia.Camera.Core 5251 * @systemapi 5252 * @since 18 5253 */ 5254 on(type: 'effectSuggestionChange', callback: AsyncCallback<EffectSuggestionType>): void; 5255 5256 /** 5257 * Unsubscribes from effect suggestion event callback. 5258 * 5259 * @param { 'effectSuggestionChange' } type - Event type. 5260 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 5261 * @syscap SystemCapability.Multimedia.Camera.Core 5262 * @systemapi 5263 * @since 18 5264 */ 5265 off(type: 'effectSuggestionChange', callback?: AsyncCallback<EffectSuggestionType>): void; 5266 5267 /** 5268 * Gets session functions. 5269 * 5270 * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. 5271 * @returns { Array<VideoFunctions> } List of session functions. 5272 * @throws { BusinessError } 202 - Not System Application. 5273 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 5274 * @syscap SystemCapability.Multimedia.Camera.Core 5275 * @systemapi 5276 * @since 13 5277 */ 5278 getSessionFunctions(outputCapability: CameraOutputCapability): Array<VideoFunctions>; 5279 5280 /** 5281 * Gets session conflict functions. 5282 * 5283 * @returns { Array<VideoConflictFunctions> } List of session conflict functions. 5284 * @throws { BusinessError } 202 - Not System Application. 5285 * @syscap SystemCapability.Multimedia.Camera.Core 5286 * @systemapi 5287 * @since 13 5288 */ 5289 getSessionConflictFunctions(): Array<VideoConflictFunctions>; 5290 } 5291 5292 /** 5293 * Enumerates the camera portrait effects. 5294 * 5295 * @enum { number } 5296 * @syscap SystemCapability.Multimedia.Camera.Core 5297 * @systemapi 5298 * @since 10 5299 */ 5300 enum PortraitEffect { 5301 /** 5302 * portrait effect off. 5303 * 5304 * @syscap SystemCapability.Multimedia.Camera.Core 5305 * @systemapi 5306 * @since 10 5307 */ 5308 OFF = 0, 5309 5310 /** 5311 * circular blurring for portrait. 5312 * 5313 * @syscap SystemCapability.Multimedia.Camera.Core 5314 * @systemapi 5315 * @since 10 5316 */ 5317 CIRCLES = 1, 5318 5319 /** 5320 * heart blurring for portrait. 5321 * 5322 * @syscap SystemCapability.Multimedia.Camera.Core 5323 * @systemapi 5324 * @since 11 5325 */ 5326 HEART = 2, 5327 5328 /** 5329 * rotated blurring for portrait. 5330 * 5331 * @syscap SystemCapability.Multimedia.Camera.Core 5332 * @systemapi 5333 * @since 11 5334 */ 5335 ROTATED = 3, 5336 5337 /** 5338 * studio blurring for portrait. 5339 * 5340 * @syscap SystemCapability.Multimedia.Camera.Core 5341 * @systemapi 5342 * @since 11 5343 */ 5344 STUDIO = 4, 5345 5346 /** 5347 * theater blurring for portrait. 5348 * 5349 * @syscap SystemCapability.Multimedia.Camera.Core 5350 * @systemapi 5351 * @since 11 5352 */ 5353 THEATER = 5 5354 } 5355 5356 /** 5357 * Portrait Query object. 5358 * 5359 * @interface PortraitQuery 5360 * @syscap SystemCapability.Multimedia.Camera.Core 5361 * @systemapi 5362 * @since 12 5363 */ 5364 interface PortraitQuery { 5365 /** 5366 * Gets supported portrait effect. 5367 * 5368 * @returns { Array<PortraitEffect> } List of portrait effect. 5369 * @throws { BusinessError } 7400103 - Session not config. 5370 * @syscap SystemCapability.Multimedia.Camera.Core 5371 * @systemapi 5372 * @since 10 5373 */ 5374 /** 5375 * Gets supported portrait effect. 5376 * Move to Portrait interface from PortraitPhotoSession interface since 11. 5377 * 5378 * @returns { Array<PortraitEffect> } List of portrait effect. 5379 * @throws { BusinessError } 202 - Not System Application. 5380 * @throws { BusinessError } 7400103 - Session not config. 5381 * @syscap SystemCapability.Multimedia.Camera.Core 5382 * @systemapi 5383 * @since 11 5384 */ 5385 /** 5386 * Gets supported portrait effect. 5387 * Move to PortraitQuery interface from Portrait interface since 12. 5388 * 5389 * @returns { Array<PortraitEffect> } List of portrait effect. 5390 * @throws { BusinessError } 202 - Not System Application. 5391 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5392 * @syscap SystemCapability.Multimedia.Camera.Core 5393 * @systemapi 5394 * @since 12 5395 */ 5396 getSupportedPortraitEffects(): Array<PortraitEffect>; 5397 } 5398 5399 /** 5400 * Portrait object. 5401 * 5402 * @interface Portrait 5403 * @syscap SystemCapability.Multimedia.Camera.Core 5404 * @systemapi 5405 * @since 11 5406 */ 5407 interface Portrait extends PortraitQuery { 5408 /** 5409 * Gets the portrait effect in use. 5410 * 5411 * @returns { PortraitEffect } The portrait effect in use. 5412 * @throws { BusinessError } 7400103 - Session not config. 5413 * @syscap SystemCapability.Multimedia.Camera.Core 5414 * @systemapi 5415 * @since 10 5416 */ 5417 /** 5418 * Gets the portrait effect in use. 5419 * Move to Portrait interface from PortraitPhotoSession interface since 11. 5420 * 5421 * @returns { PortraitEffect } The portrait effect in use. 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 getPortraitEffect(): PortraitEffect; 5429 5430 /** 5431 * Sets a portrait effect for a camera device. 5432 * 5433 * @param { PortraitEffect } effect - Effect Portrait effect to set. 5434 * @throws { BusinessError } 7400103 - Session not config. 5435 * @syscap SystemCapability.Multimedia.Camera.Core 5436 * @systemapi 5437 * @since 10 5438 */ 5439 /** 5440 * Sets a portrait effect for a camera device. 5441 * Move to Portrait interface from PortraitPhotoSession interface since 11. 5442 * 5443 * @param { PortraitEffect } effect - Effect Portrait effect to set. 5444 * @throws { BusinessError } 202 - Not System Application. 5445 * @throws { BusinessError } 7400103 - Session not config. 5446 * @syscap SystemCapability.Multimedia.Camera.Core 5447 * @systemapi 5448 * @since 11 5449 */ 5450 setPortraitEffect(effect: PortraitEffect): void; 5451 } 5452 5453 /** 5454 * Zoom range. 5455 * 5456 * @typedef ZoomRange 5457 * @syscap SystemCapability.Multimedia.Camera.Core 5458 * @systemapi 5459 * @since 11 5460 */ 5461 interface ZoomRange { 5462 /** 5463 * Min zoom value. 5464 * 5465 * @type { number } 5466 * @readonly 5467 * @syscap SystemCapability.Multimedia.Camera.Core 5468 * @systemapi 5469 * @since 11 5470 */ 5471 readonly min: number; 5472 5473 /** 5474 * Max zoom value. 5475 * 5476 * @type { number } 5477 * @readonly 5478 * @syscap SystemCapability.Multimedia.Camera.Core 5479 * @systemapi 5480 * @since 11 5481 */ 5482 readonly max: number; 5483 } 5484 5485 /** 5486 * Physical Aperture object 5487 * 5488 * @typedef PhysicalAperture 5489 * @syscap SystemCapability.Multimedia.Camera.Core 5490 * @systemapi 5491 * @since 11 5492 */ 5493 interface PhysicalAperture { 5494 /** 5495 * Zoom Range of the specific physical aperture. 5496 * 5497 * @type { ZoomRange } 5498 * @syscap SystemCapability.Multimedia.Camera.Core 5499 * @systemapi 5500 * @since 11 5501 */ 5502 zoomRange: ZoomRange; 5503 5504 /** 5505 * The supported physical apertures. 5506 * 5507 * @type { Array<number> } 5508 * @syscap SystemCapability.Multimedia.Camera.Core 5509 * @systemapi 5510 * @since 11 5511 */ 5512 apertures: Array<number>; 5513 } 5514 5515 /** 5516 * Aperture Query object. 5517 * 5518 * @interface ApertureQuery 5519 * @syscap SystemCapability.Multimedia.Camera.Core 5520 * @systemapi 5521 * @since 12 5522 */ 5523 interface ApertureQuery { 5524 /** 5525 * Gets the supported virtual apertures. 5526 * 5527 * @returns { Array<number> } The array of supported virtual apertures. 5528 * @throws { BusinessError } 202 - Not System Application. 5529 * @throws { BusinessError } 7400103 - Session not config. 5530 * @syscap SystemCapability.Multimedia.Camera.Core 5531 * @systemapi 5532 * @since 11 5533 */ 5534 /** 5535 * Gets the supported virtual apertures. 5536 * Move to ApertureQuery interface from Aperture since 12. 5537 * 5538 * @returns { Array<number> } The array of supported virtual apertures. 5539 * @throws { BusinessError } 202 - Not System Application. 5540 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5541 * @syscap SystemCapability.Multimedia.Camera.Core 5542 * @systemapi 5543 * @since 12 5544 */ 5545 getSupportedVirtualApertures(): Array<number>; 5546 5547 /** 5548 * Gets the supported physical apertures. 5549 * 5550 * @returns { Array<PhysicalAperture> } The array of supported physical apertures. 5551 * @throws { BusinessError } 202 - Not System Application. 5552 * @throws { BusinessError } 7400103 - Session not config. 5553 * @syscap SystemCapability.Multimedia.Camera.Core 5554 * @systemapi 5555 * @since 11 5556 */ 5557 /** 5558 * Gets the supported physical apertures. 5559 * Move to ApertureQuery interface from Aperture since 12. 5560 * 5561 * @returns { Array<PhysicalAperture> } The array of supported physical apertures. 5562 * @throws { BusinessError } 202 - Not System Application. 5563 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5564 * @syscap SystemCapability.Multimedia.Camera.Core 5565 * @systemapi 5566 * @since 12 5567 */ 5568 getSupportedPhysicalApertures(): Array<PhysicalAperture>; 5569 } 5570 5571 /** 5572 * Aperture object. 5573 * 5574 * @interface Aperture 5575 * @syscap SystemCapability.Multimedia.Camera.Core 5576 * @systemapi 5577 * @since 11 5578 */ 5579 interface Aperture extends ApertureQuery { 5580 /** 5581 * Gets current virtual aperture value. 5582 * 5583 * @returns { number } The current virtual aperture value. 5584 * @throws { BusinessError } 202 - Not System Application. 5585 * @throws { BusinessError } 7400103 - Session not config. 5586 * @syscap SystemCapability.Multimedia.Camera.Core 5587 * @systemapi 5588 * @since 11 5589 */ 5590 getVirtualAperture(): number; 5591 5592 /** 5593 * Sets virtual aperture value. 5594 * 5595 * @param { number } aperture - virtual aperture value 5596 * @throws { BusinessError } 202 - Not System Application. 5597 * @throws { BusinessError } 7400103 - Session not config. 5598 * @syscap SystemCapability.Multimedia.Camera.Core 5599 * @systemapi 5600 * @since 11 5601 */ 5602 setVirtualAperture(aperture: number): void; 5603 5604 /** 5605 * Gets current physical aperture value. 5606 * 5607 * @returns { number } The current physical aperture value. 5608 * @throws { BusinessError } 202 - Not System Application. 5609 * @throws { BusinessError } 7400103 - Session not config. 5610 * @syscap SystemCapability.Multimedia.Camera.Core 5611 * @systemapi 5612 * @since 11 5613 */ 5614 getPhysicalAperture(): number; 5615 5616 /** 5617 * Sets physical aperture value. 5618 * 5619 * @param { number } aperture - physical aperture value 5620 * @throws { BusinessError } 202 - Not System Application. 5621 * @throws { BusinessError } 7400103 - Session not config. 5622 * @syscap SystemCapability.Multimedia.Camera.Core 5623 * @systemapi 5624 * @since 11 5625 */ 5626 setPhysicalAperture(aperture: number): void; 5627 } 5628 5629 /** 5630 * Portrait Photo session object. 5631 * 5632 * @interface PortraitPhotoSession 5633 * @syscap SystemCapability.Multimedia.Camera.Core 5634 * @systemapi 5635 * @since 11 5636 */ 5637 interface PortraitPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, Beauty, ColorEffect, ColorManagement, Portrait, Aperture { 5638 /** 5639 * Subscribes to error events. 5640 * 5641 * @param { 'error' } type - Event type. 5642 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5643 * @syscap SystemCapability.Multimedia.Camera.Core 5644 * @systemapi 5645 * @since 11 5646 */ 5647 on(type: 'error', callback: ErrorCallback): void; 5648 5649 /** 5650 * Unsubscribes from error events. 5651 * 5652 * @param { 'error' } type - Event type. 5653 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5654 * @syscap SystemCapability.Multimedia.Camera.Core 5655 * @systemapi 5656 * @since 11 5657 */ 5658 off(type: 'error', callback?: ErrorCallback): void; 5659 5660 /** 5661 * Subscribes focus state change event callback. 5662 * 5663 * @param { 'focusStateChange' } type - Event type. 5664 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5665 * @syscap SystemCapability.Multimedia.Camera.Core 5666 * @systemapi 5667 * @since 11 5668 */ 5669 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 5670 5671 /** 5672 * Unsubscribes from focus state change event callback. 5673 * 5674 * @param { 'focusStateChange' } type - Event type. 5675 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5676 * @syscap SystemCapability.Multimedia.Camera.Core 5677 * @systemapi 5678 * @since 11 5679 */ 5680 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 5681 5682 /** 5683 * Subscribes zoom info event callback. 5684 * 5685 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5686 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5687 * @syscap SystemCapability.Multimedia.Camera.Core 5688 * @systemapi 5689 * @since 11 5690 */ 5691 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 5692 5693 /** 5694 * Unsubscribes from zoom info event callback. 5695 * 5696 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5697 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5698 * @syscap SystemCapability.Multimedia.Camera.Core 5699 * @systemapi 5700 * @since 11 5701 */ 5702 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 5703 5704 /** 5705 * Subscribes to lcd flash status. 5706 * 5707 * @param { 'lcdFlashStatus' } type - Event type. 5708 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5709 * @throws { BusinessError } 202 - Not System Application. 5710 * @syscap SystemCapability.Multimedia.Camera.Core 5711 * @systemapi 5712 * @since 13 5713 */ 5714 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 5715 5716 /** 5717 * Unsubscribes from lcd flash status. 5718 * 5719 * @param { 'lcdFlashStatus' } type - Event type. 5720 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 5721 * @throws { BusinessError } 202 - Not System Application. 5722 * @syscap SystemCapability.Multimedia.Camera.Core 5723 * @systemapi 5724 * @since 13 5725 */ 5726 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 5727 5728 /** 5729 * Gets session functions. 5730 * 5731 * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. 5732 * @returns { Array<PortraitPhotoFunctions> } List of session functions. 5733 * @throws { BusinessError } 202 - Not System Application. 5734 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 5735 * @syscap SystemCapability.Multimedia.Camera.Core 5736 * @systemapi 5737 * @since 13 5738 */ 5739 getSessionFunctions(outputCapability: CameraOutputCapability): Array<PortraitPhotoFunctions>; 5740 5741 /** 5742 * Gets session conflict functions. 5743 * 5744 * @returns { Array<PortraitPhotoConflictFunctions> } List of session conflict functions. 5745 * @throws { BusinessError } 202 - Not System Application. 5746 * @syscap SystemCapability.Multimedia.Camera.Core 5747 * @systemapi 5748 * @since 13 5749 */ 5750 getSessionConflictFunctions(): Array<PortraitPhotoConflictFunctions>; 5751 } 5752 5753 /** 5754 * Aperture video session object. 5755 * 5756 * @interface ApertureVideoSession 5757 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Aperture 5758 * @syscap SystemCapability.Multimedia.Camera.Core 5759 * @systemapi 5760 * @since 12 5761 */ 5762 interface ApertureVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Aperture { 5763 /** 5764 * Subscribes to error events. 5765 * 5766 * @param { 'error' } type - Event type. 5767 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5768 * @throws { BusinessError } 202 - Not System Application. 5769 * @syscap SystemCapability.Multimedia.Camera.Core 5770 * @systemapi 5771 * @since 12 5772 */ 5773 on(type: 'error', callback: ErrorCallback): void; 5774 5775 /** 5776 * Unsubscribes from error events. 5777 * 5778 * @param { 'error' } type - Event type. 5779 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5780 * @throws { BusinessError } 202 - Not System Application. 5781 * @syscap SystemCapability.Multimedia.Camera.Core 5782 * @systemapi 5783 * @since 12 5784 */ 5785 off(type: 'error', callback?: ErrorCallback): void; 5786 5787 /** 5788 * Subscribes focus state change event callback. 5789 * 5790 * @param { 'focusStateChange' } type - Event type. 5791 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5792 * @throws { BusinessError } 202 - Not System Application. 5793 * @syscap SystemCapability.Multimedia.Camera.Core 5794 * @systemapi 5795 * @since 12 5796 */ 5797 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 5798 5799 /** 5800 * Unsubscribes from focus state change event callback. 5801 * 5802 * @param { 'focusStateChange' } type - Event type. 5803 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5804 * @throws { BusinessError } 202 - Not System Application. 5805 * @syscap SystemCapability.Multimedia.Camera.Core 5806 * @systemapi 5807 * @since 12 5808 */ 5809 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 5810 5811 /** 5812 * Subscribes zoom info event callback. 5813 * 5814 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5815 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5816 * @throws { BusinessError } 202 - Not System Application. 5817 * @syscap SystemCapability.Multimedia.Camera.Core 5818 * @systemapi 5819 * @since 12 5820 */ 5821 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 5822 5823 /** 5824 * Unsubscribes from zoom info event callback. 5825 * 5826 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5827 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5828 * @throws { BusinessError } 202 - Not System Application. 5829 * @syscap SystemCapability.Multimedia.Camera.Core 5830 * @systemapi 5831 * @since 12 5832 */ 5833 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 5834 } 5835 5836 /** 5837 * ManualExposure Query object. 5838 * 5839 * @interface ManualExposureQuery 5840 * @syscap SystemCapability.Multimedia.Camera.Core 5841 * @systemapi 5842 * @since 12 5843 */ 5844 interface ManualExposureQuery { 5845 /** 5846 * Gets the supported manual exposure range. 5847 * 5848 * @returns { Array<number> } The array of manual exposure range. 5849 * @throws { BusinessError } 202 - Not System Application. 5850 * @throws { BusinessError } 7400103 - Session not config. 5851 * @syscap SystemCapability.Multimedia.Camera.Core 5852 * @systemapi 5853 * @since 11 5854 */ 5855 /** 5856 * Gets the supported manual exposure range. 5857 * Move to ManualExposureQuery from ManualExposure since 12. 5858 * 5859 * @returns { Array<number> } The array of manual exposure range. 5860 * @throws { BusinessError } 202 - Not System Application. 5861 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5862 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5863 * @syscap SystemCapability.Multimedia.Camera.Core 5864 * @systemapi 5865 * @since 12 5866 */ 5867 getSupportedExposureRange(): Array<number>; 5868 } 5869 5870 /** 5871 * ManualExposure object. 5872 * 5873 * @interface ManualExposure 5874 * @syscap SystemCapability.Multimedia.Camera.Core 5875 * @systemapi 5876 * @since 11 5877 */ 5878 interface ManualExposure extends ManualExposureQuery { 5879 /** 5880 * Gets current exposure value. 5881 * 5882 * @returns { number } The current exposure value. 5883 * @throws { BusinessError } 202 - Not System Application. 5884 * @throws { BusinessError } 7400103 - Session not config. 5885 * @syscap SystemCapability.Multimedia.Camera.Core 5886 * @systemapi 5887 * @since 11 5888 */ 5889 /** 5890 * Gets current exposure value. 5891 * 5892 * @returns { number } The current exposure value. 5893 * @throws { BusinessError } 202 - Not System Application. 5894 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5895 * @throws { BusinessError } 7400103 - Session not config. 5896 * @syscap SystemCapability.Multimedia.Camera.Core 5897 * @systemapi 5898 * @since 12 5899 */ 5900 getExposure(): number; 5901 5902 /** 5903 * Sets Exposure value. 5904 * 5905 * @param { number } exposure - Exposure value 5906 * @throws { BusinessError } 202 - Not System Application. 5907 * @throws { BusinessError } 7400103 - Session not config. 5908 * @syscap SystemCapability.Multimedia.Camera.Core 5909 * @systemapi 5910 * @since 11 5911 */ 5912 /** 5913 * Sets Exposure value. 5914 * 5915 * @param { number } exposure - Exposure value 5916 * @throws { BusinessError } 202 - Not System Application. 5917 * @throws { BusinessError } 7400102 - Operation not allowed. 5918 * @throws { BusinessError } 7400103 - Session not config. 5919 * @syscap SystemCapability.Multimedia.Camera.Core 5920 * @systemapi 5921 * @since 12 5922 */ 5923 setExposure(exposure: number): void; 5924 } 5925 5926 /** 5927 * Night photo session object. 5928 * 5929 * @interface NightPhotoSession 5930 * @syscap SystemCapability.Multimedia.Camera.Core 5931 * @systemapi 5932 * @since 11 5933 */ 5934 interface NightPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Beauty, ColorManagement, ManualExposure { 5935 /** 5936 * Subscribes to error events. 5937 * 5938 * @param { 'error' } type - Event type. 5939 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5940 * @syscap SystemCapability.Multimedia.Camera.Core 5941 * @systemapi 5942 * @since 11 5943 */ 5944 on(type: 'error', callback: ErrorCallback): void; 5945 5946 /** 5947 * Unsubscribes from error events. 5948 * 5949 * @param { 'error' } type - Event type. 5950 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 5951 * @syscap SystemCapability.Multimedia.Camera.Core 5952 * @systemapi 5953 * @since 11 5954 */ 5955 off(type: 'error', callback?: ErrorCallback): void; 5956 5957 /** 5958 * Subscribes focus state change event callback. 5959 * 5960 * @param { 'focusStateChange' } type - Event type. 5961 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5962 * @syscap SystemCapability.Multimedia.Camera.Core 5963 * @systemapi 5964 * @since 11 5965 */ 5966 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 5967 5968 /** 5969 * Unsubscribes from focus state change event callback. 5970 * 5971 * @param { 'focusStateChange' } type - Event type. 5972 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 5973 * @syscap SystemCapability.Multimedia.Camera.Core 5974 * @systemapi 5975 * @since 11 5976 */ 5977 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 5978 5979 /** 5980 * Subscribes zoom info event callback. 5981 * 5982 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5983 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5984 * @syscap SystemCapability.Multimedia.Camera.Core 5985 * @systemapi 5986 * @since 11 5987 */ 5988 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 5989 5990 /** 5991 * Unsubscribes from zoom info event callback. 5992 * 5993 * @param { 'smoothZoomInfoAvailable' } type - Event type. 5994 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 5995 * @syscap SystemCapability.Multimedia.Camera.Core 5996 * @systemapi 5997 * @since 11 5998 */ 5999 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6000 6001 /** 6002 * Subscribes to lcd flash status. 6003 * 6004 * @param { 'lcdFlashStatus' } type - Event type. 6005 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 6006 * @throws { BusinessError } 202 - Not System Application. 6007 * @syscap SystemCapability.Multimedia.Camera.Core 6008 * @systemapi 6009 * @since 12 6010 */ 6011 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 6012 6013 /** 6014 * Unsubscribes from lcd flash status. 6015 * 6016 * @param { 'lcdFlashStatus' } type - Event type. 6017 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 6018 * @throws { BusinessError } 202 - Not System Application. 6019 * @syscap SystemCapability.Multimedia.Camera.Core 6020 * @systemapi 6021 * @since 12 6022 */ 6023 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 6024 } 6025 6026 /** 6027 * ISO info object 6028 * 6029 * @typedef IsoInfo 6030 * @syscap SystemCapability.Multimedia.Camera.Core 6031 * @systemapi 6032 * @since 12 6033 */ 6034 interface IsoInfo { 6035 /** 6036 * ISO value. 6037 * 6038 * @type { ?number } 6039 * @readonly 6040 * @syscap SystemCapability.Multimedia.Camera.Core 6041 * @systemapi 6042 * @since 12 6043 */ 6044 readonly iso?: number; 6045 } 6046 6047 /** 6048 * Exposure info object 6049 * 6050 * @typedef ExposureInfo 6051 * @syscap SystemCapability.Multimedia.Camera.Core 6052 * @systemapi 6053 * @since 12 6054 */ 6055 interface ExposureInfo { 6056 /** 6057 * Exposure time value. 6058 * 6059 * @type { ?number } 6060 * @readonly 6061 * @syscap SystemCapability.Multimedia.Camera.Core 6062 * @systemapi 6063 * @since 12 6064 */ 6065 readonly exposureTime?: number; 6066 } 6067 6068 /** 6069 * Aperture info object 6070 * 6071 * @typedef ApertureInfo 6072 * @syscap SystemCapability.Multimedia.Camera.Core 6073 * @systemapi 6074 * @since 12 6075 */ 6076 interface ApertureInfo { 6077 /** 6078 * Aperture value. 6079 * 6080 * @type { ?number } 6081 * @readonly 6082 * @syscap SystemCapability.Multimedia.Camera.Core 6083 * @systemapi 6084 * @since 12 6085 */ 6086 readonly aperture?: number; 6087 } 6088 6089 /** 6090 * Lumination info object 6091 * 6092 * @typedef LuminationInfo 6093 * @syscap SystemCapability.Multimedia.Camera.Core 6094 * @systemapi 6095 * @since 12 6096 */ 6097 interface LuminationInfo { 6098 /** 6099 * Lumination value. 6100 * 6101 * @type { ?number } 6102 * @readonly 6103 * @syscap SystemCapability.Multimedia.Camera.Core 6104 * @systemapi 6105 * @since 12 6106 */ 6107 readonly lumination?: number; 6108 } 6109 6110 /** 6111 * Professional photo session object. 6112 * 6113 * @interface ProfessionalPhotoSession 6114 * @syscap SystemCapability.Multimedia.Camera.Core 6115 * @systemapi 6116 * @since 12 6117 */ 6118 interface ProfessionalPhotoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { 6119 /** 6120 * Subscribes to error events. 6121 * 6122 * @param { 'error' } type - Event type. 6123 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6124 * @throws { BusinessError } 202 - Not System Application. 6125 * @syscap SystemCapability.Multimedia.Camera.Core 6126 * @systemapi 6127 * @since 12 6128 */ 6129 on(type: 'error', callback: ErrorCallback): void; 6130 6131 /** 6132 * Unsubscribes from error events. 6133 * 6134 * @param { 'error' } type - Event type. 6135 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6136 * @throws { BusinessError } 202 - Not System Application. 6137 * @syscap SystemCapability.Multimedia.Camera.Core 6138 * @systemapi 6139 * @since 12 6140 */ 6141 off(type: 'error', callback?: ErrorCallback): void; 6142 6143 /** 6144 * Subscribes focus state change event callback. 6145 * 6146 * @param { 'focusStateChange' } type - Event type. 6147 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6148 * @throws { BusinessError } 202 - Not System Application. 6149 * @syscap SystemCapability.Multimedia.Camera.Core 6150 * @systemapi 6151 * @since 12 6152 */ 6153 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6154 6155 /** 6156 * Unsubscribes from focus state change event callback. 6157 * 6158 * @param { 'focusStateChange' } type - Event type. 6159 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6160 * @throws { BusinessError } 202 - Not System Application. 6161 * @syscap SystemCapability.Multimedia.Camera.Core 6162 * @systemapi 6163 * @since 12 6164 */ 6165 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6166 6167 /** 6168 * Subscribes zoom info event callback. 6169 * 6170 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6171 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6172 * @throws { BusinessError } 202 - Not System Application. 6173 * @syscap SystemCapability.Multimedia.Camera.Core 6174 * @systemapi 6175 * @since 12 6176 */ 6177 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6178 6179 /** 6180 * Unsubscribes from zoom info event callback. 6181 * 6182 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6183 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6184 * @throws { BusinessError } 202 - Not System Application. 6185 * @syscap SystemCapability.Multimedia.Camera.Core 6186 * @systemapi 6187 * @since 12 6188 */ 6189 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6190 6191 /** 6192 * Subscribes ISO info event callback. 6193 * 6194 * @param { 'isoInfoChange' } type - Event type. 6195 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 6196 * @throws { BusinessError } 202 - Not System Application. 6197 * @syscap SystemCapability.Multimedia.Camera.Core 6198 * @systemapi 6199 * @since 12 6200 */ 6201 on(type: 'isoInfoChange', callback: AsyncCallback<IsoInfo>): void; 6202 6203 /** 6204 * Unsubscribes from ISO info event callback. 6205 * 6206 * @param { 'isoInfoChange' } type - Event type. 6207 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 6208 * @throws { BusinessError } 202 - Not System Application. 6209 * @syscap SystemCapability.Multimedia.Camera.Core 6210 * @systemapi 6211 * @since 12 6212 */ 6213 off(type: 'isoInfoChange', callback?: AsyncCallback<IsoInfo>): void; 6214 6215 /** 6216 * Subscribes exposure info event callback. 6217 * 6218 * @param { 'exposureInfoChange' } type - Event type. 6219 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 6220 * @throws { BusinessError } 202 - Not System Application. 6221 * @syscap SystemCapability.Multimedia.Camera.Core 6222 * @systemapi 6223 * @since 12 6224 */ 6225 on(type: 'exposureInfoChange', callback: AsyncCallback<ExposureInfo>): void; 6226 6227 /** 6228 * Unsubscribes from exposure info event callback. 6229 * 6230 * @param { 'exposureInfoChange' } type - Event type. 6231 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 6232 * @throws { BusinessError } 202 - Not System Application. 6233 * @syscap SystemCapability.Multimedia.Camera.Core 6234 * @systemapi 6235 * @since 12 6236 */ 6237 off(type: 'exposureInfoChange', callback?: AsyncCallback<ExposureInfo>): void; 6238 6239 /** 6240 * Subscribes aperture info event callback. 6241 * 6242 * @param { 'apertureInfoChange' } type - Event type. 6243 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 6244 * @throws { BusinessError } 202 - Not System Application. 6245 * @syscap SystemCapability.Multimedia.Camera.Core 6246 * @systemapi 6247 * @since 12 6248 */ 6249 on(type: 'apertureInfoChange', callback: AsyncCallback<ApertureInfo>): void; 6250 6251 /** 6252 * Unsubscribes from aperture info event callback. 6253 * 6254 * @param { 'apertureInfoChange' } type - Event type. 6255 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 6256 * @throws { BusinessError } 202 - Not System Application. 6257 * @syscap SystemCapability.Multimedia.Camera.Core 6258 * @systemapi 6259 * @since 12 6260 */ 6261 off(type: 'apertureInfoChange', callback?: AsyncCallback<ApertureInfo>): void; 6262 6263 /** 6264 * Subscribes lumination info event callback. 6265 * 6266 * @param { 'luminationInfoChange' } type - Event type. 6267 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 6268 * @throws { BusinessError } 202 - Not System Application. 6269 * @syscap SystemCapability.Multimedia.Camera.Core 6270 * @systemapi 6271 * @since 12 6272 */ 6273 on(type: 'luminationInfoChange', callback: AsyncCallback<LuminationInfo>): void; 6274 6275 /** 6276 * Unsubscribes from lumination info event callback. 6277 * 6278 * @param { 'luminationInfoChange' } type - Event type. 6279 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 6280 * @throws { BusinessError } 202 - Not System Application. 6281 * @syscap SystemCapability.Multimedia.Camera.Core 6282 * @systemapi 6283 * @since 12 6284 */ 6285 off(type: 'luminationInfoChange', callback?: AsyncCallback<LuminationInfo>): void; 6286 } 6287 6288 /** 6289 * Professional video session object. 6290 * 6291 * @interface ProfessionalVideoSession 6292 * @syscap SystemCapability.Multimedia.Camera.Core 6293 * @systemapi 6294 * @since 12 6295 */ 6296 interface ProfessionalVideoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { 6297 /** 6298 * Subscribes to error events. 6299 * 6300 * @param { 'error' } type - Event type. 6301 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6302 * @throws { BusinessError } 202 - Not System Application. 6303 * @syscap SystemCapability.Multimedia.Camera.Core 6304 * @systemapi 6305 * @since 12 6306 */ 6307 on(type: 'error', callback: ErrorCallback): void; 6308 6309 /** 6310 * Unsubscribes from error events. 6311 * 6312 * @param { 'error' } type - Event type. 6313 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6314 * @throws { BusinessError } 202 - Not System Application. 6315 * @syscap SystemCapability.Multimedia.Camera.Core 6316 * @systemapi 6317 * @since 12 6318 */ 6319 off(type: 'error', callback?: ErrorCallback): void; 6320 6321 /** 6322 * Subscribes focus state change event callback. 6323 * 6324 * @param { 'focusStateChange' } type - Event type. 6325 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6326 * @throws { BusinessError } 202 - Not System Application. 6327 * @syscap SystemCapability.Multimedia.Camera.Core 6328 * @systemapi 6329 * @since 12 6330 */ 6331 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6332 6333 /** 6334 * Unsubscribes from focus state change event callback. 6335 * 6336 * @param { 'focusStateChange' } type - Event type. 6337 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6338 * @throws { BusinessError } 202 - Not System Application. 6339 * @syscap SystemCapability.Multimedia.Camera.Core 6340 * @systemapi 6341 * @since 12 6342 */ 6343 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6344 6345 /** 6346 * Subscribes zoom info event callback. 6347 * 6348 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6349 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6350 * @throws { BusinessError } 202 - Not System Application. 6351 * @syscap SystemCapability.Multimedia.Camera.Core 6352 * @systemapi 6353 * @since 12 6354 */ 6355 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6356 6357 /** 6358 * Unsubscribes from zoom info event callback. 6359 * 6360 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6361 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6362 * @throws { BusinessError } 202 - Not System Application. 6363 * @syscap SystemCapability.Multimedia.Camera.Core 6364 * @systemapi 6365 * @since 12 6366 */ 6367 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6368 6369 /** 6370 * Subscribes ISO info event callback. 6371 * 6372 * @param { 'isoInfoChange' } type - Event type. 6373 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 6374 * @throws { BusinessError } 202 - Not System Application. 6375 * @syscap SystemCapability.Multimedia.Camera.Core 6376 * @systemapi 6377 * @since 12 6378 */ 6379 on(type: 'isoInfoChange', callback: AsyncCallback<IsoInfo>): void; 6380 6381 /** 6382 * Unsubscribes from ISO info event callback. 6383 * 6384 * @param { 'isoInfoChange' } type - Event type. 6385 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 6386 * @throws { BusinessError } 202 - Not System Application. 6387 * @syscap SystemCapability.Multimedia.Camera.Core 6388 * @systemapi 6389 * @since 12 6390 */ 6391 off(type: 'isoInfoChange', callback?: AsyncCallback<IsoInfo>): void; 6392 6393 /** 6394 * Subscribes exposure info event callback. 6395 * 6396 * @param { 'exposureInfoChange' } type - Event type. 6397 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 6398 * @throws { BusinessError } 202 - Not System Application. 6399 * @syscap SystemCapability.Multimedia.Camera.Core 6400 * @systemapi 6401 * @since 12 6402 */ 6403 on(type: 'exposureInfoChange', callback: AsyncCallback<ExposureInfo>): void; 6404 6405 /** 6406 * Unsubscribes from exposure info event callback. 6407 * 6408 * @param { 'exposureInfoChange' } type - Event type. 6409 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 6410 * @throws { BusinessError } 202 - Not System Application. 6411 * @syscap SystemCapability.Multimedia.Camera.Core 6412 * @systemapi 6413 * @since 12 6414 */ 6415 off(type: 'exposureInfoChange', callback?: AsyncCallback<ExposureInfo>): void; 6416 6417 /** 6418 * Subscribes aperture info event callback. 6419 * 6420 * @param { 'apertureInfoChange' } type - Event type. 6421 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 6422 * @throws { BusinessError } 202 - Not System Application. 6423 * @syscap SystemCapability.Multimedia.Camera.Core 6424 * @systemapi 6425 * @since 12 6426 */ 6427 on(type: 'apertureInfoChange', callback: AsyncCallback<ApertureInfo>): void; 6428 6429 /** 6430 * Unsubscribes from aperture info event callback. 6431 * 6432 * @param { 'apertureInfoChange' } type - Event type. 6433 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 6434 * @throws { BusinessError } 202 - Not System Application. 6435 * @syscap SystemCapability.Multimedia.Camera.Core 6436 * @systemapi 6437 * @since 12 6438 */ 6439 off(type: 'apertureInfoChange', callback?: AsyncCallback<ApertureInfo>): void; 6440 6441 /** 6442 * Subscribes lumination info event callback. 6443 * 6444 * @param { 'luminationInfoChange' } type - Event type. 6445 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 6446 * @throws { BusinessError } 202 - Not System Application. 6447 * @syscap SystemCapability.Multimedia.Camera.Core 6448 * @systemapi 6449 * @since 12 6450 */ 6451 on(type: 'luminationInfoChange', callback: AsyncCallback<LuminationInfo>): void; 6452 6453 /** 6454 * Unsubscribes from lumination info event callback. 6455 * 6456 * @param { 'luminationInfoChange' } type - Event type. 6457 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 6458 * @throws { BusinessError } 202 - Not System Application. 6459 * @syscap SystemCapability.Multimedia.Camera.Core 6460 * @systemapi 6461 * @since 12 6462 */ 6463 off(type: 'luminationInfoChange', callback?: AsyncCallback<LuminationInfo>): void; 6464 } 6465 6466 /** 6467 * Enum for slow motion status. 6468 * 6469 * @enum { number } 6470 * @syscap SystemCapability.Multimedia.Camera.Core 6471 * @systemapi 6472 * @since 12 6473 */ 6474 enum SlowMotionStatus { 6475 /** 6476 * Slow motion disabled. 6477 * 6478 * @syscap SystemCapability.Multimedia.Camera.Core 6479 * @systemapi 6480 * @since 12 6481 */ 6482 DISABLED = 0, 6483 6484 /** 6485 * Slow motion ready. 6486 * 6487 * @syscap SystemCapability.Multimedia.Camera.Core 6488 * @systemapi 6489 * @since 12 6490 */ 6491 READY = 1, 6492 6493 /** 6494 * Slow motion video start. 6495 * 6496 * @syscap SystemCapability.Multimedia.Camera.Core 6497 * @systemapi 6498 * @since 12 6499 */ 6500 VIDEO_START = 2, 6501 6502 /** 6503 * Slow motion video done. 6504 * 6505 * @syscap SystemCapability.Multimedia.Camera.Core 6506 * @systemapi 6507 * @since 12 6508 */ 6509 VIDEO_DONE = 3, 6510 6511 /** 6512 * Slow motion finished. 6513 * 6514 * @syscap SystemCapability.Multimedia.Camera.Core 6515 * @systemapi 6516 * @since 12 6517 */ 6518 FINISHED = 4 6519 } 6520 6521 /** 6522 * Slow motion video session object. 6523 * 6524 * @interface SlowMotionVideoSession 6525 * @syscap SystemCapability.Multimedia.Camera.Core 6526 * @systemapi 6527 * @since 12 6528 */ 6529 interface SlowMotionVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect { 6530 /** 6531 * Subscribes to error events. 6532 * 6533 * @param { 'error' } type - Event type. 6534 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6535 * @throws { BusinessError } 202 - Not System Application. 6536 * @syscap SystemCapability.Multimedia.Camera.Core 6537 * @systemapi 6538 * @since 12 6539 */ 6540 on(type: 'error', callback: ErrorCallback): void; 6541 6542 /** 6543 * Unsubscribes from error events. 6544 * 6545 * @param { 'error' } type - Event type. 6546 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6547 * @throws { BusinessError } 202 - Not System Application. 6548 * @syscap SystemCapability.Multimedia.Camera.Core 6549 * @systemapi 6550 * @since 12 6551 */ 6552 off(type: 'error', callback?: ErrorCallback): void; 6553 6554 /** 6555 * Subscribes focus state change event callback. 6556 * 6557 * @param { 'focusStateChange' } type - Event type. 6558 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6559 * @throws { BusinessError } 202 - Not System Application. 6560 * @syscap SystemCapability.Multimedia.Camera.Core 6561 * @systemapi 6562 * @since 12 6563 */ 6564 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6565 6566 /** 6567 * Unsubscribes from focus state change event callback. 6568 * 6569 * @param { 'focusStateChange' } type - Event type. 6570 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6571 * @throws { BusinessError } 202 - Not System Application. 6572 * @syscap SystemCapability.Multimedia.Camera.Core 6573 * @systemapi 6574 * @since 12 6575 */ 6576 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6577 6578 /** 6579 * Subscribes zoom info event callback. 6580 * 6581 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6582 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6583 * @throws { BusinessError } 202 - Not System Application. 6584 * @syscap SystemCapability.Multimedia.Camera.Core 6585 * @systemapi 6586 * @since 12 6587 */ 6588 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6589 6590 /** 6591 * Unsubscribes from zoom info event callback. 6592 * 6593 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6594 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6595 * @throws { BusinessError } 202 - Not System Application. 6596 * @syscap SystemCapability.Multimedia.Camera.Core 6597 * @systemapi 6598 * @since 12 6599 */ 6600 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6601 6602 /** 6603 * Determine whether camera slow motion detection is supported. 6604 * 6605 * @returns { boolean } Is camera slow motion detection supported. 6606 * @throws { BusinessError } 202 - Not System Application. 6607 * @throws { BusinessError } 7400103 - Session not config. 6608 * @syscap SystemCapability.Multimedia.Camera.Core 6609 * @systemapi 6610 * @since 12 6611 */ 6612 isSlowMotionDetectionSupported(): boolean; 6613 6614 /** 6615 * Set slow motion detection area. 6616 * 6617 * @param { Rect } area - Detection area. 6618 * @throws { BusinessError } 202 - Not System Application. 6619 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6620 * @throws { BusinessError } 7400103 - Session not config. 6621 * @syscap SystemCapability.Multimedia.Camera.Core 6622 * @systemapi 6623 * @since 12 6624 */ 6625 setSlowMotionDetectionArea(area: Rect): void; 6626 6627 /** 6628 * Subscribes slow motion status callback. 6629 * 6630 * @param { 'slowMotionStatus' } type - Event type. 6631 * @param { AsyncCallback<SlowMotionStatus> } callback - Callback used to get the slow motion status. 6632 * @throws { BusinessError } 202 - Not System Application. 6633 * @syscap SystemCapability.Multimedia.Camera.Core 6634 * @systemapi 6635 * @since 12 6636 */ 6637 on(type: 'slowMotionStatus', callback: AsyncCallback<SlowMotionStatus>): void; 6638 6639 /** 6640 * Unsubscribes slow motion status callback. 6641 * 6642 * @param { 'slowMotionStatus' } type - Event type. 6643 * @param { AsyncCallback<SlowMotionStatus> } callback - Callback used to get the slow motion status. 6644 * @throws { BusinessError } 202 - Not System Application. 6645 * @syscap SystemCapability.Multimedia.Camera.Core 6646 * @systemapi 6647 * @since 12 6648 */ 6649 off(type: 'slowMotionStatus', callback?: AsyncCallback<SlowMotionStatus>): void; 6650 } 6651 6652 /** 6653 * High resolution session object. 6654 * 6655 * @interface HighResolutionPhotoSession 6656 * @syscap SystemCapability.Multimedia.Camera.Core 6657 * @systemapi 6658 * @since 12 6659 */ 6660 interface HighResolutionPhotoSession extends Session, AutoExposure, Focus { 6661 /** 6662 * Subscribes to error events. 6663 * 6664 * @param { 'error' } type - Event type. 6665 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6666 * @throws { BusinessError } 202 - Not System Application. 6667 * @syscap SystemCapability.Multimedia.Camera.Core 6668 * @systemapi 6669 * @since 12 6670 */ 6671 on(type: 'error', callback: ErrorCallback): void; 6672 6673 /** 6674 * Unsubscribes from error events. 6675 * 6676 * @param { 'error' } type - Event type. 6677 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6678 * @throws { BusinessError } 202 - Not System Application. 6679 * @syscap SystemCapability.Multimedia.Camera.Core 6680 * @systemapi 6681 * @since 12 6682 */ 6683 off(type: 'error', callback?: ErrorCallback): void; 6684 6685 /** 6686 * Subscribes focus state change event callback. 6687 * 6688 * @param { 'focusStateChange' } type - Event type. 6689 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6690 * @throws { BusinessError } 202 - Not System Application. 6691 * @syscap SystemCapability.Multimedia.Camera.Core 6692 * @systemapi 6693 * @since 12 6694 */ 6695 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6696 6697 /** 6698 * Unsubscribes from focus state change event callback. 6699 * 6700 * @param { 'focusStateChange' } type - Event type. 6701 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6702 * @throws { BusinessError } 202 - Not System Application. 6703 * @syscap SystemCapability.Multimedia.Camera.Core 6704 * @systemapi 6705 * @since 12 6706 */ 6707 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6708 } 6709 6710 /** 6711 * Macro photo session object. 6712 * 6713 * @interface MacroPhotoSession 6714 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus 6715 * @syscap SystemCapability.Multimedia.Camera.Core 6716 * @systemapi 6717 * @since 12 6718 */ 6719 /** 6720 * Macro photo session object. 6721 * 6722 * @interface MacroPhotoSession 6723 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, DepthFusion 6724 * @syscap SystemCapability.Multimedia.Camera.Core 6725 * @systemapi 6726 * @since 14 6727 */ 6728 interface MacroPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, DepthFusion { 6729 /** 6730 * Subscribes to error events. 6731 * 6732 * @param { 'error' } type - Event type. 6733 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6734 * @throws { BusinessError } 202 - Not System Application. 6735 * @syscap SystemCapability.Multimedia.Camera.Core 6736 * @systemapi 6737 * @since 12 6738 */ 6739 on(type: 'error', callback: ErrorCallback): void; 6740 6741 /** 6742 * Unsubscribes from error events. 6743 * 6744 * @param { 'error' } type - Event type. 6745 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6746 * @throws { BusinessError } 202 - Not System Application. 6747 * @syscap SystemCapability.Multimedia.Camera.Core 6748 * @systemapi 6749 * @since 12 6750 */ 6751 off(type: 'error', callback?: ErrorCallback): void; 6752 6753 /** 6754 * Subscribes focus state change event callback. 6755 * 6756 * @param { 'focusStateChange' } type - Event type. 6757 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6758 * @throws { BusinessError } 202 - Not System Application. 6759 * @syscap SystemCapability.Multimedia.Camera.Core 6760 * @systemapi 6761 * @since 12 6762 */ 6763 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6764 6765 /** 6766 * Unsubscribes from focus state change event callback. 6767 * 6768 * @param { 'focusStateChange' } type - Event type. 6769 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6770 * @throws { BusinessError } 202 - Not System Application. 6771 * @syscap SystemCapability.Multimedia.Camera.Core 6772 * @systemapi 6773 * @since 12 6774 */ 6775 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6776 6777 /** 6778 * Subscribes zoom info event callback. 6779 * 6780 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6781 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6782 * @throws { BusinessError } 202 - Not System Application. 6783 * @syscap SystemCapability.Multimedia.Camera.Core 6784 * @systemapi 6785 * @since 12 6786 */ 6787 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6788 6789 /** 6790 * Unsubscribes from zoom info event callback. 6791 * 6792 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6793 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6794 * @throws { BusinessError } 202 - Not System Application. 6795 * @syscap SystemCapability.Multimedia.Camera.Core 6796 * @systemapi 6797 * @since 12 6798 */ 6799 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6800 } 6801 6802 /** 6803 * Macro video session object. 6804 * 6805 * @interface MacroVideoSession 6806 * @syscap SystemCapability.Multimedia.Camera.Core 6807 * @systemapi 6808 * @since 12 6809 */ 6810 interface MacroVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus { 6811 /** 6812 * Subscribes to error events. 6813 * 6814 * @param { 'error' } type - Event type. 6815 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6816 * @throws { BusinessError } 202 - Not System Application. 6817 * @syscap SystemCapability.Multimedia.Camera.Core 6818 * @systemapi 6819 * @since 12 6820 */ 6821 on(type: 'error', callback: ErrorCallback): void; 6822 6823 /** 6824 * Unsubscribes from error events. 6825 * 6826 * @param { 'error' } type - Event type. 6827 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6828 * @throws { BusinessError } 202 - Not System Application. 6829 * @syscap SystemCapability.Multimedia.Camera.Core 6830 * @systemapi 6831 * @since 12 6832 */ 6833 off(type: 'error', callback?: ErrorCallback): void; 6834 6835 /** 6836 * Subscribes focus state change event callback. 6837 * 6838 * @param { 'focusStateChange' } type - Event type. 6839 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6840 * @throws { BusinessError } 202 - Not System Application. 6841 * @syscap SystemCapability.Multimedia.Camera.Core 6842 * @systemapi 6843 * @since 12 6844 */ 6845 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6846 6847 /** 6848 * Unsubscribes from focus state change event callback. 6849 * 6850 * @param { 'focusStateChange' } type - Event type. 6851 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6852 * @throws { BusinessError } 202 - Not System Application. 6853 * @syscap SystemCapability.Multimedia.Camera.Core 6854 * @systemapi 6855 * @since 12 6856 */ 6857 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6858 6859 /** 6860 * Subscribes zoom info event callback. 6861 * 6862 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6863 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6864 * @throws { BusinessError } 202 - Not System Application. 6865 * @syscap SystemCapability.Multimedia.Camera.Core 6866 * @systemapi 6867 * @since 12 6868 */ 6869 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 6870 6871 /** 6872 * Unsubscribes from zoom info event callback. 6873 * 6874 * @param { 'smoothZoomInfoAvailable' } type - Event type. 6875 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 6876 * @throws { BusinessError } 202 - Not System Application. 6877 * @syscap SystemCapability.Multimedia.Camera.Core 6878 * @systemapi 6879 * @since 12 6880 */ 6881 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 6882 } 6883 6884 /** 6885 * Secure camera session object. 6886 * 6887 * @interface SecureSession 6888 * @syscap SystemCapability.Multimedia.Camera.Core 6889 * @since 12 6890 */ 6891 interface SecureSession extends Session, Flash, AutoExposure, Focus, Zoom { 6892 /** 6893 * Add Secure output for camera. 6894 * 6895 * @param { PreviewOutput } previewOutput - Specify the output as a secure flow. 6896 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6897 * @throws { BusinessError } 7400102 - Operation not allowed. 6898 * @throws { BusinessError } 7400103 - Session not config. 6899 * @syscap SystemCapability.Multimedia.Camera.Core 6900 * @since 12 6901 */ 6902 addSecureOutput(previewOutput: PreviewOutput): void; 6903 6904 /** 6905 * Subscribes to error events. 6906 * 6907 * @param { 'error' } type - Event type. 6908 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6909 * @syscap SystemCapability.Multimedia.Camera.Core 6910 * @since 12 6911 */ 6912 on(type: 'error', callback: ErrorCallback): void; 6913 6914 /** 6915 * Unsubscribes from error events. 6916 * 6917 * @param { 'error' } type - Event type. 6918 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6919 * @syscap SystemCapability.Multimedia.Camera.Core 6920 * @since 12 6921 */ 6922 off(type: 'error', callback?: ErrorCallback): void; 6923 6924 /** 6925 * Subscribes focus status change event callback. 6926 * 6927 * @param { 'focusStateChange' } type - Event type. 6928 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6929 * @syscap SystemCapability.Multimedia.Camera.Core 6930 * @since 12 6931 */ 6932 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6933 6934 /** 6935 * Unsubscribes from focus status change event callback. 6936 * 6937 * @param { 'focusStateChange' } type - Event type. 6938 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6939 * @syscap SystemCapability.Multimedia.Camera.Core 6940 * @since 12 6941 */ 6942 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 6943 } 6944 6945 /** 6946 * Light painting photo session object. 6947 * 6948 * @interface LightPaintingPhotoSession 6949 * @extends Session, Flash, Focus, Zoom, ColorEffect 6950 * @syscap SystemCapability.Multimedia.Camera.Core 6951 * @systemapi 6952 * @since 12 6953 */ 6954 interface LightPaintingPhotoSession extends Session, Flash, Focus, Zoom, ColorEffect { 6955 /** 6956 * Subscribes to error events. 6957 * 6958 * @param { 'error' } type - Event type. 6959 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6960 * @throws { BusinessError } 202 - Not System Application. 6961 * @syscap SystemCapability.Multimedia.Camera.Core 6962 * @systemapi 6963 * @since 12 6964 */ 6965 on(type: 'error', callback: ErrorCallback): void; 6966 6967 /** 6968 * Unsubscribes from error events. 6969 * 6970 * @param { 'error' } type - Event type. 6971 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 6972 * @throws { BusinessError } 202 - Not System Application. 6973 * @syscap SystemCapability.Multimedia.Camera.Core 6974 * @systemapi 6975 * @since 12 6976 */ 6977 off(type: 'error', callback?: ErrorCallback): void; 6978 6979 /** 6980 * Subscribes focus state change event callback. 6981 * 6982 * @param { 'focusStateChange' } type - Event type. 6983 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6984 * @throws { BusinessError } 202 - Not System Application. 6985 * @syscap SystemCapability.Multimedia.Camera.Core 6986 * @systemapi 6987 * @since 12 6988 */ 6989 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 6990 6991 /** 6992 * Unsubscribes from focus state change event callback. 6993 * 6994 * @param { 'focusStateChange' } type - Event type. 6995 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 6996 * @throws { BusinessError } 202 - Not System Application. 6997 * @syscap SystemCapability.Multimedia.Camera.Core 6998 * @systemapi 6999 * @since 12 7000 */ 7001 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 7002 7003 /** 7004 * Subscribes zoom info event callback. 7005 * 7006 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7007 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7008 * @throws { BusinessError } 202 - Not System Application. 7009 * @syscap SystemCapability.Multimedia.Camera.Core 7010 * @systemapi 7011 * @since 12 7012 */ 7013 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 7014 7015 /** 7016 * Unsubscribes from zoom info event callback. 7017 * 7018 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7019 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7020 * @throws { BusinessError } 202 - Not System Application. 7021 * @syscap SystemCapability.Multimedia.Camera.Core 7022 * @systemapi 7023 * @since 12 7024 */ 7025 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 7026 7027 /** 7028 * Gets the light painting type in use. 7029 * 7030 * @returns { LightPaintingType } The light painting type in use. 7031 * @throws { BusinessError } 202 - Not System Application. 7032 * @throws { BusinessError } 7400103 - Session not config. 7033 * @syscap SystemCapability.Multimedia.Camera.Core 7034 * @systemapi 7035 * @since 12 7036 */ 7037 getLightPaintingType(): LightPaintingType; 7038 7039 /** 7040 * Sets a light painting type for a camera device. 7041 * 7042 * @param { LightPaintingType } type - Light painting type to set. 7043 * @throws { BusinessError } 202 - Not System Application. 7044 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7045 * @throws { BusinessError } 7400103 - Session not config. 7046 * @syscap SystemCapability.Multimedia.Camera.Core 7047 * @systemapi 7048 * @since 12 7049 */ 7050 setLightPaintingType(type: LightPaintingType): void; 7051 7052 /** 7053 * Gets supported light painting types. 7054 * 7055 * @returns { Array<LightPaintingType> } List of light painting types. 7056 * @throws { BusinessError } 202 - Not System Application. 7057 * @throws { BusinessError } 7400103 - Session not config. 7058 * @syscap SystemCapability.Multimedia.Camera.Core 7059 * @systemapi 7060 * @since 12 7061 */ 7062 getSupportedLightPaintingTypes(): Array<LightPaintingType>; 7063 } 7064 7065 /** 7066 * Quick shot photo session object. 7067 * 7068 * @interface QuickShotPhotoSession 7069 * @extends Session, AutoExposure, ColorEffect, ColorManagement, EffectSuggestion, Flash, Focus, Zoom 7070 * @syscap SystemCapability.Multimedia.Camera.Core 7071 * @systemapi 7072 * @since 12 7073 */ 7074 interface QuickShotPhotoSession extends Session, AutoExposure, ColorEffect, ColorManagement, EffectSuggestion, Flash, Focus, Zoom { 7075 /** 7076 * Subscribes to error events. 7077 * 7078 * @param { 'error' } type - Event type. 7079 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7080 * @throws { BusinessError } 202 - Not System Application. 7081 * @syscap SystemCapability.Multimedia.Camera.Core 7082 * @systemapi 7083 * @since 12 7084 */ 7085 on(type: 'error', callback: ErrorCallback): void; 7086 7087 /** 7088 * Unsubscribes from error events. 7089 * 7090 * @param { 'error' } type - Event type. 7091 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7092 * @throws { BusinessError } 202 - Not System Application. 7093 * @syscap SystemCapability.Multimedia.Camera.Core 7094 * @systemapi 7095 * @since 12 7096 */ 7097 off(type: 'error', callback?: ErrorCallback): void; 7098 7099 /** 7100 * Subscribes to effect suggestion event callback. 7101 * 7102 * @param { 'effectSuggestionChange' } type - Event type. 7103 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 7104 * @throws { BusinessError } 202 - Not System Application. 7105 * @syscap SystemCapability.Multimedia.Camera.Core 7106 * @systemapi 7107 * @since 12 7108 */ 7109 on(type: 'effectSuggestionChange', callback: AsyncCallback<EffectSuggestionType>): void; 7110 7111 /** 7112 * Unsubscribes from effect suggestion event callback. 7113 * 7114 * @param { 'effectSuggestionChange' } type - Event type. 7115 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 7116 * @throws { BusinessError } 202 - Not System Application. 7117 * @syscap SystemCapability.Multimedia.Camera.Core 7118 * @systemapi 7119 * @since 12 7120 */ 7121 off(type: 'effectSuggestionChange', callback?: AsyncCallback<EffectSuggestionType>): void; 7122 7123 /** 7124 * Subscribes focus state change event callback. 7125 * 7126 * @param { 'focusStateChange' } type - Event type. 7127 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7128 * @throws { BusinessError } 202 - Not System Application. 7129 * @syscap SystemCapability.Multimedia.Camera.Core 7130 * @systemapi 7131 * @since 12 7132 */ 7133 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 7134 7135 /** 7136 * Unsubscribes from focus state change event callback. 7137 * 7138 * @param { 'focusStateChange' } type - Event type. 7139 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7140 * @throws { BusinessError } 202 - Not System Application. 7141 * @syscap SystemCapability.Multimedia.Camera.Core 7142 * @systemapi 7143 * @since 12 7144 */ 7145 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 7146 7147 /** 7148 * Subscribes zoom info event callback. 7149 * 7150 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7151 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7152 * @throws { BusinessError } 202 - Not System Application. 7153 * @syscap SystemCapability.Multimedia.Camera.Core 7154 * @systemapi 7155 * @since 12 7156 */ 7157 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 7158 7159 /** 7160 * Unsubscribes from zoom info event callback. 7161 * 7162 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7163 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7164 * @throws { BusinessError } 202 - Not System Application. 7165 * @syscap SystemCapability.Multimedia.Camera.Core 7166 * @systemapi 7167 * @since 12 7168 */ 7169 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 7170 } 7171 7172 /** 7173 * Panorama photo session object. 7174 * 7175 * @interface PanoramaPhotoSession 7176 * @extends Session, Focus, AutoExposure, WhiteBalance, ColorEffect 7177 * @syscap SystemCapability.Multimedia.Camera.Core 7178 * @systemapi 7179 * @since 12 7180 */ 7181 interface PanoramaPhotoSession extends Session, Focus, AutoExposure, WhiteBalance, ColorEffect { 7182 /** 7183 * Subscribes to error events. 7184 * 7185 * @param { 'error' } type - Event type. 7186 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7187 * @throws { BusinessError } 202 - Not System Application. 7188 * @syscap SystemCapability.Multimedia.Camera.Core 7189 * @systemapi 7190 * @since 12 7191 */ 7192 on(type: 'error', callback: ErrorCallback): void; 7193 7194 /** 7195 * Unsubscribes from error events. 7196 * 7197 * @param { 'error' } type - Event type. 7198 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7199 * @throws { BusinessError } 202 - Not System Application. 7200 * @syscap SystemCapability.Multimedia.Camera.Core 7201 * @systemapi 7202 * @since 12 7203 */ 7204 off(type: 'error', callback?: ErrorCallback): void; 7205 7206 /** 7207 * Subscribes focus state change event callback. 7208 * 7209 * @param { 'focusStateChange' } type - Event type. 7210 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7211 * @throws { BusinessError } 202 - Not System Application. 7212 * @syscap SystemCapability.Multimedia.Camera.Core 7213 * @systemapi 7214 * @since 12 7215 */ 7216 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 7217 7218 /** 7219 * Unsubscribes from focus state change event callback. 7220 * 7221 * @param { 'focusStateChange' } type - Event type. 7222 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7223 * @throws { BusinessError } 202 - Not System Application. 7224 * @syscap SystemCapability.Multimedia.Camera.Core 7225 * @systemapi 7226 * @since 12 7227 */ 7228 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 7229 } 7230 7231 /** 7232 * Fluorescence photo session object. 7233 * 7234 * @interface FluorescencePhotoSession 7235 * @syscap SystemCapability.Multimedia.Camera.Core 7236 * @systemapi 7237 * @since 13 7238 */ 7239 interface FluorescencePhotoSession extends Session, AutoExposure, Focus, Zoom { 7240 /** 7241 * Subscribes to error events. 7242 * 7243 * @param { 'error' } type - Event type. 7244 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7245 * @throws { BusinessError } 202 - Not System Application. 7246 * @syscap SystemCapability.Multimedia.Camera.Core 7247 * @systemapi 7248 * @since 13 7249 */ 7250 on(type: 'error', callback: ErrorCallback): void; 7251 7252 /** 7253 * Unsubscribes from error events. 7254 * 7255 * @param { 'error' } type - Event type. 7256 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7257 * @throws { BusinessError } 202 - Not System Application. 7258 * @syscap SystemCapability.Multimedia.Camera.Core 7259 * @systemapi 7260 * @since 13 7261 */ 7262 off(type: 'error', callback?: ErrorCallback): void; 7263 7264 /** 7265 * Subscribes focus state change event callback. 7266 * 7267 * @param { 'focusStateChange' } type - Event type. 7268 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7269 * @throws { BusinessError } 202 - Not System Application. 7270 * @syscap SystemCapability.Multimedia.Camera.Core 7271 * @systemapi 7272 * @since 13 7273 */ 7274 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 7275 7276 /** 7277 * Unsubscribes from focus state change event callback. 7278 * 7279 * @param { 'focusStateChange' } type - Event type. 7280 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7281 * @throws { BusinessError } 202 - Not System Application. 7282 * @syscap SystemCapability.Multimedia.Camera.Core 7283 * @systemapi 7284 * @since 13 7285 */ 7286 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 7287 } 7288 7289 /** 7290 * Photo Functions object. 7291 * 7292 * @interface PhotoFunctions 7293 * @extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery 7294 * @syscap SystemCapability.Multimedia.Camera.Core 7295 * @systemapi 7296 * @since 13 7297 */ 7298 interface PhotoFunctions extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery { 7299 } 7300 7301 /** 7302 * Video Functions object. 7303 * 7304 * @interface VideoFunctions 7305 * @extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, StabilizationQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery 7306 * @syscap SystemCapability.Multimedia.Camera.Core 7307 * @systemapi 7308 * @since 13 7309 */ 7310 interface VideoFunctions extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, StabilizationQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery { 7311 } 7312 7313 /** 7314 * Portrait Photo Functions object. 7315 * 7316 * @interface PortraitPhotoFunctions 7317 * @extends FlashQuery, AutoExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, PortraitQuery, ApertureQuery, SceneDetectionQuery 7318 * @syscap SystemCapability.Multimedia.Camera.Core 7319 * @systemapi 7320 * @since 13 7321 */ 7322 interface PortraitPhotoFunctions extends FlashQuery, AutoExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, PortraitQuery, ApertureQuery, SceneDetectionQuery { 7323 } 7324 7325 /** 7326 * Photo Conflict Functions object. 7327 * 7328 * @interface PhotoConflictFunctions 7329 * @extends ZoomQuery, MacroQuery 7330 * @syscap SystemCapability.Multimedia.Camera.Core 7331 * @systemapi 7332 * @since 13 7333 */ 7334 interface PhotoConflictFunctions extends ZoomQuery, MacroQuery { 7335 } 7336 7337 /** 7338 * Video Conflict Functions object. 7339 * 7340 * @interface VideoConflictFunctions 7341 * @extends ZoomQuery, MacroQuery 7342 * @syscap SystemCapability.Multimedia.Camera.Core 7343 * @systemapi 7344 * @since 13 7345 */ 7346 interface VideoConflictFunctions extends ZoomQuery, MacroQuery { 7347 } 7348 7349 /** 7350 * Portrait Photo Conflict Functions object. 7351 * 7352 * @interface PortraitPhotoFunctions 7353 * @extends ZoomQuery, PortraitQuery, ApertureQuery 7354 * @syscap SystemCapability.Multimedia.Camera.Core 7355 * @systemapi 7356 * @since 13 7357 */ 7358 interface PortraitPhotoConflictFunctions extends ZoomQuery, PortraitQuery, ApertureQuery { 7359 } 7360 7361 /** 7362 * Camera output object. 7363 * 7364 * @interface CameraOutput 7365 * @syscap SystemCapability.Multimedia.Camera.Core 7366 * @since 10 7367 */ 7368 interface CameraOutput { 7369 /** 7370 * Release output instance. 7371 * 7372 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7373 * @throws { BusinessError } 7400201 - Camera service fatal error. 7374 * @syscap SystemCapability.Multimedia.Camera.Core 7375 * @since 10 7376 */ 7377 release(callback: AsyncCallback<void>): void; 7378 7379 /** 7380 * Release output instance. 7381 * 7382 * @returns { Promise<void> } Promise used to return the result. 7383 * @throws { BusinessError } 7400201 - Camera service fatal error. 7384 * @syscap SystemCapability.Multimedia.Camera.Core 7385 * @since 10 7386 */ 7387 release(): Promise<void>; 7388 } 7389 7390 /** 7391 * SketchStatusData object 7392 * 7393 * @typedef SketchStatusData 7394 * @syscap SystemCapability.Multimedia.Camera.Core 7395 * @systemapi 7396 * @since 11 7397 */ 7398 interface SketchStatusData { 7399 /** 7400 * Status of the sketch stream. 7401 * 0 is stop, and 1 is start. 7402 * 7403 * @type { number } 7404 * @syscap SystemCapability.Multimedia.Camera.Core 7405 * @systemapi 7406 * @since 11 7407 */ 7408 status: number; 7409 7410 /** 7411 * The zoom ratio of the sketch stream. 7412 * 7413 * @type { number } 7414 * @syscap SystemCapability.Multimedia.Camera.Core 7415 * @systemapi 7416 * @since 11 7417 */ 7418 sketchRatio: number; 7419 } 7420 7421 /** 7422 * Preview output object. 7423 * 7424 * @interface PreviewOutput 7425 * @syscap SystemCapability.Multimedia.Camera.Core 7426 * @since 10 7427 */ 7428 interface PreviewOutput extends CameraOutput { 7429 /** 7430 * Start output instance. 7431 * 7432 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7433 * @throws { BusinessError } 7400103 - Session not config. 7434 * @syscap SystemCapability.Multimedia.Camera.Core 7435 * @since 10 7436 * @deprecated since 11 7437 * @useinstead ohos.multimedia.camera.Session#start 7438 */ 7439 start(callback: AsyncCallback<void>): void; 7440 7441 /** 7442 * Start output instance. 7443 * 7444 * @returns { Promise<void> } Promise used to return the result. 7445 * @throws { BusinessError } 7400103 - Session not config. 7446 * @syscap SystemCapability.Multimedia.Camera.Core 7447 * @since 10 7448 * @deprecated since 11 7449 * @useinstead ohos.multimedia.camera.Session#start 7450 */ 7451 start(): Promise<void>; 7452 7453 /** 7454 * Stop output instance. 7455 * 7456 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7457 * @syscap SystemCapability.Multimedia.Camera.Core 7458 * @since 10 7459 * @deprecated since 11 7460 * @useinstead ohos.multimedia.camera.Session#stop 7461 */ 7462 stop(callback: AsyncCallback<void>): void; 7463 7464 /** 7465 * Stop output instance. 7466 * 7467 * @returns { Promise<void> } Promise used to return the result. 7468 * @syscap SystemCapability.Multimedia.Camera.Core 7469 * @since 10 7470 * @deprecated since 11 7471 * @useinstead ohos.multimedia.camera.Session#stop 7472 */ 7473 stop(): Promise<void>; 7474 7475 /** 7476 * Subscribes frame start event callback. 7477 * 7478 * @param { 'frameStart' } type - Event type. 7479 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7480 * @syscap SystemCapability.Multimedia.Camera.Core 7481 * @since 10 7482 */ 7483 on(type: 'frameStart', callback: AsyncCallback<void>): void; 7484 7485 /** 7486 * Unsubscribes from frame start event callback. 7487 * 7488 * @param { 'frameStart' } type - Event type. 7489 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7490 * @syscap SystemCapability.Multimedia.Camera.Core 7491 * @since 10 7492 */ 7493 off(type: 'frameStart', callback?: AsyncCallback<void>): void; 7494 7495 /** 7496 * Subscribes frame end event callback. 7497 * 7498 * @param { 'frameEnd' } type - Event type. 7499 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7500 * @syscap SystemCapability.Multimedia.Camera.Core 7501 * @since 10 7502 */ 7503 on(type: 'frameEnd', callback: AsyncCallback<void>): void; 7504 7505 /** 7506 * Unsubscribes from frame end event callback. 7507 * 7508 * @param { 'frameEnd' } type - Event type. 7509 * @param { AsyncCallback<void> } callback - Callback used to return the result. 7510 * @syscap SystemCapability.Multimedia.Camera.Core 7511 * @since 10 7512 */ 7513 off(type: 'frameEnd', callback?: AsyncCallback<void>): void; 7514 7515 /** 7516 * Subscribes to error events. 7517 * 7518 * @param { 'error' } type - Event type. 7519 * @param { ErrorCallback } callback - Callback used to get the preview output errors. 7520 * @syscap SystemCapability.Multimedia.Camera.Core 7521 * @since 10 7522 */ 7523 on(type: 'error', callback: ErrorCallback): void; 7524 7525 /** 7526 * Unsubscribes from error events. 7527 * 7528 * @param { 'error' } type - Event type. 7529 * @param { ErrorCallback } callback - Callback used to get the preview output errors. 7530 * @syscap SystemCapability.Multimedia.Camera.Core 7531 * @since 10 7532 */ 7533 off(type: 'error', callback?: ErrorCallback): void; 7534 7535 /** 7536 * Get supported frame rates which can be set during session running. 7537 * 7538 * @returns { Array<FrameRateRange> } The array of supported frame rate range. 7539 * @syscap SystemCapability.Multimedia.Camera.Core 7540 * @since 12 7541 */ 7542 getSupportedFrameRates(): Array<FrameRateRange> 7543 7544 /** 7545 * Set a frame rate range. 7546 * 7547 * @param { number } minFps - Minimum frame rate per second. 7548 * @param { number } maxFps - Maximum frame rate per second. 7549 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7550 * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. 7551 * @syscap SystemCapability.Multimedia.Camera.Core 7552 * @since 12 7553 */ 7554 setFrameRate(minFps: number, maxFps: number): void 7555 7556 /** 7557 * Get active frame rate range which has been set before. 7558 * 7559 * @returns { FrameRateRange } The active frame rate range. 7560 * @syscap SystemCapability.Multimedia.Camera.Core 7561 * @since 12 7562 */ 7563 getActiveFrameRate(): FrameRateRange; 7564 7565 /** 7566 * Gets the preview rotation angle. 7567 * 7568 * @param { number } displayRotation - The current display rotation angle. 7569 * @returns { ImageRotation } The preview rotation angle. 7570 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7571 * @throws { BusinessError } 7400201 - Camera service fatal error. 7572 * @syscap SystemCapability.Multimedia.Camera.Core 7573 * @since 12 7574 */ 7575 getPreviewRotation(displayRotation: number): ImageRotation; 7576 7577 /** 7578 * Sets the preview rotation angle. 7579 * 7580 * @param { ImageRotation } previewRotation - Preview display rotation angle. 7581 * @param { boolean } isDisplayLocked - TRUE means the display is locked, if not set, the default is FALSE. 7582 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7583 * @throws { BusinessError } 7400201 - Camera service fatal error. 7584 * @syscap SystemCapability.Multimedia.Camera.Core 7585 * @since 12 7586 */ 7587 setPreviewRotation(previewRotation: ImageRotation, isDisplayLocked?: boolean): void; 7588 7589 /** 7590 * Gets the current preconfig type if you had already call preconfig interface. 7591 * 7592 * @returns { Profile } The current preconfig type. 7593 * @throws { BusinessError } 7400201 - Camera service fatal error. 7594 * @syscap SystemCapability.Multimedia.Camera.Core 7595 * @since 12 7596 */ 7597 getActiveProfile(): Profile; 7598 7599 /** 7600 * Adds a deferred surface. 7601 * 7602 * @param { string } surfaceId - Surface object id used in camera photo output. 7603 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7604 * @syscap SystemCapability.Multimedia.Camera.Core 7605 * @systemapi 7606 * @since 10 7607 */ 7608 /** 7609 * Adds a deferred surface. 7610 * 7611 * @param { string } surfaceId - Surface object id used in camera photo output. 7612 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 7613 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7614 * @syscap SystemCapability.Multimedia.Camera.Core 7615 * @systemapi 7616 * @since 13 7617 */ 7618 addDeferredSurface(surfaceId: string): void; 7619 7620 /** 7621 * Determine whether camera sketch is supported. 7622 * 7623 * @returns { boolean } Is camera sketch supported. 7624 * @throws { BusinessError } 202 - Not System Application. 7625 * @syscap SystemCapability.Multimedia.Camera.Core 7626 * @systemapi 7627 * @since 11 7628 */ 7629 isSketchSupported(): boolean; 7630 7631 /** 7632 * Gets the specific zoom ratio when sketch stream open. 7633 * 7634 * @returns { number } The specific zoom ratio of sketch. 7635 * @throws { BusinessError } 202 - Not System Application. 7636 * @throws { BusinessError } 7400103 - Session not config. 7637 * @syscap SystemCapability.Multimedia.Camera.Core 7638 * @systemapi 7639 * @since 11 7640 */ 7641 getSketchRatio(): number; 7642 7643 /** 7644 * Enable sketch for camera. 7645 * 7646 * @param { boolean } enabled - enable sketch for camera if TRUE. 7647 * @throws { BusinessError } 202 - Not System Application. 7648 * @throws { BusinessError } 7400103 - Session not config. 7649 * @syscap SystemCapability.Multimedia.Camera.Core 7650 * @systemapi 7651 * @since 11 7652 */ 7653 /** 7654 * Enable sketch for camera. 7655 * 7656 * @param { boolean } enabled - enable sketch for camera if TRUE. 7657 * @throws { BusinessError } 202 - Not System Application. 7658 * @throws { BusinessError } 7400102 - Operation not allowed. 7659 * @throws { BusinessError } 7400103 - Session not config. 7660 * @throws { BusinessError } 7400201 - Camera service fatal error. 7661 * @syscap SystemCapability.Multimedia.Camera.Core 7662 * @systemapi 7663 * @since 12 7664 */ 7665 enableSketch(enabled: boolean): void; 7666 7667 /** 7668 * Attach surface to the sketch stream. 7669 * 7670 * @param { string } surfaceId - Surface object id used in sketch stream. 7671 * @throws { BusinessError } 202 - Not System Application. 7672 * @throws { BusinessError } 7400103 - Session not config. 7673 * @syscap SystemCapability.Multimedia.Camera.Core 7674 * @systemapi 7675 * @since 11 7676 */ 7677 /** 7678 * Attach surface to the sketch stream. 7679 * 7680 * @param { string } surfaceId - Surface object id used in sketch stream. 7681 * @throws { BusinessError } 202 - Not System Application. 7682 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7683 * @throws { BusinessError } 7400103 - Session not config. 7684 * @throws { BusinessError } 7400201 - Camera service fatal error. 7685 * @syscap SystemCapability.Multimedia.Camera.Core 7686 * @systemapi 7687 * @since 12 7688 */ 7689 attachSketchSurface(surfaceId: string): void; 7690 7691 /** 7692 * Subscribes sketch status changed event callback. 7693 * 7694 * @param { 'sketchStatusChanged' } type - Event type. 7695 * @param { AsyncCallback<SketchStatusData> } callback - Callback used to sketch status data. 7696 * @throws { BusinessError } 202 - Not System Application. 7697 * @syscap SystemCapability.Multimedia.Camera.Core 7698 * @systemapi 7699 * @since 11 7700 */ 7701 on(type: 'sketchStatusChanged', callback: AsyncCallback<SketchStatusData>): void; 7702 7703 /** 7704 * Unsubscribes sketch status changed event callback. 7705 * 7706 * @param { 'sketchStatusChanged' } type - Event type. 7707 * @param { AsyncCallback<SketchStatusData> } callback - Callback used to get sketch status data. 7708 * @throws { BusinessError } 202 - Not System Application. 7709 * @syscap SystemCapability.Multimedia.Camera.Core 7710 * @systemapi 7711 * @since 11 7712 */ 7713 off(type: 'sketchStatusChanged', callback?: AsyncCallback<SketchStatusData>): void; 7714 } 7715 7716 /** 7717 * Enum for effect suggestion. 7718 * 7719 * @enum { number } 7720 * @syscap SystemCapability.Multimedia.Camera.Core 7721 * @systemapi 7722 * @since 12 7723 */ 7724 enum EffectSuggestionType { 7725 /** 7726 * None. 7727 * 7728 * @syscap SystemCapability.Multimedia.Camera.Core 7729 * @systemapi 7730 * @since 12 7731 */ 7732 EFFECT_SUGGESTION_NONE = 0, 7733 /** 7734 * Portrait. 7735 * 7736 * @syscap SystemCapability.Multimedia.Camera.Core 7737 * @systemapi 7738 * @since 12 7739 */ 7740 EFFECT_SUGGESTION_PORTRAIT = 1, 7741 /** 7742 * Food. 7743 * 7744 * @syscap SystemCapability.Multimedia.Camera.Core 7745 * @systemapi 7746 * @since 12 7747 */ 7748 EFFECT_SUGGESTION_FOOD = 2, 7749 7750 /** 7751 * Sky. 7752 * 7753 * @syscap SystemCapability.Multimedia.Camera.Core 7754 * @systemapi 7755 * @since 12 7756 */ 7757 EFFECT_SUGGESTION_SKY = 3, 7758 7759 /** 7760 * Sunrise and sunset. 7761 * 7762 * @syscap SystemCapability.Multimedia.Camera.Core 7763 * @systemapi 7764 * @since 12 7765 */ 7766 EFFECT_SUGGESTION_SUNRISE_SUNSET = 4, 7767 7768 /** 7769 * Stage. 7770 * 7771 * @syscap SystemCapability.Multimedia.Camera.Core 7772 * @systemapi 7773 * @since 18 7774 */ 7775 EFFECT_SUGGESTION_STAGE = 5 7776 } 7777 7778 /** 7779 * Effect suggestion status 7780 * 7781 * @syscap SystemCapability.Multimedia.Camera.Core 7782 * @systemapi 7783 * @since 12 7784 */ 7785 class EffectSuggestionStatus { 7786 /** 7787 * Effect Suggestion type. 7788 * 7789 * @type { EffectSuggestionType } 7790 * @syscap SystemCapability.Multimedia.Camera.Core 7791 * @systemapi 7792 * @since 12 7793 */ 7794 type: EffectSuggestionType; 7795 /** 7796 * Effect Suggestion type status. 7797 * 7798 * @type { boolean } 7799 * @syscap SystemCapability.Multimedia.Camera.Core 7800 * @systemapi 7801 * @since 12 7802 */ 7803 status: boolean; 7804 } 7805 7806 /** 7807 * Enumerates the image rotation angles. 7808 * 7809 * @enum { number } 7810 * @syscap SystemCapability.Multimedia.Camera.Core 7811 * @since 10 7812 */ 7813 enum ImageRotation { 7814 /** 7815 * The capture image rotates 0 degrees. 7816 * 7817 * @syscap SystemCapability.Multimedia.Camera.Core 7818 * @since 10 7819 */ 7820 ROTATION_0 = 0, 7821 7822 /** 7823 * The capture image rotates 90 degrees. 7824 * 7825 * @syscap SystemCapability.Multimedia.Camera.Core 7826 * @since 10 7827 */ 7828 ROTATION_90 = 90, 7829 7830 /** 7831 * The capture image rotates 180 degrees. 7832 * 7833 * @syscap SystemCapability.Multimedia.Camera.Core 7834 * @since 10 7835 */ 7836 ROTATION_180 = 180, 7837 7838 /** 7839 * The capture image rotates 270 degrees. 7840 * 7841 * @syscap SystemCapability.Multimedia.Camera.Core 7842 * @since 10 7843 */ 7844 ROTATION_270 = 270 7845 } 7846 7847 /** 7848 * Photo capture location 7849 * 7850 * @typedef Location 7851 * @syscap SystemCapability.Multimedia.Camera.Core 7852 * @since 10 7853 */ 7854 interface Location { 7855 /** 7856 * Latitude. 7857 * 7858 * @type { number } 7859 * @syscap SystemCapability.Multimedia.Camera.Core 7860 * @since 10 7861 */ 7862 latitude: number; 7863 7864 /** 7865 * Longitude. 7866 * 7867 * @type { number } 7868 * @syscap SystemCapability.Multimedia.Camera.Core 7869 * @since 10 7870 */ 7871 longitude: number; 7872 7873 /** 7874 * Altitude. 7875 * 7876 * @type { number } 7877 * @syscap SystemCapability.Multimedia.Camera.Core 7878 * @since 10 7879 */ 7880 altitude: number; 7881 } 7882 7883 /** 7884 * Enumerates the image quality levels. 7885 * 7886 * @enum { number } 7887 * @syscap SystemCapability.Multimedia.Camera.Core 7888 * @since 10 7889 */ 7890 enum QualityLevel { 7891 /** 7892 * High image quality. 7893 * 7894 * @syscap SystemCapability.Multimedia.Camera.Core 7895 * @since 10 7896 */ 7897 QUALITY_LEVEL_HIGH = 0, 7898 7899 /** 7900 * Medium image quality. 7901 * 7902 * @syscap SystemCapability.Multimedia.Camera.Core 7903 * @since 10 7904 */ 7905 QUALITY_LEVEL_MEDIUM = 1, 7906 7907 /** 7908 * Low image quality. 7909 * 7910 * @syscap SystemCapability.Multimedia.Camera.Core 7911 * @since 10 7912 */ 7913 QUALITY_LEVEL_LOW = 2 7914 } 7915 7916 /** 7917 * Photo capture options to set. 7918 * 7919 * @typedef PhotoCaptureSetting 7920 * @syscap SystemCapability.Multimedia.Camera.Core 7921 * @since 10 7922 */ 7923 interface PhotoCaptureSetting { 7924 /** 7925 * Photo image quality. 7926 * 7927 * @type { ?QualityLevel } 7928 * @syscap SystemCapability.Multimedia.Camera.Core 7929 * @since 10 7930 */ 7931 quality?: QualityLevel; 7932 7933 /** 7934 * Photo rotation. 7935 * 7936 * @type { ?ImageRotation } 7937 * @syscap SystemCapability.Multimedia.Camera.Core 7938 * @since 10 7939 */ 7940 rotation?: ImageRotation; 7941 7942 /** 7943 * Photo location. 7944 * 7945 * @type { ?Location } 7946 * @syscap SystemCapability.Multimedia.Camera.Core 7947 * @since 10 7948 */ 7949 location?: Location; 7950 7951 /** 7952 * Set the mirror photo function switch, default to false. 7953 * 7954 * @type { ?boolean } 7955 * @syscap SystemCapability.Multimedia.Camera.Core 7956 * @since 10 7957 */ 7958 mirror?: boolean; 7959 } 7960 7961 /** 7962 * Enumerates the delivery image types. 7963 * 7964 * @enum { number } 7965 * @syscap SystemCapability.Multimedia.Camera.Core 7966 * @systemapi 7967 * @since 11 7968 */ 7969 enum DeferredDeliveryImageType { 7970 /** 7971 * Undefer image delivery. 7972 * 7973 * @syscap SystemCapability.Multimedia.Camera.Core 7974 * @systemapi 7975 * @since 11 7976 */ 7977 NONE = 0, 7978 7979 /** 7980 * Defer photo delivery when capturing photos. 7981 * 7982 * @syscap SystemCapability.Multimedia.Camera.Core 7983 * @systemapi 7984 * @since 11 7985 */ 7986 PHOTO = 1, 7987 7988 /** 7989 * Defer video delivery when capturing videos. 7990 * 7991 * @syscap SystemCapability.Multimedia.Camera.Core 7992 * @systemapi 7993 * @since 11 7994 */ 7995 VIDEO = 2 7996 } 7997 7998 /** 7999 * Photo object 8000 * 8001 * @typedef Photo 8002 * @syscap SystemCapability.Multimedia.Camera.Core 8003 * @since 11 8004 */ 8005 interface Photo { 8006 /** 8007 * Main image. 8008 * 8009 * @type { image.Image } 8010 * @syscap SystemCapability.Multimedia.Camera.Core 8011 * @since 11 8012 */ 8013 main: image.Image; 8014 8015 /** 8016 * Raw image. 8017 * 8018 * @type { ?image.Image } 8019 * @syscap SystemCapability.Multimedia.Camera.Core 8020 * @systemapi 8021 * @since 12 8022 */ 8023 raw?: image.Image; 8024 8025 /** 8026 * Depth data. 8027 * 8028 * @type { DepthData } 8029 * @syscap SystemCapability.Multimedia.Camera.Core 8030 * @systemapi 8031 * @since 13 8032 */ 8033 depthData?: DepthData; 8034 8035 /** 8036 * Release Photo object. 8037 * 8038 * @returns { Promise<void> } Promise used to return the result. 8039 * @syscap SystemCapability.Multimedia.Camera.Core 8040 * @since 11 8041 */ 8042 release(): Promise<void>; 8043 } 8044 8045 /** 8046 * DeferredPhotoProxy object 8047 * 8048 * @typedef DeferredPhotoProxy 8049 * @syscap SystemCapability.Multimedia.Camera.Core 8050 * @systemapi 8051 * @since 11 8052 */ 8053 interface DeferredPhotoProxy { 8054 /** 8055 * Thumbnail image. 8056 * 8057 * @returns { Promise<image.PixelMap> } Promise used to return the result. 8058 * @throws { BusinessError } 202 - Not System Application. 8059 * @syscap SystemCapability.Multimedia.Camera.Core 8060 * @systemapi 8061 * @since 11 8062 */ 8063 getThumbnail(): Promise<image.PixelMap>; 8064 8065 /** 8066 * Release DeferredPhotoProxy object. 8067 * 8068 * @returns { Promise<void> } Promise used to return the result. 8069 * @throws { BusinessError } 202 - Not System Application. 8070 * @syscap SystemCapability.Multimedia.Camera.Core 8071 * @systemapi 8072 * @since 11 8073 */ 8074 release(): Promise<void>; 8075 } 8076 8077 /** 8078 * Enumerates the camera video codec type. 8079 * 8080 * @enum { number } 8081 * @syscap SystemCapability.Multimedia.Camera.Core 8082 * @since 13 8083 */ 8084 enum VideoCodecType { 8085 /** 8086 * Codec type AVC. 8087 * 8088 * @syscap SystemCapability.Multimedia.Camera.Core 8089 * @since 13 8090 */ 8091 AVC = 0, 8092 8093 /** 8094 * Codec type HEVC. 8095 * 8096 * @syscap SystemCapability.Multimedia.Camera.Core 8097 * @since 13 8098 */ 8099 HEVC = 1 8100 } 8101 8102 /** 8103 * Photo output object. 8104 * 8105 * @interface PhotoOutput 8106 * @syscap SystemCapability.Multimedia.Camera.Core 8107 * @since 10 8108 */ 8109 interface PhotoOutput extends CameraOutput { 8110 /** 8111 * Start capture output. 8112 * 8113 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8114 * @throws { BusinessError } 7400104 - Session not running. 8115 * @throws { BusinessError } 7400201 - Camera service fatal error. 8116 * @syscap SystemCapability.Multimedia.Camera.Core 8117 * @since 10 8118 */ 8119 capture(callback: AsyncCallback<void>): void; 8120 8121 /** 8122 * Start capture output. 8123 * 8124 * @returns { Promise<void> } Promise used to return the result. 8125 * @throws { BusinessError } 7400104 - Session not running. 8126 * @throws { BusinessError } 7400201 - Camera service fatal error. 8127 * @syscap SystemCapability.Multimedia.Camera.Core 8128 * @since 10 8129 */ 8130 capture(): Promise<void>; 8131 8132 /** 8133 * Start capture output. 8134 * 8135 * @param { PhotoCaptureSetting } setting - Photo capture settings. 8136 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8137 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8138 * @throws { BusinessError } 7400104 - Session not running. 8139 * @throws { BusinessError } 7400201 - Camera service fatal error. 8140 * @syscap SystemCapability.Multimedia.Camera.Core 8141 * @since 10 8142 */ 8143 capture(setting: PhotoCaptureSetting, callback: AsyncCallback<void>): void; 8144 8145 /** 8146 * Start capture output. 8147 * 8148 * @param { PhotoCaptureSetting } setting - Photo capture settings. 8149 * @returns { Promise<void> } Promise used to return the result. 8150 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8151 * @throws { BusinessError } 7400104 - Session not running. 8152 * @throws { BusinessError } 7400201 - Camera service fatal error. 8153 * @syscap SystemCapability.Multimedia.Camera.Core 8154 * @since 10 8155 */ 8156 /** 8157 * Start capture output. 8158 * Remove optional param. 8159 * 8160 * @param { PhotoCaptureSetting } setting - Photo capture settings. 8161 * @returns { Promise<void> } Promise used to return the result. 8162 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8163 * @throws { BusinessError } 7400104 - Session not running. 8164 * @throws { BusinessError } 7400201 - Camera service fatal error. 8165 * @syscap SystemCapability.Multimedia.Camera.Core 8166 * @since 11 8167 */ 8168 capture(setting: PhotoCaptureSetting): Promise<void>; 8169 8170 /** 8171 * Start burst capture. 8172 * 8173 * @param { PhotoCaptureSetting } setting - Photo capture settings. 8174 * @returns { Promise<void> } Promise used to return the result. 8175 * @throws { BusinessError } 202 - Not System Application. 8176 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8177 * @throws { BusinessError } 7400104 - Session not running. 8178 * @throws { BusinessError } 7400201 - Camera service fatal error. 8179 * @syscap SystemCapability.Multimedia.Camera.Core 8180 * @systemapi 8181 * @since 12 8182 */ 8183 burstCapture(setting: PhotoCaptureSetting): Promise<void>; 8184 8185 /** 8186 * Confirm capture in Night mode or end burst capture. 8187 * 8188 * @throws { BusinessError } 202 - Not System Application. 8189 * @throws { BusinessError } 7400104 - Session not running. 8190 * @throws { BusinessError } 7400201 - Camera service fatal error. 8191 * @syscap SystemCapability.Multimedia.Camera.Core 8192 * @systemapi 8193 * @since 11 8194 */ 8195 confirmCapture(); 8196 8197 /** 8198 * Confirm if the raw image delivery is supported 8199 * 8200 * @returns { boolean } TRUE if the type of delivery image is support. 8201 * @throws { BusinessError } 202 - Not System Application. 8202 * @throws { BusinessError } 7400104 - Session not running. 8203 * @throws { BusinessError } 7400201 - Camera service fatal error. 8204 * @syscap SystemCapability.Multimedia.Camera.Core 8205 * @systemapi 8206 * @since 13 8207 */ 8208 isRawDeliverySupported(): boolean; 8209 8210 /** 8211 * Enable raw image image delivery. 8212 * 8213 * @param { boolean } enabled - Target state for raw image delivery. 8214 * @throws { BusinessError } 202 - Not System Application. 8215 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8216 * @throws { BusinessError } 7400104 - Session not running. 8217 * @throws { BusinessError } 7400201 - Camera service fatal error. 8218 * @syscap SystemCapability.Multimedia.Camera.Core 8219 * @systemapi 8220 * @since 13 8221 */ 8222 enableRawDelivery(enabled: boolean): void; 8223 8224 /** 8225 * Confirm if the deferred image delivery supported in the specific device. 8226 * 8227 * @param { DeferredDeliveryImageType } type - Type of delivery image. 8228 * @returns { boolean } TRUE if the type of delivery image is support. 8229 * @throws { BusinessError } 202 - Not System Application. 8230 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8231 * @throws { BusinessError } 7400104 - Session not running. 8232 * @throws { BusinessError } 7400201 - Camera service fatal error. 8233 * @syscap SystemCapability.Multimedia.Camera.Core 8234 * @systemapi 8235 * @since 11 8236 */ 8237 isDeferredImageDeliverySupported(type: DeferredDeliveryImageType): boolean; 8238 8239 /** 8240 * Confirm if the deferred image delivery enabled. 8241 * 8242 * @param { DeferredDeliveryImageType } type - Type of delivery image. 8243 * @returns { boolean } TRUE if the type of delivery image is enable. 8244 * @throws { BusinessError } 202 - Not System Application. 8245 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8246 * @throws { BusinessError } 7400104 - Session not running. 8247 * @throws { BusinessError } 7400201 - Camera service fatal error. 8248 * @syscap SystemCapability.Multimedia.Camera.Core 8249 * @systemapi 8250 * @since 11 8251 */ 8252 isDeferredImageDeliveryEnabled(type: DeferredDeliveryImageType): boolean; 8253 8254 /** 8255 * Sets the image type for deferred image delivery. 8256 * 8257 * @param { DeferredDeliveryImageType } type - Type of delivery image. 8258 * @throws { BusinessError } 202 - Not System Application. 8259 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8260 * @throws { BusinessError } 7400104 - Session not running. 8261 * @throws { BusinessError } 7400201 - Camera service fatal error. 8262 * @syscap SystemCapability.Multimedia.Camera.Core 8263 * @systemapi 8264 * @since 11 8265 */ 8266 deferImageDelivery(type: DeferredDeliveryImageType): void; 8267 8268 /** 8269 * Check if the depth data delivery is supported. 8270 * 8271 * @returns { boolean } TRUE if the type of delivery image is enabled. 8272 * @throws { BusinessError } 202 - Not System Application. 8273 * @throws { BusinessError } 7400104 - Session not running. 8274 * @throws { BusinessError } 7400201 - Camera service fatal error. 8275 * @syscap SystemCapability.Multimedia.Camera.Core 8276 * @systemapi 8277 * @since 13 8278 */ 8279 isDepthDataDeliverySupported(): boolean; 8280 8281 /** 8282 * Enable depth data delivery. 8283 * 8284 * @param { boolean } enabled - Target state for depth data delivery. 8285 * @throws { BusinessError } 202 - Not System Application. 8286 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8287 * @throws { BusinessError } 7400104 - Session not running. 8288 * @throws { BusinessError } 7400201 - Camera service fatal error. 8289 * @syscap SystemCapability.Multimedia.Camera.Core 8290 * @systemapi 8291 * @since 13 8292 */ 8293 enableDepthDataDelivery(enabled: boolean): void; 8294 8295 /** 8296 * Get supported moving photo video codec types. 8297 * 8298 * @returns { Array<VideoCodecType> } An array of supported video codec types for moving photo. 8299 * @throws { BusinessError } 7400201 - Camera service fatal error. 8300 * @syscap SystemCapability.Multimedia.Camera.Core 8301 * @since 13 8302 */ 8303 getSupportedMovingPhotoVideoCodecTypes(): Array<VideoCodecType>; 8304 8305 /** 8306 * Sets codec type for moving photo, default to AVC. 8307 * 8308 * @param { VideoCodecType } codecType - Codec type for moving photo. 8309 * @throws { BusinessError } 7400201 - Camera service fatal error. 8310 * @syscap SystemCapability.Multimedia.Camera.Core 8311 * @since 13 8312 */ 8313 setMovingPhotoVideoCodecType(codecType: VideoCodecType): void; 8314 8315 /** 8316 * Subscribes photo available event callback. 8317 * 8318 * @param { 'photoAvailable' } type - Event type. 8319 * @param { AsyncCallback<Photo> } callback - Callback used to get the Photo. 8320 * @syscap SystemCapability.Multimedia.Camera.Core 8321 * @since 11 8322 */ 8323 on(type: 'photoAvailable', callback: AsyncCallback<Photo>): void; 8324 8325 /** 8326 * Unsubscribes photo available event callback. 8327 * 8328 * @param { 'photoAvailable' } type - Event type. 8329 * @param { AsyncCallback<Photo> } callback - Callback used to get the Photo. 8330 * @syscap SystemCapability.Multimedia.Camera.Core 8331 * @since 11 8332 */ 8333 off(type: 'photoAvailable', callback?: AsyncCallback<Photo>): void; 8334 8335 /** 8336 * Subscribes deferred photo proxy available event callback. 8337 * 8338 * @param { 'deferredPhotoProxyAvailable' } type - Event type. 8339 * @param { AsyncCallback<DeferredPhotoProxy> } callback - Callback used to get the DeferredPhotoProxy. 8340 * @throws { BusinessError } 202 - Not System Application. 8341 * @syscap SystemCapability.Multimedia.Camera.Core 8342 * @systemapi 8343 * @since 11 8344 */ 8345 on(type: 'deferredPhotoProxyAvailable', callback: AsyncCallback<DeferredPhotoProxy>): void; 8346 8347 /** 8348 * Unsubscribes deferred photo proxy available event callback. 8349 * 8350 * @param { 'deferredPhotoProxyAvailable' } type - Event type. 8351 * @param { AsyncCallback<DeferredPhotoProxy> } callback - Callback used to get the DeferredPhotoProxy. 8352 * @throws { BusinessError } 202 - Not System Application. 8353 * @syscap SystemCapability.Multimedia.Camera.Core 8354 * @systemapi 8355 * @since 11 8356 */ 8357 off(type: 'deferredPhotoProxyAvailable', callback?: AsyncCallback<DeferredPhotoProxy>): void; 8358 8359 /** 8360 * Subscribes photo asset event callback. 8361 * 8362 * @param { 'photoAssetAvailable' } type - Event type. 8363 * @param { AsyncCallback<photoAccessHelper.PhotoAsset> } callback - Callback used to get the asset. 8364 * @syscap SystemCapability.Multimedia.Camera.Core 8365 * @since 12 8366 */ 8367 on(type: 'photoAssetAvailable', callback: AsyncCallback<photoAccessHelper.PhotoAsset>): void; 8368 8369 /** 8370 * Unsubscribes photo asset event callback. 8371 * 8372 * @param { 'photoAssetAvailable' } type - Event type. 8373 * @param { AsyncCallback<photoAccessHelper.PhotoAsset> } callback - Callback used to get the asset. 8374 * @syscap SystemCapability.Multimedia.Camera.Core 8375 * @since 12 8376 */ 8377 off(type: 'photoAssetAvailable', callback?: AsyncCallback<photoAccessHelper.PhotoAsset>): void; 8378 8379 /** 8380 * Check whether to support mirror photo. 8381 * 8382 * @returns { boolean } Is the mirror supported. 8383 * @syscap SystemCapability.Multimedia.Camera.Core 8384 * @since 10 8385 */ 8386 isMirrorSupported(): boolean; 8387 8388 /** 8389 * Enable mirror for photo capture. 8390 * 8391 * @param { boolean } enabled - enable photo mirror if TRUE. 8392 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8393 * @throws { BusinessError } 7400103 - Session not config. 8394 * @throws { BusinessError } 7400201 - Camera service fatal error. 8395 * @syscap SystemCapability.Multimedia.Camera.Core 8396 * @since 13 8397 */ 8398 enableMirror(enabled: boolean): void; 8399 8400 /** 8401 * Subscribes capture start event callback. 8402 * 8403 * @param { 'captureStart' } type - Event type. 8404 * @param { AsyncCallback<number> } callback - Callback used to get the capture ID. 8405 * @syscap SystemCapability.Multimedia.Camera.Core 8406 * @since 10 8407 * @deprecated since 11 8408 * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo 8409 */ 8410 on(type: 'captureStart', callback: AsyncCallback<number>): void; 8411 8412 /** 8413 * Unsubscribes from capture start event callback. 8414 * 8415 * @param { 'captureStart' } type - Event type. 8416 * @param { AsyncCallback<number> } callback - Callback used to get the capture ID. 8417 * @syscap SystemCapability.Multimedia.Camera.Core 8418 * @since 10 8419 * @deprecated since 11 8420 * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo 8421 */ 8422 off(type: 'captureStart', callback?: AsyncCallback<number>): void; 8423 8424 /** 8425 * Subscribes capture start event callback. 8426 * 8427 * @param { 'captureStartWithInfo' } type - Event type. 8428 * @param { AsyncCallback<CaptureStartInfo> } callback - Callback used to get the capture start info. 8429 * @syscap SystemCapability.Multimedia.Camera.Core 8430 * @since 11 8431 */ 8432 on(type: 'captureStartWithInfo', callback: AsyncCallback<CaptureStartInfo>): void; 8433 8434 /** 8435 * Unsubscribes from capture start event callback. 8436 * 8437 * @param { 'captureStartWithInfo' } type - Event type. 8438 * @param { AsyncCallback<CaptureStartInfo> } callback - Callback used to get the capture start info. 8439 * @syscap SystemCapability.Multimedia.Camera.Core 8440 * @since 11 8441 */ 8442 off(type: 'captureStartWithInfo', callback?: AsyncCallback<CaptureStartInfo>): void; 8443 8444 /** 8445 * Subscribes frame shutter event callback. 8446 * 8447 * @param { 'frameShutter' } type - Event type. 8448 * @param { AsyncCallback<FrameShutterInfo> } callback - Callback used to get the frame shutter information. 8449 * @syscap SystemCapability.Multimedia.Camera.Core 8450 * @since 10 8451 */ 8452 on(type: 'frameShutter', callback: AsyncCallback<FrameShutterInfo>): void; 8453 8454 /** 8455 * Unsubscribes from frame shutter event callback. 8456 * 8457 * @param { 'frameShutter' } type - Event type. 8458 * @param { AsyncCallback<FrameShutterInfo> } callback - Callback used to get the frame shutter information. 8459 * @syscap SystemCapability.Multimedia.Camera.Core 8460 * @since 10 8461 */ 8462 off(type: 'frameShutter', callback?: AsyncCallback<FrameShutterInfo>): void; 8463 8464 /** 8465 * Subscribes frame shutter end event callback. 8466 * 8467 * @param { 'frameShutterEnd' } type - Event type. 8468 * @param { AsyncCallback<FrameShutterEndInfo> } callback - Callback used to get the frame shutter end information. 8469 * @syscap SystemCapability.Multimedia.Camera.Core 8470 * @since 12 8471 */ 8472 on(type: 'frameShutterEnd', callback: AsyncCallback<FrameShutterEndInfo>): void; 8473 8474 /** 8475 * Unsubscribes from frame shutter end event callback. 8476 * 8477 * @param { 'frameShutterEnd' } type - Event type. 8478 * @param { AsyncCallback<FrameShutterEndInfo> } callback - Callback used to get the frame shutter end information. 8479 * @syscap SystemCapability.Multimedia.Camera.Core 8480 * @since 12 8481 */ 8482 off(type: 'frameShutterEnd', callback?: AsyncCallback<FrameShutterEndInfo>): void; 8483 8484 /** 8485 * Subscribes capture end event callback. 8486 * 8487 * @param { 'captureEnd' } type - Event type. 8488 * @param { AsyncCallback<CaptureEndInfo> } callback - Callback used to get the capture end information. 8489 * @syscap SystemCapability.Multimedia.Camera.Core 8490 * @since 10 8491 */ 8492 on(type: 'captureEnd', callback: AsyncCallback<CaptureEndInfo>): void; 8493 8494 /** 8495 * Unsubscribes from capture end event callback. 8496 * 8497 * @param { 'captureEnd' } type - Event type. 8498 * @param { AsyncCallback<CaptureEndInfo> } callback - Callback used to get the capture end information. 8499 * @syscap SystemCapability.Multimedia.Camera.Core 8500 * @since 10 8501 */ 8502 off(type: 'captureEnd', callback?: AsyncCallback<CaptureEndInfo>): void; 8503 8504 /** 8505 * Subscribes capture ready event callback. After receiving the callback, can proceed to the next capture 8506 * 8507 * @param { 'captureReady' } type - Event type. 8508 * @param { AsyncCallback<void> } callback - Callback used to notice capture ready. 8509 * @syscap SystemCapability.Multimedia.Camera.Core 8510 * @since 12 8511 */ 8512 on(type: 'captureReady', callback: AsyncCallback<void>): void; 8513 8514 /** 8515 * Unsubscribes from capture ready event callback. 8516 * 8517 * @param { 'captureReady' } type - Event type. 8518 * @param { AsyncCallback<void> } callback - Callback used to notice capture ready. 8519 * @syscap SystemCapability.Multimedia.Camera.Core 8520 * @since 12 8521 */ 8522 off(type: 'captureReady', callback?: AsyncCallback<void>): void; 8523 8524 /** 8525 * Subscribes estimated capture duration event callback. 8526 * 8527 * @param { 'estimatedCaptureDuration' } type - Event type. 8528 * @param { AsyncCallback<number> } callback - Callback used to notify the estimated capture duration (in milliseconds). 8529 * @syscap SystemCapability.Multimedia.Camera.Core 8530 * @since 12 8531 */ 8532 on(type: 'estimatedCaptureDuration', callback: AsyncCallback<number>): void; 8533 8534 /** 8535 * Unsubscribes from estimated capture duration event callback. 8536 * 8537 * @param { 'estimatedCaptureDuration' } type - Event type. 8538 * @param { AsyncCallback<number> } callback - Callback used to notify the estimated capture duration (in milliseconds). 8539 * @syscap SystemCapability.Multimedia.Camera.Core 8540 * @since 12 8541 */ 8542 off(type: 'estimatedCaptureDuration', callback?: AsyncCallback<number>): void; 8543 8544 /** 8545 * Subscribes to error events. 8546 * 8547 * @param { 'error' } type - Event type. 8548 * @param { ErrorCallback } callback - Callback used to get the photo output errors. 8549 * @syscap SystemCapability.Multimedia.Camera.Core 8550 * @since 10 8551 */ 8552 on(type: 'error', callback: ErrorCallback): void; 8553 8554 /** 8555 * Unsubscribes from error events. 8556 * 8557 * @param { 'error' } type - Event type. 8558 * @param { ErrorCallback } callback - Callback used to get the photo output errors. 8559 * @syscap SystemCapability.Multimedia.Camera.Core 8560 * @since 10 8561 */ 8562 off(type: 'error', callback?: ErrorCallback): void; 8563 8564 /** 8565 * Gets the current preconfig type if you had already call preconfig interface. 8566 * 8567 * @returns { Profile } The current preconfig type. 8568 * @throws { BusinessError } 7400201 - Camera service fatal error. 8569 * @syscap SystemCapability.Multimedia.Camera.Core 8570 * @since 12 8571 */ 8572 getActiveProfile(): Profile; 8573 8574 /** 8575 * Checks whether PhotoOutput supports quick thumbnail. 8576 * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. 8577 * 8578 * @returns { boolean } Whether quick thumbnail is supported. 8579 * @throws { BusinessError } 7400104 - session is not running. 8580 * @syscap SystemCapability.Multimedia.Camera.Core 8581 * @systemapi 8582 * @since 10 8583 */ 8584 /** 8585 * Checks whether PhotoOutput supports quick thumbnail. 8586 * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. 8587 * 8588 * @returns { boolean } Whether quick thumbnail is supported. 8589 * @throws { BusinessError } 202 - Not System Application. 8590 * @throws { BusinessError } 7400104 - session is not running. 8591 * @syscap SystemCapability.Multimedia.Camera.Core 8592 * @systemapi 8593 * @since 12 8594 */ 8595 isQuickThumbnailSupported(): boolean; 8596 8597 /** 8598 * Enables or disables quick thumbnail. 8599 * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. 8600 * To avoid stream reconfiguration and performance loss, 8601 * you are advised to call the method before Session.commitConfig(). 8602 * 8603 * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. 8604 * @throws { BusinessError } 7400104 - session is not running. 8605 * @syscap SystemCapability.Multimedia.Camera.Core 8606 * @systemapi 8607 * @since 10 8608 */ 8609 /** 8610 * Enables or disables quick thumbnail. 8611 * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. 8612 * To avoid stream reconfiguration and performance loss, 8613 * you are advised to call the method before Session.commitConfig(). 8614 * 8615 * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. 8616 * @throws { BusinessError } 202 - Not System Application. 8617 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8618 * @throws { BusinessError } 7400104 - session is not running. 8619 * @throws { BusinessError } 7400201 - Camera service fatal error. 8620 * @syscap SystemCapability.Multimedia.Camera.Core 8621 * @systemapi 8622 * @since 12 8623 */ 8624 enableQuickThumbnail(enabled: boolean): void; 8625 8626 /** 8627 * Subscribes to camera thumbnail events. 8628 * This method is valid only after enableQuickThumbnail(true) is called. 8629 * 8630 * @param { 'quickThumbnail' } type - Event type. 8631 * @param { AsyncCallback<image.PixelMap> } callback - Callback used to get the quick thumbnail. 8632 * @syscap SystemCapability.Multimedia.Camera.Core 8633 * @systemapi 8634 * @since 10 8635 */ 8636 on(type: 'quickThumbnail', callback: AsyncCallback<image.PixelMap>): void; 8637 8638 /** 8639 * Unsubscribes from camera thumbnail events. 8640 * This method is valid only after enableQuickThumbnail(true) is called. 8641 * 8642 * @param { 'quickThumbnail' } type - Event type. 8643 * @param { AsyncCallback<image.PixelMap> } callback - Callback used to get the quick thumbnail. 8644 * @syscap SystemCapability.Multimedia.Camera.Core 8645 * @systemapi 8646 * @since 10 8647 */ 8648 off(type: 'quickThumbnail', callback?: AsyncCallback<image.PixelMap>): void; 8649 8650 /** 8651 * Confirm if the auto high quality photo supported. 8652 * 8653 * @returns { boolean } TRUE if the auto high quality photo is supported. 8654 * @throws { BusinessError } 202 - Not System Application. 8655 * @throws { BusinessError } 7400104 - session is not running. 8656 * @throws { BusinessError } 7400201 - Camera service fatal error. 8657 * @syscap SystemCapability.Multimedia.Camera.Core 8658 * @systemapi 8659 * @since 13 8660 */ 8661 isAutoHighQualityPhotoSupported(): boolean; 8662 8663 /** 8664 * Enable auto high quality photo. 8665 * 8666 * @param { boolean } enabled - Target state for auto high quality photo. 8667 * @throws { BusinessError } 202 - Not System Application. 8668 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8669 * @throws { BusinessError } 7400104 - session is not running. 8670 * @throws { BusinessError } 7400201 - Camera service fatal error. 8671 * @syscap SystemCapability.Multimedia.Camera.Core 8672 * @systemapi 8673 * @since 13 8674 */ 8675 enableAutoHighQualityPhoto(enabled: boolean): void; 8676 8677 /** 8678 * Confirm if the auto cloud image enhancement is supported. 8679 * 8680 * @returns { boolean } TRUE if the auto cloud image enhancement is supported. 8681 * @throws { BusinessError } 202 - Not System Application. 8682 * @throws { BusinessError } 7400201 - Camera service fatal error. 8683 * @syscap SystemCapability.Multimedia.Camera.Core 8684 * @systemapi 8685 * @since 13 8686 */ 8687 isAutoCloudImageEnhancementSupported(): boolean; 8688 8689 /** 8690 * Enable auto cloud image enhancement 8691 * 8692 * @param { boolean } enabled - Target state for auto cloud image enhancement. 8693 * @throws { BusinessError } 202 - Not System Application. 8694 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8695 * @throws { BusinessError } 7400201 - Camera service fatal error. 8696 * @syscap SystemCapability.Multimedia.Camera.Core 8697 * @systemapi 8698 * @since 13 8699 */ 8700 enableAutoCloudImageEnhancement(enabled: boolean): void; 8701 8702 /** 8703 * Confirm if moving photo supported. 8704 * 8705 * @returns { boolean } TRUE if the moving photo is supported. 8706 * @throws { BusinessError } 7400201 - Camera service fatal error. 8707 * @syscap SystemCapability.Multimedia.Camera.Core 8708 * @since 12 8709 */ 8710 isMovingPhotoSupported(): boolean; 8711 8712 /** 8713 * Enable moving photo. 8714 * 8715 * @permission ohos.permission.MICROPHONE 8716 * @param { boolean } enabled - Target state for moving photo. 8717 * @throws { BusinessError } 201 - permission denied. 8718 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8719 * @throws { BusinessError } 7400201 - Camera service fatal error. 8720 * @syscap SystemCapability.Multimedia.Camera.Core 8721 * @since 12 8722 */ 8723 enableMovingPhoto(enabled: boolean): void; 8724 8725 /** 8726 * Gets the photo rotation angle. 8727 * 8728 * @param { number } deviceDegree - The current device rotation degree. 8729 * @returns { ImageRotation } The photo rotation angle. 8730 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 8731 * @throws { BusinessError } 7400201 - Camera service fatal error. 8732 * @syscap SystemCapability.Multimedia.Camera.Core 8733 * @since 12 8734 */ 8735 getPhotoRotation(deviceDegree: number): ImageRotation; 8736 8737 /** 8738 * Confirm if auto aigc photo supported. 8739 * 8740 * @returns { boolean } TRUE if auto aigc photo is supported. 8741 * @throws { BusinessError } 202 - Not System Application. 8742 * @throws { BusinessError } 401 - Parameter error. Possible causes: 8743 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 8744 * 3. Parameter verification failed. 8745 * @throws { BusinessError } 7400201 - Camera service fatal error. 8746 * @syscap SystemCapability.Multimedia.Camera.Core 8747 * @systemapi 8748 * @since 16 8749 */ 8750 isAutoAigcPhotoSupported(): boolean; 8751 8752 /** 8753 * Enable auto aigc photo. 8754 * 8755 * @param { boolean } enabled - Target state for auto aigc photo. 8756 * @throws { BusinessError } 202 - Not System Application. 8757 * @throws { BusinessError } 401 - Parameter error. Possible causes: 8758 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 8759 * 3. Parameter verification failed. 8760 */ 8761 enableAutoAigcPhoto(enabled: boolean): void; 8762 8763 /** 8764 * Confirm if offline processing is supported. 8765 * 8766 * @returns { boolean } TRUE if the type of offline is supported. 8767 * @throws { BusinessError } 202 - Not System Application. 8768 * @throws { BusinessError } 7400201 - Camera service fatal error. 8769 * @syscap SystemCapability.Multimedia.Camera.Core 8770 * @systemapi 8771 * @since 16 8772 */ 8773 isOfflineSupported(): boolean; 8774 8775 /** 8776 * Enable offline processing. 8777 * 8778 * @throws { BusinessError } 202 - Not System Application. 8779 * @throws { BusinessError } 7400104 - session is not running. 8780 * @throws { BusinessError } 7400201 - Camera service fatal error. 8781 * @syscap SystemCapability.Multimedia.Camera.Core 8782 * @systemapi 8783 * @since 16 8784 */ 8785 enableOffline(): void; 8786 8787 /** 8788 * Subscribes offline Delivery finished events. 8789 * This method is valid only after enableOffline() is called. 8790 * 8791 * @param { 'offlineDeliveryFinished' } type - Event type. 8792 * @param { AsyncCallback<void> } callback - Callback used to get offline Delivery finished events. 8793 * @syscap SystemCapability.Multimedia.Camera.Core 8794 * @systemapi 8795 * @since 16 8796 */ 8797 on(type: 'offlineDeliveryFinished', callback: AsyncCallback<void>): void; 8798 8799 /** 8800 * Unsubscribes offline Delivery finished events. 8801 * This method is valid only after enableOffline() is called. 8802 * 8803 * @param { 'offlineDeliveryFinished' } type - Event type. 8804 * @param { AsyncCallback<void>} callback - Callback used to get offline Delivery finished events. 8805 * @syscap SystemCapability.Multimedia.Camera.Core 8806 * @systemapi 8807 * @since 16 8808 */ 8809 off(type: 'offlineDeliveryFinished', callback?: AsyncCallback<void>): void 8810 } 8811 8812 /** 8813 * Frame shutter callback info. 8814 * 8815 * @typedef FrameShutterInfo 8816 * @syscap SystemCapability.Multimedia.Camera.Core 8817 * @since 10 8818 */ 8819 interface FrameShutterInfo { 8820 /** 8821 * Capture id. 8822 * 8823 * @type { number } 8824 * @syscap SystemCapability.Multimedia.Camera.Core 8825 * @since 10 8826 */ 8827 captureId: number; 8828 /** 8829 * Timestamp for frame. 8830 * 8831 * @type { number } 8832 * @syscap SystemCapability.Multimedia.Camera.Core 8833 * @since 10 8834 */ 8835 timestamp: number; 8836 } 8837 8838 /** 8839 * Frame shutter end callback info. 8840 * 8841 * @typedef FrameShutterEndInfo 8842 * @syscap SystemCapability.Multimedia.Camera.Core 8843 * @since 12 8844 */ 8845 interface FrameShutterEndInfo { 8846 /** 8847 * Capture id. 8848 * 8849 * @type { number } 8850 * @syscap SystemCapability.Multimedia.Camera.Core 8851 * @since 12 8852 */ 8853 captureId: number; 8854 } 8855 8856 /** 8857 * Capture start info. 8858 * 8859 * @typedef CaptureStartInfo 8860 * @syscap SystemCapability.Multimedia.Camera.Core 8861 * @since 11 8862 */ 8863 interface CaptureStartInfo { 8864 /** 8865 * Capture id. 8866 * 8867 * @type { number } 8868 * @syscap SystemCapability.Multimedia.Camera.Core 8869 * @since 11 8870 */ 8871 captureId: number; 8872 /** 8873 * Time(in milliseconds) is the shutter time for the photo. 8874 * 8875 * @type { number } 8876 * @syscap SystemCapability.Multimedia.Camera.Core 8877 * @since 11 8878 */ 8879 time: number; 8880 } 8881 8882 /** 8883 * Capture end info. 8884 * 8885 * @typedef CaptureEndInfo 8886 * @syscap SystemCapability.Multimedia.Camera.Core 8887 * @since 10 8888 */ 8889 interface CaptureEndInfo { 8890 /** 8891 * Capture id. 8892 * 8893 * @type { number } 8894 * @syscap SystemCapability.Multimedia.Camera.Core 8895 * @since 10 8896 */ 8897 captureId: number; 8898 /** 8899 * Frame count. 8900 * 8901 * @type { number } 8902 * @syscap SystemCapability.Multimedia.Camera.Core 8903 * @since 10 8904 */ 8905 frameCount: number; 8906 } 8907 8908 /** 8909 * Deferred video enhancement info. 8910 * 8911 * @typedef DeferredVideoEnhancementInfo 8912 * @syscap SystemCapability.Multimedia.Camera.Core 8913 * @systemapi 8914 * @since 13 8915 */ 8916 interface DeferredVideoEnhancementInfo { 8917 /** 8918 * Check whether deferred video enhancement available. 8919 * 8920 * @type { boolean } 8921 * @syscap SystemCapability.Multimedia.Camera.Core 8922 * @systemapi 8923 * @since 13 8924 * @readonly 8925 */ 8926 readonly isDeferredVideoEnhancementAvailable: boolean; 8927 /** 8928 * Video identifier. 8929 * 8930 * @type { ?string } 8931 * @syscap SystemCapability.Multimedia.Camera.Core 8932 * @systemapi 8933 * @since 13 8934 * @readonly 8935 */ 8936 readonly videoId?: string; 8937 } 8938 8939 /** 8940 * Video output object. 8941 * 8942 * @interface VideoOutput 8943 * @syscap SystemCapability.Multimedia.Camera.Core 8944 * @since 10 8945 */ 8946 interface VideoOutput extends CameraOutput { 8947 /** 8948 * Start video output. 8949 * 8950 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8951 * @throws { BusinessError } 7400103 - Session not config. 8952 * @throws { BusinessError } 7400201 - Camera service fatal error. 8953 * @syscap SystemCapability.Multimedia.Camera.Core 8954 * @since 10 8955 */ 8956 start(callback: AsyncCallback<void>): void; 8957 8958 /** 8959 * Start video output. 8960 * 8961 * @returns { Promise<void> } Promise used to return the result. 8962 * @throws { BusinessError } 7400103 - Session not config. 8963 * @throws { BusinessError } 7400201 - Camera service fatal error. 8964 * @syscap SystemCapability.Multimedia.Camera.Core 8965 * @since 10 8966 */ 8967 start(): Promise<void>; 8968 8969 /** 8970 * Stop video output. 8971 * 8972 * @param { AsyncCallback<void> } callback - Callback used to return the result. 8973 * @syscap SystemCapability.Multimedia.Camera.Core 8974 * @since 10 8975 */ 8976 stop(callback: AsyncCallback<void>): void; 8977 8978 /** 8979 * Stop video output. 8980 * 8981 * @returns { Promise<void> } Promise used to return the result. 8982 * @syscap SystemCapability.Multimedia.Camera.Core 8983 * @since 10 8984 */ 8985 stop(): Promise<void>; 8986 8987 /** 8988 * Determine whether video mirror is supported. 8989 * 8990 * @returns { boolean } Is video mirror supported. 8991 * @throws { BusinessError } 202 - Not System Application. 8992 * @syscap SystemCapability.Multimedia.Camera.Core 8993 * @systemapi 8994 * @since 12 8995 */ 8996 isMirrorSupported(): boolean; 8997 8998 /** 8999 * Enable mirror for video capture. 9000 * 9001 * @param { boolean } enabled - enable video mirror if TRUE. 9002 * @throws { BusinessError } 202 - Not System Application. 9003 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9004 * @throws { BusinessError } 7400103 - Session not config. 9005 * @syscap SystemCapability.Multimedia.Camera.Core 9006 * @systemapi 9007 * @since 12 9008 */ 9009 enableMirror(enabled: boolean): void; 9010 9011 /** 9012 * Get supported frame rates which can be set during session running. 9013 * 9014 * @returns { Array<FrameRateRange> } The array of supported frame rate range. 9015 * @syscap SystemCapability.Multimedia.Camera.Core 9016 * @since 12 9017 */ 9018 getSupportedFrameRates(): Array<FrameRateRange> 9019 9020 /** 9021 * Set a frame rate range. 9022 * 9023 * @param { number } minFps - Minimum frame rate per second. 9024 * @param { number } maxFps - Maximum frame rate per second. 9025 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9026 * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. 9027 * @syscap SystemCapability.Multimedia.Camera.Core 9028 * @since 12 9029 */ 9030 setFrameRate(minFps: number, maxFps: number): void 9031 9032 /** 9033 * Get active frame rate range which has been set before. 9034 * 9035 * @returns { FrameRateRange } The active frame rate range. 9036 * @syscap SystemCapability.Multimedia.Camera.Core 9037 * @since 12 9038 */ 9039 getActiveFrameRate(): FrameRateRange; 9040 9041 /** 9042 * Gets the video rotation angle. 9043 * 9044 * @param { number } deviceDegree - The current device rotation degree. 9045 * @returns { ImageRotation } The video rotation angle. 9046 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9047 * @throws { BusinessError } 7400201 - Camera service fatal error. 9048 * @syscap SystemCapability.Multimedia.Camera.Core 9049 * @since 12 9050 */ 9051 getVideoRotation(deviceDegree: number): ImageRotation; 9052 9053 /** 9054 * Confirm if auto deferred video enhancement is supported in the specific device. 9055 * 9056 * @returns { boolean } TRUE if auto deferred video enhancement is supported. 9057 * @throws { BusinessError } 202 - Not System Application. 9058 * @throws { BusinessError } 7400201 - Camera service fatal error. 9059 * @syscap SystemCapability.Multimedia.Camera.Core 9060 * @systemapi 9061 * @since 13 9062 */ 9063 isAutoDeferredVideoEnhancementSupported(): boolean; 9064 9065 /** 9066 * Confirm if auto deferred video enhancement is enabled. 9067 * 9068 * @returns { boolean } TRUE if auto deferred video enhancement is enabled. 9069 * @throws { BusinessError } 202 - Not System Application. 9070 * @throws { BusinessError } 7400201 - Camera service fatal error. 9071 * @syscap SystemCapability.Multimedia.Camera.Core 9072 * @systemapi 9073 * @since 13 9074 */ 9075 isAutoDeferredVideoEnhancementEnabled(): boolean; 9076 9077 /** 9078 * Enable auto deferred video enhancement if needed. 9079 * 9080 * @param { boolean } enabled - Status of auto deferred video enhancement. 9081 * @throws { BusinessError } 202 - Not System Application. 9082 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9083 * @throws { BusinessError } 7400201 - Camera service fatal error. 9084 * @syscap SystemCapability.Multimedia.Camera.Core 9085 * @systemapi 9086 * @since 13 9087 */ 9088 enableAutoDeferredVideoEnhancement(enabled: boolean): void; 9089 9090 /** 9091 * Subscribes deferred video enhancement info callback. 9092 * 9093 * @param { 'deferredVideoEnhancementInfo' } type - Event type. 9094 * @param { AsyncCallback<DeferredVideoEnhanceInfo> } callback - Callback used to return the result. 9095 * @throws { BusinessError } 202 - Not System Application. 9096 * @syscap SystemCapability.Multimedia.Camera.Core 9097 * @systemapi 9098 * @since 13 9099 */ 9100 on(type: 'deferredVideoEnhancementInfo', callback: AsyncCallback<DeferredVideoEnhancementInfo>): void; 9101 9102 /** 9103 * Unsubscribes from deferred video enhancement info callback. 9104 * 9105 * @param { 'deferredVideoEnhancementInfo' } type - Event type. 9106 * @param { AsyncCallback<DeferredVideoEnhancementInfo> } callback - Callback used to return the result. 9107 * @throws { BusinessError } 202 - Not System Application. 9108 * @syscap SystemCapability.Multimedia.Camera.Core 9109 * @systemapi 9110 * @since 13 9111 */ 9112 off(type: 'deferredVideoEnhancementInfo', callback?: AsyncCallback<DeferredVideoEnhancementInfo>): void; 9113 9114 /** 9115 * Subscribes frame start event callback. 9116 * 9117 * @param { 'frameStart' } type - Event type. 9118 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9119 * @syscap SystemCapability.Multimedia.Camera.Core 9120 * @since 10 9121 */ 9122 on(type: 'frameStart', callback: AsyncCallback<void>): void; 9123 9124 /** 9125 * Unsubscribes from frame start event callback. 9126 * 9127 * @param { 'frameStart' } type - Event type. 9128 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9129 * @syscap SystemCapability.Multimedia.Camera.Core 9130 * @since 10 9131 */ 9132 off(type: 'frameStart', callback?: AsyncCallback<void>): void; 9133 9134 /** 9135 * Subscribes frame end event callback. 9136 * 9137 * @param { 'frameEnd' } type - Event type. 9138 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9139 * @syscap SystemCapability.Multimedia.Camera.Core 9140 * @since 10 9141 */ 9142 on(type: 'frameEnd', callback: AsyncCallback<void>): void; 9143 9144 /** 9145 * Unsubscribes from frame end event callback. 9146 * 9147 * @param { 'frameEnd' } type - Event type. 9148 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9149 * @syscap SystemCapability.Multimedia.Camera.Core 9150 * @since 10 9151 */ 9152 off(type: 'frameEnd', callback?: AsyncCallback<void>): void; 9153 9154 /** 9155 * Subscribes to error events. 9156 * 9157 * @param { 'error' } type - Event type. 9158 * @param { ErrorCallback } callback - Callback used to get the video output errors. 9159 * @syscap SystemCapability.Multimedia.Camera.Core 9160 * @since 10 9161 */ 9162 on(type: 'error', callback: ErrorCallback): void; 9163 9164 /** 9165 * Unsubscribes from error events. 9166 * 9167 * @param { 'error' } type - Event type. 9168 * @param { ErrorCallback } callback - Callback used to get the video output errors. 9169 * @syscap SystemCapability.Multimedia.Camera.Core 9170 * @since 10 9171 */ 9172 off(type: 'error', callback?: ErrorCallback): void; 9173 9174 /** 9175 * Gets the current preconfig type if you had already call preconfig interface. 9176 * 9177 * @returns { VideoProfile } The current preconfig type. 9178 * @throws { BusinessError } 7400201 - Camera service fatal error. 9179 * @syscap SystemCapability.Multimedia.Camera.Core 9180 * @since 12 9181 */ 9182 getActiveProfile(): VideoProfile; 9183 9184 /** 9185 * Get supported video meta types. 9186 * @returns { Array<VideoMetaType> } The array of supported video meta type. 9187 * @throws { BusinessError } 202 - Not System Application. 9188 * @throws { BusinessError } 7400201 - Camera service fatal error. 9189 * @syscap SystemCapability.Multimedia.Camera.Core 9190 * @systemapi 9191 * @since 12 9192 */ 9193 getSupportedVideoMetaTypes(): Array<VideoMetaType>; 9194 9195 /** 9196 * Attach a meta surface to VideoOutput. 9197 * @param { string } surfaceId - Surface object id used for receiving meta infos. 9198 * @param { VideoMetaType } type - Video meta type. 9199 * @throws { BusinessError } 202 - Not System Application. 9200 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9201 * @throws { BusinessError } 7400201 - Camera service fatal error. 9202 * @syscap SystemCapability.Multimedia.Camera.Core 9203 * @systemapi 9204 * @since 12 9205 */ 9206 attachMetaSurface(surfaceId: string, type: VideoMetaType): void; 9207 } 9208 9209 /** 9210 * Video meta type. 9211 * 9212 * @enum { number } 9213 * @syscap SystemCapability.Multimedia.Camera.Core 9214 * @systemapi 9215 * @since 12 9216 */ 9217 enum VideoMetaType { 9218 /** 9219 * Video meta type for storing maker info. 9220 * @syscap SystemCapability.Multimedia.Camera.Core 9221 * @systemapi 9222 * @since 12 9223 */ 9224 VIDEO_META_MAKER_INFO = 0, 9225 } 9226 9227 /** 9228 * Metadata object type. 9229 * 9230 * @enum { number } 9231 * @syscap SystemCapability.Multimedia.Camera.Core 9232 * @since 10 9233 */ 9234 enum MetadataObjectType { 9235 /** 9236 * Face detection type. 9237 * 9238 * @syscap SystemCapability.Multimedia.Camera.Core 9239 * @since 10 9240 */ 9241 FACE_DETECTION = 0, 9242 9243 /** 9244 * Human body detection type. 9245 * 9246 * @syscap SystemCapability.Multimedia.Camera.Core 9247 * @systemapi 9248 * @since 13 9249 */ 9250 HUMAN_BODY = 1, 9251 9252 /** 9253 * Cat face detection type. 9254 * 9255 * @syscap SystemCapability.Multimedia.Camera.Core 9256 * @systemapi 9257 * @since 13 9258 */ 9259 CAT_FACE = 2, 9260 9261 /** 9262 * Cat body detection type. 9263 * 9264 * @syscap SystemCapability.Multimedia.Camera.Core 9265 * @systemapi 9266 * @since 13 9267 */ 9268 CAT_BODY = 3, 9269 9270 /** 9271 * Dog face detection type. 9272 * 9273 * @syscap SystemCapability.Multimedia.Camera.Core 9274 * @systemapi 9275 * @since 13 9276 */ 9277 DOG_FACE = 4, 9278 9279 /** 9280 * Dog body detection type. 9281 * 9282 * @syscap SystemCapability.Multimedia.Camera.Core 9283 * @systemapi 9284 * @since 13 9285 */ 9286 DOG_BODY = 5, 9287 9288 /** 9289 * Salient detection type. 9290 * 9291 * @syscap SystemCapability.Multimedia.Camera.Core 9292 * @systemapi 9293 * @since 13 9294 */ 9295 SALIENT_DETECTION = 6, 9296 9297 /** 9298 * Barcode detection type. 9299 * 9300 * @syscap SystemCapability.Multimedia.Camera.Core 9301 * @systemapi 9302 * @since 13 9303 */ 9304 BAR_CODE_DETECTION = 7 9305 } 9306 9307 /** 9308 * Enum for light painting tabletype. 9309 * 9310 * @enum { number } 9311 * @syscap SystemCapability.Multimedia.Camera.Core 9312 * @systemapi 9313 * @since 12 9314 */ 9315 enum LightPaintingType { 9316 /** 9317 * Traffic trails effect. 9318 * 9319 * @syscap SystemCapability.Multimedia.Camera.Core 9320 * @systemapi 9321 * @since 12 9322 */ 9323 TRAFFIC_TRAILS = 0, 9324 9325 /** 9326 * Star trails effect. 9327 * 9328 * @syscap SystemCapability.Multimedia.Camera.Core 9329 * @systemapi 9330 * @since 12 9331 */ 9332 STAR_TRAILS = 1, 9333 9334 /** 9335 * Silky water effect. 9336 * 9337 * @syscap SystemCapability.Multimedia.Camera.Core 9338 * @systemapi 9339 * @since 12 9340 */ 9341 SILKY_WATER = 2, 9342 9343 /** 9344 * Light graffiti effect. 9345 * 9346 * @syscap SystemCapability.Multimedia.Camera.Core 9347 * @systemapi 9348 * @since 12 9349 */ 9350 LIGHT_GRAFFITI = 3 9351 } 9352 9353 /** 9354 * Rectangle definition. 9355 * 9356 * @typedef Rect 9357 * @syscap SystemCapability.Multimedia.Camera.Core 9358 * @since 10 9359 */ 9360 interface Rect { 9361 /** 9362 * X coordinator of top left point. 9363 * 9364 * @type { number } 9365 * @syscap SystemCapability.Multimedia.Camera.Core 9366 * @since 10 9367 */ 9368 topLeftX: number; 9369 /** 9370 * Y coordinator of top left point. 9371 * 9372 * @type { number } 9373 * @syscap SystemCapability.Multimedia.Camera.Core 9374 * @since 10 9375 */ 9376 topLeftY: number; 9377 /** 9378 * Width of this rectangle. 9379 * 9380 * @type { number } 9381 * @syscap SystemCapability.Multimedia.Camera.Core 9382 * @since 10 9383 */ 9384 width: number; 9385 /** 9386 * Height of this rectangle. 9387 * 9388 * @type { number } 9389 * @syscap SystemCapability.Multimedia.Camera.Core 9390 * @since 10 9391 */ 9392 height: number; 9393 } 9394 9395 /** 9396 * Enum for emotion type. 9397 * 9398 * @enum { number } 9399 * @syscap SystemCapability.Multimedia.Camera.Core 9400 * @systemapi 9401 * @since 13 9402 */ 9403 enum Emotion { 9404 /** 9405 * Emotion type: Neutral. 9406 * 9407 * @syscap SystemCapability.Multimedia.Camera.Core 9408 * @systemapi 9409 * @since 13 9410 */ 9411 NEUTRAL = 0, 9412 9413 /** 9414 * Emotion type: Sadness. 9415 * 9416 * @syscap SystemCapability.Multimedia.Camera.Core 9417 * @systemapi 9418 * @since 13 9419 */ 9420 SADNESS = 1, 9421 9422 /** 9423 * Emotion type: Smile. 9424 * 9425 * @syscap SystemCapability.Multimedia.Camera.Core 9426 * @systemapi 9427 * @since 13 9428 */ 9429 SMILE = 2, 9430 9431 /** 9432 * Emotion type: Surprise. 9433 * 9434 * @syscap SystemCapability.Multimedia.Camera.Core 9435 * @systemapi 9436 * @since 13 9437 */ 9438 SURPRISE = 3 9439 } 9440 9441 /** 9442 * Metadata object basis. 9443 * 9444 * @typedef MetadataObject 9445 * @syscap SystemCapability.Multimedia.Camera.Core 9446 * @since 10 9447 */ 9448 interface MetadataObject { 9449 /** 9450 * Metadata object type. 9451 * 9452 * @type { MetadataObjectType } 9453 * @readonly 9454 * @syscap SystemCapability.Multimedia.Camera.Core 9455 * @since 10 9456 */ 9457 readonly type: MetadataObjectType; 9458 /** 9459 * Metadata object timestamp in milliseconds. 9460 * 9461 * @type { number } 9462 * @readonly 9463 * @syscap SystemCapability.Multimedia.Camera.Core 9464 * @since 10 9465 */ 9466 readonly timestamp: number; 9467 /** 9468 * The axis-aligned bounding box of detected metadata object. 9469 * 9470 * @type { Rect } 9471 * @readonly 9472 * @syscap SystemCapability.Multimedia.Camera.Core 9473 * @since 10 9474 */ 9475 readonly boundingBox: Rect; 9476 /** 9477 * Metadata object id. 9478 * 9479 * @type { number } 9480 * @readonly 9481 * @syscap SystemCapability.Multimedia.Camera.Core 9482 * @systemapi 9483 * @since 13 9484 */ 9485 readonly objectId: number; 9486 /** 9487 * Confidence for the detected type. 9488 * 9489 * @type { number } 9490 * @readonly 9491 * @syscap SystemCapability.Multimedia.Camera.Core 9492 * @systemapi 9493 * @since 13 9494 */ 9495 readonly confidence: number; 9496 } 9497 9498 /** 9499 * Metadata object for face. 9500 * 9501 * @typedef MetadataFaceObject 9502 * @extends MetadataObject 9503 * @syscap SystemCapability.Multimedia.Camera.Core 9504 * @systemapi 9505 * @since 13 9506 */ 9507 interface MetadataFaceObject extends MetadataObject { 9508 /** 9509 * Bounding box for left eye. 9510 * 9511 * @type { Rect } 9512 * @readonly 9513 * @syscap SystemCapability.Multimedia.Camera.Core 9514 * @systemapi 9515 * @since 13 9516 */ 9517 readonly leftEyeBoundingBox: Rect; 9518 9519 /** 9520 * Bounding box for right eye. 9521 * 9522 * @type { Rect } 9523 * @readonly 9524 * @syscap SystemCapability.Multimedia.Camera.Core 9525 * @systemapi 9526 * @since 13 9527 */ 9528 readonly rightEyeBoundingBox: Rect; 9529 9530 /** 9531 * Emotion type for face. 9532 * 9533 * @type { Emotion } 9534 * @readonly 9535 * @syscap SystemCapability.Multimedia.Camera.Core 9536 * @systemapi 9537 * @since 13 9538 */ 9539 readonly emotion: Emotion; 9540 9541 /** 9542 * Emotion confidence. 9543 * 9544 * @type { number } 9545 * @readonly 9546 * @syscap SystemCapability.Multimedia.Camera.Core 9547 * @systemapi 9548 * @since 13 9549 */ 9550 readonly emotionConfidence: number; 9551 9552 /** 9553 * Pitch angle for face. 9554 * 9555 * @type { number } 9556 * @readonly 9557 * @syscap SystemCapability.Multimedia.Camera.Core 9558 * @systemapi 9559 * @since 13 9560 */ 9561 readonly pitchAngle: number; 9562 9563 /** 9564 * Yaw angle for face. 9565 * 9566 * @type { number } 9567 * @readonly 9568 * @syscap SystemCapability.Multimedia.Camera.Core 9569 * @systemapi 9570 * @since 13 9571 */ 9572 readonly yawAngle: number; 9573 9574 /** 9575 * Roll angle for face. 9576 * 9577 * @type { number } 9578 * @readonly 9579 * @syscap SystemCapability.Multimedia.Camera.Core 9580 * @systemapi 9581 * @since 13 9582 */ 9583 readonly rollAngle: number; 9584 } 9585 9586 /** 9587 * Metadata object for human body. 9588 * 9589 * @typedef MetadataHumanBodyObject 9590 * @extends MetadataObject 9591 * @syscap SystemCapability.Multimedia.Camera.Core 9592 * @systemapi 9593 * @since 13 9594 */ 9595 interface MetadataHumanBodyObject extends MetadataObject { 9596 } 9597 9598 /** 9599 * Metadata object for cat face. 9600 * 9601 * @typedef MetadataCatFaceObject 9602 * @extends MetadataObject 9603 * @syscap SystemCapability.Multimedia.Camera.Core 9604 * @systemapi 9605 * @since 13 9606 */ 9607 interface MetadataCatFaceObject extends MetadataObject { 9608 /** 9609 * Bounding box for left eye. 9610 * 9611 * @type { Rect } 9612 * @readonly 9613 * @syscap SystemCapability.Multimedia.Camera.Core 9614 * @systemapi 9615 * @since 13 9616 */ 9617 readonly leftEyeBoundingBox: Rect; 9618 9619 /** 9620 * Bounding box for right eye. 9621 * 9622 * @type { Rect } 9623 * @readonly 9624 * @syscap SystemCapability.Multimedia.Camera.Core 9625 * @systemapi 9626 * @since 13 9627 */ 9628 readonly rightEyeBoundingBox: Rect; 9629 } 9630 9631 /** 9632 * Metadata object for cat body. 9633 * 9634 * @typedef MetadataCatBodyObject 9635 * @extends MetadataObject 9636 * @syscap SystemCapability.Multimedia.Camera.Core 9637 * @systemapi 9638 * @since 13 9639 */ 9640 interface MetadataCatBodyObject extends MetadataObject { 9641 } 9642 9643 /** 9644 * Metadata object for dog face. 9645 * 9646 * @typedef MetadataDogFaceObject 9647 * @extends MetadataObject 9648 * @syscap SystemCapability.Multimedia.Camera.Core 9649 * @systemapi 9650 * @since 13 9651 */ 9652 interface MetadataDogFaceObject extends MetadataObject { 9653 /** 9654 * Bounding box for left eye. 9655 * 9656 * @type { Rect } 9657 * @readonly 9658 * @syscap SystemCapability.Multimedia.Camera.Core 9659 * @systemapi 9660 * @since 13 9661 */ 9662 readonly leftEyeBoundingBox: Rect; 9663 9664 /** 9665 * Bounding box for right eye. 9666 * 9667 * @type { Rect } 9668 * @readonly 9669 * @syscap SystemCapability.Multimedia.Camera.Core 9670 * @systemapi 9671 * @since 13 9672 */ 9673 readonly rightEyeBoundingBox: Rect; 9674 } 9675 9676 /** 9677 * Metadata object for dog body. 9678 * 9679 * @typedef MetadataDogBodyObject 9680 * @extends MetadataObject 9681 * @syscap SystemCapability.Multimedia.Camera.Core 9682 * @systemapi 9683 * @since 13 9684 */ 9685 interface MetadataDogBodyObject extends MetadataObject { 9686 } 9687 9688 /** 9689 * Metadata object for salient detection. 9690 * 9691 * @typedef MetadataSalientDetectionObject 9692 * @extends MetadataObject 9693 * @syscap SystemCapability.Multimedia.Camera.Core 9694 * @systemapi 9695 * @since 13 9696 */ 9697 interface MetadataSalientDetectionObject extends MetadataObject { 9698 } 9699 9700 /** 9701 * Camera Occlusion Detection Result. 9702 * 9703 * @typedef CameraOcclusionDetectionResult 9704 * @syscap SystemCapability.Multimedia.Camera.Core 9705 * @systemapi 9706 * @since 12 9707 */ 9708 interface CameraOcclusionDetectionResult { 9709 /** 9710 * Check whether camera is occluded. 9711 * 9712 * @type { boolean } 9713 * @readonly 9714 * @syscap SystemCapability.Multimedia.Camera.Core 9715 * @systemapi 9716 * @since 12 9717 */ 9718 readonly isCameraOccluded: boolean; 9719 9720 /** 9721 * Check whether camera lens is dirty. 9722 * 9723 * @type { boolean } 9724 * @readonly 9725 * @syscap SystemCapability.Multimedia.Camera.Core 9726 * @systemapi 9727 * @since 13 9728 */ 9729 readonly isCameraLensDirty: boolean; 9730 } 9731 9732 /** 9733 * Metadata Output object 9734 * 9735 * @interface MetadataOutput 9736 * @syscap SystemCapability.Multimedia.Camera.Core 9737 * @since 10 9738 */ 9739 interface MetadataOutput extends CameraOutput { 9740 /** 9741 * Start output metadata 9742 * 9743 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9744 * @throws { BusinessError } 7400103 - Session not config. 9745 * @throws { BusinessError } 7400201 - Camera service fatal error. 9746 * @syscap SystemCapability.Multimedia.Camera.Core 9747 * @since 10 9748 */ 9749 start(callback: AsyncCallback<void>): void; 9750 9751 /** 9752 * Start output metadata 9753 * 9754 * @returns { Promise<void> } Promise used to return the result. 9755 * @throws { BusinessError } 7400103 - Session not config. 9756 * @throws { BusinessError } 7400201 - Camera service fatal error. 9757 * @syscap SystemCapability.Multimedia.Camera.Core 9758 * @since 10 9759 */ 9760 start(): Promise<void>; 9761 9762 /** 9763 * Stop output metadata 9764 * 9765 * @param { AsyncCallback<void> } callback - Callback used to return the result. 9766 * @syscap SystemCapability.Multimedia.Camera.Core 9767 * @since 10 9768 */ 9769 stop(callback: AsyncCallback<void>): void; 9770 9771 /** 9772 * Stop output metadata 9773 * 9774 * @returns { Promise<void> } Promise used to return the result. 9775 * @syscap SystemCapability.Multimedia.Camera.Core 9776 * @since 10 9777 */ 9778 stop(): Promise<void>; 9779 9780 /** 9781 * Add metadata object types. 9782 * 9783 * @param { Array<MetadataObjectType> } types - Object types to be added. 9784 * @throws { BusinessError } 202 - Not System Application. 9785 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9786 * @throws { BusinessError } 7400103 - Session not config. 9787 * @throws { BusinessError } 7400201 - Camera service fatal error. 9788 * @syscap SystemCapability.Multimedia.Camera.Core 9789 * @systemapi 9790 * @since 13 9791 */ 9792 addMetadataObjectTypes(types: Array<MetadataObjectType>): void; 9793 9794 /** 9795 * Remove metadata object types. 9796 * 9797 * @param { Array<MetadataObjectType> } types - Object types to be removed. 9798 * @throws { BusinessError } 202 - Not System Application. 9799 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9800 * @throws { BusinessError } 7400103 - Session not config. 9801 * @throws { BusinessError } 7400201 - Camera service fatal error. 9802 * @syscap SystemCapability.Multimedia.Camera.Core 9803 * @systemapi 9804 * @since 13 9805 */ 9806 removeMetadataObjectTypes(types: Array<MetadataObjectType>): void; 9807 9808 /** 9809 * Subscribes to metadata objects available event callback. 9810 * 9811 * @param { 'metadataObjectsAvailable' } type - Event type. 9812 * @param { AsyncCallback<Array<MetadataObject>> } callback - Callback used to get the available metadata objects. 9813 * @syscap SystemCapability.Multimedia.Camera.Core 9814 * @since 10 9815 */ 9816 on(type: 'metadataObjectsAvailable', callback: AsyncCallback<Array<MetadataObject>>): void; 9817 9818 /** 9819 * Unsubscribes from metadata objects available event callback. 9820 * 9821 * @param { 'metadataObjectsAvailable' } type - Event type. 9822 * @param { AsyncCallback<Array<MetadataObject>> } callback - Callback used to get the available metadata objects. 9823 * @syscap SystemCapability.Multimedia.Camera.Core 9824 * @since 10 9825 */ 9826 off(type: 'metadataObjectsAvailable', callback?: AsyncCallback<Array<MetadataObject>>): void; 9827 9828 /** 9829 * Subscribes to error events. 9830 * 9831 * @param { 'error' } type - Event type. 9832 * @param { ErrorCallback } callback - Callback used to get the video output errors. 9833 * @syscap SystemCapability.Multimedia.Camera.Core 9834 * @since 10 9835 */ 9836 on(type: 'error', callback: ErrorCallback): void; 9837 9838 /** 9839 * Unsubscribes from error events. 9840 * 9841 * @param { 'error' } type - Event type. 9842 * @param { ErrorCallback } callback - Callback used to get the video output errors. 9843 * @syscap SystemCapability.Multimedia.Camera.Core 9844 * @since 10 9845 */ 9846 off(type: 'error', callback?: ErrorCallback): void; 9847 } 9848 9849 /** 9850 * Enumerates the timelapse recording state. 9851 * 9852 * @enum { number } 9853 * @syscap SystemCapability.Multimedia.Camera.Core 9854 * @systemapi 9855 * @since 12 9856 */ 9857 enum TimeLapseRecordState { 9858 /** 9859 * TimeLapse idle state. 9860 * 9861 * @syscap SystemCapability.Multimedia.Camera.Core 9862 * @systemapi 9863 * @since 12 9864 */ 9865 IDLE = 0, 9866 9867 /** 9868 * TimeLapse recording state. 9869 * 9870 * @syscap SystemCapability.Multimedia.Camera.Core 9871 * @systemapi 9872 * @since 12 9873 */ 9874 RECORDING = 1 9875 } 9876 9877 /** 9878 * Enumerates the timelapse preview type. 9879 * 9880 * @enum { number } 9881 * @syscap SystemCapability.Multimedia.Camera.Core 9882 * @systemapi 9883 * @since 12 9884 */ 9885 enum TimeLapsePreviewType { 9886 /** 9887 * TimeLapse dark preview. 9888 * 9889 * @syscap SystemCapability.Multimedia.Camera.Core 9890 * @systemapi 9891 * @since 12 9892 */ 9893 DARK = 1, 9894 9895 /** 9896 * TimeLapse Light preview. 9897 * 9898 * @syscap SystemCapability.Multimedia.Camera.Core 9899 * @systemapi 9900 * @since 12 9901 */ 9902 LIGHT = 2 9903 } 9904 9905 /** 9906 * Try AE information. 9907 * 9908 * @typedef TryAEInfo 9909 * @syscap SystemCapability.Multimedia.Camera.Core 9910 * @systemapi 9911 * @since 12 9912 */ 9913 interface TryAEInfo { 9914 /** 9915 * Determine whether try AE is done. 9916 * 9917 * @type { boolean } 9918 * @readonly 9919 * @syscap SystemCapability.Multimedia.Camera.Core 9920 * @systemapi 9921 * @since 12 9922 */ 9923 readonly isTryAEDone: boolean; 9924 9925 /** 9926 * Determine whether AE hint is needed. 9927 * 9928 * @type { ?boolean } 9929 * @readonly 9930 * @syscap SystemCapability.Multimedia.Camera.Core 9931 * @systemapi 9932 * @since 12 9933 */ 9934 readonly isTryAEHintNeeded?: boolean; 9935 9936 /** 9937 * Timelapse preview type. 9938 * 9939 * @type { ?TimeLapsePreviewType } 9940 * @readonly 9941 * @syscap SystemCapability.Multimedia.Camera.Core 9942 * @systemapi 9943 * @since 12 9944 */ 9945 readonly previewType?: TimeLapsePreviewType; 9946 9947 /** 9948 * Timelapse capture interval. 9949 * 9950 * @type { ?number } 9951 * @readonly 9952 * @syscap SystemCapability.Multimedia.Camera.Core 9953 * @systemapi 9954 * @since 12 9955 */ 9956 readonly captureInterval?: number; 9957 } 9958 9959 /** 9960 * Timelapse photo session object. 9961 * 9962 * @interface TimeLapsePhotoSession 9963 * @syscap SystemCapability.Multimedia.Camera.Core 9964 * @systemapi 9965 * @since 12 9966 */ 9967 interface TimeLapsePhotoSession extends Session, Focus, ManualFocus, AutoExposure, ManualExposure, ManualIso, WhiteBalance, Zoom, ColorEffect { 9968 /** 9969 * Subscribes to error events. 9970 * 9971 * @param { 'error' } type - Event type. 9972 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9973 * @throws { BusinessError } 202 - Not System Application. 9974 * @syscap SystemCapability.Multimedia.Camera.Core 9975 * @systemapi 9976 * @since 12 9977 */ 9978 on(type: 'error', callback: ErrorCallback): void; 9979 9980 /** 9981 * Unsubscribes from error events. 9982 * 9983 * @param { 'error' } type - Event type. 9984 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9985 * @throws { BusinessError } 202 - Not System Application. 9986 * @syscap SystemCapability.Multimedia.Camera.Core 9987 * @systemapi 9988 * @since 12 9989 */ 9990 off(type: 'error', callback?: ErrorCallback): void; 9991 9992 /** 9993 * Subscribes focus state change event callback. 9994 * 9995 * @param { 'focusStateChange' } type - Event type. 9996 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9997 * @throws { BusinessError } 202 - Not System Application. 9998 * @syscap SystemCapability.Multimedia.Camera.Core 9999 * @systemapi 10000 * @since 12 10001 */ 10002 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 10003 10004 /** 10005 * Unsubscribes from focus state change event callback. 10006 * 10007 * @param { 'focusStateChange' } type - Event type. 10008 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10009 * @throws { BusinessError } 202 - Not System Application. 10010 * @syscap SystemCapability.Multimedia.Camera.Core 10011 * @systemapi 10012 * @since 12 10013 */ 10014 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 10015 10016 /** 10017 * Subscribes ISO info event callback. 10018 * 10019 * @param { 'isoInfoChange' } type - Event type. 10020 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 10021 * @throws { BusinessError } 202 - Not System Application. 10022 * @syscap SystemCapability.Multimedia.Camera.Core 10023 * @systemapi 10024 * @since 12 10025 */ 10026 on(type: 'isoInfoChange', callback: AsyncCallback<IsoInfo>): void; 10027 10028 /** 10029 * Unsubscribes from ISO info event callback. 10030 * 10031 * @param { 'isoInfoChange' } type - Event type. 10032 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 10033 * @throws { BusinessError } 202 - Not System Application. 10034 * @syscap SystemCapability.Multimedia.Camera.Core 10035 * @systemapi 10036 * @since 12 10037 */ 10038 off(type: 'isoInfoChange', callback?: AsyncCallback<IsoInfo>): void; 10039 10040 /** 10041 * Subscribes exposure info event callback. 10042 * 10043 * @param { 'exposureInfoChange' } type - Event type. 10044 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 10045 * @throws { BusinessError } 202 - Not System Application. 10046 * @syscap SystemCapability.Multimedia.Camera.Core 10047 * @systemapi 10048 * @since 12 10049 */ 10050 on(type: 'exposureInfoChange', callback: AsyncCallback<ExposureInfo>): void; 10051 10052 /** 10053 * Unsubscribes from exposure info event callback. 10054 * 10055 * @param { 'exposureInfoChange' } type - Event type. 10056 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 10057 * @throws { BusinessError } 202 - Not System Application. 10058 * @syscap SystemCapability.Multimedia.Camera.Core 10059 * @systemapi 10060 * @since 12 10061 */ 10062 off(type: 'exposureInfoChange', callback?: AsyncCallback<ExposureInfo>): void; 10063 10064 /** 10065 * Subscribes lumination info event callback. 10066 * 10067 * @param { 'luminationInfoChange' } type - Event type. 10068 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 10069 * @throws { BusinessError } 202 - Not System Application. 10070 * @syscap SystemCapability.Multimedia.Camera.Core 10071 * @systemapi 10072 * @since 12 10073 */ 10074 on(type: 'luminationInfoChange', callback: AsyncCallback<LuminationInfo>): void; 10075 10076 /** 10077 * Unsubscribes from lumination info event callback. 10078 * 10079 * @param { 'luminationInfoChange' } type - Event type. 10080 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 10081 * @throws { BusinessError } 202 - Not System Application. 10082 * @syscap SystemCapability.Multimedia.Camera.Core 10083 * @systemapi 10084 * @since 12 10085 */ 10086 off(type: 'luminationInfoChange', callback?: AsyncCallback<LuminationInfo>): void; 10087 10088 /** 10089 * Check whether try AE is needed. 10090 * 10091 * @returns { boolean } Is try AE needed. 10092 * @throws { BusinessError } 202 - Not System Application. 10093 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 10094 * @syscap SystemCapability.Multimedia.Camera.Core 10095 * @systemapi 10096 * @since 12 10097 */ 10098 isTryAENeeded(): boolean; 10099 10100 /** 10101 * Start try AE. 10102 * 10103 * @throws { BusinessError } 202 - Not System Application. 10104 * @throws { BusinessError } 7400103 - Session not config. 10105 * @throws { BusinessError } 7400201 - Camera service fatal error. 10106 * @syscap SystemCapability.Multimedia.Camera.Core 10107 * @systemapi 10108 * @since 12 10109 */ 10110 startTryAE(): void; 10111 10112 /** 10113 * Stop try AE. 10114 * 10115 * @throws { BusinessError } 202 - Not System Application. 10116 * @throws { BusinessError } 7400103 - Session not config. 10117 * @throws { BusinessError } 7400201 - Camera service fatal error. 10118 * @syscap SystemCapability.Multimedia.Camera.Core 10119 * @systemapi 10120 * @since 12 10121 */ 10122 stopTryAE(): void; 10123 10124 /** 10125 * Subscribes try AE info event callback. 10126 * 10127 * @param { 'tryAEInfoChange' } type - Event type. 10128 * @param { AsyncCallback<TryAEInfo> } callback - Callback used to get the try AE info. 10129 * @throws { BusinessError } 202 - Not System Application. 10130 * @syscap SystemCapability.Multimedia.Camera.Core 10131 * @systemapi 10132 * @since 12 10133 */ 10134 on(type: 'tryAEInfoChange', callback: AsyncCallback<TryAEInfo>): void; 10135 10136 /** 10137 * Unsubscribes from try AE info event callback. 10138 * 10139 * @param { 'tryAEInfoChange' } type - Event type. 10140 * @param { AsyncCallback<TryAEInfo> } callback - Callback used to get the try AE info. 10141 * @throws { BusinessError } 202 - Not System Application. 10142 * @syscap SystemCapability.Multimedia.Camera.Core 10143 * @systemapi 10144 * @since 12 10145 */ 10146 off(type: 'tryAEInfoChange', callback?: AsyncCallback<TryAEInfo>): void; 10147 10148 /** 10149 * Gets supported timelapse interval range. 10150 * 10151 * @returns { Array<number> } Timelapse interval range. 10152 * @throws { BusinessError } 202 - Not System Application. 10153 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 10154 * @syscap SystemCapability.Multimedia.Camera.Core 10155 * @systemapi 10156 * @since 12 10157 */ 10158 getSupportedTimeLapseIntervalRange(): Array<number>; 10159 10160 /** 10161 * Gets the timelapse interval in use. 10162 * 10163 * @returns { number } the timelapse interval in use. 10164 * @throws { BusinessError } 202 - Not System Application. 10165 * @throws { BusinessError } 7400103 - Session not config. 10166 * @syscap SystemCapability.Multimedia.Camera.Core 10167 * @systemapi 10168 * @since 12 10169 */ 10170 getTimeLapseInterval(): number; 10171 10172 /** 10173 * Sets a timelapse interval for a camera device. 10174 * 10175 * @param { number } interval The timelapse interval. 10176 * @throws { BusinessError } 202 - Not System Application. 10177 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10178 * @throws { BusinessError } 7400103 - Session not config. 10179 * @syscap SystemCapability.Multimedia.Camera.Core 10180 * @systemapi 10181 * @since 12 10182 */ 10183 setTimeLapseInterval(interval: number): void; 10184 10185 /** 10186 * Gets the timelapse recording state in use. 10187 * 10188 * @returns { TimeLapseRecordState } the timelapse recording state in use. 10189 * @throws { BusinessError } 202 - Not System Application. 10190 * @throws { BusinessError } 7400103 - Session not config. 10191 * @syscap SystemCapability.Multimedia.Camera.Core 10192 * @systemapi 10193 * @since 12 10194 */ 10195 getTimeLapseRecordState(): TimeLapseRecordState; 10196 10197 /** 10198 * Sets a timelapse recording state. 10199 * 10200 * @param { TimeLapseRecordState } state The timelapse recording state. 10201 * @throws { BusinessError } 202 - Not System Application. 10202 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10203 * @throws { BusinessError } 7400103 - Session not config. 10204 * @syscap SystemCapability.Multimedia.Camera.Core 10205 * @systemapi 10206 * @since 12 10207 */ 10208 setTimeLapseRecordState(state: TimeLapseRecordState): void; 10209 10210 /** 10211 * Gets the timelapse preview type in use. 10212 * 10213 * @returns { TimeLapsePreviewType } the timelapse preview type in use. 10214 * @throws { BusinessError } 202 - Not System Application. 10215 * @throws { BusinessError } 7400103 - Session not config. 10216 * @syscap SystemCapability.Multimedia.Camera.Core 10217 * @systemapi 10218 * @since 12 10219 */ 10220 getTimeLapsePreviewType(): TimeLapsePreviewType; 10221 10222 /** 10223 * Sets a timelapse preview type. 10224 * 10225 * @param { TimeLapsePreviewType } type The timelapse preview type. 10226 * @throws { BusinessError } 202 - Not System Application. 10227 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10228 * @throws { BusinessError } 7400103 - Session not config. 10229 * @syscap SystemCapability.Multimedia.Camera.Core 10230 * @systemapi 10231 * @since 12 10232 */ 10233 setTimeLapsePreviewType(type: TimeLapsePreviewType): void; 10234 } 10235 10236 /** 10237 * Enum for Depth Data Accuracy. 10238 * 10239 * @enum { number } 10240 * @syscap SystemCapability.Multimedia.Camera.Core 10241 * @systemapi 10242 * @since 13 10243 */ 10244 enum DepthDataAccuracy { 10245 /** 10246 * Relative accuracy depth data. 10247 * 10248 * @syscap SystemCapability.Multimedia.Camera.Core 10249 * @systemapi 10250 * @since 13 10251 */ 10252 DEPTH_DATA_ACCURACY_RELATIVE = 0, 10253 10254 /** 10255 * Absolute accuracy depth data. 10256 * 10257 * @syscap SystemCapability.Multimedia.Camera.Core 10258 * @systemapi 10259 * @since 13 10260 */ 10261 DEPTH_DATA_ACCURACY_ABSOLUTE = 1 10262 } 10263 10264 /** 10265 * Enum for Depth Data Quality Level. 10266 * 10267 * @enum { number } 10268 * @syscap SystemCapability.Multimedia.Camera.Core 10269 * @systemapi 10270 * @since 13 10271 */ 10272 enum DepthDataQualityLevel { 10273 /** 10274 * Depth data quality is bad. 10275 * 10276 * @syscap SystemCapability.Multimedia.Camera.Core 10277 * @systemapi 10278 * @since 13 10279 */ 10280 DEPTH_DATA_QUALITY_BAD = 0, 10281 10282 /** 10283 * Depth data quality is fair. 10284 * 10285 * @syscap SystemCapability.Multimedia.Camera.Core 10286 * @systemapi 10287 * @since 13 10288 */ 10289 DEPTH_DATA_QUALITY_FAIR = 1, 10290 10291 /** 10292 * Depth data quality is good. 10293 * 10294 * @syscap SystemCapability.Multimedia.Camera.Core 10295 * @systemapi 10296 * @since 13 10297 */ 10298 DEPTH_DATA_QUALITY_GOOD = 2 10299 } 10300 10301 /** 10302 * Depth Profile. 10303 * 10304 * @interface DepthProfile 10305 * @syscap SystemCapability.Multimedia.Camera.Core 10306 * @systemapi 10307 * @since 13 10308 */ 10309 interface DepthProfile { 10310 /** 10311 * Depth data format. 10312 * 10313 * @type { CameraFormat } 10314 * @readonly 10315 * @syscap SystemCapability.Multimedia.Camera.Core 10316 * @systemapi 10317 * @since 13 10318 */ 10319 readonly format: CameraFormat; 10320 10321 /** 10322 * Depth data accuracy. 10323 * 10324 * @type { DepthDataAccuracy } 10325 * @readonly 10326 * @syscap SystemCapability.Multimedia.Camera.Core 10327 * @systemapi 10328 * @since 13 10329 */ 10330 readonly dataAccuracy: DepthDataAccuracy; 10331 10332 /** 10333 * Depth data resolution. 10334 * 10335 * @type { Size } 10336 * @readonly 10337 * @syscap SystemCapability.Multimedia.Camera.Core 10338 * @systemapi 10339 * @since 13 10340 */ 10341 readonly size: Size; 10342 } 10343 10344 /** 10345 * Depth Data. 10346 * 10347 * @interface DepthData. 10348 * @syscap SystemCapability.Multimedia.Camera.Core 10349 * @systemapi 10350 * @since 13 10351 */ 10352 interface DepthData { 10353 /** 10354 * Depth data format. 10355 * 10356 * @type { CameraFormat } 10357 * @readonly 10358 * @syscap SystemCapability.Multimedia.Camera.Core 10359 * @systemapi 10360 * @since 13 10361 */ 10362 readonly format: CameraFormat; 10363 10364 /** 10365 * Depth data map. 10366 * 10367 * @type { image.PixelMap } 10368 * @readonly 10369 * @syscap SystemCapability.Multimedia.Camera.Core 10370 * @systemapi 10371 * @since 13 10372 */ 10373 readonly depthMap: image.PixelMap; 10374 10375 /** 10376 * Depth data quality level. 10377 * 10378 * @type { DepthDataQualityLevel } 10379 * @readonly 10380 * @syscap SystemCapability.Multimedia.Camera.Core 10381 * @systemapi 10382 * @since 13 10383 */ 10384 readonly qualityLevel: DepthDataQualityLevel; 10385 10386 /** 10387 * Depth data accuracy. 10388 * 10389 * @type { DepthDataAccuracy } 10390 * @readonly 10391 * @syscap SystemCapability.Multimedia.Camera.Core 10392 * @systemapi 10393 * @since 13 10394 */ 10395 readonly dataAccuracy: DepthDataAccuracy; 10396 10397 /** 10398 * Release depth data object. 10399 * 10400 * @returns { Promise<void> } Promise used to return the result. 10401 * @throws { BusinessError } 202 - Not System Application. 10402 * @syscap SystemCapability.Multimedia.Camera.Core 10403 * @systemapi 10404 * @since 13 10405 */ 10406 release(): Promise<void>; 10407 } 10408 10409 /** 10410 * Depth Data Output object 10411 * 10412 * @interface DepthDataOutput 10413 * @extends CameraOutput 10414 * @syscap SystemCapability.Multimedia.Camera.Core 10415 * @systemapi 10416 * @since 13 10417 */ 10418 interface DepthDataOutput extends CameraOutput { 10419 /** 10420 * Start depth data output. 10421 * 10422 * @returns { Promise<void> } Promise used to return the result. 10423 * @throws { BusinessError } 202 - Not System Application. 10424 * @throws { BusinessError } 7400103 - Session not config. 10425 * @throws { BusinessError } 7400201 - Camera service fatal error. 10426 * @syscap SystemCapability.Multimedia.Camera.Core 10427 * @systemapi 10428 * @since 13 10429 */ 10430 start(): Promise<void>; 10431 10432 /** 10433 * Stop depth data output. 10434 * 10435 * @returns { Promise<void> } Promise used to return the result. 10436 * @throws { BusinessError } 202 - Not System Application. 10437 * @throws { BusinessError } 7400103 - Session not config. 10438 * @throws { BusinessError } 7400201 - Camera service fatal error. 10439 * @syscap SystemCapability.Multimedia.Camera.Core 10440 * @systemapi 10441 * @since 13 10442 */ 10443 stop(): Promise<void>; 10444 10445 /** 10446 * Subscribes to depth data objects available event callback. 10447 * 10448 * @param { 'depthDataAvailable' } type - Event type. 10449 * @param { AsyncCallback<DepthData> } callback - Callback used to get the available DepthData objects. 10450 * @throws { BusinessError } 202 - Not System Application. 10451 * @syscap SystemCapability.Multimedia.Camera.Core 10452 * @systemapi 10453 * @since 13 10454 */ 10455 on(type: 'depthDataAvailable', callback: AsyncCallback<DepthData>): void; 10456 10457 /** 10458 * Unsubscribes from depth data objects available event callback. 10459 * 10460 * @param { 'depthDataAvailable' } type - Event type. 10461 * @param { AsyncCallback<DepthData> } callback - Callback used to get the available DepthData objects. 10462 * @throws { BusinessError } 202 - Not System Application. 10463 * @syscap SystemCapability.Multimedia.Camera.Core 10464 * @systemapi 10465 * @since 13 10466 */ 10467 off(type: 'depthDataAvailable', callback?: AsyncCallback<DepthData>): void; 10468 10469 /** 10470 * Subscribes to error events. 10471 * 10472 * @param { 'error' } type - Event type. 10473 * @param { ErrorCallback } callback - Callback used to get the video output errors. 10474 * @throws { BusinessError } 202 - Not System Application. 10475 * @syscap SystemCapability.Multimedia.Camera.Core 10476 * @systemapi 10477 * @since 13 10478 */ 10479 on(type: 'error', callback: ErrorCallback): void; 10480 10481 /** 10482 * Unsubscribes from error events. 10483 * 10484 * @param { 'error' } type - Event type. 10485 * @param { ErrorCallback } callback - Callback used to get the video output errors. 10486 * @throws { BusinessError } 202 - Not System Application. 10487 * @syscap SystemCapability.Multimedia.Camera.Core 10488 * @systemapi 10489 * @since 13 10490 */ 10491 off(type: 'error', callback?: ErrorCallback): void; 10492 } 10493 10494 /** 10495 * Depth Fusion Query object. 10496 * 10497 * @interface DepthFusionQuery 10498 * @syscap SystemCapability.Multimedia.Camera.Core 10499 * @systemapi 10500 * @since 14 10501 */ 10502 interface DepthFusionQuery { 10503 /** 10504 * Checks whether a depth fusion is supported. 10505 * 10506 * @returns { boolean } Is the depth fusion supported. 10507 * @throws { BusinessError } 202 - Not System Application. 10508 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 10509 * @syscap SystemCapability.Multimedia.Camera.Core 10510 * @systemapi 10511 * @since 14 10512 */ 10513 isDepthFusionSupported(): boolean; 10514 10515 /** 10516 * Query the depth fusion threshold. 10517 * 10518 * @returns { Array<number> } The depth fusion threshold. 10519 * @throws { BusinessError } 202 - Not System Application. 10520 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 10521 * @syscap SystemCapability.Multimedia.Camera.Core 10522 * @systemapi 10523 * @since 14 10524 */ 10525 getDepthFusionThreshold(): Array<number>; 10526 } 10527 10528 /** 10529 * Depth Fusion object. 10530 * 10531 * @interface DepthFusion 10532 * @extends DepthFusionQuery 10533 * @syscap SystemCapability.Multimedia.Camera.Core 10534 * @systemapi 10535 * @since 14 10536 */ 10537 interface DepthFusion extends DepthFusionQuery { 10538 /** 10539 * Confirm if the depth fusion enabled. 10540 * 10541 * @returns { boolean } TRUE if the depth fusion is enable. 10542 * @throws { BusinessError } 202 - Not System Application. 10543 * @throws { BusinessError } 7400103 - Session not config. 10544 * @syscap SystemCapability.Multimedia.Camera.Core 10545 * @systemapi 10546 * @since 14 10547 */ 10548 isDepthFusionEnabled(): boolean; 10549 10550 /** 10551 * Enable depth fusion. 10552 * 10553 * @param { boolean } enabled - Target state for depth fusion. 10554 * @throws { BusinessError } 202 - Not System Application. 10555 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10556 * @throws { BusinessError } 7400103 - Session not config. 10557 * @throws { BusinessError } 7400201 - Camera service fatal error. 10558 * @syscap SystemCapability.Multimedia.Camera.Core 10559 * @systemapi 10560 * @since 14 10561 */ 10562 enableDepthFusion(enabled: boolean): void; 10563 } 10564} 10565 10566export default camera; 10567