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