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