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