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