1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit CameraKit 19 */ 20 21import { ErrorCallback, AsyncCallback, Callback } from './@ohos.base'; 22import type Context from './application/BaseContext'; 23import image from './@ohos.multimedia.image'; 24import type colorSpaceManager from './@ohos.graphics.colorSpaceManager'; 25import photoAccessHelper from './@ohos.file.photoAccessHelper'; 26 27/** 28 * @namespace camera 29 * @syscap SystemCapability.Multimedia.Camera.Core 30 * @since 10 31 */ 32/** 33 * @namespace camera 34 * @syscap SystemCapability.Multimedia.Camera.Core 35 * @atomicservice 36 * @since 12 37 */ 38declare namespace camera { 39 /** 40 * Creates a CameraManager instance. 41 * 42 * @param { Context } context - Current application context. 43 * @returns { CameraManager } CameraManager instance. 44 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 45 * @throws { BusinessError } 7400201 - Camera service fatal error. 46 * @syscap SystemCapability.Multimedia.Camera.Core 47 * @since 10 48 */ 49 /** 50 * Creates a CameraManager instance. 51 * 52 * @param { Context } context - Current application context. 53 * @returns { CameraManager } CameraManager instance. 54 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 55 * @throws { BusinessError } 7400201 - Camera service fatal error. 56 * @syscap SystemCapability.Multimedia.Camera.Core 57 * @atomicservice 58 * @since 19 59 */ 60 function getCameraManager(context: Context): CameraManager; 61 62 /** 63 * Enum for camera status. 64 * 65 * @enum { number } 66 * @syscap SystemCapability.Multimedia.Camera.Core 67 * @since 10 68 */ 69 /** 70 * Enum for camera status. 71 * 72 * @enum { number } 73 * @syscap SystemCapability.Multimedia.Camera.Core 74 * @atomicservice 75 * @since 19 76 */ 77 enum CameraStatus { 78 /** 79 * Appear status. 80 * 81 * @syscap SystemCapability.Multimedia.Camera.Core 82 * @since 10 83 */ 84 /** 85 * Appear status. 86 * 87 * @syscap SystemCapability.Multimedia.Camera.Core 88 * @atomicservice 89 * @since 19 90 */ 91 CAMERA_STATUS_APPEAR = 0, 92 93 /** 94 * Disappear status. 95 * 96 * @syscap SystemCapability.Multimedia.Camera.Core 97 * @since 10 98 */ 99 /** 100 * Disappear status. 101 * 102 * @syscap SystemCapability.Multimedia.Camera.Core 103 * @atomicservice 104 * @since 19 105 */ 106 CAMERA_STATUS_DISAPPEAR = 1, 107 108 /** 109 * Available status. 110 * 111 * @syscap SystemCapability.Multimedia.Camera.Core 112 * @since 10 113 */ 114 /** 115 * Available status. 116 * 117 * @syscap SystemCapability.Multimedia.Camera.Core 118 * @atomicservice 119 * @since 19 120 */ 121 CAMERA_STATUS_AVAILABLE = 2, 122 123 /** 124 * Unavailable status. 125 * 126 * @syscap SystemCapability.Multimedia.Camera.Core 127 * @since 10 128 */ 129 /** 130 * Unavailable status. 131 * 132 * @syscap SystemCapability.Multimedia.Camera.Core 133 * @atomicservice 134 * @since 19 135 */ 136 CAMERA_STATUS_UNAVAILABLE = 3 137 } 138 139 /** 140 * Enum for fold status. 141 * 142 * @enum { number } 143 * @syscap SystemCapability.Multimedia.Camera.Core 144 * @since 12 145 */ 146 /** 147 * Enum for fold status. 148 * 149 * @enum { number } 150 * @syscap SystemCapability.Multimedia.Camera.Core 151 * @atomicservice 152 * @since 19 153 */ 154 enum FoldStatus { 155 /** 156 * Non-foldable status. 157 * 158 * @syscap SystemCapability.Multimedia.Camera.Core 159 * @since 12 160 */ 161 /** 162 * Non-foldable status. 163 * 164 * @syscap SystemCapability.Multimedia.Camera.Core 165 * @atomicservice 166 * @since 19 167 */ 168 NON_FOLDABLE = 0, 169 170 /** 171 * Expanded status. 172 * 173 * @syscap SystemCapability.Multimedia.Camera.Core 174 * @since 12 175 */ 176 /** 177 * Expanded status. 178 * 179 * @syscap SystemCapability.Multimedia.Camera.Core 180 * @atomicservice 181 * @since 19 182 */ 183 EXPANDED = 1, 184 185 /** 186 * Folded status. 187 * 188 * @syscap SystemCapability.Multimedia.Camera.Core 189 * @since 12 190 */ 191 /** 192 * Folded status. 193 * 194 * @syscap SystemCapability.Multimedia.Camera.Core 195 * @atomicservice 196 * @since 19 197 */ 198 FOLDED = 2 199 } 200 201 /** 202 * Enumerates the system pressure levels of the current camera session. When the system pressure increases, 203 * you are advised to reduce the load of the current camera session. 204 * @enum { number } 205 * @syscap SystemCapability.Multimedia.Camera.Core 206 * @atomicservice 207 * @since 20 208 */ 209 enum SystemPressureLevel { 210 /** 211 * Normal level. This level indicates that the system pressure is normal. 212 * @syscap SystemCapability.Multimedia.Camera.Core 213 * @atomicservice 214 * @since 20 215 */ 216 SYSTEM_PRESSURE_NORMAL = 0, 217 218 /** 219 * Low level. This level indicates that the system pressure is slightly increased. 220 * @syscap SystemCapability.Multimedia.Camera.Core 221 * @atomicservice 222 * @since 20 223 */ 224 SYSTEM_PRESSURE_MILD = 1, 225 226 /** 227 * Severity level. This level indicates that the system pressure is severely increased. 228 * @syscap SystemCapability.Multimedia.Camera.Core 229 * @atomicservice 230 * @since 20 231 */ 232 SYSTEM_PRESSURE_SEVERE = 2, 233 234 /** 235 * Critical level. This level indicates that the system pressure has reached a critical threshold. 236 * @syscap SystemCapability.Multimedia.Camera.Core 237 * @atomicservice 238 * @since 20 239 */ 240 SYSTEM_PRESSURE_CRITICAL = 3, 241 242 /** 243 * Shutdown level. This level indicates that the system pressure is fatal, and the camera session will be 244 * shut down soon. 245 * @syscap SystemCapability.Multimedia.Camera.Core 246 * @atomicservice 247 * @since 20 248 */ 249 SYSTEM_PRESSURE_SHUTDOWN = 4 250 } 251 252 /** 253 * Profile for camera streams. 254 * 255 * @typedef Profile 256 * @syscap SystemCapability.Multimedia.Camera.Core 257 * @since 10 258 */ 259 /** 260 * Profile for camera streams. 261 * 262 * @typedef Profile 263 * @syscap SystemCapability.Multimedia.Camera.Core 264 * @atomicservice 265 * @since 19 266 */ 267 interface Profile { 268 /** 269 * Camera format. 270 * 271 * @type { CameraFormat } 272 * @readonly 273 * @syscap SystemCapability.Multimedia.Camera.Core 274 * @since 10 275 */ 276 /** 277 * Camera format. 278 * 279 * @type { CameraFormat } 280 * @readonly 281 * @syscap SystemCapability.Multimedia.Camera.Core 282 * @atomicservice 283 * @since 19 284 */ 285 readonly format: CameraFormat; 286 287 /** 288 * Picture size. 289 * 290 * @type { Size } 291 * @readonly 292 * @syscap SystemCapability.Multimedia.Camera.Core 293 * @since 10 294 */ 295 /** 296 * Resolution. The settings are the width and height of the camera's resolution, not the width and height of the actual output image. 297 * 298 * @type { Size } 299 * @readonly 300 * @syscap SystemCapability.Multimedia.Camera.Core 301 * @atomicservice 302 * @since 19 303 */ 304 readonly size: Size; 305 } 306 307 /** 308 * Frame rate range. 309 * 310 * @typedef FrameRateRange 311 * @syscap SystemCapability.Multimedia.Camera.Core 312 * @since 10 313 */ 314 /** 315 * Frame rate range. 316 * 317 * @typedef FrameRateRange 318 * @syscap SystemCapability.Multimedia.Camera.Core 319 * @atomicservice 320 * @since 19 321 */ 322 interface FrameRateRange { 323 /** 324 * Min frame rate. 325 * 326 * @type { number } 327 * @readonly 328 * @syscap SystemCapability.Multimedia.Camera.Core 329 * @since 10 330 */ 331 /** 332 * Min frame rate. 333 * 334 * @type { number } 335 * @readonly 336 * @syscap SystemCapability.Multimedia.Camera.Core 337 * @atomicservice 338 * @since 19 339 */ 340 readonly min: number; 341 342 /** 343 * Max frame rate. 344 * 345 * @type { number } 346 * @readonly 347 * @syscap SystemCapability.Multimedia.Camera.Core 348 * @since 10 349 */ 350 /** 351 * Max frame rate. 352 * 353 * @type { number } 354 * @readonly 355 * @syscap SystemCapability.Multimedia.Camera.Core 356 * @atomicservice 357 * @since 19 358 */ 359 readonly max: number; 360 } 361 362 /** 363 * Video profile. 364 * 365 * @extends Profile 366 * @typedef VideoProfile 367 * @syscap SystemCapability.Multimedia.Camera.Core 368 * @since 10 369 */ 370 /** 371 * Video profile. 372 * 373 * @extends Profile 374 * @typedef VideoProfile 375 * @syscap SystemCapability.Multimedia.Camera.Core 376 * @atomicservice 377 * @since 19 378 */ 379 interface VideoProfile extends Profile { 380 /** 381 * Frame rate in unit fps (frames per second). 382 * 383 * @type { FrameRateRange } 384 * @readonly 385 * @syscap SystemCapability.Multimedia.Camera.Core 386 * @since 10 387 */ 388 /** 389 * Frame rate range, in fps (frames per second). 390 * 391 * @type { FrameRateRange } 392 * @readonly 393 * @syscap SystemCapability.Multimedia.Camera.Core 394 * @atomicservice 395 * @since 19 396 */ 397 readonly frameRateRange: FrameRateRange; 398 } 399 400 /** 401 * Camera output capability. 402 * 403 * @typedef CameraOutputCapability 404 * @syscap SystemCapability.Multimedia.Camera.Core 405 * @since 10 406 */ 407 /** 408 * Camera output capability. 409 * 410 * @typedef CameraOutputCapability 411 * @syscap SystemCapability.Multimedia.Camera.Core 412 * @atomicservice 413 * @since 19 414 */ 415 interface CameraOutputCapability { 416 /** 417 * Preview profiles. 418 * 419 * @type { Array<Profile> } 420 * @readonly 421 * @syscap SystemCapability.Multimedia.Camera.Core 422 * @since 10 423 */ 424 /** 425 * Preview profiles. 426 * 427 * @type { Array<Profile> } 428 * @readonly 429 * @syscap SystemCapability.Multimedia.Camera.Core 430 * @atomicservice 431 * @since 19 432 */ 433 readonly previewProfiles: Array<Profile>; 434 435 /** 436 * Photo profiles. 437 * 438 * @type { Array<Profile> } 439 * @readonly 440 * @syscap SystemCapability.Multimedia.Camera.Core 441 * @since 10 442 */ 443 /** 444 * Photo profiles. 445 * 446 * @type { Array<Profile> } 447 * @readonly 448 * @syscap SystemCapability.Multimedia.Camera.Core 449 * @atomicservice 450 * @since 19 451 */ 452 readonly photoProfiles: Array<Profile>; 453 454 /** 455 * Video profiles. 456 * 457 * @type { Array<VideoProfile> } 458 * @readonly 459 * @syscap SystemCapability.Multimedia.Camera.Core 460 * @since 10 461 */ 462 /** 463 * Video profiles. 464 * 465 * @type { Array<VideoProfile> } 466 * @readonly 467 * @syscap SystemCapability.Multimedia.Camera.Core 468 * @atomicservice 469 * @since 19 470 */ 471 readonly videoProfiles: Array<VideoProfile>; 472 473 /** 474 * Depth profiles. 475 * 476 * @type { Array<DepthProfile> } 477 * @readonly 478 * @syscap SystemCapability.Multimedia.Camera.Core 479 * @systemapi 480 * @since 13 481 */ 482 readonly depthProfiles: Array<DepthProfile>; 483 484 /** 485 * All the supported metadata Object Types. 486 * 487 * @type { Array<MetadataObjectType> } 488 * @readonly 489 * @syscap SystemCapability.Multimedia.Camera.Core 490 * @since 10 491 */ 492 /** 493 * All the supported metadata Object Types. 494 * 495 * @type { Array<MetadataObjectType> } 496 * @readonly 497 * @syscap SystemCapability.Multimedia.Camera.Core 498 * @atomicservice 499 * @since 19 500 */ 501 readonly supportedMetadataObjectTypes: Array<MetadataObjectType>; 502 } 503 504 /** 505 * Control center status info. 506 * 507 * @typedef ControlCenterStatusInfo 508 * @syscap SystemCapability.Multimedia.Camera.Core 509 * @atomicservice 510 * @since 20 511 */ 512 interface ControlCenterStatusInfo { 513 /** 514 * Control center effect type. 515 * 516 * @type { ControlCenterEffectType } 517 * @readonly 518 * @syscap SystemCapability.Multimedia.Camera.Core 519 * @atomicservice 520 * @since 20 521 */ 522 readonly effectType: ControlCenterEffectType; 523 524 /** 525 * If effect type is active. 526 * 527 * @type { boolean } 528 * @readonly 529 * @syscap SystemCapability.Multimedia.Camera.Core 530 * @atomicservice 531 * @since 20 532 */ 533 readonly isActive: boolean; 534 } 535 536 /** 537 * Enum for camera error code. 538 * 539 * @enum { number } 540 * @syscap SystemCapability.Multimedia.Camera.Core 541 * @since 10 542 */ 543 /** 544 * Enum for camera error code. 545 * 546 * @enum { number } 547 * @syscap SystemCapability.Multimedia.Camera.Core 548 * @atomicservice 549 * @since 19 550 */ 551 enum CameraErrorCode { 552 /** 553 * Parameter missing or parameter type incorrect. 554 * 555 * @syscap SystemCapability.Multimedia.Camera.Core 556 * @since 10 557 */ 558 /** 559 * Parameter missing or parameter type incorrect. 560 * 561 * @syscap SystemCapability.Multimedia.Camera.Core 562 * @atomicservice 563 * @since 19 564 */ 565 INVALID_ARGUMENT = 7400101, 566 567 /** 568 * Operation not allowed. 569 * 570 * @syscap SystemCapability.Multimedia.Camera.Core 571 * @since 10 572 */ 573 /** 574 * Operation not allowed. 575 * 576 * @syscap SystemCapability.Multimedia.Camera.Core 577 * @atomicservice 578 * @since 19 579 */ 580 OPERATION_NOT_ALLOWED = 7400102, 581 582 /** 583 * Session not config. 584 * 585 * @syscap SystemCapability.Multimedia.Camera.Core 586 * @since 10 587 */ 588 /** 589 * Session not config. 590 * 591 * @syscap SystemCapability.Multimedia.Camera.Core 592 * @atomicservice 593 * @since 19 594 */ 595 SESSION_NOT_CONFIG = 7400103, 596 597 /** 598 * Session not running. 599 * 600 * @syscap SystemCapability.Multimedia.Camera.Core 601 * @since 10 602 */ 603 /** 604 * Session not running. 605 * 606 * @syscap SystemCapability.Multimedia.Camera.Core 607 * @atomicservice 608 * @since 19 609 */ 610 SESSION_NOT_RUNNING = 7400104, 611 612 /** 613 * Session config locked. 614 * 615 * @syscap SystemCapability.Multimedia.Camera.Core 616 * @since 10 617 */ 618 /** 619 * Session config locked. 620 * 621 * @syscap SystemCapability.Multimedia.Camera.Core 622 * @atomicservice 623 * @since 19 624 */ 625 SESSION_CONFIG_LOCKED = 7400105, 626 627 /** 628 * Device setting locked. 629 * 630 * @syscap SystemCapability.Multimedia.Camera.Core 631 * @since 10 632 */ 633 /** 634 * Device setting locked. 635 * 636 * @syscap SystemCapability.Multimedia.Camera.Core 637 * @atomicservice 638 * @since 19 639 */ 640 DEVICE_SETTING_LOCKED = 7400106, 641 642 /** 643 * Can not use camera cause of conflict. 644 * 645 * @syscap SystemCapability.Multimedia.Camera.Core 646 * @since 10 647 */ 648 /** 649 * Can not use camera cause of conflict. 650 * 651 * @syscap SystemCapability.Multimedia.Camera.Core 652 * @atomicservice 653 * @since 19 654 */ 655 CONFLICT_CAMERA = 7400107, 656 657 /** 658 * Camera disabled cause of security reason. 659 * 660 * @syscap SystemCapability.Multimedia.Camera.Core 661 * @since 10 662 */ 663 /** 664 * Camera disabled cause of security reason. 665 * 666 * @syscap SystemCapability.Multimedia.Camera.Core 667 * @atomicservice 668 * @since 19 669 */ 670 DEVICE_DISABLED = 7400108, 671 672 /** 673 * Can not use camera cause of preempted. 674 * 675 * @syscap SystemCapability.Multimedia.Camera.Core 676 * @since 10 677 */ 678 /** 679 * Can not use camera cause of preempted. 680 * 681 * @syscap SystemCapability.Multimedia.Camera.Core 682 * @atomicservice 683 * @since 19 684 */ 685 DEVICE_PREEMPTED = 7400109, 686 687 /** 688 * Unresolved conflicts with current configurations. 689 * 690 * @syscap SystemCapability.Multimedia.Camera.Core 691 * @since 12 692 */ 693 /** 694 * Unresolved conflicts with current configurations. 695 * 696 * @syscap SystemCapability.Multimedia.Camera.Core 697 * @atomicservice 698 * @since 19 699 */ 700 UNRESOLVED_CONFLICTS_WITH_CURRENT_CONFIGURATIONS = 7400110, 701 702 /** 703 * Camera frequently switched. 704 * 705 * @syscap SystemCapability.Multimedia.Camera.Core 706 * @systemapi 707 * @since 18 708 */ 709 DEVICE_FREQUENTLY_SWITCHED = 7400111, 710 711 /** 712 * Camera lens retracted. 713 * 714 * @syscap SystemCapability.Multimedia.Camera.Core 715 * @systemapi 716 * @since 18 717 */ 718 CAMERA_LENS_RETRACTED = 7400112, 719 720 /** 721 * Camera service fatal error. 722 * 723 * @syscap SystemCapability.Multimedia.Camera.Core 724 * @since 10 725 */ 726 /** 727 * Camera service fatal error. 728 * 729 * @syscap SystemCapability.Multimedia.Camera.Core 730 * @atomicservice 731 * @since 19 732 */ 733 SERVICE_FATAL_ERROR = 7400201 734 } 735 736 /** 737 * Enum for restore parameter. 738 * 739 * @enum { number } 740 * @syscap SystemCapability.Multimedia.Camera.Core 741 * @systemapi 742 * @since 11 743 */ 744 enum RestoreParamType { 745 /** 746 * No need set restore Stream Parameter, only prelaunch camera device. 747 * 748 * @syscap SystemCapability.Multimedia.Camera.Core 749 * @systemapi 750 * @since 11 751 */ 752 NO_NEED_RESTORE_PARAM = 0, 753 754 /** 755 * Presistent default parameter, long-lasting effect after T minutes. 756 * 757 * @syscap SystemCapability.Multimedia.Camera.Core 758 * @systemapi 759 * @since 11 760 */ 761 PRESISTENT_DEFAULT_PARAM = 1, 762 763 /** 764 * Transient active parameter, which has a higher priority than PRESISTENT_DEFAULT_PARAM when both exist. 765 * 766 * @syscap SystemCapability.Multimedia.Camera.Core 767 * @systemapi 768 * @since 11 769 */ 770 TRANSIENT_ACTIVE_PARAM = 2 771 } 772 773 /** 774 * Setting parameter for stream. 775 * 776 * @typedef SettingParam 777 * @syscap SystemCapability.Multimedia.Camera.Core 778 * @systemapi 779 * @since 11 780 */ 781 interface SettingParam { 782 /** 783 * Skin smooth level value for restore. 784 * 785 * @type { number } 786 * @syscap SystemCapability.Multimedia.Camera.Core 787 * @systemapi 788 * @since 11 789 */ 790 skinSmoothLevel: number; 791 792 /** 793 * Face slender value for restore. 794 * 795 * @type { number } 796 * @syscap SystemCapability.Multimedia.Camera.Core 797 * @systemapi 798 * @since 11 799 */ 800 faceSlender: number; 801 802 /** 803 * Skin tone value for restore. 804 * 805 * @type { number } 806 * @syscap SystemCapability.Multimedia.Camera.Core 807 * @systemapi 808 * @since 11 809 */ 810 skinTone: number; 811 } 812 813 /** 814 * Prelaunch config object. 815 * 816 * @typedef PrelaunchConfig 817 * @syscap SystemCapability.Multimedia.Camera.Core 818 * @systemapi 819 * @since 10 820 */ 821 interface PrelaunchConfig { 822 /** 823 * Camera instance. 824 * 825 * @type { CameraDevice } 826 * @syscap SystemCapability.Multimedia.Camera.Core 827 * @systemapi 828 * @since 10 829 */ 830 cameraDevice: CameraDevice; 831 832 /** 833 * Restore parameter type. 834 * 835 * @type { ?RestoreParamType } 836 * @syscap SystemCapability.Multimedia.Camera.Core 837 * @systemapi 838 * @since 11 839 */ 840 restoreParamType?: RestoreParamType; 841 842 /** 843 * Begin active time. 844 * 845 * @type { ?number } 846 * @syscap SystemCapability.Multimedia.Camera.Core 847 * @systemapi 848 * @since 11 849 */ 850 activeTime?: number; 851 852 /** 853 * Setting parameter. 854 * 855 * @type { ?SettingParam } 856 * @syscap SystemCapability.Multimedia.Camera.Core 857 * @systemapi 858 * @since 11 859 */ 860 settingParam?: SettingParam; 861 } 862 863 /** 864 * Camera manager object. 865 * 866 * @interface CameraManager 867 * @syscap SystemCapability.Multimedia.Camera.Core 868 * @since 10 869 */ 870 /** 871 * Camera Manager class, the camera manager instance needs to be get from the getCameraManager interface before using it. 872 * 873 * @interface CameraManager 874 * @syscap SystemCapability.Multimedia.Camera.Core 875 * @atomicservice 876 * @since 19 877 */ 878 interface CameraManager { 879 /** 880 * Gets supported camera descriptions. 881 * 882 * @returns { Array<CameraDevice> } An array of supported cameras. 883 * @syscap SystemCapability.Multimedia.Camera.Core 884 * @since 10 885 */ 886 /** 887 * Gets the supported camera device objects and return the results synchronously. 888 * 889 * @returns { Array<CameraDevice> } An array of supported cameras. 890 * @syscap SystemCapability.Multimedia.Camera.Core 891 * @atomicservice 892 * @since 19 893 */ 894 getSupportedCameras(): Array<CameraDevice>; 895 896 /** 897 * Queries the output capability supported by the camera device in the specified mode and returns the result synchronously. 898 * 899 * @param { CameraDevice } camera - Camera device. 900 * @returns { CameraOutputCapability } The camera output capability. 901 * @syscap SystemCapability.Multimedia.Camera.Core 902 * @since 10 903 * @deprecated since 11 904 * @useinstead ohos.multimedia.camera.CameraManager#getSupportedOutputCapability 905 */ 906 getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability; 907 908 /** 909 * Gets supported scene mode for specific camera. 910 * 911 * @param { CameraDevice } camera - Camera device. 912 * @returns { Array<SceneMode> } An array of supported scene mode of camera. 913 * @syscap SystemCapability.Multimedia.Camera.Core 914 * @since 11 915 */ 916 /** 917 * Gets supported scene mode for specific camera. 918 * 919 * @param { CameraDevice } camera - Camera device, obtained through the getSupportedCameras interface. 920 * An error code will be returned if there is an exception in parameter passing. 921 * @returns { Array<SceneMode> } An array of supported scene mode of camera. 922 * @syscap SystemCapability.Multimedia.Camera.Core 923 * @atomicservice 924 * @since 19 925 */ 926 getSupportedSceneModes(camera: CameraDevice): Array<SceneMode>; 927 928 /** 929 * Gets supported output capability for specific camera. 930 * 931 * @param { CameraDevice } camera - Camera device. 932 * @param { SceneMode } mode - Scene mode. 933 * @returns { CameraOutputCapability } The camera output capability. 934 * @syscap SystemCapability.Multimedia.Camera.Core 935 * @since 11 936 */ 937 /** 938 * Gets supported output capability for specific camera. 939 * 940 * @param { CameraDevice } camera - Camera device, obtained through the getSupportedCameras interface. 941 * @param { SceneMode } mode - Scene mode, obtained through the getSupportedSceneModes interface. 942 * @returns { CameraOutputCapability } The camera output capability. 943 * @syscap SystemCapability.Multimedia.Camera.Core 944 * @atomicservice 945 * @since 19 946 */ 947 getSupportedOutputCapability(camera: CameraDevice, mode: SceneMode): CameraOutputCapability; 948 949 /** 950 * Determine whether camera is muted. 951 * 952 * @returns { boolean } Is camera muted. 953 * @syscap SystemCapability.Multimedia.Camera.Core 954 * @since 10 955 */ 956 /** 957 * Queries whether the current camera is muted. 958 * 959 * @returns { boolean } Is camera muted. 960 * @syscap SystemCapability.Multimedia.Camera.Core 961 * @atomicservice 962 * @since 19 963 */ 964 isCameraMuted(): boolean; 965 966 /** 967 * Determine whether camera mute is supported. 968 * 969 * @returns { boolean } Is camera mute supported. 970 * @syscap SystemCapability.Multimedia.Camera.Core 971 * @systemapi 972 * @since 10 973 */ 974 /** 975 * Determine whether camera mute is supported. 976 * 977 * @returns { boolean } Is camera mute supported. 978 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 979 * @syscap SystemCapability.Multimedia.Camera.Core 980 * @systemapi 981 * @since 13 982 */ 983 isCameraMuteSupported(): boolean; 984 985 /** 986 * Mute camera. 987 * 988 * @param { boolean } mute - Mute camera if TRUE, otherwise unmute camera. 989 * @syscap SystemCapability.Multimedia.Camera.Core 990 * @systemapi 991 * @since 10 992 * @deprecated since 12 993 * @useinstead ohos.multimedia.camera.CameraManager#muteCameraPersistent 994 */ 995 muteCamera(mute: boolean): void; 996 997 /** 998 * Mutes or unmutes camera for persistence purpose. 999 * 1000 * @permission ohos.camera.CAMERA_CONTROL 1001 * @param { boolean } mute - Mute camera if TRUE, otherwise unmute camera. 1002 * @param { PolicyType } type - Type for indicating the calling role. 1003 * @throws { BusinessError } 201 - Permission denied. 1004 * @throws { BusinessError } 202 - Not System Application. 1005 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1006 * @syscap SystemCapability.Multimedia.Camera.Core 1007 * @systemapi 1008 * @since 12 1009 */ 1010 muteCameraPersistent(mute: boolean, type: PolicyType): void; 1011 1012 /** 1013 * Creates a CameraInput instance by camera. 1014 * 1015 * @permission ohos.permission.CAMERA 1016 * @param { CameraDevice } camera - Camera device used to create the instance. 1017 * @returns { CameraInput } The CameraInput instance. 1018 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1019 * @syscap SystemCapability.Multimedia.Camera.Core 1020 * @since 10 1021 */ 1022 /** 1023 * Creates a CameraInput instance by camera. 1024 * 1025 * @permission ohos.permission.CAMERA 1026 * @param { CameraDevice } camera - Camera device used to create the instance. 1027 * @returns { CameraInput } The CameraInput instance. 1028 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1029 * @throws { BusinessError } 7400102 - Operation not allowed. 1030 * @throws { BusinessError } 7400201 - Camera service fatal error. 1031 * @syscap SystemCapability.Multimedia.Camera.Core 1032 * @since 12 1033 */ 1034 /** 1035 * Creates a CameraInput instance by camera. 1036 * 1037 * Before using this interface, first through the getSupportedCameras interface to query the current list of camera 1038 * devices supported by the device, the developer needs to be based on specific scenarios to choose the camera device 1039 * that meets the needs of the developer, and then use this interface to create a CameraInput instance. 1040 * 1041 * @permission ohos.permission.CAMERA 1042 * @param { CameraDevice } camera - Camera device used to create the instance. 1043 * @returns { CameraInput } Returns a CameraInput instance. Failure of an interface call returns the corresponding 1044 * error code, which is of type CameraErrorCode. 1045 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1046 * @throws { BusinessError } 7400102 - Operation not allowed. 1047 * @throws { BusinessError } 7400201 - Camera service fatal error. 1048 * @syscap SystemCapability.Multimedia.Camera.Core 1049 * @atomicservice 1050 * @since 19 1051 */ 1052 createCameraInput(camera: CameraDevice): CameraInput; 1053 1054 /** 1055 * Creates a CameraInput instance by camera position and type. 1056 * 1057 * @permission ohos.permission.CAMERA 1058 * @param { CameraPosition } position - Target camera position. 1059 * @param { CameraType } type - Target camera type. 1060 * @returns { CameraInput } The CameraInput instance. 1061 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1062 * @syscap SystemCapability.Multimedia.Camera.Core 1063 * @since 10 1064 */ 1065 /** 1066 * Creates a CameraInput instance by camera position and type. 1067 * 1068 * @permission ohos.permission.CAMERA 1069 * @param { CameraPosition } position - Target camera position. 1070 * @param { CameraType } type - Target camera type. 1071 * @returns { CameraInput } The CameraInput instance. 1072 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1073 * @throws { BusinessError } 7400102 - Operation not allowed. 1074 * @throws { BusinessError } 7400201 - Camera service fatal error. 1075 * @syscap SystemCapability.Multimedia.Camera.Core 1076 * @since 12 1077 */ 1078 /** 1079 * Creates a CameraInput instance by camera position and type. 1080 * 1081 * @permission ohos.permission.CAMERA 1082 * @param { CameraPosition } position - Camera position, first get the supported camera device 1083 * objects through the getSupportedCameras interface, and then get the device position information 1084 * based on the returned camera device objects. 1085 * @param { CameraType } type - camera type, first get the supported camera device object through 1086 * the getSupportedCameras interface, then get the device type information based on the returned 1087 * camera device object. 1088 * @returns { CameraInput } Returns a CameraInput instance. Failure of an interface call returns 1089 * the corresponding error code, which is of type CameraErrorCode. 1090 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1091 * @throws { BusinessError } 7400102 - Operation not allowed. 1092 * @throws { BusinessError } 7400201 - Camera service fatal error. 1093 * @syscap SystemCapability.Multimedia.Camera.Core 1094 * @atomicservice 1095 * @since 19 1096 */ 1097 createCameraInput(position: CameraPosition, type: CameraType): CameraInput; 1098 1099 /** 1100 * Creates a PreviewOutput instance. 1101 * 1102 * @param { Profile } profile - Preview output profile. 1103 * @param { string } surfaceId - Surface object id used in camera photo output. 1104 * @returns { PreviewOutput } The PreviewOutput instance. 1105 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1106 * @syscap SystemCapability.Multimedia.Camera.Core 1107 * @since 10 1108 */ 1109 /** 1110 * Creates a PreviewOutput instance. 1111 * 1112 * @param { Profile } profile - Preview output profile. 1113 * @param { string } surfaceId - Surface object id used in camera photo output. 1114 * @returns { PreviewOutput } The PreviewOutput instance. 1115 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1116 * @throws { BusinessError } 7400201 - Camera service fatal error. 1117 * @syscap SystemCapability.Multimedia.Camera.Core 1118 * @since 12 1119 */ 1120 /** 1121 * Creates a PreviewOutput instance. 1122 * 1123 * @param { Profile } profile - Supported preview configuration information, 1124 * obtained through the getSupportedOutputCapability API. 1125 * @param { string } surfaceId - Surface object id used in camera photo output. 1126 * @returns { PreviewOutput } The PreviewOutput instance. 1127 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1128 * @throws { BusinessError } 7400201 - Camera service fatal error. 1129 * @syscap SystemCapability.Multimedia.Camera.Core 1130 * @atomicservice 1131 * @since 19 1132 */ 1133 createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput; 1134 1135 /** 1136 * Creates a PreviewOutput instance without profile. 1137 * You can use this method to create a preview output instance without a profile, This instance can 1138 * only be used in a preconfiged session. 1139 * 1140 * @param { string } surfaceId - Surface object id used in camera preview output. 1141 * @returns { PreviewOutput } The PreviewOutput instance. 1142 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1143 * @throws { BusinessError } 7400201 - Camera service fatal error. 1144 * @syscap SystemCapability.Multimedia.Camera.Core 1145 * @since 12 1146 */ 1147 /** 1148 * Creates a PreviewOutput instance without profile. 1149 * You can use this method to create a preview output instance without a profile, This instance can 1150 * only be used in a preconfiged session. 1151 * 1152 * @param { string } surfaceId - Surface object id used in camera preview output. 1153 * @returns { PreviewOutput } The PreviewOutput instance. 1154 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1155 * @throws { BusinessError } 7400201 - Camera service fatal error. 1156 * @syscap SystemCapability.Multimedia.Camera.Core 1157 * @atomicservice 1158 * @since 19 1159 */ 1160 createPreviewOutput(surfaceId: string): PreviewOutput; 1161 1162 /** 1163 * Creates a PhotoOutput instance. 1164 * 1165 * @param { Profile } profile - Photo output profile. 1166 * @param { string } surfaceId - Surface object id used in camera photo output. 1167 * @returns { PhotoOutput } The PhotoOutput instance. 1168 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1169 * @syscap SystemCapability.Multimedia.Camera.Core 1170 * @since 10 1171 * @deprecated since 11 1172 * @useinstead ohos.multimedia.camera.CameraManager#createPhotoOutput 1173 */ 1174 createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput; 1175 1176 /** 1177 * Creates a PhotoOutput instance without surfaceId. 1178 * Call PhotoOutput capture interface will give a callback, 1179 * {@link on(type: 'photoAvailable', callback: AsyncCallback<Photo>)} 1180 * 1181 * @param { Profile } profile - Photo output profile. 1182 * @returns { PhotoOutput } The PhotoOutput instance. 1183 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1184 * @syscap SystemCapability.Multimedia.Camera.Core 1185 * @since 11 1186 */ 1187 /** 1188 * Creates a PhotoOutput instance without surfaceId. 1189 * Call PhotoOutput capture interface will give a callback, 1190 * {@link on(type: 'photoAvailable', callback: AsyncCallback<Photo>)} 1191 * You can use this method to create a photo output instance without a profile, This instance can 1192 * only be used in a preconfiged session. 1193 * 1194 * @param { Profile } profile - Photo output profile. 1195 * @returns { PhotoOutput } The PhotoOutput instance. 1196 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1197 * @throws { BusinessError } 7400201 - Camera service fatal error. 1198 * @syscap SystemCapability.Multimedia.Camera.Core 1199 * @since 12 1200 */ 1201 /** 1202 * Creates a PhotoOutput instance without surfaceId. 1203 * Call PhotoOutput capture interface will give a callback, 1204 * {@link on(type: 'photoAvailable', callback: AsyncCallback<Photo>)} 1205 * You can use this method to create a photo output instance without a profile, This instance can 1206 * only be used in a preconfiged session. 1207 * 1208 * @param { Profile } profile - Supported photo configuration information, obtained through the 1209 * getSupportedOutputCapability API. This parameter is mandatory for API version 11. 1210 * Starting from API version 12, if the preconfig API is used for preconfiguration, the 1211 * profile parameter, if specified, will override the settings configured by the preconfig API. 1212 * @returns { PhotoOutput } The PhotoOutput instance. 1213 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1214 * @throws { BusinessError } 7400201 - Camera service fatal error. 1215 * @syscap SystemCapability.Multimedia.Camera.Core 1216 * @atomicservice 1217 * @since 19 1218 */ 1219 createPhotoOutput(profile?: Profile): PhotoOutput; 1220 1221 /** 1222 * Creates a VideoOutput instance. 1223 * 1224 * @param { VideoProfile } profile - Video profile. 1225 * @param { string } surfaceId - Surface object id used in camera video output. 1226 * @returns { VideoOutput } The VideoOutput instance. 1227 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1228 * @syscap SystemCapability.Multimedia.Camera.Core 1229 * @since 10 1230 */ 1231 /** 1232 * Creates a VideoOutput instance. 1233 * 1234 * @param { VideoProfile } profile - Video profile. 1235 * @param { string } surfaceId - Surface object id used in camera video output. 1236 * @returns { VideoOutput } The VideoOutput instance. 1237 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1238 * @throws { BusinessError } 7400201 - Camera service fatal error. 1239 * @syscap SystemCapability.Multimedia.Camera.Core 1240 * @since 12 1241 */ 1242 /** 1243 * Creates a VideoOutput instance. 1244 * 1245 * @param { VideoProfile } profile - Supported recording configuration information, 1246 * obtained through the getSupportedOutputCapability API. 1247 * @param { string } surfaceId - Surface object id used in camera video output. 1248 * @returns { VideoOutput } The VideoOutput instance. 1249 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1250 * @throws { BusinessError } 7400201 - Camera service fatal error. 1251 * @syscap SystemCapability.Multimedia.Camera.Core 1252 * @atomicservice 1253 * @since 19 1254 */ 1255 createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput; 1256 1257 /** 1258 * Creates a VideoOutput instance without profile. 1259 * You can use this method to create a video output instance without a profile, This instance can 1260 * only be used in a preconfiged session. 1261 * 1262 * @param { string } surfaceId - Surface object id used in camera video output. 1263 * @returns { VideoOutput } The VideoOutput instance. 1264 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1265 * @throws { BusinessError } 7400201 - Camera service fatal error. 1266 * @syscap SystemCapability.Multimedia.Camera.Core 1267 * @since 12 1268 */ 1269 /** 1270 * Creates a VideoOutput instance without profile. 1271 * You can use this method to create a video output instance without a profile, This instance can 1272 * only be used in a preconfiged session. 1273 * 1274 * @param { string } surfaceId - Surface object id used in camera video output. 1275 * @returns { VideoOutput } The VideoOutput instance. 1276 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1277 * @throws { BusinessError } 7400201 - Camera service fatal error. 1278 * @syscap SystemCapability.Multimedia.Camera.Core 1279 * @atomicservice 1280 * @since 19 1281 */ 1282 createVideoOutput(surfaceId: string): VideoOutput; 1283 1284 /** 1285 * Creates a MetadataOutput instance. 1286 * 1287 * @param { Array<MetadataObjectType> } metadataObjectTypes - Array of MetadataObjectType. 1288 * @returns { MetadataOutput } The MetadataOutput instance. 1289 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1290 * @syscap SystemCapability.Multimedia.Camera.Core 1291 * @since 10 1292 */ 1293 /** 1294 * Creates a MetadataOutput instance. 1295 * 1296 * @param { Array<MetadataObjectType> } metadataObjectTypes - Array of MetadataObjectType. 1297 * @returns { MetadataOutput } The MetadataOutput instance. 1298 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1299 * @throws { BusinessError } 7400201 - Camera service fatal error. 1300 * @syscap SystemCapability.Multimedia.Camera.Core 1301 * @since 12 1302 */ 1303 /** 1304 * Creates a MetadataOutput instance. 1305 * 1306 * @param { Array<MetadataObjectType> } metadataObjectTypes - Metadata stream type information, 1307 * obtained through the getSupportedOutputCapability API. 1308 * @returns { MetadataOutput } The MetadataOutput instance. 1309 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1310 * @throws { BusinessError } 7400201 - Camera service fatal error. 1311 * @syscap SystemCapability.Multimedia.Camera.Core 1312 * @atomicservice 1313 * @since 19 1314 */ 1315 createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): MetadataOutput; 1316 1317 /** 1318 * Creates a DepthDataOutput instance. 1319 * 1320 * @param { DepthProfile } profile - Depth data profile. 1321 * @returns { DepthDataOutput } The DepthDataOutput instance. 1322 * @throws { BusinessError } 202 - Not System Application. 1323 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1324 * @syscap SystemCapability.Multimedia.Camera.Core 1325 * @systemapi 1326 * @since 13 1327 */ 1328 createDepthDataOutput(profile: DepthProfile): DepthDataOutput; 1329 1330 /** 1331 * Gets a CaptureSession instance. 1332 * 1333 * @returns { CaptureSession } The CaptureSession instance. 1334 * @throws { BusinessError } 7400201 - Camera service fatal error. 1335 * @syscap SystemCapability.Multimedia.Camera.Core 1336 * @since 10 1337 * @deprecated since 11 1338 * @useinstead ohos.multimedia.camera.CameraManager#createSession 1339 */ 1340 createCaptureSession(): CaptureSession; 1341 1342 /** 1343 * Gets a Session instance by specific scene mode. 1344 * 1345 * @param { SceneMode } mode - Scene mode. 1346 * @returns { T } The specific Session instance by specific scene mode. 1347 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1348 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 1349 * 3. Parameter verification failed. 1350 * @throws { BusinessError } 7400201 - Camera service fatal error. 1351 * @syscap SystemCapability.Multimedia.Camera.Core 1352 * @since 11 1353 */ 1354 /** 1355 * Gets a Session instance by specific scene mode. 1356 * 1357 * @param { SceneMode } mode - The modes supported by the camera. If the passed parameters are 1358 * abnormal (e.g. out of range, passed null or undefined, etc.), the actual interface will not take effect. 1359 * @returns { T } Session instance. Failure of an interface call returns the appropriate error code, 1360 * which is of type CameraErrorCode. 1361 * @throws { BusinessError } 7400101 - Parameter error. Possible causes: 1362 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 1363 * 3. Parameter verification failed. 1364 * @throws { BusinessError } 7400201 - Camera service fatal error. 1365 * @syscap SystemCapability.Multimedia.Camera.Core 1366 * @atomicservice 1367 * @since 19 1368 */ 1369 createSession<T extends Session>(mode: SceneMode): T; 1370 1371 /** 1372 * Queries a specified device based on position and type. 1373 * 1374 * @param { CameraPosition } position - Camera position. 1375 * @param { CameraType } type - Camera type. 1376 * @returns { CameraDevice } A device queried base on position and type. 1377 * @throws { BusinessError } 7400201 - Camera service fatal error. 1378 * @syscap SystemCapability.Multimedia.Camera.Core 1379 * @since 18 1380 */ 1381 /** 1382 * Queries a specified device based on position and type. 1383 * 1384 * @param { CameraPosition } position - Camera position. 1385 * @param { CameraType } type - Camera type. 1386 * @returns { CameraDevice } A device queried base on position and type. 1387 * @throws { BusinessError } 7400201 - Camera service fatal error. 1388 * @syscap SystemCapability.Multimedia.Camera.Core 1389 * @atomicservice 1390 * @since 19 1391 */ 1392 getCameraDevice(position: CameraPosition, type: CameraType): CameraDevice; 1393 1394 /** 1395 * Obtains the concurrent information of specified cameras, 1396 * the empty return means concurrency is not supported. 1397 * 1398 * @param { Array<CameraDevice> } cameras - Set of camera devices to be queried. 1399 * @returns { Array<CameraConcurrentInfo> } Set of queried concurrent information. 1400 * @throws { BusinessError } 7400201 - Camera service fatal error. 1401 * @syscap SystemCapability.Multimedia.Camera.Core 1402 * @since 18 1403 */ 1404 /** 1405 * Obtains the concurrent information of specified cameras, 1406 * the empty return means concurrency is not supported. 1407 * 1408 * @param { Array<CameraDevice> } cameras - Set of camera devices to be queried. 1409 * @returns { Array<CameraConcurrentInfo> } Set of queried concurrent information. 1410 * @throws { BusinessError } 7400201 - Camera service fatal error. 1411 * @syscap SystemCapability.Multimedia.Camera.Core 1412 * @atomicservice 1413 * @since 19 1414 */ 1415 getCameraConcurrentInfos(cameras: Array<CameraDevice>): Array<CameraConcurrentInfo>; 1416 1417 /** 1418 * Subscribes camera status change event callback. 1419 * 1420 * @param { 'cameraStatus' } type - Event type. 1421 * @param { AsyncCallback<CameraStatusInfo> } callback - Callback used to get the camera status change. 1422 * @syscap SystemCapability.Multimedia.Camera.Core 1423 * @since 10 1424 */ 1425 /** 1426 * Camera state callback to get the state change of the camera by registering a callback 1427 * function. This API uses an asynchronous callback to return the result. 1428 * 1429 * Description: Currently, it is not allowed to use off() to unregister the callback 1430 * within the callback method of on(). 1431 * 1432 * @param { 'cameraStatus' } type - Event type. 1433 * @param { AsyncCallback<CameraStatusInfo> } callback - Callback used to get the camera status change. 1434 * @syscap SystemCapability.Multimedia.Camera.Core 1435 * @atomicservice 1436 * @since 19 1437 */ 1438 on(type: 'cameraStatus', callback: AsyncCallback<CameraStatusInfo>): void; 1439 1440 /** 1441 * Unsubscribes from camera status change event callback. 1442 * 1443 * @param { 'cameraStatus' } type - Event type. 1444 * @param { AsyncCallback<CameraStatusInfo> } callback - Callback used to get the camera status change. 1445 * @syscap SystemCapability.Multimedia.Camera.Core 1446 * @since 10 1447 */ 1448 /** 1449 * Unsubscribes from camera status change event callback. 1450 * 1451 * @param { 'cameraStatus' } type - Event type. 1452 * @param { AsyncCallback<CameraStatusInfo> } callback - Callback used to get the camera status change. 1453 * @syscap SystemCapability.Multimedia.Camera.Core 1454 * @atomicservice 1455 * @since 19 1456 */ 1457 off(type: 'cameraStatus', callback?: AsyncCallback<CameraStatusInfo>): void; 1458 1459 /** 1460 * Subscribes fold status change event callback. 1461 * 1462 * @param { 'foldStatusChanged' } type - Event type. 1463 * @param { AsyncCallback<FoldStatusInfo> } callback - Callback used to get the fold status change. 1464 * @syscap SystemCapability.Multimedia.Camera.Core 1465 * @since 12 1466 */ 1467 /** 1468 * Registers a listener for fold state changes. This API uses an asynchronous callback to return the result. 1469 * 1470 * Description: Currently, it is not allowed to use off() to unregister the callback 1471 * within the callback method of on(). 1472 * 1473 * @param { 'foldStatusChanged' } type - Event type. 1474 * @param { AsyncCallback<FoldStatusInfo> } callback - Callback used to get the fold status change. 1475 * @syscap SystemCapability.Multimedia.Camera.Core 1476 * @atomicservice 1477 * @since 19 1478 */ 1479 on(type: 'foldStatusChange', callback: AsyncCallback<FoldStatusInfo>): void; 1480 1481 /** 1482 * Unsubscribes from fold status change event callback. 1483 * 1484 * @param { 'foldStatusChanged' } type - Event type. 1485 * @param { AsyncCallback<FoldStatusInfo> } callback - Callback used to get the fold status change. 1486 * @syscap SystemCapability.Multimedia.Camera.Core 1487 * @since 12 1488 */ 1489 /** 1490 * Unsubscribes from fold status change event callback. 1491 * 1492 * @param { 'foldStatusChanged' } type - Event type. 1493 * @param { AsyncCallback<FoldStatusInfo> } callback - Callback used to get the fold status change. 1494 * @syscap SystemCapability.Multimedia.Camera.Core 1495 * @atomicservice 1496 * @since 19 1497 */ 1498 off(type: 'foldStatusChange', callback?: AsyncCallback<FoldStatusInfo>): void; 1499 1500 /** 1501 * Subscribes camera mute change event callback. 1502 * 1503 * @param { 'cameraMute' } type - Event type. 1504 * @param { AsyncCallback<boolean> } callback - Callback used to get the camera mute change. 1505 * @syscap SystemCapability.Multimedia.Camera.Core 1506 * @systemapi 1507 * @since 10 1508 */ 1509 /** 1510 * Subscribes camera mute change event callback. 1511 * 1512 * @param { 'cameraMute' } type - Event type. 1513 * @param { AsyncCallback<boolean> } callback - Callback used to get the camera mute change. 1514 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1515 * @syscap SystemCapability.Multimedia.Camera.Core 1516 * @systemapi 1517 * @since 13 1518 */ 1519 on(type: 'cameraMute', callback: AsyncCallback<boolean>): void; 1520 1521 /** 1522 * Unsubscribes from camera mute change event callback. 1523 * 1524 * @param { 'cameraMute' } type - Event type. 1525 * @param { AsyncCallback<boolean> } callback - Callback used to get the camera mute change. 1526 * @syscap SystemCapability.Multimedia.Camera.Core 1527 * @systemapi 1528 * @since 10 1529 */ 1530 /** 1531 * Unsubscribes from camera mute change event callback. 1532 * 1533 * @param { 'cameraMute' } type - Event type. 1534 * @param { AsyncCallback<boolean> } callback - Callback used to get the camera mute change. 1535 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1536 * @syscap SystemCapability.Multimedia.Camera.Core 1537 * @systemapi 1538 * @since 13 1539 */ 1540 off(type: 'cameraMute', callback?: AsyncCallback<boolean>): void; 1541 1542 /** 1543 * Subscribes control center status change event callback. 1544 * 1545 * @param { 'controlCenterStatusChange' } type - Event type. 1546 * @param { AsyncCallback<boolean> } callback - Callback used to get the control center status change. 1547 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1548 * @syscap SystemCapability.Multimedia.Camera.Core 1549 * @systemapi 1550 * @since 20 1551 */ 1552 on(type: 'controlCenterStatusChange', callback: AsyncCallback<boolean>): void; 1553 1554 /** 1555 * Unsubscribes control center status change event callback. 1556 * 1557 * @param { 'controlCenterStatusChange' } type - Event type. 1558 * @param { AsyncCallback<boolean> } [callback] - Callback used to get the control center status change. 1559 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1560 * @syscap SystemCapability.Multimedia.Camera.Core 1561 * @systemapi 1562 * @since 20 1563 */ 1564 off(type: 'controlCenterStatusChange', callback?: AsyncCallback<boolean>): void; 1565 1566 /** 1567 * Check if the control center active. 1568 * 1569 * @returns { boolean } this value that specifies whether the control center active. 1570 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1571 * @syscap SystemCapability.Multimedia.Camera.Core 1572 * @systemapi 1573 * @since 20 1574 */ 1575 isControlCenterActive(): boolean; 1576 1577 /** 1578 * Create a ControlCenterSession instance. 1579 * 1580 * @permission ohos.permission.CAMERA_CONTROL 1581 * @returns { ControlCenterSession } the ControlCenterSession instance. 1582 * @throws { BusinessError } 201 - Permission denied. 1583 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1584 * @syscap SystemCapability.Multimedia.Camera.Core 1585 * @systemapi 1586 * @since 20 1587 */ 1588 createControlCenterSession(): ControlCenterSession; 1589 1590 /** 1591 * Determines whether the camera device supports prelaunch. 1592 * This function must be called in prior to the setPrelaunchConfig and prelaunch functions. 1593 * 1594 * @param { CameraDevice } camera - Camera device. 1595 * @returns { boolean } Whether prelaunch is supported. 1596 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1597 * @syscap SystemCapability.Multimedia.Camera.Core 1598 * @systemapi 1599 * @since 10 1600 */ 1601 /** 1602 * Determines whether the camera device supports prelaunch. 1603 * This function must be called in prior to the setPrelaunchConfig and prelaunch functions. 1604 * 1605 * @param { CameraDevice } camera - Camera device. 1606 * @returns { boolean } Whether prelaunch is supported. 1607 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1608 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1609 * @syscap SystemCapability.Multimedia.Camera.Core 1610 * @systemapi 1611 * @since 12 1612 */ 1613 isPrelaunchSupported(camera: CameraDevice): boolean; 1614 1615 /** 1616 * Sets the camera prelaunch configuration. 1617 * The configuration is sent to the camera service when you exit the camera or change the configuration next time. 1618 * 1619 * @permission ohos.permission.CAMERA 1620 * @param { PrelaunchConfig } prelaunchConfig - Prelaunch configuration info. 1621 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1622 * @throws { BusinessError } 7400102 - Operation not allowed. 1623 * @syscap SystemCapability.Multimedia.Camera.Core 1624 * @systemapi 1625 * @since 10 1626 */ 1627 /** 1628 * Sets the camera prelaunch configuration. 1629 * The configuration is sent to the camera service when you exit the camera or change the configuration next time. 1630 * 1631 * @permission ohos.permission.CAMERA 1632 * @param { PrelaunchConfig } prelaunchConfig - Prelaunch configuration info. 1633 * @throws { BusinessError } 202 - Not System Application. 1634 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1635 * @throws { BusinessError } 7400102 - Operation not allowed. 1636 * @throws { BusinessError } 7400201 - Camera service fatal error. 1637 * @syscap SystemCapability.Multimedia.Camera.Core 1638 * @systemapi 1639 * @since 12 1640 */ 1641 setPrelaunchConfig(prelaunchConfig: PrelaunchConfig): void; 1642 1643 /** 1644 * Enable the camera to prelaunch and start. 1645 * This function is called when the user clicks the system camera icon to start the camera application. 1646 * 1647 * @syscap SystemCapability.Multimedia.Camera.Core 1648 * @systemapi 1649 * @since 10 1650 */ 1651 /** 1652 * Enable the camera to prelaunch and start. 1653 * This function is called when the user clicks the system camera icon to start the camera application. 1654 * 1655 * @throws { BusinessError } 202 - Not System Application. 1656 * @syscap SystemCapability.Multimedia.Camera.Core 1657 * @systemapi 1658 * @since 13 1659 */ 1660 prelaunch(): void; 1661 1662 /** 1663 * Prepare the camera resources. 1664 * This function is called when the user touch down the camera switch icon in camera application. 1665 * 1666 * @param { string } cameraId - The camera to prepare. 1667 * @throws { BusinessError } 202 - Not System Application. 1668 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1669 * @syscap SystemCapability.Multimedia.Camera.Core 1670 * @systemapi 1671 * @since 11 1672 */ 1673 /** 1674 * Prepare the camera resources. 1675 * This function is called when the user touch down the camera switch icon in camera application. 1676 * 1677 * @param { string } cameraId - The camera to prepare. 1678 * @throws { BusinessError } 202 - Not System Application. 1679 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1680 * @throws { BusinessError } 7400201 - Camera service fatal error. 1681 * @syscap SystemCapability.Multimedia.Camera.Core 1682 * @systemapi 1683 * @since 12 1684 */ 1685 preSwitchCamera(cameraId: string): void; 1686 1687 /** 1688 * Creates a deferred PreviewOutput instance. 1689 * 1690 * @param { Profile } profile - Preview output profile. 1691 * @returns { PreviewOutput } the PreviewOutput instance. 1692 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1693 * @syscap SystemCapability.Multimedia.Camera.Core 1694 * @systemapi 1695 * @since 10 1696 */ 1697 /** 1698 * Creates a deferred PreviewOutput instance. 1699 * You can use the method to create deferred preview output without profile, then you must add this output 1700 * to a session which already preconfiged. 1701 * 1702 * @param { Profile } profile - Preview output profile. 1703 * @returns { PreviewOutput } the PreviewOutput instance. 1704 * @throws { BusinessError } 202 - Not System Application. 1705 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1706 * @syscap SystemCapability.Multimedia.Camera.Core 1707 * @systemapi 1708 * @since 12 1709 */ 1710 createDeferredPreviewOutput(profile?: Profile): PreviewOutput; 1711 1712 /** 1713 * Check if the device has a torch. 1714 * 1715 * @returns { boolean } this value that specifies whether the device has a torch. 1716 * @syscap SystemCapability.Multimedia.Camera.Core 1717 * @since 11 1718 */ 1719 /** 1720 * Check if the device has a torch. 1721 * 1722 * @returns { boolean } this value that specifies whether the device has a torch. 1723 * @syscap SystemCapability.Multimedia.Camera.Core 1724 * @atomicservice 1725 * @since 19 1726 */ 1727 isTorchSupported(): boolean; 1728 1729 /** 1730 * Check if a specifies torch mode is supported. 1731 * @param { TorchMode } mode - torch mode. 1732 * @returns { boolean } is torch mode supported. 1733 * @syscap SystemCapability.Multimedia.Camera.Core 1734 * @since 11 1735 */ 1736 /** 1737 * Check if a specifies torch mode is supported. 1738 * @param { TorchMode } mode - torch mode. 1739 * @returns { boolean } is torch mode supported. 1740 * @syscap SystemCapability.Multimedia.Camera.Core 1741 * @atomicservice 1742 * @since 19 1743 */ 1744 isTorchModeSupported(mode: TorchMode): boolean; 1745 1746 /** 1747 * Get current torch mode. 1748 * 1749 * @returns { TorchMode } torch mode. 1750 * @syscap SystemCapability.Multimedia.Camera.Core 1751 * @since 11 1752 */ 1753 /** 1754 * Get current torch mode. 1755 * 1756 * @returns { TorchMode } torch mode. 1757 * @syscap SystemCapability.Multimedia.Camera.Core 1758 * @atomicservice 1759 * @since 19 1760 */ 1761 getTorchMode(): TorchMode; 1762 1763 /** 1764 * Set torch mode to the device. 1765 * 1766 * @param { TorchMode } mode - torch mode. 1767 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1768 * @syscap SystemCapability.Multimedia.Camera.Core 1769 * @since 11 1770 */ 1771 /** 1772 * Set torch mode to the device. 1773 * 1774 * @param { TorchMode } mode - torch mode. 1775 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 1776 * @throws { BusinessError } 7400102 - Operation not allowed. 1777 * @throws { BusinessError } 7400201 - Camera service fatal error. 1778 * @syscap SystemCapability.Multimedia.Camera.Core 1779 * @since 12 1780 */ 1781 /** 1782 * Set torch mode to the device. 1783 * 1784 * @param { TorchMode } mode - torch mode. 1785 * @throws { BusinessError } 7400102 - Operation not allowed. 1786 * @throws { BusinessError } 7400201 - Camera service fatal error. 1787 * @syscap SystemCapability.Multimedia.Camera.Core 1788 * @since 18 1789 */ 1790 /** 1791 * Set torch mode to the device. 1792 * 1793 * @param { TorchMode } mode - torch mode. 1794 * @throws { BusinessError } 7400102 - Operation not allowed. 1795 * @throws { BusinessError } 7400201 - Camera service fatal error. 1796 * @syscap SystemCapability.Multimedia.Camera.Core 1797 * @atomicservice 1798 * @since 19 1799 */ 1800 setTorchMode(mode: TorchMode): void; 1801 1802 /** 1803 * Subscribes torch status change event callback. 1804 * 1805 * @param { 'torchStatusChange' } type - Event type 1806 * @param { AsyncCallback<TorchStatusInfo> } callback - Callback used to return the torch status change 1807 * @syscap SystemCapability.Multimedia.Camera.Core 1808 * @since 11 1809 */ 1810 /** 1811 * Registers a listener for flashlight state changes to get flashlight state change by registering 1812 * a callback function. This API uses an asynchronous callback to return the result. 1813 * 1814 * Description: Currently, it is not allowed to use off() to unregister the callback 1815 * within the callback method of on(). 1816 * 1817 * @param { 'torchStatusChange' } type - Event type 1818 * @param { AsyncCallback<TorchStatusInfo> } callback - Callback used to return the torch status change 1819 * @syscap SystemCapability.Multimedia.Camera.Core 1820 * @atomicservice 1821 * @since 19 1822 */ 1823 on(type: 'torchStatusChange', callback: AsyncCallback<TorchStatusInfo>): void; 1824 1825 /** 1826 * Unsubscribes torch status change event callback. 1827 * 1828 * @param { 'torchStatusChange' } type - Event type 1829 * @param { AsyncCallback<TorchStatusInfo> } callback - Callback used to return the torch status change 1830 * @syscap SystemCapability.Multimedia.Camera.Core 1831 * @since 11 1832 */ 1833 /** 1834 * Unsubscribes torch status change event callback. 1835 * 1836 * @param { 'torchStatusChange' } type - Event type 1837 * @param { AsyncCallback<TorchStatusInfo> } callback - Callback used to return the torch status change 1838 * @syscap SystemCapability.Multimedia.Camera.Core 1839 * @atomicservice 1840 * @since 19 1841 */ 1842 off(type: 'torchStatusChange', callback?: AsyncCallback<TorchStatusInfo>): void; 1843 } 1844 1845 /** 1846 * Torch status info. 1847 * 1848 * @typedef TorchStatusInfo 1849 * @syscap SystemCapability.Multimedia.Camera.Core 1850 * @since 11 1851 */ 1852 /** 1853 * Torch status info. 1854 * 1855 * @typedef TorchStatusInfo 1856 * @syscap SystemCapability.Multimedia.Camera.Core 1857 * @atomicservice 1858 * @since 19 1859 */ 1860 interface TorchStatusInfo { 1861 /** 1862 * is torch available 1863 * 1864 * @type { boolean } 1865 * @readonly 1866 * @syscap SystemCapability.Multimedia.Camera.Core 1867 * @since 11 1868 */ 1869 /** 1870 * is torch available 1871 * 1872 * @type { boolean } 1873 * @readonly 1874 * @syscap SystemCapability.Multimedia.Camera.Core 1875 * @atomicservice 1876 * @since 19 1877 */ 1878 readonly isTorchAvailable: boolean; 1879 1880 /** 1881 * is torch active 1882 * 1883 * @type { boolean } 1884 * @readonly 1885 * @syscap SystemCapability.Multimedia.Camera.Core 1886 * @since 11 1887 */ 1888 /** 1889 * Whether the flashlight is activated or not. True means the flashlight is activated, false means the flashlight 1890 * is not activated. 1891 * 1892 * @type { boolean } 1893 * @readonly 1894 * @syscap SystemCapability.Multimedia.Camera.Core 1895 * @atomicservice 1896 * @since 19 1897 */ 1898 readonly isTorchActive: boolean; 1899 1900 /** 1901 * the current torch brightness level. 1902 * 1903 * @type { number } 1904 * @readonly 1905 * @syscap SystemCapability.Multimedia.Camera.Core 1906 * @since 11 1907 */ 1908 /** 1909 * Flashlight brightness level, value range is [0,1], the closer to 1, the brighter it is. 1910 * 1911 * @type { number } 1912 * @readonly 1913 * @syscap SystemCapability.Multimedia.Camera.Core 1914 * @atomicservice 1915 * @since 19 1916 */ 1917 readonly torchLevel: number; 1918 } 1919 1920 /** 1921 * Enum for torch mode. 1922 * 1923 * @enum { number } 1924 * @syscap SystemCapability.Multimedia.Camera.Core 1925 * @since 11 1926 */ 1927 /** 1928 * Enum for torch mode. 1929 * 1930 * @enum { number } 1931 * @syscap SystemCapability.Multimedia.Camera.Core 1932 * @atomicservice 1933 * @since 19 1934 */ 1935 enum TorchMode { 1936 /** 1937 * The device torch is always off. 1938 * 1939 * @syscap SystemCapability.Multimedia.Camera.Core 1940 * @since 11 1941 */ 1942 /** 1943 * The device torch is always off. 1944 * 1945 * @syscap SystemCapability.Multimedia.Camera.Core 1946 * @atomicservice 1947 * @since 19 1948 */ 1949 OFF = 0, 1950 1951 /** 1952 * The device torch is always on. 1953 * 1954 * @syscap SystemCapability.Multimedia.Camera.Core 1955 * @since 11 1956 */ 1957 /** 1958 * The device torch is always on. 1959 * 1960 * @syscap SystemCapability.Multimedia.Camera.Core 1961 * @atomicservice 1962 * @since 19 1963 */ 1964 ON = 1, 1965 1966 /** 1967 * The device continuously monitors light levels and uses the torch when necessary. 1968 * 1969 * @syscap SystemCapability.Multimedia.Camera.Core 1970 * @since 11 1971 */ 1972 /** 1973 * The device continuously monitors light levels and uses the torch when necessary. 1974 * 1975 * @syscap SystemCapability.Multimedia.Camera.Core 1976 * @atomicservice 1977 * @since 19 1978 */ 1979 AUTO = 2 1980 } 1981 1982 /** 1983 * Camera status info. 1984 * 1985 * @typedef CameraStatusInfo 1986 * @syscap SystemCapability.Multimedia.Camera.Core 1987 * @since 10 1988 */ 1989 /** 1990 * An instance of the interface returned by the camera manager's callback that represents camera state information. 1991 * 1992 * @typedef CameraStatusInfo 1993 * @syscap SystemCapability.Multimedia.Camera.Core 1994 * @atomicservice 1995 * @since 19 1996 */ 1997 interface CameraStatusInfo { 1998 /** 1999 * Camera instance. 2000 * 2001 * @type { CameraDevice } 2002 * @syscap SystemCapability.Multimedia.Camera.Core 2003 * @since 10 2004 */ 2005 /** 2006 * Camera instance. 2007 * 2008 * @type { CameraDevice } 2009 * @syscap SystemCapability.Multimedia.Camera.Core 2010 * @atomicservice 2011 * @since 19 2012 */ 2013 camera: CameraDevice; 2014 2015 /** 2016 * Current camera status. 2017 * 2018 * @type { CameraStatus } 2019 * @syscap SystemCapability.Multimedia.Camera.Core 2020 * @since 10 2021 */ 2022 /** 2023 * Current camera status. 2024 * 2025 * @type { CameraStatus } 2026 * @syscap SystemCapability.Multimedia.Camera.Core 2027 * @atomicservice 2028 * @since 19 2029 */ 2030 status: CameraStatus; 2031 } 2032 2033 /** 2034 * Fold status info. 2035 * 2036 * @typedef FoldStatusInfo 2037 * @syscap SystemCapability.Multimedia.Camera.Core 2038 * @since 12 2039 */ 2040 /** 2041 * Fold status info. 2042 * 2043 * @typedef FoldStatusInfo 2044 * @syscap SystemCapability.Multimedia.Camera.Core 2045 * @atomicservice 2046 * @since 19 2047 */ 2048 interface FoldStatusInfo { 2049 /** 2050 * Gets supported camera devices under the current fold status. 2051 * 2052 * @type { Array<CameraDevice> } 2053 * @readonly 2054 * @syscap SystemCapability.Multimedia.Camera.Core 2055 * @since 12 2056 */ 2057 /** 2058 * Gets supported camera devices under the current fold status. 2059 * 2060 * @type { Array<CameraDevice> } 2061 * @readonly 2062 * @syscap SystemCapability.Multimedia.Camera.Core 2063 * @atomicservice 2064 * @since 19 2065 */ 2066 readonly supportedCameras: Array<CameraDevice>; 2067 2068 /** 2069 * Current fold status. 2070 * 2071 * @type { FoldStatus } 2072 * @readonly 2073 * @syscap SystemCapability.Multimedia.Camera.Core 2074 * @since 12 2075 */ 2076 /** 2077 * Current fold status. 2078 * 2079 * @type { FoldStatus } 2080 * @readonly 2081 * @syscap SystemCapability.Multimedia.Camera.Core 2082 * @atomicservice 2083 * @since 19 2084 */ 2085 readonly foldStatus: FoldStatus; 2086 } 2087 2088 /** 2089 * Enum for camera position. 2090 * 2091 * @enum { number } 2092 * @syscap SystemCapability.Multimedia.Camera.Core 2093 * @since 10 2094 */ 2095 /** 2096 * Enum for camera position. 2097 * 2098 * @enum { number } 2099 * @syscap SystemCapability.Multimedia.Camera.Core 2100 * @atomicservice 2101 * @since 12 2102 */ 2103 enum CameraPosition { 2104 /** 2105 * Unspecified position. 2106 * 2107 * @syscap SystemCapability.Multimedia.Camera.Core 2108 * @since 10 2109 */ 2110 /** 2111 * Unspecified position. 2112 * 2113 * @syscap SystemCapability.Multimedia.Camera.Core 2114 * @atomicservice 2115 * @since 12 2116 */ 2117 CAMERA_POSITION_UNSPECIFIED = 0, 2118 2119 /** 2120 * Back position. 2121 * 2122 * @syscap SystemCapability.Multimedia.Camera.Core 2123 * @since 10 2124 */ 2125 /** 2126 * Back position. 2127 * 2128 * @syscap SystemCapability.Multimedia.Camera.Core 2129 * @atomicservice 2130 * @since 12 2131 */ 2132 CAMERA_POSITION_BACK = 1, 2133 2134 /** 2135 * Front position. 2136 * 2137 * @syscap SystemCapability.Multimedia.Camera.Core 2138 * @since 10 2139 */ 2140 /** 2141 * Front position. 2142 * 2143 * @syscap SystemCapability.Multimedia.Camera.Core 2144 * @atomicservice 2145 * @since 12 2146 */ 2147 CAMERA_POSITION_FRONT = 2, 2148 2149 /** 2150 * Camera that is inner position when the device is folded. 2151 * 2152 * @syscap SystemCapability.Multimedia.Camera.Core 2153 * @since 11 2154 */ 2155 /** 2156 * Camera that is inner position when the device is folded. 2157 * 2158 * @syscap SystemCapability.Multimedia.Camera.Core 2159 * @atomicservice 2160 * @since 12 2161 * @deprecated since 12 2162 */ 2163 CAMERA_POSITION_FOLD_INNER = 3 2164 } 2165 2166 /** 2167 * Enum for camera type. 2168 * 2169 * @enum { number } 2170 * @syscap SystemCapability.Multimedia.Camera.Core 2171 * @since 10 2172 */ 2173 /** 2174 * Enum for camera type. 2175 * 2176 * @enum { number } 2177 * @syscap SystemCapability.Multimedia.Camera.Core 2178 * @atomicservice 2179 * @since 19 2180 */ 2181 enum CameraType { 2182 /** 2183 * Default camera type 2184 * 2185 * @syscap SystemCapability.Multimedia.Camera.Core 2186 * @since 10 2187 */ 2188 /** 2189 * Default camera type 2190 * 2191 * @syscap SystemCapability.Multimedia.Camera.Core 2192 * @atomicservice 2193 * @since 19 2194 */ 2195 CAMERA_TYPE_DEFAULT = 0, 2196 2197 /** 2198 * Wide camera 2199 * 2200 * @syscap SystemCapability.Multimedia.Camera.Core 2201 * @since 10 2202 */ 2203 /** 2204 * Wide camera 2205 * 2206 * @syscap SystemCapability.Multimedia.Camera.Core 2207 * @atomicservice 2208 * @since 19 2209 */ 2210 CAMERA_TYPE_WIDE_ANGLE = 1, 2211 2212 /** 2213 * Ultra wide camera 2214 * 2215 * @syscap SystemCapability.Multimedia.Camera.Core 2216 * @since 10 2217 */ 2218 /** 2219 * Ultra wide camera 2220 * 2221 * @syscap SystemCapability.Multimedia.Camera.Core 2222 * @atomicservice 2223 * @since 19 2224 */ 2225 CAMERA_TYPE_ULTRA_WIDE = 2, 2226 2227 /** 2228 * Telephoto camera 2229 * 2230 * @syscap SystemCapability.Multimedia.Camera.Core 2231 * @since 10 2232 */ 2233 /** 2234 * Telephoto camera 2235 * 2236 * @syscap SystemCapability.Multimedia.Camera.Core 2237 * @atomicservice 2238 * @since 19 2239 */ 2240 CAMERA_TYPE_TELEPHOTO = 3, 2241 2242 /** 2243 * True depth camera 2244 * 2245 * @syscap SystemCapability.Multimedia.Camera.Core 2246 * @since 10 2247 */ 2248 /** 2249 * True depth camera 2250 * 2251 * @syscap SystemCapability.Multimedia.Camera.Core 2252 * @atomicservice 2253 * @since 19 2254 */ 2255 CAMERA_TYPE_TRUE_DEPTH = 4 2256 } 2257 2258 /** 2259 * Enum for camera connection type. 2260 * 2261 * @enum { number } 2262 * @syscap SystemCapability.Multimedia.Camera.Core 2263 * @since 10 2264 */ 2265 /** 2266 * Enum for camera connection type. 2267 * 2268 * @enum { number } 2269 * @syscap SystemCapability.Multimedia.Camera.Core 2270 * @atomicservice 2271 * @since 19 2272 */ 2273 enum ConnectionType { 2274 /** 2275 * Built-in camera. 2276 * 2277 * @syscap SystemCapability.Multimedia.Camera.Core 2278 * @since 10 2279 */ 2280 /** 2281 * Built-in camera. 2282 * 2283 * @syscap SystemCapability.Multimedia.Camera.Core 2284 * @atomicservice 2285 * @since 19 2286 */ 2287 CAMERA_CONNECTION_BUILT_IN = 0, 2288 2289 /** 2290 * Camera connected using USB 2291 * 2292 * @syscap SystemCapability.Multimedia.Camera.Core 2293 * @since 10 2294 */ 2295 /** 2296 * Camera connected using USB 2297 * 2298 * @syscap SystemCapability.Multimedia.Camera.Core 2299 * @atomicservice 2300 * @since 19 2301 */ 2302 CAMERA_CONNECTION_USB_PLUGIN = 1, 2303 2304 /** 2305 * Remote camera 2306 * 2307 * @syscap SystemCapability.Multimedia.Camera.Core 2308 * @since 10 2309 */ 2310 /** 2311 * Remote camera 2312 * 2313 * @syscap SystemCapability.Multimedia.Camera.Core 2314 * @atomicservice 2315 * @since 19 2316 */ 2317 CAMERA_CONNECTION_REMOTE = 2 2318 } 2319 2320 /** 2321 * Enum for remote camera device type. 2322 * 2323 * @enum { number } 2324 * @syscap SystemCapability.Multimedia.Camera.Core 2325 * @systemapi 2326 * @since 10 2327 */ 2328 /** 2329 * Enum for remote camera device type. 2330 * 2331 * @enum { number } 2332 * @syscap SystemCapability.Multimedia.Camera.Core 2333 * @since 15 2334 */ 2335 /** 2336 * Enum for remote camera device type. 2337 * 2338 * @enum { number } 2339 * @syscap SystemCapability.Multimedia.Camera.Core 2340 * @atomicservice 2341 * @since 19 2342 */ 2343 enum HostDeviceType { 2344 /** 2345 * Indicates an unknown device camera. 2346 * 2347 * @syscap SystemCapability.Multimedia.Camera.Core 2348 * @systemapi 2349 * @since 10 2350 */ 2351 /** 2352 * Indicates an unknown device camera. 2353 * 2354 * @syscap SystemCapability.Multimedia.Camera.Core 2355 * @since 15 2356 */ 2357 /** 2358 * Indicates an unknown device camera. 2359 * 2360 * @syscap SystemCapability.Multimedia.Camera.Core 2361 * @atomicservice 2362 * @since 19 2363 */ 2364 UNKNOWN_TYPE = 0, 2365 2366 /** 2367 * Indicates a smartphone camera. 2368 * 2369 * @syscap SystemCapability.Multimedia.Camera.Core 2370 * @systemapi 2371 * @since 10 2372 */ 2373 /** 2374 * Indicates a smartphone camera. 2375 * 2376 * @syscap SystemCapability.Multimedia.Camera.Core 2377 * @since 15 2378 */ 2379 /** 2380 * Indicates a smartphone camera. 2381 * 2382 * @syscap SystemCapability.Multimedia.Camera.Core 2383 * @atomicservice 2384 * @since 19 2385 */ 2386 PHONE = 0x0E, 2387 2388 /** 2389 * Indicates a tablet camera. 2390 * 2391 * @syscap SystemCapability.Multimedia.Camera.Core 2392 * @systemapi 2393 * @since 10 2394 */ 2395 /** 2396 * Indicates a tablet camera. 2397 * 2398 * @syscap SystemCapability.Multimedia.Camera.Core 2399 * @since 15 2400 */ 2401 /** 2402 * Indicates a tablet camera. 2403 * 2404 * @syscap SystemCapability.Multimedia.Camera.Core 2405 * @atomicservice 2406 * @since 19 2407 */ 2408 TABLET = 0x11 2409 } 2410 2411 /** 2412 * Camera device object. 2413 * 2414 * @typedef CameraDevice 2415 * @syscap SystemCapability.Multimedia.Camera.Core 2416 * @since 10 2417 */ 2418 /** 2419 * Camera device object. 2420 * 2421 * @typedef CameraDevice 2422 * @syscap SystemCapability.Multimedia.Camera.Core 2423 * @atomicservice 2424 * @since 19 2425 */ 2426 interface CameraDevice { 2427 /** 2428 * Camera id attribute. 2429 * 2430 * @type { string } 2431 * @readonly 2432 * @syscap SystemCapability.Multimedia.Camera.Core 2433 * @since 10 2434 */ 2435 /** 2436 * Camera ID attribute. 2437 * 2438 * @type { string } 2439 * @readonly 2440 * @syscap SystemCapability.Multimedia.Camera.Core 2441 * @atomicservice 2442 * @since 19 2443 */ 2444 readonly cameraId: string; 2445 2446 /** 2447 * Camera position attribute. 2448 * 2449 * @type { CameraPosition } 2450 * @readonly 2451 * @syscap SystemCapability.Multimedia.Camera.Core 2452 * @since 10 2453 */ 2454 /** 2455 * Camera position attribute. 2456 * 2457 * @type { CameraPosition } 2458 * @readonly 2459 * @syscap SystemCapability.Multimedia.Camera.Core 2460 * @atomicservice 2461 * @since 19 2462 */ 2463 readonly cameraPosition: CameraPosition; 2464 2465 /** 2466 * Camera type attribute. 2467 * 2468 * @type { CameraType } 2469 * @readonly 2470 * @syscap SystemCapability.Multimedia.Camera.Core 2471 * @since 10 2472 */ 2473 /** 2474 * Camera type attribute. 2475 * 2476 * @type { CameraType } 2477 * @readonly 2478 * @syscap SystemCapability.Multimedia.Camera.Core 2479 * @atomicservice 2480 * @since 19 2481 */ 2482 readonly cameraType: CameraType; 2483 2484 /** 2485 * Camera connection type attribute. 2486 * 2487 * @type { ConnectionType } 2488 * @readonly 2489 * @syscap SystemCapability.Multimedia.Camera.Core 2490 * @since 10 2491 */ 2492 /** 2493 * Camera connection type attribute. 2494 * 2495 * @type { ConnectionType } 2496 * @readonly 2497 * @syscap SystemCapability.Multimedia.Camera.Core 2498 * @atomicservice 2499 * @since 19 2500 */ 2501 readonly connectionType: ConnectionType; 2502 2503 /** 2504 * Camera remote camera device name attribute. 2505 * 2506 * @type { string } 2507 * @readonly 2508 * @syscap SystemCapability.Multimedia.Camera.Core 2509 * @systemapi 2510 * @since 10 2511 */ 2512 /** 2513 * Camera remote camera device name attribute. 2514 * 2515 * @type { string } 2516 * @readonly 2517 * @syscap SystemCapability.Multimedia.Camera.Core 2518 * @since 15 2519 */ 2520 /** 2521 * Camera remote camera device name attribute. 2522 * 2523 * @type { string } 2524 * @readonly 2525 * @syscap SystemCapability.Multimedia.Camera.Core 2526 * @atomicservice 2527 * @since 19 2528 */ 2529 readonly hostDeviceName: string; 2530 2531 /** 2532 * Camera remote camera device type attribute. 2533 * 2534 * @type { HostDeviceType } 2535 * @readonly 2536 * @syscap SystemCapability.Multimedia.Camera.Core 2537 * @systemapi 2538 * @since 10 2539 */ 2540 /** 2541 * Camera remote camera device type attribute. 2542 * 2543 * @type { HostDeviceType } 2544 * @readonly 2545 * @syscap SystemCapability.Multimedia.Camera.Core 2546 * @since 15 2547 */ 2548 /** 2549 * Camera remote camera device type attribute. 2550 * 2551 * @type { HostDeviceType } 2552 * @readonly 2553 * @syscap SystemCapability.Multimedia.Camera.Core 2554 * @atomicservice 2555 * @since 19 2556 */ 2557 readonly hostDeviceType: HostDeviceType; 2558 2559 /** 2560 * Camera sensor orientation attribute. 2561 * 2562 * @type { number } 2563 * @readonly 2564 * @syscap SystemCapability.Multimedia.Camera.Core 2565 * @since 12 2566 */ 2567 /** 2568 * The camera mounting angle, which does not change with screen rotation, takes values from 0° to 360° in degrees. 2569 * 2570 * @type { number } 2571 * @readonly 2572 * @syscap SystemCapability.Multimedia.Camera.Core 2573 * @atomicservice 2574 * @since 19 2575 */ 2576 readonly cameraOrientation: number; 2577 2578 /** 2579 * Camera device retractable attribute 2580 * 2581 * @type { boolean } 2582 * @readonly 2583 * @syscap SystemCapability.Multimedia.Camera.Core 2584 * @systemapi 2585 * @since 18 2586 */ 2587 readonly isRetractable?: boolean; 2588 2589 /** 2590 * Camera lens equivalent focal length 2591 * 2592 * @type { ?Array<int> } 2593 * @readonly 2594 * @syscap SystemCapability.Multimedia.Camera.Core 2595 * @systemapi 2596 * @since 20 2597 * @arkts 1.1&1.2 2598 */ 2599 readonly lensEquivalentFocalLength?: Array<int>; 2600 } 2601 2602 /** 2603 * Size parameter. 2604 * 2605 * @typedef Size 2606 * @syscap SystemCapability.Multimedia.Camera.Core 2607 * @since 10 2608 */ 2609 /** 2610 * Size parameter. 2611 * 2612 * @typedef Size 2613 * @syscap SystemCapability.Multimedia.Camera.Core 2614 * @atomicservice 2615 * @since 19 2616 */ 2617 interface Size { 2618 /** 2619 * Height. 2620 * 2621 * @type { number } 2622 * @syscap SystemCapability.Multimedia.Camera.Core 2623 * @since 10 2624 */ 2625 /** 2626 * Height. 2627 * 2628 * @type { number } 2629 * @syscap SystemCapability.Multimedia.Camera.Core 2630 * @atomicservice 2631 * @since 19 2632 */ 2633 height: number; 2634 2635 /** 2636 * Width. 2637 * 2638 * @type { number } 2639 * @syscap SystemCapability.Multimedia.Camera.Core 2640 * @since 10 2641 */ 2642 /** 2643 * Width. 2644 * 2645 * @type { number } 2646 * @syscap SystemCapability.Multimedia.Camera.Core 2647 * @atomicservice 2648 * @since 19 2649 */ 2650 width: number; 2651 } 2652 2653 /** 2654 * Point parameter. 2655 * 2656 * @typedef Point 2657 * @syscap SystemCapability.Multimedia.Camera.Core 2658 * @since 10 2659 */ 2660 /** 2661 * Point coordinates are used for focus and exposure configuration. 2662 * 2663 * @typedef Point 2664 * @syscap SystemCapability.Multimedia.Camera.Core 2665 * @atomicservice 2666 * @since 19 2667 */ 2668 interface Point { 2669 /** 2670 * x co-ordinate 2671 * 2672 * @type { number } 2673 * @syscap SystemCapability.Multimedia.Camera.Core 2674 * @since 10 2675 */ 2676 /** 2677 * x co-ordinate 2678 * 2679 * @type { number } 2680 * @syscap SystemCapability.Multimedia.Camera.Core 2681 * @atomicservice 2682 * @since 19 2683 */ 2684 x: number; 2685 2686 /** 2687 * y co-ordinate 2688 * 2689 * @type { number } 2690 * @syscap SystemCapability.Multimedia.Camera.Core 2691 * @since 10 2692 */ 2693 /** 2694 * y co-ordinate 2695 * 2696 * @type { number } 2697 * @syscap SystemCapability.Multimedia.Camera.Core 2698 * @atomicservice 2699 * @since 19 2700 */ 2701 y: number; 2702 } 2703 2704 /** 2705 * Camera input object. 2706 * 2707 * @interface CameraInput 2708 * @syscap SystemCapability.Multimedia.Camera.Core 2709 * @since 10 2710 */ 2711 /** 2712 * Camera input object. 2713 * 2714 * @interface CameraInput 2715 * @syscap SystemCapability.Multimedia.Camera.Core 2716 * @atomicservice 2717 * @since 19 2718 */ 2719 interface CameraInput { 2720 /** 2721 * Open camera. 2722 * 2723 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2724 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 2725 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 2726 * @throws { BusinessError } 7400201 - Camera service fatal error. 2727 * @syscap SystemCapability.Multimedia.Camera.Core 2728 * @since 10 2729 */ 2730 /** 2731 * Open camera. 2732 * 2733 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2734 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 2735 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 2736 * @throws { BusinessError } 7400201 - Camera service fatal error. 2737 * @syscap SystemCapability.Multimedia.Camera.Core 2738 * @atomicservice 2739 * @since 19 2740 */ 2741 open(callback: AsyncCallback<void>): void; 2742 2743 /** 2744 * Open camera. 2745 * 2746 * @returns { Promise<void> } Promise used to return the result. 2747 * @throws { BusinessError } 7400102 - Operation not allowed. 2748 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 2749 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 2750 * @throws { BusinessError } 7400201 - Camera service fatal error. 2751 * @syscap SystemCapability.Multimedia.Camera.Core 2752 * @since 10 2753 */ 2754 /** 2755 * Open camera. 2756 * 2757 * @returns { Promise<void> } Promise used to return the result. 2758 * @throws { BusinessError } 7400102 - Operation not allowed. 2759 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 2760 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 2761 * @throws { BusinessError } 7400201 - Camera service fatal error. 2762 * @syscap SystemCapability.Multimedia.Camera.Core 2763 * @atomicservice 2764 * @since 19 2765 */ 2766 open(): Promise<void>; 2767 2768 /** 2769 * Open camera. 2770 * 2771 * @param { boolean } isSecureEnabled - Enable secure camera. 2772 * @returns { Promise<bigint> } Promise used to return the result. 2773 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 2774 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 2775 * @throws { BusinessError } 7400201 - Camera service fatal error. 2776 * @syscap SystemCapability.Multimedia.Camera.Core 2777 * @since 12 2778 */ 2779 /** 2780 * Open camera. 2781 * 2782 * @param { boolean } isSecureEnabled - Setting true enables the camera to be opened in a safe way, 2783 * setting false does the opposite. Failure of an interface call returns an error code of type CameraErrorCode. 2784 * @returns { Promise<bigint> } Promise used to return the result. 2785 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 2786 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 2787 * @throws { BusinessError } 7400201 - Camera service fatal error. 2788 * @syscap SystemCapability.Multimedia.Camera.Core 2789 * @atomicservice 2790 * @since 19 2791 */ 2792 open(isSecureEnabled: boolean): Promise<bigint>; 2793 2794 /** 2795 * Open camera with specified concurrent type. 2796 * 2797 * @param { CameraConcurrentType } type - Camera concurrent type. 2798 * @returns { Promise<void> } Promise used to return the result. 2799 * @throws { BusinessError } 7400102 - Operation not allowed. 2800 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 2801 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 2802 * @throws { BusinessError } 7400201 - Camera service fatal error. 2803 * @syscap SystemCapability.Multimedia.Camera.Core 2804 * @since 18 2805 */ 2806 /** 2807 * Open camera with specified concurrent type. 2808 * 2809 * @param { CameraConcurrentType } type - Camera concurrent type. 2810 * @returns { Promise<void> } Promise used to return the result. 2811 * @throws { BusinessError } 7400102 - Operation not allowed. 2812 * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. 2813 * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. 2814 * @throws { BusinessError } 7400201 - Camera service fatal error. 2815 * @syscap SystemCapability.Multimedia.Camera.Core 2816 * @atomicservice 2817 * @since 19 2818 */ 2819 open(type: CameraConcurrentType): Promise<void>; 2820 2821 /** 2822 * Close camera. 2823 * 2824 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2825 * @throws { BusinessError } 7400201 - Camera service fatal error. 2826 * @syscap SystemCapability.Multimedia.Camera.Core 2827 * @since 10 2828 */ 2829 /** 2830 * Close camera. 2831 * 2832 * @param { AsyncCallback<void> } callback - Callback used to return the result. 2833 * @throws { BusinessError } 7400201 - Camera service fatal error. 2834 * @syscap SystemCapability.Multimedia.Camera.Core 2835 * @atomicservice 2836 * @since 19 2837 */ 2838 close(callback: AsyncCallback<void>): void; 2839 2840 /** 2841 * Close camera. 2842 * 2843 * @returns { Promise<void> } Promise used to return the result. 2844 * @throws { BusinessError } 7400201 - Camera service fatal error. 2845 * @syscap SystemCapability.Multimedia.Camera.Core 2846 * @since 10 2847 */ 2848 /** 2849 * Close camera. 2850 * 2851 * @returns { Promise<void> } Promise used to return the result. 2852 * @throws { BusinessError } 7400201 - Camera service fatal error. 2853 * @syscap SystemCapability.Multimedia.Camera.Core 2854 * @atomicservice 2855 * @since 19 2856 */ 2857 close(): Promise<void>; 2858 2859 /** 2860 * Delay close camera. 2861 * 2862 * @param { number } time - delay time for turning off camera. 2863 * @returns { Promise<void> } Promise used to return the result. 2864 * @throws { BusinessError } 202 - Not System Application. 2865 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2866 * @throws { BusinessError } 7400201 - Camera service fatal error. 2867 * @syscap SystemCapability.Multimedia.Camera.Core 2868 * @systemapi 2869 * @since 18 2870 */ 2871 closeDelayed(time: number): Promise<void>; 2872 2873 /** 2874 * Subscribes to error events. 2875 * 2876 * @param { 'error' } type - Event type. 2877 * @param { CameraDevice } camera - Camera device. 2878 * @param { ErrorCallback } callback - Callback used to get the camera input errors. 2879 * @syscap SystemCapability.Multimedia.Camera.Core 2880 * @since 10 2881 */ 2882 /** 2883 * Registers a listener for CameraInput error events to get the result by registering 2884 * a callback function. This API uses an asynchronous callback to return the result. 2885 * 2886 * Description: Currently, it is not allowed to use off() to unregister the callback 2887 * within the callback method of on(). 2888 * 2889 * @param { 'error' } type - Event type. 2890 * @param { CameraDevice } camera - Camera device. 2891 * @param { ErrorCallback } callback - Callback used to get the camera input errors. 2892 * @syscap SystemCapability.Multimedia.Camera.Core 2893 * @atomicservice 2894 * @since 19 2895 */ 2896 on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; 2897 2898 /** 2899 * Unsubscribes from error events. 2900 * 2901 * @param { 'error' } type - Event type. 2902 * @param { CameraDevice } camera - Camera device. 2903 * @param { ErrorCallback } callback - Callback used to get the camera input errors. 2904 * @syscap SystemCapability.Multimedia.Camera.Core 2905 * @since 10 2906 */ 2907 /** 2908 * Unsubscribes from error events. 2909 * 2910 * @param { 'error' } type - Event type. 2911 * @param { CameraDevice } camera - Camera device. 2912 * @param { ErrorCallback } callback - Callback used to get the camera input errors. 2913 * @syscap SystemCapability.Multimedia.Camera.Core 2914 * @atomicservice 2915 * @since 19 2916 */ 2917 off(type: 'error', camera: CameraDevice, callback?: ErrorCallback): void; 2918 2919 /** 2920 * Subscribes to camera occlusion detection results. 2921 * 2922 * @param { 'cameraOcclusionDetection' } type - Event type. 2923 * @param { AsyncCallback<CameraOcclusionDetectionResult> } callback - Callback used to get detection results. 2924 * @throws { BusinessError } 202 - Not System Application. 2925 * @syscap SystemCapability.Multimedia.Camera.Core 2926 * @systemapi 2927 * @since 12 2928 */ 2929 on(type: 'cameraOcclusionDetection', callback: AsyncCallback<CameraOcclusionDetectionResult>): void; 2930 2931 /** 2932 * Unsubscribes from camera occlusion detection results. 2933 * 2934 * @param { 'cameraOcclusionDetection' } type - Event type. 2935 * @param { AsyncCallback<CameraOcclusionDetectionResult> } callback - Callback used to get detection results. 2936 * @throws { BusinessError } 202 - Not System Application. 2937 * @syscap SystemCapability.Multimedia.Camera.Core 2938 * @systemapi 2939 * @since 12 2940 */ 2941 off(type: 'cameraOcclusionDetection', callback?: AsyncCallback<CameraOcclusionDetectionResult>): void; 2942 2943 /** 2944 * Sets the camera to be used as a camera at the specified position. 2945 * 2946 * @param { CameraPosition } position - The positon used for the camera. 2947 * @throws { BusinessError } 202 - Not System Application. 2948 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 2949 * @throws { BusinessError } 7400201 - Camera service fatal error. 2950 * @syscap SystemCapability.Multimedia.Camera.Core 2951 * @systemapi 2952 * @since 19 2953 */ 2954 usedAsPosition(position: CameraPosition): void; 2955 2956 /** 2957 * Control auxiliary. 2958 * 2959 * @param { AuxiliaryType } auxiliaryType - Auxiliary type. 2960 * @param { AuxiliaryStatus } auxiliaryStatus - Auxiliary status. 2961 * @returns { Promise<void> } Promise used to return the result. 2962 * @throws { BusinessError } 202 - Not System Application. 2963 * @throws { BusinessError } 7400102 - Operation not allowed. 2964 * @throws { BusinessError } 7400201 - Camera service fatal error. 2965 * @syscap SystemCapability.Multimedia.Camera.Core 2966 * @systemapi 2967 * @since 18 2968 */ 2969 controlAuxiliary(auxiliaryType: AuxiliaryType, auxiliaryStatus: AuxiliaryStatus): Promise<void>; 2970 } 2971 2972 /** 2973 * Enumerates the camera scene modes. 2974 * 2975 * @enum { number } 2976 * @syscap SystemCapability.Multimedia.Camera.Core 2977 * @since 11 2978 */ 2979 /** 2980 * Enumerates the camera scene modes. 2981 * 2982 * @enum { number } 2983 * @syscap SystemCapability.Multimedia.Camera.Core 2984 * @atomicservice 2985 * @since 19 2986 */ 2987 enum SceneMode { 2988 /** 2989 * Normal photo mode. 2990 * 2991 * @syscap SystemCapability.Multimedia.Camera.Core 2992 * @since 11 2993 */ 2994 /** 2995 * Normal photo mode. 2996 * 2997 * @syscap SystemCapability.Multimedia.Camera.Core 2998 * @atomicservice 2999 * @since 19 3000 */ 3001 NORMAL_PHOTO = 1, 3002 3003 /** 3004 * Normal video mode. 3005 * 3006 * @syscap SystemCapability.Multimedia.Camera.Core 3007 * @since 11 3008 */ 3009 /** 3010 * Normal video mode. 3011 * 3012 * @syscap SystemCapability.Multimedia.Camera.Core 3013 * @atomicservice 3014 * @since 19 3015 */ 3016 NORMAL_VIDEO = 2, 3017 3018 /** 3019 * Portrait photo mode. 3020 * 3021 * @syscap SystemCapability.Multimedia.Camera.Core 3022 * @systemapi 3023 * @since 11 3024 */ 3025 PORTRAIT_PHOTO = 3, 3026 3027 /** 3028 * Night photo mode. 3029 * 3030 * @syscap SystemCapability.Multimedia.Camera.Core 3031 * @systemapi 3032 * @since 11 3033 */ 3034 NIGHT_PHOTO = 4, 3035 3036 /** 3037 * Professional photo mode. 3038 * 3039 * @syscap SystemCapability.Multimedia.Camera.Core 3040 * @systemapi 3041 * @since 12 3042 */ 3043 PROFESSIONAL_PHOTO = 5, 3044 3045 /** 3046 * Professional video mode. 3047 * 3048 * @syscap SystemCapability.Multimedia.Camera.Core 3049 * @systemapi 3050 * @since 12 3051 */ 3052 PROFESSIONAL_VIDEO = 6, 3053 3054 /** 3055 * Slow motion video mode. 3056 * 3057 * @syscap SystemCapability.Multimedia.Camera.Core 3058 * @systemapi 3059 * @since 12 3060 */ 3061 SLOW_MOTION_VIDEO = 7, 3062 3063 /** 3064 * Macro photo mode. 3065 * 3066 * @syscap SystemCapability.Multimedia.Camera.Core 3067 * @systemapi 3068 * @since 12 3069 */ 3070 MACRO_PHOTO = 8, 3071 3072 /** 3073 * Macro video mode. 3074 * 3075 * @syscap SystemCapability.Multimedia.Camera.Core 3076 * @systemapi 3077 * @since 12 3078 */ 3079 MACRO_VIDEO = 9, 3080 3081 /** 3082 * Light painting photo mode. 3083 * 3084 * @syscap SystemCapability.Multimedia.Camera.Core 3085 * @systemapi 3086 * @since 12 3087 */ 3088 LIGHT_PAINTING_PHOTO = 10, 3089 3090 /** 3091 * High resolution mode. 3092 * 3093 * @syscap SystemCapability.Multimedia.Camera.Core 3094 * @systemapi 3095 * @since 12 3096 */ 3097 HIGH_RESOLUTION_PHOTO = 11, 3098 3099 /** 3100 * Secure camera mode. 3101 * 3102 * @syscap SystemCapability.Multimedia.Camera.Core 3103 * @since 12 3104 */ 3105 /** 3106 * Secure camera mode. 3107 * 3108 * @syscap SystemCapability.Multimedia.Camera.Core 3109 * @atomicservice 3110 * @since 19 3111 */ 3112 SECURE_PHOTO = 12, 3113 3114 /** 3115 * Quick shot mode. 3116 * 3117 * @syscap SystemCapability.Multimedia.Camera.Core 3118 * @systemapi 3119 * @since 12 3120 */ 3121 QUICK_SHOT_PHOTO = 13, 3122 3123 /** 3124 * Aperture video mode. 3125 * 3126 * @syscap SystemCapability.Multimedia.Camera.Core 3127 * @systemapi 3128 * @since 12 3129 */ 3130 APERTURE_VIDEO = 14, 3131 3132 /** 3133 * Panorama photo camera mode. 3134 * 3135 * @syscap SystemCapability.Multimedia.Camera.Core 3136 * @systemapi 3137 * @since 12 3138 */ 3139 PANORAMA_PHOTO = 15, 3140 3141 /** 3142 * Timelapse photo camera mode. 3143 * 3144 * @syscap SystemCapability.Multimedia.Camera.Core 3145 * @systemapi 3146 * @since 12 3147 */ 3148 TIME_LAPSE_PHOTO = 16, 3149 3150 /** 3151 * Fluorescence photo mode. 3152 * 3153 * @syscap SystemCapability.Multimedia.Camera.Core 3154 * @systemapi 3155 * @since 13 3156 */ 3157 FLUORESCENCE_PHOTO = 17 3158 } 3159 3160 /** 3161 * Enum for camera format type. 3162 * 3163 * @enum { number } 3164 * @syscap SystemCapability.Multimedia.Camera.Core 3165 * @since 10 3166 */ 3167 /** 3168 * Enum for camera format type. 3169 * 3170 * @enum { number } 3171 * @syscap SystemCapability.Multimedia.Camera.Core 3172 * @atomicservice 3173 * @since 19 3174 */ 3175 enum CameraFormat { 3176 /** 3177 * RGBA 8888 Format. 3178 * 3179 * @syscap SystemCapability.Multimedia.Camera.Core 3180 * @since 10 3181 */ 3182 /** 3183 * RGBA 8888 Format. 3184 * 3185 * @syscap SystemCapability.Multimedia.Camera.Core 3186 * @atomicservice 3187 * @since 19 3188 */ 3189 CAMERA_FORMAT_RGBA_8888 = 3, 3190 3191 /** 3192 * Digital negative Format. 3193 * 3194 * @syscap SystemCapability.Multimedia.Camera.Core 3195 * @systemapi 3196 * @since 12 3197 */ 3198 CAMERA_FORMAT_DNG = 4, 3199 3200 /** 3201 * Extreme Digital Format. 3202 * 3203 * @syscap SystemCapability.Multimedia.Camera.Core 3204 * @systemapi 3205 * @since 18 3206 */ 3207 CAMERA_FORMAT_DNG_XDRAW = 5, 3208 3209 /** 3210 * YUV 420 Format. 3211 * 3212 * @syscap SystemCapability.Multimedia.Camera.Core 3213 * @since 10 3214 */ 3215 /** 3216 * YUV 420 Format. 3217 * 3218 * @syscap SystemCapability.Multimedia.Camera.Core 3219 * @atomicservice 3220 * @since 19 3221 */ 3222 CAMERA_FORMAT_YUV_420_SP = 1003, 3223 3224 /** 3225 * JPEG Format. 3226 * 3227 * @syscap SystemCapability.Multimedia.Camera.Core 3228 * @since 10 3229 */ 3230 /** 3231 * JPEG Format. 3232 * 3233 * @syscap SystemCapability.Multimedia.Camera.Core 3234 * @atomicservice 3235 * @since 19 3236 */ 3237 CAMERA_FORMAT_JPEG = 2000, 3238 3239 /** 3240 * YCBCR P010 Format. 3241 * 3242 * @syscap SystemCapability.Multimedia.Camera.Core 3243 * @since 11 3244 */ 3245 /** 3246 * YCBCR P010 Format. 3247 * 3248 * @syscap SystemCapability.Multimedia.Camera.Core 3249 * @atomicservice 3250 * @since 19 3251 */ 3252 CAMERA_FORMAT_YCBCR_P010, 3253 3254 /** 3255 * YCRCB P010 Format. 3256 * 3257 * @syscap SystemCapability.Multimedia.Camera.Core 3258 * @since 11 3259 */ 3260 /** 3261 * YCRCB P010 Format. 3262 * 3263 * @syscap SystemCapability.Multimedia.Camera.Core 3264 * @atomicservice 3265 * @since 19 3266 */ 3267 CAMERA_FORMAT_YCRCB_P010, 3268 3269 /** 3270 * HEIC Format. 3271 * 3272 * @syscap SystemCapability.Multimedia.Camera.Core 3273 * @since 13 3274 */ 3275 /** 3276 * HEIC Format. 3277 * 3278 * @syscap SystemCapability.Multimedia.Camera.Core 3279 * @atomicservice 3280 * @since 19 3281 */ 3282 CAMERA_FORMAT_HEIC = 2003, 3283 3284 /** 3285 * Depth Data Format: float 16. 3286 * 3287 * @syscap SystemCapability.Multimedia.Camera.Core 3288 * @systemapi 3289 * @since 13 3290 */ 3291 CAMERA_FORMAT_DEPTH_16 = 3000, 3292 3293 /** 3294 * Depth Data Format: float 32. 3295 * 3296 * @syscap SystemCapability.Multimedia.Camera.Core 3297 * @systemapi 3298 * @since 13 3299 */ 3300 CAMERA_FORMAT_DEPTH_32 = 3001 3301 } 3302 3303 /** 3304 * Enum for flash mode. 3305 * 3306 * @enum { number } 3307 * @syscap SystemCapability.Multimedia.Camera.Core 3308 * @since 10 3309 */ 3310 /** 3311 * Enum for flash mode. 3312 * 3313 * @enum { number } 3314 * @syscap SystemCapability.Multimedia.Camera.Core 3315 * @atomicservice 3316 * @since 19 3317 */ 3318 enum FlashMode { 3319 /** 3320 * Close mode. 3321 * 3322 * @syscap SystemCapability.Multimedia.Camera.Core 3323 * @since 10 3324 */ 3325 /** 3326 * Close mode. 3327 * 3328 * @syscap SystemCapability.Multimedia.Camera.Core 3329 * @atomicservice 3330 * @since 19 3331 */ 3332 FLASH_MODE_CLOSE = 0, 3333 3334 /** 3335 * Open mode. 3336 * 3337 * @syscap SystemCapability.Multimedia.Camera.Core 3338 * @since 10 3339 */ 3340 /** 3341 * Open mode. 3342 * 3343 * @syscap SystemCapability.Multimedia.Camera.Core 3344 * @atomicservice 3345 * @since 19 3346 */ 3347 FLASH_MODE_OPEN = 1, 3348 3349 /** 3350 * Auto mode. 3351 * 3352 * @syscap SystemCapability.Multimedia.Camera.Core 3353 * @since 10 3354 */ 3355 /** 3356 * Auto mode. 3357 * 3358 * @syscap SystemCapability.Multimedia.Camera.Core 3359 * @atomicservice 3360 * @since 19 3361 */ 3362 FLASH_MODE_AUTO = 2, 3363 3364 /** 3365 * Always open mode. 3366 * 3367 * @syscap SystemCapability.Multimedia.Camera.Core 3368 * @since 10 3369 */ 3370 /** 3371 * Always open mode. 3372 * 3373 * @syscap SystemCapability.Multimedia.Camera.Core 3374 * @atomicservice 3375 * @since 19 3376 */ 3377 FLASH_MODE_ALWAYS_OPEN = 3 3378 } 3379 3380 /** 3381 * LCD Flash Status. 3382 * 3383 * @typedef LcdFlashStatus 3384 * @syscap SystemCapability.Multimedia.Camera.Core 3385 * @systemapi 3386 * @since 12 3387 */ 3388 interface LcdFlashStatus { 3389 /** 3390 * Check whether lcd flash is needed. 3391 * 3392 * @type { boolean } 3393 * @readonly 3394 * @syscap SystemCapability.Multimedia.Camera.Core 3395 * @systemapi 3396 * @since 12 3397 */ 3398 readonly isLcdFlashNeeded: boolean; 3399 3400 /** 3401 * Compensate value for lcd flash. 3402 * 3403 * @type { number } 3404 * @readonly 3405 * @syscap SystemCapability.Multimedia.Camera.Core 3406 * @systemapi 3407 * @since 12 3408 */ 3409 readonly lcdCompensation: number; 3410 } 3411 3412 /** 3413 * Flash Query object. 3414 * 3415 * @interface FlashQuery 3416 * @syscap SystemCapability.Multimedia.Camera.Core 3417 * @since 12 3418 */ 3419 /** 3420 * Flash Query object. 3421 * 3422 * @interface FlashQuery 3423 * @syscap SystemCapability.Multimedia.Camera.Core 3424 * @atomicservice 3425 * @since 19 3426 */ 3427 interface FlashQuery { 3428 /** 3429 * Check if device has flash light. 3430 * 3431 * @returns { boolean } The flash light support status. 3432 * @throws { BusinessError } 7400103 - Session not config. 3433 * @syscap SystemCapability.Multimedia.Camera.Core 3434 * @since 11 3435 */ 3436 /** 3437 * Check if device has flash light. 3438 * Move to FlashQuery interface from Flash since 12. 3439 * 3440 * @returns { boolean } The flash light support status. 3441 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3442 * @syscap SystemCapability.Multimedia.Camera.Core 3443 * @since 12 3444 */ 3445 /** 3446 * Check if device has flash light. 3447 * Move to FlashQuery interface from Flash since 12. 3448 * 3449 * @returns { boolean } The flash light support status. 3450 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3451 * @syscap SystemCapability.Multimedia.Camera.Core 3452 * @atomicservice 3453 * @since 19 3454 */ 3455 hasFlash(): boolean; 3456 3457 /** 3458 * Checks whether a specified flash mode is supported. 3459 * 3460 * @param { FlashMode } flashMode - Flash mode 3461 * @returns { boolean } Is the flash mode supported. 3462 * @throws { BusinessError } 7400103 - Session not config. 3463 * @syscap SystemCapability.Multimedia.Camera.Core 3464 * @since 11 3465 */ 3466 /** 3467 * Checks whether a specified flash mode is supported. 3468 * Move to FlashQuery interface from Flash since 12. 3469 * 3470 * @param { FlashMode } flashMode - Flash mode 3471 * @returns { boolean } Is the flash mode supported. 3472 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3473 * @syscap SystemCapability.Multimedia.Camera.Core 3474 * @since 12 3475 */ 3476 /** 3477 * Checks whether a specified flash mode is supported. 3478 * Move to FlashQuery interface from Flash since 12. 3479 * 3480 * @param { FlashMode } flashMode - Flash mode 3481 * @returns { boolean } Is the flash mode supported. 3482 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3483 * @syscap SystemCapability.Multimedia.Camera.Core 3484 * @atomicservice 3485 * @since 19 3486 */ 3487 isFlashModeSupported(flashMode: FlashMode): boolean; 3488 3489 /** 3490 * Checks whether lcd flash is supported. 3491 * 3492 * @returns { boolean } Is lcd flash supported. 3493 * @throws { BusinessError } 202 - Not System Application. 3494 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3495 * @syscap SystemCapability.Multimedia.Camera.Core 3496 * @systemapi 3497 * @since 12 3498 */ 3499 isLcdFlashSupported(): boolean; 3500 } 3501 3502 /** 3503 * Flash object. 3504 * 3505 * @extends FlashQuery 3506 * @interface Flash 3507 * @syscap SystemCapability.Multimedia.Camera.Core 3508 * @since 11 3509 */ 3510 /** 3511 * Flash object. 3512 * 3513 * @extends FlashQuery 3514 * @interface Flash 3515 * @syscap SystemCapability.Multimedia.Camera.Core 3516 * @atomicservice 3517 * @since 19 3518 */ 3519 interface Flash extends FlashQuery { 3520 /** 3521 * Gets current flash mode. 3522 * 3523 * @returns { FlashMode } The current flash mode. 3524 * @throws { BusinessError } 7400103 - Session not config. 3525 * @syscap SystemCapability.Multimedia.Camera.Core 3526 * @since 11 3527 */ 3528 /** 3529 * Gets current flash mode. 3530 * 3531 * @returns { FlashMode } The current flash mode. 3532 * @throws { BusinessError } 7400103 - Session not config. 3533 * @syscap SystemCapability.Multimedia.Camera.Core 3534 * @atomicservice 3535 * @since 19 3536 */ 3537 getFlashMode(): FlashMode; 3538 3539 /** 3540 * Sets flash mode. 3541 * 3542 * @param { FlashMode } flashMode - Target flash mode. 3543 * @throws { BusinessError } 7400103 - Session not config. 3544 * @syscap SystemCapability.Multimedia.Camera.Core 3545 * @since 11 3546 */ 3547 /** 3548 * Sets flash mode. 3549 * 3550 * @param { FlashMode } flashMode - Target flash mode. 3551 * @throws { BusinessError } 7400103 - Session not config. 3552 * @syscap SystemCapability.Multimedia.Camera.Core 3553 * @atomicservice 3554 * @since 19 3555 */ 3556 setFlashMode(flashMode: FlashMode): void; 3557 3558 /** 3559 * Enable lcd flash. 3560 * 3561 * @param { boolean } enabled - Target lcd flash status. 3562 * @throws { BusinessError } 202 - Not System Application. 3563 * @throws { BusinessError } 7400103 - Session not config. 3564 * @syscap SystemCapability.Multimedia.Camera.Core 3565 * @systemapi 3566 * @since 13 3567 */ 3568 enableLcdFlash(enabled: boolean): void; 3569 } 3570 3571 /** 3572 * Enum for exposure mode. 3573 * 3574 * @enum { number } 3575 * @syscap SystemCapability.Multimedia.Camera.Core 3576 * @since 10 3577 */ 3578 /** 3579 * Enum for exposure mode. 3580 * 3581 * @enum { number } 3582 * @syscap SystemCapability.Multimedia.Camera.Core 3583 * @atomicservice 3584 * @since 19 3585 */ 3586 enum ExposureMode { 3587 /** 3588 * Lock exposure mode. 3589 * 3590 * @syscap SystemCapability.Multimedia.Camera.Core 3591 * @since 10 3592 */ 3593 /** 3594 * Lock exposure mode. 3595 * 3596 * @syscap SystemCapability.Multimedia.Camera.Core 3597 * @atomicservice 3598 * @since 19 3599 */ 3600 EXPOSURE_MODE_LOCKED = 0, 3601 3602 /** 3603 * Auto exposure mode. 3604 * 3605 * @syscap SystemCapability.Multimedia.Camera.Core 3606 * @since 10 3607 */ 3608 /** 3609 * Auto exposure mode. Exposure area center point can be set by AutoExposure.setMeteringPoint interface. 3610 * 3611 * @syscap SystemCapability.Multimedia.Camera.Core 3612 * @atomicservice 3613 * @since 19 3614 */ 3615 EXPOSURE_MODE_AUTO = 1, 3616 3617 /** 3618 * Continuous automatic exposure. 3619 * 3620 * @syscap SystemCapability.Multimedia.Camera.Core 3621 * @since 10 3622 */ 3623 /** 3624 * Continuous automatic exposure. 3625 * 3626 * @syscap SystemCapability.Multimedia.Camera.Core 3627 * @atomicservice 3628 * @since 19 3629 */ 3630 EXPOSURE_MODE_CONTINUOUS_AUTO = 2, 3631 3632 /** 3633 * Manual exposure mode. 3634 * 3635 * @syscap SystemCapability.Multimedia.Camera.Core 3636 * @systemapi 3637 * @since 12 3638 */ 3639 EXPOSURE_MODE_MANUAL = 3 3640 } 3641 3642 /** 3643 * Enum for exposure metering mode. 3644 * 3645 * @enum { number } 3646 * @syscap SystemCapability.Multimedia.Camera.Core 3647 * @systemapi 3648 * @since 12 3649 */ 3650 enum ExposureMeteringMode { 3651 /** 3652 * Matrix metering. 3653 * 3654 * @syscap SystemCapability.Multimedia.Camera.Core 3655 * @systemapi 3656 * @since 12 3657 */ 3658 MATRIX = 0, 3659 3660 /** 3661 * Center metering. 3662 * 3663 * @syscap SystemCapability.Multimedia.Camera.Core 3664 * @systemapi 3665 * @since 12 3666 */ 3667 CENTER = 1, 3668 3669 /** 3670 * Spot metering. 3671 * 3672 * @syscap SystemCapability.Multimedia.Camera.Core 3673 * @systemapi 3674 * @since 12 3675 */ 3676 SPOT = 2 3677 } 3678 3679 /** 3680 * AutoExposureQuery object. 3681 * 3682 * @interface AutoExposureQuery 3683 * @syscap SystemCapability.Multimedia.Camera.Core 3684 * @since 12 3685 */ 3686 /** 3687 * AutoExposureQuery object. 3688 * 3689 * @interface AutoExposureQuery 3690 * @syscap SystemCapability.Multimedia.Camera.Core 3691 * @atomicservice 3692 * @since 19 3693 */ 3694 interface AutoExposureQuery { 3695 /** 3696 * Checks whether a specified exposure mode is supported. 3697 * 3698 * @param { ExposureMode } aeMode - Exposure mode 3699 * @returns { boolean } Is the exposure mode supported. 3700 * @throws { BusinessError } 7400103 - Session not config. 3701 * @syscap SystemCapability.Multimedia.Camera.Core 3702 * @since 11 3703 */ 3704 /** 3705 * Checks whether a specified exposure mode is supported. 3706 * Move to AutoExposureQuery interface from AutoExposure interface since 12. 3707 * 3708 * @param { ExposureMode } aeMode - Exposure mode 3709 * @returns { boolean } Is the exposure mode supported. 3710 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3711 * @syscap SystemCapability.Multimedia.Camera.Core 3712 * @since 12 3713 */ 3714 /** 3715 * Checks whether a specified exposure mode is supported. 3716 * Move to AutoExposureQuery interface from AutoExposure interface since 12. 3717 * 3718 * @param { ExposureMode } aeMode - Exposure mode 3719 * @returns { boolean } Is the exposure mode supported. 3720 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3721 * @syscap SystemCapability.Multimedia.Camera.Core 3722 * @atomicservice 3723 * @since 19 3724 */ 3725 isExposureModeSupported(aeMode: ExposureMode): boolean; 3726 3727 /** 3728 * Query the exposure compensation range. 3729 * 3730 * @returns { Array<number> } The array of compensation range. 3731 * @throws { BusinessError } 7400103 - Session not config. 3732 * @syscap SystemCapability.Multimedia.Camera.Core 3733 * @since 11 3734 */ 3735 /** 3736 * Query the exposure compensation range. 3737 * Move to AutoExposureQuery interface from AutoExposure interface since 12. 3738 * 3739 * @returns { Array<number> } The array of compensation range. 3740 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3741 * @syscap SystemCapability.Multimedia.Camera.Core 3742 * @since 12 3743 */ 3744 /** 3745 * Query the exposure compensation range. 3746 * Move to AutoExposureQuery interface from AutoExposure interface since 12. 3747 * 3748 * @returns { Array<number> } The array of compensation range. 3749 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3750 * @syscap SystemCapability.Multimedia.Camera.Core 3751 * @atomicservice 3752 * @since 19 3753 */ 3754 getExposureBiasRange(): Array<number>; 3755 3756 /** 3757 * Checks whether a specified exposure metering mode is supported. 3758 * 3759 * @param { ExposureMeteringMode } aeMeteringMode - Exposure metering mode 3760 * @returns { boolean } Is the exposure metering mode supported. 3761 * @throws { BusinessError } 202 - Not System Application. 3762 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3763 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3764 * @syscap SystemCapability.Multimedia.Camera.Core 3765 * @systemapi 3766 * @since 12 3767 */ 3768 isExposureMeteringModeSupported(aeMeteringMode: ExposureMeteringMode): boolean; 3769 } 3770 3771 /** 3772 * AutoExposure object. 3773 * 3774 * @extends AutoExposureQuery 3775 * @interface AutoExposure 3776 * @syscap SystemCapability.Multimedia.Camera.Core 3777 * @since 11 3778 */ 3779 /** 3780 * AutoExposure object. 3781 * 3782 * @extends AutoExposureQuery 3783 * @interface AutoExposure 3784 * @syscap SystemCapability.Multimedia.Camera.Core 3785 * @atomicservice 3786 * @since 19 3787 */ 3788 interface AutoExposure extends AutoExposureQuery { 3789 /** 3790 * Gets current exposure mode. 3791 * 3792 * @returns { ExposureMode } The current exposure mode. 3793 * @throws { BusinessError } 7400103 - Session not config. 3794 * @syscap SystemCapability.Multimedia.Camera.Core 3795 * @since 11 3796 */ 3797 /** 3798 * Gets current exposure mode. 3799 * 3800 * @returns { ExposureMode } The current exposure mode. 3801 * @throws { BusinessError } 7400103 - Session not config. 3802 * @syscap SystemCapability.Multimedia.Camera.Core 3803 * @atomicservice 3804 * @since 19 3805 */ 3806 getExposureMode(): ExposureMode; 3807 3808 /** 3809 * Sets Exposure mode. 3810 * 3811 * @param { ExposureMode } aeMode - Exposure mode 3812 * @throws { BusinessError } 7400103 - Session not config. 3813 * @syscap SystemCapability.Multimedia.Camera.Core 3814 * @since 11 3815 */ 3816 /** 3817 * Sets Exposure mode. 3818 * 3819 * @param { ExposureMode } aeMode - Exposure mode 3820 * @throws { BusinessError } 7400102 - Operation not allowed. 3821 * @throws { BusinessError } 7400103 - Session not config. 3822 * @syscap SystemCapability.Multimedia.Camera.Core 3823 * @atomicservice 3824 * @since 19 3825 */ 3826 setExposureMode(aeMode: ExposureMode): void; 3827 3828 /** 3829 * Gets current metering point. 3830 * 3831 * @returns { Point } The current metering point. 3832 * @throws { BusinessError } 7400103 - Session not config. 3833 * @syscap SystemCapability.Multimedia.Camera.Core 3834 * @since 11 3835 */ 3836 /** 3837 * Gets current metering point. 3838 * 3839 * @returns { Point } The current metering point. 3840 * @throws { BusinessError } 7400103 - Session not config. 3841 * @syscap SystemCapability.Multimedia.Camera.Core 3842 * @atomicservice 3843 * @since 19 3844 */ 3845 getMeteringPoint(): Point; 3846 3847 /** 3848 * Set the center point of the metering area. 3849 * 3850 * @param { Point } point - metering point 3851 * @throws { BusinessError } 7400103 - Session not config. 3852 * @syscap SystemCapability.Multimedia.Camera.Core 3853 * @since 11 3854 */ 3855 /** 3856 * Set the center point of the metering area. 3857 * 3858 * @param { Point } point - metering point 3859 * @throws { BusinessError } 7400103 - Session not config. 3860 * @syscap SystemCapability.Multimedia.Camera.Core 3861 * @atomicservice 3862 * @since 19 3863 */ 3864 setMeteringPoint(point: Point): void; 3865 3866 /** 3867 * Set exposure compensation. 3868 * 3869 * @param { number } exposureBias - Exposure compensation 3870 * @throws { BusinessError } 7400103 - Session not config. 3871 * @syscap SystemCapability.Multimedia.Camera.Core 3872 * @since 11 3873 */ 3874 /** 3875 * Set exposure compensation. 3876 * 3877 * @param { number } exposureBias - Exposure compensation 3878 * @throws { BusinessError } 7400102 - Operation not allowed. 3879 * @throws { BusinessError } 7400103 - Session not config. 3880 * @syscap SystemCapability.Multimedia.Camera.Core 3881 * @since 12 3882 */ 3883 /** 3884 * Set exposure compensation. 3885 * 3886 * @param { number } exposureBias - Exposure compensation 3887 * @throws { BusinessError } 7400102 - Operation not allowed. 3888 * @throws { BusinessError } 7400103 - Session not config. 3889 * @syscap SystemCapability.Multimedia.Camera.Core 3890 * @atomicservice 3891 * @since 19 3892 */ 3893 setExposureBias(exposureBias: number): void; 3894 3895 /** 3896 * Query the exposure value. 3897 * 3898 * @returns { number } The exposure value. 3899 * @throws { BusinessError } 7400103 - Session not config. 3900 * @syscap SystemCapability.Multimedia.Camera.Core 3901 * @since 11 3902 */ 3903 /** 3904 * Query the exposure value. 3905 * 3906 * @returns { number } The exposure value. 3907 * @throws { BusinessError } 7400103 - Session not config. 3908 * @syscap SystemCapability.Multimedia.Camera.Core 3909 * @atomicservice 3910 * @since 19 3911 */ 3912 getExposureValue(): number; 3913 3914 /** 3915 * Gets current exposure metering mode. 3916 * 3917 * @returns { ExposureMeteringMode } The current exposure metering mode. 3918 * @throws { BusinessError } 202 - Not System Application. 3919 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3920 * @syscap SystemCapability.Multimedia.Camera.Core 3921 * @systemapi 3922 * @since 12 3923 */ 3924 getExposureMeteringMode(): ExposureMeteringMode; 3925 3926 /** 3927 * Sets exposure metering mode. 3928 * 3929 * @param { ExposureMeteringMode } aeMeteringMode - Exposure metering mode 3930 * @throws { BusinessError } 202 - Not System Application. 3931 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 3932 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 3933 * @syscap SystemCapability.Multimedia.Camera.Core 3934 * @systemapi 3935 * @since 12 3936 */ 3937 setExposureMeteringMode(aeMeteringMode: ExposureMeteringMode): void; 3938 } 3939 3940 /** 3941 * Enum for focus mode. 3942 * 3943 * @enum { number } 3944 * @syscap SystemCapability.Multimedia.Camera.Core 3945 * @since 10 3946 */ 3947 /** 3948 * Enum for focus mode. 3949 * 3950 * @enum { number } 3951 * @syscap SystemCapability.Multimedia.Camera.Core 3952 * @atomicservice 3953 * @since 19 3954 */ 3955 enum FocusMode { 3956 /** 3957 * Manual mode. 3958 * 3959 * @syscap SystemCapability.Multimedia.Camera.Core 3960 * @since 10 3961 */ 3962 /** 3963 * Manual mode. 3964 * 3965 * @syscap SystemCapability.Multimedia.Camera.Core 3966 * @atomicservice 3967 * @since 19 3968 */ 3969 FOCUS_MODE_MANUAL = 0, 3970 3971 /** 3972 * Continuous auto mode. 3973 * 3974 * @syscap SystemCapability.Multimedia.Camera.Core 3975 * @since 10 3976 */ 3977 /** 3978 * Continuous auto mode. 3979 * 3980 * @syscap SystemCapability.Multimedia.Camera.Core 3981 * @atomicservice 3982 * @since 19 3983 */ 3984 FOCUS_MODE_CONTINUOUS_AUTO = 1, 3985 3986 /** 3987 * Auto mode. 3988 * 3989 * @syscap SystemCapability.Multimedia.Camera.Core 3990 * @since 10 3991 */ 3992 /** 3993 * Auto mode. 3994 * 3995 * @syscap SystemCapability.Multimedia.Camera.Core 3996 * @atomicservice 3997 * @since 19 3998 */ 3999 FOCUS_MODE_AUTO = 2, 4000 4001 /** 4002 * Locked mode. 4003 * 4004 * @syscap SystemCapability.Multimedia.Camera.Core 4005 * @since 10 4006 */ 4007 /** 4008 * Locked mode. 4009 * 4010 * @syscap SystemCapability.Multimedia.Camera.Core 4011 * @atomicservice 4012 * @since 19 4013 */ 4014 FOCUS_MODE_LOCKED = 3 4015 } 4016 4017 /** 4018 * Enum for focus state. 4019 * 4020 * @enum { number } 4021 * @syscap SystemCapability.Multimedia.Camera.Core 4022 * @since 10 4023 */ 4024 /** 4025 * Enum for focus state. 4026 * 4027 * @enum { number } 4028 * @syscap SystemCapability.Multimedia.Camera.Core 4029 * @atomicservice 4030 * @since 19 4031 */ 4032 enum FocusState { 4033 /** 4034 * Scan state. 4035 * 4036 * @syscap SystemCapability.Multimedia.Camera.Core 4037 * @since 10 4038 */ 4039 /** 4040 * Scan state. 4041 * 4042 * @syscap SystemCapability.Multimedia.Camera.Core 4043 * @atomicservice 4044 * @since 19 4045 */ 4046 FOCUS_STATE_SCAN = 0, 4047 4048 /** 4049 * Focused state. 4050 * 4051 * @syscap SystemCapability.Multimedia.Camera.Core 4052 * @since 10 4053 */ 4054 /** 4055 * Focused state. 4056 * 4057 * @syscap SystemCapability.Multimedia.Camera.Core 4058 * @atomicservice 4059 * @since 19 4060 */ 4061 FOCUS_STATE_FOCUSED = 1, 4062 4063 /** 4064 * Unfocused state. 4065 * 4066 * @syscap SystemCapability.Multimedia.Camera.Core 4067 * @since 10 4068 */ 4069 /** 4070 * Unfocused state. 4071 * 4072 * @syscap SystemCapability.Multimedia.Camera.Core 4073 * @atomicservice 4074 * @since 19 4075 */ 4076 FOCUS_STATE_UNFOCUSED = 2 4077 } 4078 4079 /** 4080 * Enum for focus range type. 4081 * 4082 * @enum { number } 4083 * @syscap SystemCapability.Multimedia.Camera.Core 4084 * @systemapi 4085 * @since 15 4086 */ 4087 enum FocusRangeType { 4088 /** 4089 * Automatic focus range type. 4090 * 4091 * @syscap SystemCapability.Multimedia.Camera.Core 4092 * @systemapi 4093 * @since 15 4094 */ 4095 AUTO = 0, 4096 4097 /** 4098 * Focus on near objects primarily. 4099 * 4100 * @syscap SystemCapability.Multimedia.Camera.Core 4101 * @systemapi 4102 * @since 15 4103 */ 4104 NEAR = 1 4105 } 4106 4107 /** 4108 * Enum for focus driven type. 4109 * 4110 * @enum { number } 4111 * @syscap SystemCapability.Multimedia.Camera.Core 4112 * @systemapi 4113 * @since 15 4114 */ 4115 enum FocusDrivenType { 4116 /** 4117 * Automatic focus driven type. 4118 * 4119 * @syscap SystemCapability.Multimedia.Camera.Core 4120 * @systemapi 4121 * @since 15 4122 */ 4123 AUTO = 0, 4124 4125 /** 4126 * Face focus driven type. 4127 * 4128 * @syscap SystemCapability.Multimedia.Camera.Core 4129 * @systemapi 4130 * @since 15 4131 */ 4132 FACE = 1 4133 } 4134 4135 /** 4136 * Enum for focus tracking mode. 4137 * 4138 * @enum { number } 4139 * @syscap SystemCapability.Multimedia.Camera.Core 4140 * @systemapi 4141 * @since 15 4142 */ 4143 enum FocusTrackingMode { 4144 /** 4145 * Automatic focus tracking mode. 4146 * 4147 * @syscap SystemCapability.Multimedia.Camera.Core 4148 * @systemapi 4149 * @since 15 4150 */ 4151 AUTO = 0 4152 } 4153 4154 /** 4155 * Focus tracking info. 4156 * 4157 * @typedef FocusTrackingInfo 4158 * @syscap SystemCapability.Multimedia.Camera.Core 4159 * @systemapi 4160 * @since 15 4161 */ 4162 interface FocusTrackingInfo { 4163 /** 4164 * mode of focus tracking. 4165 * 4166 * @type { FocusTrackingMode } 4167 * @syscap SystemCapability.Multimedia.Camera.Core 4168 * @systemapi 4169 * @since 15 4170 */ 4171 trackingMode: FocusTrackingMode; 4172 4173 /** 4174 * region of focus tracking. 4175 * 4176 * @type { Rect } 4177 * @syscap SystemCapability.Multimedia.Camera.Core 4178 * @systemapi 4179 * @since 15 4180 */ 4181 trackingRegion: Rect; 4182 } 4183 4184 /** 4185 * Focus Query object. 4186 * 4187 * @interface FocusQuery 4188 * @syscap SystemCapability.Multimedia.Camera.Core 4189 * @since 12 4190 */ 4191 /** 4192 * Focus Query object. 4193 * 4194 * @interface FocusQuery 4195 * @syscap SystemCapability.Multimedia.Camera.Core 4196 * @atomicservice 4197 * @since 19 4198 */ 4199 interface FocusQuery { 4200 /** 4201 * Checks whether a specified focus mode is supported. 4202 * 4203 * @param { FocusMode } afMode - Focus mode. 4204 * @returns { boolean } Is the focus mode supported. 4205 * @throws { BusinessError } 7400103 - Session not config. 4206 * @syscap SystemCapability.Multimedia.Camera.Core 4207 * @since 11 4208 */ 4209 /** 4210 * Checks whether a specified focus mode is supported. 4211 * Move to FocusQuery interface from Focus interface since 12. 4212 * 4213 * @param { FocusMode } afMode - Focus mode. 4214 * @returns { boolean } Is the focus mode supported. 4215 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4216 * @syscap SystemCapability.Multimedia.Camera.Core 4217 * @since 12 4218 */ 4219 /** 4220 * Checks whether a specified focus mode is supported. 4221 * Move to FocusQuery interface from Focus interface since 12. 4222 * 4223 * @param { FocusMode } afMode - Focus mode. 4224 * @returns { boolean } Is the focus mode supported. 4225 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4226 * @syscap SystemCapability.Multimedia.Camera.Core 4227 * @atomicservice 4228 * @since 19 4229 */ 4230 isFocusModeSupported(afMode: FocusMode): boolean; 4231 4232 /** 4233 * Checks whether a focus assist is supported. 4234 * 4235 * @returns { boolean } Is the focus assist supported. 4236 * @throws { BusinessError } 202 - Not System Application. 4237 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4238 * @syscap SystemCapability.Multimedia.Camera.Core 4239 * @systemapi 4240 * @since 12 4241 */ 4242 isFocusAssistSupported(): boolean; 4243 4244 /** 4245 * Checks whether a specified focus range type is supported. 4246 * 4247 * @param { FocusRangeType } type - Focus range type. 4248 * @returns { boolean } Is the focus range type supported. 4249 * @throws { BusinessError } 202 - Not System Application. 4250 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4251 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 4252 * 3. Parameter verification failed. 4253 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4254 * @syscap SystemCapability.Multimedia.Camera.Core 4255 * @systemapi 4256 * @since 15 4257 */ 4258 isFocusRangeTypeSupported(type: FocusRangeType): boolean; 4259 4260 /** 4261 * Checks whether a specified focus driven type is supported. 4262 * 4263 * @param { FocusDrivenType } type - Focus driven type. 4264 * @returns { boolean } Is the focus driven type supported. 4265 * @throws { BusinessError } 202 - Not System Application. 4266 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4267 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 4268 * 3. Parameter verification failed. 4269 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4270 * @syscap SystemCapability.Multimedia.Camera.Core 4271 * @systemapi 4272 * @since 15 4273 */ 4274 isFocusDrivenTypeSupported(type: FocusDrivenType): boolean; 4275 } 4276 4277 /** 4278 * Focus object. 4279 * 4280 * @extends FocusQuery 4281 * @interface Focus 4282 * @syscap SystemCapability.Multimedia.Camera.Core 4283 * @since 11 4284 */ 4285 /** 4286 * Focus object. 4287 * 4288 * @extends FocusQuery 4289 * @interface Focus 4290 * @syscap SystemCapability.Multimedia.Camera.Core 4291 * @atomicservice 4292 * @since 19 4293 */ 4294 interface Focus extends FocusQuery { 4295 /** 4296 * Gets current focus mode. 4297 * 4298 * @returns { FocusMode } The current focus mode. 4299 * @throws { BusinessError } 7400103 - Session not config. 4300 * @syscap SystemCapability.Multimedia.Camera.Core 4301 * @since 11 4302 */ 4303 /** 4304 * Gets current focus mode. 4305 * 4306 * @returns { FocusMode } The current focus mode. 4307 * @throws { BusinessError } 7400103 - Session not config. 4308 * @syscap SystemCapability.Multimedia.Camera.Core 4309 * @atomicservice 4310 * @since 19 4311 */ 4312 getFocusMode(): FocusMode; 4313 4314 /** 4315 * Sets focus mode. 4316 * 4317 * @param { FocusMode } afMode - Target focus mode. 4318 * @throws { BusinessError } 7400103 - Session not config. 4319 * @syscap SystemCapability.Multimedia.Camera.Core 4320 * @since 11 4321 */ 4322 /** 4323 * Sets focus mode. 4324 * 4325 * @param { FocusMode } afMode - Target focus mode. 4326 * @throws { BusinessError } 7400103 - Session not config. 4327 * @syscap SystemCapability.Multimedia.Camera.Core 4328 * @atomicservice 4329 * @since 19 4330 */ 4331 setFocusMode(afMode: FocusMode): void; 4332 4333 /** 4334 * Sets focus point. 4335 * 4336 * @param { Point } point - Target focus point. 4337 * @throws { BusinessError } 7400103 - Session not config. 4338 * @syscap SystemCapability.Multimedia.Camera.Core 4339 * @since 11 4340 */ 4341 /** 4342 * Sets focus point. 4343 * 4344 * @param { Point } point - Target focus point. 4345 * @throws { BusinessError } 7400103 - Session not config. 4346 * @syscap SystemCapability.Multimedia.Camera.Core 4347 * @atomicservice 4348 * @since 19 4349 */ 4350 setFocusPoint(point: Point): void; 4351 4352 /** 4353 * Gets current focus point. 4354 * 4355 * @returns { Point } The current focus point. 4356 * @throws { BusinessError } 7400103 - Session not config. 4357 * @syscap SystemCapability.Multimedia.Camera.Core 4358 * @since 11 4359 */ 4360 /** 4361 * Gets current focus point. 4362 * 4363 * @returns { Point } Used to get the current focus. Failure of the interface call will return the 4364 * corresponding error code, which is of type CameraErrorCode. 4365 * @throws { BusinessError } 7400103 - Session not config. 4366 * @syscap SystemCapability.Multimedia.Camera.Core 4367 * @atomicservice 4368 * @since 19 4369 */ 4370 getFocusPoint(): Point; 4371 4372 /** 4373 * Gets current focal length. 4374 * 4375 * @returns { number } The current focal point. 4376 * @throws { BusinessError } 7400103 - Session not config. 4377 * @syscap SystemCapability.Multimedia.Camera.Core 4378 * @since 11 4379 */ 4380 /** 4381 * Gets current focal length. 4382 * 4383 * @returns { number } The current focal point. 4384 * @throws { BusinessError } 7400103 - Session not config. 4385 * @syscap SystemCapability.Multimedia.Camera.Core 4386 * @atomicservice 4387 * @since 19 4388 */ 4389 getFocalLength(): number; 4390 4391 /** 4392 * Gets current focus assist. 4393 * 4394 * @returns { boolean } The current focus assist. 4395 * @throws { BusinessError } 202 - Not System Application. 4396 * @throws { BusinessError } 7400103 - Session not config. 4397 * @syscap SystemCapability.Multimedia.Camera.Core 4398 * @systemapi 4399 * @since 12 4400 */ 4401 getFocusAssist(): boolean; 4402 4403 /** 4404 * Sets focus assist. 4405 * 4406 * @param { boolean } enabled - Enable focus assist if TRUE. 4407 * @throws { BusinessError } 202 - Not System Application. 4408 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4409 * @throws { BusinessError } 7400103 - Session not config. 4410 * @syscap SystemCapability.Multimedia.Camera.Core 4411 * @systemapi 4412 * @since 12 4413 */ 4414 setFocusAssist(enabled: boolean): void; 4415 4416 /** 4417 * Gets current focus range type. 4418 * 4419 * @returns { FocusRangeType } The current focus range type. 4420 * @throws { BusinessError } 202 - Not System Application. 4421 * @throws { BusinessError } 7400103 - Session not config. 4422 * @syscap SystemCapability.Multimedia.Camera.Core 4423 * @systemapi 4424 * @since 15 4425 */ 4426 getFocusRange(): FocusRangeType; 4427 4428 /** 4429 * Sets focus range type. 4430 * 4431 * @param { FocusRangeType } type - Target focus range type. 4432 * @throws { BusinessError } 202 - Not System Application. 4433 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4434 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 4435 * 3. Parameter verification failed. 4436 * @throws { BusinessError } 7400102 - Operation not allowed. 4437 * @throws { BusinessError } 7400103 - Session not config. 4438 * @throws { BusinessError } 7400201 - Camera service fatal error. 4439 * @syscap SystemCapability.Multimedia.Camera.Core 4440 * @systemapi 4441 * @since 15 4442 */ 4443 setFocusRange(type: FocusRangeType): void; 4444 4445 /** 4446 * Gets current focus driven type. 4447 * 4448 * @returns { FocusDrivenType } The current focus driven type. 4449 * @throws { BusinessError } 202 - Not System Application. 4450 * @throws { BusinessError } 7400103 - Session not config. 4451 * @syscap SystemCapability.Multimedia.Camera.Core 4452 * @systemapi 4453 * @since 15 4454 */ 4455 getFocusDriven(): FocusDrivenType; 4456 4457 /** 4458 * Sets focus driven type. 4459 * 4460 * @param { FocusDrivenType } type - Target focus driven type. 4461 * @throws { BusinessError } 202 - Not System Application. 4462 * @throws { BusinessError } 401 - Parameter error. Possible causes: 4463 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 4464 * 3. Parameter verification failed. 4465 * @throws { BusinessError } 7400102 - Operation not allowed. 4466 * @throws { BusinessError } 7400103 - Session not config. 4467 * @throws { BusinessError } 7400201 - Camera service fatal error. 4468 * @syscap SystemCapability.Multimedia.Camera.Core 4469 * @systemapi 4470 * @since 15 4471 */ 4472 setFocusDriven(type: FocusDrivenType): void; 4473 } 4474 4475 /** 4476 * ManualFocus object. 4477 * 4478 * @interface ManualFocus 4479 * @syscap SystemCapability.Multimedia.Camera.Core 4480 * @systemapi 4481 * @since 12 4482 */ 4483 interface ManualFocus { 4484 /** 4485 * Gets current focus distance. 4486 * 4487 * @returns { number } The current focus distance. 4488 * @throws { BusinessError } 202 - Not System Application. 4489 * @throws { BusinessError } 7400103 - Session not config. 4490 * @syscap SystemCapability.Multimedia.Camera.Core 4491 * @systemapi 4492 * @since 12 4493 */ 4494 getFocusDistance(): number; 4495 4496 /** 4497 * Sets focus distance. 4498 * 4499 * @param { number } distance - Focus distance 4500 * @throws { BusinessError } 202 - Not System Application. 4501 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4502 * @throws { BusinessError } 7400103 - Session not config. 4503 * @syscap SystemCapability.Multimedia.Camera.Core 4504 * @systemapi 4505 * @since 12 4506 */ 4507 setFocusDistance(distance: number): void; 4508 } 4509 4510 /** 4511 * Enumerates the camera white balance modes. 4512 * 4513 * @enum { number } 4514 * @syscap SystemCapability.Multimedia.Camera.Core 4515 * @systemapi 4516 * @since 12 4517 */ 4518 /** 4519 * Enumerates the camera white balance modes. 4520 * 4521 * @enum { number } 4522 * @syscap SystemCapability.Multimedia.Camera.Core 4523 * @atomicservice 4524 * @since 20 4525 */ 4526 enum WhiteBalanceMode { 4527 /** 4528 * Automatic white balance mode. 4529 * @syscap SystemCapability.Multimedia.Camera.Core 4530 * @systemapi 4531 * @since 12 4532 */ 4533 /** 4534 * Automatic white balance mode. 4535 * @syscap SystemCapability.Multimedia.Camera.Core 4536 * @atomicservice 4537 * @since 20 4538 */ 4539 AUTO = 0, 4540 4541 /** 4542 * Cloudy white balance mode. 4543 * 4544 * @syscap SystemCapability.Multimedia.Camera.Core 4545 * @systemapi 4546 * @since 12 4547 */ 4548 /** 4549 * Cloudy white balance mode. 4550 * 4551 * @syscap SystemCapability.Multimedia.Camera.Core 4552 * @atomicservice 4553 * @since 20 4554 */ 4555 CLOUDY = 1, 4556 4557 /** 4558 * Incandescent white balance mode. 4559 * 4560 * @syscap SystemCapability.Multimedia.Camera.Core 4561 * @systemapi 4562 * @since 12 4563 */ 4564 /** 4565 * Incandescent white balance mode. 4566 * 4567 * @syscap SystemCapability.Multimedia.Camera.Core 4568 * @atomicservice 4569 * @since 20 4570 */ 4571 INCANDESCENT = 2, 4572 4573 /** 4574 * Fluorescent white balance mode. 4575 * 4576 * @syscap SystemCapability.Multimedia.Camera.Core 4577 * @systemapi 4578 * @since 12 4579 */ 4580 /** 4581 * Fluorescent white balance mode. 4582 * 4583 * @syscap SystemCapability.Multimedia.Camera.Core 4584 * @atomicservice 4585 * @since 20 4586 */ 4587 FLUORESCENT = 3, 4588 4589 /** 4590 * Daylight white balance mode. 4591 * 4592 * @syscap SystemCapability.Multimedia.Camera.Core 4593 * @systemapi 4594 * @since 12 4595 */ 4596 /** 4597 * Daylight white balance mode. 4598 * 4599 * @syscap SystemCapability.Multimedia.Camera.Core 4600 * @atomicservice 4601 * @since 20 4602 */ 4603 DAYLIGHT = 4, 4604 4605 /** 4606 * Manual white balance mode. 4607 * 4608 * @syscap SystemCapability.Multimedia.Camera.Core 4609 * @systemapi 4610 * @since 12 4611 */ 4612 /** 4613 * Manual white balance mode. 4614 * 4615 * @syscap SystemCapability.Multimedia.Camera.Core 4616 * @atomicservice 4617 * @since 20 4618 */ 4619 MANUAL = 5, 4620 4621 /** 4622 * Lock white balance mode. 4623 * 4624 * @syscap SystemCapability.Multimedia.Camera.Core 4625 * @systemapi 4626 * @since 12 4627 */ 4628 /** 4629 * Lock white balance mode. 4630 * 4631 * @syscap SystemCapability.Multimedia.Camera.Core 4632 * @atomicservice 4633 * @since 20 4634 */ 4635 LOCKED = 6 4636 } 4637 4638 /** 4639 * White Balance Query object. 4640 * 4641 * @interface WhiteBalanceQuery 4642 * @syscap SystemCapability.Multimedia.Camera.Core 4643 * @systemapi 4644 * @since 12 4645 */ 4646 /** 4647 * White Balance Query object. 4648 * 4649 * @interface WhiteBalanceQuery 4650 * @syscap SystemCapability.Multimedia.Camera.Core 4651 * @atomicservice 4652 * @since 20 4653 */ 4654 interface WhiteBalanceQuery { 4655 /** 4656 * Checks whether a specified white balance mode is supported. 4657 * 4658 * @param { WhiteBalanceMode } mode - White balance mode. 4659 * @returns { boolean } Is the white balance mode supported. 4660 * @throws { BusinessError } 202 - Not System Application. 4661 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4662 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4663 * @syscap SystemCapability.Multimedia.Camera.Core 4664 * @systemapi 4665 * @since 12 4666 */ 4667 /** 4668 * Checks whether the specified white balance mode is supported. 4669 * @param { WhiteBalanceMode } mode White balance mode. 4670 * @returns { boolean } Check result. 4671 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4672 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4673 * @syscap SystemCapability.Multimedia.Camera.Core 4674 * @atomicservice 4675 * @since 20 4676 */ 4677 isWhiteBalanceModeSupported(mode: WhiteBalanceMode): boolean; 4678 4679 /** 4680 * Query the white balance mode range. 4681 * 4682 * @returns { Array<number> } The array of white balance mode range. 4683 * @throws { BusinessError } 202 - Not System Application. 4684 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4685 * @syscap SystemCapability.Multimedia.Camera.Core 4686 * @systemapi 4687 * @since 12 4688 */ 4689 /** 4690 * Query the white balance mode range. 4691 * 4692 * @returns { Array<number> } The array of white balance mode range. 4693 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4694 * @syscap SystemCapability.Multimedia.Camera.Core 4695 * @atomicservice 4696 * @since 20 4697 */ 4698 getWhiteBalanceRange(): Array<number>; 4699 } 4700 4701 /** 4702 * WhiteBalance object. 4703 * 4704 * @extends WhiteBalanceQuery 4705 * @interface WhiteBalance 4706 * @syscap SystemCapability.Multimedia.Camera.Core 4707 * @systemapi 4708 * @since 12 4709 */ 4710 /** 4711 * WhiteBalance object. 4712 * 4713 * @extends WhiteBalanceQuery 4714 * @interface WhiteBalance 4715 * @syscap SystemCapability.Multimedia.Camera.Core 4716 * @atomicservice 4717 * @since 20 4718 */ 4719 interface WhiteBalance extends WhiteBalanceQuery { 4720 /** 4721 * Gets current white balance mode. 4722 * 4723 * @returns { WhiteBalanceMode } The current white balance mode. 4724 * @throws { BusinessError } 202 - Not System Application. 4725 * @throws { BusinessError } 7400103 - Session not config. 4726 * @syscap SystemCapability.Multimedia.Camera.Core 4727 * @systemapi 4728 * @since 12 4729 */ 4730 /** 4731 * Obtains the white balance mode in use. 4732 * @returns { WhiteBalanceMode } White balance mode. 4733 * @throws { BusinessError } 7400103 - Session not config. 4734 * @syscap SystemCapability.Multimedia.Camera.Core 4735 * @atomicservice 4736 * @since 20 4737 */ 4738 getWhiteBalanceMode(): WhiteBalanceMode; 4739 4740 /** 4741 * Sets white balance mode. 4742 * 4743 * @param { WhiteBalanceMode } mode - Target white balance mode. 4744 * @throws { BusinessError } 202 - Not System Application. 4745 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4746 * @throws { BusinessError } 7400103 - Session not config. 4747 * @syscap SystemCapability.Multimedia.Camera.Core 4748 * @systemapi 4749 * @since 12 4750 */ 4751 /** 4752 * Sets white balance mode. 4753 * 4754 * @param { WhiteBalanceMode } mode - Target white balance mode. 4755 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4756 * @throws { BusinessError } 7400103 - Session not config. 4757 * @syscap SystemCapability.Multimedia.Camera.Core 4758 * @atomicservice 4759 * @since 20 4760 */ 4761 setWhiteBalanceMode(mode: WhiteBalanceMode): void; 4762 4763 /** 4764 * Gets current white balance. 4765 * 4766 * @returns { number } The current white balance. 4767 * @throws { BusinessError } 202 - Not System Application. 4768 * @throws { BusinessError } 7400103 - Session not config. 4769 * @syscap SystemCapability.Multimedia.Camera.Core 4770 * @systemapi 4771 * @since 12 4772 */ 4773 /** 4774 * Gets current white balance. 4775 * 4776 * @returns { number } The current white balance. 4777 * @throws { BusinessError } 7400103 - Session not config. 4778 * @syscap SystemCapability.Multimedia.Camera.Core 4779 * @atomicservice 4780 * @since 20 4781 */ 4782 getWhiteBalance(): number; 4783 4784 /** 4785 * Sets white balance. 4786 * 4787 * @param { number } whiteBalance - White balance. 4788 * @throws { BusinessError } 202 - Not System Application. 4789 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4790 * @throws { BusinessError } 7400103 - Session not config. 4791 * @syscap SystemCapability.Multimedia.Camera.Core 4792 * @systemapi 4793 * @since 12 4794 */ 4795 /** 4796 * Sets white balance. 4797 * 4798 * @param { number } whiteBalance - White balance. 4799 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4800 * @throws { BusinessError } 7400103 - Session not config. 4801 * @syscap SystemCapability.Multimedia.Camera.Core 4802 * @atomicservice 4803 * @since 20 4804 */ 4805 setWhiteBalance(whiteBalance: number): void; 4806 } 4807 4808 /** 4809 * Manual ISO Query object. 4810 * 4811 * @interface ManualIsoQuery 4812 * @syscap SystemCapability.Multimedia.Camera.Core 4813 * @systemapi 4814 * @since 12 4815 */ 4816 interface ManualIsoQuery { 4817 /** 4818 * Checks whether ISO is supported. 4819 * 4820 * @returns { boolean } Is the ISO supported. 4821 * @throws { BusinessError } 202 - Not System Application. 4822 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4823 * @syscap SystemCapability.Multimedia.Camera.Core 4824 * @systemapi 4825 * @since 12 4826 */ 4827 isManualIsoSupported(): boolean; 4828 4829 /** 4830 * Get the ISO range. 4831 * 4832 * @returns { Array<number> } The array of ISO range. 4833 * @throws { BusinessError } 202 - Not System Application. 4834 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 4835 * @syscap SystemCapability.Multimedia.Camera.Core 4836 * @systemapi 4837 * @since 12 4838 */ 4839 getIsoRange(): Array<number>; 4840 } 4841 4842 /** 4843 * ManualIso object. 4844 * 4845 * @extends ManualIsoQuery 4846 * @interface ManualIso 4847 * @syscap SystemCapability.Multimedia.Camera.Core 4848 * @systemapi 4849 * @since 12 4850 */ 4851 interface ManualIso extends ManualIsoQuery { 4852 /** 4853 * Gets current ISO. 4854 * 4855 * @returns { number } The current ISO. 4856 * @throws { BusinessError } 202 - Not System Application. 4857 * @throws { BusinessError } 7400103 - Session not config. 4858 * @syscap SystemCapability.Multimedia.Camera.Core 4859 * @systemapi 4860 * @since 12 4861 */ 4862 getIso(): number; 4863 4864 /** 4865 * Sets ISO. 4866 * 4867 * @param { number } iso - ISO 4868 * @throws { BusinessError } 202 - Not System Application. 4869 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 4870 * @throws { BusinessError } 7400103 - Session not config. 4871 * @syscap SystemCapability.Multimedia.Camera.Core 4872 * @systemapi 4873 * @since 12 4874 */ 4875 setIso(iso: number): void; 4876 } 4877 4878 /** 4879 * Enum for smooth zoom mode. 4880 * 4881 * @enum { number } 4882 * @syscap SystemCapability.Multimedia.Camera.Core 4883 * @since 11 4884 */ 4885 /** 4886 * Enum for smooth zoom mode. 4887 * 4888 * @enum { number } 4889 * @syscap SystemCapability.Multimedia.Camera.Core 4890 * @atomicservice 4891 * @since 19 4892 */ 4893 enum SmoothZoomMode { 4894 /** 4895 * Normal zoom mode. 4896 * 4897 * @syscap SystemCapability.Multimedia.Camera.Core 4898 * @since 11 4899 */ 4900 /** 4901 * Normal zoom mode. 4902 * 4903 * @syscap SystemCapability.Multimedia.Camera.Core 4904 * @atomicservice 4905 * @since 19 4906 */ 4907 NORMAL = 0 4908 } 4909 4910 /** 4911 * SmoothZoomInfo object 4912 * 4913 * @typedef SmoothZoomInfo 4914 * @syscap SystemCapability.Multimedia.Camera.Core 4915 * @since 11 4916 */ 4917 /** 4918 * SmoothZoomInfo object 4919 * 4920 * @typedef SmoothZoomInfo 4921 * @syscap SystemCapability.Multimedia.Camera.Core 4922 * @atomicservice 4923 * @since 19 4924 */ 4925 interface SmoothZoomInfo { 4926 /** 4927 * The duration of smooth zoom. 4928 * 4929 * @type { number } 4930 * @syscap SystemCapability.Multimedia.Camera.Core 4931 * @since 11 4932 */ 4933 /** 4934 * The duration of smooth zoom. 4935 * 4936 * @type { number } 4937 * @syscap SystemCapability.Multimedia.Camera.Core 4938 * @atomicservice 4939 * @since 19 4940 */ 4941 duration: number; 4942 } 4943 4944 /** 4945 * ZoomPointInfo object. 4946 * 4947 * @typedef ZoomPointInfo 4948 * @syscap SystemCapability.Multimedia.Camera.Core 4949 * @systemapi 4950 * @since 12 4951 */ 4952 interface ZoomPointInfo { 4953 /** 4954 * The zoom ratio value. 4955 * 4956 * @type { number } 4957 * @readonly 4958 * @syscap SystemCapability.Multimedia.Camera.Core 4959 * @systemapi 4960 * @since 12 4961 */ 4962 readonly zoomRatio: number; 4963 4964 /** 4965 * The equivalent focal Length. 4966 * 4967 * @type { number } 4968 * @readonly 4969 * @syscap SystemCapability.Multimedia.Camera.Core 4970 * @systemapi 4971 * @since 12 4972 */ 4973 readonly equivalentFocalLength: number; 4974 } 4975 4976 /** 4977 * Zoom query object. 4978 * 4979 * @interface ZoomQuery 4980 * @syscap SystemCapability.Multimedia.Camera.Core 4981 * @since 12 4982 */ 4983 /** 4984 * Zoom query object. 4985 * 4986 * @interface ZoomQuery 4987 * @syscap SystemCapability.Multimedia.Camera.Core 4988 * @atomicservice 4989 * @since 19 4990 */ 4991 interface ZoomQuery { 4992 /** 4993 * Gets all supported zoom ratio range. 4994 * 4995 * @returns { Array<number> } The zoom ratio range. 4996 * @throws { BusinessError } 7400103 - Session not config. 4997 * @syscap SystemCapability.Multimedia.Camera.Core 4998 * @since 11 4999 */ 5000 /** 5001 * Gets all supported zoom ratio range. 5002 * Move to ZoomQuery interface from Zoom since 12. 5003 * 5004 * @returns { Array<number> } The zoom ratio range. 5005 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5006 * @syscap SystemCapability.Multimedia.Camera.Core 5007 * @since 12 5008 */ 5009 /** 5010 * Gets all supported zoom ratio range. 5011 * Move to ZoomQuery interface from Zoom since 12. 5012 * 5013 * @returns { Array<number> } The zoom ratio range. 5014 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5015 * @syscap SystemCapability.Multimedia.Camera.Core 5016 * @atomicservice 5017 * @since 19 5018 */ 5019 getZoomRatioRange(): Array<number>; 5020 5021 /** 5022 * Gets all important zoom ratio infos. 5023 * 5024 * @returns { Array<ZoomPointInfo> } The zoom point infos. 5025 * @throws { BusinessError } 202 - Not System Application. 5026 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5027 * @syscap SystemCapability.Multimedia.Camera.Core 5028 * @systemapi 5029 * @since 12 5030 */ 5031 getZoomPointInfos(): Array<ZoomPointInfo>; 5032 5033 /** 5034 * Checks whether zoom center point is supported. 5035 * 5036 * @returns { boolean } Is zoom center point supported. 5037 * @throws { BusinessError } 202 - Not System Application. 5038 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5039 * @syscap SystemCapability.Multimedia.Camera.Core 5040 * @systemapi 5041 * @since 20 5042 */ 5043 isZoomCenterPointSupported(): boolean; 5044 } 5045 5046 /** 5047 * Zoom object. 5048 * 5049 * @extends ZoomQuery 5050 * @interface Zoom 5051 * @syscap SystemCapability.Multimedia.Camera.Core 5052 * @since 11 5053 */ 5054 /** 5055 * Zoom object. 5056 * 5057 * @extends ZoomQuery 5058 * @interface Zoom 5059 * @syscap SystemCapability.Multimedia.Camera.Core 5060 * @atomicservice 5061 * @since 19 5062 */ 5063 interface Zoom extends ZoomQuery { 5064 /** 5065 * Gets zoom ratio. 5066 * 5067 * @returns { number } The zoom ratio value. 5068 * @throws { BusinessError } 7400103 - Session not config. 5069 * @syscap SystemCapability.Multimedia.Camera.Core 5070 * @since 11 5071 */ 5072 /** 5073 * Gets zoom ratio. 5074 * 5075 * @returns { number } The zoom ratio value. 5076 * @throws { BusinessError } 7400103 - Session not config. 5077 * @throws { BusinessError } 7400201 - Camera service fatal error. 5078 * @syscap SystemCapability.Multimedia.Camera.Core 5079 * @since 12 5080 */ 5081 /** 5082 * Gets zoom ratio. 5083 * 5084 * @returns { number } The zoom ratio value. 5085 * @throws { BusinessError } 7400103 - Session not config. 5086 * @throws { BusinessError } 7400201 - Camera service fatal error. 5087 * @syscap SystemCapability.Multimedia.Camera.Core 5088 * @atomicservice 5089 * @since 19 5090 */ 5091 getZoomRatio(): number; 5092 5093 /** 5094 * Sets zoom ratio. 5095 * 5096 * @param { number } zoomRatio - Target zoom ratio. 5097 * @throws { BusinessError } 7400103 - Session not config. 5098 * @syscap SystemCapability.Multimedia.Camera.Core 5099 * @since 11 5100 */ 5101 /** 5102 * Sets zoom ratio. 5103 * 5104 * @param { number } zoomRatio - Target zoom ratio. 5105 * @throws { BusinessError } 7400103 - Session not config. 5106 * @syscap SystemCapability.Multimedia.Camera.Core 5107 * @atomicservice 5108 * @since 19 5109 */ 5110 setZoomRatio(zoomRatio: number): void; 5111 5112 /** 5113 * Sets target zoom ratio by smooth method. 5114 * 5115 * @param { number } targetRatio - Target zoom ratio. 5116 * @param { SmoothZoomMode } mode - Smooth zoom mode. 5117 * @throws { BusinessError } 7400103 - Session not config. 5118 * @syscap SystemCapability.Multimedia.Camera.Core 5119 * @since 11 5120 */ 5121 /** 5122 * Sets target zoom ratio by smooth method. 5123 * 5124 * @param { number } targetRatio - Target zoom ratio. 5125 * @param { SmoothZoomMode } mode - Smooth zoom mode. 5126 * @syscap SystemCapability.Multimedia.Camera.Core 5127 * @since 18 5128 */ 5129 /** 5130 * Sets target zoom ratio by smooth method. 5131 * 5132 * @param { number } targetRatio - Target zoom ratio. 5133 * @param { SmoothZoomMode } mode - Smooth zoom mode. 5134 * @syscap SystemCapability.Multimedia.Camera.Core 5135 * @atomicservice 5136 * @since 19 5137 */ 5138 setSmoothZoom(targetRatio: number, mode?: SmoothZoomMode): void; 5139 5140 /** 5141 * Notify device to prepare for zoom. 5142 * 5143 * @throws { BusinessError } 202 - Not System Application. 5144 * @throws { BusinessError } 7400103 - Session not config. 5145 * @syscap SystemCapability.Multimedia.Camera.Core 5146 * @systemapi 5147 * @since 11 5148 */ 5149 prepareZoom(): void; 5150 5151 /** 5152 * Notify device of zoom completion. 5153 * 5154 * @throws { BusinessError } 202 - Not System Application. 5155 * @throws { BusinessError } 7400103 - Session not config. 5156 * @syscap SystemCapability.Multimedia.Camera.Core 5157 * @systemapi 5158 * @since 11 5159 */ 5160 unprepareZoom(): void; 5161 5162 /** 5163 * Gets current zoom center point. 5164 * 5165 * @returns { Point } The zoom center point 5166 * @throws { BusinessError } 202 - Not System Application. 5167 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5168 * @syscap SystemCapability.Multimedia.Camera.Core 5169 * @systemapi 5170 * @since 20 5171 */ 5172 getZoomCenterPoint(): Point; 5173 5174 /** 5175 * Sets the zoom center point. 5176 * 5177 * @param { Point } point - The point of zoom center. 5178 * @throws { BusinessError } 202 - Not System Application. 5179 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5180 * @syscap SystemCapability.Multimedia.Camera.Core 5181 * @systemapi 5182 * @since 20 5183 */ 5184 setZoomCenterPoint(point: Point): void; 5185 } 5186 5187 /** 5188 * Enum for video stabilization mode. 5189 * 5190 * @enum { number } 5191 * @syscap SystemCapability.Multimedia.Camera.Core 5192 * @since 10 5193 */ 5194 /** 5195 * Enum for video stabilization mode. 5196 * 5197 * @enum { number } 5198 * @syscap SystemCapability.Multimedia.Camera.Core 5199 * @atomicservice 5200 * @since 19 5201 */ 5202 enum VideoStabilizationMode { 5203 /** 5204 * Turn off video stablization. 5205 * 5206 * @syscap SystemCapability.Multimedia.Camera.Core 5207 * @since 10 5208 */ 5209 /** 5210 * Turn off video stablization. 5211 * 5212 * @syscap SystemCapability.Multimedia.Camera.Core 5213 * @atomicservice 5214 * @since 19 5215 */ 5216 OFF = 0, 5217 5218 /** 5219 * LOW mode provides basic stabilization effect. 5220 * 5221 * @syscap SystemCapability.Multimedia.Camera.Core 5222 * @since 10 5223 */ 5224 /** 5225 * LOW mode provides basic stabilization effect. 5226 * 5227 * @syscap SystemCapability.Multimedia.Camera.Core 5228 * @atomicservice 5229 * @since 19 5230 */ 5231 LOW = 1, 5232 5233 /** 5234 * MIDDLE mode means algorithms can achieve better effects than LOW mode. 5235 * 5236 * @syscap SystemCapability.Multimedia.Camera.Core 5237 * @since 10 5238 */ 5239 /** 5240 * MIDDLE mode means algorithms can achieve better effects than LOW mode. 5241 * 5242 * @syscap SystemCapability.Multimedia.Camera.Core 5243 * @atomicservice 5244 * @since 19 5245 */ 5246 MIDDLE = 2, 5247 5248 /** 5249 * HIGH mode means algorithms can achieve better effects than MIDDLE mode. 5250 * 5251 * @syscap SystemCapability.Multimedia.Camera.Core 5252 * @since 10 5253 */ 5254 /** 5255 * HIGH mode means algorithms can achieve better effects than MIDDLE mode. 5256 * 5257 * @syscap SystemCapability.Multimedia.Camera.Core 5258 * @atomicservice 5259 * @since 19 5260 */ 5261 HIGH = 3, 5262 5263 /** 5264 * Camera HDF can select mode automatically. 5265 * 5266 * @syscap SystemCapability.Multimedia.Camera.Core 5267 * @since 10 5268 */ 5269 /** 5270 * The stabilization algorithm is selected automatically. Selection of the stabilization algorithm is performed automatically. 5271 * 5272 * @syscap SystemCapability.Multimedia.Camera.Core 5273 * @atomicservice 5274 * @since 19 5275 */ 5276 AUTO = 4 5277 } 5278 5279 /** 5280 * Stabilization Query object. 5281 * 5282 * @interface StabilizationQuery 5283 * @syscap SystemCapability.Multimedia.Camera.Core 5284 * @since 12 5285 */ 5286 /** 5287 * Stabilization Query object. 5288 * 5289 * @interface StabilizationQuery 5290 * @syscap SystemCapability.Multimedia.Camera.Core 5291 * @atomicservice 5292 * @since 19 5293 */ 5294 interface StabilizationQuery { 5295 /** 5296 * Check whether the specified video stabilization mode is supported. 5297 * 5298 * @param { VideoStabilizationMode } vsMode - Video Stabilization mode. 5299 * @returns { boolean } Is video stabilization mode supported. 5300 * @throws { BusinessError } 7400103 - Session not config. 5301 * @syscap SystemCapability.Multimedia.Camera.Core 5302 * @since 11 5303 */ 5304 /** 5305 * Check whether the specified video stabilization mode is supported. 5306 * Move to StabilizationQuery interface from Stabilization since 12. 5307 * 5308 * @param { VideoStabilizationMode } vsMode - Video Stabilization mode. 5309 * @returns { boolean } Is video stabilization mode supported. 5310 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5311 * @syscap SystemCapability.Multimedia.Camera.Core 5312 * @since 12 5313 */ 5314 /** 5315 * Check whether the specified video stabilization mode is supported. 5316 * Move to StabilizationQuery interface from Stabilization since 12. 5317 * 5318 * @param { VideoStabilizationMode } vsMode - Video Stabilization mode. 5319 * @returns { boolean } Is video stabilization mode supported. 5320 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5321 * @syscap SystemCapability.Multimedia.Camera.Core 5322 * @atomicservice 5323 * @since 19 5324 */ 5325 isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean; 5326 } 5327 5328 /** 5329 * Stabilization object. 5330 * 5331 * @extends StabilizationQuery 5332 * @interface Stabilization 5333 * @syscap SystemCapability.Multimedia.Camera.Core 5334 * @since 11 5335 */ 5336 /** 5337 * Stabilization object. 5338 * 5339 * @extends StabilizationQuery 5340 * @interface Stabilization 5341 * @syscap SystemCapability.Multimedia.Camera.Core 5342 * @atomicservice 5343 * @since 19 5344 */ 5345 interface Stabilization extends StabilizationQuery { 5346 /** 5347 * Query the video stabilization mode currently in use. 5348 * 5349 * @returns { VideoStabilizationMode } The current video stabilization mode. 5350 * @throws { BusinessError } 7400103 - Session not config. 5351 * @syscap SystemCapability.Multimedia.Camera.Core 5352 * @since 11 5353 */ 5354 /** 5355 * Query the video stabilization mode currently in use. 5356 * 5357 * @returns { VideoStabilizationMode } The current video stabilization mode. 5358 * @throws { BusinessError } 7400103 - Session not config. 5359 * @syscap SystemCapability.Multimedia.Camera.Core 5360 * @atomicservice 5361 * @since 19 5362 */ 5363 getActiveVideoStabilizationMode(): VideoStabilizationMode; 5364 5365 /** 5366 * Set video stabilization mode. 5367 * 5368 * @param { VideoStabilizationMode } mode - video stabilization mode to set. 5369 * @throws { BusinessError } 7400103 - Session not config. 5370 * @syscap SystemCapability.Multimedia.Camera.Core 5371 * @since 11 5372 */ 5373 /** 5374 * Set video stabilization mode. 5375 * 5376 * @param { VideoStabilizationMode } mode - video stabilization mode to set. 5377 * @throws { BusinessError } 7400103 - Session not config. 5378 * @syscap SystemCapability.Multimedia.Camera.Core 5379 * @atomicservice 5380 * @since 19 5381 */ 5382 setVideoStabilizationMode(mode: VideoStabilizationMode): void; 5383 } 5384 5385 /** 5386 * Enumerates the camera portrait theme types. 5387 * 5388 * @enum { number } 5389 * @syscap SystemCapability.Multimedia.Camera.Core 5390 * @systemapi 5391 * @since 14 5392 */ 5393 enum PortraitThemeType { 5394 /** 5395 * Natural portrait theme type. 5396 * 5397 * @syscap SystemCapability.Multimedia.Camera.Core 5398 * @systemapi 5399 * @since 14 5400 */ 5401 NATURAL = 0, 5402 5403 /** 5404 * Delicate portrait theme type. 5405 * 5406 * @syscap SystemCapability.Multimedia.Camera.Core 5407 * @systemapi 5408 * @since 14 5409 */ 5410 DELICATE = 1, 5411 5412 /** 5413 * Stylish portrait theme type. 5414 * 5415 * @syscap SystemCapability.Multimedia.Camera.Core 5416 * @systemapi 5417 * @since 14 5418 */ 5419 STYLISH = 2 5420 } 5421 5422 /** 5423 * Enumerates the camera beauty effect types. 5424 * 5425 * @enum { number } 5426 * @syscap SystemCapability.Multimedia.Camera.Core 5427 * @systemapi 5428 * @since 10 5429 */ 5430 enum BeautyType { 5431 /** 5432 * Auto beauty type. 5433 * 5434 * @syscap SystemCapability.Multimedia.Camera.Core 5435 * @systemapi 5436 * @since 10 5437 */ 5438 AUTO = 0, 5439 5440 /** 5441 * Skin smooth beauty type. 5442 * 5443 * @syscap SystemCapability.Multimedia.Camera.Core 5444 * @systemapi 5445 * @since 10 5446 */ 5447 SKIN_SMOOTH = 1, 5448 5449 /** 5450 * Face slender beauty type. 5451 * 5452 * @syscap SystemCapability.Multimedia.Camera.Core 5453 * @systemapi 5454 * @since 10 5455 */ 5456 FACE_SLENDER = 2, 5457 5458 /** 5459 * Skin tone beauty type. 5460 * 5461 * @syscap SystemCapability.Multimedia.Camera.Core 5462 * @systemapi 5463 * @since 10 5464 */ 5465 SKIN_TONE = 3 5466 } 5467 5468 /** 5469 * Beauty Query object. 5470 * 5471 * @interface BeautyQuery 5472 * @syscap SystemCapability.Multimedia.Camera.Core 5473 * @systemapi 5474 * @since 12 5475 */ 5476 interface BeautyQuery { 5477 /** 5478 * Gets supported beauty effect types. 5479 * 5480 * @returns { Array<BeautyType> } List of beauty effect types. 5481 * @throws { BusinessError } 202 - Not System Application. 5482 * @throws { BusinessError } 7400103 - Session not config. 5483 * @syscap SystemCapability.Multimedia.Camera.Core 5484 * @systemapi 5485 * @since 11 5486 */ 5487 /** 5488 * Gets supported beauty effect types. 5489 * Move to BeautyQuery from Beauty since 12. 5490 * 5491 * @returns { Array<BeautyType> } List of beauty effect types. 5492 * @throws { BusinessError } 202 - Not System Application. 5493 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5494 * @syscap SystemCapability.Multimedia.Camera.Core 5495 * @systemapi 5496 * @since 12 5497 */ 5498 getSupportedBeautyTypes(): Array<BeautyType>; 5499 5500 /** 5501 * Gets the specific beauty effect type range. 5502 * 5503 * @param { BeautyType } type - The type of beauty effect. 5504 * @returns { Array<number> } The array of the specific beauty effect range. 5505 * @throws { BusinessError } 202 - Not System Application. 5506 * @throws { BusinessError } 7400103 - Session not config. 5507 * @syscap SystemCapability.Multimedia.Camera.Core 5508 * @systemapi 5509 * @since 11 5510 */ 5511 /** 5512 * Gets the specific beauty effect type range. 5513 * Move to BeautyQuery from Beauty since 12. 5514 * 5515 * @param { BeautyType } type - The type of beauty effect. 5516 * @returns { Array<number> } The array of the specific beauty effect range. 5517 * @throws { BusinessError } 202 - Not System Application. 5518 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5519 * @syscap SystemCapability.Multimedia.Camera.Core 5520 * @systemapi 5521 * @since 12 5522 */ 5523 getSupportedBeautyRange(type: BeautyType): Array<number>; 5524 5525 /** 5526 * Gets supported portrait theme type. 5527 * 5528 * @returns { Array<PortraitThemeType> } Lists of portrait theme types 5529 * @throws { BusinessError } 202 - Not System Application. 5530 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5531 * @syscap SystemCapability.Multimedia.Camera.Core 5532 * @systemapi 5533 * @since 14 5534 */ 5535 getSupportedPortraitThemeTypes(): Array<PortraitThemeType>; 5536 5537 /** 5538 * Checks whether portrait theme is supported. 5539 * 5540 * @returns { boolean } Is portrait theme supported. 5541 * @throws { BusinessError } 202 - Not System Application. 5542 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5543 * @syscap SystemCapability.Multimedia.Camera.Core 5544 * @systemapi 5545 * @since 14 5546 */ 5547 isPortraitThemeSupported(): boolean; 5548 } 5549 5550 /** 5551 * Beauty object. 5552 * 5553 * @extends BeautyQuery 5554 * @interface Beauty 5555 * @syscap SystemCapability.Multimedia.Camera.Core 5556 * @systemapi 5557 * @since 11 5558 */ 5559 interface Beauty extends BeautyQuery { 5560 /** 5561 * Gets the beauty effect in use. 5562 * 5563 * @param { BeautyType } type - The type of beauty effect. 5564 * @returns { number } the beauty effect in use. 5565 * @throws { BusinessError } 202 - Not System Application. 5566 * @throws { BusinessError } 7400103 - Session not config. 5567 * @syscap SystemCapability.Multimedia.Camera.Core 5568 * @systemapi 5569 * @since 11 5570 */ 5571 getBeauty(type: BeautyType): number; 5572 5573 /** 5574 * Sets a beauty effect for a camera device. 5575 * 5576 * @param { BeautyType } type - The type of beauty effect. 5577 * @param { number } value The number of beauty effect. 5578 * @throws { BusinessError } 202 - Not System Application. 5579 * @throws { BusinessError } 7400103 - Session not config. 5580 * @syscap SystemCapability.Multimedia.Camera.Core 5581 * @systemapi 5582 * @since 11 5583 */ 5584 setBeauty(type: BeautyType, value: number): void; 5585 5586 /** 5587 * Sets a portrait theme type for a camera device. 5588 * 5589 * @param { PortraitThemeType } type - The type of portrait theme. 5590 * @throws { BusinessError } 202 - Not System Application. 5591 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5592 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5593 * @syscap SystemCapability.Multimedia.Camera.Core 5594 * @systemapi 5595 * @since 14 5596 */ 5597 setPortraitThemeType(type: PortraitThemeType): void; 5598 } 5599 5600 /** 5601 * EffectSuggestion object. 5602 * 5603 * @typedef EffectSuggestion 5604 * @syscap SystemCapability.Multimedia.Camera.Core 5605 * @systemapi 5606 * @since 12 5607 */ 5608 interface EffectSuggestion { 5609 5610 /** 5611 * Checks whether effect suggestion is supported. 5612 * 5613 * @returns { boolean } Is the effect suggestion supported. 5614 * @throws { BusinessError } 202 - Not System Application. 5615 * @throws { BusinessError } 7400103 - Session not config. 5616 * @syscap SystemCapability.Multimedia.Camera.Core 5617 * @systemapi 5618 * @since 12 5619 */ 5620 isEffectSuggestionSupported(): boolean; 5621 5622 /** 5623 * Enable effect suggestion for session. 5624 * 5625 * @param { boolean } enabled enable effect suggestion for session if TRUE.. 5626 * @throws { BusinessError } 202 - Not System Application. 5627 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5628 * @throws { BusinessError } 7400103 - Session not config. 5629 * @syscap SystemCapability.Multimedia.Camera.Core 5630 * @systemapi 5631 * @since 12 5632 */ 5633 enableEffectSuggestion(enabled: boolean): void; 5634 5635 /** 5636 * Gets supported effect suggestion types. 5637 * 5638 * @returns { Array<EffectSuggestionType> } The array of the effect suggestion types. 5639 * @throws { BusinessError } 202 - Not System Application. 5640 * @throws { BusinessError } 7400103 - Session not config. 5641 * @syscap SystemCapability.Multimedia.Camera.Core 5642 * @systemapi 5643 * @since 12 5644 */ 5645 getSupportedEffectSuggestionTypes(): Array<EffectSuggestionType>; 5646 5647 /** 5648 * Set the range of effect suggestion type and enable status. 5649 * The application should fully set all data when it starts up. 5650 * 5651 * @param { Array<EffectSuggestionStatus> } status - The array of the effect suggestion status. 5652 * @throws { BusinessError } 202 - Not System Application. 5653 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5654 * @throws { BusinessError } 7400103 - Session not config. 5655 * @syscap SystemCapability.Multimedia.Camera.Core 5656 * @systemapi 5657 * @since 12 5658 */ 5659 setEffectSuggestionStatus(status: Array<EffectSuggestionStatus>): void; 5660 5661 /** 5662 * Update the enable status of the effect suggestion type. 5663 * 5664 * @param { EffectSuggestionType } type - The type of effect suggestion. 5665 * @param { boolean } enabled - The status of effect suggestion type. 5666 * @throws { BusinessError } 202 - Not System Application. 5667 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5668 * @throws { BusinessError } 7400103 - Session not config. 5669 * @syscap SystemCapability.Multimedia.Camera.Core 5670 * @systemapi 5671 * @since 12 5672 */ 5673 updateEffectSuggestion(type: EffectSuggestionType, enabled: boolean): void; 5674 } 5675 5676 /** 5677 * Enumerates the camera color effect types. 5678 * 5679 * @enum { number } 5680 * @syscap SystemCapability.Multimedia.Camera.Core 5681 * @systemapi 5682 * @since 11 5683 */ 5684 enum ColorEffectType { 5685 /** 5686 * Normal color effect type. 5687 * 5688 * @syscap SystemCapability.Multimedia.Camera.Core 5689 * @systemapi 5690 * @since 11 5691 */ 5692 NORMAL = 0, 5693 5694 /** 5695 * Bright color effect type. 5696 * 5697 * @syscap SystemCapability.Multimedia.Camera.Core 5698 * @systemapi 5699 * @since 11 5700 */ 5701 BRIGHT = 1, 5702 5703 /** 5704 * Soft color effect type. 5705 * 5706 * @syscap SystemCapability.Multimedia.Camera.Core 5707 * @systemapi 5708 * @since 11 5709 */ 5710 SOFT = 2, 5711 5712 /** 5713 * Black white color effect type. 5714 * 5715 * @syscap SystemCapability.Multimedia.Camera.Core 5716 * @systemapi 5717 * @since 12 5718 */ 5719 BLACK_WHITE = 3 5720 } 5721 5722 /** 5723 * Enumerates the control center effect types. 5724 * 5725 * @enum { number } 5726 * @syscap SystemCapability.Multimedia.Camera.Core 5727 * @atomicservice 5728 * @since 20 5729 */ 5730 enum ControlCenterEffectType { 5731 /** 5732 * Beauty type. 5733 * 5734 * @syscap SystemCapability.Multimedia.Camera.Core 5735 * @atomicservice 5736 * @since 20 5737 */ 5738 BEAUTY = 0, 5739 /** 5740 * Portrait type. 5741 * 5742 * @syscap SystemCapability.Multimedia.Camera.Core 5743 * @atomicservice 5744 * @since 20 5745 */ 5746 PORTRAIT = 1 5747 } 5748 5749 /** 5750 * Enum for policy type 5751 * 5752 * @enum { number } 5753 * @syscap SystemCapability.Multimedia.Camera.Core 5754 * @systemapi 5755 * @since 12 5756 */ 5757 enum PolicyType { 5758 /** 5759 * PRIVACY type. 5760 * 5761 * @syscap SystemCapability.Multimedia.Camera.Core 5762 * @systemapi 5763 * @since 12 5764 */ 5765 PRIVACY = 1 5766 } 5767 5768 /** 5769 * Color Effect Query object. 5770 * 5771 * @interface ColorEffectQuery 5772 * @syscap SystemCapability.Multimedia.Camera.Core 5773 * @systemapi 5774 * @since 12 5775 */ 5776 interface ColorEffectQuery { 5777 /** 5778 * Gets supported color effect types. 5779 * 5780 * @returns { Array<ColorEffectType> } List of color effect types. 5781 * @throws { BusinessError } 202 - Not System Application. 5782 * @throws { BusinessError } 7400103 - Session not config. 5783 * @syscap SystemCapability.Multimedia.Camera.Core 5784 * @systemapi 5785 * @since 11 5786 */ 5787 /** 5788 * Gets supported color effect types. 5789 * Move to ColorEffectQuery from ColorEffect since 12. 5790 * 5791 * @returns { Array<ColorEffectType> } List of color effect types. 5792 * @throws { BusinessError } 202 - Not System Application. 5793 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5794 * @syscap SystemCapability.Multimedia.Camera.Core 5795 * @systemapi 5796 * @since 12 5797 */ 5798 getSupportedColorEffects(): Array<ColorEffectType>; 5799 } 5800 5801 /** 5802 * Color effect object. 5803 * 5804 * @extends ColorEffectQuery 5805 * @interface ColorEffect 5806 * @syscap SystemCapability.Multimedia.Camera.Core 5807 * @systemapi 5808 * @since 11 5809 */ 5810 interface ColorEffect extends ColorEffectQuery { 5811 /** 5812 * Gets the specific color effect type. 5813 * 5814 * @returns { ColorEffectType } The array of the specific color effect type. 5815 * @throws { BusinessError } 202 - Not System Application. 5816 * @throws { BusinessError } 7400103 - Session not config. 5817 * @syscap SystemCapability.Multimedia.Camera.Core 5818 * @systemapi 5819 * @since 11 5820 */ 5821 getColorEffect(): ColorEffectType; 5822 5823 /** 5824 * Sets a color effect for a camera device. 5825 * 5826 * @param { ColorEffectType } type - The type of color effect. 5827 * @throws { BusinessError } 202 - Not System Application. 5828 * @throws { BusinessError } 7400103 - Session not config. 5829 * @syscap SystemCapability.Multimedia.Camera.Core 5830 * @systemapi 5831 * @since 11 5832 */ 5833 setColorEffect(type: ColorEffectType): void; 5834 } 5835 5836 /** 5837 * Color Management Query object. 5838 * 5839 * @interface ColorManagementQuery 5840 * @syscap SystemCapability.Multimedia.Camera.Core 5841 * @since 12 5842 */ 5843 /** 5844 * Color Management Query object. 5845 * 5846 * @interface ColorManagementQuery 5847 * @syscap SystemCapability.Multimedia.Camera.Core 5848 * @atomicservice 5849 * @since 19 5850 */ 5851 interface ColorManagementQuery { 5852 /** 5853 * Gets the supported color space types. 5854 * 5855 * @returns { Array<colorSpaceManager.ColorSpace> } The array of the supported color space for the session. 5856 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 5857 * @syscap SystemCapability.Multimedia.Camera.Core 5858 * @since 12 5859 */ 5860 /** 5861 * Gets the supported color space types. 5862 * 5863 * @returns { Array<colorSpaceManager.ColorSpace> } The array of the supported color space for the session. 5864 * @syscap SystemCapability.Multimedia.Camera.Core 5865 * @since 18 5866 */ 5867 /** 5868 * Gets the supported color space types. 5869 * 5870 * @returns { Array<colorSpaceManager.ColorSpace> } The array of the supported color space for the session. 5871 * @syscap SystemCapability.Multimedia.Camera.Core 5872 * @atomicservice 5873 * @since 19 5874 */ 5875 getSupportedColorSpaces(): Array<colorSpaceManager.ColorSpace>; 5876 } 5877 5878 /** 5879 * Color Management object. 5880 * 5881 * @extends ColorManagementQuery 5882 * @interface ColorManagement 5883 * @syscap SystemCapability.Multimedia.Camera.Core 5884 * @since 12 5885 */ 5886 /** 5887 * Color Management object. 5888 * 5889 * @extends ColorManagementQuery 5890 * @interface ColorManagement 5891 * @syscap SystemCapability.Multimedia.Camera.Core 5892 * @atomicservice 5893 * @since 19 5894 */ 5895 interface ColorManagement extends ColorManagementQuery { 5896 /** 5897 * Gets the specific color space type. 5898 * 5899 * @returns { colorSpaceManager.ColorSpace } Current color space. 5900 * @throws { BusinessError } 7400103 - Session not config. 5901 * @syscap SystemCapability.Multimedia.Camera.Core 5902 * @since 12 5903 */ 5904 /** 5905 * Gets the specific color space type. 5906 * 5907 * @returns { colorSpaceManager.ColorSpace } Current color space. 5908 * @throws { BusinessError } 7400103 - Session not config. 5909 * @syscap SystemCapability.Multimedia.Camera.Core 5910 * @atomicservice 5911 * @since 19 5912 */ 5913 getActiveColorSpace(): colorSpaceManager.ColorSpace; 5914 5915 /** 5916 * Sets a color space for the session. 5917 * 5918 * @param { colorSpaceManager.ColorSpace } colorSpace - The type of color space. 5919 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5920 * @throws { BusinessError } 7400102 - The colorSpace does not match the format. 5921 * @throws { BusinessError } 7400103 - Session not config. 5922 * @throws { BusinessError } 7400201 - Camera service fatal error. 5923 * @syscap SystemCapability.Multimedia.Camera.Core 5924 * @since 12 5925 */ 5926 /** 5927 * Sets a color space for the session. 5928 * 5929 * @param { colorSpaceManager.ColorSpace } colorSpace - The type of color space. 5930 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 5931 * @throws { BusinessError } 7400102 - The colorSpace does not match the format. 5932 * @throws { BusinessError } 7400103 - Session not config. 5933 * @throws { BusinessError } 7400201 - Camera service fatal error. 5934 * @syscap SystemCapability.Multimedia.Camera.Core 5935 * @atomicservice 5936 * @since 19 5937 */ 5938 setColorSpace(colorSpace: colorSpaceManager.ColorSpace): void; 5939 } 5940 5941 /** 5942 * Control Center Query object. 5943 * 5944 * @interface ControlCenterQuery 5945 * @syscap SystemCapability.Multimedia.Camera.Core 5946 * @atomicservice 5947 * @since 20 5948 */ 5949 interface ControlCenterQuery { 5950 /** 5951 * Checks whether control center is supported. 5952 * 5953 * @returns { boolean } Is control center supported. 5954 * @syscap SystemCapability.Multimedia.Camera.Core 5955 * @atomicservice 5956 * @since 20 5957 */ 5958 isControlCenterSupported(): boolean; 5959 5960 /** 5961 * Gets the supported effect types. 5962 * 5963 * @returns { Array<ControlCenterEffectType> } The array of the supported control center type for the session. 5964 * @syscap SystemCapability.Multimedia.Camera.Core 5965 * @atomicservice 5966 * @since 20 5967 */ 5968 getSupportedEffectTypes(): Array<ControlCenterEffectType>; 5969 } 5970 5971 /** 5972 * Control center object. 5973 * 5974 * @extends ControlCenterQuery 5975 * @interface ControlCenter 5976 * @syscap SystemCapability.Multimedia.Camera.Core 5977 * @atomicservice 5978 * @since 20 5979 */ 5980 interface ControlCenter extends ControlCenterQuery { 5981 /** 5982 * Enable control center for session. 5983 * 5984 * @param { boolean } enabled enable control center for session if TRUE. 5985 * @throws { BusinessError } 7400103 - Session not config. 5986 * @syscap SystemCapability.Multimedia.Camera.Core 5987 * @atomicservice 5988 * @since 20 5989 */ 5990 enableControlCenter(enabled: boolean): void; 5991 } 5992 5993 /** 5994 * Auto Device Switch Query object. 5995 * 5996 * @interface AutoDeviceSwitchQuery 5997 * @syscap SystemCapability.Multimedia.Camera.Core 5998 * @since 13 5999 */ 6000 /** 6001 * Auto Device Switch Query object. 6002 * 6003 * @interface AutoDeviceSwitchQuery 6004 * @syscap SystemCapability.Multimedia.Camera.Core 6005 * @atomicservice 6006 * @since 19 6007 */ 6008 interface AutoDeviceSwitchQuery { 6009 /** 6010 * Check whether auto device switch is supported. 6011 * 6012 * @returns { boolean } Is auto device switch supported. 6013 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 6014 * @syscap SystemCapability.Multimedia.Camera.Core 6015 * @since 13 6016 */ 6017 /** 6018 * Check whether auto device switch is supported. 6019 * 6020 * @returns { boolean } Is auto device switch supported. 6021 * @syscap SystemCapability.Multimedia.Camera.Core 6022 * @since 18 6023 */ 6024 /** 6025 * Check whether auto device switch is supported. 6026 * 6027 * @returns { boolean } Is auto device switch supported. 6028 * @syscap SystemCapability.Multimedia.Camera.Core 6029 * @atomicservice 6030 * @since 19 6031 */ 6032 isAutoDeviceSwitchSupported(): boolean; 6033 } 6034 6035 /** 6036 * Auto Device Switch object. 6037 * 6038 * @extends AutoDeviceSwitchQuery 6039 * @interface AutoDeviceSwitch 6040 * @syscap SystemCapability.Multimedia.Camera.Core 6041 * @since 13 6042 */ 6043 /** 6044 * Auto Device Switch object. 6045 * 6046 * @extends AutoDeviceSwitchQuery 6047 * @interface AutoDeviceSwitch 6048 * @syscap SystemCapability.Multimedia.Camera.Core 6049 * @atomicservice 6050 * @since 19 6051 */ 6052 interface AutoDeviceSwitch extends AutoDeviceSwitchQuery { 6053 /** 6054 * Enable auto device switch for session. 6055 * 6056 * @param { boolean } enabled - enable auto device switch if TRUE. 6057 * @throws { BusinessError } 401 - Parameter error. Possible causes: 6058 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 6059 * 3. Parameters verification failed. 6060 * @throws { BusinessError } 7400102 - Operation not allowed. 6061 * @throws { BusinessError } 7400103 - Session not config. 6062 * @throws { BusinessError } 7400201 - Camera service fatal error. 6063 * @syscap SystemCapability.Multimedia.Camera.Core 6064 * @since 13 6065 */ 6066 /** 6067 * Enable auto device switch for session. 6068 * 6069 * @param { boolean } enabled - enable auto device switch if TRUE. 6070 * @throws { BusinessError } 7400101 - Parameter error. Possible causes: 6071 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 6072 * 3. Parameters verification failed. 6073 * @throws { BusinessError } 7400102 - Operation not allowed. 6074 * @throws { BusinessError } 7400103 - Session not config. 6075 * @throws { BusinessError } 7400201 - Camera service fatal error. 6076 * @syscap SystemCapability.Multimedia.Camera.Core 6077 * @atomicservice 6078 * @since 19 6079 */ 6080 enableAutoDeviceSwitch(enabled: boolean): void; 6081 } 6082 6083 /** 6084 * Auto Device Switch Status. 6085 * 6086 * @typedef AutoDeviceSwitchStatus 6087 * @syscap SystemCapability.Multimedia.Camera.Core 6088 * @since 13 6089 */ 6090 /** 6091 * Auto Device Switch Status. 6092 * 6093 * @typedef AutoDeviceSwitchStatus 6094 * @syscap SystemCapability.Multimedia.Camera.Core 6095 * @atomicservice 6096 * @since 19 6097 */ 6098 interface AutoDeviceSwitchStatus { 6099 /** 6100 * Notify whether device is switched. 6101 * 6102 * @type { boolean } 6103 * @readonly 6104 * @syscap SystemCapability.Multimedia.Camera.Core 6105 * @since 13 6106 */ 6107 /** 6108 * Notify whether device is switched. 6109 * 6110 * @type { boolean } 6111 * @readonly 6112 * @syscap SystemCapability.Multimedia.Camera.Core 6113 * @atomicservice 6114 * @since 19 6115 */ 6116 readonly isDeviceSwitched: boolean; 6117 6118 /** 6119 * Notify whether device capability is changed. 6120 * 6121 * @type { boolean } 6122 * @readonly 6123 * @syscap SystemCapability.Multimedia.Camera.Core 6124 * @since 13 6125 */ 6126 /** 6127 * Notify whether device capability is changed. 6128 * 6129 * @type { boolean } 6130 * @readonly 6131 * @syscap SystemCapability.Multimedia.Camera.Core 6132 * @atomicservice 6133 * @since 19 6134 */ 6135 readonly isDeviceCapabilityChanged: boolean; 6136 } 6137 6138 /** 6139 * Macro Query object. 6140 * 6141 * @interface MacroQuery 6142 * @syscap SystemCapability.Multimedia.Camera.Core 6143 * @systemapi 6144 * @since 12 6145 */ 6146 /** 6147 * Macro Query object. 6148 * 6149 * @interface MacroQuery 6150 * @syscap SystemCapability.Multimedia.Camera.Core 6151 * @atomicservice 6152 * @since 19 6153 */ 6154 interface MacroQuery { 6155 /** 6156 * Determine whether camera macro is supported. 6157 * 6158 * @returns { boolean } Is camera macro supported. 6159 * @throws { BusinessError } 202 - Not System Application. 6160 * @syscap SystemCapability.Multimedia.Camera.Core 6161 * @systemapi 6162 * @since 11 6163 */ 6164 /** 6165 * Determine whether camera macro is supported. 6166 * Move to MacroQuery interface from Macro since 12. 6167 * 6168 * @returns { boolean } Is camera macro supported. 6169 * @throws { BusinessError } 202 - Not System Application. 6170 * @syscap SystemCapability.Multimedia.Camera.Core 6171 * @systemapi 6172 * @since 12 6173 */ 6174 /** 6175 * Determine whether camera macro is supported. 6176 * 6177 * @returns { boolean } Is camera macro supported. 6178 * @syscap SystemCapability.Multimedia.Camera.Core 6179 * @atomicservice 6180 * @since 19 6181 */ 6182 isMacroSupported(): boolean; 6183 } 6184 6185 /** 6186 * Macro object. 6187 * 6188 * @extends MacroQuery 6189 * @interface Macro 6190 * @syscap SystemCapability.Multimedia.Camera.Core 6191 * @systemapi 6192 * @since 11 6193 */ 6194 /** 6195 * Macro object. 6196 * 6197 * @extends MacroQuery 6198 * @interface Macro 6199 * @syscap SystemCapability.Multimedia.Camera.Core 6200 * @atomicservice 6201 * @since 19 6202 */ 6203 interface Macro extends MacroQuery { 6204 /** 6205 * Enable macro for camera. 6206 * 6207 * @param { boolean } enabled - enable macro for camera if TRUE. 6208 * @throws { BusinessError } 202 - Not System Application. 6209 * @throws { BusinessError } 7400103 - Session not config. 6210 * @syscap SystemCapability.Multimedia.Camera.Core 6211 * @systemapi 6212 * @since 11 6213 */ 6214 /** 6215 * Enable macro for camera. 6216 * 6217 * @param { boolean } enabled - enable macro for camera if TRUE. 6218 * @throws { BusinessError } 202 - Not System Application. 6219 * @throws { BusinessError } 7400102 - Operation not allowed. 6220 * @throws { BusinessError } 7400103 - Session not config. 6221 * @syscap SystemCapability.Multimedia.Camera.Core 6222 * @systemapi 6223 * @since 12 6224 */ 6225 /** 6226 * Enable macro for camera. 6227 * 6228 * @param { boolean } enabled - enable macro for camera if TRUE. 6229 * @throws { BusinessError } 7400102 - Operation not allowed. 6230 * @throws { BusinessError } 7400103 - Session not config. 6231 * @syscap SystemCapability.Multimedia.Camera.Core 6232 * @atomicservice 6233 * @since 19 6234 */ 6235 enableMacro(enabled: boolean): void; 6236 } 6237 6238 /** 6239 * Enum for usage type used in capture session. 6240 * 6241 * @enum { number } 6242 * @syscap SystemCapability.Multimedia.Camera.Core 6243 * @systemapi 6244 * @since 13 6245 */ 6246 enum UsageType { 6247 /** 6248 * Bokeh usage type. 6249 * 6250 * @syscap SystemCapability.Multimedia.Camera.Core 6251 * @systemapi 6252 * @since 13 6253 */ 6254 BOKEH = 0 6255 } 6256 6257 /** 6258 * Session object. 6259 * 6260 * @interface Session 6261 * @syscap SystemCapability.Multimedia.Camera.Core 6262 * @since 11 6263 */ 6264 /** 6265 * Session object. 6266 * 6267 * @interface Session 6268 * @syscap SystemCapability.Multimedia.Camera.Core 6269 * @atomicservice 6270 * @since 19 6271 */ 6272 interface Session { 6273 /** 6274 * Begin capture session config. 6275 * 6276 * @throws { BusinessError } 7400105 - Session config locked. 6277 * @syscap SystemCapability.Multimedia.Camera.Core 6278 * @since 11 6279 */ 6280 /** 6281 * Begin capture session config. 6282 * 6283 * @throws { BusinessError } 7400105 - Session config locked. 6284 * @throws { BusinessError } 7400201 - Camera service fatal error. 6285 * @syscap SystemCapability.Multimedia.Camera.Core 6286 * @since 12 6287 */ 6288 /** 6289 * Begin capture session config. 6290 * 6291 * @throws { BusinessError } 7400105 - Session config locked. 6292 * @throws { BusinessError } 7400201 - Camera service fatal error. 6293 * @syscap SystemCapability.Multimedia.Camera.Core 6294 * @atomicservice 6295 * @since 19 6296 */ 6297 beginConfig(): void; 6298 6299 /** 6300 * Commit capture session config. 6301 * 6302 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6303 * @throws { BusinessError } 7400102 - Operation not allowed. 6304 * @throws { BusinessError } 7400201 - Camera service fatal error. 6305 * @syscap SystemCapability.Multimedia.Camera.Core 6306 * @since 11 6307 */ 6308 /** 6309 * Commit capture session config. 6310 * 6311 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6312 * @throws { BusinessError } 7400102 - Operation not allowed. 6313 * @throws { BusinessError } 7400201 - Camera service fatal error. 6314 * @syscap SystemCapability.Multimedia.Camera.Core 6315 * @atomicservice 6316 * @since 19 6317 */ 6318 commitConfig(callback: AsyncCallback<void>): void; 6319 6320 /** 6321 * Commit capture session config. 6322 * 6323 * @returns { Promise<void> } Promise used to return the result. 6324 * @throws { BusinessError } 7400102 - Operation not allowed. 6325 * @throws { BusinessError } 7400201 - Camera service fatal error. 6326 * @syscap SystemCapability.Multimedia.Camera.Core 6327 * @since 11 6328 */ 6329 /** 6330 * Commit capture session config. 6331 * 6332 * @returns { Promise<void> } Promise used to return the result. 6333 * @throws { BusinessError } 7400102 - Operation not allowed. 6334 * @throws { BusinessError } 7400201 - Camera service fatal error. 6335 * @syscap SystemCapability.Multimedia.Camera.Core 6336 * @atomicservice 6337 * @since 19 6338 */ 6339 commitConfig(): Promise<void>; 6340 6341 /** 6342 * Determines whether the camera input can be added into the session. 6343 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6344 * 6345 * @param { CameraInput } cameraInput - Target camera input to add. 6346 * @returns { boolean } You can add the input into the session. 6347 * @syscap SystemCapability.Multimedia.Camera.Core 6348 * @since 11 6349 */ 6350 /** 6351 * Determines whether the camera input can be added into the session. 6352 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6353 * 6354 * @param { CameraInput } cameraInput - Target camera input to add. 6355 * @returns { boolean } You can add the input into the session. 6356 * @syscap SystemCapability.Multimedia.Camera.Core 6357 * @atomicservice 6358 * @since 19 6359 */ 6360 canAddInput(cameraInput: CameraInput): boolean; 6361 6362 /** 6363 * Adds a camera input. 6364 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6365 * 6366 * @param { CameraInput } cameraInput - Target camera input to add. 6367 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6368 * @throws { BusinessError } 7400102 - Operation not allowed. 6369 * @throws { BusinessError } 7400103 - Session not config. 6370 * @syscap SystemCapability.Multimedia.Camera.Core 6371 * @since 11 6372 */ 6373 /** 6374 * Adds a camera input. 6375 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6376 * 6377 * @param { CameraInput } cameraInput - Target camera input to add. 6378 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6379 * @throws { BusinessError } 7400102 - Operation not allowed. 6380 * @throws { BusinessError } 7400103 - Session not config. 6381 * @throws { BusinessError } 7400201 - Camera service fatal error. 6382 * @syscap SystemCapability.Multimedia.Camera.Core 6383 * @since 12 6384 */ 6385 /** 6386 * Adds a camera input. 6387 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6388 * 6389 * @param { CameraInput } cameraInput - Target camera input to add. 6390 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6391 * @throws { BusinessError } 7400102 - Operation not allowed. 6392 * @throws { BusinessError } 7400201 - Camera service fatal error. 6393 * @syscap SystemCapability.Multimedia.Camera.Core 6394 * @since 18 6395 */ 6396 /** 6397 * Adds a camera input. 6398 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6399 * 6400 * @param { CameraInput } cameraInput - Target camera input to add. 6401 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6402 * @throws { BusinessError } 7400102 - Operation not allowed. 6403 * @throws { BusinessError } 7400201 - Camera service fatal error. 6404 * @syscap SystemCapability.Multimedia.Camera.Core 6405 * @atomicservice 6406 * @since 19 6407 */ 6408 addInput(cameraInput: CameraInput): void; 6409 6410 /** 6411 * Removes a camera input. 6412 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6413 * 6414 * @param { CameraInput } cameraInput - Target camera input to remove. 6415 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6416 * @throws { BusinessError } 7400102 - Operation not allowed. 6417 * @throws { BusinessError } 7400103 - Session not config. 6418 * @syscap SystemCapability.Multimedia.Camera.Core 6419 * @since 11 6420 */ 6421 /** 6422 * Removes a camera input. 6423 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6424 * 6425 * @param { CameraInput } cameraInput - Target camera input to remove. 6426 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6427 * @throws { BusinessError } 7400102 - Operation not allowed. 6428 * @throws { BusinessError } 7400103 - Session not config. 6429 * @throws { BusinessError } 7400201 - Camera service fatal error. 6430 * @syscap SystemCapability.Multimedia.Camera.Core 6431 * @since 12 6432 */ 6433 /** 6434 * Removes a camera input. 6435 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6436 * 6437 * @param { CameraInput } cameraInput - Target camera input to remove. 6438 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6439 * @throws { BusinessError } 7400102 - Operation not allowed. 6440 * @throws { BusinessError } 7400201 - Camera service fatal error. 6441 * @syscap SystemCapability.Multimedia.Camera.Core 6442 * @since 18 6443 */ 6444 /** 6445 * Removes a camera input. 6446 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6447 * 6448 * @param { CameraInput } cameraInput - Target camera input to remove. 6449 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6450 * @throws { BusinessError } 7400102 - Operation not allowed. 6451 * @throws { BusinessError } 7400201 - Camera service fatal error. 6452 * @syscap SystemCapability.Multimedia.Camera.Core 6453 * @atomicservice 6454 * @since 19 6455 */ 6456 removeInput(cameraInput: CameraInput): void; 6457 6458 /** 6459 * Determines whether the camera output can be added into the session. 6460 * This method is valid after Session.addInput(cameraInput) and before Session.commitConfig(). 6461 * 6462 * @param { CameraOutput } cameraOutput - Target camera output to add. 6463 * @returns { boolean } You can add the output into the session. 6464 * @syscap SystemCapability.Multimedia.Camera.Core 6465 * @since 11 6466 */ 6467 /** 6468 * Determines whether the camera output can be added into the session. 6469 * This method is valid after Session.addInput(cameraInput) and before Session.commitConfig(). 6470 * 6471 * @param { CameraOutput } cameraOutput - Target camera output to add. 6472 * @returns { boolean } You can add the output into the session. 6473 * @syscap SystemCapability.Multimedia.Camera.Core 6474 * @atomicservice 6475 * @since 19 6476 */ 6477 canAddOutput(cameraOutput: CameraOutput): boolean; 6478 6479 /** 6480 * Adds a camera output. 6481 * This method is valid after Session.addInput(cameraInput) and before Session.commitConfig(). 6482 * 6483 * @param { CameraOutput } cameraOutput - Target camera output to add. 6484 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6485 * @throws { BusinessError } 7400102 - Operation not allowed. 6486 * @throws { BusinessError } 7400103 - Session not config. 6487 * @syscap SystemCapability.Multimedia.Camera.Core 6488 * @since 11 6489 */ 6490 /** 6491 * Adds a camera output. 6492 * This method is valid after Session.addInput(cameraInput) and before Session.commitConfig(). 6493 * 6494 * @param { CameraOutput } cameraOutput - Target camera output to add. 6495 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6496 * @throws { BusinessError } 7400102 - Operation not allowed. 6497 * @throws { BusinessError } 7400103 - Session not config. 6498 * @throws { BusinessError } 7400201 - Camera service fatal error. 6499 * @syscap SystemCapability.Multimedia.Camera.Core 6500 * @since 12 6501 */ 6502 /** 6503 * Adds a camera output. 6504 * This method is valid after Session.addInput(cameraInput) and before Session.commitConfig(). 6505 * 6506 * @param { CameraOutput } cameraOutput - Target camera output to add. 6507 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6508 * @throws { BusinessError } 7400102 - Operation not allowed. 6509 * @throws { BusinessError } 7400201 - Camera service fatal error. 6510 * @syscap SystemCapability.Multimedia.Camera.Core 6511 * @since 18 6512 */ 6513 /** 6514 * Adds a camera output. 6515 * This method is valid after Session.addInput(cameraInput) and before Session.commitConfig(). 6516 * 6517 * @param { CameraOutput } cameraOutput - Target camera output to add. 6518 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6519 * @throws { BusinessError } 7400102 - Operation not allowed. 6520 * @throws { BusinessError } 7400201 - Camera service fatal error. 6521 * @syscap SystemCapability.Multimedia.Camera.Core 6522 * @atomicservice 6523 * @since 19 6524 */ 6525 addOutput(cameraOutput: CameraOutput): void; 6526 6527 /** 6528 * Removes a camera output. 6529 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6530 * 6531 * @param { CameraOutput } cameraOutput - Target camera output to remove. 6532 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6533 * @throws { BusinessError } 7400102 - Operation not allowed. 6534 * @throws { BusinessError } 7400103 - Session not config. 6535 * @syscap SystemCapability.Multimedia.Camera.Core 6536 * @since 11 6537 */ 6538 /** 6539 * Removes a camera output. 6540 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6541 * 6542 * @param { CameraOutput } cameraOutput - Target camera output to remove. 6543 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6544 * @throws { BusinessError } 7400102 - Operation not allowed. 6545 * @throws { BusinessError } 7400103 - Session not config. 6546 * @throws { BusinessError } 7400201 - Camera service fatal error. 6547 * @syscap SystemCapability.Multimedia.Camera.Core 6548 * @since 12 6549 */ 6550 /** 6551 * Removes a camera output. 6552 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6553 * 6554 * @param { CameraOutput } cameraOutput - Target camera output to remove. 6555 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6556 * @throws { BusinessError } 7400102 - Operation not allowed. 6557 * @throws { BusinessError } 7400201 - Camera service fatal error. 6558 * @syscap SystemCapability.Multimedia.Camera.Core 6559 * @since 18 6560 */ 6561 /** 6562 * Removes a camera output. 6563 * This method is valid between Session.beginConfig() and Session.commitConfig(). 6564 * 6565 * @param { CameraOutput } cameraOutput - Target camera output to remove. 6566 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6567 * @throws { BusinessError } 7400102 - Operation not allowed. 6568 * @throws { BusinessError } 7400201 - Camera service fatal error. 6569 * @syscap SystemCapability.Multimedia.Camera.Core 6570 * @atomicservice 6571 * @since 19 6572 */ 6573 removeOutput(cameraOutput: CameraOutput): void; 6574 6575 /** 6576 * Starts capture session. 6577 * 6578 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6579 * @throws { BusinessError } 7400103 - Session not config. 6580 * @throws { BusinessError } 7400201 - Camera service fatal error. 6581 * @syscap SystemCapability.Multimedia.Camera.Core 6582 * @since 11 6583 */ 6584 /** 6585 * Starts capture session. 6586 * 6587 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6588 * @throws { BusinessError } 7400102 - Operation not allowed. 6589 * @throws { BusinessError } 7400103 - Session not config. 6590 * @throws { BusinessError } 7400201 - Camera service fatal error. 6591 * @syscap SystemCapability.Multimedia.Camera.Core 6592 * @since 12 6593 */ 6594 /** 6595 * Starts capture session. 6596 * 6597 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6598 * @throws { BusinessError } 7400102 - Operation not allowed. 6599 * @throws { BusinessError } 7400103 - Session not config. 6600 * @throws { BusinessError } 7400201 - Camera service fatal error. 6601 * @syscap SystemCapability.Multimedia.Camera.Core 6602 * @atomicservice 6603 * @since 19 6604 */ 6605 start(callback: AsyncCallback<void>): void; 6606 6607 /** 6608 * Starts capture session. 6609 * 6610 * @returns { Promise<void> } Promise used to return the result. 6611 * @throws { BusinessError } 7400103 - Session not config. 6612 * @throws { BusinessError } 7400201 - Camera service fatal error. 6613 * @syscap SystemCapability.Multimedia.Camera.Core 6614 * @since 11 6615 */ 6616 /** 6617 * Starts capture session. 6618 * 6619 * @returns { Promise<void> } Promise used to return the result. 6620 * @throws { BusinessError } 7400102 - Operation not allowed. 6621 * @throws { BusinessError } 7400103 - Session not config. 6622 * @throws { BusinessError } 7400201 - Camera service fatal error. 6623 * @syscap SystemCapability.Multimedia.Camera.Core 6624 * @since 12 6625 */ 6626 /** 6627 * Starts capture session. 6628 * 6629 * @returns { Promise<void> } Promise used to return the result. 6630 * @throws { BusinessError } 7400102 - Operation not allowed. 6631 * @throws { BusinessError } 7400103 - Session not config. 6632 * @throws { BusinessError } 7400201 - Camera service fatal error. 6633 * @syscap SystemCapability.Multimedia.Camera.Core 6634 * @atomicservice 6635 * @since 19 6636 */ 6637 start(): Promise<void>; 6638 6639 /** 6640 * Stops capture session. 6641 * 6642 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6643 * @throws { BusinessError } 7400201 - Camera service fatal error. 6644 * @syscap SystemCapability.Multimedia.Camera.Core 6645 * @since 11 6646 */ 6647 /** 6648 * Stops capture session. 6649 * 6650 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6651 * @throws { BusinessError } 7400201 - Camera service fatal error. 6652 * @syscap SystemCapability.Multimedia.Camera.Core 6653 * @atomicservice 6654 * @since 19 6655 */ 6656 stop(callback: AsyncCallback<void>): void; 6657 6658 /** 6659 * Stops capture session. 6660 * 6661 * @returns { Promise<void> } Promise used to return the result. 6662 * @throws { BusinessError } 7400201 - Camera service fatal error. 6663 * @syscap SystemCapability.Multimedia.Camera.Core 6664 * @since 11 6665 */ 6666 /** 6667 * Stops capture session. 6668 * 6669 * @returns { Promise<void> } Promise used to return the result. 6670 * @throws { BusinessError } 7400201 - Camera service fatal error. 6671 * @syscap SystemCapability.Multimedia.Camera.Core 6672 * @atomicservice 6673 * @since 19 6674 */ 6675 stop(): Promise<void>; 6676 6677 /** 6678 * Release capture session instance. 6679 * 6680 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6681 * @throws { BusinessError } 7400201 - Camera service fatal error. 6682 * @syscap SystemCapability.Multimedia.Camera.Core 6683 * @since 11 6684 */ 6685 /** 6686 * Release capture session instance. 6687 * 6688 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6689 * @throws { BusinessError } 7400201 - Camera service fatal error. 6690 * @syscap SystemCapability.Multimedia.Camera.Core 6691 * @atomicservice 6692 * @since 19 6693 */ 6694 release(callback: AsyncCallback<void>): void; 6695 6696 /** 6697 * Release capture session instance. 6698 * 6699 * @returns { Promise<void> } Promise used to return the result. 6700 * @throws { BusinessError } 7400201 - Camera service fatal error. 6701 * @syscap SystemCapability.Multimedia.Camera.Core 6702 * @since 11 6703 */ 6704 /** 6705 * Release capture session instance. 6706 * 6707 * @returns { Promise<void> } Promise used to return the result. 6708 * @throws { BusinessError } 7400201 - Camera service fatal error. 6709 * @syscap SystemCapability.Multimedia.Camera.Core 6710 * @atomicservice 6711 * @since 19 6712 */ 6713 release(): Promise<void>; 6714 6715 /** 6716 * Set usage for the capture session. 6717 * 6718 * @param { UsageType } usage - The capture session usage. 6719 * @param { boolean } enabled - Enable usage for session if TRUE. 6720 * @throws { BusinessError } 202 - Not System Application. 6721 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6722 * @throws { BusinessError } 7400102 - Operation not allowed. 6723 * @throws { BusinessError } 7400103 - Session not config. 6724 * @throws { BusinessError } 7400201 - Camera service fatal error. 6725 * @syscap SystemCapability.Multimedia.Camera.Core 6726 * @systemapi 6727 * @since 13 6728 */ 6729 setUsage(usage: UsageType, enabled: boolean): void; 6730 6731 /** 6732 * Get the supported camera output capability set. 6733 * 6734 * @param { CameraDevice } camera - Camera device. 6735 * @returns { Array<CameraOutputCapability> } The array of the output capability. 6736 * @throws { BusinessError } 202 - Not System Application. 6737 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6738 * @throws { BusinessError } 7400201 - Camera service fatal error. 6739 * @syscap SystemCapability.Multimedia.Camera.Core 6740 * @systemapi 6741 * @since 13 6742 */ 6743 getCameraOutputCapabilities(camera: CameraDevice): Array<CameraOutputCapability>; 6744 } 6745 6746 /** 6747 * Capture session object. 6748 * 6749 * @interface CaptureSession 6750 * @syscap SystemCapability.Multimedia.Camera.Core 6751 * @since 10 6752 * @deprecated since 11 6753 * @useinstead ohos.multimedia.camera.VideoSession 6754 */ 6755 interface CaptureSession { 6756 /** 6757 * Begin capture session config. 6758 * 6759 * @throws { BusinessError } 7400105 - Session config locked. 6760 * @syscap SystemCapability.Multimedia.Camera.Core 6761 * @since 10 6762 * @deprecated since 11 6763 * @useinstead ohos.multimedia.camera.Session#beginConfig 6764 */ 6765 beginConfig(): void; 6766 6767 /** 6768 * Commit capture session config. 6769 * 6770 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6771 * @throws { BusinessError } 7400102 - Operation not allowed. 6772 * @throws { BusinessError } 7400201 - Camera service fatal error. 6773 * @syscap SystemCapability.Multimedia.Camera.Core 6774 * @since 10 6775 * @deprecated since 11 6776 * @useinstead ohos.multimedia.camera.Session#commitConfig 6777 */ 6778 commitConfig(callback: AsyncCallback<void>): void; 6779 6780 /** 6781 * Commit capture session config. 6782 * 6783 * @returns { Promise<void> } Promise used to return the result. 6784 * @throws { BusinessError } 7400102 - Operation not allowed. 6785 * @throws { BusinessError } 7400201 - Camera service fatal error. 6786 * @syscap SystemCapability.Multimedia.Camera.Core 6787 * @since 10 6788 * @deprecated since 11 6789 * @useinstead ohos.multimedia.camera.Session#commitConfig 6790 */ 6791 commitConfig(): Promise<void>; 6792 6793 /** 6794 * Adds a camera input. 6795 * 6796 * @param { CameraInput } cameraInput - Target camera input to add. 6797 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6798 * @throws { BusinessError } 7400102 - Operation not allowed. 6799 * @syscap SystemCapability.Multimedia.Camera.Core 6800 * @since 10 6801 * @deprecated since 11 6802 * @useinstead ohos.multimedia.camera.Session#addInput 6803 */ 6804 addInput(cameraInput: CameraInput): void; 6805 6806 /** 6807 * Removes a camera input. 6808 * 6809 * @param { CameraInput } cameraInput - Target camera input to remove. 6810 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6811 * @throws { BusinessError } 7400102 - Operation not allowed. 6812 * @syscap SystemCapability.Multimedia.Camera.Core 6813 * @since 10 6814 * @deprecated since 11 6815 * @useinstead ohos.multimedia.camera.Session#removeInput 6816 */ 6817 removeInput(cameraInput: CameraInput): void; 6818 6819 /** 6820 * Adds a camera output. 6821 * 6822 * @param { CameraOutput } cameraOutput - Target camera output to add. 6823 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6824 * @throws { BusinessError } 7400102 - Operation not allowed. 6825 * @syscap SystemCapability.Multimedia.Camera.Core 6826 * @since 10 6827 * @deprecated since 11 6828 * @useinstead ohos.multimedia.camera.Session#addOutput 6829 */ 6830 addOutput(cameraOutput: CameraOutput): void; 6831 6832 /** 6833 * Removes a camera output. 6834 * 6835 * @param { CameraOutput } cameraOutput - Target camera output to remove. 6836 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 6837 * @throws { BusinessError } 7400102 - Operation not allowed. 6838 * @syscap SystemCapability.Multimedia.Camera.Core 6839 * @since 10 6840 * @deprecated since 11 6841 * @useinstead ohos.multimedia.camera.Session#removeOutput 6842 */ 6843 removeOutput(cameraOutput: CameraOutput): void; 6844 6845 /** 6846 * Starts capture session. 6847 * 6848 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6849 * @throws { BusinessError } 7400103 - Session not config. 6850 * @throws { BusinessError } 7400201 - Camera service fatal error. 6851 * @syscap SystemCapability.Multimedia.Camera.Core 6852 * @since 10 6853 * @deprecated since 11 6854 * @useinstead ohos.multimedia.camera.Session#start 6855 */ 6856 start(callback: AsyncCallback<void>): void; 6857 6858 /** 6859 * Starts capture session. 6860 * 6861 * @returns { Promise<void> } Promise used to return the result. 6862 * @throws { BusinessError } 7400103 - Session not config. 6863 * @throws { BusinessError } 7400201 - Camera service fatal error. 6864 * @syscap SystemCapability.Multimedia.Camera.Core 6865 * @since 10 6866 * @deprecated since 11 6867 * @useinstead ohos.multimedia.camera.Session#start 6868 */ 6869 start(): Promise<void>; 6870 6871 /** 6872 * Stops capture session. 6873 * 6874 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6875 * @throws { BusinessError } 7400201 - Camera service fatal error. 6876 * @syscap SystemCapability.Multimedia.Camera.Core 6877 * @since 10 6878 * @deprecated since 11 6879 * @useinstead ohos.multimedia.camera.Session#stop 6880 */ 6881 stop(callback: AsyncCallback<void>): void; 6882 6883 /** 6884 * Stops capture session. 6885 * 6886 * @returns { Promise<void> } Promise used to return the result. 6887 * @throws { BusinessError } 7400201 - Camera service fatal error. 6888 * @syscap SystemCapability.Multimedia.Camera.Core 6889 * @since 10 6890 * @deprecated since 11 6891 * @useinstead ohos.multimedia.camera.Session#stop 6892 */ 6893 stop(): Promise<void>; 6894 6895 /** 6896 * Release capture session instance. 6897 * 6898 * @param { AsyncCallback<void> } callback - Callback used to return the result. 6899 * @throws { BusinessError } 7400201 - Camera service fatal error. 6900 * @syscap SystemCapability.Multimedia.Camera.Core 6901 * @since 10 6902 * @deprecated since 11 6903 * @useinstead ohos.multimedia.camera.Session#release 6904 */ 6905 release(callback: AsyncCallback<void>): void; 6906 6907 /** 6908 * Release capture session instance. 6909 * 6910 * @returns { Promise<void> } Promise used to return the result. 6911 * @throws { BusinessError } 7400201 - Camera service fatal error. 6912 * @syscap SystemCapability.Multimedia.Camera.Core 6913 * @since 10 6914 * @deprecated since 11 6915 * @useinstead ohos.multimedia.camera.Session#release 6916 */ 6917 release(): Promise<void>; 6918 6919 /** 6920 * Check if device has flash light. 6921 * 6922 * @returns { boolean } The flash light support status. 6923 * @throws { BusinessError } 7400103 - Session not config. 6924 * @syscap SystemCapability.Multimedia.Camera.Core 6925 * @since 10 6926 * @deprecated since 11 6927 * @useinstead ohos.multimedia.camera.Flash#hasFlash 6928 */ 6929 hasFlash(): boolean; 6930 6931 /** 6932 * Checks whether a specified flash mode is supported. 6933 * 6934 * @param { FlashMode } flashMode - Flash mode 6935 * @returns { boolean } Is the flash mode supported. 6936 * @throws { BusinessError } 7400103 - Session not config. 6937 * @syscap SystemCapability.Multimedia.Camera.Core 6938 * @since 10 6939 * @deprecated since 11 6940 * @useinstead ohos.multimedia.camera.Flash#isFlashModeSupported 6941 */ 6942 isFlashModeSupported(flashMode: FlashMode): boolean; 6943 6944 /** 6945 * Gets current flash mode. 6946 * 6947 * @returns { FlashMode } The current flash mode. 6948 * @throws { BusinessError } 7400103 - Session not config. 6949 * @syscap SystemCapability.Multimedia.Camera.Core 6950 * @since 10 6951 * @deprecated since 11 6952 * @useinstead ohos.multimedia.camera.Flash#getFlashMode 6953 */ 6954 getFlashMode(): FlashMode; 6955 6956 /** 6957 * Sets flash mode. 6958 * 6959 * @param { FlashMode } flashMode - Target flash mode. 6960 * @throws { BusinessError } 7400103 - Session not config. 6961 * @syscap SystemCapability.Multimedia.Camera.Core 6962 * @since 10 6963 * @deprecated since 11 6964 * @useinstead ohos.multimedia.camera.Flash#setFlashMode 6965 */ 6966 setFlashMode(flashMode: FlashMode): void; 6967 6968 /** 6969 * Checks whether a specified exposure mode is supported. 6970 * 6971 * @param { ExposureMode } aeMode - Exposure mode 6972 * @returns { boolean } Is the exposure mode supported. 6973 * @throws { BusinessError } 7400103 - Session not config. 6974 * @syscap SystemCapability.Multimedia.Camera.Core 6975 * @since 10 6976 * @deprecated since 11 6977 * @useinstead ohos.multimedia.camera.AutoExposure#isExposureModeSupported 6978 */ 6979 isExposureModeSupported(aeMode: ExposureMode): boolean; 6980 6981 /** 6982 * Gets current exposure mode. 6983 * 6984 * @returns { ExposureMode } The current exposure mode. 6985 * @throws { BusinessError } 7400103 - Session not config. 6986 * @syscap SystemCapability.Multimedia.Camera.Core 6987 * @since 10 6988 * @deprecated since 11 6989 * @useinstead ohos.multimedia.camera.AutoExposure#getExposureMode 6990 */ 6991 getExposureMode(): ExposureMode; 6992 6993 /** 6994 * Sets Exposure mode. 6995 * 6996 * @param { ExposureMode } aeMode - Exposure mode 6997 * @throws { BusinessError } 7400103 - Session not config. 6998 * @syscap SystemCapability.Multimedia.Camera.Core 6999 * @since 10 7000 * @deprecated since 11 7001 * @useinstead ohos.multimedia.camera.AutoExposure#setExposureMode 7002 */ 7003 setExposureMode(aeMode: ExposureMode): void; 7004 7005 /** 7006 * Gets current metering point. 7007 * 7008 * @returns { Point } The current metering point. 7009 * @throws { BusinessError } 7400103 - Session not config. 7010 * @syscap SystemCapability.Multimedia.Camera.Core 7011 * @since 10 7012 * @deprecated since 11 7013 * @useinstead ohos.multimedia.camera.AutoExposure#getMeteringPoint 7014 */ 7015 getMeteringPoint(): Point; 7016 7017 /** 7018 * Set the center point of the exposure area, the exposure point should be located in the 0-1 coordinate system, 7019 * which is {0, 0} in the upper left corner and {1, 1} in the bottom right corner. This coordinate system is 7020 * based on the horizontal device orientation when the device charging port is on the right side, e.g. the preview 7021 * interface layout of an application is based on the vertical direction when the device charging port is on the lower side, 7022 * the layout width and height is {w, h}, and the touch point is {x, y}. Then the transformed coordinate point is {y/h, 1-x/w}. 7023 * 7024 * @param { Point } point - metering point 7025 * @throws { BusinessError } 7400103 - Session not config. 7026 * @syscap SystemCapability.Multimedia.Camera.Core 7027 * @since 10 7028 * @deprecated since 11 7029 * @useinstead ohos.multimedia.camera.AutoExposure#setMeteringPoint 7030 */ 7031 setMeteringPoint(point: Point): void; 7032 7033 /** 7034 * Query the exposure compensation range. 7035 * 7036 * @returns { Array<number> } The array of compensation range. 7037 * @throws { BusinessError } 7400103 - Session not config. 7038 * @syscap SystemCapability.Multimedia.Camera.Core 7039 * @since 10 7040 * @deprecated since 11 7041 * @useinstead ohos.multimedia.camera.AutoExposure#getExposureBiasRange 7042 */ 7043 getExposureBiasRange(): Array<number>; 7044 7045 /** 7046 * Set exposure compensation. 7047 * 7048 * @param { number } exposureBias - Exposure compensation 7049 * @throws { BusinessError } 7400103 - Session not config. 7050 * @syscap SystemCapability.Multimedia.Camera.Core 7051 * @since 10 7052 * @deprecated since 11 7053 * @useinstead ohos.multimedia.camera.AutoExposure#setExposureBias 7054 */ 7055 setExposureBias(exposureBias: number): void; 7056 7057 /** 7058 * Queries the current exposure value. 7059 * 7060 * @returns { number } The exposure value. 7061 * @throws { BusinessError } 7400103 - Session not config. 7062 * @syscap SystemCapability.Multimedia.Camera.Core 7063 * @since 10 7064 * @deprecated since 11 7065 * @useinstead ohos.multimedia.camera.AutoExposure#getExposureValue 7066 */ 7067 getExposureValue(): number; 7068 7069 /** 7070 * Queries whether a specified focus mode is supported. 7071 * 7072 * @param { FocusMode } afMode - Focus mode. 7073 * @returns { boolean } Is the focus mode supported. 7074 * @throws { BusinessError } 7400103 - Session not config. 7075 * @syscap SystemCapability.Multimedia.Camera.Core 7076 * @since 10 7077 * @deprecated since 11 7078 * @useinstead ohos.multimedia.camera.Focus#isFocusModeSupported 7079 */ 7080 isFocusModeSupported(afMode: FocusMode): boolean; 7081 7082 /** 7083 * Gets current focus mode. 7084 * 7085 * @returns { FocusMode } The current focus mode. 7086 * @throws { BusinessError } 7400103 - Session not config. 7087 * @syscap SystemCapability.Multimedia.Camera.Core 7088 * @since 10 7089 * @deprecated since 11 7090 * @useinstead ohos.multimedia.camera.Focus#getFocusMode 7091 */ 7092 getFocusMode(): FocusMode; 7093 7094 /** 7095 * Sets focus mode. 7096 * 7097 * @param { FocusMode } afMode - Target focus mode. 7098 * @throws { BusinessError } 7400103 - Session not config. 7099 * @syscap SystemCapability.Multimedia.Camera.Core 7100 * @since 10 7101 * @deprecated since 11 7102 * @useinstead ohos.multimedia.camera.Focus#setFocusMode 7103 */ 7104 setFocusMode(afMode: FocusMode): void; 7105 7106 /** 7107 * Sets focus point. 7108 * 7109 * @param { Point } point - Target focus point. 7110 * @throws { BusinessError } 7400103 - Session not config. 7111 * @syscap SystemCapability.Multimedia.Camera.Core 7112 * @since 10 7113 * @deprecated since 11 7114 * @useinstead ohos.multimedia.camera.Focus#setFocusPoint 7115 */ 7116 setFocusPoint(point: Point): void; 7117 7118 /** 7119 * Gets current focus point. 7120 * 7121 * @returns { Point } The current focus point. 7122 * @throws { BusinessError } 7400103 - Session not config. 7123 * @syscap SystemCapability.Multimedia.Camera.Core 7124 * @since 10 7125 * @deprecated since 11 7126 * @useinstead ohos.multimedia.camera.Focus#getFocusPoint 7127 */ 7128 getFocusPoint(): Point; 7129 7130 /** 7131 * Gets current focal length. 7132 * 7133 * @returns { number } The current focal point. 7134 * @throws { BusinessError } 7400103 - Session not config. 7135 * @syscap SystemCapability.Multimedia.Camera.Core 7136 * @since 10 7137 * @deprecated since 11 7138 * @useinstead ohos.multimedia.camera.Focus#getFocalLength 7139 */ 7140 getFocalLength(): number; 7141 7142 /** 7143 * Gets all supported zoom ratio range. 7144 * 7145 * @returns { Array<number> } The zoom ratio range. 7146 * @throws { BusinessError } 7400103 - Session not config. 7147 * @syscap SystemCapability.Multimedia.Camera.Core 7148 * @since 10 7149 * @deprecated since 11 7150 * @useinstead ohos.multimedia.camera.Zoom#getZoomRatioRange 7151 */ 7152 getZoomRatioRange(): Array<number>; 7153 7154 /** 7155 * Gets zoom ratio. 7156 * 7157 * @returns { number } The zoom ratio value. 7158 * @throws { BusinessError } 7400103 - Session not config. 7159 * @syscap SystemCapability.Multimedia.Camera.Core 7160 * @since 10 7161 * @deprecated since 11 7162 * @useinstead ohos.multimedia.camera.Zoom#getZoomRatio 7163 */ 7164 getZoomRatio(): number; 7165 7166 /** 7167 * Sets zoom ratio. 7168 * 7169 * @param { number } zoomRatio - Target zoom ratio. 7170 * @throws { BusinessError } 7400103 - Session not config. 7171 * @syscap SystemCapability.Multimedia.Camera.Core 7172 * @since 10 7173 * @deprecated since 11 7174 * @useinstead ohos.multimedia.camera.Zoom#setZoomRatio 7175 */ 7176 setZoomRatio(zoomRatio: number): void; 7177 7178 /** 7179 * Check whether the specified video stabilization mode is supported. 7180 * 7181 * @param { VideoStabilizationMode } vsMode - Video Stabilization mode. 7182 * @returns { boolean } Is flash mode supported. 7183 * @throws { BusinessError } 7400103 - Session not config. 7184 * @syscap SystemCapability.Multimedia.Camera.Core 7185 * @since 10 7186 * @deprecated since 11 7187 * @useinstead ohos.multimedia.camera.Stabilization#isVideoStabilizationModeSupported 7188 */ 7189 isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean; 7190 7191 /** 7192 * Query the video stabilization mode currently in use. 7193 * 7194 * @returns { VideoStabilizationMode } The current video stabilization mode. 7195 * @throws { BusinessError } 7400103 - Session not config. 7196 * @syscap SystemCapability.Multimedia.Camera.Core 7197 * @since 10 7198 * @deprecated since 11 7199 * @useinstead ohos.multimedia.camera.Stabilization#getActiveVideoStabilizationMode 7200 */ 7201 getActiveVideoStabilizationMode(): VideoStabilizationMode; 7202 7203 /** 7204 * Set video stabilization mode. 7205 * 7206 * @param { VideoStabilizationMode } mode - video stabilization mode to set. 7207 * @throws { BusinessError } 7400103 - Session not config. 7208 * @syscap SystemCapability.Multimedia.Camera.Core 7209 * @since 10 7210 * @deprecated since 11 7211 * @useinstead ohos.multimedia.camera.Stabilization#setVideoStabilizationMode 7212 */ 7213 setVideoStabilizationMode(mode: VideoStabilizationMode): void; 7214 7215 /** 7216 * Subscribes focus status change event callback. 7217 * 7218 * @param { 'focusStateChange' } type - Event type. 7219 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7220 * @syscap SystemCapability.Multimedia.Camera.Core 7221 * @since 10 7222 * @deprecated since 11 7223 * @useinstead ohos.multimedia.camera.VideoSession#on 7224 */ 7225 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 7226 7227 /** 7228 * Unsubscribes from focus status change event callback. 7229 * 7230 * @param { 'focusStateChange' } type - Event type. 7231 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7232 * @syscap SystemCapability.Multimedia.Camera.Core 7233 * @since 10 7234 * @deprecated since 11 7235 * @useinstead ohos.multimedia.camera.VideoSession#off 7236 */ 7237 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 7238 7239 /** 7240 * Subscribes to error events. 7241 * 7242 * @param { 'error' } type - Event type. 7243 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7244 * @syscap SystemCapability.Multimedia.Camera.Core 7245 * @since 10 7246 * @deprecated since 11 7247 * @useinstead ohos.multimedia.camera.VideoSession#on 7248 */ 7249 on(type: 'error', callback: ErrorCallback): void; 7250 7251 /** 7252 * Unsubscribes from error events. 7253 * 7254 * @param { 'error' } type - Event type. 7255 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7256 * @syscap SystemCapability.Multimedia.Camera.Core 7257 * @since 10 7258 * @deprecated since 11 7259 * @useinstead ohos.multimedia.camera.VideoSession#off 7260 */ 7261 off(type: 'error', callback?: ErrorCallback): void; 7262 7263 /** 7264 * Gets supported beauty effect types. 7265 * 7266 * @returns { Array<BeautyType> } List of beauty effect types. 7267 * @throws { BusinessError } 7400103 - Session not config. 7268 * @syscap SystemCapability.Multimedia.Camera.Core 7269 * @systemapi 7270 * @since 10 7271 * @deprecated since 11 7272 * @useinstead ohos.multimedia.camera.Beauty#getSupportedBeautyTypes 7273 */ 7274 getSupportedBeautyTypes(): Array<BeautyType>; 7275 7276 /** 7277 * Gets the specific beauty effect type range. 7278 * 7279 * @param { BeautyType } type - The type of beauty effect. 7280 * @returns { Array<number> } The array of the specific beauty effect range. 7281 * @throws { BusinessError } 7400103 - Session not config. 7282 * @syscap SystemCapability.Multimedia.Camera.Core 7283 * @systemapi 7284 * @since 10 7285 * @deprecated since 11 7286 * @useinstead ohos.multimedia.camera.Beauty#getSupportedBeautyRange 7287 */ 7288 getSupportedBeautyRange(type: BeautyType): Array<number>; 7289 7290 /** 7291 * Gets the beauty effect in use. 7292 * 7293 * @param { BeautyType } type - The type of beauty effect. 7294 * @returns { number } the beauty effect in use. 7295 * @throws { BusinessError } 7400103 - Session not config. 7296 * @syscap SystemCapability.Multimedia.Camera.Core 7297 * @systemapi 7298 * @since 10 7299 * @deprecated since 11 7300 * @useinstead ohos.multimedia.camera.Beauty#getBeauty 7301 */ 7302 getBeauty(type: BeautyType): number; 7303 7304 /** 7305 * Sets a beauty effect for a camera device. 7306 * 7307 * @param { BeautyType } type - The type of beauty effect. 7308 * @param { number } value The number of beauty effect. 7309 * @throws { BusinessError } 7400103 - Session not config. 7310 * @syscap SystemCapability.Multimedia.Camera.Core 7311 * @systemapi 7312 * @since 10 7313 * @deprecated since 11 7314 * @useinstead ohos.multimedia.camera.Beauty#setBeauty 7315 */ 7316 setBeauty(type: BeautyType, value: number): void; 7317 } 7318 7319 /** 7320 * Types of preconfig, which used to configure session conveniently. 7321 * Preconfig type contains common use cases of camera output. 7322 * 7323 * @enum { number } 7324 * @syscap SystemCapability.Multimedia.Camera.Core 7325 * @since 12 7326 */ 7327 /** 7328 * Types of preconfig, which used to configure session conveniently. 7329 * Preconfig type contains common use cases of camera output. 7330 * 7331 * @enum { number } 7332 * @syscap SystemCapability.Multimedia.Camera.Core 7333 * @atomicservice 7334 * @since 19 7335 */ 7336 enum PreconfigType { 7337 /** 7338 * 720P output for preconfig. 7339 * 7340 * @syscap SystemCapability.Multimedia.Camera.Core 7341 * @since 12 7342 */ 7343 /** 7344 * 720P output for preconfig. 7345 * 7346 * @syscap SystemCapability.Multimedia.Camera.Core 7347 * @atomicservice 7348 * @since 19 7349 */ 7350 PRECONFIG_720P = 0, 7351 7352 /** 7353 * 1080P output for preconfig. 7354 * 7355 * @syscap SystemCapability.Multimedia.Camera.Core 7356 * @since 12 7357 */ 7358 /** 7359 * 1080P output for preconfig. 7360 * 7361 * @syscap SystemCapability.Multimedia.Camera.Core 7362 * @atomicservice 7363 * @since 19 7364 */ 7365 PRECONFIG_1080P = 1, 7366 7367 /** 7368 * 4K output for preconfig. 7369 * 7370 * @syscap SystemCapability.Multimedia.Camera.Core 7371 * @since 12 7372 */ 7373 /** 7374 * 4K output for preconfig. 7375 * 7376 * @syscap SystemCapability.Multimedia.Camera.Core 7377 * @atomicservice 7378 * @since 19 7379 */ 7380 PRECONFIG_4K = 2, 7381 7382 /** 7383 * high quality output for preconfig. 7384 * 7385 * @syscap SystemCapability.Multimedia.Camera.Core 7386 * @since 12 7387 */ 7388 /** 7389 * high quality output for preconfig. 7390 * 7391 * @syscap SystemCapability.Multimedia.Camera.Core 7392 * @atomicservice 7393 * @since 19 7394 */ 7395 PRECONFIG_HIGH_QUALITY = 3 7396 } 7397 7398 /** 7399 * The aspect ratios of preconfig, which used to configure session conveniently. 7400 * 7401 * @enum { number } 7402 * @syscap SystemCapability.Multimedia.Camera.Core 7403 * @since 12 7404 */ 7405 /** 7406 * The aspect ratios of preconfig, which used to configure session conveniently. 7407 * 7408 * @enum { number } 7409 * @syscap SystemCapability.Multimedia.Camera.Core 7410 * @atomicservice 7411 * @since 19 7412 */ 7413 enum PreconfigRatio { 7414 /** 7415 * Aspect ratio 1:1 for preconfig. 7416 * 7417 * @syscap SystemCapability.Multimedia.Camera.Core 7418 * @since 12 7419 */ 7420 /** 7421 * Aspect ratio 1:1 for preconfig. 7422 * 7423 * @syscap SystemCapability.Multimedia.Camera.Core 7424 * @atomicservice 7425 * @since 19 7426 */ 7427 PRECONFIG_RATIO_1_1 = 0, 7428 7429 /** 7430 * Aspect ratio 4:3 for preconfig. 7431 * 7432 * @syscap SystemCapability.Multimedia.Camera.Core 7433 * @since 12 7434 */ 7435 /** 7436 * Aspect ratio 4:3 for preconfig. 7437 * 7438 * @syscap SystemCapability.Multimedia.Camera.Core 7439 * @atomicservice 7440 * @since 19 7441 */ 7442 PRECONFIG_RATIO_4_3 = 1, 7443 7444 /** 7445 * Aspect ratio 16:9 for preconfig. 7446 * 7447 * @syscap SystemCapability.Multimedia.Camera.Core 7448 * @since 12 7449 */ 7450 /** 7451 * Aspect ratio 16:9 for preconfig. 7452 * 7453 * @syscap SystemCapability.Multimedia.Camera.Core 7454 * @atomicservice 7455 * @since 19 7456 */ 7457 PRECONFIG_RATIO_16_9 = 2 7458 } 7459 7460 /** 7461 * Enum for feature type used in scene detection. 7462 * 7463 * @enum { number } 7464 * @syscap SystemCapability.Multimedia.Camera.Core 7465 * @systemapi 7466 * @since 12 7467 */ 7468 enum SceneFeatureType { 7469 /** 7470 * Feature for boost moon capture. 7471 * 7472 * @syscap SystemCapability.Multimedia.Camera.Core 7473 * @systemapi 7474 * @since 12 7475 */ 7476 MOON_CAPTURE_BOOST = 0, 7477 7478 /** 7479 * Feature for tripod detection. 7480 * 7481 * @syscap SystemCapability.Multimedia.Camera.Core 7482 * @systemapi 7483 * @since 13 7484 */ 7485 TRIPOD_DETECTION = 1, 7486 7487 /** 7488 * Feature for low light boost. 7489 * 7490 * @syscap SystemCapability.Multimedia.Camera.Core 7491 * @systemapi 7492 * @since 13 7493 */ 7494 LOW_LIGHT_BOOST = 2 7495 } 7496 7497 /** 7498 * Feature Detection Result. 7499 * 7500 * @typedef SceneFeatureDetectionResult 7501 * @syscap SystemCapability.Multimedia.Camera.Core 7502 * @systemapi 7503 * @since 12 7504 */ 7505 interface SceneFeatureDetectionResult { 7506 /** 7507 * Detected feature type. 7508 * 7509 * @type { SceneFeatureType } 7510 * @readonly 7511 * @syscap SystemCapability.Multimedia.Camera.Core 7512 * @systemapi 7513 * @since 12 7514 */ 7515 readonly featureType: SceneFeatureType; 7516 7517 /** 7518 * Check whether feature is detected. 7519 * 7520 * @type { boolean } 7521 * @readonly 7522 * @syscap SystemCapability.Multimedia.Camera.Core 7523 * @systemapi 7524 * @since 12 7525 */ 7526 readonly detected: boolean; 7527 } 7528 7529 /** 7530 * Enum for tripod status. 7531 * 7532 * @enum { number } 7533 * @syscap SystemCapability.Multimedia.Camera.Core 7534 * @systemapi 7535 * @since 13 7536 */ 7537 enum TripodStatus { 7538 /** 7539 * Invalid tripod status. 7540 * 7541 * @syscap SystemCapability.Multimedia.Camera.Core 7542 * @systemapi 7543 * @since 13 7544 */ 7545 INVALID = 0, 7546 7547 /** 7548 * Tripod is active. 7549 * 7550 * @syscap SystemCapability.Multimedia.Camera.Core 7551 * @systemapi 7552 * @since 13 7553 */ 7554 ACTIVE = 1, 7555 7556 /** 7557 * Enter tripod stabilization state. 7558 * 7559 * @syscap SystemCapability.Multimedia.Camera.Core 7560 * @systemapi 7561 * @since 13 7562 */ 7563 ENTERING = 2, 7564 7565 /** 7566 * Exit tripod stabilization state. 7567 * 7568 * @syscap SystemCapability.Multimedia.Camera.Core 7569 * @systemapi 7570 * @since 13 7571 */ 7572 EXITING = 3 7573 } 7574 7575 /** 7576 * Tripod detection result. 7577 * 7578 * @extends SceneFeatureDetectionResult 7579 * @interface TripodDetectionResult 7580 * @syscap SystemCapability.Multimedia.Camera.Core 7581 * @systemapi 7582 * @since 13 7583 */ 7584 interface TripodDetectionResult extends SceneFeatureDetectionResult { 7585 /** 7586 * tripod status. 7587 * 7588 * @type { TripodStatus } 7589 * @readonly 7590 * @syscap SystemCapability.Multimedia.Camera.Core 7591 * @systemapi 7592 * @since 13 7593 */ 7594 readonly tripodStatus: TripodStatus; 7595 } 7596 7597 /** 7598 * Scene detection query. 7599 * 7600 * @interface SceneDetectionQuery 7601 * @syscap SystemCapability.Multimedia.Camera.Core 7602 * @systemapi 7603 * @since 12 7604 */ 7605 interface SceneDetectionQuery { 7606 /** 7607 * Check whether specified feature is supported. 7608 * 7609 * @param { SceneFeatureType } type - Specified feature type. 7610 * @returns { boolean } - Is specified feature supported. 7611 * @throws { BusinessError } 202 - Not System Application, only throw in session usage. 7612 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7613 * @syscap SystemCapability.Multimedia.Camera.Core 7614 * @systemapi 7615 * @since 12 7616 */ 7617 isSceneFeatureSupported(type: SceneFeatureType): boolean; 7618 } 7619 7620 /** 7621 * Scene detection. 7622 * 7623 * @extends SceneDetectionQuery 7624 * @interface SceneDetection 7625 * @syscap SystemCapability.Multimedia.Camera.Core 7626 * @systemapi 7627 * @since 12 7628 */ 7629 interface SceneDetection extends SceneDetectionQuery { 7630 /** 7631 * Enable specified feature. 7632 * 7633 * @param { SceneFeatureType } type - Specified feature type. 7634 * @param { boolean } enabled - Target feature status. 7635 * @throws { BusinessError } 202 - Not System Application. 7636 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 7637 * @syscap SystemCapability.Multimedia.Camera.Core 7638 * @systemapi 7639 * @since 12 7640 */ 7641 enableSceneFeature(type: SceneFeatureType, enabled: boolean): void; 7642 } 7643 7644 /** 7645 * Photo session object for system hap. 7646 * 7647 * @extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection, EffectSuggestion 7648 * @interface PhotoSessionForSys 7649 * @syscap SystemCapability.Multimedia.Camera.Core 7650 * @systemapi 7651 * @since 11 7652 */ 7653 /** 7654 * Photo session object for system hap. 7655 * 7656 * @extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection, EffectSuggestion, DepthFusion 7657 * @interface PhotoSessionForSys 7658 * @syscap SystemCapability.Multimedia.Camera.Core 7659 * @systemapi 7660 * @since 14 7661 */ 7662 interface PhotoSessionForSys extends PhotoSession, Beauty, ColorEffect, ColorManagement, Macro, SceneDetection, EffectSuggestion, DepthFusion { 7663 } 7664 7665 /** 7666 * Photo session object. 7667 * 7668 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement 7669 * @interface PhotoSession 7670 * @syscap SystemCapability.Multimedia.Camera.Core 7671 * @since 11 7672 */ 7673 /** 7674 * The Normal Photo Mode session category provides operations for flash, exposure, focus, zoom, and color space. 7675 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement, AutoDeviceSwitch 7676 * @interface PhotoSession 7677 * @syscap SystemCapability.Multimedia.Camera.Core 7678 * @since 13 7679 */ 7680 /** 7681 * Photo session object. 7682 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement, AutoDeviceSwitch, Macro 7683 * @interface PhotoSession 7684 * @syscap SystemCapability.Multimedia.Camera.Core 7685 * @atomicservice 7686 * @since 19 7687 */ 7688 /** 7689 * Photo session object. 7690 * @extends Session, Flash, AutoExposure, WhiteBalance, Focus, Zoom, ColorManagement, AutoDeviceSwitch, Macro 7691 * @interface PhotoSession 7692 * @syscap SystemCapability.Multimedia.Camera.Core 7693 * @atomicservice 7694 * @since 20 7695 */ 7696 interface PhotoSession extends Session, Flash, AutoExposure, WhiteBalance, Focus, Zoom, ColorManagement, AutoDeviceSwitch, Macro { 7697 /** 7698 * Gets whether the choosed preconfig type can be used to configure photo session. 7699 * Must choose preconfig type from {@link PreconfigType}. 7700 * 7701 * @param { PreconfigType } preconfigType - preconfig type. 7702 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 7703 * default value {@link PreconfigRatio#PRECONFIG_RATIO_4_3}. 7704 * @returns { boolean } Whether the choosed preconfig type can be used. 7705 * @throws { BusinessError } 7400201 - Camera service fatal error. 7706 * @syscap SystemCapability.Multimedia.Camera.Core 7707 * @since 12 7708 */ 7709 /** 7710 * Gets whether the choosed preconfig type can be used to configure photo session. 7711 * Must choose preconfig type from {@link PreconfigType}. 7712 * 7713 * @param { PreconfigType } preconfigType - preconfig type. 7714 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 7715 * default value {@link PreconfigRatio#PRECONFIG_RATIO_4_3}. 7716 * @returns { boolean } Whether the choosed preconfig type can be used. 7717 * @throws { BusinessError } 7400201 - Camera service fatal error. 7718 * @syscap SystemCapability.Multimedia.Camera.Core 7719 * @atomicservice 7720 * @since 19 7721 */ 7722 canPreconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): boolean; 7723 7724 /** 7725 * Configure photo session with the preconfig type. 7726 * Must choose preconfig type from {@link PreconfigType}. 7727 * 7728 * @param { PreconfigType } preconfigType - preconfig type. 7729 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 7730 * default value {@link PreconfigRatio#PRECONFIG_RATIO_4_3} 7731 * @throws { BusinessError } 7400201 - Camera service fatal error. 7732 * @syscap SystemCapability.Multimedia.Camera.Core 7733 * @since 12 7734 */ 7735 /** 7736 * Configure photo session with the preconfig type. 7737 * Must choose preconfig type from {@link PreconfigType}. 7738 * 7739 * @param { PreconfigType } preconfigType - preconfig type. 7740 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 7741 * default value {@link PreconfigRatio#PRECONFIG_RATIO_4_3} 7742 * @throws { BusinessError } 7400201 - Camera service fatal error. 7743 * @syscap SystemCapability.Multimedia.Camera.Core 7744 * @atomicservice 7745 * @since 19 7746 */ 7747 preconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): void; 7748 7749 /** 7750 * Subscribes to error events. 7751 * 7752 * @param { 'error' } type - Event type. 7753 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7754 * @syscap SystemCapability.Multimedia.Camera.Core 7755 * @since 11 7756 */ 7757 /** 7758 * Registers a listener for error events from a normal video session to get the result by registering 7759 * a callback function. This API uses an asynchronous callback to return the result. 7760 * 7761 * Description: Currently, it is not allowed to use off() to unregister the callback 7762 * within the callback method of on(). 7763 * 7764 * @param { 'error' } type - Event type. 7765 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7766 * @syscap SystemCapability.Multimedia.Camera.Core 7767 * @atomicservice 7768 * @since 19 7769 */ 7770 on(type: 'error', callback: ErrorCallback): void; 7771 7772 /** 7773 * Unsubscribes from error events. 7774 * 7775 * @param { 'error' } type - Event type. 7776 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7777 * @syscap SystemCapability.Multimedia.Camera.Core 7778 * @since 11 7779 */ 7780 /** 7781 * Unsubscribes from error events. 7782 * 7783 * @param { 'error' } type - Event type. 7784 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 7785 * @syscap SystemCapability.Multimedia.Camera.Core 7786 * @atomicservice 7787 * @since 19 7788 */ 7789 off(type: 'error', callback?: ErrorCallback): void; 7790 7791 /** 7792 * Subscribes focus state change event callback. 7793 * 7794 * @param { 'focusStateChange' } type - Event type. 7795 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7796 * @syscap SystemCapability.Multimedia.Camera.Core 7797 * @since 11 7798 */ 7799 /** 7800 * Registers a listener for camera focus state changes to get the result by registering 7801 * a callback function. This API uses an asynchronous callback to return the result. 7802 * 7803 * Description: Currently, it is not allowed to use off() to unregister the callback 7804 * within the callback method of on(). 7805 * 7806 * @param { 'focusStateChange' } type - Event type. 7807 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7808 * @syscap SystemCapability.Multimedia.Camera.Core 7809 * @atomicservice 7810 * @since 19 7811 */ 7812 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 7813 7814 /** 7815 * Unsubscribes from focus state change event callback. 7816 * 7817 * @param { 'focusStateChange' } type - Event type. 7818 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7819 * @syscap SystemCapability.Multimedia.Camera.Core 7820 * @since 11 7821 */ 7822 /** 7823 * Unsubscribes from focus state change event callback. 7824 * 7825 * @param { 'focusStateChange' } type - Event type. 7826 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 7827 * @syscap SystemCapability.Multimedia.Camera.Core 7828 * @atomicservice 7829 * @since 19 7830 */ 7831 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 7832 7833 /** 7834 * Subscribes zoom info event callback. 7835 * 7836 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7837 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7838 * @syscap SystemCapability.Multimedia.Camera.Core 7839 * @since 11 7840 */ 7841 /** 7842 * Registers a listener for state changes in the camera's smooth zoom to get the result by registering 7843 * a callback function. This API uses an asynchronous callback to return the result. 7844 * 7845 * Description: Currently, it is not allowed to use off() to unregister the callback 7846 * within the callback method of on(). 7847 * 7848 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7849 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7850 * @syscap SystemCapability.Multimedia.Camera.Core 7851 * @atomicservice 7852 * @since 19 7853 */ 7854 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 7855 7856 /** 7857 * Unsubscribes from zoom info event callback. 7858 * 7859 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7860 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7861 * @syscap SystemCapability.Multimedia.Camera.Core 7862 * @since 11 7863 */ 7864 /** 7865 * Unsubscribes from zoom info event callback. 7866 * 7867 * @param { 'smoothZoomInfoAvailable' } type - Event type. 7868 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 7869 * @syscap SystemCapability.Multimedia.Camera.Core 7870 * @atomicservice 7871 * @since 19 7872 */ 7873 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 7874 7875 /** 7876 * Subscribes camera macro status event callback. 7877 * 7878 * @param { 'macroStatusChanged' } type - Event type. 7879 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 7880 * @throws { BusinessError } 202 - Not System Application. 7881 * @syscap SystemCapability.Multimedia.Camera.Core 7882 * @systemapi 7883 * @since 11 7884 */ 7885 /** 7886 * Subscribes camera macro status event callback. 7887 * 7888 * @param { 'macroStatusChanged' } type - Event type. 7889 * @param { AsyncCallback<boolean> } callback - Callback used to return macro detection result, 7890 * true indicating macro scene is detected and can be enabled, false indicating no macro scene is detected, 7891 * and macro should be disabled. 7892 * @syscap SystemCapability.Multimedia.Camera.Core 7893 * @atomicservice 7894 * @since 20 7895 */ 7896 on(type: 'macroStatusChanged', callback: AsyncCallback<boolean>): void; 7897 7898 /** 7899 * Unsubscribes camera macro status event callback. 7900 * 7901 * @param { 'macroStatusChanged' } type - Event type. 7902 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 7903 * @throws { BusinessError } 202 - Not System Application. 7904 * @syscap SystemCapability.Multimedia.Camera.Core 7905 * @systemapi 7906 * @since 11 7907 */ 7908 /** 7909 * Unsubscribes camera macro status event callback. 7910 * 7911 * @param { 'macroStatusChanged' } type - Event type. 7912 * @param { AsyncCallback<boolean> } callback - Callback used to return macro detection result, 7913 * true indicating macro scene is detected and can be enabled, false indicating no macro scene is detected, 7914 * and macro should be disabled. 7915 * @syscap SystemCapability.Multimedia.Camera.Core 7916 * @atomicservice 7917 * @since 20 7918 */ 7919 off(type: 'macroStatusChanged', callback?: AsyncCallback<boolean>): void; 7920 7921 /** 7922 * Subscribes to system pressure level event callback. 7923 * 7924 * @param { 'systemPressureLevelChange' } type - Event type. 7925 * @param { AsyncCallback<SystemPressureLevel> } callback - Callback used to return the result. 7926 * @syscap SystemCapability.Multimedia.Camera.Core 7927 * @atomicservice 7928 * @since 20 7929 */ 7930 on(type: 'systemPressureLevelChange', callback: AsyncCallback<SystemPressureLevel>): void 7931 7932 /** 7933 * Unsubscribes to system pressure level event callback. 7934 * 7935 * @param { 'systemPressureLevelChange' } type - Event type. 7936 * @param { AsyncCallback<SystemPressureLevel> } [callback] - Callback used to return the result. 7937 * @syscap SystemCapability.Multimedia.Camera.Core 7938 * @atomicservice 7939 * @since 20 7940 */ 7941 off(type: 'systemPressureLevelChange', callback?: AsyncCallback<SystemPressureLevel>): void 7942 7943 /** 7944 * Subscribes to feature detection results. 7945 * 7946 * @param { 'featureDetection' } type - Event type. 7947 * @param { SceneFeatureType } featureType - Feature type. 7948 * @param { AsyncCallback<SceneFeatureDetectionResult> } callback - Callback used to get the detection result. 7949 * @throws { BusinessError } 202 - Not System Application. 7950 * @syscap SystemCapability.Multimedia.Camera.Core 7951 * @systemapi 7952 * @since 12 7953 */ 7954 on(type: 'featureDetection', featureType: SceneFeatureType, callback: AsyncCallback<SceneFeatureDetectionResult>): void; 7955 7956 /** 7957 * Unsubscribes from feature detection result. 7958 * 7959 * @param { 'featureDetection' } type - Event type. 7960 * @param { SceneFeatureType } featureType - Feature type. 7961 * @param { AsyncCallback<SceneFeatureDetectionResult> } callback - Callback used to get the detection result. 7962 * @throws { BusinessError } 202 - Not System Application. 7963 * @syscap SystemCapability.Multimedia.Camera.Core 7964 * @systemapi 7965 * @since 12 7966 */ 7967 off(type: 'featureDetection', featureType: SceneFeatureType, callback?: AsyncCallback<SceneFeatureDetectionResult>): void; 7968 7969 /** 7970 * Subscribes to effect suggestion event callback. 7971 * 7972 * @param { 'effectSuggestionChange' } type - Event type. 7973 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 7974 * @syscap SystemCapability.Multimedia.Camera.Core 7975 * @systemapi 7976 * @since 12 7977 */ 7978 on(type: 'effectSuggestionChange', callback: AsyncCallback<EffectSuggestionType>): void; 7979 7980 /** 7981 * Unsubscribes from effect suggestion event callback. 7982 * 7983 * @param { 'effectSuggestionChange' } type - Event type. 7984 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 7985 * @syscap SystemCapability.Multimedia.Camera.Core 7986 * @systemapi 7987 * @since 12 7988 */ 7989 off(type: 'effectSuggestionChange', callback?: AsyncCallback<EffectSuggestionType>): void; 7990 7991 /** 7992 * Subscribes to auto device switch status event callback. 7993 * 7994 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 7995 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 7996 * @syscap SystemCapability.Multimedia.Camera.Core 7997 * @since 13 7998 */ 7999 /** 8000 * Registers a listener for the camera's automatic lens switching state changes to get the result 8001 * by registering a callback function. This API uses an asynchronous callback to return the result. 8002 * 8003 * Description: Currently, it is not allowed to use off() to unregister the callback 8004 * within the callback method of on(). 8005 * 8006 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 8007 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 8008 * @syscap SystemCapability.Multimedia.Camera.Core 8009 * @atomicservice 8010 * @since 19 8011 */ 8012 on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback<AutoDeviceSwitchStatus>): void; 8013 8014 /** 8015 * Unsubscribes to auto device switch status event callback. 8016 * 8017 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 8018 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 8019 * @syscap SystemCapability.Multimedia.Camera.Core 8020 * @since 13 8021 */ 8022 /** 8023 * Unsubscribes to auto device switch status event callback. 8024 * 8025 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 8026 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 8027 * @syscap SystemCapability.Multimedia.Camera.Core 8028 * @atomicservice 8029 * @since 19 8030 */ 8031 off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback<AutoDeviceSwitchStatus>): void; 8032 8033 /** 8034 * Subscribes to lcd flash status. 8035 * 8036 * @param { 'lcdFlashStatus' } type - Event type. 8037 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 8038 * @throws { BusinessError } 202 - Not System Application. 8039 * @syscap SystemCapability.Multimedia.Camera.Core 8040 * @systemapi 8041 * @since 13 8042 */ 8043 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 8044 8045 /** 8046 * Unsubscribes from lcd flash status. 8047 * 8048 * @param { 'lcdFlashStatus' } type - Event type. 8049 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 8050 * @throws { BusinessError } 202 - Not System Application. 8051 * @syscap SystemCapability.Multimedia.Camera.Core 8052 * @systemapi 8053 * @since 13 8054 */ 8055 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 8056 8057 /** 8058 * Gets session functions. 8059 * 8060 * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. 8061 * @returns { Array<PhotoFunctions> } List of session functions. 8062 * @throws { BusinessError } 202 - Not System Application. 8063 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 8064 * @syscap SystemCapability.Multimedia.Camera.Core 8065 * @systemapi 8066 * @since 13 8067 */ 8068 getSessionFunctions(outputCapability: CameraOutputCapability): Array<PhotoFunctions>; 8069 8070 /** 8071 * Gets session conflict functions. 8072 * 8073 * @returns { Array<PhotoConflictFunctions> } List of session conflict functions. 8074 * @throws { BusinessError } 202 - Not System Application. 8075 * @syscap SystemCapability.Multimedia.Camera.Core 8076 * @systemapi 8077 * @since 13 8078 */ 8079 getSessionConflictFunctions(): Array<PhotoConflictFunctions>; 8080 } 8081 8082 /** 8083 * Video session object used by the system camera. 8084 * 8085 * @extends VideoSession, Beauty, ColorEffect, ColorManagement, Macro 8086 * @interface VideoSessionForSys 8087 * @syscap SystemCapability.Multimedia.Camera.Core 8088 * @systemapi 8089 * @since 11 8090 */ 8091 /** 8092 * Video session object used by the system camera. 8093 * 8094 * @extends VideoSession, Beauty, ColorEffect, ColorManagement, Macro, Aperture, ColorReservation 8095 * @interface VideoSessionForSys 8096 * @syscap SystemCapability.Multimedia.Camera.Core 8097 * @systemapi 8098 * @since 15 8099 */ 8100 /** 8101 * Video session object used by the system camera. 8102 * 8103 * @extends VideoSession, Beauty, ColorEffect, ColorManagement, Macro, Aperture, ColorReservation, EffectSuggestion 8104 * @interface VideoSessionForSys 8105 * @syscap SystemCapability.Multimedia.Camera.Core 8106 * @systemapi 8107 * @since 18 8108 */ 8109 interface VideoSessionForSys extends VideoSession, Beauty, ColorEffect, ColorManagement, Macro, Aperture, ColorReservation, EffectSuggestion { 8110 } 8111 8112 /** 8113 * Enum for quality prioritization. 8114 * 8115 * @enum { number } 8116 * @syscap SystemCapability.Multimedia.Camera.Core 8117 * @since 14 8118 */ 8119 /** 8120 * Enum for quality prioritization. 8121 * 8122 * @enum { number } 8123 * @syscap SystemCapability.Multimedia.Camera.Core 8124 * @atomicservice 8125 * @since 19 8126 */ 8127 enum QualityPrioritization { 8128 /** 8129 * High quality priority. 8130 * 8131 * @syscap SystemCapability.Multimedia.Camera.Core 8132 * @since 14 8133 */ 8134 /** 8135 * High quality priority. 8136 * 8137 * @syscap SystemCapability.Multimedia.Camera.Core 8138 * @atomicservice 8139 * @since 19 8140 */ 8141 HIGH_QUALITY = 0, 8142 8143 /** 8144 * Power balance priority. 8145 * 8146 * @syscap SystemCapability.Multimedia.Camera.Core 8147 * @since 14 8148 */ 8149 /** 8150 * Power balance priority. 8151 * 8152 * @syscap SystemCapability.Multimedia.Camera.Core 8153 * @atomicservice 8154 * @since 19 8155 */ 8156 POWER_BALANCE = 1 8157 } 8158 8159 /** 8160 * Video session object. 8161 * 8162 * @extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement 8163 * @interface VideoSession 8164 * @syscap SystemCapability.Multimedia.Camera.Core 8165 * @since 11 8166 */ 8167 /** 8168 * Video session object. 8169 * 8170 * @interface VideoSession 8171 * @extends AutoDeviceSwitch 8172 * @syscap SystemCapability.Multimedia.Camera.Core 8173 * @since 13 8174 */ 8175 /** 8176 * Video session object. 8177 * 8178 * @extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement, AutoDeviceSwitch, Macro 8179 * @interface VideoSession 8180 * @syscap SystemCapability.Multimedia.Camera.Core 8181 * @atomicservice 8182 * @since 19 8183 */ 8184 /** 8185 * Video session object. 8186 * 8187 * @extends Session, Flash, AutoExposure, WhiteBalance, Focus, Zoom, Stabilization, ColorManagement, ControlCenter, AutoDeviceSwitch, Macro 8188 * @interface VideoSession 8189 * @syscap SystemCapability.Multimedia.Camera.Core 8190 * @atomicservice 8191 * @since 20 8192 */ 8193 interface VideoSession extends Session, Flash, AutoExposure, WhiteBalance, Focus, Zoom, Stabilization, ColorManagement, ControlCenter, AutoDeviceSwitch, Macro { 8194 /** 8195 * Gets whether the choosed preconfig type can be used to configure video session. 8196 * Must choose preconfig type from {@link PreconfigType}. 8197 * 8198 * @param { PreconfigType } preconfigType - preconfig type. 8199 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 8200 * default value {@link PreconfigRatio#PRECONFIG_RATIO_16_9}. 8201 * @returns { boolean } Whether the choosed preconfig type can be used. 8202 * @throws { BusinessError } 7400201 - Camera service fatal error. 8203 * @syscap SystemCapability.Multimedia.Camera.Core 8204 * @since 12 8205 */ 8206 /** 8207 * Gets whether the choosed preconfig type can be used to configure video session. 8208 * Must choose preconfig type from {@link PreconfigType}. 8209 * 8210 * @param { PreconfigType } preconfigType - preconfig type. 8211 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 8212 * default value {@link PreconfigRatio#PRECONFIG_RATIO_16_9}. 8213 * @returns { boolean } Whether the choosed preconfig type can be used. 8214 * @throws { BusinessError } 7400201 - Camera service fatal error. 8215 * @syscap SystemCapability.Multimedia.Camera.Core 8216 * @atomicservice 8217 * @since 19 8218 */ 8219 canPreconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): boolean; 8220 8221 /** 8222 * Configure video session with the preconfig type. 8223 * Must choose preconfig type from {@link PreconfigType}. 8224 * 8225 * @param { PreconfigType } preconfigType - preconfig type. 8226 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 8227 * default value {@link PreconfigRatio#PRECONFIG_RATIO_16_9}. 8228 * @throws { BusinessError } 7400201 - Camera service fatal error. 8229 * @syscap SystemCapability.Multimedia.Camera.Core 8230 * @since 12 8231 */ 8232 /** 8233 * Configure video session with the preconfig type. 8234 * Must choose preconfig type from {@link PreconfigType}. 8235 * 8236 * @param { PreconfigType } preconfigType - preconfig type. 8237 * @param { PreconfigRatio } preconfigRatio - the aspect ratio of surface for preconfig, 8238 * default value {@link PreconfigRatio#PRECONFIG_RATIO_16_9}. 8239 * @throws { BusinessError } 7400201 - Camera service fatal error. 8240 * @syscap SystemCapability.Multimedia.Camera.Core 8241 * @atomicservice 8242 * @since 19 8243 */ 8244 preconfig(preconfigType: PreconfigType, preconfigRatio?: PreconfigRatio): void; 8245 8246 /** 8247 * Subscribes to error events. 8248 * 8249 * @param { 'error' } type - Event type. 8250 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 8251 * @syscap SystemCapability.Multimedia.Camera.Core 8252 * @since 11 8253 */ 8254 /** 8255 * Registers a listener for error events in normal photo sessions to get the result by registering 8256 * a callback function. This API uses an asynchronous callback to return the result. 8257 * 8258 * Description: Currently, it is not allowed to use off() to unregister the callback 8259 * within the callback method of on(). 8260 * 8261 * @param { 'error' } type - Event type. 8262 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 8263 * @syscap SystemCapability.Multimedia.Camera.Core 8264 * @atomicservice 8265 * @since 19 8266 */ 8267 on(type: 'error', callback: ErrorCallback): void; 8268 8269 /** 8270 * Unsubscribes from error events. 8271 * 8272 * @param { 'error' } type - Event type. 8273 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 8274 * @syscap SystemCapability.Multimedia.Camera.Core 8275 * @since 11 8276 */ 8277 /** 8278 * Unsubscribes from error events. 8279 * 8280 * @param { 'error' } type - Event type. 8281 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 8282 * @syscap SystemCapability.Multimedia.Camera.Core 8283 * @atomicservice 8284 * @since 19 8285 */ 8286 off(type: 'error', callback?: ErrorCallback): void; 8287 8288 /** 8289 * Subscribes focus state change event callback. 8290 * 8291 * @param { 'focusStateChange' } type - Event type. 8292 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 8293 * @syscap SystemCapability.Multimedia.Camera.Core 8294 * @since 11 8295 */ 8296 /** 8297 * Registers a listener for error events in normal photo sessions to get the result by registering 8298 * a callback function. This API uses an asynchronous callback to return the result. 8299 * 8300 * Description: Currently, it is not allowed to use off() to unregister the callback 8301 * within the callback method of on(). 8302 * 8303 * @param { 'focusStateChange' } type - Event type. 8304 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 8305 * @syscap SystemCapability.Multimedia.Camera.Core 8306 * @atomicservice 8307 * @since 19 8308 */ 8309 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 8310 8311 /** 8312 * Unsubscribes from focus state change event callback. 8313 * 8314 * @param { 'focusStateChange' } type - Event type. 8315 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 8316 * @syscap SystemCapability.Multimedia.Camera.Core 8317 * @since 11 8318 */ 8319 /** 8320 * Unsubscribes from focus state change event callback. 8321 * 8322 * @param { 'focusStateChange' } type - Event type. 8323 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 8324 * @syscap SystemCapability.Multimedia.Camera.Core 8325 * @atomicservice 8326 * @since 19 8327 */ 8328 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 8329 8330 /** 8331 * Subscribes zoom info event callback. 8332 * 8333 * @param { 'smoothZoomInfoAvailable' } type - Event type. 8334 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 8335 * @syscap SystemCapability.Multimedia.Camera.Core 8336 * @since 11 8337 */ 8338 /** 8339 * Registers a listener for state changes in the camera's smooth zoom to get the result by registering 8340 * a callback function. This API uses an asynchronous callback to return the result. 8341 * 8342 * Description: Currently, it is not allowed to use off() to unregister the callback 8343 * within the callback method of on(). 8344 * 8345 * @param { 'smoothZoomInfoAvailable' } type - Event type. 8346 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 8347 * @syscap SystemCapability.Multimedia.Camera.Core 8348 * @atomicservice 8349 * @since 19 8350 */ 8351 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 8352 8353 /** 8354 * Unsubscribes from zoom info event callback. 8355 * 8356 * @param { 'smoothZoomInfoAvailable' } type - Event type. 8357 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 8358 * @syscap SystemCapability.Multimedia.Camera.Core 8359 * @since 11 8360 */ 8361 /** 8362 * Unsubscribes from zoom info event callback. 8363 * 8364 * @param { 'smoothZoomInfoAvailable' } type - Event type. 8365 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 8366 * @syscap SystemCapability.Multimedia.Camera.Core 8367 * @atomicservice 8368 * @since 19 8369 */ 8370 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 8371 8372 /** 8373 * Subscribes camera macro status event callback. 8374 * 8375 * @param { 'macroStatusChanged' } type - Event type. 8376 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 8377 * @throws { BusinessError } 202 - Not System Application. 8378 * @syscap SystemCapability.Multimedia.Camera.Core 8379 * @systemapi 8380 * @since 11 8381 */ 8382 /** 8383 * Subscribes camera macro status event callback. 8384 * 8385 * @param { 'macroStatusChanged' } type - Event type. 8386 * @param { AsyncCallback<boolean> } callback - Callback used to return macro detection result, 8387 * true indicating macro scene is detected and can be enabled, false indicating no macro scene is detected, 8388 * and macro should be disabled. 8389 * @syscap SystemCapability.Multimedia.Camera.Core 8390 * @atomicservice 8391 * @since 20 8392 */ 8393 on(type: 'macroStatusChanged', callback: AsyncCallback<boolean>): void; 8394 8395 /** 8396 * Unsubscribes camera macro status event callback. 8397 * 8398 * @param { 'macroStatusChanged' } type - Event type. 8399 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. 8400 * @throws { BusinessError } 202 - Not System Application. 8401 * @syscap SystemCapability.Multimedia.Camera.Core 8402 * @systemapi 8403 * @since 11 8404 */ 8405 /** 8406 * Unsubscribes camera macro status event callback. 8407 * 8408 * @param { 'macroStatusChanged' } type - Event type. 8409 * @param { AsyncCallback<boolean> } callback - Callback used to return macro detection result, 8410 * true indicating macro scene is detected and can be enabled, false indicating no macro scene is detected, 8411 * and macro should be disabled. 8412 * @syscap SystemCapability.Multimedia.Camera.Core 8413 * @atomicservice 8414 * @since 20 8415 */ 8416 off(type: 'macroStatusChanged', callback?: AsyncCallback<boolean>): void; 8417 8418 /** 8419 * Subscribes to system pressure level event callback. 8420 * 8421 * @param { 'systemPressureLevelChange' } type - Event type. 8422 * @param { AsyncCallback<SystemPressureLevel> } callback - Callback used to return the result. 8423 * @syscap SystemCapability.Multimedia.Camera.Core 8424 * @atomicservice 8425 * @since 20 8426 */ 8427 on(type: 'systemPressureLevelChange', callback: AsyncCallback<SystemPressureLevel>): void 8428 8429 /** 8430 * Unsubscribes to system pressure level event callback. 8431 * 8432 * @param { 'systemPressureLevelChange' } type - Event type. 8433 * @param { AsyncCallback<SystemPressureLevel> } [callback] - Callback used to return the result. 8434 * @syscap SystemCapability.Multimedia.Camera.Core 8435 * @atomicservice 8436 * @since 20 8437 */ 8438 off(type: 'systemPressureLevelChange', callback?: AsyncCallback<SystemPressureLevel>): void 8439 8440 /** 8441 * Subscribes to control center effect status change callback. 8442 * 8443 * @param { 'controlCenterEffectStatusChange' } type - Event type. 8444 * @param { AsyncCallback<ControlCenterStatusInfo> } callback - Callback used to get control center effect status. 8445 * @syscap SystemCapability.Multimedia.Camera.Core 8446 * @atomicservice 8447 * @since 20 8448 */ 8449 on(type: 'controlCenterEffectStatusChange', callback: AsyncCallback<ControlCenterStatusInfo>): void; 8450 8451 /** 8452 * Unsubscribes to control center effect status change callback. 8453 * 8454 * @param { 'controlCenterEffectStatusChange' } type - Event type. 8455 * @param { AsyncCallback<ControlCenterStatusInfo> } [callback] - Callback used to get control center effect status. 8456 * @syscap SystemCapability.Multimedia.Camera.Core 8457 * @atomicservice 8458 * @since 20 8459 */ 8460 off(type: 'controlCenterEffectStatusChange', callback?: AsyncCallback<ControlCenterStatusInfo>): void; 8461 8462 /** 8463 * Subscribes to lcd flash status. 8464 * 8465 * @param { 'lcdFlashStatus' } type - Event type. 8466 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 8467 * @throws { BusinessError } 202 - Not System Application. 8468 * @syscap SystemCapability.Multimedia.Camera.Core 8469 * @systemapi 8470 * @since 13 8471 */ 8472 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 8473 8474 /** 8475 * Unsubscribes from lcd flash status. 8476 * 8477 * @param { 'lcdFlashStatus' } type - Event type. 8478 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 8479 * @throws { BusinessError } 202 - Not System Application. 8480 * @syscap SystemCapability.Multimedia.Camera.Core 8481 * @systemapi 8482 * @since 13 8483 */ 8484 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 8485 8486 /** 8487 * Subscribes to auto device switch status event callback. 8488 * 8489 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 8490 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 8491 * @syscap SystemCapability.Multimedia.Camera.Core 8492 * @since 13 8493 */ 8494 /** 8495 * Registers a listener for the camera's automatic lens switching state changes to get the 8496 * result by registering a callback function. This API uses an asynchronous callback to 8497 * return the result. 8498 * 8499 * Description: Currently, it is not allowed to use off() to unregister the callback 8500 * within the callback method of on(). 8501 * 8502 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 8503 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 8504 * @syscap SystemCapability.Multimedia.Camera.Core 8505 * @atomicservice 8506 * @since 19 8507 */ 8508 on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback<AutoDeviceSwitchStatus>): void; 8509 8510 /** 8511 * Unsubscribes to auto device switch status event callback. 8512 * 8513 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 8514 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 8515 * @syscap SystemCapability.Multimedia.Camera.Core 8516 * @since 13 8517 */ 8518 /** 8519 * Unsubscribes to auto device switch status event callback. 8520 * 8521 * @param { 'autoDeviceSwitchStatusChange' } type - Event type. 8522 * @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result. 8523 * @syscap SystemCapability.Multimedia.Camera.Core 8524 * @atomicservice 8525 * @since 19 8526 */ 8527 off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback<AutoDeviceSwitchStatus>): void; 8528 8529 /** 8530 * Subscribes to focus tracking info event callback. 8531 * 8532 * @param { 'focusTrackingInfoAvailable' } type - Event type. 8533 * @param { Callback<FocusTrackingInfo> } callback - Callback used to get the focus tracking info. 8534 * @throws { BusinessError } 202 - Not System Application. 8535 * @syscap SystemCapability.Multimedia.Camera.Core 8536 * @systemapi 8537 * @since 15 8538 */ 8539 on(type: 'focusTrackingInfoAvailable', callback: Callback<FocusTrackingInfo>): void; 8540 8541 /** 8542 * Unsubscribes from focus tracking info event callback. 8543 * 8544 * @param { 'focusTrackingInfoAvailable' } type - Event type. 8545 * @param { Callback<FocusTrackingInfo> } callback - Callback used to get the focus tracking info. 8546 * @throws { BusinessError } 202 - Not System Application. 8547 * @syscap SystemCapability.Multimedia.Camera.Core 8548 * @systemapi 8549 * @since 15 8550 */ 8551 off(type: 'focusTrackingInfoAvailable', callback?: Callback<FocusTrackingInfo>): void; 8552 8553 /** 8554 * Subscribes to effect suggestion change events. 8555 * @param { 'effectSuggestionChange' } type - Event type. 8556 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 8557 * @throws { BusinessError } 202 - Not System Application.[object Object] 8558 * @syscap SystemCapability.Multimedia.Camera.Core 8559 * @systemapi 8560 * @since 18 8561 */ 8562 on(type: 'effectSuggestionChange', callback: AsyncCallback<EffectSuggestionType>): void; 8563 8564 /** 8565 * Unsubscribes from effect suggestion change events. 8566 * 8567 * @param { 'effectSuggestionChange' } type - Event type. 8568 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 8569 * @throws { BusinessError } 202 - Not System Application.[object Object] 8570 * @syscap SystemCapability.Multimedia.Camera.Core 8571 * @systemapi 8572 * @since 18 8573 */ 8574 off(type: 'effectSuggestionChange', callback?: AsyncCallback<EffectSuggestionType>): void; 8575 8576 /** 8577 * Gets session functions. 8578 * 8579 * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. 8580 * @returns { Array<VideoFunctions> } List of session functions. 8581 * @throws { BusinessError } 202 - Not System Application. 8582 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 8583 * @syscap SystemCapability.Multimedia.Camera.Core 8584 * @systemapi 8585 * @since 13 8586 */ 8587 getSessionFunctions(outputCapability: CameraOutputCapability): Array<VideoFunctions>; 8588 8589 /** 8590 * Gets session conflict functions. 8591 * 8592 * @returns { Array<VideoConflictFunctions> } List of session conflict functions. 8593 * @throws { BusinessError } 202 - Not System Application. 8594 * @syscap SystemCapability.Multimedia.Camera.Core 8595 * @systemapi 8596 * @since 13 8597 */ 8598 getSessionConflictFunctions(): Array<VideoConflictFunctions>; 8599 8600 /** 8601 * Sets quality prioritization. 8602 * Setting to power balance reduces video quality to conserve power, suitable for long-duration recordings where 8603 * video quality is less critical. 8604 * 8605 * @param { QualityPrioritization } quality - Target quality prioritization, with a default of HIGH_QUALITY. 8606 * @throws { BusinessError } 401 - Parameter error. Possible causes: 8607 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 8608 * 3. Parameter verification failed. 8609 * @throws { BusinessError } 7400103 - Session not config. The session has not been committed or configured. 8610 * @syscap SystemCapability.Multimedia.Camera.Core 8611 * @since 14 8612 */ 8613 /** 8614 * Sets quality prioritization. 8615 * Setting to power balance reduces video quality to conserve power, suitable for long-duration recordings where 8616 * video quality is less critical. 8617 * 8618 * @param { QualityPrioritization } quality - Target quality prioritization, with a default of HIGH_QUALITY. 8619 * @throws { BusinessError } 401 - Parameter error. Possible causes: 8620 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 8621 * 3. Parameter verification failed. 8622 * @throws { BusinessError } 7400103 - Session not config. The session has not been committed or configured. 8623 * @syscap SystemCapability.Multimedia.Camera.Core 8624 * @atomicservice 8625 * @since 19 8626 */ 8627 setQualityPrioritization(quality : QualityPrioritization) : void; 8628 8629 /** 8630 * Subscribes camera light status event callback. 8631 * 8632 * @param { 'lightStatusChange' } type - Event type. 8633 * @param { AsyncCallback<LightStatus> } callback - Callback used to return the result. 8634 * @throws { BusinessError } 202 - Not System Application. 8635 * @syscap SystemCapability.Multimedia.Camera.Core 8636 * @systemapi 8637 * @since 18 8638 */ 8639 on(type: 'lightStatusChange', callback: AsyncCallback<LightStatus>): void; 8640 8641 /** 8642 * Unsubscribes camera light status event callback. 8643 * 8644 * @param { 'lightStatusChange' } type - Event type. 8645 * @param { AsyncCallback<LightStatus> } callback - Callback used to return the result. 8646 * @throws { BusinessError } 202 - Not System Application. 8647 * @syscap SystemCapability.Multimedia.Camera.Core 8648 * @systemapi 8649 * @since 18 8650 */ 8651 off(type: 'lightStatusChange', callback?: AsyncCallback<LightStatus>): void; 8652 } 8653 8654 /** 8655 * Enum for the camera light status. 8656 * 8657 * @enum { number } 8658 * @syscap SystemCapability.Multimedia.Camera.Core 8659 * @systemapi 8660 * @since 18 8661 */ 8662 enum LightStatus { 8663 /** 8664 * Sufficient lighting. 8665 * 8666 * @syscap SystemCapability.Multimedia.Camera.Core 8667 * @systemapi 8668 * @since 18 8669 */ 8670 NORMAL = 0, 8671 8672 /** 8673 * Insufficient lighting. 8674 * 8675 * @syscap SystemCapability.Multimedia.Camera.Core 8676 * @systemapi 8677 * @since 18 8678 */ 8679 INSUFFICIENT = 1 8680 } 8681 8682 /** 8683 * Enumerates the camera portrait effects. 8684 * 8685 * @enum { number } 8686 * @syscap SystemCapability.Multimedia.Camera.Core 8687 * @systemapi 8688 * @since 10 8689 */ 8690 enum PortraitEffect { 8691 /** 8692 * portrait effect off. 8693 * 8694 * @syscap SystemCapability.Multimedia.Camera.Core 8695 * @systemapi 8696 * @since 10 8697 */ 8698 OFF = 0, 8699 8700 /** 8701 * circular blurring for portrait. 8702 * 8703 * @syscap SystemCapability.Multimedia.Camera.Core 8704 * @systemapi 8705 * @since 10 8706 */ 8707 CIRCLES = 1, 8708 8709 /** 8710 * heart blurring for portrait. 8711 * 8712 * @syscap SystemCapability.Multimedia.Camera.Core 8713 * @systemapi 8714 * @since 11 8715 */ 8716 HEART = 2, 8717 8718 /** 8719 * rotated blurring for portrait. 8720 * 8721 * @syscap SystemCapability.Multimedia.Camera.Core 8722 * @systemapi 8723 * @since 11 8724 */ 8725 ROTATED = 3, 8726 8727 /** 8728 * studio blurring for portrait. 8729 * 8730 * @syscap SystemCapability.Multimedia.Camera.Core 8731 * @systemapi 8732 * @since 11 8733 */ 8734 STUDIO = 4, 8735 8736 /** 8737 * theater blurring for portrait. 8738 * 8739 * @syscap SystemCapability.Multimedia.Camera.Core 8740 * @systemapi 8741 * @since 11 8742 */ 8743 THEATER = 5 8744 } 8745 8746 /** 8747 * Portrait Query object. 8748 * 8749 * @interface PortraitQuery 8750 * @syscap SystemCapability.Multimedia.Camera.Core 8751 * @systemapi 8752 * @since 12 8753 */ 8754 interface PortraitQuery { 8755 /** 8756 * Gets supported portrait effect. 8757 * 8758 * @returns { Array<PortraitEffect> } List of portrait effect. 8759 * @throws { BusinessError } 7400103 - Session not config. 8760 * @syscap SystemCapability.Multimedia.Camera.Core 8761 * @systemapi 8762 * @since 10 8763 */ 8764 /** 8765 * Gets supported portrait effect. 8766 * Move to Portrait interface from PortraitPhotoSession interface since 11. 8767 * 8768 * @returns { Array<PortraitEffect> } List of portrait effect. 8769 * @throws { BusinessError } 202 - Not System Application. 8770 * @throws { BusinessError } 7400103 - Session not config. 8771 * @syscap SystemCapability.Multimedia.Camera.Core 8772 * @systemapi 8773 * @since 11 8774 */ 8775 /** 8776 * Gets supported portrait effect. 8777 * Move to PortraitQuery interface from Portrait interface since 12. 8778 * 8779 * @returns { Array<PortraitEffect> } List of portrait effect. 8780 * @throws { BusinessError } 202 - Not System Application. 8781 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 8782 * @syscap SystemCapability.Multimedia.Camera.Core 8783 * @systemapi 8784 * @since 12 8785 */ 8786 getSupportedPortraitEffects(): Array<PortraitEffect>; 8787 } 8788 8789 /** 8790 * Portrait object. 8791 * 8792 * @extends PortraitQuery 8793 * @interface Portrait 8794 * @syscap SystemCapability.Multimedia.Camera.Core 8795 * @systemapi 8796 * @since 11 8797 */ 8798 interface Portrait extends PortraitQuery { 8799 /** 8800 * Gets the portrait effect in use. 8801 * 8802 * @returns { PortraitEffect } The portrait effect in use. 8803 * @throws { BusinessError } 7400103 - Session not config. 8804 * @syscap SystemCapability.Multimedia.Camera.Core 8805 * @systemapi 8806 * @since 10 8807 */ 8808 /** 8809 * Gets the portrait effect in use. 8810 * Move to Portrait interface from PortraitPhotoSession interface since 11. 8811 * 8812 * @returns { PortraitEffect } The portrait effect in use. 8813 * @throws { BusinessError } 202 - Not System Application. 8814 * @throws { BusinessError } 7400103 - Session not config. 8815 * @syscap SystemCapability.Multimedia.Camera.Core 8816 * @systemapi 8817 * @since 11 8818 */ 8819 getPortraitEffect(): PortraitEffect; 8820 8821 /** 8822 * Sets a portrait effect for a camera device. 8823 * 8824 * @param { PortraitEffect } effect - Effect Portrait effect to set. 8825 * @throws { BusinessError } 7400103 - Session not config. 8826 * @syscap SystemCapability.Multimedia.Camera.Core 8827 * @systemapi 8828 * @since 10 8829 */ 8830 /** 8831 * Sets a portrait effect for a camera device. 8832 * Move to Portrait interface from PortraitPhotoSession interface since 11. 8833 * 8834 * @param { PortraitEffect } effect - Effect Portrait effect to set. 8835 * @throws { BusinessError } 202 - Not System Application. 8836 * @throws { BusinessError } 7400103 - Session not config. 8837 * @syscap SystemCapability.Multimedia.Camera.Core 8838 * @systemapi 8839 * @since 11 8840 */ 8841 setPortraitEffect(effect: PortraitEffect): void; 8842 } 8843 8844 /** 8845 * Zoom range. 8846 * 8847 * @typedef ZoomRange 8848 * @syscap SystemCapability.Multimedia.Camera.Core 8849 * @systemapi 8850 * @since 11 8851 */ 8852 interface ZoomRange { 8853 /** 8854 * Min zoom value. 8855 * 8856 * @type { number } 8857 * @readonly 8858 * @syscap SystemCapability.Multimedia.Camera.Core 8859 * @systemapi 8860 * @since 11 8861 */ 8862 readonly min: number; 8863 8864 /** 8865 * Max zoom value. 8866 * 8867 * @type { number } 8868 * @readonly 8869 * @syscap SystemCapability.Multimedia.Camera.Core 8870 * @systemapi 8871 * @since 11 8872 */ 8873 readonly max: number; 8874 } 8875 8876 /** 8877 * Physical Aperture object 8878 * 8879 * @typedef PhysicalAperture 8880 * @syscap SystemCapability.Multimedia.Camera.Core 8881 * @systemapi 8882 * @since 11 8883 */ 8884 interface PhysicalAperture { 8885 /** 8886 * Zoom Range of the specific physical aperture. 8887 * 8888 * @type { ZoomRange } 8889 * @syscap SystemCapability.Multimedia.Camera.Core 8890 * @systemapi 8891 * @since 11 8892 */ 8893 zoomRange: ZoomRange; 8894 8895 /** 8896 * The supported physical apertures. 8897 * 8898 * @type { Array<number> } 8899 * @syscap SystemCapability.Multimedia.Camera.Core 8900 * @systemapi 8901 * @since 11 8902 */ 8903 apertures: Array<number>; 8904 } 8905 8906 /** 8907 * Aperture Query object. 8908 * 8909 * @interface ApertureQuery 8910 * @syscap SystemCapability.Multimedia.Camera.Core 8911 * @systemapi 8912 * @since 12 8913 */ 8914 interface ApertureQuery { 8915 /** 8916 * Gets the supported virtual apertures. 8917 * 8918 * @returns { Array<number> } The array of supported virtual apertures. 8919 * @throws { BusinessError } 202 - Not System Application. 8920 * @throws { BusinessError } 7400103 - Session not config. 8921 * @syscap SystemCapability.Multimedia.Camera.Core 8922 * @systemapi 8923 * @since 11 8924 */ 8925 /** 8926 * Gets the supported virtual apertures. 8927 * Move to ApertureQuery interface from Aperture since 12. 8928 * 8929 * @returns { Array<number> } The array of supported virtual apertures. 8930 * @throws { BusinessError } 202 - Not System Application. 8931 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 8932 * @syscap SystemCapability.Multimedia.Camera.Core 8933 * @systemapi 8934 * @since 12 8935 */ 8936 getSupportedVirtualApertures(): Array<number>; 8937 8938 /** 8939 * Gets the supported physical apertures. 8940 * 8941 * @returns { Array<PhysicalAperture> } The array of supported physical apertures. 8942 * @throws { BusinessError } 202 - Not System Application. 8943 * @throws { BusinessError } 7400103 - Session not config. 8944 * @syscap SystemCapability.Multimedia.Camera.Core 8945 * @systemapi 8946 * @since 11 8947 */ 8948 /** 8949 * Gets the supported physical apertures. 8950 * Move to ApertureQuery interface from Aperture since 12. 8951 * 8952 * @returns { Array<PhysicalAperture> } The array of supported physical apertures. 8953 * @throws { BusinessError } 202 - Not System Application. 8954 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 8955 * @syscap SystemCapability.Multimedia.Camera.Core 8956 * @systemapi 8957 * @since 12 8958 */ 8959 getSupportedPhysicalApertures(): Array<PhysicalAperture>; 8960 } 8961 8962 /** 8963 * Aperture object. 8964 * 8965 * @extends ApertureQuery 8966 * @interface Aperture 8967 * @syscap SystemCapability.Multimedia.Camera.Core 8968 * @systemapi 8969 * @since 11 8970 */ 8971 interface Aperture extends ApertureQuery { 8972 /** 8973 * Gets current virtual aperture value. 8974 * 8975 * @returns { number } The current virtual aperture value. 8976 * @throws { BusinessError } 202 - Not System Application. 8977 * @throws { BusinessError } 7400103 - Session not config. 8978 * @syscap SystemCapability.Multimedia.Camera.Core 8979 * @systemapi 8980 * @since 11 8981 */ 8982 getVirtualAperture(): number; 8983 8984 /** 8985 * Sets virtual aperture value. 8986 * 8987 * @param { number } aperture - virtual aperture value 8988 * @throws { BusinessError } 202 - Not System Application. 8989 * @throws { BusinessError } 7400103 - Session not config. 8990 * @syscap SystemCapability.Multimedia.Camera.Core 8991 * @systemapi 8992 * @since 11 8993 */ 8994 setVirtualAperture(aperture: number): void; 8995 8996 /** 8997 * Gets current physical aperture value. 8998 * 8999 * @returns { number } The current physical aperture value. 9000 * @throws { BusinessError } 202 - Not System Application. 9001 * @throws { BusinessError } 7400103 - Session not config. 9002 * @syscap SystemCapability.Multimedia.Camera.Core 9003 * @systemapi 9004 * @since 11 9005 */ 9006 getPhysicalAperture(): number; 9007 9008 /** 9009 * Sets physical aperture value. 9010 * 9011 * @param { number } aperture - physical aperture value 9012 * @throws { BusinessError } 202 - Not System Application. 9013 * @throws { BusinessError } 7400103 - Session not config. 9014 * @syscap SystemCapability.Multimedia.Camera.Core 9015 * @systemapi 9016 * @since 11 9017 */ 9018 setPhysicalAperture(aperture: number): void; 9019 } 9020 9021 /** 9022 * Portrait Photo session object. 9023 * 9024 * @extends Session, Flash, AutoExposure, Focus, Zoom, Beauty, ColorEffect, ColorManagement, Portrait, Aperture 9025 * @interface PortraitPhotoSession 9026 * @syscap SystemCapability.Multimedia.Camera.Core 9027 * @systemapi 9028 * @since 11 9029 */ 9030 interface PortraitPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, Beauty, ColorEffect, ColorManagement, Portrait, Aperture { 9031 /** 9032 * Subscribes to error events. 9033 * 9034 * @param { 'error' } type - Event type. 9035 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9036 * @syscap SystemCapability.Multimedia.Camera.Core 9037 * @systemapi 9038 * @since 11 9039 */ 9040 on(type: 'error', callback: ErrorCallback): void; 9041 9042 /** 9043 * Unsubscribes from error events. 9044 * 9045 * @param { 'error' } type - Event type. 9046 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9047 * @syscap SystemCapability.Multimedia.Camera.Core 9048 * @systemapi 9049 * @since 11 9050 */ 9051 off(type: 'error', callback?: ErrorCallback): void; 9052 9053 /** 9054 * Subscribes focus state change event callback. 9055 * 9056 * @param { 'focusStateChange' } type - Event type. 9057 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9058 * @syscap SystemCapability.Multimedia.Camera.Core 9059 * @systemapi 9060 * @since 11 9061 */ 9062 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 9063 9064 /** 9065 * Unsubscribes from focus state change event callback. 9066 * 9067 * @param { 'focusStateChange' } type - Event type. 9068 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9069 * @syscap SystemCapability.Multimedia.Camera.Core 9070 * @systemapi 9071 * @since 11 9072 */ 9073 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 9074 9075 /** 9076 * Subscribes zoom info event callback. 9077 * 9078 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9079 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9080 * @syscap SystemCapability.Multimedia.Camera.Core 9081 * @systemapi 9082 * @since 11 9083 */ 9084 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 9085 9086 /** 9087 * Unsubscribes from zoom info event callback. 9088 * 9089 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9090 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9091 * @syscap SystemCapability.Multimedia.Camera.Core 9092 * @systemapi 9093 * @since 11 9094 */ 9095 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 9096 9097 /** 9098 * Subscribes to lcd flash status. 9099 * 9100 * @param { 'lcdFlashStatus' } type - Event type. 9101 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 9102 * @throws { BusinessError } 202 - Not System Application. 9103 * @syscap SystemCapability.Multimedia.Camera.Core 9104 * @systemapi 9105 * @since 13 9106 */ 9107 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 9108 9109 /** 9110 * Unsubscribes from lcd flash status. 9111 * 9112 * @param { 'lcdFlashStatus' } type - Event type. 9113 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 9114 * @throws { BusinessError } 202 - Not System Application. 9115 * @syscap SystemCapability.Multimedia.Camera.Core 9116 * @systemapi 9117 * @since 13 9118 */ 9119 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 9120 9121 /** 9122 * Gets session functions. 9123 * 9124 * @param { CameraOutputCapability } outputCapability - CameraOutputCapability to set. 9125 * @returns { Array<PortraitPhotoFunctions> } List of session functions. 9126 * @throws { BusinessError } 202 - Not System Application. 9127 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 9128 * @syscap SystemCapability.Multimedia.Camera.Core 9129 * @systemapi 9130 * @since 13 9131 */ 9132 getSessionFunctions(outputCapability: CameraOutputCapability): Array<PortraitPhotoFunctions>; 9133 9134 /** 9135 * Gets session conflict functions. 9136 * 9137 * @returns { Array<PortraitPhotoConflictFunctions> } List of session conflict functions. 9138 * @throws { BusinessError } 202 - Not System Application. 9139 * @syscap SystemCapability.Multimedia.Camera.Core 9140 * @systemapi 9141 * @since 13 9142 */ 9143 getSessionConflictFunctions(): Array<PortraitPhotoConflictFunctions>; 9144 } 9145 9146 /** 9147 * Aperture video session object. 9148 * 9149 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Aperture 9150 * @interface ApertureVideoSession 9151 * @syscap SystemCapability.Multimedia.Camera.Core 9152 * @systemapi 9153 * @since 12 9154 */ 9155 interface ApertureVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Aperture { 9156 /** 9157 * Subscribes to error events. 9158 * 9159 * @param { 'error' } type - Event type. 9160 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9161 * @throws { BusinessError } 202 - Not System Application. 9162 * @syscap SystemCapability.Multimedia.Camera.Core 9163 * @systemapi 9164 * @since 12 9165 */ 9166 on(type: 'error', callback: ErrorCallback): void; 9167 9168 /** 9169 * Unsubscribes from error events. 9170 * 9171 * @param { 'error' } type - Event type. 9172 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9173 * @throws { BusinessError } 202 - Not System Application. 9174 * @syscap SystemCapability.Multimedia.Camera.Core 9175 * @systemapi 9176 * @since 12 9177 */ 9178 off(type: 'error', callback?: ErrorCallback): void; 9179 9180 /** 9181 * Subscribes focus state change event callback. 9182 * 9183 * @param { 'focusStateChange' } type - Event type. 9184 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9185 * @throws { BusinessError } 202 - Not System Application. 9186 * @syscap SystemCapability.Multimedia.Camera.Core 9187 * @systemapi 9188 * @since 12 9189 */ 9190 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 9191 9192 /** 9193 * Unsubscribes from focus state change event callback. 9194 * 9195 * @param { 'focusStateChange' } type - Event type. 9196 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9197 * @throws { BusinessError } 202 - Not System Application. 9198 * @syscap SystemCapability.Multimedia.Camera.Core 9199 * @systemapi 9200 * @since 12 9201 */ 9202 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 9203 9204 /** 9205 * Subscribes zoom info event callback. 9206 * 9207 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9208 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9209 * @throws { BusinessError } 202 - Not System Application. 9210 * @syscap SystemCapability.Multimedia.Camera.Core 9211 * @systemapi 9212 * @since 12 9213 */ 9214 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 9215 9216 /** 9217 * Unsubscribes from zoom info event callback. 9218 * 9219 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9220 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9221 * @throws { BusinessError } 202 - Not System Application. 9222 * @syscap SystemCapability.Multimedia.Camera.Core 9223 * @systemapi 9224 * @since 12 9225 */ 9226 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 9227 } 9228 9229 /** 9230 * ManualExposure Query object. 9231 * 9232 * @interface ManualExposureQuery 9233 * @syscap SystemCapability.Multimedia.Camera.Core 9234 * @systemapi 9235 * @since 12 9236 */ 9237 interface ManualExposureQuery { 9238 /** 9239 * Gets the supported manual exposure range. 9240 * 9241 * @returns { Array<number> } The array of manual exposure range. 9242 * @throws { BusinessError } 202 - Not System Application. 9243 * @throws { BusinessError } 7400103 - Session not config. 9244 * @syscap SystemCapability.Multimedia.Camera.Core 9245 * @systemapi 9246 * @since 11 9247 */ 9248 /** 9249 * Gets the supported manual exposure range. 9250 * Move to ManualExposureQuery from ManualExposure since 12. 9251 * 9252 * @returns { Array<number> } The array of manual exposure range. 9253 * @throws { BusinessError } 202 - Not System Application. 9254 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9255 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 9256 * @syscap SystemCapability.Multimedia.Camera.Core 9257 * @systemapi 9258 * @since 12 9259 */ 9260 getSupportedExposureRange(): Array<number>; 9261 } 9262 9263 /** 9264 * ManualExposure object. 9265 * 9266 * @extends ManualExposureQuery 9267 * @interface ManualExposure 9268 * @syscap SystemCapability.Multimedia.Camera.Core 9269 * @systemapi 9270 * @since 11 9271 */ 9272 interface ManualExposure extends ManualExposureQuery { 9273 /** 9274 * Gets current exposure value. 9275 * 9276 * @returns { number } The current exposure value. 9277 * @throws { BusinessError } 202 - Not System Application. 9278 * @throws { BusinessError } 7400103 - Session not config. 9279 * @syscap SystemCapability.Multimedia.Camera.Core 9280 * @systemapi 9281 * @since 11 9282 */ 9283 /** 9284 * Gets current exposure value. 9285 * 9286 * @returns { number } The current exposure value. 9287 * @throws { BusinessError } 202 - Not System Application. 9288 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 9289 * @throws { BusinessError } 7400103 - Session not config. 9290 * @syscap SystemCapability.Multimedia.Camera.Core 9291 * @systemapi 9292 * @since 12 9293 */ 9294 getExposure(): number; 9295 9296 /** 9297 * Sets Exposure value. 9298 * 9299 * @param { number } exposure - Exposure value 9300 * @throws { BusinessError } 202 - Not System Application. 9301 * @throws { BusinessError } 7400103 - Session not config. 9302 * @syscap SystemCapability.Multimedia.Camera.Core 9303 * @systemapi 9304 * @since 11 9305 */ 9306 /** 9307 * Sets Exposure value. 9308 * 9309 * @param { number } exposure - Exposure value 9310 * @throws { BusinessError } 202 - Not System Application. 9311 * @throws { BusinessError } 7400102 - Operation not allowed. 9312 * @throws { BusinessError } 7400103 - Session not config. 9313 * @syscap SystemCapability.Multimedia.Camera.Core 9314 * @systemapi 9315 * @since 12 9316 */ 9317 setExposure(exposure: number): void; 9318 } 9319 9320 /** 9321 * Night photo session object. 9322 * 9323 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Beauty, ColorManagement, ManualExposure 9324 * @interface NightPhotoSession 9325 * @syscap SystemCapability.Multimedia.Camera.Core 9326 * @systemapi 9327 * @since 11 9328 */ 9329 interface NightPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, Beauty, ColorManagement, ManualExposure { 9330 /** 9331 * Subscribes to error events. 9332 * 9333 * @param { 'error' } type - Event type. 9334 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9335 * @syscap SystemCapability.Multimedia.Camera.Core 9336 * @systemapi 9337 * @since 11 9338 */ 9339 on(type: 'error', callback: ErrorCallback): void; 9340 9341 /** 9342 * Unsubscribes from error events. 9343 * 9344 * @param { 'error' } type - Event type. 9345 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9346 * @syscap SystemCapability.Multimedia.Camera.Core 9347 * @systemapi 9348 * @since 11 9349 */ 9350 off(type: 'error', callback?: ErrorCallback): void; 9351 9352 /** 9353 * Subscribes focus state change event callback. 9354 * 9355 * @param { 'focusStateChange' } type - Event type. 9356 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9357 * @syscap SystemCapability.Multimedia.Camera.Core 9358 * @systemapi 9359 * @since 11 9360 */ 9361 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 9362 9363 /** 9364 * Unsubscribes from focus state change event callback. 9365 * 9366 * @param { 'focusStateChange' } type - Event type. 9367 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9368 * @syscap SystemCapability.Multimedia.Camera.Core 9369 * @systemapi 9370 * @since 11 9371 */ 9372 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 9373 9374 /** 9375 * Subscribes zoom info event callback. 9376 * 9377 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9378 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9379 * @syscap SystemCapability.Multimedia.Camera.Core 9380 * @systemapi 9381 * @since 11 9382 */ 9383 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 9384 9385 /** 9386 * Unsubscribes from zoom info event callback. 9387 * 9388 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9389 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9390 * @syscap SystemCapability.Multimedia.Camera.Core 9391 * @systemapi 9392 * @since 11 9393 */ 9394 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 9395 9396 /** 9397 * Subscribes to lcd flash status. 9398 * 9399 * @param { 'lcdFlashStatus' } type - Event type. 9400 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 9401 * @throws { BusinessError } 202 - Not System Application. 9402 * @syscap SystemCapability.Multimedia.Camera.Core 9403 * @systemapi 9404 * @since 12 9405 */ 9406 on(type: 'lcdFlashStatus', callback: AsyncCallback<LcdFlashStatus>): void; 9407 9408 /** 9409 * Unsubscribes from lcd flash status. 9410 * 9411 * @param { 'lcdFlashStatus' } type - Event type. 9412 * @param { AsyncCallback<LcdFlashStatus> } callback - Callback used to get the lcd flash status. 9413 * @throws { BusinessError } 202 - Not System Application. 9414 * @syscap SystemCapability.Multimedia.Camera.Core 9415 * @systemapi 9416 * @since 12 9417 */ 9418 off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void; 9419 } 9420 9421 /** 9422 * ISO info object 9423 * 9424 * @typedef IsoInfo 9425 * @syscap SystemCapability.Multimedia.Camera.Core 9426 * @systemapi 9427 * @since 12 9428 */ 9429 interface IsoInfo { 9430 /** 9431 * ISO value. 9432 * 9433 * @type { ?number } 9434 * @readonly 9435 * @syscap SystemCapability.Multimedia.Camera.Core 9436 * @systemapi 9437 * @since 12 9438 */ 9439 readonly iso?: number; 9440 } 9441 9442 /** 9443 * Exposure info object 9444 * 9445 * @typedef ExposureInfo 9446 * @syscap SystemCapability.Multimedia.Camera.Core 9447 * @systemapi 9448 * @since 12 9449 */ 9450 interface ExposureInfo { 9451 /** 9452 * Exposure time value. 9453 * 9454 * @type { ?number } 9455 * @readonly 9456 * @syscap SystemCapability.Multimedia.Camera.Core 9457 * @systemapi 9458 * @since 12 9459 */ 9460 readonly exposureTime?: number; 9461 } 9462 9463 /** 9464 * Aperture info object 9465 * 9466 * @typedef ApertureInfo 9467 * @syscap SystemCapability.Multimedia.Camera.Core 9468 * @systemapi 9469 * @since 12 9470 */ 9471 interface ApertureInfo { 9472 /** 9473 * Aperture value. 9474 * 9475 * @type { ?number } 9476 * @readonly 9477 * @syscap SystemCapability.Multimedia.Camera.Core 9478 * @systemapi 9479 * @since 12 9480 */ 9481 readonly aperture?: number; 9482 } 9483 9484 /** 9485 * Lumination info object 9486 * 9487 * @typedef LuminationInfo 9488 * @syscap SystemCapability.Multimedia.Camera.Core 9489 * @systemapi 9490 * @since 12 9491 */ 9492 interface LuminationInfo { 9493 /** 9494 * Lumination value. 9495 * 9496 * @type { ?number } 9497 * @readonly 9498 * @syscap SystemCapability.Multimedia.Camera.Core 9499 * @systemapi 9500 * @since 12 9501 */ 9502 readonly lumination?: number; 9503 } 9504 9505 /** 9506 * Professional photo session object. 9507 * 9508 * @interface ProfessionalPhotoSession 9509 * @syscap SystemCapability.Multimedia.Camera.Core 9510 * @systemapi 9511 * @since 12 9512 */ 9513 interface ProfessionalPhotoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { 9514 /** 9515 * Subscribes to error events. 9516 * 9517 * @param { 'error' } type - Event type. 9518 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9519 * @throws { BusinessError } 202 - Not System Application. 9520 * @syscap SystemCapability.Multimedia.Camera.Core 9521 * @systemapi 9522 * @since 12 9523 */ 9524 on(type: 'error', callback: ErrorCallback): void; 9525 9526 /** 9527 * Unsubscribes from error events. 9528 * 9529 * @param { 'error' } type - Event type. 9530 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9531 * @throws { BusinessError } 202 - Not System Application. 9532 * @syscap SystemCapability.Multimedia.Camera.Core 9533 * @systemapi 9534 * @since 12 9535 */ 9536 off(type: 'error', callback?: ErrorCallback): void; 9537 9538 /** 9539 * Subscribes focus state change event callback. 9540 * 9541 * @param { 'focusStateChange' } type - Event type. 9542 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9543 * @throws { BusinessError } 202 - Not System Application. 9544 * @syscap SystemCapability.Multimedia.Camera.Core 9545 * @systemapi 9546 * @since 12 9547 */ 9548 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 9549 9550 /** 9551 * Unsubscribes from focus state change event callback. 9552 * 9553 * @param { 'focusStateChange' } type - Event type. 9554 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9555 * @throws { BusinessError } 202 - Not System Application. 9556 * @syscap SystemCapability.Multimedia.Camera.Core 9557 * @systemapi 9558 * @since 12 9559 */ 9560 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 9561 9562 /** 9563 * Subscribes zoom info event callback. 9564 * 9565 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9566 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9567 * @throws { BusinessError } 202 - Not System Application. 9568 * @syscap SystemCapability.Multimedia.Camera.Core 9569 * @systemapi 9570 * @since 12 9571 */ 9572 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 9573 9574 /** 9575 * Unsubscribes from zoom info event callback. 9576 * 9577 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9578 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9579 * @throws { BusinessError } 202 - Not System Application. 9580 * @syscap SystemCapability.Multimedia.Camera.Core 9581 * @systemapi 9582 * @since 12 9583 */ 9584 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 9585 9586 /** 9587 * Subscribes ISO info event callback. 9588 * 9589 * @param { 'isoInfoChange' } type - Event type. 9590 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 9591 * @throws { BusinessError } 202 - Not System Application. 9592 * @syscap SystemCapability.Multimedia.Camera.Core 9593 * @systemapi 9594 * @since 12 9595 */ 9596 on(type: 'isoInfoChange', callback: AsyncCallback<IsoInfo>): void; 9597 9598 /** 9599 * Unsubscribes from ISO info event callback. 9600 * 9601 * @param { 'isoInfoChange' } type - Event type. 9602 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 9603 * @throws { BusinessError } 202 - Not System Application. 9604 * @syscap SystemCapability.Multimedia.Camera.Core 9605 * @systemapi 9606 * @since 12 9607 */ 9608 off(type: 'isoInfoChange', callback?: AsyncCallback<IsoInfo>): void; 9609 9610 /** 9611 * Subscribes exposure info event callback. 9612 * 9613 * @param { 'exposureInfoChange' } type - Event type. 9614 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 9615 * @throws { BusinessError } 202 - Not System Application. 9616 * @syscap SystemCapability.Multimedia.Camera.Core 9617 * @systemapi 9618 * @since 12 9619 */ 9620 on(type: 'exposureInfoChange', callback: AsyncCallback<ExposureInfo>): void; 9621 9622 /** 9623 * Unsubscribes from exposure info event callback. 9624 * 9625 * @param { 'exposureInfoChange' } type - Event type. 9626 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 9627 * @throws { BusinessError } 202 - Not System Application. 9628 * @syscap SystemCapability.Multimedia.Camera.Core 9629 * @systemapi 9630 * @since 12 9631 */ 9632 off(type: 'exposureInfoChange', callback?: AsyncCallback<ExposureInfo>): void; 9633 9634 /** 9635 * Subscribes aperture info event callback. 9636 * 9637 * @param { 'apertureInfoChange' } type - Event type. 9638 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 9639 * @throws { BusinessError } 202 - Not System Application. 9640 * @syscap SystemCapability.Multimedia.Camera.Core 9641 * @systemapi 9642 * @since 12 9643 */ 9644 on(type: 'apertureInfoChange', callback: AsyncCallback<ApertureInfo>): void; 9645 9646 /** 9647 * Unsubscribes from aperture info event callback. 9648 * 9649 * @param { 'apertureInfoChange' } type - Event type. 9650 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 9651 * @throws { BusinessError } 202 - Not System Application. 9652 * @syscap SystemCapability.Multimedia.Camera.Core 9653 * @systemapi 9654 * @since 12 9655 */ 9656 off(type: 'apertureInfoChange', callback?: AsyncCallback<ApertureInfo>): void; 9657 9658 /** 9659 * Subscribes lumination info event callback. 9660 * 9661 * @param { 'luminationInfoChange' } type - Event type. 9662 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 9663 * @throws { BusinessError } 202 - Not System Application. 9664 * @syscap SystemCapability.Multimedia.Camera.Core 9665 * @systemapi 9666 * @since 12 9667 */ 9668 on(type: 'luminationInfoChange', callback: AsyncCallback<LuminationInfo>): void; 9669 9670 /** 9671 * Unsubscribes from lumination info event callback. 9672 * 9673 * @param { 'luminationInfoChange' } type - Event type. 9674 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 9675 * @throws { BusinessError } 202 - Not System Application. 9676 * @syscap SystemCapability.Multimedia.Camera.Core 9677 * @systemapi 9678 * @since 12 9679 */ 9680 off(type: 'luminationInfoChange', callback?: AsyncCallback<LuminationInfo>): void; 9681 } 9682 9683 /** 9684 * Professional video session object. 9685 * 9686 * @extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture 9687 * @interface ProfessionalVideoSession 9688 * @syscap SystemCapability.Multimedia.Camera.Core 9689 * @systemapi 9690 * @since 12 9691 */ 9692 interface ProfessionalVideoSession extends Session, AutoExposure, ManualExposure, Focus, ManualFocus, WhiteBalance, ManualIso, Flash, Zoom, ColorEffect, Aperture { 9693 /** 9694 * Subscribes to error events. 9695 * 9696 * @param { 'error' } type - Event type. 9697 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9698 * @throws { BusinessError } 202 - Not System Application. 9699 * @syscap SystemCapability.Multimedia.Camera.Core 9700 * @systemapi 9701 * @since 12 9702 */ 9703 on(type: 'error', callback: ErrorCallback): void; 9704 9705 /** 9706 * Unsubscribes from error events. 9707 * 9708 * @param { 'error' } type - Event type. 9709 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9710 * @throws { BusinessError } 202 - Not System Application. 9711 * @syscap SystemCapability.Multimedia.Camera.Core 9712 * @systemapi 9713 * @since 12 9714 */ 9715 off(type: 'error', callback?: ErrorCallback): void; 9716 9717 /** 9718 * Subscribes focus state change event callback. 9719 * 9720 * @param { 'focusStateChange' } type - Event type. 9721 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9722 * @throws { BusinessError } 202 - Not System Application. 9723 * @syscap SystemCapability.Multimedia.Camera.Core 9724 * @systemapi 9725 * @since 12 9726 */ 9727 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 9728 9729 /** 9730 * Unsubscribes from focus state change event callback. 9731 * 9732 * @param { 'focusStateChange' } type - Event type. 9733 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9734 * @throws { BusinessError } 202 - Not System Application. 9735 * @syscap SystemCapability.Multimedia.Camera.Core 9736 * @systemapi 9737 * @since 12 9738 */ 9739 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 9740 9741 /** 9742 * Subscribes zoom info event callback. 9743 * 9744 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9745 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9746 * @throws { BusinessError } 202 - Not System Application. 9747 * @syscap SystemCapability.Multimedia.Camera.Core 9748 * @systemapi 9749 * @since 12 9750 */ 9751 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 9752 9753 /** 9754 * Unsubscribes from zoom info event callback. 9755 * 9756 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9757 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9758 * @throws { BusinessError } 202 - Not System Application. 9759 * @syscap SystemCapability.Multimedia.Camera.Core 9760 * @systemapi 9761 * @since 12 9762 */ 9763 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 9764 9765 /** 9766 * Subscribes ISO info event callback. 9767 * 9768 * @param { 'isoInfoChange' } type - Event type. 9769 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 9770 * @throws { BusinessError } 202 - Not System Application. 9771 * @syscap SystemCapability.Multimedia.Camera.Core 9772 * @systemapi 9773 * @since 12 9774 */ 9775 on(type: 'isoInfoChange', callback: AsyncCallback<IsoInfo>): void; 9776 9777 /** 9778 * Unsubscribes from ISO info event callback. 9779 * 9780 * @param { 'isoInfoChange' } type - Event type. 9781 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 9782 * @throws { BusinessError } 202 - Not System Application. 9783 * @syscap SystemCapability.Multimedia.Camera.Core 9784 * @systemapi 9785 * @since 12 9786 */ 9787 off(type: 'isoInfoChange', callback?: AsyncCallback<IsoInfo>): void; 9788 9789 /** 9790 * Subscribes exposure info event callback. 9791 * 9792 * @param { 'exposureInfoChange' } type - Event type. 9793 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 9794 * @throws { BusinessError } 202 - Not System Application. 9795 * @syscap SystemCapability.Multimedia.Camera.Core 9796 * @systemapi 9797 * @since 12 9798 */ 9799 on(type: 'exposureInfoChange', callback: AsyncCallback<ExposureInfo>): void; 9800 9801 /** 9802 * Unsubscribes from exposure info event callback. 9803 * 9804 * @param { 'exposureInfoChange' } type - Event type. 9805 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 9806 * @throws { BusinessError } 202 - Not System Application. 9807 * @syscap SystemCapability.Multimedia.Camera.Core 9808 * @systemapi 9809 * @since 12 9810 */ 9811 off(type: 'exposureInfoChange', callback?: AsyncCallback<ExposureInfo>): void; 9812 9813 /** 9814 * Subscribes aperture info event callback. 9815 * 9816 * @param { 'apertureInfoChange' } type - Event type. 9817 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 9818 * @throws { BusinessError } 202 - Not System Application. 9819 * @syscap SystemCapability.Multimedia.Camera.Core 9820 * @systemapi 9821 * @since 12 9822 */ 9823 on(type: 'apertureInfoChange', callback: AsyncCallback<ApertureInfo>): void; 9824 9825 /** 9826 * Unsubscribes from aperture info event callback. 9827 * 9828 * @param { 'apertureInfoChange' } type - Event type. 9829 * @param { AsyncCallback<ApertureInfo> } callback - Callback used to get the aperture info. 9830 * @throws { BusinessError } 202 - Not System Application. 9831 * @syscap SystemCapability.Multimedia.Camera.Core 9832 * @systemapi 9833 * @since 12 9834 */ 9835 off(type: 'apertureInfoChange', callback?: AsyncCallback<ApertureInfo>): void; 9836 9837 /** 9838 * Subscribes lumination info event callback. 9839 * 9840 * @param { 'luminationInfoChange' } type - Event type. 9841 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 9842 * @throws { BusinessError } 202 - Not System Application. 9843 * @syscap SystemCapability.Multimedia.Camera.Core 9844 * @systemapi 9845 * @since 12 9846 */ 9847 on(type: 'luminationInfoChange', callback: AsyncCallback<LuminationInfo>): void; 9848 9849 /** 9850 * Unsubscribes from lumination info event callback. 9851 * 9852 * @param { 'luminationInfoChange' } type - Event type. 9853 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 9854 * @throws { BusinessError } 202 - Not System Application. 9855 * @syscap SystemCapability.Multimedia.Camera.Core 9856 * @systemapi 9857 * @since 12 9858 */ 9859 off(type: 'luminationInfoChange', callback?: AsyncCallback<LuminationInfo>): void; 9860 } 9861 9862 /** 9863 * Enum for slow motion status. 9864 * 9865 * @enum { number } 9866 * @syscap SystemCapability.Multimedia.Camera.Core 9867 * @systemapi 9868 * @since 12 9869 */ 9870 enum SlowMotionStatus { 9871 /** 9872 * Slow motion disabled. 9873 * 9874 * @syscap SystemCapability.Multimedia.Camera.Core 9875 * @systemapi 9876 * @since 12 9877 */ 9878 DISABLED = 0, 9879 9880 /** 9881 * Slow motion ready. 9882 * 9883 * @syscap SystemCapability.Multimedia.Camera.Core 9884 * @systemapi 9885 * @since 12 9886 */ 9887 READY = 1, 9888 9889 /** 9890 * Slow motion video start. 9891 * 9892 * @syscap SystemCapability.Multimedia.Camera.Core 9893 * @systemapi 9894 * @since 12 9895 */ 9896 VIDEO_START = 2, 9897 9898 /** 9899 * Slow motion video done. 9900 * 9901 * @syscap SystemCapability.Multimedia.Camera.Core 9902 * @systemapi 9903 * @since 12 9904 */ 9905 VIDEO_DONE = 3, 9906 9907 /** 9908 * Slow motion finished. 9909 * 9910 * @syscap SystemCapability.Multimedia.Camera.Core 9911 * @systemapi 9912 * @since 12 9913 */ 9914 FINISHED = 4 9915 } 9916 9917 /** 9918 * Slow motion video session object. 9919 * 9920 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect 9921 * @interface SlowMotionVideoSession 9922 * @syscap SystemCapability.Multimedia.Camera.Core 9923 * @systemapi 9924 * @since 12 9925 */ 9926 interface SlowMotionVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect { 9927 /** 9928 * Subscribes to error events. 9929 * 9930 * @param { 'error' } type - Event type. 9931 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9932 * @throws { BusinessError } 202 - Not System Application. 9933 * @syscap SystemCapability.Multimedia.Camera.Core 9934 * @systemapi 9935 * @since 12 9936 */ 9937 on(type: 'error', callback: ErrorCallback): void; 9938 9939 /** 9940 * Unsubscribes from error events. 9941 * 9942 * @param { 'error' } type - Event type. 9943 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 9944 * @throws { BusinessError } 202 - Not System Application. 9945 * @syscap SystemCapability.Multimedia.Camera.Core 9946 * @systemapi 9947 * @since 12 9948 */ 9949 off(type: 'error', callback?: ErrorCallback): void; 9950 9951 /** 9952 * Subscribes focus state change event callback. 9953 * 9954 * @param { 'focusStateChange' } type - Event type. 9955 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9956 * @throws { BusinessError } 202 - Not System Application. 9957 * @syscap SystemCapability.Multimedia.Camera.Core 9958 * @systemapi 9959 * @since 12 9960 */ 9961 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 9962 9963 /** 9964 * Unsubscribes from focus state change event callback. 9965 * 9966 * @param { 'focusStateChange' } type - Event type. 9967 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 9968 * @throws { BusinessError } 202 - Not System Application. 9969 * @syscap SystemCapability.Multimedia.Camera.Core 9970 * @systemapi 9971 * @since 12 9972 */ 9973 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 9974 9975 /** 9976 * Subscribes zoom info event callback. 9977 * 9978 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9979 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9980 * @throws { BusinessError } 202 - Not System Application. 9981 * @syscap SystemCapability.Multimedia.Camera.Core 9982 * @systemapi 9983 * @since 12 9984 */ 9985 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 9986 9987 /** 9988 * Unsubscribes from zoom info event callback. 9989 * 9990 * @param { 'smoothZoomInfoAvailable' } type - Event type. 9991 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 9992 * @throws { BusinessError } 202 - Not System Application. 9993 * @syscap SystemCapability.Multimedia.Camera.Core 9994 * @systemapi 9995 * @since 12 9996 */ 9997 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 9998 9999 /** 10000 * Determine whether camera slow motion detection is supported. 10001 * 10002 * @returns { boolean } Is camera slow motion detection supported. 10003 * @throws { BusinessError } 202 - Not System Application. 10004 * @throws { BusinessError } 7400103 - Session not config. 10005 * @syscap SystemCapability.Multimedia.Camera.Core 10006 * @systemapi 10007 * @since 12 10008 */ 10009 /** 10010 * Determine whether camera slow motion detection is supported. 10011 * 10012 * @returns { boolean } Is camera slow motion detection supported. 10013 * @throws { BusinessError } 202 - Not System Application. 10014 * @syscap SystemCapability.Multimedia.Camera.Core 10015 * @systemapi 10016 * @since 19 10017 */ 10018 isSlowMotionDetectionSupported(): boolean; 10019 10020 /** 10021 * Set slow motion detection area. 10022 * 10023 * @param { Rect } area - Detection area. 10024 * @throws { BusinessError } 202 - Not System Application. 10025 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10026 * @throws { BusinessError } 7400103 - Session not config. 10027 * @syscap SystemCapability.Multimedia.Camera.Core 10028 * @systemapi 10029 * @since 12 10030 */ 10031 /** 10032 * Set slow motion detection area. 10033 * 10034 * @param { Rect } area - Detection area. 10035 * @throws { BusinessError } 202 - Not System Application. 10036 * @syscap SystemCapability.Multimedia.Camera.Core 10037 * @systemapi 10038 * @since 19 10039 */ 10040 setSlowMotionDetectionArea(area: Rect): void; 10041 10042 /** 10043 * Subscribes slow motion status callback. 10044 * 10045 * @param { 'slowMotionStatus' } type - Event type. 10046 * @param { AsyncCallback<SlowMotionStatus> } callback - Callback used to get the slow motion status. 10047 * @throws { BusinessError } 202 - Not System Application. 10048 * @syscap SystemCapability.Multimedia.Camera.Core 10049 * @systemapi 10050 * @since 12 10051 */ 10052 on(type: 'slowMotionStatus', callback: AsyncCallback<SlowMotionStatus>): void; 10053 10054 /** 10055 * Unsubscribes slow motion status callback. 10056 * 10057 * @param { 'slowMotionStatus' } type - Event type. 10058 * @param { AsyncCallback<SlowMotionStatus> } callback - Callback used to get the slow motion status. 10059 * @throws { BusinessError } 202 - Not System Application. 10060 * @syscap SystemCapability.Multimedia.Camera.Core 10061 * @systemapi 10062 * @since 12 10063 */ 10064 off(type: 'slowMotionStatus', callback?: AsyncCallback<SlowMotionStatus>): void; 10065 } 10066 10067 /** 10068 * High resolution session object. 10069 * 10070 * @extends Session, AutoExposure, Focus 10071 * @interface HighResolutionPhotoSession 10072 * @syscap SystemCapability.Multimedia.Camera.Core 10073 * @systemapi 10074 * @since 12 10075 */ 10076 interface HighResolutionPhotoSession extends Session, AutoExposure, Focus { 10077 /** 10078 * Subscribes to error events. 10079 * 10080 * @param { 'error' } type - Event type. 10081 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10082 * @throws { BusinessError } 202 - Not System Application. 10083 * @syscap SystemCapability.Multimedia.Camera.Core 10084 * @systemapi 10085 * @since 12 10086 */ 10087 on(type: 'error', callback: ErrorCallback): void; 10088 10089 /** 10090 * Unsubscribes from error events. 10091 * 10092 * @param { 'error' } type - Event type. 10093 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10094 * @throws { BusinessError } 202 - Not System Application. 10095 * @syscap SystemCapability.Multimedia.Camera.Core 10096 * @systemapi 10097 * @since 12 10098 */ 10099 off(type: 'error', callback?: ErrorCallback): void; 10100 10101 /** 10102 * Subscribes focus state change event callback. 10103 * 10104 * @param { 'focusStateChange' } type - Event type. 10105 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10106 * @throws { BusinessError } 202 - Not System Application. 10107 * @syscap SystemCapability.Multimedia.Camera.Core 10108 * @systemapi 10109 * @since 12 10110 */ 10111 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 10112 10113 /** 10114 * Unsubscribes from focus state change event callback. 10115 * 10116 * @param { 'focusStateChange' } type - Event type. 10117 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10118 * @throws { BusinessError } 202 - Not System Application. 10119 * @syscap SystemCapability.Multimedia.Camera.Core 10120 * @systemapi 10121 * @since 12 10122 */ 10123 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 10124 } 10125 10126 /** 10127 * Macro photo session object. 10128 * 10129 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus 10130 * @interface MacroPhotoSession 10131 * @syscap SystemCapability.Multimedia.Camera.Core 10132 * @systemapi 10133 * @since 12 10134 */ 10135 /** 10136 * Macro photo session object. 10137 * 10138 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, DepthFusion 10139 * @interface MacroPhotoSession 10140 * @syscap SystemCapability.Multimedia.Camera.Core 10141 * @systemapi 10142 * @since 14 10143 */ 10144 /** 10145 * Macro photo session object. 10146 * 10147 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, DepthFusion, ColorManagement 10148 * @interface MacroPhotoSession 10149 * @syscap SystemCapability.Multimedia.Camera.Core 10150 * @systemapi 10151 * @since 18 10152 */ 10153 interface MacroPhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, DepthFusion, ColorManagement { 10154 /** 10155 * Subscribes to error events. 10156 * 10157 * @param { 'error' } type - Event type. 10158 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10159 * @throws { BusinessError } 202 - Not System Application. 10160 * @syscap SystemCapability.Multimedia.Camera.Core 10161 * @systemapi 10162 * @since 12 10163 */ 10164 on(type: 'error', callback: ErrorCallback): void; 10165 10166 /** 10167 * Unsubscribes from error events. 10168 * 10169 * @param { 'error' } type - Event type. 10170 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10171 * @throws { BusinessError } 202 - Not System Application. 10172 * @syscap SystemCapability.Multimedia.Camera.Core 10173 * @systemapi 10174 * @since 12 10175 */ 10176 off(type: 'error', callback?: ErrorCallback): void; 10177 10178 /** 10179 * Subscribes focus state change event callback. 10180 * 10181 * @param { 'focusStateChange' } type - Event type. 10182 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10183 * @throws { BusinessError } 202 - Not System Application. 10184 * @syscap SystemCapability.Multimedia.Camera.Core 10185 * @systemapi 10186 * @since 12 10187 */ 10188 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 10189 10190 /** 10191 * Unsubscribes from focus state change event callback. 10192 * 10193 * @param { 'focusStateChange' } type - Event type. 10194 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10195 * @throws { BusinessError } 202 - Not System Application. 10196 * @syscap SystemCapability.Multimedia.Camera.Core 10197 * @systemapi 10198 * @since 12 10199 */ 10200 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 10201 10202 /** 10203 * Subscribes zoom info event callback. 10204 * 10205 * @param { 'smoothZoomInfoAvailable' } type - Event type. 10206 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 10207 * @throws { BusinessError } 202 - Not System Application. 10208 * @syscap SystemCapability.Multimedia.Camera.Core 10209 * @systemapi 10210 * @since 12 10211 */ 10212 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 10213 10214 /** 10215 * Unsubscribes from zoom info event callback. 10216 * 10217 * @param { 'smoothZoomInfoAvailable' } type - Event type. 10218 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 10219 * @throws { BusinessError } 202 - Not System Application. 10220 * @syscap SystemCapability.Multimedia.Camera.Core 10221 * @systemapi 10222 * @since 12 10223 */ 10224 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 10225 } 10226 10227 /** 10228 * Macro video session object. 10229 * 10230 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus 10231 * @interface MacroVideoSession 10232 * @syscap SystemCapability.Multimedia.Camera.Core 10233 * @systemapi 10234 * @since 12 10235 */ 10236 /** 10237 * Macro video session object. 10238 * 10239 * @extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, ColorManagement 10240 * @interface MacroVideoSession 10241 * @syscap SystemCapability.Multimedia.Camera.Core 10242 * @systemapi 10243 * @since 18 10244 */ 10245 interface MacroVideoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorEffect, ManualFocus, ColorManagement { 10246 /** 10247 * Subscribes to error events. 10248 * 10249 * @param { 'error' } type - Event type. 10250 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10251 * @throws { BusinessError } 202 - Not System Application. 10252 * @syscap SystemCapability.Multimedia.Camera.Core 10253 * @systemapi 10254 * @since 12 10255 */ 10256 on(type: 'error', callback: ErrorCallback): void; 10257 10258 /** 10259 * Unsubscribes from error events. 10260 * 10261 * @param { 'error' } type - Event type. 10262 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10263 * @throws { BusinessError } 202 - Not System Application. 10264 * @syscap SystemCapability.Multimedia.Camera.Core 10265 * @systemapi 10266 * @since 12 10267 */ 10268 off(type: 'error', callback?: ErrorCallback): void; 10269 10270 /** 10271 * Subscribes focus state change event callback. 10272 * 10273 * @param { 'focusStateChange' } type - Event type. 10274 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10275 * @throws { BusinessError } 202 - Not System Application. 10276 * @syscap SystemCapability.Multimedia.Camera.Core 10277 * @systemapi 10278 * @since 12 10279 */ 10280 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 10281 10282 /** 10283 * Unsubscribes from focus state change event callback. 10284 * 10285 * @param { 'focusStateChange' } type - Event type. 10286 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10287 * @throws { BusinessError } 202 - Not System Application. 10288 * @syscap SystemCapability.Multimedia.Camera.Core 10289 * @systemapi 10290 * @since 12 10291 */ 10292 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 10293 10294 /** 10295 * Subscribes zoom info event callback. 10296 * 10297 * @param { 'smoothZoomInfoAvailable' } type - Event type. 10298 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 10299 * @throws { BusinessError } 202 - Not System Application. 10300 * @syscap SystemCapability.Multimedia.Camera.Core 10301 * @systemapi 10302 * @since 12 10303 */ 10304 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 10305 10306 /** 10307 * Unsubscribes from zoom info event callback. 10308 * 10309 * @param { 'smoothZoomInfoAvailable' } type - Event type. 10310 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 10311 * @throws { BusinessError } 202 - Not System Application. 10312 * @syscap SystemCapability.Multimedia.Camera.Core 10313 * @systemapi 10314 * @since 12 10315 */ 10316 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 10317 } 10318 10319 /** 10320 * Secure camera session object. 10321 * 10322 * @extends Session, Flash, AutoExposure, Focus, Zoom 10323 * @interface SecureSession 10324 * @syscap SystemCapability.Multimedia.Camera.Core 10325 * @since 12 10326 */ 10327 /** 10328 * Secure camera session object. 10329 * 10330 * @extends Session, Flash, AutoExposure, Focus, Zoom 10331 * @interface SecureSession 10332 * @syscap SystemCapability.Multimedia.Camera.Core 10333 * @atomicservice 10334 * @since 19 10335 */ 10336 /** 10337 * Secure camera session object. 10338 * 10339 * @extends Session, Flash, AutoExposure, WhiteBalance, Focus, Zoom 10340 * @interface SecureSession 10341 * @syscap SystemCapability.Multimedia.Camera.Core 10342 * @atomicservice 10343 * @since 20 10344 */ 10345 interface SecureSession extends Session, Flash, AutoExposure, WhiteBalance, Focus, Zoom { 10346 /** 10347 * Add Secure output for camera. 10348 * 10349 * @param { PreviewOutput } previewOutput - Specify the output as a secure flow. 10350 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10351 * @throws { BusinessError } 7400102 - Operation not allowed. 10352 * @throws { BusinessError } 7400103 - Session not config. 10353 * @syscap SystemCapability.Multimedia.Camera.Core 10354 * @since 12 10355 */ 10356 /** 10357 * Preview output is marked as secure out put by this interface. 10358 * 10359 * @param { PreviewOutput } previewOutput - Specify the output as a secure flow. 10360 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10361 * @throws { BusinessError } 7400102 - Operation not allowed. 10362 * @syscap SystemCapability.Multimedia.Camera.Core 10363 * @since 18 10364 */ 10365 /** 10366 * Add Secure output for camera. 10367 * 10368 * @param { PreviewOutput } previewOutput - Specify the output as a secure flow. 10369 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10370 * @throws { BusinessError } 7400102 - Operation not allowed. 10371 * @syscap SystemCapability.Multimedia.Camera.Core 10372 * @atomicservice 10373 * @since 19 10374 */ 10375 addSecureOutput(previewOutput: PreviewOutput): void; 10376 10377 /** 10378 * Subscribes to error events. 10379 * 10380 * @param { 'error' } type - Event type. 10381 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10382 * @syscap SystemCapability.Multimedia.Camera.Core 10383 * @since 12 10384 */ 10385 /** 10386 * Registers a listener for error events on security camera sessions to get the result by registering 10387 * a callback function. This API uses an asynchronous callback to return the result. 10388 * 10389 * Description: Currently, it is not allowed to use off() to unregister the callback 10390 * within the callback method of on(). 10391 * 10392 * @param { 'error' } type - Event type. 10393 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10394 * @syscap SystemCapability.Multimedia.Camera.Core 10395 * @atomicservice 10396 * @since 19 10397 */ 10398 on(type: 'error', callback: ErrorCallback): void; 10399 10400 /** 10401 * Unsubscribes from error events. 10402 * 10403 * @param { 'error' } type - Event type. 10404 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10405 * @syscap SystemCapability.Multimedia.Camera.Core 10406 * @since 12 10407 */ 10408 /** 10409 * Unsubscribes from error events. 10410 * 10411 * @param { 'error' } type - Event type. 10412 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10413 * @syscap SystemCapability.Multimedia.Camera.Core 10414 * @atomicservice 10415 * @since 19 10416 */ 10417 off(type: 'error', callback?: ErrorCallback): void; 10418 10419 /** 10420 * Subscribes focus status change event callback. 10421 * 10422 * @param { 'focusStateChange' } type - Event type. 10423 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10424 * @syscap SystemCapability.Multimedia.Camera.Core 10425 * @since 12 10426 */ 10427 /** 10428 * Registers a listener for error events on security camera sessions to get the result by registering 10429 * a callback function. This API uses an asynchronous callback to return the result. 10430 * 10431 * Description: Currently, it is not allowed to use off() to unregister the callback 10432 * within the callback method of on(). 10433 * 10434 * @param { 'focusStateChange' } type - Event type. 10435 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10436 * @syscap SystemCapability.Multimedia.Camera.Core 10437 * @atomicservice 10438 * @since 19 10439 */ 10440 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 10441 10442 /** 10443 * Unsubscribes from focus status change event callback. 10444 * 10445 * @param { 'focusStateChange' } type - Event type. 10446 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10447 * @syscap SystemCapability.Multimedia.Camera.Core 10448 * @since 12 10449 */ 10450 /** 10451 * Unsubscribes from focus status change event callback. 10452 * 10453 * @param { 'focusStateChange' } type - Event type. 10454 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10455 * @syscap SystemCapability.Multimedia.Camera.Core 10456 * @atomicservice 10457 * @since 19 10458 */ 10459 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 10460 } 10461 10462 /** 10463 * Light painting photo session object. 10464 * 10465 * @extends Session, Flash, Focus, Zoom, ColorEffect 10466 * @interface LightPaintingPhotoSession 10467 * @syscap SystemCapability.Multimedia.Camera.Core 10468 * @systemapi 10469 * @since 12 10470 */ 10471 interface LightPaintingPhotoSession extends Session, Flash, Focus, Zoom, ColorEffect { 10472 /** 10473 * Subscribes to error events. 10474 * 10475 * @param { 'error' } type - Event type. 10476 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10477 * @throws { BusinessError } 202 - Not System Application. 10478 * @syscap SystemCapability.Multimedia.Camera.Core 10479 * @systemapi 10480 * @since 12 10481 */ 10482 on(type: 'error', callback: ErrorCallback): void; 10483 10484 /** 10485 * Unsubscribes from error events. 10486 * 10487 * @param { 'error' } type - Event type. 10488 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10489 * @throws { BusinessError } 202 - Not System Application. 10490 * @syscap SystemCapability.Multimedia.Camera.Core 10491 * @systemapi 10492 * @since 12 10493 */ 10494 off(type: 'error', callback?: ErrorCallback): void; 10495 10496 /** 10497 * Subscribes focus state change event callback. 10498 * 10499 * @param { 'focusStateChange' } type - Event type. 10500 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10501 * @throws { BusinessError } 202 - Not System Application. 10502 * @syscap SystemCapability.Multimedia.Camera.Core 10503 * @systemapi 10504 * @since 12 10505 */ 10506 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 10507 10508 /** 10509 * Unsubscribes from focus state change event callback. 10510 * 10511 * @param { 'focusStateChange' } type - Event type. 10512 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10513 * @throws { BusinessError } 202 - Not System Application. 10514 * @syscap SystemCapability.Multimedia.Camera.Core 10515 * @systemapi 10516 * @since 12 10517 */ 10518 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 10519 10520 /** 10521 * Subscribes zoom info event callback. 10522 * 10523 * @param { 'smoothZoomInfoAvailable' } type - Event type. 10524 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 10525 * @throws { BusinessError } 202 - Not System Application. 10526 * @syscap SystemCapability.Multimedia.Camera.Core 10527 * @systemapi 10528 * @since 12 10529 */ 10530 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 10531 10532 /** 10533 * Unsubscribes from zoom info event callback. 10534 * 10535 * @param { 'smoothZoomInfoAvailable' } type - Event type. 10536 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 10537 * @throws { BusinessError } 202 - Not System Application. 10538 * @syscap SystemCapability.Multimedia.Camera.Core 10539 * @systemapi 10540 * @since 12 10541 */ 10542 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 10543 10544 /** 10545 * Gets the light painting type in use. 10546 * 10547 * @returns { LightPaintingType } The light painting type in use. 10548 * @throws { BusinessError } 202 - Not System Application. 10549 * @throws { BusinessError } 7400103 - Session not config. 10550 * @syscap SystemCapability.Multimedia.Camera.Core 10551 * @systemapi 10552 * @since 12 10553 */ 10554 getLightPaintingType(): LightPaintingType; 10555 10556 /** 10557 * Sets a light painting type for a camera device. 10558 * 10559 * @param { LightPaintingType } type - Light painting type to set. 10560 * @throws { BusinessError } 202 - Not System Application. 10561 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 10562 * @throws { BusinessError } 7400103 - Session not config. 10563 * @syscap SystemCapability.Multimedia.Camera.Core 10564 * @systemapi 10565 * @since 12 10566 */ 10567 setLightPaintingType(type: LightPaintingType): void; 10568 10569 /** 10570 * Gets supported light painting types. 10571 * 10572 * @returns { Array<LightPaintingType> } List of light painting types. 10573 * @throws { BusinessError } 202 - Not System Application. 10574 * @throws { BusinessError } 7400103 - Session not config. 10575 * @syscap SystemCapability.Multimedia.Camera.Core 10576 * @systemapi 10577 * @since 12 10578 */ 10579 getSupportedLightPaintingTypes(): Array<LightPaintingType>; 10580 } 10581 10582 /** 10583 * Quick shot photo session object. 10584 * 10585 * @extends Session, AutoExposure, ColorEffect, ColorManagement, EffectSuggestion, Flash, Focus, Zoom 10586 * @interface QuickShotPhotoSession 10587 * @syscap SystemCapability.Multimedia.Camera.Core 10588 * @systemapi 10589 * @since 12 10590 */ 10591 interface QuickShotPhotoSession extends Session, AutoExposure, ColorEffect, ColorManagement, EffectSuggestion, Flash, Focus, Zoom { 10592 /** 10593 * Subscribes to error events. 10594 * 10595 * @param { 'error' } type - Event type. 10596 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10597 * @throws { BusinessError } 202 - Not System Application. 10598 * @syscap SystemCapability.Multimedia.Camera.Core 10599 * @systemapi 10600 * @since 12 10601 */ 10602 on(type: 'error', callback: ErrorCallback): void; 10603 10604 /** 10605 * Unsubscribes from error events. 10606 * 10607 * @param { 'error' } type - Event type. 10608 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10609 * @throws { BusinessError } 202 - Not System Application. 10610 * @syscap SystemCapability.Multimedia.Camera.Core 10611 * @systemapi 10612 * @since 12 10613 */ 10614 off(type: 'error', callback?: ErrorCallback): void; 10615 10616 /** 10617 * Subscribes to effect suggestion event callback. 10618 * 10619 * @param { 'effectSuggestionChange' } type - Event type. 10620 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 10621 * @throws { BusinessError } 202 - Not System Application. 10622 * @syscap SystemCapability.Multimedia.Camera.Core 10623 * @systemapi 10624 * @since 12 10625 */ 10626 on(type: 'effectSuggestionChange', callback: AsyncCallback<EffectSuggestionType>): void; 10627 10628 /** 10629 * Unsubscribes from effect suggestion event callback. 10630 * 10631 * @param { 'effectSuggestionChange' } type - Event type. 10632 * @param { AsyncCallback<EffectSuggestionType> } callback - Callback used to return the result. 10633 * @throws { BusinessError } 202 - Not System Application. 10634 * @syscap SystemCapability.Multimedia.Camera.Core 10635 * @systemapi 10636 * @since 12 10637 */ 10638 off(type: 'effectSuggestionChange', callback?: AsyncCallback<EffectSuggestionType>): void; 10639 10640 /** 10641 * Subscribes focus state change event callback. 10642 * 10643 * @param { 'focusStateChange' } type - Event type. 10644 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10645 * @throws { BusinessError } 202 - Not System Application. 10646 * @syscap SystemCapability.Multimedia.Camera.Core 10647 * @systemapi 10648 * @since 12 10649 */ 10650 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 10651 10652 /** 10653 * Unsubscribes from focus state change event callback. 10654 * 10655 * @param { 'focusStateChange' } type - Event type. 10656 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10657 * @throws { BusinessError } 202 - Not System Application. 10658 * @syscap SystemCapability.Multimedia.Camera.Core 10659 * @systemapi 10660 * @since 12 10661 */ 10662 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 10663 10664 /** 10665 * Subscribes zoom info event callback. 10666 * 10667 * @param { 'smoothZoomInfoAvailable' } type - Event type. 10668 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 10669 * @throws { BusinessError } 202 - Not System Application. 10670 * @syscap SystemCapability.Multimedia.Camera.Core 10671 * @systemapi 10672 * @since 12 10673 */ 10674 on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback<SmoothZoomInfo>): void; 10675 10676 /** 10677 * Unsubscribes from zoom info event callback. 10678 * 10679 * @param { 'smoothZoomInfoAvailable' } type - Event type. 10680 * @param { AsyncCallback<SmoothZoomInfo> } callback - Callback used to get the zoom info. 10681 * @throws { BusinessError } 202 - Not System Application. 10682 * @syscap SystemCapability.Multimedia.Camera.Core 10683 * @systemapi 10684 * @since 12 10685 */ 10686 off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback<SmoothZoomInfo>): void; 10687 } 10688 10689 /** 10690 * Panorama photo session object. 10691 * 10692 * @extends Session, Focus, AutoExposure, WhiteBalance, ColorEffect 10693 * @interface PanoramaPhotoSession 10694 * @syscap SystemCapability.Multimedia.Camera.Core 10695 * @systemapi 10696 * @since 12 10697 */ 10698 interface PanoramaPhotoSession extends Session, Focus, AutoExposure, WhiteBalance, ColorEffect { 10699 /** 10700 * Subscribes to error events. 10701 * 10702 * @param { 'error' } type - Event type. 10703 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10704 * @throws { BusinessError } 202 - Not System Application. 10705 * @syscap SystemCapability.Multimedia.Camera.Core 10706 * @systemapi 10707 * @since 12 10708 */ 10709 on(type: 'error', callback: ErrorCallback): void; 10710 10711 /** 10712 * Unsubscribes from error events. 10713 * 10714 * @param { 'error' } type - Event type. 10715 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10716 * @throws { BusinessError } 202 - Not System Application. 10717 * @syscap SystemCapability.Multimedia.Camera.Core 10718 * @systemapi 10719 * @since 12 10720 */ 10721 off(type: 'error', callback?: ErrorCallback): void; 10722 10723 /** 10724 * Subscribes focus state change event callback. 10725 * 10726 * @param { 'focusStateChange' } type - Event type. 10727 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10728 * @throws { BusinessError } 202 - Not System Application. 10729 * @syscap SystemCapability.Multimedia.Camera.Core 10730 * @systemapi 10731 * @since 12 10732 */ 10733 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 10734 10735 /** 10736 * Unsubscribes from focus state change event callback. 10737 * 10738 * @param { 'focusStateChange' } type - Event type. 10739 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10740 * @throws { BusinessError } 202 - Not System Application. 10741 * @syscap SystemCapability.Multimedia.Camera.Core 10742 * @systemapi 10743 * @since 12 10744 */ 10745 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 10746 } 10747 10748 /** 10749 * Fluorescence photo session object. 10750 * 10751 * @extends Session, AutoExposure, Focus, Zoom 10752 * @interface FluorescencePhotoSession 10753 * @syscap SystemCapability.Multimedia.Camera.Core 10754 * @systemapi 10755 * @since 13 10756 */ 10757 interface FluorescencePhotoSession extends Session, AutoExposure, Focus, Zoom { 10758 /** 10759 * Subscribes to error events. 10760 * 10761 * @param { 'error' } type - Event type. 10762 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10763 * @throws { BusinessError } 202 - Not System Application. 10764 * @syscap SystemCapability.Multimedia.Camera.Core 10765 * @systemapi 10766 * @since 13 10767 */ 10768 on(type: 'error', callback: ErrorCallback): void; 10769 10770 /** 10771 * Unsubscribes from error events. 10772 * 10773 * @param { 'error' } type - Event type. 10774 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 10775 * @throws { BusinessError } 202 - Not System Application. 10776 * @syscap SystemCapability.Multimedia.Camera.Core 10777 * @systemapi 10778 * @since 13 10779 */ 10780 off(type: 'error', callback?: ErrorCallback): void; 10781 10782 /** 10783 * Subscribes focus state change event callback. 10784 * 10785 * @param { 'focusStateChange' } type - Event type. 10786 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10787 * @throws { BusinessError } 202 - Not System Application. 10788 * @syscap SystemCapability.Multimedia.Camera.Core 10789 * @systemapi 10790 * @since 13 10791 */ 10792 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 10793 10794 /** 10795 * Unsubscribes from focus state change event callback. 10796 * 10797 * @param { 'focusStateChange' } type - Event type. 10798 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 10799 * @throws { BusinessError } 202 - Not System Application. 10800 * @syscap SystemCapability.Multimedia.Camera.Core 10801 * @systemapi 10802 * @since 13 10803 */ 10804 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 10805 } 10806 10807 /** 10808 * Photo Functions object. 10809 * 10810 * @extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery 10811 * @interface PhotoFunctions 10812 * @syscap SystemCapability.Multimedia.Camera.Core 10813 * @systemapi 10814 * @since 13 10815 */ 10816 interface PhotoFunctions extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery { 10817 } 10818 10819 /** 10820 * Video Functions object. 10821 * 10822 * @extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, StabilizationQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery 10823 * @interface VideoFunctions 10824 * @syscap SystemCapability.Multimedia.Camera.Core 10825 * @systemapi 10826 * @since 13 10827 */ 10828 interface VideoFunctions extends FlashQuery, AutoExposureQuery, ManualExposureQuery, FocusQuery, ZoomQuery, StabilizationQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, MacroQuery, SceneDetectionQuery { 10829 } 10830 10831 /** 10832 * Portrait Photo Functions object. 10833 * 10834 * @extends FlashQuery, AutoExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, PortraitQuery, ApertureQuery, SceneDetectionQuery 10835 * @interface PortraitPhotoFunctions 10836 * @syscap SystemCapability.Multimedia.Camera.Core 10837 * @systemapi 10838 * @since 13 10839 */ 10840 interface PortraitPhotoFunctions extends FlashQuery, AutoExposureQuery, FocusQuery, ZoomQuery, BeautyQuery, ColorEffectQuery, ColorManagementQuery, PortraitQuery, ApertureQuery, SceneDetectionQuery { 10841 } 10842 10843 /** 10844 * Photo Conflict Functions object. 10845 * 10846 * @extends ZoomQuery, MacroQuery 10847 * @interface PhotoConflictFunctions 10848 * @syscap SystemCapability.Multimedia.Camera.Core 10849 * @systemapi 10850 * @since 13 10851 */ 10852 interface PhotoConflictFunctions extends ZoomQuery, MacroQuery { 10853 } 10854 10855 /** 10856 * Video Conflict Functions object. 10857 * 10858 * @extends ZoomQuery, MacroQuery 10859 * @interface VideoConflictFunctions 10860 * @syscap SystemCapability.Multimedia.Camera.Core 10861 * @systemapi 10862 * @since 13 10863 */ 10864 interface VideoConflictFunctions extends ZoomQuery, MacroQuery { 10865 } 10866 10867 /** 10868 * Portrait Photo Conflict Functions object. 10869 * 10870 * @interface PortraitPhotoFunctions 10871 * @extends ZoomQuery, PortraitQuery, ApertureQuery 10872 * @syscap SystemCapability.Multimedia.Camera.Core 10873 * @systemapi 10874 * @since 13 10875 */ 10876 interface PortraitPhotoConflictFunctions extends ZoomQuery, PortraitQuery, ApertureQuery { 10877 } 10878 10879 /** 10880 * Camera output object. 10881 * 10882 * @interface CameraOutput 10883 * @syscap SystemCapability.Multimedia.Camera.Core 10884 * @since 10 10885 */ 10886 /** 10887 * Camera output object. 10888 * 10889 * @interface CameraOutput 10890 * @syscap SystemCapability.Multimedia.Camera.Core 10891 * @atomicservice 10892 * @since 19 10893 */ 10894 interface CameraOutput { 10895 /** 10896 * Release output instance. 10897 * 10898 * @param { AsyncCallback<void> } callback - Callback used to return the result. 10899 * @throws { BusinessError } 7400201 - Camera service fatal error. 10900 * @syscap SystemCapability.Multimedia.Camera.Core 10901 * @since 10 10902 */ 10903 /** 10904 * Release output instance. 10905 * 10906 * @param { AsyncCallback<void> } callback - Callback used to return the result. 10907 * @throws { BusinessError } 7400201 - Camera service fatal error. 10908 * @syscap SystemCapability.Multimedia.Camera.Core 10909 * @atomicservice 10910 * @since 19 10911 */ 10912 release(callback: AsyncCallback<void>): void; 10913 10914 /** 10915 * Release output instance. 10916 * 10917 * @returns { Promise<void> } Promise used to return the result. 10918 * @throws { BusinessError } 7400201 - Camera service fatal error. 10919 * @syscap SystemCapability.Multimedia.Camera.Core 10920 * @since 10 10921 */ 10922 /** 10923 * Release output instance. 10924 * 10925 * @returns { Promise<void> } Promise used to return the result. 10926 * @throws { BusinessError } 7400201 - Camera service fatal error. 10927 * @syscap SystemCapability.Multimedia.Camera.Core 10928 * @atomicservice 10929 * @since 19 10930 */ 10931 release(): Promise<void>; 10932 } 10933 10934 /** 10935 * SketchStatusData object 10936 * 10937 * @typedef SketchStatusData 10938 * @syscap SystemCapability.Multimedia.Camera.Core 10939 * @systemapi 10940 * @since 11 10941 */ 10942 interface SketchStatusData { 10943 /** 10944 * Status of the sketch stream. 10945 * 0 is stop, and 1 is start. 10946 * 10947 * @type { number } 10948 * @syscap SystemCapability.Multimedia.Camera.Core 10949 * @systemapi 10950 * @since 11 10951 */ 10952 status: number; 10953 10954 /** 10955 * The zoom ratio of the sketch stream. 10956 * 10957 * @type { number } 10958 * @syscap SystemCapability.Multimedia.Camera.Core 10959 * @systemapi 10960 * @since 11 10961 */ 10962 sketchRatio: number; 10963 10964 /** 10965 * The offset point of the sketch stream. 10966 * 10967 * @type { Point } 10968 * @syscap SystemCapability.Multimedia.Camera.Core 10969 * @systemapi 10970 * @since 20 10971 */ 10972 centerPointOffset: Point; 10973 } 10974 10975 /** 10976 * Preview output object. 10977 * 10978 * @extends CameraOutput 10979 * @interface PreviewOutput 10980 * @syscap SystemCapability.Multimedia.Camera.Core 10981 * @since 10 10982 */ 10983 /** 10984 * Preview output object. 10985 * 10986 * @extends CameraOutput 10987 * @interface PreviewOutput 10988 * @syscap SystemCapability.Multimedia.Camera.Core 10989 * @atomicservice 10990 * @since 19 10991 */ 10992 interface PreviewOutput extends CameraOutput { 10993 /** 10994 * Start output instance. 10995 * 10996 * @param { AsyncCallback<void> } callback - Callback used to return the result. 10997 * @throws { BusinessError } 7400103 - Session not config. 10998 * @syscap SystemCapability.Multimedia.Camera.Core 10999 * @since 10 11000 * @deprecated since 11 11001 * @useinstead ohos.multimedia.camera.Session#start 11002 */ 11003 start(callback: AsyncCallback<void>): void; 11004 11005 /** 11006 * Start output instance. 11007 * 11008 * @returns { Promise<void> } Promise used to return the result. 11009 * @throws { BusinessError } 7400103 - Session not config. 11010 * @syscap SystemCapability.Multimedia.Camera.Core 11011 * @since 10 11012 * @deprecated since 11 11013 * @useinstead ohos.multimedia.camera.Session#start 11014 */ 11015 start(): Promise<void>; 11016 11017 /** 11018 * Stop output instance. 11019 * 11020 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11021 * @syscap SystemCapability.Multimedia.Camera.Core 11022 * @since 10 11023 * @deprecated since 11 11024 * @useinstead ohos.multimedia.camera.Session#stop 11025 */ 11026 stop(callback: AsyncCallback<void>): void; 11027 11028 /** 11029 * Stop output instance. 11030 * 11031 * @returns { Promise<void> } Promise used to return the result. 11032 * @syscap SystemCapability.Multimedia.Camera.Core 11033 * @since 10 11034 * @deprecated since 11 11035 * @useinstead ohos.multimedia.camera.Session#stop 11036 */ 11037 stop(): Promise<void>; 11038 11039 /** 11040 * Subscribes frame start event callback. 11041 * 11042 * @param { 'frameStart' } type - Event type. 11043 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11044 * @syscap SystemCapability.Multimedia.Camera.Core 11045 * @since 10 11046 */ 11047 /** 11048 * Registers a listener for the preview frame to start to get the result by registering 11049 * a callback function. This API uses an asynchronous callback to return the result. 11050 * 11051 * Description: Currently, it is not allowed to use off() to unregister the callback 11052 * within the callback method of on(). 11053 * 11054 * @param { 'frameStart' } type - Event type. 11055 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11056 * @syscap SystemCapability.Multimedia.Camera.Core 11057 * @atomicservice 11058 * @since 19 11059 */ 11060 on(type: 'frameStart', callback: AsyncCallback<void>): void; 11061 11062 /** 11063 * Unsubscribes from frame start event callback. 11064 * 11065 * @param { 'frameStart' } type - Event type. 11066 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11067 * @syscap SystemCapability.Multimedia.Camera.Core 11068 * @since 10 11069 */ 11070 /** 11071 * Unsubscribes from frame start event callback. 11072 * 11073 * @param { 'frameStart' } type - Event type. 11074 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11075 * @syscap SystemCapability.Multimedia.Camera.Core 11076 * @atomicservice 11077 * @since 19 11078 */ 11079 off(type: 'frameStart', callback?: AsyncCallback<void>): void; 11080 11081 /** 11082 * Subscribes frame end event callback. 11083 * 11084 * @param { 'frameEnd' } type - Event type. 11085 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11086 * @syscap SystemCapability.Multimedia.Camera.Core 11087 * @since 10 11088 */ 11089 /** 11090 * Registers a listener for the end of the preview frame to get the result by registering 11091 * a callback function. This API uses an asynchronous callback to return the result. 11092 * 11093 * Description: Currently, it is not allowed to use off() to unregister the callback 11094 * within the callback method of on(). 11095 * 11096 * @param { 'frameEnd' } type - Event type. 11097 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11098 * @syscap SystemCapability.Multimedia.Camera.Core 11099 * @atomicservice 11100 * @since 19 11101 */ 11102 on(type: 'frameEnd', callback: AsyncCallback<void>): void; 11103 11104 /** 11105 * Unsubscribes from frame end event callback. 11106 * 11107 * @param { 'frameEnd' } type - Event type. 11108 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11109 * @syscap SystemCapability.Multimedia.Camera.Core 11110 * @since 10 11111 */ 11112 /** 11113 * Unsubscribes from frame end event callback. 11114 * 11115 * @param { 'frameEnd' } type - Event type. 11116 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11117 * @syscap SystemCapability.Multimedia.Camera.Core 11118 * @atomicservice 11119 * @since 19 11120 */ 11121 off(type: 'frameEnd', callback?: AsyncCallback<void>): void; 11122 11123 /** 11124 * Subscribes to error events. 11125 * 11126 * @param { 'error' } type - Event type. 11127 * @param { ErrorCallback } callback - Callback used to get the preview output errors. 11128 * @syscap SystemCapability.Multimedia.Camera.Core 11129 * @since 10 11130 */ 11131 /** 11132 * Registers a listener for error events on the preview output to get the result by registering 11133 * a callback function. This API uses an asynchronous callback to return the result. 11134 * 11135 * Description: Currently, it is not allowed to use off() to unregister the callback 11136 * within the callback method of on(). 11137 * 11138 * @param { 'error' } type - Event type. 11139 * @param { ErrorCallback } callback - Callback used to get the preview output errors. 11140 * @syscap SystemCapability.Multimedia.Camera.Core 11141 * @atomicservice 11142 * @since 19 11143 */ 11144 on(type: 'error', callback: ErrorCallback): void; 11145 11146 /** 11147 * Unsubscribes from error events. 11148 * 11149 * @param { 'error' } type - Event type. 11150 * @param { ErrorCallback } callback - Callback used to get the preview output errors. 11151 * @syscap SystemCapability.Multimedia.Camera.Core 11152 * @since 10 11153 */ 11154 /** 11155 * Unsubscribes from error events. 11156 * 11157 * @param { 'error' } type - Event type. 11158 * @param { ErrorCallback } callback - Callback used to get the preview output errors. 11159 * @syscap SystemCapability.Multimedia.Camera.Core 11160 * @atomicservice 11161 * @since 19 11162 */ 11163 off(type: 'error', callback?: ErrorCallback): void; 11164 11165 /** 11166 * Get supported frame rates which can be set during session running. 11167 * 11168 * @returns { Array<FrameRateRange> } The array of supported frame rate range. 11169 * @syscap SystemCapability.Multimedia.Camera.Core 11170 * @since 12 11171 */ 11172 /** 11173 * Get supported frame rates which can be set during session running. 11174 * 11175 * @returns { Array<FrameRateRange> } The array of supported frame rate range. 11176 * @syscap SystemCapability.Multimedia.Camera.Core 11177 * @atomicservice 11178 * @since 19 11179 */ 11180 getSupportedFrameRates(): Array<FrameRateRange>; 11181 11182 /** 11183 * Set a frame rate range. 11184 * 11185 * @param { number } minFps - Minimum frame rate per second. 11186 * @param { number } maxFps - Maximum frame rate per second. 11187 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 11188 * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. 11189 * @syscap SystemCapability.Multimedia.Camera.Core 11190 * @since 12 11191 */ 11192 /** 11193 * The supported frame rate range can be queried via the getSupportedFrameRates interface before setting. 11194 * 11195 * @param { number } minFps - Minimum frame rate per second. 11196 * @param { number } maxFps - Maximum frame rate per second. 11197 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 11198 * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. 11199 * @syscap SystemCapability.Multimedia.Camera.Core 11200 * @atomicservice 11201 * @since 19 11202 */ 11203 setFrameRate(minFps: number, maxFps: number): void; 11204 11205 /** 11206 * Get active frame rate range which has been set before. 11207 * 11208 * @returns { FrameRateRange } The active frame rate range. 11209 * @syscap SystemCapability.Multimedia.Camera.Core 11210 * @since 12 11211 */ 11212 /** 11213 * Queryable after setting the frame rate for the preview stream using the setFrameRate interface. 11214 * 11215 * @returns { FrameRateRange } The active frame rate range. 11216 * @syscap SystemCapability.Multimedia.Camera.Core 11217 * @atomicservice 11218 * @since 19 11219 */ 11220 getActiveFrameRate(): FrameRateRange; 11221 11222 /** 11223 * Gets the current preconfig type if you had already call preconfig interface. 11224 * 11225 * @returns { Profile } The current preconfig type. 11226 * @throws { BusinessError } 7400201 - Camera service fatal error. 11227 * @syscap SystemCapability.Multimedia.Camera.Core 11228 * @since 12 11229 */ 11230 /** 11231 * Gets the current preconfig type if you had already call preconfig interface. 11232 * 11233 * @returns { Profile } The current preconfig type. 11234 * @throws { BusinessError } 7400201 - Camera service fatal error. 11235 * @syscap SystemCapability.Multimedia.Camera.Core 11236 * @atomicservice 11237 * @since 19 11238 */ 11239 getActiveProfile(): Profile; 11240 11241 /** 11242 * Gets the preview rotation angle. 11243 * 11244 * @param { number } displayRotation - The current display rotation angle. 11245 * @returns { ImageRotation } The preview rotation angle. 11246 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 11247 * @throws { BusinessError } 7400201 - Camera service fatal error. 11248 * @syscap SystemCapability.Multimedia.Camera.Core 11249 * @since 12 11250 */ 11251 /** 11252 * Gets the preview rotation angle. 11253 * 11254 * @param { number } displayRotation - The current display rotation angle. 11255 * @returns { ImageRotation } The preview rotation angle. 11256 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 11257 * @throws { BusinessError } 7400201 - Camera service fatal error. 11258 * @syscap SystemCapability.Multimedia.Camera.Core 11259 * @atomicservice 11260 * @since 19 11261 */ 11262 getPreviewRotation(displayRotation: number): ImageRotation; 11263 11264 /** 11265 * Sets the preview rotation angle. 11266 * 11267 * @param { ImageRotation } previewRotation - Preview display rotation angle. 11268 * @param { boolean } isDisplayLocked - TRUE means the display is locked, if not set, the default is FALSE. 11269 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 11270 * @throws { BusinessError } 7400201 - Camera service fatal error. 11271 * @syscap SystemCapability.Multimedia.Camera.Core 11272 * @since 12 11273 */ 11274 /** 11275 * Sets the preview rotation angle. 11276 * 11277 * @param { ImageRotation } previewRotation - Preview display rotation angle. 11278 * @param { boolean } isDisplayLocked - TRUE means the display is locked, if not set, the default is FALSE. 11279 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 11280 * @throws { BusinessError } 7400201 - Camera service fatal error. 11281 * @syscap SystemCapability.Multimedia.Camera.Core 11282 * @atomicservice 11283 * @since 19 11284 */ 11285 setPreviewRotation(previewRotation: ImageRotation, isDisplayLocked?: boolean): void; 11286 11287 /** 11288 * Adds a deferred surface. 11289 * 11290 * @param { string } surfaceId - Surface object id used in camera photo output. 11291 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 11292 * @syscap SystemCapability.Multimedia.Camera.Core 11293 * @systemapi 11294 * @since 10 11295 */ 11296 /** 11297 * Adds a deferred surface. 11298 * 11299 * @param { string } surfaceId - Surface object id used in camera photo output. 11300 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 11301 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 11302 * @syscap SystemCapability.Multimedia.Camera.Core 11303 * @systemapi 11304 * @since 13 11305 */ 11306 addDeferredSurface(surfaceId: string): void; 11307 11308 /** 11309 * Determine whether camera sketch is supported. 11310 * 11311 * @returns { boolean } Is camera sketch supported. 11312 * @throws { BusinessError } 202 - Not System Application. 11313 * @syscap SystemCapability.Multimedia.Camera.Core 11314 * @systemapi 11315 * @since 11 11316 */ 11317 isSketchSupported(): boolean; 11318 11319 /** 11320 * Gets the specific zoom ratio when sketch stream open. 11321 * 11322 * @returns { number } The specific zoom ratio of sketch. 11323 * @throws { BusinessError } 202 - Not System Application. 11324 * @throws { BusinessError } 7400103 - Session not config. 11325 * @syscap SystemCapability.Multimedia.Camera.Core 11326 * @systemapi 11327 * @since 11 11328 */ 11329 getSketchRatio(): number; 11330 11331 /** 11332 * Enable sketch for camera. 11333 * 11334 * @param { boolean } enabled - enable sketch for camera if TRUE. 11335 * @throws { BusinessError } 202 - Not System Application. 11336 * @throws { BusinessError } 7400103 - Session not config. 11337 * @syscap SystemCapability.Multimedia.Camera.Core 11338 * @systemapi 11339 * @since 11 11340 */ 11341 /** 11342 * Enable sketch for camera. 11343 * 11344 * @param { boolean } enabled - enable sketch for camera if TRUE. 11345 * @throws { BusinessError } 202 - Not System Application. 11346 * @throws { BusinessError } 7400102 - Operation not allowed. 11347 * @throws { BusinessError } 7400103 - Session not config. 11348 * @throws { BusinessError } 7400201 - Camera service fatal error. 11349 * @syscap SystemCapability.Multimedia.Camera.Core 11350 * @systemapi 11351 * @since 12 11352 */ 11353 enableSketch(enabled: boolean): void; 11354 11355 /** 11356 * Attach surface to the sketch stream. 11357 * 11358 * @param { string } surfaceId - Surface object id used in sketch stream. 11359 * @throws { BusinessError } 202 - Not System Application. 11360 * @throws { BusinessError } 7400103 - Session not config. 11361 * @syscap SystemCapability.Multimedia.Camera.Core 11362 * @systemapi 11363 * @since 11 11364 */ 11365 /** 11366 * Attach surface to the sketch stream. 11367 * 11368 * @param { string } surfaceId - Surface object id used in sketch stream. 11369 * @throws { BusinessError } 202 - Not System Application. 11370 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 11371 * @throws { BusinessError } 7400103 - Session not config. 11372 * @throws { BusinessError } 7400201 - Camera service fatal error. 11373 * @syscap SystemCapability.Multimedia.Camera.Core 11374 * @systemapi 11375 * @since 12 11376 */ 11377 attachSketchSurface(surfaceId: string): void; 11378 11379 /** 11380 * Subscribes sketch status changed event callback. 11381 * 11382 * @param { 'sketchStatusChanged' } type - Event type. 11383 * @param { AsyncCallback<SketchStatusData> } callback - Callback used to sketch status data. 11384 * @throws { BusinessError } 202 - Not System Application. 11385 * @syscap SystemCapability.Multimedia.Camera.Core 11386 * @systemapi 11387 * @since 11 11388 */ 11389 on(type: 'sketchStatusChanged', callback: AsyncCallback<SketchStatusData>): void; 11390 11391 /** 11392 * Unsubscribes sketch status changed event callback. 11393 * 11394 * @param { 'sketchStatusChanged' } type - Event type. 11395 * @param { AsyncCallback<SketchStatusData> } callback - Callback used to get sketch status data. 11396 * @throws { BusinessError } 202 - Not System Application. 11397 * @syscap SystemCapability.Multimedia.Camera.Core 11398 * @systemapi 11399 * @since 11 11400 */ 11401 off(type: 'sketchStatusChanged', callback?: AsyncCallback<SketchStatusData>): void; 11402 } 11403 11404 /** 11405 * Enum for effect suggestion. 11406 * 11407 * @enum { number } 11408 * @syscap SystemCapability.Multimedia.Camera.Core 11409 * @systemapi 11410 * @since 12 11411 */ 11412 enum EffectSuggestionType { 11413 /** 11414 * None. 11415 * 11416 * @syscap SystemCapability.Multimedia.Camera.Core 11417 * @systemapi 11418 * @since 12 11419 */ 11420 EFFECT_SUGGESTION_NONE = 0, 11421 /** 11422 * Portrait. 11423 * 11424 * @syscap SystemCapability.Multimedia.Camera.Core 11425 * @systemapi 11426 * @since 12 11427 */ 11428 EFFECT_SUGGESTION_PORTRAIT = 1, 11429 /** 11430 * Food. 11431 * 11432 * @syscap SystemCapability.Multimedia.Camera.Core 11433 * @systemapi 11434 * @since 12 11435 */ 11436 EFFECT_SUGGESTION_FOOD = 2, 11437 11438 /** 11439 * Sky. 11440 * 11441 * @syscap SystemCapability.Multimedia.Camera.Core 11442 * @systemapi 11443 * @since 12 11444 */ 11445 EFFECT_SUGGESTION_SKY = 3, 11446 11447 /** 11448 * Sunrise and sunset. 11449 * 11450 * @syscap SystemCapability.Multimedia.Camera.Core 11451 * @systemapi 11452 * @since 12 11453 */ 11454 EFFECT_SUGGESTION_SUNRISE_SUNSET = 4, 11455 11456 /** 11457 * Stage. 11458 * 11459 * @syscap SystemCapability.Multimedia.Camera.Core 11460 * @systemapi 11461 * @since 18 11462 */ 11463 EFFECT_SUGGESTION_STAGE = 5 11464 } 11465 11466 /** 11467 * Effect suggestion status 11468 * 11469 * @syscap SystemCapability.Multimedia.Camera.Core 11470 * @systemapi 11471 * @since 12 11472 */ 11473 class EffectSuggestionStatus { 11474 /** 11475 * Effect Suggestion type. 11476 * 11477 * @type { EffectSuggestionType } 11478 * @syscap SystemCapability.Multimedia.Camera.Core 11479 * @systemapi 11480 * @since 12 11481 */ 11482 type: EffectSuggestionType; 11483 /** 11484 * Effect Suggestion type status. 11485 * 11486 * @type { boolean } 11487 * @syscap SystemCapability.Multimedia.Camera.Core 11488 * @systemapi 11489 * @since 12 11490 */ 11491 status: boolean; 11492 } 11493 11494 /** 11495 * Enumerates the image rotation angles. 11496 * 11497 * @enum { number } 11498 * @syscap SystemCapability.Multimedia.Camera.Core 11499 * @since 10 11500 */ 11501 /** 11502 * Enumerates the image rotation angles. 11503 * 11504 * @enum { number } 11505 * @syscap SystemCapability.Multimedia.Camera.Core 11506 * @atomicservice 11507 * @since 19 11508 */ 11509 enum ImageRotation { 11510 /** 11511 * The capture image rotates 0 degrees. 11512 * 11513 * @syscap SystemCapability.Multimedia.Camera.Core 11514 * @since 10 11515 */ 11516 /** 11517 * The capture image rotates 0 degrees. 11518 * 11519 * @syscap SystemCapability.Multimedia.Camera.Core 11520 * @atomicservice 11521 * @since 19 11522 */ 11523 ROTATION_0 = 0, 11524 11525 /** 11526 * The capture image rotates 90 degrees. 11527 * 11528 * @syscap SystemCapability.Multimedia.Camera.Core 11529 * @since 10 11530 */ 11531 /** 11532 * The capture image rotates 90 degrees. 11533 * 11534 * @syscap SystemCapability.Multimedia.Camera.Core 11535 * @atomicservice 11536 * @since 19 11537 */ 11538 ROTATION_90 = 90, 11539 11540 /** 11541 * The capture image rotates 180 degrees. 11542 * 11543 * @syscap SystemCapability.Multimedia.Camera.Core 11544 * @since 10 11545 */ 11546 /** 11547 * The capture image rotates 180 degrees. 11548 * 11549 * @syscap SystemCapability.Multimedia.Camera.Core 11550 * @atomicservice 11551 * @since 19 11552 */ 11553 ROTATION_180 = 180, 11554 11555 /** 11556 * The capture image rotates 270 degrees. 11557 * 11558 * @syscap SystemCapability.Multimedia.Camera.Core 11559 * @since 10 11560 */ 11561 /** 11562 * The capture image rotates 270 degrees. 11563 * 11564 * @syscap SystemCapability.Multimedia.Camera.Core 11565 * @atomicservice 11566 * @since 19 11567 */ 11568 ROTATION_270 = 270 11569 } 11570 11571 /** 11572 * Photo capture location 11573 * 11574 * @typedef Location 11575 * @syscap SystemCapability.Multimedia.Camera.Core 11576 * @since 10 11577 */ 11578 /** 11579 * Photo capture location 11580 * 11581 * @typedef Location 11582 * @syscap SystemCapability.Multimedia.Camera.Core 11583 * @atomicservice 11584 * @since 19 11585 */ 11586 interface Location { 11587 /** 11588 * Latitude. 11589 * 11590 * @type { number } 11591 * @syscap SystemCapability.Multimedia.Camera.Core 11592 * @since 10 11593 */ 11594 /** 11595 * Latitude. 11596 * 11597 * @type { number } 11598 * @syscap SystemCapability.Multimedia.Camera.Core 11599 * @atomicservice 11600 * @since 19 11601 */ 11602 latitude: number; 11603 11604 /** 11605 * Longitude. 11606 * 11607 * @type { number } 11608 * @syscap SystemCapability.Multimedia.Camera.Core 11609 * @since 10 11610 */ 11611 /** 11612 * Longitude. 11613 * 11614 * @type { number } 11615 * @syscap SystemCapability.Multimedia.Camera.Core 11616 * @atomicservice 11617 * @since 19 11618 */ 11619 longitude: number; 11620 11621 /** 11622 * Altitude. 11623 * 11624 * @type { number } 11625 * @syscap SystemCapability.Multimedia.Camera.Core 11626 * @since 10 11627 */ 11628 /** 11629 * Altitude. 11630 * 11631 * @type { number } 11632 * @syscap SystemCapability.Multimedia.Camera.Core 11633 * @atomicservice 11634 * @since 19 11635 */ 11636 altitude: number; 11637 } 11638 11639 /** 11640 * Enumerates the image quality levels. 11641 * 11642 * @enum { number } 11643 * @syscap SystemCapability.Multimedia.Camera.Core 11644 * @since 10 11645 */ 11646 /** 11647 * Enumerates the image quality levels. 11648 * 11649 * @enum { number } 11650 * @syscap SystemCapability.Multimedia.Camera.Core 11651 * @atomicservice 11652 * @since 19 11653 */ 11654 enum QualityLevel { 11655 /** 11656 * High image quality. 11657 * 11658 * @syscap SystemCapability.Multimedia.Camera.Core 11659 * @since 10 11660 */ 11661 /** 11662 * High image quality. 11663 * 11664 * @syscap SystemCapability.Multimedia.Camera.Core 11665 * @atomicservice 11666 * @since 19 11667 */ 11668 QUALITY_LEVEL_HIGH = 0, 11669 11670 /** 11671 * Medium image quality. 11672 * 11673 * @syscap SystemCapability.Multimedia.Camera.Core 11674 * @since 10 11675 */ 11676 /** 11677 * Medium image quality. 11678 * 11679 * @syscap SystemCapability.Multimedia.Camera.Core 11680 * @atomicservice 11681 * @since 19 11682 */ 11683 QUALITY_LEVEL_MEDIUM = 1, 11684 11685 /** 11686 * Low image quality. 11687 * 11688 * @syscap SystemCapability.Multimedia.Camera.Core 11689 * @since 10 11690 */ 11691 /** 11692 * Low image quality. 11693 * 11694 * @syscap SystemCapability.Multimedia.Camera.Core 11695 * @atomicservice 11696 * @since 19 11697 */ 11698 QUALITY_LEVEL_LOW = 2 11699 } 11700 11701 /** 11702 * Photo capture options to set. 11703 * 11704 * @typedef PhotoCaptureSetting 11705 * @syscap SystemCapability.Multimedia.Camera.Core 11706 * @since 10 11707 */ 11708 /** 11709 * Photo capture options to set. 11710 * 11711 * @typedef PhotoCaptureSetting 11712 * @syscap SystemCapability.Multimedia.Camera.Core 11713 * @atomicservice 11714 * @since 19 11715 */ 11716 interface PhotoCaptureSetting { 11717 /** 11718 * Photo image quality. 11719 * 11720 * @type { ?QualityLevel } 11721 * @syscap SystemCapability.Multimedia.Camera.Core 11722 * @since 10 11723 */ 11724 /** 11725 * Photo image quality. 11726 * 11727 * @type { ?QualityLevel } 11728 * @syscap SystemCapability.Multimedia.Camera.Core 11729 * @atomicservice 11730 * @since 19 11731 */ 11732 quality?: QualityLevel; 11733 11734 /** 11735 * Photo rotation. 11736 * 11737 * @type { ?ImageRotation } 11738 * @syscap SystemCapability.Multimedia.Camera.Core 11739 * @since 10 11740 */ 11741 /** 11742 * Photo rotation. 11743 * 11744 * @type { ?ImageRotation } 11745 * @syscap SystemCapability.Multimedia.Camera.Core 11746 * @atomicservice 11747 * @since 19 11748 */ 11749 rotation?: ImageRotation; 11750 11751 /** 11752 * Photo location. 11753 * 11754 * @type { ?Location } 11755 * @syscap SystemCapability.Multimedia.Camera.Core 11756 * @since 10 11757 */ 11758 /** 11759 * Photo location. 11760 * 11761 * @type { ?Location } 11762 * @syscap SystemCapability.Multimedia.Camera.Core 11763 * @atomicservice 11764 * @since 19 11765 */ 11766 location?: Location; 11767 11768 /** 11769 * Set the mirror photo function switch, default to false. 11770 * 11771 * @type { ?boolean } 11772 * @syscap SystemCapability.Multimedia.Camera.Core 11773 * @since 10 11774 */ 11775 /** 11776 * Mirror enable switch (default off). 11777 * It is necessary to utilize the function isMirrorSupported to ascertain whether it is supported 11778 * prior to its implementation. 11779 * 11780 * @type { ?boolean } 11781 * @syscap SystemCapability.Multimedia.Camera.Core 11782 * @atomicservice 11783 * @since 19 11784 */ 11785 mirror?: boolean; 11786 } 11787 11788 /** 11789 * Enumerates the delivery image types. 11790 * 11791 * @enum { number } 11792 * @syscap SystemCapability.Multimedia.Camera.Core 11793 * @systemapi 11794 * @since 11 11795 */ 11796 enum DeferredDeliveryImageType { 11797 /** 11798 * Undefer image delivery. 11799 * 11800 * @syscap SystemCapability.Multimedia.Camera.Core 11801 * @systemapi 11802 * @since 11 11803 */ 11804 NONE = 0, 11805 11806 /** 11807 * Defer photo delivery when capturing photos. 11808 * 11809 * @syscap SystemCapability.Multimedia.Camera.Core 11810 * @systemapi 11811 * @since 11 11812 */ 11813 PHOTO = 1, 11814 11815 /** 11816 * Defer video delivery when capturing videos. 11817 * 11818 * @syscap SystemCapability.Multimedia.Camera.Core 11819 * @systemapi 11820 * @since 11 11821 */ 11822 VIDEO = 2 11823 } 11824 11825 /** 11826 * Photo object 11827 * 11828 * @typedef Photo 11829 * @syscap SystemCapability.Multimedia.Camera.Core 11830 * @since 11 11831 */ 11832 /** 11833 * Photo object 11834 * 11835 * @typedef Photo 11836 * @syscap SystemCapability.Multimedia.Camera.Core 11837 * @atomicservice 11838 * @since 19 11839 */ 11840 interface Photo { 11841 /** 11842 * Main image. 11843 * 11844 * @type { image.Image } 11845 * @syscap SystemCapability.Multimedia.Camera.Core 11846 * @since 11 11847 */ 11848 /** 11849 * Main image. 11850 * 11851 * @type { image.Image } 11852 * @syscap SystemCapability.Multimedia.Camera.Core 11853 * @atomicservice 11854 * @since 19 11855 */ 11856 main: image.Image; 11857 11858 /** 11859 * Raw image. 11860 * 11861 * @type { ?image.Image } 11862 * @syscap SystemCapability.Multimedia.Camera.Core 11863 * @systemapi 11864 * @since 12 11865 */ 11866 raw?: image.Image; 11867 11868 /** 11869 * Depth data. 11870 * 11871 * @type { DepthData } 11872 * @syscap SystemCapability.Multimedia.Camera.Core 11873 * @systemapi 11874 * @since 13 11875 */ 11876 depthData?: DepthData; 11877 11878 /** 11879 * Release Photo object. 11880 * 11881 * @returns { Promise<void> } Promise used to return the result. 11882 * @syscap SystemCapability.Multimedia.Camera.Core 11883 * @since 11 11884 */ 11885 /** 11886 * Release Photo object. 11887 * 11888 * @returns { Promise<void> } Promise used to return the result. 11889 * @syscap SystemCapability.Multimedia.Camera.Core 11890 * @atomicservice 11891 * @since 19 11892 */ 11893 release(): Promise<void>; 11894 } 11895 11896 /** 11897 * DeferredPhotoProxy object 11898 * 11899 * @typedef DeferredPhotoProxy 11900 * @syscap SystemCapability.Multimedia.Camera.Core 11901 * @systemapi 11902 * @since 11 11903 */ 11904 interface DeferredPhotoProxy { 11905 /** 11906 * Thumbnail image. 11907 * 11908 * @returns { Promise<image.PixelMap> } Promise used to return the result. 11909 * @throws { BusinessError } 202 - Not System Application. 11910 * @syscap SystemCapability.Multimedia.Camera.Core 11911 * @systemapi 11912 * @since 11 11913 */ 11914 getThumbnail(): Promise<image.PixelMap>; 11915 11916 /** 11917 * Release DeferredPhotoProxy object. 11918 * 11919 * @returns { Promise<void> } Promise used to return the result. 11920 * @throws { BusinessError } 202 - Not System Application. 11921 * @syscap SystemCapability.Multimedia.Camera.Core 11922 * @systemapi 11923 * @since 11 11924 */ 11925 release(): Promise<void>; 11926 } 11927 11928 /** 11929 * Enumerates the camera video codec type. 11930 * 11931 * @enum { number } 11932 * @syscap SystemCapability.Multimedia.Camera.Core 11933 * @since 13 11934 */ 11935 /** 11936 * Enumerates the camera video codec type. 11937 * 11938 * @enum { number } 11939 * @syscap SystemCapability.Multimedia.Camera.Core 11940 * @atomicservice 11941 * @since 19 11942 */ 11943 enum VideoCodecType { 11944 /** 11945 * Codec type AVC. 11946 * 11947 * @syscap SystemCapability.Multimedia.Camera.Core 11948 * @since 13 11949 */ 11950 /** 11951 * Video encoding type AVC. 11952 * 11953 * @syscap SystemCapability.Multimedia.Camera.Core 11954 * @atomicservice 11955 * @since 19 11956 */ 11957 AVC = 0, 11958 11959 /** 11960 * Codec type HEVC. 11961 * 11962 * @syscap SystemCapability.Multimedia.Camera.Core 11963 * @since 13 11964 */ 11965 /** 11966 * Video encoding type HEVC. 11967 * 11968 * @syscap SystemCapability.Multimedia.Camera.Core 11969 * @atomicservice 11970 * @since 19 11971 */ 11972 HEVC = 1 11973 } 11974 11975 /** 11976 * Photo output object. 11977 * 11978 * @extends CameraOutput 11979 * @interface PhotoOutput 11980 * @syscap SystemCapability.Multimedia.Camera.Core 11981 * @since 10 11982 */ 11983 /** 11984 * Photo output object. 11985 * 11986 * @extends CameraOutput 11987 * @interface PhotoOutput 11988 * @syscap SystemCapability.Multimedia.Camera.Core 11989 * @atomicservice 11990 * @since 19 11991 */ 11992 interface PhotoOutput extends CameraOutput { 11993 /** 11994 * Start capture output. 11995 * 11996 * @param { AsyncCallback<void> } callback - Callback used to return the result. 11997 * @throws { BusinessError } 7400104 - Session not running. 11998 * @throws { BusinessError } 7400201 - Camera service fatal error. 11999 * @syscap SystemCapability.Multimedia.Camera.Core 12000 * @since 10 12001 */ 12002 /** 12003 * Start capture output. 12004 * 12005 * @param { AsyncCallback<void> } callback - Callback used to return the result. 12006 * @throws { BusinessError } 7400104 - Session not running. 12007 * @throws { BusinessError } 7400201 - Camera service fatal error. 12008 * @syscap SystemCapability.Multimedia.Camera.Core 12009 * @atomicservice 12010 * @since 19 12011 */ 12012 capture(callback: AsyncCallback<void>): void; 12013 12014 /** 12015 * Start capture output. 12016 * 12017 * @returns { Promise<void> } Promise used to return the result. 12018 * @throws { BusinessError } 7400104 - Session not running. 12019 * @throws { BusinessError } 7400201 - Camera service fatal error. 12020 * @syscap SystemCapability.Multimedia.Camera.Core 12021 * @since 10 12022 */ 12023 /** 12024 * Start capture output. 12025 * 12026 * @returns { Promise<void> } Promise used to return the result. 12027 * @throws { BusinessError } 7400104 - Session not running. 12028 * @throws { BusinessError } 7400201 - Camera service fatal error. 12029 * @syscap SystemCapability.Multimedia.Camera.Core 12030 * @atomicservice 12031 * @since 19 12032 */ 12033 capture(): Promise<void>; 12034 12035 /** 12036 * Start capture output. 12037 * 12038 * @param { PhotoCaptureSetting } setting - Photo capture settings. 12039 * @param { AsyncCallback<void> } callback - Callback used to return the result. 12040 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12041 * @throws { BusinessError } 7400104 - Session not running. 12042 * @throws { BusinessError } 7400201 - Camera service fatal error. 12043 * @syscap SystemCapability.Multimedia.Camera.Core 12044 * @since 10 12045 */ 12046 /** 12047 * Start capture output. 12048 * 12049 * @param { PhotoCaptureSetting } setting - Photo capture settings. 12050 * @param { AsyncCallback<void> } callback - Callback used to return the result. 12051 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12052 * @throws { BusinessError } 7400104 - Session not running. 12053 * @throws { BusinessError } 7400201 - Camera service fatal error. 12054 * @syscap SystemCapability.Multimedia.Camera.Core 12055 * @atomicservice 12056 * @since 19 12057 */ 12058 capture(setting: PhotoCaptureSetting, callback: AsyncCallback<void>): void; 12059 12060 /** 12061 * Start capture output. 12062 * 12063 * @param { PhotoCaptureSetting } setting - Photo capture settings. 12064 * @returns { Promise<void> } Promise used to return the result. 12065 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12066 * @throws { BusinessError } 7400104 - Session not running. 12067 * @throws { BusinessError } 7400201 - Camera service fatal error. 12068 * @syscap SystemCapability.Multimedia.Camera.Core 12069 * @since 10 12070 */ 12071 /** 12072 * Start capture output. 12073 * Remove optional param. 12074 * 12075 * @param { PhotoCaptureSetting } setting - Photo capture settings. 12076 * @returns { Promise<void> } Promise used to return the result. 12077 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12078 * @throws { BusinessError } 7400104 - Session not running. 12079 * @throws { BusinessError } 7400201 - Camera service fatal error. 12080 * @syscap SystemCapability.Multimedia.Camera.Core 12081 * @since 11 12082 */ 12083 /** 12084 * Start capture output. 12085 * Remove optional param. 12086 * 12087 * @param { PhotoCaptureSetting } setting - Photo capture settings. 12088 * @returns { Promise<void> } Promise used to return the result. 12089 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12090 * @throws { BusinessError } 7400104 - Session not running. 12091 * @throws { BusinessError } 7400201 - Camera service fatal error. 12092 * @syscap SystemCapability.Multimedia.Camera.Core 12093 * @atomicservice 12094 * @since 19 12095 */ 12096 capture(setting: PhotoCaptureSetting): Promise<void>; 12097 12098 /** 12099 * Start burst capture. 12100 * 12101 * @param { PhotoCaptureSetting } setting - Photo capture settings. 12102 * @returns { Promise<void> } Promise used to return the result. 12103 * @throws { BusinessError } 202 - Not System Application. 12104 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12105 * @throws { BusinessError } 7400104 - Session not running. 12106 * @throws { BusinessError } 7400201 - Camera service fatal error. 12107 * @syscap SystemCapability.Multimedia.Camera.Core 12108 * @systemapi 12109 * @since 12 12110 */ 12111 burstCapture(setting: PhotoCaptureSetting): Promise<void>; 12112 12113 /** 12114 * Confirm capture in Night mode or end burst capture. 12115 * 12116 * @throws { BusinessError } 202 - Not System Application. 12117 * @throws { BusinessError } 7400104 - Session not running. 12118 * @throws { BusinessError } 7400201 - Camera service fatal error. 12119 * @syscap SystemCapability.Multimedia.Camera.Core 12120 * @systemapi 12121 * @since 11 12122 */ 12123 confirmCapture(): void; 12124 12125 /** 12126 * Confirm if the raw image delivery is supported 12127 * 12128 * @returns { boolean } TRUE if the type of delivery image is support. 12129 * @throws { BusinessError } 202 - Not System Application. 12130 * @throws { BusinessError } 7400104 - Session not running. 12131 * @throws { BusinessError } 7400201 - Camera service fatal error. 12132 * @syscap SystemCapability.Multimedia.Camera.Core 12133 * @systemapi 12134 * @since 13 12135 */ 12136 isRawDeliverySupported(): boolean; 12137 12138 /** 12139 * Enable raw image image delivery. 12140 * 12141 * @param { boolean } enabled - Target state for raw image delivery. 12142 * @throws { BusinessError } 202 - Not System Application. 12143 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12144 * @throws { BusinessError } 7400104 - Session not running. 12145 * @throws { BusinessError } 7400201 - Camera service fatal error. 12146 * @syscap SystemCapability.Multimedia.Camera.Core 12147 * @systemapi 12148 * @since 13 12149 */ 12150 enableRawDelivery(enabled: boolean): void; 12151 12152 /** 12153 * Confirm if the deferred image delivery supported in the specific device. 12154 * 12155 * @param { DeferredDeliveryImageType } type - Type of delivery image. 12156 * @returns { boolean } TRUE if the type of delivery image is support. 12157 * @throws { BusinessError } 202 - Not System Application. 12158 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12159 * @throws { BusinessError } 7400104 - Session not running. 12160 * @throws { BusinessError } 7400201 - Camera service fatal error. 12161 * @syscap SystemCapability.Multimedia.Camera.Core 12162 * @systemapi 12163 * @since 11 12164 */ 12165 isDeferredImageDeliverySupported(type: DeferredDeliveryImageType): boolean; 12166 12167 /** 12168 * Confirm if the deferred image delivery enabled. 12169 * 12170 * @param { DeferredDeliveryImageType } type - Type of delivery image. 12171 * @returns { boolean } TRUE if the type of delivery image is enable. 12172 * @throws { BusinessError } 202 - Not System Application. 12173 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12174 * @throws { BusinessError } 7400104 - Session not running. 12175 * @throws { BusinessError } 7400201 - Camera service fatal error. 12176 * @syscap SystemCapability.Multimedia.Camera.Core 12177 * @systemapi 12178 * @since 11 12179 */ 12180 isDeferredImageDeliveryEnabled(type: DeferredDeliveryImageType): boolean; 12181 12182 /** 12183 * Sets the image type for deferred image delivery. 12184 * 12185 * @param { DeferredDeliveryImageType } type - Type of delivery image. 12186 * @throws { BusinessError } 202 - Not System Application. 12187 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12188 * @throws { BusinessError } 7400104 - Session not running. 12189 * @throws { BusinessError } 7400201 - Camera service fatal error. 12190 * @syscap SystemCapability.Multimedia.Camera.Core 12191 * @systemapi 12192 * @since 11 12193 */ 12194 deferImageDelivery(type: DeferredDeliveryImageType): void; 12195 12196 /** 12197 * Check if the depth data delivery is supported. 12198 * 12199 * @returns { boolean } TRUE if the type of delivery image is enabled. 12200 * @throws { BusinessError } 202 - Not System Application. 12201 * @throws { BusinessError } 7400104 - Session not running. 12202 * @throws { BusinessError } 7400201 - Camera service fatal error. 12203 * @syscap SystemCapability.Multimedia.Camera.Core 12204 * @systemapi 12205 * @since 13 12206 */ 12207 isDepthDataDeliverySupported(): boolean; 12208 12209 /** 12210 * Enable depth data delivery. 12211 * 12212 * @param { boolean } enabled - Target state for depth data delivery. 12213 * @throws { BusinessError } 202 - Not System Application. 12214 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12215 * @throws { BusinessError } 7400104 - Session not running. 12216 * @throws { BusinessError } 7400201 - Camera service fatal error. 12217 * @syscap SystemCapability.Multimedia.Camera.Core 12218 * @systemapi 12219 * @since 13 12220 */ 12221 enableDepthDataDelivery(enabled: boolean): void; 12222 12223 /** 12224 * Get supported moving photo video codec types. 12225 * 12226 * @returns { Array<VideoCodecType> } An array of supported video codec types for moving photo. 12227 * @throws { BusinessError } 7400201 - Camera service fatal error. 12228 * @syscap SystemCapability.Multimedia.Camera.Core 12229 * @since 13 12230 */ 12231 /** 12232 * Get supported moving photo video codec types. 12233 * 12234 * @returns { Array<VideoCodecType> } An array of supported video codec types for moving photo. 12235 * @throws { BusinessError } 7400201 - Camera service fatal error. 12236 * @syscap SystemCapability.Multimedia.Camera.Core 12237 * @atomicservice 12238 * @since 19 12239 */ 12240 getSupportedMovingPhotoVideoCodecTypes(): Array<VideoCodecType>; 12241 12242 /** 12243 * Sets codec type for moving photo, default to AVC. 12244 * 12245 * @param { VideoCodecType } codecType - Codec type for moving photo. 12246 * @throws { BusinessError } 7400201 - Camera service fatal error. 12247 * @syscap SystemCapability.Multimedia.Camera.Core 12248 * @since 13 12249 */ 12250 /** 12251 * Sets codec type for moving photo, default to AVC. 12252 * 12253 * @param { VideoCodecType } codecType - Codec type for moving photo. 12254 * @throws { BusinessError } 7400201 - Camera service fatal error. 12255 * @syscap SystemCapability.Multimedia.Camera.Core 12256 * @atomicservice 12257 * @since 19 12258 */ 12259 setMovingPhotoVideoCodecType(codecType: VideoCodecType): void; 12260 12261 /** 12262 * Subscribes photo available event callback. 12263 * 12264 * @param { 'photoAvailable' } type - Event type. 12265 * @param { AsyncCallback<Photo> } callback - Callback used to get the Photo. 12266 * @syscap SystemCapability.Multimedia.Camera.Core 12267 * @since 11 12268 */ 12269 /** 12270 * Registers a listener for full quality chart uploads to get the result by registering 12271 * a callback function. This API uses an asynchronous callback to return the result. 12272 * 12273 * Description: Currently, it is not allowed to use off() to unregister the callback 12274 * within the callback method of on(). 12275 * 12276 * @param { 'photoAvailable' } type - Event type. 12277 * @param { AsyncCallback<Photo> } callback - Callback used to get the Photo. 12278 * @syscap SystemCapability.Multimedia.Camera.Core 12279 * @atomicservice 12280 * @since 19 12281 */ 12282 on(type: 'photoAvailable', callback: AsyncCallback<Photo>): void; 12283 12284 /** 12285 * Unsubscribes photo available event callback. 12286 * 12287 * @param { 'photoAvailable' } type - Event type. 12288 * @param { AsyncCallback<Photo> } callback - Callback used to get the Photo. 12289 * @syscap SystemCapability.Multimedia.Camera.Core 12290 * @since 11 12291 */ 12292 /** 12293 * Unsubscribes photo available event callback. 12294 * 12295 * @param { 'photoAvailable' } type - Event type. 12296 * @param { AsyncCallback<Photo> } callback - Callback used to get the Photo. 12297 * @syscap SystemCapability.Multimedia.Camera.Core 12298 * @atomicservice 12299 * @since 19 12300 */ 12301 off(type: 'photoAvailable', callback?: AsyncCallback<Photo>): void; 12302 12303 /** 12304 * Subscribes deferred photo proxy available event callback. 12305 * 12306 * @param { 'deferredPhotoProxyAvailable' } type - Event type. 12307 * @param { AsyncCallback<DeferredPhotoProxy> } callback - Callback used to get the DeferredPhotoProxy. 12308 * @throws { BusinessError } 202 - Not System Application. 12309 * @syscap SystemCapability.Multimedia.Camera.Core 12310 * @systemapi 12311 * @since 11 12312 */ 12313 on(type: 'deferredPhotoProxyAvailable', callback: AsyncCallback<DeferredPhotoProxy>): void; 12314 12315 /** 12316 * Unsubscribes deferred photo proxy available event callback. 12317 * 12318 * @param { 'deferredPhotoProxyAvailable' } type - Event type. 12319 * @param { AsyncCallback<DeferredPhotoProxy> } callback - Callback used to get the DeferredPhotoProxy. 12320 * @throws { BusinessError } 202 - Not System Application. 12321 * @syscap SystemCapability.Multimedia.Camera.Core 12322 * @systemapi 12323 * @since 11 12324 */ 12325 off(type: 'deferredPhotoProxyAvailable', callback?: AsyncCallback<DeferredPhotoProxy>): void; 12326 12327 /** 12328 * Subscribes to photo asset event callback. 12329 * 12330 * <p>This API processes deferred photo delivery data by quickly displaying low-quality images to give 12331 * users the impression of faster photo capture, while also generating high-quality images to maintain the 12332 * final output quality. For details about the design specifications, see {@link 12333 * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-camera-shot2see}. </p> 12334 * @param { 'photoAssetAvailable' } type - Event type. 12335 * @param { AsyncCallback<photoAccessHelper.PhotoAsset> } callback - Callback used to get the asset. 12336 * @syscap SystemCapability.Multimedia.Camera.Core 12337 * @since 12 12338 */ 12339 /** 12340 * Registers a listener for photoAsset uploads to monitor the upload process. This API 12341 * uses an asynchronous callback to return the result. 12342 * 12343 * Description: Currently, it is not allowed to use off() to unregister the callback 12344 * within the callback method of on(). 12345 * 12346 * <p>This API processes deferred photo delivery data by quickly displaying low-quality images to give 12347 * users the impression of faster photo capture, while also generating high-quality images to maintain the 12348 * final output quality. For details about the design specifications, see {@link 12349 * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-camera-shot2see}. </p> 12350 * @param { 'photoAssetAvailable' } type - Event type. 12351 * @param { AsyncCallback<photoAccessHelper.PhotoAsset> } callback - Callback used to get the asset. 12352 * @syscap SystemCapability.Multimedia.Camera.Core 12353 * @atomicservice 12354 * @since 19 12355 */ 12356 on(type: 'photoAssetAvailable', callback: AsyncCallback<photoAccessHelper.PhotoAsset>): void; 12357 12358 /** 12359 * Unsubscribes photo asset event callback. 12360 * 12361 * @param { 'photoAssetAvailable' } type - Event type. 12362 * @param { AsyncCallback<photoAccessHelper.PhotoAsset> } callback - Callback used to get the asset. 12363 * @syscap SystemCapability.Multimedia.Camera.Core 12364 * @since 12 12365 */ 12366 /** 12367 * Unsubscribes photo asset event callback. 12368 * 12369 * @param { 'photoAssetAvailable' } type - Event type. 12370 * @param { AsyncCallback<photoAccessHelper.PhotoAsset> } callback - Callback used to get the asset. 12371 * @syscap SystemCapability.Multimedia.Camera.Core 12372 * @atomicservice 12373 * @since 19 12374 */ 12375 off(type: 'photoAssetAvailable', callback?: AsyncCallback<photoAccessHelper.PhotoAsset>): void; 12376 12377 /** 12378 * Check whether to support mirror photo. 12379 * 12380 * @returns { boolean } Is the mirror supported. 12381 * @syscap SystemCapability.Multimedia.Camera.Core 12382 * @since 10 12383 */ 12384 /** 12385 * Check whether to support mirror photo. 12386 * 12387 * @returns { boolean } Is the mirror supported. 12388 * @syscap SystemCapability.Multimedia.Camera.Core 12389 * @atomicservice 12390 * @since 19 12391 */ 12392 isMirrorSupported(): boolean; 12393 12394 /** 12395 * Enable mirror for photo capture. 12396 * 12397 * @param { boolean } enabled - enable photo mirror if TRUE. 12398 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12399 * @throws { BusinessError } 7400103 - Session not config. 12400 * @throws { BusinessError } 7400201 - Camera service fatal error. 12401 * @syscap SystemCapability.Multimedia.Camera.Core 12402 * @since 13 12403 */ 12404 /** 12405 * Whether to enable moving photo mirroring. 12406 * 12407 * Prior to invoking this interface, it is necessary to determine whether the moving 12408 * photo function is supported through the isMovingPhotoSupported API and whether the 12409 * photo mirroring function is supported through the isMirrorSupported API. 12410 * 12411 * @param { boolean } enabled - enable moving photo mirror if TRUE. 12412 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12413 * @throws { BusinessError } 7400103 - Session not config. 12414 * @throws { BusinessError } 7400201 - Camera service fatal error. 12415 * @syscap SystemCapability.Multimedia.Camera.Core 12416 * @atomicservice 12417 * @since 19 12418 */ 12419 enableMirror(enabled: boolean): void; 12420 12421 /** 12422 * Subscribes capture start event callback. 12423 * 12424 * @param { 'captureStart' } type - Event type. 12425 * @param { AsyncCallback<number> } callback - Callback used to get the capture ID. 12426 * @syscap SystemCapability.Multimedia.Camera.Core 12427 * @since 10 12428 * @deprecated since 11 12429 * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo 12430 */ 12431 on(type: 'captureStart', callback: AsyncCallback<number>): void; 12432 12433 /** 12434 * Unsubscribes from capture start event callback. 12435 * 12436 * @param { 'captureStart' } type - Event type. 12437 * @param { AsyncCallback<number> } callback - Callback used to get the capture ID. 12438 * @syscap SystemCapability.Multimedia.Camera.Core 12439 * @since 10 12440 * @deprecated since 11 12441 * @useinstead ohos.multimedia.camera.PhotoOutput#captureStartWithInfo 12442 */ 12443 off(type: 'captureStart', callback?: AsyncCallback<number>): void; 12444 12445 /** 12446 * Subscribes capture start event callback. 12447 * 12448 * @param { 'captureStartWithInfo' } type - Event type. 12449 * @param { AsyncCallback<CaptureStartInfo> } callback - Callback used to get the capture start info. 12450 * @syscap SystemCapability.Multimedia.Camera.Core 12451 * @since 11 12452 */ 12453 /** 12454 * Registers a listener for the start of the photo taking to get the CaptureStartInfo by registering 12455 * a callback function. This API uses an asynchronous callback to return the result. 12456 * 12457 * Description: Currently, it is not allowed to use off() to unregister the callback 12458 * within the callback method of on(). 12459 * 12460 * @param { 'captureStartWithInfo' } type - Event type. 12461 * @param { AsyncCallback<CaptureStartInfo> } callback - Callback used to get the capture start info. 12462 * @syscap SystemCapability.Multimedia.Camera.Core 12463 * @atomicservice 12464 * @since 19 12465 */ 12466 on(type: 'captureStartWithInfo', callback: AsyncCallback<CaptureStartInfo>): void; 12467 12468 /** 12469 * Unsubscribes from capture start event callback. 12470 * 12471 * @param { 'captureStartWithInfo' } type - Event type. 12472 * @param { AsyncCallback<CaptureStartInfo> } callback - Callback used to get the capture start info. 12473 * @syscap SystemCapability.Multimedia.Camera.Core 12474 * @since 11 12475 */ 12476 /** 12477 * Unsubscribes from capture start event callback. 12478 * 12479 * @param { 'captureStartWithInfo' } type - Event type. 12480 * @param { AsyncCallback<CaptureStartInfo> } callback - Callback used to get the capture start info. 12481 * @syscap SystemCapability.Multimedia.Camera.Core 12482 * @atomicservice 12483 * @since 19 12484 */ 12485 off(type: 'captureStartWithInfo', callback?: AsyncCallback<CaptureStartInfo>): void; 12486 12487 /** 12488 * Subscribes frame shutter event callback. 12489 * 12490 * @param { 'frameShutter' } type - Event type. 12491 * @param { AsyncCallback<FrameShutterInfo> } callback - Callback used to get the frame shutter information. 12492 * @syscap SystemCapability.Multimedia.Camera.Core 12493 * @since 10 12494 */ 12495 /** 12496 * Subscribes frame shutter event callback. 12497 * 12498 * @param { 'frameShutter' } type - Event type. 12499 * @param { AsyncCallback<FrameShutterInfo> } callback - Callback used to get the frame shutter information. 12500 * @syscap SystemCapability.Multimedia.Camera.Core 12501 * @atomicservice 12502 * @since 19 12503 */ 12504 on(type: 'frameShutter', callback: AsyncCallback<FrameShutterInfo>): void; 12505 12506 /** 12507 * Unsubscribes from frame shutter event callback. 12508 * 12509 * @param { 'frameShutter' } type - Event type. 12510 * @param { AsyncCallback<FrameShutterInfo> } callback - Callback used to get the frame shutter information. 12511 * @syscap SystemCapability.Multimedia.Camera.Core 12512 * @since 10 12513 */ 12514 /** 12515 * Unsubscribes from frame shutter event callback. 12516 * 12517 * @param { 'frameShutter' } type - Event type. 12518 * @param { AsyncCallback<FrameShutterInfo> } callback - Callback used to get the frame shutter information. 12519 * @syscap SystemCapability.Multimedia.Camera.Core 12520 * @atomicservice 12521 * @since 19 12522 */ 12523 off(type: 'frameShutter', callback?: AsyncCallback<FrameShutterInfo>): void; 12524 12525 /** 12526 * Subscribes frame shutter end event callback. 12527 * 12528 * @param { 'frameShutterEnd' } type - Event type. 12529 * @param { AsyncCallback<FrameShutterEndInfo> } callback - Callback used to get the frame shutter end information. 12530 * @syscap SystemCapability.Multimedia.Camera.Core 12531 * @since 12 12532 */ 12533 /** 12534 * Registers a listener for the end of photo exposure capture to get the result by registering 12535 * a callback function. This API uses an asynchronous callback to return the result. 12536 * 12537 * Description: Currently, it is not allowed to use off() to unregister the callback 12538 * within the callback method of on(). 12539 * 12540 * @param { 'frameShutterEnd' } type - Event type. 12541 * @param { AsyncCallback<FrameShutterEndInfo> } callback - Callback used to get the frame shutter end information. 12542 * @syscap SystemCapability.Multimedia.Camera.Core 12543 * @atomicservice 12544 * @since 19 12545 */ 12546 on(type: 'frameShutterEnd', callback: AsyncCallback<FrameShutterEndInfo>): void; 12547 12548 /** 12549 * Unsubscribes from frame shutter end event callback. 12550 * 12551 * @param { 'frameShutterEnd' } type - Event type. 12552 * @param { AsyncCallback<FrameShutterEndInfo> } callback - Callback used to get the frame shutter end information. 12553 * @syscap SystemCapability.Multimedia.Camera.Core 12554 * @since 12 12555 */ 12556 /** 12557 * Unsubscribes from frame shutter end event callback. 12558 * 12559 * @param { 'frameShutterEnd' } type - Event type. 12560 * @param { AsyncCallback<FrameShutterEndInfo> } callback - Callback used to get the frame shutter end information. 12561 * @syscap SystemCapability.Multimedia.Camera.Core 12562 * @atomicservice 12563 * @since 19 12564 */ 12565 off(type: 'frameShutterEnd', callback?: AsyncCallback<FrameShutterEndInfo>): void; 12566 12567 /** 12568 * Subscribes capture end event callback. 12569 * 12570 * @param { 'captureEnd' } type - Event type. 12571 * @param { AsyncCallback<CaptureEndInfo> } callback - Callback used to get the capture end information. 12572 * @syscap SystemCapability.Multimedia.Camera.Core 12573 * @since 10 12574 */ 12575 /** 12576 * Registers a listener for the end of the photo shoot to get the result by registering 12577 * a callback function. This API uses an asynchronous callback to return the result. 12578 * 12579 * Description: Currently, it is not allowed to use off() to unregister the callback 12580 * within the callback method of on(). 12581 * 12582 * @param { 'captureEnd' } type - Listens to the event, fixed to 'captureEnd', when photoOutput is 12583 * created successfully. This event can be triggered when the photoOutput is created successfully. 12584 * @param { AsyncCallback<CaptureEndInfo> } callback - Callback used to get the capture end information. 12585 * @syscap SystemCapability.Multimedia.Camera.Core 12586 * @atomicservice 12587 * @since 19 12588 */ 12589 on(type: 'captureEnd', callback: AsyncCallback<CaptureEndInfo>): void; 12590 12591 /** 12592 * Unsubscribes from capture end event callback. 12593 * 12594 * @param { 'captureEnd' } type - Event type. 12595 * @param { AsyncCallback<CaptureEndInfo> } callback - Callback used to get the capture end information. 12596 * @syscap SystemCapability.Multimedia.Camera.Core 12597 * @since 10 12598 */ 12599 /** 12600 * Unsubscribes from capture end event callback. 12601 * 12602 * @param { 'captureEnd' } type - Event type. 12603 * @param { AsyncCallback<CaptureEndInfo> } callback - Callback used to get the capture end information. 12604 * @syscap SystemCapability.Multimedia.Camera.Core 12605 * @atomicservice 12606 * @since 19 12607 */ 12608 off(type: 'captureEnd', callback?: AsyncCallback<CaptureEndInfo>): void; 12609 12610 /** 12611 * Subscribes capture ready event callback. After receiving the callback, can proceed to the next capture 12612 * 12613 * @param { 'captureReady' } type - Event type. 12614 * @param { AsyncCallback<void> } callback - Callback used to notice capture ready. 12615 * @syscap SystemCapability.Multimedia.Camera.Core 12616 * @since 12 12617 */ 12618 /** 12619 * Registers a listener for the next available shot to get the result by registering 12620 * a callback function. This API uses an asynchronous callback to return the result. 12621 * 12622 * Description: Currently, it is not allowed to use off() to unregister the callback 12623 * within the callback method of on(). 12624 * 12625 * @param { 'captureReady' } type - Event type. 12626 * @param { AsyncCallback<void> } callback - Callback used to notice capture ready. 12627 * @syscap SystemCapability.Multimedia.Camera.Core 12628 * @atomicservice 12629 * @since 19 12630 */ 12631 on(type: 'captureReady', callback: AsyncCallback<void>): void; 12632 12633 /** 12634 * Unsubscribes from capture ready event callback. 12635 * 12636 * @param { 'captureReady' } type - Event type. 12637 * @param { AsyncCallback<void> } callback - Callback used to notice capture ready. 12638 * @syscap SystemCapability.Multimedia.Camera.Core 12639 * @since 12 12640 */ 12641 /** 12642 * Unsubscribes from capture ready event callback. 12643 * 12644 * @param { 'captureReady' } type - Event type. 12645 * @param { AsyncCallback<void> } callback - Callback used to notice capture ready. 12646 * @syscap SystemCapability.Multimedia.Camera.Core 12647 * @atomicservice 12648 * @since 19 12649 */ 12650 off(type: 'captureReady', callback?: AsyncCallback<void>): void; 12651 12652 /** 12653 * Subscribes estimated capture duration event callback. 12654 * 12655 * @param { 'estimatedCaptureDuration' } type - Event type. 12656 * @param { AsyncCallback<number> } callback - Callback used to notify the estimated capture duration (in milliseconds). 12657 * @syscap SystemCapability.Multimedia.Camera.Core 12658 * @since 12 12659 */ 12660 /** 12661 * Registers a listener for the estimated time to take a picture to get the result by registering 12662 * a callback function. This API uses an asynchronous callback to return the result. 12663 * 12664 * Description: Currently, it is not allowed to use off() to unregister the callback 12665 * within the callback method of on(). 12666 * 12667 * @param { 'estimatedCaptureDuration' } type - Event type. 12668 * @param { AsyncCallback<number> } callback - Callback used to notify the estimated capture duration (in milliseconds). 12669 * @syscap SystemCapability.Multimedia.Camera.Core 12670 * @atomicservice 12671 * @since 19 12672 */ 12673 on(type: 'estimatedCaptureDuration', callback: AsyncCallback<number>): void; 12674 12675 /** 12676 * Unsubscribes from estimated capture duration event callback. 12677 * 12678 * @param { 'estimatedCaptureDuration' } type - Event type. 12679 * @param { AsyncCallback<number> } callback - Callback used to notify the estimated capture duration (in milliseconds). 12680 * @syscap SystemCapability.Multimedia.Camera.Core 12681 * @since 12 12682 */ 12683 /** 12684 * Unsubscribes from estimated capture duration event callback. 12685 * 12686 * @param { 'estimatedCaptureDuration' } type - Event type. 12687 * @param { AsyncCallback<number> } callback - Callback used to notify the estimated capture duration (in milliseconds). 12688 * @syscap SystemCapability.Multimedia.Camera.Core 12689 * @atomicservice 12690 * @since 19 12691 */ 12692 off(type: 'estimatedCaptureDuration', callback?: AsyncCallback<number>): void; 12693 12694 /** 12695 * Subscribes to error events. 12696 * 12697 * @param { 'error' } type - Event type. 12698 * @param { ErrorCallback } callback - Callback used to get the photo output errors. 12699 * @syscap SystemCapability.Multimedia.Camera.Core 12700 * @since 10 12701 */ 12702 /** 12703 * Registers a listener for errors in the photo output to get the result by registering 12704 * a callback function. This API uses an asynchronous callback to return the result. 12705 * 12706 * Description: Currently, it is not allowed to use off() to unregister the callback 12707 * within the callback method of on(). 12708 * 12709 * @param { 'error' } type - Event type. 12710 * @param { ErrorCallback } callback - Callback used to get the photo output errors. 12711 * @syscap SystemCapability.Multimedia.Camera.Core 12712 * @atomicservice 12713 * @since 19 12714 */ 12715 on(type: 'error', callback: ErrorCallback): void; 12716 12717 /** 12718 * Unsubscribes from error events. 12719 * 12720 * @param { 'error' } type - Event type. 12721 * @param { ErrorCallback } callback - Callback used to get the photo output errors. 12722 * @syscap SystemCapability.Multimedia.Camera.Core 12723 * @since 10 12724 */ 12725 /** 12726 * Unsubscribes from error events. 12727 * 12728 * @param { 'error' } type - Event type. 12729 * @param { ErrorCallback } callback - Callback used to get the photo output errors. 12730 * @syscap SystemCapability.Multimedia.Camera.Core 12731 * @atomicservice 12732 * @since 19 12733 */ 12734 off(type: 'error', callback?: ErrorCallback): void; 12735 12736 /** 12737 * Gets the current preconfig type if you had already call preconfig interface. 12738 * 12739 * @returns { Profile } The current preconfig type. 12740 * @throws { BusinessError } 7400201 - Camera service fatal error. 12741 * @syscap SystemCapability.Multimedia.Camera.Core 12742 * @since 12 12743 */ 12744 /** 12745 * Gets the current preconfig type if you had already call preconfig interface. 12746 * 12747 * @returns { Profile } The current preconfig type. 12748 * @throws { BusinessError } 7400201 - Camera service fatal error. 12749 * @syscap SystemCapability.Multimedia.Camera.Core 12750 * @atomicservice 12751 * @since 19 12752 */ 12753 getActiveProfile(): Profile; 12754 12755 /** 12756 * Checks whether PhotoOutput supports quick thumbnail. 12757 * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. 12758 * 12759 * @returns { boolean } Whether quick thumbnail is supported. 12760 * @throws { BusinessError } 7400104 - session is not running. 12761 * @syscap SystemCapability.Multimedia.Camera.Core 12762 * @systemapi 12763 * @since 10 12764 */ 12765 /** 12766 * Checks whether PhotoOutput supports quick thumbnail. 12767 * This method is valid after Session.addInput() and Session.addOutput(photoOutput) are called. 12768 * 12769 * @returns { boolean } Whether quick thumbnail is supported. 12770 * @throws { BusinessError } 202 - Not System Application. 12771 * @throws { BusinessError } 7400104 - session is not running. 12772 * @syscap SystemCapability.Multimedia.Camera.Core 12773 * @systemapi 12774 * @since 12 12775 */ 12776 isQuickThumbnailSupported(): boolean; 12777 12778 /** 12779 * Enables or disables quick thumbnail. 12780 * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. 12781 * To avoid stream reconfiguration and performance loss, 12782 * you are advised to call the method before Session.commitConfig(). 12783 * 12784 * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. 12785 * @throws { BusinessError } 7400104 - session is not running. 12786 * @syscap SystemCapability.Multimedia.Camera.Core 12787 * @systemapi 12788 * @since 10 12789 */ 12790 /** 12791 * Enables or disables quick thumbnail. 12792 * The method must be called after Session.addInput() and Session.addOutput(photoOutput) are called. 12793 * To avoid stream reconfiguration and performance loss, 12794 * you are advised to call the method before Session.commitConfig(). 12795 * 12796 * @param { boolean } enabled - The value TRUE means to enable quick thumbnail, and FALSE means the opposite. 12797 * @throws { BusinessError } 202 - Not System Application. 12798 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12799 * @throws { BusinessError } 7400104 - session is not running. 12800 * @throws { BusinessError } 7400201 - Camera service fatal error. 12801 * @syscap SystemCapability.Multimedia.Camera.Core 12802 * @systemapi 12803 * @since 12 12804 */ 12805 enableQuickThumbnail(enabled: boolean): void; 12806 12807 /** 12808 * Subscribes to camera thumbnail events. 12809 * This method is valid only after enableQuickThumbnail(true) is called. 12810 * 12811 * @param { 'quickThumbnail' } type - Event type. 12812 * @param { AsyncCallback<image.PixelMap> } callback - Callback used to get the quick thumbnail. 12813 * @syscap SystemCapability.Multimedia.Camera.Core 12814 * @systemapi 12815 * @since 10 12816 */ 12817 on(type: 'quickThumbnail', callback: AsyncCallback<image.PixelMap>): void; 12818 12819 /** 12820 * Unsubscribes from camera thumbnail events. 12821 * This method is valid only after enableQuickThumbnail(true) is called. 12822 * 12823 * @param { 'quickThumbnail' } type - Event type. 12824 * @param { AsyncCallback<image.PixelMap> } callback - Callback used to get the quick thumbnail. 12825 * @syscap SystemCapability.Multimedia.Camera.Core 12826 * @systemapi 12827 * @since 10 12828 */ 12829 off(type: 'quickThumbnail', callback?: AsyncCallback<image.PixelMap>): void; 12830 12831 /** 12832 * Confirm if the auto high quality photo supported. 12833 * 12834 * @returns { boolean } TRUE if the auto high quality photo is supported. 12835 * @throws { BusinessError } 202 - Not System Application. 12836 * @throws { BusinessError } 7400104 - session is not running. 12837 * @throws { BusinessError } 7400201 - Camera service fatal error. 12838 * @syscap SystemCapability.Multimedia.Camera.Core 12839 * @systemapi 12840 * @since 13 12841 */ 12842 isAutoHighQualityPhotoSupported(): boolean; 12843 12844 /** 12845 * Enable auto high quality photo. 12846 * 12847 * @param { boolean } enabled - Target state for auto high quality photo. 12848 * @throws { BusinessError } 202 - Not System Application. 12849 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12850 * @throws { BusinessError } 7400104 - session is not running. 12851 * @throws { BusinessError } 7400201 - Camera service fatal error. 12852 * @syscap SystemCapability.Multimedia.Camera.Core 12853 * @systemapi 12854 * @since 13 12855 */ 12856 enableAutoHighQualityPhoto(enabled: boolean): void; 12857 12858 /** 12859 * Confirm if the auto cloud image enhancement is supported. 12860 * 12861 * @returns { boolean } TRUE if the auto cloud image enhancement is supported. 12862 * @throws { BusinessError } 202 - Not System Application. 12863 * @throws { BusinessError } 7400201 - Camera service fatal error. 12864 * @syscap SystemCapability.Multimedia.Camera.Core 12865 * @systemapi 12866 * @since 13 12867 */ 12868 isAutoCloudImageEnhancementSupported(): boolean; 12869 12870 /** 12871 * Enable auto cloud image enhancement 12872 * 12873 * @param { boolean } enabled - Target state for auto cloud image enhancement. 12874 * @throws { BusinessError } 202 - Not System Application. 12875 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12876 * @throws { BusinessError } 7400201 - Camera service fatal error. 12877 * @syscap SystemCapability.Multimedia.Camera.Core 12878 * @systemapi 12879 * @since 13 12880 */ 12881 enableAutoCloudImageEnhancement(enabled: boolean): void; 12882 12883 /** 12884 * Confirm if moving photo supported. 12885 * 12886 * @returns { boolean } TRUE if the moving photo is supported. 12887 * @throws { BusinessError } 7400201 - Camera service fatal error. 12888 * @syscap SystemCapability.Multimedia.Camera.Core 12889 * @since 12 12890 */ 12891 /** 12892 * Confirm if moving photo supported. 12893 * 12894 * @returns { boolean } TRUE if the moving photo is supported. 12895 * @throws { BusinessError } 7400201 - Camera service fatal error. 12896 * @syscap SystemCapability.Multimedia.Camera.Core 12897 * @atomicservice 12898 * @since 19 12899 */ 12900 isMovingPhotoSupported(): boolean; 12901 12902 /** 12903 * Enable moving photo. 12904 * 12905 * @permission ohos.permission.MICROPHONE 12906 * @param { boolean } enabled - Target state for moving photo. 12907 * @throws { BusinessError } 201 - permission denied. 12908 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12909 * @throws { BusinessError } 7400201 - Camera service fatal error. 12910 * @syscap SystemCapability.Multimedia.Camera.Core 12911 * @since 12 12912 */ 12913 /** 12914 * Enable moving photo. 12915 * 12916 * @permission ohos.permission.MICROPHONE 12917 * @param { boolean } enabled - Target state for moving photo. 12918 * @throws { BusinessError } 201 - permission denied. 12919 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12920 * @throws { BusinessError } 7400201 - Camera service fatal error. 12921 * @syscap SystemCapability.Multimedia.Camera.Core 12922 * @atomicservice 12923 * @since 19 12924 */ 12925 enableMovingPhoto(enabled: boolean): void; 12926 12927 /** 12928 * Gets the photo rotation angle. 12929 * 12930 * @param { number } deviceDegree - The current device rotation degree. 12931 * @returns { ImageRotation } The photo rotation angle. 12932 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12933 * @throws { BusinessError } 7400201 - Camera service fatal error. 12934 * @syscap SystemCapability.Multimedia.Camera.Core 12935 * @since 12 12936 */ 12937 /** 12938 * Gets the photo rotation angle. 12939 * 12940 * @param { number } deviceDegree - The current device rotation degree. 12941 * @returns { ImageRotation } The photo rotation angle. 12942 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 12943 * @throws { BusinessError } 7400201 - Camera service fatal error. 12944 * @syscap SystemCapability.Multimedia.Camera.Core 12945 * @atomicservice 12946 * @since 19 12947 */ 12948 getPhotoRotation(deviceDegree: number): ImageRotation; 12949 12950 /** 12951 * Confirm if offline processing is supported. 12952 * 12953 * @returns { boolean } TRUE if the type of offline is supported. 12954 * @throws { BusinessError } 202 - Not System Application. 12955 * @throws { BusinessError } 7400201 - Camera service fatal error. 12956 * @syscap SystemCapability.Multimedia.Camera.Core 12957 * @systemapi 12958 * @since 18 12959 */ 12960 isOfflineSupported(): boolean; 12961 12962 /** 12963 * Enable offline processing. 12964 * 12965 * @throws { BusinessError } 202 - Not System Application. 12966 * @throws { BusinessError } 7400104 - session is not running. 12967 * @throws { BusinessError } 7400201 - Camera service fatal error. 12968 * @syscap SystemCapability.Multimedia.Camera.Core 12969 * @systemapi 12970 * @since 18 12971 */ 12972 enableOffline(): void; 12973 12974 /** 12975 * Subscribes offline Delivery finished events. 12976 * This method is valid only after enableOffline() is called. 12977 * 12978 * @param { 'offlineDeliveryFinished' } type - Event type. 12979 * @param { AsyncCallback<void> } callback - Callback used to get offline Delivery finished events. 12980 * @throws { BusinessError } 202 - Not System Application. 12981 * @syscap SystemCapability.Multimedia.Camera.Core 12982 * @systemapi 12983 * @since 18 12984 */ 12985 on(type: 'offlineDeliveryFinished', callback: AsyncCallback<void>): void; 12986 12987 /** 12988 * Unsubscribes offline Delivery finished events. 12989 * This method is valid only after enableOffline() is called. 12990 * 12991 * @param { 'offlineDeliveryFinished' } type - Event type. 12992 * @param { AsyncCallback<void>} callback - Callback used to get offline Delivery finished events. 12993 * @throws { BusinessError } 202 - Not System Application. 12994 * @syscap SystemCapability.Multimedia.Camera.Core 12995 * @systemapi 12996 * @since 18 12997 */ 12998 off(type: 'offlineDeliveryFinished', callback?: AsyncCallback<void>): void; 12999 } 13000 13001 /** 13002 * Frame shutter callback info. 13003 * 13004 * @typedef FrameShutterInfo 13005 * @syscap SystemCapability.Multimedia.Camera.Core 13006 * @since 10 13007 */ 13008 /** 13009 * Frame shutter callback info. 13010 * 13011 * @typedef FrameShutterInfo 13012 * @syscap SystemCapability.Multimedia.Camera.Core 13013 * @atomicservice 13014 * @since 19 13015 */ 13016 interface FrameShutterInfo { 13017 /** 13018 * Capture id. 13019 * 13020 * @type { number } 13021 * @syscap SystemCapability.Multimedia.Camera.Core 13022 * @since 10 13023 */ 13024 /** 13025 * Capture id. 13026 * 13027 * @type { number } 13028 * @syscap SystemCapability.Multimedia.Camera.Core 13029 * @atomicservice 13030 * @since 19 13031 */ 13032 captureId: number; 13033 /** 13034 * Timestamp for frame. 13035 * 13036 * @type { number } 13037 * @syscap SystemCapability.Multimedia.Camera.Core 13038 * @since 10 13039 */ 13040 /** 13041 * Timestamp for frame. 13042 * 13043 * @type { number } 13044 * @syscap SystemCapability.Multimedia.Camera.Core 13045 * @atomicservice 13046 * @since 19 13047 */ 13048 timestamp: number; 13049 } 13050 13051 /** 13052 * Frame shutter end callback info. 13053 * 13054 * @typedef FrameShutterEndInfo 13055 * @syscap SystemCapability.Multimedia.Camera.Core 13056 * @since 12 13057 */ 13058 /** 13059 * Frame shutter end callback info. 13060 * 13061 * @typedef FrameShutterEndInfo 13062 * @syscap SystemCapability.Multimedia.Camera.Core 13063 * @atomicservice 13064 * @since 19 13065 */ 13066 interface FrameShutterEndInfo { 13067 /** 13068 * Capture id. 13069 * 13070 * @type { number } 13071 * @syscap SystemCapability.Multimedia.Camera.Core 13072 * @since 12 13073 */ 13074 /** 13075 * Capture id. 13076 * 13077 * @type { number } 13078 * @syscap SystemCapability.Multimedia.Camera.Core 13079 * @atomicservice 13080 * @since 19 13081 */ 13082 captureId: number; 13083 } 13084 13085 /** 13086 * Capture start info. 13087 * 13088 * @typedef CaptureStartInfo 13089 * @syscap SystemCapability.Multimedia.Camera.Core 13090 * @since 11 13091 */ 13092 /** 13093 * Capture start info. 13094 * 13095 * @typedef CaptureStartInfo 13096 * @syscap SystemCapability.Multimedia.Camera.Core 13097 * @atomicservice 13098 * @since 19 13099 */ 13100 interface CaptureStartInfo { 13101 /** 13102 * Capture id. 13103 * 13104 * @type { number } 13105 * @syscap SystemCapability.Multimedia.Camera.Core 13106 * @since 11 13107 */ 13108 /** 13109 * Capture id. 13110 * 13111 * @type { number } 13112 * @syscap SystemCapability.Multimedia.Camera.Core 13113 * @atomicservice 13114 * @since 19 13115 */ 13116 captureId: number; 13117 /** 13118 * Time(in milliseconds) is the shutter time for the photo. 13119 * 13120 * @type { number } 13121 * @syscap SystemCapability.Multimedia.Camera.Core 13122 * @since 11 13123 */ 13124 /** 13125 * Time(in milliseconds) is the shutter time for the photo. 13126 * 13127 * @type { number } 13128 * @syscap SystemCapability.Multimedia.Camera.Core 13129 * @atomicservice 13130 * @since 19 13131 */ 13132 time: number; 13133 } 13134 13135 /** 13136 * Capture end info. 13137 * 13138 * @typedef CaptureEndInfo 13139 * @syscap SystemCapability.Multimedia.Camera.Core 13140 * @since 10 13141 */ 13142 /** 13143 * Capture end info. 13144 * 13145 * @typedef CaptureEndInfo 13146 * @syscap SystemCapability.Multimedia.Camera.Core 13147 * @atomicservice 13148 * @since 19 13149 */ 13150 interface CaptureEndInfo { 13151 /** 13152 * Capture id. 13153 * 13154 * @type { number } 13155 * @syscap SystemCapability.Multimedia.Camera.Core 13156 * @since 10 13157 */ 13158 /** 13159 * Capture id. 13160 * 13161 * @type { number } 13162 * @syscap SystemCapability.Multimedia.Camera.Core 13163 * @atomicservice 13164 * @since 19 13165 */ 13166 captureId: number; 13167 /** 13168 * Frame count. 13169 * 13170 * @type { number } 13171 * @syscap SystemCapability.Multimedia.Camera.Core 13172 * @since 10 13173 */ 13174 /** 13175 * Frame count. 13176 * 13177 * @type { number } 13178 * @syscap SystemCapability.Multimedia.Camera.Core 13179 * @atomicservice 13180 * @since 19 13181 */ 13182 frameCount: number; 13183 } 13184 13185 /** 13186 * Deferred video enhancement info. 13187 * 13188 * @typedef DeferredVideoEnhancementInfo 13189 * @syscap SystemCapability.Multimedia.Camera.Core 13190 * @systemapi 13191 * @since 13 13192 */ 13193 interface DeferredVideoEnhancementInfo { 13194 /** 13195 * Check whether deferred video enhancement available. 13196 * 13197 * @type { boolean } 13198 * @readonly 13199 * @syscap SystemCapability.Multimedia.Camera.Core 13200 * @systemapi 13201 * @since 13 13202 */ 13203 readonly isDeferredVideoEnhancementAvailable: boolean; 13204 /** 13205 * Video identifier. 13206 * 13207 * @type { ?string } 13208 * @readonly 13209 * @syscap SystemCapability.Multimedia.Camera.Core 13210 * @systemapi 13211 * @since 13 13212 */ 13213 readonly videoId?: string; 13214 } 13215 13216 /** 13217 * Video output object. 13218 * 13219 * @extends CameraOutput 13220 * @interface VideoOutput 13221 * @syscap SystemCapability.Multimedia.Camera.Core 13222 * @since 10 13223 */ 13224 /** 13225 * Video output object. 13226 * 13227 * @extends CameraOutput 13228 * @interface VideoOutput 13229 * @syscap SystemCapability.Multimedia.Camera.Core 13230 * @atomicservice 13231 * @since 19 13232 */ 13233 interface VideoOutput extends CameraOutput { 13234 /** 13235 * Start video output. 13236 * 13237 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13238 * @throws { BusinessError } 7400103 - Session not config. 13239 * @throws { BusinessError } 7400201 - Camera service fatal error. 13240 * @syscap SystemCapability.Multimedia.Camera.Core 13241 * @since 10 13242 */ 13243 /** 13244 * Start video output. 13245 * 13246 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13247 * @throws { BusinessError } 7400103 - Session not config. 13248 * @throws { BusinessError } 7400201 - Camera service fatal error. 13249 * @syscap SystemCapability.Multimedia.Camera.Core 13250 * @atomicservice 13251 * @since 19 13252 */ 13253 start(callback: AsyncCallback<void>): void; 13254 13255 /** 13256 * Start video output. 13257 * 13258 * @returns { Promise<void> } Promise used to return the result. 13259 * @throws { BusinessError } 7400103 - Session not config. 13260 * @throws { BusinessError } 7400201 - Camera service fatal error. 13261 * @syscap SystemCapability.Multimedia.Camera.Core 13262 * @since 10 13263 */ 13264 /** 13265 * Start video output. 13266 * 13267 * @returns { Promise<void> } Promise used to return the result. 13268 * @throws { BusinessError } 7400103 - Session not config. 13269 * @throws { BusinessError } 7400201 - Camera service fatal error. 13270 * @syscap SystemCapability.Multimedia.Camera.Core 13271 * @atomicservice 13272 * @since 19 13273 */ 13274 start(): Promise<void>; 13275 13276 /** 13277 * Stop video output. 13278 * 13279 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13280 * @syscap SystemCapability.Multimedia.Camera.Core 13281 * @since 10 13282 */ 13283 /** 13284 * Stop video output. 13285 * 13286 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13287 * @syscap SystemCapability.Multimedia.Camera.Core 13288 * @atomicservice 13289 * @since 19 13290 */ 13291 stop(callback: AsyncCallback<void>): void; 13292 13293 /** 13294 * Stop video output. 13295 * 13296 * @returns { Promise<void> } Promise used to return the result. 13297 * @syscap SystemCapability.Multimedia.Camera.Core 13298 * @since 10 13299 */ 13300 /** 13301 * Stop video output. 13302 * 13303 * @returns { Promise<void> } Promise used to return the result. 13304 * @syscap SystemCapability.Multimedia.Camera.Core 13305 * @atomicservice 13306 * @since 19 13307 */ 13308 stop(): Promise<void>; 13309 13310 /** 13311 * Determine whether video mirror is supported. 13312 * 13313 * @returns { boolean } Is video mirror supported. 13314 * @throws { BusinessError } 202 - Not System Application. 13315 * @syscap SystemCapability.Multimedia.Camera.Core 13316 * @systemapi 13317 * @since 12 13318 */ 13319 /** 13320 * Determine whether video mirror is supported. 13321 * 13322 * @returns { boolean } Is video mirror supported. 13323 * @syscap SystemCapability.Multimedia.Camera.Core 13324 * @since 15 13325 */ 13326 /** 13327 * Determine whether video mirror is supported. 13328 * 13329 * @returns { boolean } Is video mirror supported. 13330 * @syscap SystemCapability.Multimedia.Camera.Core 13331 * @atomicservice 13332 * @since 19 13333 */ 13334 isMirrorSupported(): boolean; 13335 13336 /** 13337 * Enable mirror for video capture. 13338 * 13339 * @param { boolean } enabled - enable video mirror if TRUE. 13340 * @throws { BusinessError } 202 - Not System Application. 13341 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13342 * @throws { BusinessError } 7400103 - Session not config. 13343 * @syscap SystemCapability.Multimedia.Camera.Core 13344 * @systemapi 13345 * @since 12 13346 */ 13347 /** 13348 * Enable mirror for video capture. 13349 * 13350 * @param { boolean } enabled - enable video mirror if TRUE. 13351 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13352 * @throws { BusinessError } 7400103 - Session not config. 13353 * @syscap SystemCapability.Multimedia.Camera.Core 13354 * @since 15 13355 */ 13356 /** 13357 * Enable/disable mirror recording. 13358 * 13359 * Before calling this API, it is necessary to use isMirrorSupported to check whether 13360 * video mirroring is supported. 13361 * 13362 * When enabling or disabling video mirroring, you must first call getVideoRotation 13363 * to retrieve the current rotation value and then call updateRotation to apply the 13364 * updated rotation. 13365 * 13366 * @param { boolean } enabled - enable video mirror if TRUE. 13367 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13368 * @throws { BusinessError } 7400103 - Session not config. 13369 * @syscap SystemCapability.Multimedia.Camera.Core 13370 * @atomicservice 13371 * @since 19 13372 */ 13373 enableMirror(enabled: boolean): void; 13374 13375 /** 13376 * Get supported frame rates which can be set during session running. 13377 * 13378 * @returns { Array<FrameRateRange> } The array of supported frame rate range. 13379 * @syscap SystemCapability.Multimedia.Camera.Core 13380 * @since 12 13381 */ 13382 /** 13383 * Get supported frame rates which can be set during session running. 13384 * 13385 * @returns { Array<FrameRateRange> } The array of supported frame rate range. 13386 * @syscap SystemCapability.Multimedia.Camera.Core 13387 * @atomicservice 13388 * @since 19 13389 */ 13390 getSupportedFrameRates(): Array<FrameRateRange>; 13391 13392 /** 13393 * Set a frame rate range. 13394 * 13395 * @param { number } minFps - Minimum frame rate per second. 13396 * @param { number } maxFps - Maximum frame rate per second. 13397 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13398 * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. 13399 * @syscap SystemCapability.Multimedia.Camera.Core 13400 * @since 12 13401 */ 13402 /** 13403 * Set a frame rate range. 13404 * 13405 * @param { number } minFps - Minimum frame rate per second. 13406 * @param { number } maxFps - Maximum frame rate per second. 13407 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13408 * @throws { BusinessError } 7400110 - Unresolved conflicts with current configurations. 13409 * @syscap SystemCapability.Multimedia.Camera.Core 13410 * @atomicservice 13411 * @since 19 13412 */ 13413 setFrameRate(minFps: number, maxFps: number): void; 13414 13415 /** 13416 * Get active frame rate range which has been set before. 13417 * 13418 * @returns { FrameRateRange } The active frame rate range. 13419 * @syscap SystemCapability.Multimedia.Camera.Core 13420 * @since 12 13421 */ 13422 /** 13423 * Get active frame rate range which has been set before. 13424 * 13425 * @returns { FrameRateRange } The active frame rate range. 13426 * @syscap SystemCapability.Multimedia.Camera.Core 13427 * @atomicservice 13428 * @since 19 13429 */ 13430 getActiveFrameRate(): FrameRateRange; 13431 13432 /** 13433 * Gets the video rotation angle. 13434 * 13435 * @param { number } deviceDegree - The current device rotation degree. 13436 * @returns { ImageRotation } The video rotation angle. 13437 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13438 * @throws { BusinessError } 7400201 - Camera service fatal error. 13439 * @syscap SystemCapability.Multimedia.Camera.Core 13440 * @since 12 13441 */ 13442 /** 13443 * Gets the video rotation angle. 13444 * 13445 * @param { number } deviceDegree - The current device rotation degree. 13446 * @returns { ImageRotation } The video rotation angle. 13447 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13448 * @throws { BusinessError } 7400201 - Camera service fatal error. 13449 * @syscap SystemCapability.Multimedia.Camera.Core 13450 * @atomicservice 13451 * @since 19 13452 */ 13453 getVideoRotation(deviceDegree: number): ImageRotation; 13454 13455 /** 13456 * Confirm if auto deferred video enhancement is supported in the specific device. 13457 * 13458 * @returns { boolean } TRUE if auto deferred video enhancement is supported. 13459 * @throws { BusinessError } 202 - Not System Application. 13460 * @throws { BusinessError } 7400201 - Camera service fatal error. 13461 * @syscap SystemCapability.Multimedia.Camera.Core 13462 * @systemapi 13463 * @since 13 13464 */ 13465 isAutoDeferredVideoEnhancementSupported(): boolean; 13466 13467 /** 13468 * Confirm if auto deferred video enhancement is enabled. 13469 * 13470 * @returns { boolean } TRUE if auto deferred video enhancement is enabled. 13471 * @throws { BusinessError } 202 - Not System Application. 13472 * @throws { BusinessError } 7400201 - Camera service fatal error. 13473 * @syscap SystemCapability.Multimedia.Camera.Core 13474 * @systemapi 13475 * @since 13 13476 */ 13477 isAutoDeferredVideoEnhancementEnabled(): boolean; 13478 13479 /** 13480 * Enable auto deferred video enhancement if needed. 13481 * 13482 * @param { boolean } enabled - Status of auto deferred video enhancement. 13483 * @throws { BusinessError } 202 - Not System Application. 13484 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13485 * @throws { BusinessError } 7400201 - Camera service fatal error. 13486 * @syscap SystemCapability.Multimedia.Camera.Core 13487 * @systemapi 13488 * @since 13 13489 */ 13490 enableAutoDeferredVideoEnhancement(enabled: boolean): void; 13491 13492 /** 13493 * Get supported video rotations. 13494 * 13495 * @returns { Array<ImageRotation> } The array of supported video rotations. 13496 * @throws { BusinessError } 202 - Not System Application. 13497 * @syscap SystemCapability.Multimedia.Camera.Core 13498 * @systemapi 13499 * @since 14 13500 */ 13501 getSupportedRotations(): Array<ImageRotation>; 13502 13503 /** 13504 * Determine whether video rotation is supported. 13505 * 13506 * @returns { boolean } Is video rotation supported. 13507 * @throws { BusinessError } 202 - Not System Application. 13508 * @syscap SystemCapability.Multimedia.Camera.Core 13509 * @systemapi 13510 * @since 14 13511 */ 13512 isRotationSupported(): boolean; 13513 13514 /** 13515 * Set a video rotation. 13516 * 13517 * @param { ImageRotation } rotation - The rotation angle. 13518 * @throws { BusinessError } 202 - Not System Application. 13519 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13520 * @syscap SystemCapability.Multimedia.Camera.Core 13521 * @systemapi 13522 * @since 14 13523 */ 13524 setRotation(rotation: ImageRotation): void; 13525 13526 /** 13527 * Determine whether auto frame rate is supported. 13528 * 13529 * @returns { boolean } Is auto frame rate supported. 13530 * @throws { BusinessError } 202 - Not System Application. 13531 * @syscap SystemCapability.Multimedia.Camera.Core 13532 * @systemapi 13533 * @since 18 13534 */ 13535 isAutoVideoFrameRateSupported(): boolean; 13536 13537 /** 13538 * Enable auto frame rate for video capture. 13539 * 13540 * @param { boolean } enabled - enable auto frame rate if TRUE. 13541 * @throws { BusinessError } 202 - Not System Application. 13542 * @throws { BusinessError } 7400103 - Session not config. 13543 * @syscap SystemCapability.Multimedia.Camera.Core 13544 * @systemapi 13545 * @since 18 13546 */ 13547 enableAutoVideoFrameRate(enabled: boolean): void; 13548 13549 /** 13550 * Subscribes deferred video enhancement info callback. 13551 * 13552 * @param { 'deferredVideoEnhancementInfo' } type - Event type. 13553 * @param { AsyncCallback<DeferredVideoEnhanceInfo> } callback - Callback used to return the result. 13554 * @throws { BusinessError } 202 - Not System Application. 13555 * @syscap SystemCapability.Multimedia.Camera.Core 13556 * @systemapi 13557 * @since 13 13558 */ 13559 on(type: 'deferredVideoEnhancementInfo', callback: AsyncCallback<DeferredVideoEnhancementInfo>): void; 13560 13561 /** 13562 * Unsubscribes from deferred video enhancement info callback. 13563 * 13564 * @param { 'deferredVideoEnhancementInfo' } type - Event type. 13565 * @param { AsyncCallback<DeferredVideoEnhancementInfo> } callback - Callback used to return the result. 13566 * @throws { BusinessError } 202 - Not System Application. 13567 * @syscap SystemCapability.Multimedia.Camera.Core 13568 * @systemapi 13569 * @since 13 13570 */ 13571 off(type: 'deferredVideoEnhancementInfo', callback?: AsyncCallback<DeferredVideoEnhancementInfo>): void; 13572 13573 /** 13574 * Subscribes frame start event callback. 13575 * 13576 * @param { 'frameStart' } type - Event type. 13577 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13578 * @syscap SystemCapability.Multimedia.Camera.Core 13579 * @since 10 13580 */ 13581 /** 13582 * Registers a listener for the start of the video recording to get the result by registering 13583 * a callback function. This API uses an asynchronous callback to return the result. 13584 * 13585 * Description: Currently, it is not allowed to use off() to unregister the callback 13586 * within the callback method of on(). 13587 * 13588 * @param { 'frameStart' } type - Event type. 13589 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13590 * @syscap SystemCapability.Multimedia.Camera.Core 13591 * @atomicservice 13592 * @since 19 13593 */ 13594 on(type: 'frameStart', callback: AsyncCallback<void>): void; 13595 13596 /** 13597 * Unsubscribes from frame start event callback. 13598 * 13599 * @param { 'frameStart' } type - Event type. 13600 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13601 * @syscap SystemCapability.Multimedia.Camera.Core 13602 * @since 10 13603 */ 13604 /** 13605 * Unsubscribes from frame start event callback. 13606 * 13607 * @param { 'frameStart' } type - Event type. 13608 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13609 * @syscap SystemCapability.Multimedia.Camera.Core 13610 * @atomicservice 13611 * @since 19 13612 */ 13613 off(type: 'frameStart', callback?: AsyncCallback<void>): void; 13614 13615 /** 13616 * Subscribes frame end event callback. 13617 * 13618 * @param { 'frameEnd' } type - Event type. 13619 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13620 * @syscap SystemCapability.Multimedia.Camera.Core 13621 * @since 10 13622 */ 13623 /** 13624 * Subscribes frame end event callback. 13625 * 13626 * @param { 'frameEnd' } type - Event type. 13627 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13628 * @syscap SystemCapability.Multimedia.Camera.Core 13629 * @atomicservice 13630 * @since 19 13631 */ 13632 on(type: 'frameEnd', callback: AsyncCallback<void>): void; 13633 13634 /** 13635 * Unsubscribes from frame end event callback. 13636 * 13637 * @param { 'frameEnd' } type - Event type. 13638 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13639 * @syscap SystemCapability.Multimedia.Camera.Core 13640 * @since 10 13641 */ 13642 /** 13643 * Unsubscribes from frame end event callback. 13644 * 13645 * @param { 'frameEnd' } type - Event type. 13646 * @param { AsyncCallback<void> } callback - Callback used to return the result. 13647 * @syscap SystemCapability.Multimedia.Camera.Core 13648 * @atomicservice 13649 * @since 19 13650 */ 13651 off(type: 'frameEnd', callback?: AsyncCallback<void>): void; 13652 13653 /** 13654 * Subscribes to error events. 13655 * 13656 * @param { 'error' } type - Event type. 13657 * @param { ErrorCallback } callback - Callback used to get the video output errors. 13658 * @syscap SystemCapability.Multimedia.Camera.Core 13659 * @since 10 13660 */ 13661 /** 13662 * Registers a listener for errors in the metadata stream to get the result by registering 13663 * a callback function. This API uses an asynchronous callback to return the result. 13664 * 13665 * Description: Currently, it is not allowed to use off() to unregister the callback 13666 * within the callback method of on(). 13667 * 13668 * @param { 'error' } type - Event type. 13669 * @param { ErrorCallback } callback - Callback used to get the video output errors. 13670 * @syscap SystemCapability.Multimedia.Camera.Core 13671 * @atomicservice 13672 * @since 19 13673 */ 13674 on(type: 'error', callback: ErrorCallback): void; 13675 13676 /** 13677 * Unsubscribes from error events. 13678 * 13679 * @param { 'error' } type - Event type. 13680 * @param { ErrorCallback } callback - Callback used to get the video output errors. 13681 * @syscap SystemCapability.Multimedia.Camera.Core 13682 * @since 10 13683 */ 13684 /** 13685 * Unsubscribes from error events. 13686 * 13687 * @param { 'error' } type - Event type. 13688 * @param { ErrorCallback } callback - Callback used to get the video output errors. 13689 * @syscap SystemCapability.Multimedia.Camera.Core 13690 * @atomicservice 13691 * @since 19 13692 */ 13693 off(type: 'error', callback?: ErrorCallback): void; 13694 13695 /** 13696 * Gets the current preconfig type if you had already call preconfig interface. 13697 * 13698 * @returns { VideoProfile } The current preconfig type. 13699 * @throws { BusinessError } 7400201 - Camera service fatal error. 13700 * @syscap SystemCapability.Multimedia.Camera.Core 13701 * @since 12 13702 */ 13703 /** 13704 * Gets the current preconfig type if you had already call preconfig interface. 13705 * 13706 * @returns { VideoProfile } The current preconfig type. 13707 * @throws { BusinessError } 7400201 - Camera service fatal error. 13708 * @syscap SystemCapability.Multimedia.Camera.Core 13709 * @atomicservice 13710 * @since 19 13711 */ 13712 getActiveProfile(): VideoProfile; 13713 13714 /** 13715 * Get supported video meta types. 13716 * @returns { Array<VideoMetaType> } The array of supported video meta type. 13717 * @throws { BusinessError } 202 - Not System Application. 13718 * @throws { BusinessError } 7400201 - Camera service fatal error. 13719 * @syscap SystemCapability.Multimedia.Camera.Core 13720 * @systemapi 13721 * @since 12 13722 */ 13723 getSupportedVideoMetaTypes(): Array<VideoMetaType>; 13724 13725 /** 13726 * Attach a meta surface to VideoOutput. 13727 * @param { string } surfaceId - Surface object id used for receiving meta infos. 13728 * @param { VideoMetaType } type - Video meta type. 13729 * @throws { BusinessError } 202 - Not System Application. 13730 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 13731 * @throws { BusinessError } 7400201 - Camera service fatal error. 13732 * @syscap SystemCapability.Multimedia.Camera.Core 13733 * @systemapi 13734 * @since 12 13735 */ 13736 attachMetaSurface(surfaceId: string, type: VideoMetaType): void; 13737 } 13738 13739 /** 13740 * Video meta type. 13741 * 13742 * @enum { number } 13743 * @syscap SystemCapability.Multimedia.Camera.Core 13744 * @systemapi 13745 * @since 12 13746 */ 13747 enum VideoMetaType { 13748 /** 13749 * Video meta type for storing maker info. 13750 * @syscap SystemCapability.Multimedia.Camera.Core 13751 * @systemapi 13752 * @since 12 13753 */ 13754 VIDEO_META_MAKER_INFO = 0 13755 } 13756 13757 /** 13758 * Metadata object type. 13759 * 13760 * @enum { number } 13761 * @syscap SystemCapability.Multimedia.Camera.Core 13762 * @since 10 13763 */ 13764 /** 13765 * Metadata object type. 13766 * 13767 * @enum { number } 13768 * @syscap SystemCapability.Multimedia.Camera.Core 13769 * @atomicservice 13770 * @since 19 13771 */ 13772 enum MetadataObjectType { 13773 /** 13774 * Face detection type. 13775 * 13776 * @syscap SystemCapability.Multimedia.Camera.Core 13777 * @since 10 13778 */ 13779 /** 13780 * Face detection type. 13781 * 13782 * @syscap SystemCapability.Multimedia.Camera.Core 13783 * @atomicservice 13784 * @since 19 13785 */ 13786 FACE_DETECTION = 0, 13787 13788 /** 13789 * Human body detection type. 13790 * 13791 * @syscap SystemCapability.Multimedia.Camera.Core 13792 * @systemapi 13793 * @since 13 13794 */ 13795 HUMAN_BODY = 1, 13796 13797 /** 13798 * Cat face detection type. 13799 * 13800 * @syscap SystemCapability.Multimedia.Camera.Core 13801 * @systemapi 13802 * @since 13 13803 */ 13804 CAT_FACE = 2, 13805 13806 /** 13807 * Cat body detection type. 13808 * 13809 * @syscap SystemCapability.Multimedia.Camera.Core 13810 * @systemapi 13811 * @since 13 13812 */ 13813 CAT_BODY = 3, 13814 13815 /** 13816 * Dog face detection type. 13817 * 13818 * @syscap SystemCapability.Multimedia.Camera.Core 13819 * @systemapi 13820 * @since 13 13821 */ 13822 DOG_FACE = 4, 13823 13824 /** 13825 * Dog body detection type. 13826 * 13827 * @syscap SystemCapability.Multimedia.Camera.Core 13828 * @systemapi 13829 * @since 13 13830 */ 13831 DOG_BODY = 5, 13832 13833 /** 13834 * Salient detection type. 13835 * 13836 * @syscap SystemCapability.Multimedia.Camera.Core 13837 * @systemapi 13838 * @since 13 13839 */ 13840 SALIENT_DETECTION = 6, 13841 13842 /** 13843 * Barcode detection type. 13844 * 13845 * @syscap SystemCapability.Multimedia.Camera.Core 13846 * @systemapi 13847 * @since 13 13848 */ 13849 BAR_CODE_DETECTION = 7 13850 } 13851 13852 /** 13853 * Enum for light painting tabletype. 13854 * 13855 * @enum { number } 13856 * @syscap SystemCapability.Multimedia.Camera.Core 13857 * @systemapi 13858 * @since 12 13859 */ 13860 enum LightPaintingType { 13861 /** 13862 * Traffic trails effect. 13863 * 13864 * @syscap SystemCapability.Multimedia.Camera.Core 13865 * @systemapi 13866 * @since 12 13867 */ 13868 TRAFFIC_TRAILS = 0, 13869 13870 /** 13871 * Star trails effect. 13872 * 13873 * @syscap SystemCapability.Multimedia.Camera.Core 13874 * @systemapi 13875 * @since 12 13876 */ 13877 STAR_TRAILS = 1, 13878 13879 /** 13880 * Silky water effect. 13881 * 13882 * @syscap SystemCapability.Multimedia.Camera.Core 13883 * @systemapi 13884 * @since 12 13885 */ 13886 SILKY_WATER = 2, 13887 13888 /** 13889 * Light graffiti effect. 13890 * 13891 * @syscap SystemCapability.Multimedia.Camera.Core 13892 * @systemapi 13893 * @since 12 13894 */ 13895 LIGHT_GRAFFITI = 3 13896 } 13897 13898 /** 13899 * Rectangle definition. 13900 * 13901 * @typedef Rect 13902 * @syscap SystemCapability.Multimedia.Camera.Core 13903 * @since 10 13904 */ 13905 /** 13906 * Rectangle definition. 13907 * 13908 * @typedef Rect 13909 * @syscap SystemCapability.Multimedia.Camera.Core 13910 * @atomicservice 13911 * @since 19 13912 */ 13913 interface Rect { 13914 /** 13915 * X coordinator of top left point. 13916 * 13917 * @type { number } 13918 * @syscap SystemCapability.Multimedia.Camera.Core 13919 * @since 10 13920 */ 13921 /** 13922 * X coordinator of top left point. 13923 * 13924 * @type { number } 13925 * @syscap SystemCapability.Multimedia.Camera.Core 13926 * @atomicservice 13927 * @since 19 13928 */ 13929 topLeftX: number; 13930 /** 13931 * Y coordinator of top left point. 13932 * 13933 * @type { number } 13934 * @syscap SystemCapability.Multimedia.Camera.Core 13935 * @since 10 13936 */ 13937 /** 13938 * Y coordinator of top left point. 13939 * 13940 * @type { number } 13941 * @syscap SystemCapability.Multimedia.Camera.Core 13942 * @atomicservice 13943 * @since 19 13944 */ 13945 topLeftY: number; 13946 /** 13947 * Width of this rectangle. 13948 * 13949 * @type { number } 13950 * @syscap SystemCapability.Multimedia.Camera.Core 13951 * @since 10 13952 */ 13953 /** 13954 * Width of this rectangle. 13955 * 13956 * @type { number } 13957 * @syscap SystemCapability.Multimedia.Camera.Core 13958 * @atomicservice 13959 * @since 19 13960 */ 13961 width: number; 13962 /** 13963 * Height of this rectangle. 13964 * 13965 * @type { number } 13966 * @syscap SystemCapability.Multimedia.Camera.Core 13967 * @since 10 13968 */ 13969 /** 13970 * Height of this rectangle. 13971 * 13972 * @type { number } 13973 * @syscap SystemCapability.Multimedia.Camera.Core 13974 * @atomicservice 13975 * @since 19 13976 */ 13977 height: number; 13978 } 13979 13980 /** 13981 * Enum for emotion type. 13982 * 13983 * @enum { number } 13984 * @syscap SystemCapability.Multimedia.Camera.Core 13985 * @systemapi 13986 * @since 13 13987 */ 13988 enum Emotion { 13989 /** 13990 * Emotion type: Neutral. 13991 * 13992 * @syscap SystemCapability.Multimedia.Camera.Core 13993 * @systemapi 13994 * @since 13 13995 */ 13996 NEUTRAL = 0, 13997 13998 /** 13999 * Emotion type: Sadness. 14000 * 14001 * @syscap SystemCapability.Multimedia.Camera.Core 14002 * @systemapi 14003 * @since 13 14004 */ 14005 SADNESS = 1, 14006 14007 /** 14008 * Emotion type: Smile. 14009 * 14010 * @syscap SystemCapability.Multimedia.Camera.Core 14011 * @systemapi 14012 * @since 13 14013 */ 14014 SMILE = 2, 14015 14016 /** 14017 * Emotion type: Surprise. 14018 * 14019 * @syscap SystemCapability.Multimedia.Camera.Core 14020 * @systemapi 14021 * @since 13 14022 */ 14023 SURPRISE = 3 14024 } 14025 14026 /** 14027 * Metadata object basis. 14028 * 14029 * @typedef MetadataObject 14030 * @syscap SystemCapability.Multimedia.Camera.Core 14031 * @since 10 14032 */ 14033 /** 14034 * Metadata object basis. 14035 * 14036 * @typedef MetadataObject 14037 * @syscap SystemCapability.Multimedia.Camera.Core 14038 * @atomicservice 14039 * @since 19 14040 */ 14041 interface MetadataObject { 14042 /** 14043 * Metadata object type. 14044 * 14045 * @type { MetadataObjectType } 14046 * @readonly 14047 * @syscap SystemCapability.Multimedia.Camera.Core 14048 * @since 10 14049 */ 14050 /** 14051 * Metadata object type. 14052 * 14053 * @type { MetadataObjectType } 14054 * @readonly 14055 * @syscap SystemCapability.Multimedia.Camera.Core 14056 * @atomicservice 14057 * @since 19 14058 */ 14059 readonly type: MetadataObjectType; 14060 /** 14061 * Metadata object timestamp in milliseconds. 14062 * 14063 * @type { number } 14064 * @readonly 14065 * @syscap SystemCapability.Multimedia.Camera.Core 14066 * @since 10 14067 */ 14068 /** 14069 * Metadata object timestamp in milliseconds. 14070 * 14071 * @type { number } 14072 * @readonly 14073 * @syscap SystemCapability.Multimedia.Camera.Core 14074 * @atomicservice 14075 * @since 19 14076 */ 14077 readonly timestamp: number; 14078 /** 14079 * The axis-aligned bounding box of detected metadata object. 14080 * 14081 * @type { Rect } 14082 * @readonly 14083 * @syscap SystemCapability.Multimedia.Camera.Core 14084 * @since 10 14085 */ 14086 /** 14087 * The axis-aligned bounding box of detected metadata object. 14088 * 14089 * @type { Rect } 14090 * @readonly 14091 * @syscap SystemCapability.Multimedia.Camera.Core 14092 * @atomicservice 14093 * @since 19 14094 */ 14095 readonly boundingBox: Rect; 14096 /** 14097 * Metadata object id. 14098 * 14099 * @type { number } 14100 * @readonly 14101 * @syscap SystemCapability.Multimedia.Camera.Core 14102 * @systemapi 14103 * @since 13 14104 */ 14105 readonly objectId: number; 14106 /** 14107 * Confidence for the detected type. 14108 * 14109 * @type { number } 14110 * @readonly 14111 * @syscap SystemCapability.Multimedia.Camera.Core 14112 * @systemapi 14113 * @since 13 14114 */ 14115 readonly confidence: number; 14116 } 14117 14118 /** 14119 * Metadata object for face. 14120 * 14121 * @typedef MetadataFaceObject 14122 * @extends MetadataObject 14123 * @syscap SystemCapability.Multimedia.Camera.Core 14124 * @systemapi 14125 * @since 13 14126 */ 14127 interface MetadataFaceObject extends MetadataObject { 14128 /** 14129 * Bounding box for left eye. 14130 * 14131 * @type { Rect } 14132 * @readonly 14133 * @syscap SystemCapability.Multimedia.Camera.Core 14134 * @systemapi 14135 * @since 13 14136 */ 14137 readonly leftEyeBoundingBox: Rect; 14138 14139 /** 14140 * Bounding box for right eye. 14141 * 14142 * @type { Rect } 14143 * @readonly 14144 * @syscap SystemCapability.Multimedia.Camera.Core 14145 * @systemapi 14146 * @since 13 14147 */ 14148 readonly rightEyeBoundingBox: Rect; 14149 14150 /** 14151 * Emotion type for face. 14152 * 14153 * @type { Emotion } 14154 * @readonly 14155 * @syscap SystemCapability.Multimedia.Camera.Core 14156 * @systemapi 14157 * @since 13 14158 */ 14159 readonly emotion: Emotion; 14160 14161 /** 14162 * Emotion confidence. 14163 * 14164 * @type { number } 14165 * @readonly 14166 * @syscap SystemCapability.Multimedia.Camera.Core 14167 * @systemapi 14168 * @since 13 14169 */ 14170 readonly emotionConfidence: number; 14171 14172 /** 14173 * Pitch angle for face. 14174 * 14175 * @type { number } 14176 * @readonly 14177 * @syscap SystemCapability.Multimedia.Camera.Core 14178 * @systemapi 14179 * @since 13 14180 */ 14181 readonly pitchAngle: number; 14182 14183 /** 14184 * Yaw angle for face. 14185 * 14186 * @type { number } 14187 * @readonly 14188 * @syscap SystemCapability.Multimedia.Camera.Core 14189 * @systemapi 14190 * @since 13 14191 */ 14192 readonly yawAngle: number; 14193 14194 /** 14195 * Roll angle for face. 14196 * 14197 * @type { number } 14198 * @readonly 14199 * @syscap SystemCapability.Multimedia.Camera.Core 14200 * @systemapi 14201 * @since 13 14202 */ 14203 readonly rollAngle: number; 14204 } 14205 14206 /** 14207 * Metadata object for human body. 14208 * 14209 * @typedef MetadataHumanBodyObject 14210 * @extends MetadataObject 14211 * @syscap SystemCapability.Multimedia.Camera.Core 14212 * @systemapi 14213 * @since 13 14214 */ 14215 interface MetadataHumanBodyObject extends MetadataObject { 14216 } 14217 14218 /** 14219 * Metadata object for cat face. 14220 * 14221 * @typedef MetadataCatFaceObject 14222 * @extends MetadataObject 14223 * @syscap SystemCapability.Multimedia.Camera.Core 14224 * @systemapi 14225 * @since 13 14226 */ 14227 interface MetadataCatFaceObject extends MetadataObject { 14228 /** 14229 * Bounding box for left eye. 14230 * 14231 * @type { Rect } 14232 * @readonly 14233 * @syscap SystemCapability.Multimedia.Camera.Core 14234 * @systemapi 14235 * @since 13 14236 */ 14237 readonly leftEyeBoundingBox: Rect; 14238 14239 /** 14240 * Bounding box for right eye. 14241 * 14242 * @type { Rect } 14243 * @readonly 14244 * @syscap SystemCapability.Multimedia.Camera.Core 14245 * @systemapi 14246 * @since 13 14247 */ 14248 readonly rightEyeBoundingBox: Rect; 14249 } 14250 14251 /** 14252 * Metadata object for cat body. 14253 * 14254 * @typedef MetadataCatBodyObject 14255 * @extends MetadataObject 14256 * @syscap SystemCapability.Multimedia.Camera.Core 14257 * @systemapi 14258 * @since 13 14259 */ 14260 interface MetadataCatBodyObject extends MetadataObject { 14261 } 14262 14263 /** 14264 * Metadata object for dog face. 14265 * 14266 * @typedef MetadataDogFaceObject 14267 * @extends MetadataObject 14268 * @syscap SystemCapability.Multimedia.Camera.Core 14269 * @systemapi 14270 * @since 13 14271 */ 14272 interface MetadataDogFaceObject extends MetadataObject { 14273 /** 14274 * Bounding box for left eye. 14275 * 14276 * @type { Rect } 14277 * @readonly 14278 * @syscap SystemCapability.Multimedia.Camera.Core 14279 * @systemapi 14280 * @since 13 14281 */ 14282 readonly leftEyeBoundingBox: Rect; 14283 14284 /** 14285 * Bounding box for right eye. 14286 * 14287 * @type { Rect } 14288 * @readonly 14289 * @syscap SystemCapability.Multimedia.Camera.Core 14290 * @systemapi 14291 * @since 13 14292 */ 14293 readonly rightEyeBoundingBox: Rect; 14294 } 14295 14296 /** 14297 * Metadata object for dog body. 14298 * 14299 * @typedef MetadataDogBodyObject 14300 * @extends MetadataObject 14301 * @syscap SystemCapability.Multimedia.Camera.Core 14302 * @systemapi 14303 * @since 13 14304 */ 14305 interface MetadataDogBodyObject extends MetadataObject { 14306 } 14307 14308 /** 14309 * Metadata object for salient detection. 14310 * 14311 * @typedef MetadataSalientDetectionObject 14312 * @extends MetadataObject 14313 * @syscap SystemCapability.Multimedia.Camera.Core 14314 * @systemapi 14315 * @since 13 14316 */ 14317 interface MetadataSalientDetectionObject extends MetadataObject { 14318 } 14319 14320 /** 14321 * Metadata object for barcode. 14322 * 14323 * @extends MetadataObject 14324 * @typedef MetadataBarcodeObject 14325 * @syscap SystemCapability.Multimedia.Camera.Core 14326 * @systemapi 14327 * @since 14 14328 */ 14329 interface MetadataBarcodeObject extends MetadataObject { 14330 } 14331 14332 /** 14333 * Camera Occlusion Detection Result. 14334 * 14335 * @typedef CameraOcclusionDetectionResult 14336 * @syscap SystemCapability.Multimedia.Camera.Core 14337 * @systemapi 14338 * @since 12 14339 */ 14340 interface CameraOcclusionDetectionResult { 14341 /** 14342 * Check whether camera is occluded. 14343 * 14344 * @type { boolean } 14345 * @readonly 14346 * @syscap SystemCapability.Multimedia.Camera.Core 14347 * @systemapi 14348 * @since 12 14349 */ 14350 readonly isCameraOccluded: boolean; 14351 14352 /** 14353 * Check whether camera lens is dirty. 14354 * 14355 * @type { boolean } 14356 * @readonly 14357 * @syscap SystemCapability.Multimedia.Camera.Core 14358 * @systemapi 14359 * @since 13 14360 */ 14361 readonly isCameraLensDirty: boolean; 14362 } 14363 14364 /** 14365 * Metadata Output object 14366 * 14367 * @extends CameraOutput 14368 * @interface MetadataOutput 14369 * @syscap SystemCapability.Multimedia.Camera.Core 14370 * @since 10 14371 */ 14372 /** 14373 * Metadata Output object 14374 * 14375 * @extends CameraOutput 14376 * @interface MetadataOutput 14377 * @syscap SystemCapability.Multimedia.Camera.Core 14378 * @atomicservice 14379 * @since 19 14380 */ 14381 interface MetadataOutput extends CameraOutput { 14382 /** 14383 * Start output metadata 14384 * 14385 * @param { AsyncCallback<void> } callback - Callback used to return the result. 14386 * @throws { BusinessError } 7400103 - Session not config. 14387 * @throws { BusinessError } 7400201 - Camera service fatal error. 14388 * @syscap SystemCapability.Multimedia.Camera.Core 14389 * @since 10 14390 */ 14391 /** 14392 * Start output metadata 14393 * 14394 * @param { AsyncCallback<void> } callback - Callback used to return the result. 14395 * @throws { BusinessError } 7400103 - Session not config. 14396 * @throws { BusinessError } 7400201 - Camera service fatal error. 14397 * @syscap SystemCapability.Multimedia.Camera.Core 14398 * @atomicservice 14399 * @since 19 14400 */ 14401 start(callback: AsyncCallback<void>): void; 14402 14403 /** 14404 * Start output metadata 14405 * 14406 * @returns { Promise<void> } Promise used to return the result. 14407 * @throws { BusinessError } 7400103 - Session not config. 14408 * @throws { BusinessError } 7400201 - Camera service fatal error. 14409 * @syscap SystemCapability.Multimedia.Camera.Core 14410 * @since 10 14411 */ 14412 /** 14413 * Start output metadata 14414 * 14415 * @returns { Promise<void> } Promise used to return the result. 14416 * @throws { BusinessError } 7400103 - Session not config. 14417 * @throws { BusinessError } 7400201 - Camera service fatal error. 14418 * @syscap SystemCapability.Multimedia.Camera.Core 14419 * @atomicservice 14420 * @since 19 14421 */ 14422 start(): Promise<void>; 14423 14424 /** 14425 * Stop output metadata 14426 * 14427 * @param { AsyncCallback<void> } callback - Callback used to return the result. 14428 * @syscap SystemCapability.Multimedia.Camera.Core 14429 * @since 10 14430 */ 14431 /** 14432 * Stop output metadata 14433 * 14434 * @param { AsyncCallback<void> } callback - Callback used to return the result. 14435 * @syscap SystemCapability.Multimedia.Camera.Core 14436 * @atomicservice 14437 * @since 19 14438 */ 14439 stop(callback: AsyncCallback<void>): void; 14440 14441 /** 14442 * Stop output metadata 14443 * 14444 * @returns { Promise<void> } Promise used to return the result. 14445 * @syscap SystemCapability.Multimedia.Camera.Core 14446 * @since 10 14447 */ 14448 /** 14449 * Stop output metadata 14450 * 14451 * @returns { Promise<void> } Promise used to return the result. 14452 * @syscap SystemCapability.Multimedia.Camera.Core 14453 * @atomicservice 14454 * @since 19 14455 */ 14456 stop(): Promise<void>; 14457 14458 /** 14459 * Add metadata object types. 14460 * 14461 * @param { Array<MetadataObjectType> } types - Object types to be added. 14462 * @throws { BusinessError } 202 - Not System Application. 14463 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 14464 * @throws { BusinessError } 7400103 - Session not config. 14465 * @throws { BusinessError } 7400201 - Camera service fatal error. 14466 * @syscap SystemCapability.Multimedia.Camera.Core 14467 * @systemapi 14468 * @since 13 14469 */ 14470 addMetadataObjectTypes(types: Array<MetadataObjectType>): void; 14471 14472 /** 14473 * Remove metadata object types. 14474 * 14475 * @param { Array<MetadataObjectType> } types - Object types to be removed. 14476 * @throws { BusinessError } 202 - Not System Application. 14477 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 14478 * @throws { BusinessError } 7400103 - Session not config. 14479 * @throws { BusinessError } 7400201 - Camera service fatal error. 14480 * @syscap SystemCapability.Multimedia.Camera.Core 14481 * @systemapi 14482 * @since 13 14483 */ 14484 removeMetadataObjectTypes(types: Array<MetadataObjectType>): void; 14485 14486 /** 14487 * Subscribes to metadata objects available event callback. 14488 * 14489 * @param { 'metadataObjectsAvailable' } type - Event type. 14490 * @param { AsyncCallback<Array<MetadataObject>> } callback - Callback used to get the available metadata objects. 14491 * @syscap SystemCapability.Multimedia.Camera.Core 14492 * @since 10 14493 */ 14494 /** 14495 * Registers a listener for the detected metadata object to get the result by registering 14496 * a callback function. This API uses an asynchronous callback to return the result. 14497 * 14498 * Description: Currently, it is not allowed to use off() to unregister the callback 14499 * within the callback method of on(). 14500 * 14501 * @param { 'metadataObjectsAvailable' } type - Event type. 14502 * @param { AsyncCallback<Array<MetadataObject>> } callback - Callback used to get the available metadata objects. 14503 * @syscap SystemCapability.Multimedia.Camera.Core 14504 * @atomicservice 14505 * @since 19 14506 */ 14507 on(type: 'metadataObjectsAvailable', callback: AsyncCallback<Array<MetadataObject>>): void; 14508 14509 /** 14510 * Unsubscribes from metadata objects available event callback. 14511 * 14512 * @param { 'metadataObjectsAvailable' } type - Event type. 14513 * @param { AsyncCallback<Array<MetadataObject>> } callback - Callback used to get the available metadata objects. 14514 * @syscap SystemCapability.Multimedia.Camera.Core 14515 * @since 10 14516 */ 14517 /** 14518 * Unsubscribes from metadata objects available event callback. 14519 * 14520 * @param { 'metadataObjectsAvailable' } type - Event type. 14521 * @param { AsyncCallback<Array<MetadataObject>> } callback - Callback used to get the available metadata objects. 14522 * @syscap SystemCapability.Multimedia.Camera.Core 14523 * @atomicservice 14524 * @since 19 14525 */ 14526 off(type: 'metadataObjectsAvailable', callback?: AsyncCallback<Array<MetadataObject>>): void; 14527 14528 /** 14529 * Subscribes to error events. 14530 * 14531 * @param { 'error' } type - Event type. 14532 * @param { ErrorCallback } callback - Callback used to get the video output errors. 14533 * @syscap SystemCapability.Multimedia.Camera.Core 14534 * @since 10 14535 */ 14536 /** 14537 * Registers a listener for errors in the video output to get the result by registering 14538 * a callback function. This API uses an asynchronous callback to return the result. 14539 * 14540 * Description: Currently, it is not allowed to use off() to unregister the callback 14541 * within the callback method of on(). 14542 * 14543 * @param { 'error' } type - Event type. 14544 * @param { ErrorCallback } callback - Callback used to get the video output errors. 14545 * @syscap SystemCapability.Multimedia.Camera.Core 14546 * @atomicservice 14547 * @since 19 14548 */ 14549 on(type: 'error', callback: ErrorCallback): void; 14550 14551 /** 14552 * Unsubscribes from error events. 14553 * 14554 * @param { 'error' } type - Event type. 14555 * @param { ErrorCallback } callback - Callback used to get the video output errors. 14556 * @syscap SystemCapability.Multimedia.Camera.Core 14557 * @since 10 14558 */ 14559 /** 14560 * Unsubscribes from error events. 14561 * 14562 * @param { 'error' } type - Event type. 14563 * @param { ErrorCallback } callback - Callback used to get the video output errors. 14564 * @syscap SystemCapability.Multimedia.Camera.Core 14565 * @atomicservice 14566 * @since 19 14567 */ 14568 off(type: 'error', callback?: ErrorCallback): void; 14569 } 14570 14571 /** 14572 * Enum for camera concurrent type. 14573 * 14574 * @enum { number } 14575 * @syscap SystemCapability.Multimedia.Camera.Core 14576 * @since 18 14577 */ 14578 /** 14579 * Enum for camera concurrent type. 14580 * 14581 * @enum { number } 14582 * @syscap SystemCapability.Multimedia.Camera.Core 14583 * @atomicservice 14584 * @since 19 14585 */ 14586 enum CameraConcurrentType { 14587 /** 14588 * Cameras concurrency with limited capabilities. 14589 * 14590 * @syscap SystemCapability.Multimedia.Camera.Core 14591 * @since 18 14592 */ 14593 /** 14594 * Cameras concurrency with limited capabilities. 14595 * 14596 * @syscap SystemCapability.Multimedia.Camera.Core 14597 * @atomicservice 14598 * @since 19 14599 */ 14600 CAMERA_LIMITED_CAPABILITY = 0, 14601 14602 /** 14603 * Cameras concurrency with full capabilities. 14604 * 14605 * @syscap SystemCapability.Multimedia.Camera.Core 14606 * @since 18 14607 */ 14608 /** 14609 * Cameras concurrency with full capabilities. 14610 * 14611 * @syscap SystemCapability.Multimedia.Camera.Core 14612 * @atomicservice 14613 * @since 19 14614 */ 14615 CAMERA_FULL_CAPABILITY = 1, 14616 } 14617 14618 /** 14619 * Camera concurrent information. 14620 * 14621 * @interface CameraConcurrentInfo 14622 * @syscap SystemCapability.Multimedia.Camera.Core 14623 * @since 18 14624 */ 14625 /** 14626 * Camera concurrent information. 14627 * 14628 * @interface CameraConcurrentInfo 14629 * @syscap SystemCapability.Multimedia.Camera.Core 14630 * @atomicservice 14631 * @since 19 14632 */ 14633 interface CameraConcurrentInfo { 14634 /** 14635 * Camera instance. 14636 * 14637 * @type { CameraDevice } 14638 * @readonly 14639 * @syscap SystemCapability.Multimedia.Camera.Core 14640 * @since 18 14641 */ 14642 /** 14643 * Camera instance. 14644 * 14645 * @type { CameraDevice } 14646 * @readonly 14647 * @syscap SystemCapability.Multimedia.Camera.Core 14648 * @atomicservice 14649 * @since 19 14650 */ 14651 readonly device: CameraDevice; 14652 14653 /** 14654 * Camera concurrent type. 14655 * 14656 * @type { CameraConcurrentType } 14657 * @readonly 14658 * @syscap SystemCapability.Multimedia.Camera.Core 14659 * @since 18 14660 */ 14661 /** 14662 * Camera concurrent type. 14663 * 14664 * @type { CameraConcurrentType } 14665 * @readonly 14666 * @syscap SystemCapability.Multimedia.Camera.Core 14667 * @atomicservice 14668 * @since 19 14669 */ 14670 readonly type: CameraConcurrentType; 14671 14672 /** 14673 * Supported scene modes. 14674 * 14675 * @type { Array<SceneMode> } 14676 * @readonly 14677 * @syscap SystemCapability.Multimedia.Camera.Core 14678 * @since 18 14679 */ 14680 /** 14681 * Supported scene modes. 14682 * 14683 * @type { Array<SceneMode> } 14684 * @readonly 14685 * @syscap SystemCapability.Multimedia.Camera.Core 14686 * @atomicservice 14687 * @since 19 14688 */ 14689 readonly modes: Array<SceneMode>; 14690 14691 /** 14692 * Supported outputCapability. 14693 * 14694 * @type { Array<CameraOutputCapability> } 14695 * @readonly 14696 * @syscap SystemCapability.Multimedia.Camera.Core 14697 * @since 18 14698 */ 14699 /** 14700 * Supported outputCapability. 14701 * 14702 * @type { Array<CameraOutputCapability> } 14703 * @readonly 14704 * @syscap SystemCapability.Multimedia.Camera.Core 14705 * @atomicservice 14706 * @since 19 14707 */ 14708 readonly outputCapabilities: Array<CameraOutputCapability>; 14709 } 14710 14711 /** 14712 * Enumerates the timelapse recording state. 14713 * 14714 * @enum { number } 14715 * @syscap SystemCapability.Multimedia.Camera.Core 14716 * @systemapi 14717 * @since 12 14718 */ 14719 enum TimeLapseRecordState { 14720 /** 14721 * TimeLapse idle state. 14722 * 14723 * @syscap SystemCapability.Multimedia.Camera.Core 14724 * @systemapi 14725 * @since 12 14726 */ 14727 IDLE = 0, 14728 14729 /** 14730 * TimeLapse recording state. 14731 * 14732 * @syscap SystemCapability.Multimedia.Camera.Core 14733 * @systemapi 14734 * @since 12 14735 */ 14736 RECORDING = 1 14737 } 14738 14739 /** 14740 * Enumerates the timelapse preview type. 14741 * 14742 * @enum { number } 14743 * @syscap SystemCapability.Multimedia.Camera.Core 14744 * @systemapi 14745 * @since 12 14746 */ 14747 enum TimeLapsePreviewType { 14748 /** 14749 * TimeLapse dark preview. 14750 * 14751 * @syscap SystemCapability.Multimedia.Camera.Core 14752 * @systemapi 14753 * @since 12 14754 */ 14755 DARK = 1, 14756 14757 /** 14758 * TimeLapse Light preview. 14759 * 14760 * @syscap SystemCapability.Multimedia.Camera.Core 14761 * @systemapi 14762 * @since 12 14763 */ 14764 LIGHT = 2 14765 } 14766 14767 /** 14768 * Try AE information. 14769 * 14770 * @typedef TryAEInfo 14771 * @syscap SystemCapability.Multimedia.Camera.Core 14772 * @systemapi 14773 * @since 12 14774 */ 14775 interface TryAEInfo { 14776 /** 14777 * Determine whether try AE is done. 14778 * 14779 * @type { boolean } 14780 * @readonly 14781 * @syscap SystemCapability.Multimedia.Camera.Core 14782 * @systemapi 14783 * @since 12 14784 */ 14785 readonly isTryAEDone: boolean; 14786 14787 /** 14788 * Determine whether AE hint is needed. 14789 * 14790 * @type { ?boolean } 14791 * @readonly 14792 * @syscap SystemCapability.Multimedia.Camera.Core 14793 * @systemapi 14794 * @since 12 14795 */ 14796 readonly isTryAEHintNeeded?: boolean; 14797 14798 /** 14799 * Timelapse preview type. 14800 * 14801 * @type { ?TimeLapsePreviewType } 14802 * @readonly 14803 * @syscap SystemCapability.Multimedia.Camera.Core 14804 * @systemapi 14805 * @since 12 14806 */ 14807 readonly previewType?: TimeLapsePreviewType; 14808 14809 /** 14810 * Timelapse capture interval. 14811 * 14812 * @type { ?number } 14813 * @readonly 14814 * @syscap SystemCapability.Multimedia.Camera.Core 14815 * @systemapi 14816 * @since 12 14817 */ 14818 readonly captureInterval?: number; 14819 } 14820 14821 /** 14822 * Timelapse photo session object. 14823 * 14824 * @extends Session, Focus, ManualFocus, AutoExposure, ManualExposure, ManualIso, WhiteBalance, Zoom, ColorEffect 14825 * @interface TimeLapsePhotoSession 14826 * @syscap SystemCapability.Multimedia.Camera.Core 14827 * @systemapi 14828 * @since 12 14829 */ 14830 interface TimeLapsePhotoSession extends Session, Focus, ManualFocus, AutoExposure, ManualExposure, ManualIso, WhiteBalance, Zoom, ColorEffect { 14831 /** 14832 * Subscribes to error events. 14833 * 14834 * @param { 'error' } type - Event type. 14835 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 14836 * @throws { BusinessError } 202 - Not System Application. 14837 * @syscap SystemCapability.Multimedia.Camera.Core 14838 * @systemapi 14839 * @since 12 14840 */ 14841 on(type: 'error', callback: ErrorCallback): void; 14842 14843 /** 14844 * Unsubscribes from error events. 14845 * 14846 * @param { 'error' } type - Event type. 14847 * @param { ErrorCallback } callback - Callback used to get the capture session errors. 14848 * @throws { BusinessError } 202 - Not System Application. 14849 * @syscap SystemCapability.Multimedia.Camera.Core 14850 * @systemapi 14851 * @since 12 14852 */ 14853 off(type: 'error', callback?: ErrorCallback): void; 14854 14855 /** 14856 * Subscribes focus state change event callback. 14857 * 14858 * @param { 'focusStateChange' } type - Event type. 14859 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 14860 * @throws { BusinessError } 202 - Not System Application. 14861 * @syscap SystemCapability.Multimedia.Camera.Core 14862 * @systemapi 14863 * @since 12 14864 */ 14865 on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; 14866 14867 /** 14868 * Unsubscribes from focus state change event callback. 14869 * 14870 * @param { 'focusStateChange' } type - Event type. 14871 * @param { AsyncCallback<FocusState> } callback - Callback used to get the focus state change. 14872 * @throws { BusinessError } 202 - Not System Application. 14873 * @syscap SystemCapability.Multimedia.Camera.Core 14874 * @systemapi 14875 * @since 12 14876 */ 14877 off(type: 'focusStateChange', callback?: AsyncCallback<FocusState>): void; 14878 14879 /** 14880 * Subscribes ISO info event callback. 14881 * 14882 * @param { 'isoInfoChange' } type - Event type. 14883 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 14884 * @throws { BusinessError } 202 - Not System Application. 14885 * @syscap SystemCapability.Multimedia.Camera.Core 14886 * @systemapi 14887 * @since 12 14888 */ 14889 on(type: 'isoInfoChange', callback: AsyncCallback<IsoInfo>): void; 14890 14891 /** 14892 * Unsubscribes from ISO info event callback. 14893 * 14894 * @param { 'isoInfoChange' } type - Event type. 14895 * @param { AsyncCallback<IsoInfo> } callback - Callback used to get the ISO info. 14896 * @throws { BusinessError } 202 - Not System Application. 14897 * @syscap SystemCapability.Multimedia.Camera.Core 14898 * @systemapi 14899 * @since 12 14900 */ 14901 off(type: 'isoInfoChange', callback?: AsyncCallback<IsoInfo>): void; 14902 14903 /** 14904 * Subscribes exposure info event callback. 14905 * 14906 * @param { 'exposureInfoChange' } type - Event type. 14907 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 14908 * @throws { BusinessError } 202 - Not System Application. 14909 * @syscap SystemCapability.Multimedia.Camera.Core 14910 * @systemapi 14911 * @since 12 14912 */ 14913 on(type: 'exposureInfoChange', callback: AsyncCallback<ExposureInfo>): void; 14914 14915 /** 14916 * Unsubscribes from exposure info event callback. 14917 * 14918 * @param { 'exposureInfoChange' } type - Event type. 14919 * @param { AsyncCallback<ExposureInfo> } callback - Callback used to get the exposure info. 14920 * @throws { BusinessError } 202 - Not System Application. 14921 * @syscap SystemCapability.Multimedia.Camera.Core 14922 * @systemapi 14923 * @since 12 14924 */ 14925 off(type: 'exposureInfoChange', callback?: AsyncCallback<ExposureInfo>): void; 14926 14927 /** 14928 * Subscribes lumination info event callback. 14929 * 14930 * @param { 'luminationInfoChange' } type - Event type. 14931 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 14932 * @throws { BusinessError } 202 - Not System Application. 14933 * @syscap SystemCapability.Multimedia.Camera.Core 14934 * @systemapi 14935 * @since 12 14936 */ 14937 on(type: 'luminationInfoChange', callback: AsyncCallback<LuminationInfo>): void; 14938 14939 /** 14940 * Unsubscribes from lumination info event callback. 14941 * 14942 * @param { 'luminationInfoChange' } type - Event type. 14943 * @param { AsyncCallback<LuminationInfo> } callback - Callback used to get the lumination info. 14944 * @throws { BusinessError } 202 - Not System Application. 14945 * @syscap SystemCapability.Multimedia.Camera.Core 14946 * @systemapi 14947 * @since 12 14948 */ 14949 off(type: 'luminationInfoChange', callback?: AsyncCallback<LuminationInfo>): void; 14950 14951 /** 14952 * Check whether try AE is needed. 14953 * 14954 * @returns { boolean } Is try AE needed. 14955 * @throws { BusinessError } 202 - Not System Application. 14956 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 14957 * @syscap SystemCapability.Multimedia.Camera.Core 14958 * @systemapi 14959 * @since 12 14960 */ 14961 isTryAENeeded(): boolean; 14962 14963 /** 14964 * Start try AE. 14965 * 14966 * @throws { BusinessError } 202 - Not System Application. 14967 * @throws { BusinessError } 7400103 - Session not config. 14968 * @throws { BusinessError } 7400201 - Camera service fatal error. 14969 * @syscap SystemCapability.Multimedia.Camera.Core 14970 * @systemapi 14971 * @since 12 14972 */ 14973 startTryAE(): void; 14974 14975 /** 14976 * Stop try AE. 14977 * 14978 * @throws { BusinessError } 202 - Not System Application. 14979 * @throws { BusinessError } 7400103 - Session not config. 14980 * @throws { BusinessError } 7400201 - Camera service fatal error. 14981 * @syscap SystemCapability.Multimedia.Camera.Core 14982 * @systemapi 14983 * @since 12 14984 */ 14985 stopTryAE(): void; 14986 14987 /** 14988 * Subscribes try AE info event callback. 14989 * 14990 * @param { 'tryAEInfoChange' } type - Event type. 14991 * @param { AsyncCallback<TryAEInfo> } callback - Callback used to get the try AE info. 14992 * @throws { BusinessError } 202 - Not System Application. 14993 * @syscap SystemCapability.Multimedia.Camera.Core 14994 * @systemapi 14995 * @since 12 14996 */ 14997 on(type: 'tryAEInfoChange', callback: AsyncCallback<TryAEInfo>): void; 14998 14999 /** 15000 * Unsubscribes from try AE info event callback. 15001 * 15002 * @param { 'tryAEInfoChange' } type - Event type. 15003 * @param { AsyncCallback<TryAEInfo> } callback - Callback used to get the try AE info. 15004 * @throws { BusinessError } 202 - Not System Application. 15005 * @syscap SystemCapability.Multimedia.Camera.Core 15006 * @systemapi 15007 * @since 12 15008 */ 15009 off(type: 'tryAEInfoChange', callback?: AsyncCallback<TryAEInfo>): void; 15010 15011 /** 15012 * Gets supported timelapse interval range. 15013 * 15014 * @returns { Array<number> } Timelapse interval range. 15015 * @throws { BusinessError } 202 - Not System Application. 15016 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 15017 * @syscap SystemCapability.Multimedia.Camera.Core 15018 * @systemapi 15019 * @since 12 15020 */ 15021 getSupportedTimeLapseIntervalRange(): Array<number>; 15022 15023 /** 15024 * Gets the timelapse interval in use. 15025 * 15026 * @returns { number } the timelapse interval in use. 15027 * @throws { BusinessError } 202 - Not System Application. 15028 * @throws { BusinessError } 7400103 - Session not config. 15029 * @syscap SystemCapability.Multimedia.Camera.Core 15030 * @systemapi 15031 * @since 12 15032 */ 15033 getTimeLapseInterval(): number; 15034 15035 /** 15036 * Sets a timelapse interval for a camera device. 15037 * 15038 * @param { number } interval The timelapse interval. 15039 * @throws { BusinessError } 202 - Not System Application. 15040 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 15041 * @throws { BusinessError } 7400103 - Session not config. 15042 * @syscap SystemCapability.Multimedia.Camera.Core 15043 * @systemapi 15044 * @since 12 15045 */ 15046 setTimeLapseInterval(interval: number): void; 15047 15048 /** 15049 * Gets the timelapse recording state in use. 15050 * 15051 * @returns { TimeLapseRecordState } the timelapse recording state in use. 15052 * @throws { BusinessError } 202 - Not System Application. 15053 * @throws { BusinessError } 7400103 - Session not config. 15054 * @syscap SystemCapability.Multimedia.Camera.Core 15055 * @systemapi 15056 * @since 12 15057 */ 15058 getTimeLapseRecordState(): TimeLapseRecordState; 15059 15060 /** 15061 * Sets a timelapse recording state. 15062 * 15063 * @param { TimeLapseRecordState } state The timelapse recording state. 15064 * @throws { BusinessError } 202 - Not System Application. 15065 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 15066 * @throws { BusinessError } 7400103 - Session not config. 15067 * @syscap SystemCapability.Multimedia.Camera.Core 15068 * @systemapi 15069 * @since 12 15070 */ 15071 setTimeLapseRecordState(state: TimeLapseRecordState): void; 15072 15073 /** 15074 * Gets the timelapse preview type in use. 15075 * 15076 * @returns { TimeLapsePreviewType } the timelapse preview type in use. 15077 * @throws { BusinessError } 202 - Not System Application. 15078 * @throws { BusinessError } 7400103 - Session not config. 15079 * @syscap SystemCapability.Multimedia.Camera.Core 15080 * @systemapi 15081 * @since 12 15082 */ 15083 getTimeLapsePreviewType(): TimeLapsePreviewType; 15084 15085 /** 15086 * Sets a timelapse preview type. 15087 * 15088 * @param { TimeLapsePreviewType } type The timelapse preview type. 15089 * @throws { BusinessError } 202 - Not System Application. 15090 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 15091 * @throws { BusinessError } 7400103 - Session not config. 15092 * @syscap SystemCapability.Multimedia.Camera.Core 15093 * @systemapi 15094 * @since 12 15095 */ 15096 setTimeLapsePreviewType(type: TimeLapsePreviewType): void; 15097 } 15098 15099 /** 15100 * Control center session object. 15101 * 15102 * @extends Beauty, Aperture 15103 * @interface ControlCenterSession 15104 * @syscap SystemCapability.Multimedia.Camera.Core 15105 * @systemapi 15106 * @since 20 15107 */ 15108 interface ControlCenterSession extends Beauty, Aperture { 15109 /** 15110 * Release control center session object. 15111 * 15112 * @returns { Promise<void> } Promise used to return the result. 15113 * @throws { BusinessError } 202 - Not System Application. 15114 * @syscap SystemCapability.Multimedia.Camera.Core 15115 * @systemapi 15116 * @since 20 15117 */ 15118 release(): Promise<void>; 15119 } 15120 15121 /** 15122 * Enum for Depth Data Accuracy. 15123 * 15124 * @enum { number } 15125 * @syscap SystemCapability.Multimedia.Camera.Core 15126 * @systemapi 15127 * @since 13 15128 */ 15129 enum DepthDataAccuracy { 15130 /** 15131 * Relative accuracy depth data. 15132 * 15133 * @syscap SystemCapability.Multimedia.Camera.Core 15134 * @systemapi 15135 * @since 13 15136 */ 15137 DEPTH_DATA_ACCURACY_RELATIVE = 0, 15138 15139 /** 15140 * Absolute accuracy depth data. 15141 * 15142 * @syscap SystemCapability.Multimedia.Camera.Core 15143 * @systemapi 15144 * @since 13 15145 */ 15146 DEPTH_DATA_ACCURACY_ABSOLUTE = 1 15147 } 15148 15149 /** 15150 * Enum for Depth Data Quality Level. 15151 * 15152 * @enum { number } 15153 * @syscap SystemCapability.Multimedia.Camera.Core 15154 * @systemapi 15155 * @since 13 15156 */ 15157 enum DepthDataQualityLevel { 15158 /** 15159 * Depth data quality is bad. 15160 * 15161 * @syscap SystemCapability.Multimedia.Camera.Core 15162 * @systemapi 15163 * @since 13 15164 */ 15165 DEPTH_DATA_QUALITY_BAD = 0, 15166 15167 /** 15168 * Depth data quality is fair. 15169 * 15170 * @syscap SystemCapability.Multimedia.Camera.Core 15171 * @systemapi 15172 * @since 13 15173 */ 15174 DEPTH_DATA_QUALITY_FAIR = 1, 15175 15176 /** 15177 * Depth data quality is good. 15178 * 15179 * @syscap SystemCapability.Multimedia.Camera.Core 15180 * @systemapi 15181 * @since 13 15182 */ 15183 DEPTH_DATA_QUALITY_GOOD = 2 15184 } 15185 15186 /** 15187 * Depth Profile. 15188 * 15189 * @interface DepthProfile 15190 * @syscap SystemCapability.Multimedia.Camera.Core 15191 * @systemapi 15192 * @since 13 15193 */ 15194 interface DepthProfile { 15195 /** 15196 * Depth data format. 15197 * 15198 * @type { CameraFormat } 15199 * @readonly 15200 * @syscap SystemCapability.Multimedia.Camera.Core 15201 * @systemapi 15202 * @since 13 15203 */ 15204 readonly format: CameraFormat; 15205 15206 /** 15207 * Depth data accuracy. 15208 * 15209 * @type { DepthDataAccuracy } 15210 * @readonly 15211 * @syscap SystemCapability.Multimedia.Camera.Core 15212 * @systemapi 15213 * @since 13 15214 */ 15215 readonly dataAccuracy: DepthDataAccuracy; 15216 15217 /** 15218 * Depth data resolution. 15219 * 15220 * @type { Size } 15221 * @readonly 15222 * @syscap SystemCapability.Multimedia.Camera.Core 15223 * @systemapi 15224 * @since 13 15225 */ 15226 readonly size: Size; 15227 } 15228 15229 /** 15230 * Depth Data. 15231 * 15232 * @interface DepthData. 15233 * @syscap SystemCapability.Multimedia.Camera.Core 15234 * @systemapi 15235 * @since 13 15236 */ 15237 interface DepthData { 15238 /** 15239 * Depth data format. 15240 * 15241 * @type { CameraFormat } 15242 * @readonly 15243 * @syscap SystemCapability.Multimedia.Camera.Core 15244 * @systemapi 15245 * @since 13 15246 */ 15247 readonly format: CameraFormat; 15248 15249 /** 15250 * Depth data map. 15251 * 15252 * @type { image.PixelMap } 15253 * @readonly 15254 * @syscap SystemCapability.Multimedia.Camera.Core 15255 * @systemapi 15256 * @since 13 15257 */ 15258 readonly depthMap: image.PixelMap; 15259 15260 /** 15261 * Depth data quality level. 15262 * 15263 * @type { DepthDataQualityLevel } 15264 * @readonly 15265 * @syscap SystemCapability.Multimedia.Camera.Core 15266 * @systemapi 15267 * @since 13 15268 */ 15269 readonly qualityLevel: DepthDataQualityLevel; 15270 15271 /** 15272 * Depth data accuracy. 15273 * 15274 * @type { DepthDataAccuracy } 15275 * @readonly 15276 * @syscap SystemCapability.Multimedia.Camera.Core 15277 * @systemapi 15278 * @since 13 15279 */ 15280 readonly dataAccuracy: DepthDataAccuracy; 15281 15282 /** 15283 * Release depth data object. 15284 * 15285 * @returns { Promise<void> } Promise used to return the result. 15286 * @throws { BusinessError } 202 - Not System Application. 15287 * @syscap SystemCapability.Multimedia.Camera.Core 15288 * @systemapi 15289 * @since 13 15290 */ 15291 release(): Promise<void>; 15292 } 15293 15294 /** 15295 * Depth Data Output object 15296 * 15297 * @extends CameraOutput 15298 * @interface DepthDataOutput 15299 * @syscap SystemCapability.Multimedia.Camera.Core 15300 * @systemapi 15301 * @since 13 15302 */ 15303 interface DepthDataOutput extends CameraOutput { 15304 /** 15305 * Start depth data output. 15306 * 15307 * @returns { Promise<void> } Promise used to return the result. 15308 * @throws { BusinessError } 202 - Not System Application. 15309 * @throws { BusinessError } 7400103 - Session not config. 15310 * @throws { BusinessError } 7400201 - Camera service fatal error. 15311 * @syscap SystemCapability.Multimedia.Camera.Core 15312 * @systemapi 15313 * @since 13 15314 */ 15315 start(): Promise<void>; 15316 15317 /** 15318 * Stop depth data output. 15319 * 15320 * @returns { Promise<void> } Promise used to return the result. 15321 * @throws { BusinessError } 202 - Not System Application. 15322 * @throws { BusinessError } 7400103 - Session not config. 15323 * @throws { BusinessError } 7400201 - Camera service fatal error. 15324 * @syscap SystemCapability.Multimedia.Camera.Core 15325 * @systemapi 15326 * @since 13 15327 */ 15328 stop(): Promise<void>; 15329 15330 /** 15331 * Subscribes to depth data objects available event callback. 15332 * 15333 * @param { 'depthDataAvailable' } type - Event type. 15334 * @param { AsyncCallback<DepthData> } callback - Callback used to get the available DepthData objects. 15335 * @throws { BusinessError } 202 - Not System Application. 15336 * @syscap SystemCapability.Multimedia.Camera.Core 15337 * @systemapi 15338 * @since 13 15339 */ 15340 on(type: 'depthDataAvailable', callback: AsyncCallback<DepthData>): void; 15341 15342 /** 15343 * Unsubscribes from depth data objects available event callback. 15344 * 15345 * @param { 'depthDataAvailable' } type - Event type. 15346 * @param { AsyncCallback<DepthData> } callback - Callback used to get the available DepthData objects. 15347 * @throws { BusinessError } 202 - Not System Application. 15348 * @syscap SystemCapability.Multimedia.Camera.Core 15349 * @systemapi 15350 * @since 13 15351 */ 15352 off(type: 'depthDataAvailable', callback?: AsyncCallback<DepthData>): void; 15353 15354 /** 15355 * Subscribes to error events. 15356 * 15357 * @param { 'error' } type - Event type. 15358 * @param { ErrorCallback } callback - Callback used to get the video output errors. 15359 * @throws { BusinessError } 202 - Not System Application. 15360 * @syscap SystemCapability.Multimedia.Camera.Core 15361 * @systemapi 15362 * @since 13 15363 */ 15364 on(type: 'error', callback: ErrorCallback): void; 15365 15366 /** 15367 * Unsubscribes from error events. 15368 * 15369 * @param { 'error' } type - Event type. 15370 * @param { ErrorCallback } callback - Callback used to get the video output errors. 15371 * @throws { BusinessError } 202 - Not System Application. 15372 * @syscap SystemCapability.Multimedia.Camera.Core 15373 * @systemapi 15374 * @since 13 15375 */ 15376 off(type: 'error', callback?: ErrorCallback): void; 15377 } 15378 15379 /** 15380 * Depth Fusion Query object. 15381 * 15382 * @interface DepthFusionQuery 15383 * @syscap SystemCapability.Multimedia.Camera.Core 15384 * @systemapi 15385 * @since 14 15386 */ 15387 interface DepthFusionQuery { 15388 /** 15389 * Checks whether a depth fusion is supported. 15390 * 15391 * @returns { boolean } Is the depth fusion supported. 15392 * @throws { BusinessError } 202 - Not System Application. 15393 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 15394 * @syscap SystemCapability.Multimedia.Camera.Core 15395 * @systemapi 15396 * @since 14 15397 */ 15398 isDepthFusionSupported(): boolean; 15399 15400 /** 15401 * Query the depth fusion threshold. 15402 * 15403 * @returns { Array<number> } The depth fusion threshold. 15404 * @throws { BusinessError } 202 - Not System Application. 15405 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 15406 * @syscap SystemCapability.Multimedia.Camera.Core 15407 * @systemapi 15408 * @since 14 15409 */ 15410 getDepthFusionThreshold(): Array<number>; 15411 } 15412 15413 /** 15414 * Depth Fusion object. 15415 * 15416 * @extends DepthFusionQuery 15417 * @interface DepthFusion 15418 * @syscap SystemCapability.Multimedia.Camera.Core 15419 * @systemapi 15420 * @since 14 15421 */ 15422 interface DepthFusion extends DepthFusionQuery { 15423 /** 15424 * Confirm if the depth fusion enabled. 15425 * 15426 * @returns { boolean } TRUE if the depth fusion is enable. 15427 * @throws { BusinessError } 202 - Not System Application. 15428 * @throws { BusinessError } 7400103 - Session not config. 15429 * @syscap SystemCapability.Multimedia.Camera.Core 15430 * @systemapi 15431 * @since 14 15432 */ 15433 isDepthFusionEnabled(): boolean; 15434 15435 /** 15436 * Enable depth fusion. 15437 * 15438 * @param { boolean } enabled - Target state for depth fusion. 15439 * @throws { BusinessError } 202 - Not System Application. 15440 * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. 15441 * @throws { BusinessError } 7400103 - Session not config. 15442 * @throws { BusinessError } 7400201 - Camera service fatal error. 15443 * @syscap SystemCapability.Multimedia.Camera.Core 15444 * @systemapi 15445 * @since 14 15446 */ 15447 enableDepthFusion(enabled: boolean): void; 15448 } 15449 15450 /** 15451 * Enum for auxiliary type. 15452 * 15453 * @enum { number } 15454 * @syscap SystemCapability.Multimedia.Camera.Core 15455 * @systemapi 15456 * @since 18 15457 */ 15458 enum AuxiliaryType { 15459 /** 15460 * Contract lens. 15461 * 15462 * @syscap SystemCapability.Multimedia.Camera.Core 15463 * @systemapi 15464 * @since 18 15465 */ 15466 CONTRACT_LENS = 0 15467 } 15468 15469 /** 15470 * Enum for auxiliary status. 15471 * 15472 * @enum { number } 15473 * @syscap SystemCapability.Multimedia.Camera.Core 15474 * @systemapi 15475 * @since 18 15476 */ 15477 enum AuxiliaryStatus { 15478 /** 15479 * Auxiliary locked. 15480 * 15481 * @syscap SystemCapability.Multimedia.Camera.Core 15482 * @systemapi 15483 * @since 18 15484 */ 15485 LOCKED = 0, 15486 15487 /** 15488 * Turn on auxiliary. 15489 * 15490 * @syscap SystemCapability.Multimedia.Camera.Core 15491 * @systemapi 15492 * @since 18 15493 */ 15494 ON = 1, 15495 15496 /** 15497 * Turn off auxiliary. 15498 * 15499 * @syscap SystemCapability.Multimedia.Camera.Core 15500 * @systemapi 15501 * @since 18 15502 */ 15503 OFF = 2 15504 } 15505 15506 /** 15507 * Enum for color reservation type. 15508 * 15509 * @enum { number } 15510 * @syscap SystemCapability.Multimedia.Camera.Core 15511 * @systemapi 15512 * @since 15 15513 */ 15514 enum ColorReservationType { 15515 /** 15516 * None. 15517 * 15518 * @syscap SystemCapability.Multimedia.Camera.Core 15519 * @systemapi 15520 * @since 15 15521 */ 15522 NONE = 0, 15523 15524 /** 15525 * Portrait color reservation. 15526 * 15527 * @syscap SystemCapability.Multimedia.Camera.Core 15528 * @systemapi 15529 * @since 15 15530 */ 15531 PORTRAIT = 1 15532 } 15533 15534 /** 15535 * Color Reservation Query object. 15536 * 15537 * @interface ColorReservationQuery 15538 * @syscap SystemCapability.Multimedia.Camera.Core 15539 * @systemapi 15540 * @since 15 15541 */ 15542 interface ColorReservationQuery { 15543 /** 15544 * Gets supported color reservation types. 15545 * 15546 * @returns { Array<ColorReservationType> } Array of supported color reservation types. 15547 * @throws { BusinessError } 202 - Not System Application. 15548 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 15549 * @syscap SystemCapability.Multimedia.Camera.Core 15550 * @systemapi 15551 * @since 15 15552 */ 15553 getSupportedColorReservationTypes(): Array<ColorReservationType>; 15554 } 15555 15556 /** 15557 * Color Reservation object. 15558 * 15559 * @extends ColorReservationQuery 15560 * @interface ColorReservation 15561 * @syscap SystemCapability.Multimedia.Camera.Core 15562 * @systemapi 15563 * @since 15 15564 */ 15565 interface ColorReservation extends ColorReservationQuery { 15566 /** 15567 * Gets the current color reservation type. 15568 * 15569 * @returns { ColorReservationType } The current color reservation type. 15570 * @throws { BusinessError } 202 - Not System Application. 15571 * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. 15572 * @syscap SystemCapability.Multimedia.Camera.Core 15573 * @systemapi 15574 * @since 15 15575 */ 15576 getColorReservation(): ColorReservationType; 15577 15578 /** 15579 * Sets the color reservation type. 15580 * 15581 * @param { ColorReservationType } type - The color reservation type. 15582 * @throws { BusinessError } 202 - Not System Application. 15583 * @throws { BusinessError } 401 - Parameter error. Possible causes: 15584 * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 15585 * 3. Parameter verification failed. 15586 * @throws { BusinessError } 7400102 - Operation not allowed. 15587 * @throws { BusinessError } 7400103 - Session not config. 15588 * @throws { BusinessError } 7400201 - Camera service fatal error. 15589 * @syscap SystemCapability.Multimedia.Camera.Core 15590 * @systemapi 15591 * @since 15 15592 */ 15593 setColorReservation(type: ColorReservationType): void; 15594 } 15595 15596 /** 15597 * Quick thumbnail object 15598 * 15599 * @typedef QuickThumbnail 15600 * @syscap SystemCapability.Multimedia.Camera.Core 15601 * @systemapi 15602 * @since 19 15603 */ 15604 interface QuickThumbnail { 15605 /** 15606 * capture id. 15607 * 15608 * @type { number } 15609 * @syscap SystemCapability.Multimedia.Camera.Core 15610 * @systemapi 15611 * @since 19 15612 */ 15613 readonly captureId: number; 15614 15615 /** 15616 * Thumbnail image. 15617 * 15618 * @type { image.PixelMap } 15619 * @syscap SystemCapability.Multimedia.Camera.Core 15620 * @systemapi 15621 * @since 19 15622 */ 15623 thumbnailImage: image.PixelMap; 15624 15625 /** 15626 * Release quick thumbnail object. 15627 * 15628 * @returns { Promise<void> } Promise used to return the result. 15629 * @syscap SystemCapability.Multimedia.Camera.Core 15630 * @systemapi 15631 * @since 19 15632 */ 15633 release(): Promise<void>; 15634 } 15635} 15636 15637export default camera; 15638