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 ImageKit 19 */ 20 21import { AsyncCallback } from './@ohos.base'; 22import type colorSpaceManager from './@ohos.graphics.colorSpaceManager'; 23import type resourceManager from './@ohos.resourceManager'; 24import type rpc from './@ohos.rpc'; 25 26/** 27 * @namespace image 28 * @since 6 29 */ 30/** 31 * This module provides the capability of image codec and access 32 * @namespace image 33 * @syscap SystemCapability.Multimedia.Image.Core 34 * @crossplatform 35 * @atomicservice 36 * @since 11 37 */ 38/** 39 * This module provides the capability of image codec and access 40 * @namespace image 41 * @syscap SystemCapability.Multimedia.Image.Core 42 * @crossplatform 43 * @form 44 * @atomicservice 45 * @since 12 46 */ 47declare namespace image { 48 /** 49 * Enumerates pixel map formats. 50 * 51 * @enum { number } 52 * @syscap SystemCapability.Multimedia.Image.Core 53 * @since 7 54 */ 55 /** 56 * Enumerates pixel map formats. 57 * 58 * @enum { number } 59 * @syscap SystemCapability.Multimedia.Image.Core 60 * @crossplatform 61 * @since 10 62 */ 63 /** 64 * Enumerates pixel map formats. 65 * 66 * @enum { number } 67 * @syscap SystemCapability.Multimedia.Image.Core 68 * @crossplatform 69 * @atomicservice 70 * @since 11 71 */ 72 /** 73 * Enumerates pixel map formats. 74 * 75 * @enum { number } 76 * @syscap SystemCapability.Multimedia.Image.Core 77 * @crossplatform 78 * @form 79 * @atomicservice 80 * @since 12 81 */ 82 enum PixelMapFormat { 83 /** 84 * Indicates an unknown format. 85 * 86 * @syscap SystemCapability.Multimedia.Image.Core 87 * @since 7 88 */ 89 /** 90 * Indicates an unknown format. 91 * 92 * @syscap SystemCapability.Multimedia.Image.Core 93 * @crossplatform 94 * @since 10 95 */ 96 /** 97 * Indicates an unknown format. 98 * 99 * @syscap SystemCapability.Multimedia.Image.Core 100 * @crossplatform 101 * @atomicservice 102 * @since 11 103 */ 104 /** 105 * Indicates an unknown format. 106 * 107 * @syscap SystemCapability.Multimedia.Image.Core 108 * @crossplatform 109 * @form 110 * @atomicservice 111 * @since 12 112 */ 113 UNKNOWN = 0, 114 115 /** 116 * Indicates that each pixel is stored on 16 bits. Only the R, G, and B components are encoded 117 * from the higher-order to the lower-order bits: red is stored with 5 bits of precision, 118 * green is stored with 6 bits of precision, and blue is stored with 5 bits of precision. 119 * 120 * @syscap SystemCapability.Multimedia.Image.Core 121 * @since 7 122 */ 123 /** 124 * Indicates that each pixel is stored on 16 bits. Only the R, G, and B components are encoded 125 * from the higher-order to the lower-order bits: red is stored with 5 bits of precision, 126 * green is stored with 6 bits of precision, and blue is stored with 5 bits of precision. 127 * 128 * @syscap SystemCapability.Multimedia.Image.Core 129 * @crossplatform 130 * @since 10 131 */ 132 /** 133 * Indicates that each pixel is stored on 16 bits. Only the R, G, and B components are encoded 134 * from the higher-order to the lower-order bits: red is stored with 5 bits of precision, 135 * green is stored with 6 bits of precision, and blue is stored with 5 bits of precision. 136 * 137 * @syscap SystemCapability.Multimedia.Image.Core 138 * @crossplatform 139 * @atomicservice 140 * @since 11 141 */ 142 /** 143 * Indicates that each pixel is stored on 16 bits. Only the R, G, and B components are encoded 144 * from the higher-order to the lower-order bits: red is stored with 5 bits of precision, 145 * green is stored with 6 bits of precision, and blue is stored with 5 bits of precision. 146 * 147 * @syscap SystemCapability.Multimedia.Image.Core 148 * @crossplatform 149 * @form 150 * @atomicservice 151 * @since 12 152 */ 153 RGB_565 = 2, 154 155 /** 156 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 157 * and are stored from the higher-order to the lower-order bits. 158 * 159 * @syscap SystemCapability.Multimedia.Image.Core 160 * @since 7 161 */ 162 /** 163 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 164 * and are stored from the higher-order to the lower-order bits. 165 * 166 * @syscap SystemCapability.Multimedia.Image.Core 167 * @crossplatform 168 * @since 10 169 */ 170 /** 171 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 172 * and are stored from the higher-order to the lower-order bits. 173 * 174 * @syscap SystemCapability.Multimedia.Image.Core 175 * @crossplatform 176 * @atomicservice 177 * @since 11 178 */ 179 /** 180 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 181 * and are stored from the higher-order to the lower-order bits. 182 * 183 * @syscap SystemCapability.Multimedia.Image.Core 184 * @crossplatform 185 * @form 186 * @atomicservice 187 * @since 12 188 */ 189 RGBA_8888 = 3, 190 191 /** 192 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 193 * and are stored from the higher-order to the lower-order bits. 194 * 195 * @syscap SystemCapability.Multimedia.Image.Core 196 * @since 9 197 */ 198 /** 199 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 200 * and are stored from the higher-order to the lower-order bits. 201 * 202 * @syscap SystemCapability.Multimedia.Image.Core 203 * @crossplatform 204 * @since 10 205 */ 206 /** 207 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 208 * and are stored from the higher-order to the lower-order bits. 209 * 210 * @syscap SystemCapability.Multimedia.Image.Core 211 * @crossplatform 212 * @atomicservice 213 * @since 11 214 */ 215 /** 216 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 217 * and are stored from the higher-order to the lower-order bits. 218 * 219 * @syscap SystemCapability.Multimedia.Image.Core 220 * @crossplatform 221 * @form 222 * @atomicservice 223 * @since 12 224 */ 225 BGRA_8888 = 4, 226 227 /** 228 * Indicates that each pixel is stored on 24 bits. Each pixel contains 3 components:R(8bits), G(8bits), B(8bits) 229 * and are stored from the higher-order to the lower-order bits. 230 * 231 * @syscap SystemCapability.Multimedia.Image.Core 232 * @since 9 233 */ 234 /** 235 * Indicates that each pixel is stored on 24 bits. Each pixel contains 3 components:R(8bits), G(8bits), B(8bits) 236 * and are stored from the higher-order to the lower-order bits. 237 * 238 * @syscap SystemCapability.Multimedia.Image.Core 239 * @crossplatform 240 * @since 10 241 */ 242 /** 243 * Indicates that each pixel is stored on 24 bits. Each pixel contains 3 components:R(8bits), G(8bits), B(8bits) 244 * and are stored from the higher-order to the lower-order bits. 245 * 246 * @syscap SystemCapability.Multimedia.Image.Core 247 * @crossplatform 248 * @atomicservice 249 * @since 11 250 */ 251 /** 252 * Indicates that each pixel is stored on 24 bits. Each pixel contains 3 components:R(8bits), G(8bits), B(8bits) 253 * and are stored from the higher-order to the lower-order bits. 254 * 255 * @syscap SystemCapability.Multimedia.Image.Core 256 * @crossplatform 257 * @form 258 * @atomicservice 259 * @since 12 260 */ 261 RGB_888 = 5, 262 263 /** 264 * Indicates that each pixel is stored on 8 bits. Each pixel contains 1 component:ALPHA(8bits) 265 * and is stored from the higher-order to the lower-order bits. 266 * 267 * @syscap SystemCapability.Multimedia.Image.Core 268 * @since 9 269 */ 270 /** 271 * Indicates that each pixel is stored on 8 bits. Each pixel contains 1 component:ALPHA(8bits) 272 * and is stored from the higher-order to the lower-order bits. 273 * 274 * @syscap SystemCapability.Multimedia.Image.Core 275 * @crossplatform 276 * @since 10 277 */ 278 /** 279 * Indicates that each pixel is stored on 8 bits. Each pixel contains 1 component:ALPHA(8bits) 280 * and is stored from the higher-order to the lower-order bits. 281 * 282 * @syscap SystemCapability.Multimedia.Image.Core 283 * @crossplatform 284 * @atomicservice 285 * @since 11 286 */ 287 /** 288 * Indicates that each pixel is stored on 8 bits. Each pixel contains 1 component:ALPHA(8bits) 289 * and is stored from the higher-order to the lower-order bits. 290 * 291 * @syscap SystemCapability.Multimedia.Image.Core 292 * @crossplatform 293 * @form 294 * @atomicservice 295 * @since 12 296 */ 297 ALPHA_8 = 6, 298 299 /** 300 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 301 * and are stored from the higher-order to the lower-order bits in F16. 302 * 303 * @syscap SystemCapability.Multimedia.Image.Core 304 * @since 9 305 */ 306 /** 307 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 308 * and are stored from the higher-order to the lower-order bits in F16. 309 * 310 * @syscap SystemCapability.Multimedia.Image.Core 311 * @crossplatform 312 * @since 10 313 */ 314 /** 315 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 316 * and are stored from the higher-order to the lower-order bits in F16. 317 * 318 * @syscap SystemCapability.Multimedia.Image.Core 319 * @crossplatform 320 * @atomicservice 321 * @since 11 322 */ 323 /** 324 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components:B(8bits), G(8bits), R(8bits), A(8bits) 325 * and are stored from the higher-order to the lower-order bits in F16. 326 * 327 * @syscap SystemCapability.Multimedia.Image.Core 328 * @crossplatform 329 * @form 330 * @atomicservice 331 * @since 12 332 */ 333 RGBA_F16 = 7, 334 335 /** 336 * Indicates that the storage order is to store Y first and then V U alternately each occupies 8 bits 337 * and are stored from the higher-order to the lower-order bits. 338 * 339 * @syscap SystemCapability.Multimedia.Image.Core 340 * @since 9 341 */ 342 /** 343 * Indicates that the storage order is to store Y first and then V U alternately each occupies 8 bits 344 * and are stored from the higher-order to the lower-order bits. 345 * 346 * @syscap SystemCapability.Multimedia.Image.Core 347 * @crossplatform 348 * @since 10 349 */ 350 /** 351 * Indicates that the storage order is to store Y first and then V U alternately each occupies 8 bits 352 * and are stored from the higher-order to the lower-order bits. 353 * 354 * @syscap SystemCapability.Multimedia.Image.Core 355 * @crossplatform 356 * @atomicservice 357 * @since 11 358 */ 359 /** 360 * Indicates that the storage order is to store Y first and then V U alternately each occupies 8 bits 361 * and are stored from the higher-order to the lower-order bits. 362 * 363 * @syscap SystemCapability.Multimedia.Image.Core 364 * @crossplatform 365 * @form 366 * @atomicservice 367 * @since 12 368 */ 369 NV21 = 8, 370 371 /** 372 * Indicates that the storage order is to store Y first and then U V alternately each occupies 8 bits 373 * and are stored from the higher-order to the lower-order bits. 374 * 375 * @syscap SystemCapability.Multimedia.Image.Core 376 * @since 9 377 */ 378 /** 379 * Indicates that the storage order is to store Y first and then U V alternately each occupies 8 bits 380 * and are stored from the higher-order to the lower-order bits. 381 * 382 * @syscap SystemCapability.Multimedia.Image.Core 383 * @crossplatform 384 * @since 10 385 */ 386 /** 387 * Indicates that the storage order is to store Y first and then U V alternately each occupies 8 bits 388 * and are stored from the higher-order to the lower-order bits. 389 * 390 * @syscap SystemCapability.Multimedia.Image.Core 391 * @crossplatform 392 * @atomicservice 393 * @since 11 394 */ 395 /** 396 * Indicates that the storage order is to store Y first and then U V alternately each occupies 8 bits 397 * and are stored from the higher-order to the lower-order bits. 398 * 399 * @syscap SystemCapability.Multimedia.Image.Core 400 * @crossplatform 401 * @form 402 * @atomicservice 403 * @since 12 404 */ 405 NV12 = 9, 406 407 /** 408 * Indicates that each pixel is stored on 32 bits. Each pixel contains 4 components: 409 * R(10bits), G(10bits), B(10bits), A(2bits) and are stored from the higher-order to the lower-order bits. 410 * 411 * @syscap SystemCapability.Multimedia.Image.Core 412 * @since 12 413 */ 414 RGBA_1010102 = 10, 415 416 /** 417 * Indicates that the storage order is to store Y first and then U V alternately each occupies 10 bits 418 * and are stored from the higher-order to the lower-order bits. 419 * 420 * @syscap SystemCapability.Multimedia.Image.Core 421 * @since 12 422 */ 423 YCBCR_P010 = 11, 424 425 /** 426 * Indicates that the storage order is to store Y first and then V U alternately each occupies 10 bits 427 * and are stored from the higher-order to the lower-order bits. 428 * 429 * @syscap SystemCapability.Multimedia.Image.Core 430 * @since 12 431 */ 432 YCRCB_P010 = 12 433 } 434 435 /** 436 * Enumerates image resolution quality. 437 * 438 * @enum { number } 439 * @syscap SystemCapability.Multimedia.Image.Core 440 * @systemapi 441 * @since 12 442 */ 443 enum ResolutionQuality { 444 /** 445 * Low quality images, short decoding time. 446 * 447 * @syscap SystemCapability.Multimedia.Image.Core 448 * @systemapi 449 * @since 12 450 */ 451 LOW = 1, 452 453 /** 454 * Medium quality images, moderate decoding time. 455 * 456 * @syscap SystemCapability.Multimedia.Image.Core 457 * @systemapi 458 * @since 12 459 */ 460 MEDIUM = 2, 461 462 /** 463 * High quality images, longer decoding time. 464 * 465 * @syscap SystemCapability.Multimedia.Image.Core 466 * @systemapi 467 * @since 12 468 */ 469 HIGH = 3 470 } 471 472 /** 473 * Describes the size of an image. 474 * 475 * @typedef Size 476 * @syscap SystemCapability.Multimedia.Image.Core 477 * @since 6 478 */ 479 /** 480 * Describes the size of an image. 481 * 482 * @typedef Size 483 * @syscap SystemCapability.Multimedia.Image.Core 484 * @crossplatform 485 * @since 10 486 */ 487 /** 488 * Describes the size of an image. 489 * 490 * @typedef Size 491 * @syscap SystemCapability.Multimedia.Image.Core 492 * @crossplatform 493 * @atomicservice 494 * @since 11 495 */ 496 /** 497 * Describes the size of an image. 498 * 499 * @typedef Size 500 * @syscap SystemCapability.Multimedia.Image.Core 501 * @crossplatform 502 * @form 503 * @atomicservice 504 * @since 12 505 */ 506 interface Size { 507 /** 508 * Height 509 * 510 * @type { number } 511 * @syscap SystemCapability.Multimedia.Image.Core 512 * @since 6 513 */ 514 /** 515 * Height 516 * 517 * @type { number } 518 * @syscap SystemCapability.Multimedia.Image.Core 519 * @crossplatform 520 * @since 10 521 */ 522 /** 523 * Height 524 * 525 * @type { number } 526 * @syscap SystemCapability.Multimedia.Image.Core 527 * @crossplatform 528 * @atomicservice 529 * @since 11 530 */ 531 /** 532 * Height 533 * 534 * @type { number } 535 * @syscap SystemCapability.Multimedia.Image.Core 536 * @crossplatform 537 * @form 538 * @atomicservice 539 * @since 12 540 */ 541 height: number; 542 543 /** 544 * Width 545 * 546 * @type { number } 547 * @syscap SystemCapability.Multimedia.Image.Core 548 * @since 6 549 */ 550 /** 551 * Width 552 * 553 * @type { number } 554 * @syscap SystemCapability.Multimedia.Image.Core 555 * @crossplatform 556 * @since 10 557 */ 558 /** 559 * Width 560 * 561 * @type { number } 562 * @syscap SystemCapability.Multimedia.Image.Core 563 * @crossplatform 564 * @atomicservice 565 * @since 11 566 */ 567 /** 568 * Width 569 * 570 * @type { number } 571 * @syscap SystemCapability.Multimedia.Image.Core 572 * @crossplatform 573 * @form 574 * @atomicservice 575 * @since 12 576 */ 577 width: number; 578 } 579 580 /** 581 * Enumerates exchangeable image file format (Exif) information types of an image. 582 * 583 * @enum { string } 584 * @syscap SystemCapability.Multimedia.Image.Core 585 * @since 7 586 */ 587 /** 588 * Enumerates exchangeable image file format (Exif) information types of an image. 589 * 590 * @enum { string } 591 * @syscap SystemCapability.Multimedia.Image.Core 592 * @crossplatform 593 * @since 10 594 */ 595 enum PropertyKey { 596 /** 597 * Number of bits in each pixel of an image. 598 * 599 * @syscap SystemCapability.Multimedia.Image.Core 600 * @since 7 601 */ 602 /** 603 * Number of bits in each pixel of an image. 604 * 605 * @syscap SystemCapability.Multimedia.Image.Core 606 * @crossplatform 607 * @since 10 608 */ 609 BITS_PER_SAMPLE = 'BitsPerSample', 610 611 /** 612 * Image rotation mode. 613 * 614 * @syscap SystemCapability.Multimedia.Image.Core 615 * @since 7 616 */ 617 /** 618 * Image rotation mode. 619 * 620 * @syscap SystemCapability.Multimedia.Image.Core 621 * @crossplatform 622 * @since 10 623 */ 624 ORIENTATION = 'Orientation', 625 626 /** 627 * Image length. 628 * 629 * @syscap SystemCapability.Multimedia.Image.Core 630 * @since 7 631 */ 632 /** 633 * Image length. 634 * 635 * @syscap SystemCapability.Multimedia.Image.Core 636 * @crossplatform 637 * @since 10 638 */ 639 IMAGE_LENGTH = 'ImageLength', 640 641 /** 642 * Image width. 643 * 644 * @syscap SystemCapability.Multimedia.Image.Core 645 * @since 7 646 */ 647 /** 648 * Image width. 649 * 650 * @syscap SystemCapability.Multimedia.Image.Core 651 * @crossplatform 652 * @since 10 653 */ 654 IMAGE_WIDTH = 'ImageWidth', 655 656 /** 657 * GPS latitude. 658 * 659 * @syscap SystemCapability.Multimedia.Image.Core 660 * @since 7 661 */ 662 /** 663 * GPS latitude. 664 * 665 * @syscap SystemCapability.Multimedia.Image.Core 666 * @crossplatform 667 * @since 10 668 */ 669 GPS_LATITUDE = 'GPSLatitude', 670 671 /** 672 * GPS longitude. 673 * 674 * @syscap SystemCapability.Multimedia.Image.Core 675 * @since 7 676 */ 677 /** 678 * GPS longitude. 679 * 680 * @syscap SystemCapability.Multimedia.Image.Core 681 * @crossplatform 682 * @since 10 683 */ 684 GPS_LONGITUDE = 'GPSLongitude', 685 686 /** 687 * GPS latitude reference. For example, N indicates north latitude and S indicates south latitude. 688 * 689 * @syscap SystemCapability.Multimedia.Image.Core 690 * @since 7 691 */ 692 /** 693 * GPS latitude reference. For example, N indicates north latitude and S indicates south latitude. 694 * 695 * @syscap SystemCapability.Multimedia.Image.Core 696 * @crossplatform 697 * @since 10 698 */ 699 GPS_LATITUDE_REF = 'GPSLatitudeRef', 700 701 /** 702 * GPS longitude reference. For example, E indicates east longitude and W indicates west longitude. 703 * 704 * @syscap SystemCapability.Multimedia.Image.Core 705 * @since 7 706 */ 707 /** 708 * GPS longitude reference. For example, E indicates east longitude and W indicates west longitude. 709 * 710 * @syscap SystemCapability.Multimedia.Image.Core 711 * @crossplatform 712 * @since 10 713 */ 714 GPS_LONGITUDE_REF = 'GPSLongitudeRef', 715 716 /** 717 * Shooting time 718 * 719 * @syscap SystemCapability.Multimedia.Image.Core 720 * @since 9 721 */ 722 /** 723 * Shooting time 724 * 725 * @syscap SystemCapability.Multimedia.Image.Core 726 * @crossplatform 727 * @since 10 728 */ 729 DATE_TIME_ORIGINAL = 'DateTimeOriginal', 730 731 /** 732 * Exposure time 733 * 734 * @syscap SystemCapability.Multimedia.Image.Core 735 * @since 9 736 */ 737 /** 738 * Exposure time 739 * 740 * @syscap SystemCapability.Multimedia.Image.Core 741 * @crossplatform 742 * @since 10 743 */ 744 EXPOSURE_TIME = 'ExposureTime', 745 746 /** 747 * Scene type 748 * 749 * @syscap SystemCapability.Multimedia.Image.Core 750 * @since 9 751 */ 752 /** 753 * Scene type 754 * 755 * @syscap SystemCapability.Multimedia.Image.Core 756 * @crossplatform 757 * @since 10 758 */ 759 SCENE_TYPE = 'SceneType', 760 761 /** 762 * ISO speedratings 763 * 764 * @syscap SystemCapability.Multimedia.Image.Core 765 * @since 9 766 */ 767 /** 768 * ISO speedratings 769 * 770 * @syscap SystemCapability.Multimedia.Image.Core 771 * @crossplatform 772 * @since 10 773 */ 774 ISO_SPEED_RATINGS = 'ISOSpeedRatings', 775 776 /** 777 * Aperture value 778 * 779 * @syscap SystemCapability.Multimedia.Image.Core 780 * @since 9 781 */ 782 /** 783 * Aperture value 784 * 785 * @syscap SystemCapability.Multimedia.Image.Core 786 * @crossplatform 787 * @since 10 788 */ 789 F_NUMBER = 'FNumber', 790 791 /** 792 * Date time 793 * 794 * @syscap SystemCapability.Multimedia.Image.Core 795 * @since 10 796 */ 797 DATE_TIME = 'DateTime', 798 799 /** 800 * GPS time stamp 801 * 802 * @syscap SystemCapability.Multimedia.Image.Core 803 * @since 10 804 */ 805 GPS_TIME_STAMP = 'GPSTimeStamp', 806 807 /** 808 * GPS date stamp 809 * 810 * @syscap SystemCapability.Multimedia.Image.Core 811 * @since 10 812 */ 813 GPS_DATE_STAMP = 'GPSDateStamp', 814 815 /** 816 * Image description 817 * 818 * @syscap SystemCapability.Multimedia.Image.Core 819 * @since 10 820 */ 821 IMAGE_DESCRIPTION = 'ImageDescription', 822 823 /** 824 * Make 825 * 826 * @syscap SystemCapability.Multimedia.Image.Core 827 * @since 10 828 */ 829 MAKE = 'Make', 830 831 /** 832 * Model 833 * 834 * @syscap SystemCapability.Multimedia.Image.Core 835 * @since 10 836 */ 837 MODEL = 'Model', 838 839 /** 840 * Photo mode 841 * 842 * @syscap SystemCapability.Multimedia.Image.Core 843 * @since 10 844 */ 845 PHOTO_MODE = 'PhotoMode', 846 847 /** 848 * Sensitivity type 849 * 850 * @syscap SystemCapability.Multimedia.Image.Core 851 * @since 10 852 */ 853 SENSITIVITY_TYPE = 'SensitivityType', 854 855 /** 856 * Standard output sensitivity 857 * 858 * @syscap SystemCapability.Multimedia.Image.Core 859 * @since 10 860 */ 861 STANDARD_OUTPUT_SENSITIVITY = 'StandardOutputSensitivity', 862 863 /** 864 * Recommended exposure index 865 * 866 * @syscap SystemCapability.Multimedia.Image.Core 867 * @since 10 868 */ 869 RECOMMENDED_EXPOSURE_INDEX = 'RecommendedExposureIndex', 870 871 /** 872 * ISO speed 873 * 874 * @syscap SystemCapability.Multimedia.Image.Core 875 * @since 10 876 */ 877 ISO_SPEED = 'ISOSpeedRatings', 878 879 /** 880 * Aperture value 881 * 882 * @syscap SystemCapability.Multimedia.Image.Core 883 * @since 10 884 */ 885 APERTURE_VALUE = 'ApertureValue', 886 887 /** 888 * Exposure bias value 889 * 890 * @syscap SystemCapability.Multimedia.Image.Core 891 * @since 10 892 */ 893 EXPOSURE_BIAS_VALUE = 'ExposureBiasValue', 894 895 /** 896 * Metering mode 897 * 898 * @syscap SystemCapability.Multimedia.Image.Core 899 * @since 10 900 */ 901 METERING_MODE = 'MeteringMode', 902 903 /** 904 * Light source 905 * 906 * @syscap SystemCapability.Multimedia.Image.Core 907 * @since 10 908 */ 909 LIGHT_SOURCE = 'LightSource', 910 911 /** 912 * Flash 913 * 914 * @syscap SystemCapability.Multimedia.Image.Core 915 * @since 10 916 */ 917 FLASH = 'Flash', 918 919 /** 920 * Focal length 921 * 922 * @syscap SystemCapability.Multimedia.Image.Core 923 * @since 10 924 */ 925 FOCAL_LENGTH = 'FocalLength', 926 927 /** 928 * User comment 929 * 930 * @syscap SystemCapability.Multimedia.Image.Core 931 * @since 10 932 */ 933 USER_COMMENT = 'UserComment', 934 935 /** 936 * Pixel x dimension 937 * 938 * @syscap SystemCapability.Multimedia.Image.Core 939 * @since 10 940 */ 941 PIXEL_X_DIMENSION = 'PixelXDimension', 942 943 /** 944 * Pixel y dimension 945 * 946 * @syscap SystemCapability.Multimedia.Image.Core 947 * @since 10 948 */ 949 PIXEL_Y_DIMENSION = 'PixelYDimension', 950 951 /** 952 * White balance 953 * 954 * @syscap SystemCapability.Multimedia.Image.Core 955 * @since 10 956 */ 957 WHITE_BALANCE = 'WhiteBalance', 958 959 /** 960 * Focal length in 35mm film 961 * 962 * @syscap SystemCapability.Multimedia.Image.Core 963 * @since 10 964 */ 965 FOCAL_LENGTH_IN_35_MM_FILM = 'FocalLengthIn35mmFilm', 966 967 /** 968 * Capture mode 969 * 970 * @syscap SystemCapability.Multimedia.Image.Core 971 * @since 10 972 */ 973 CAPTURE_MODE = 'HwMnoteCaptureMode', 974 975 /** 976 * Physical aperture 977 * 978 * @syscap SystemCapability.Multimedia.Image.Core 979 * @since 10 980 */ 981 PHYSICAL_APERTURE = 'HwMnotePhysicalAperture', 982 983 /** 984 * Roll Angle 985 * 986 * @syscap SystemCapability.Multimedia.Image.Core 987 * @crossplatform 988 * @since 11 989 */ 990 ROLL_ANGLE = 'HwMnoteRollAngle', 991 992 /** 993 * Pitch Angle 994 * 995 * @syscap SystemCapability.Multimedia.Image.Core 996 * @crossplatform 997 * @since 11 998 */ 999 PITCH_ANGLE = 'HwMnotePitchAngle', 1000 1001 /** 1002 * Capture Scene: Food 1003 * 1004 * @syscap SystemCapability.Multimedia.Image.Core 1005 * @crossplatform 1006 * @since 11 1007 */ 1008 SCENE_FOOD_CONF = 'HwMnoteSceneFoodConf', 1009 1010 /** 1011 * Capture Scene: Stage 1012 * 1013 * @syscap SystemCapability.Multimedia.Image.Core 1014 * @crossplatform 1015 * @since 11 1016 */ 1017 SCENE_STAGE_CONF = 'HwMnoteSceneStageConf', 1018 1019 /** 1020 * Capture Scene: Blue Sky 1021 * 1022 * @syscap SystemCapability.Multimedia.Image.Core 1023 * @crossplatform 1024 * @since 11 1025 */ 1026 SCENE_BLUE_SKY_CONF = 'HwMnoteSceneBlueSkyConf', 1027 1028 /** 1029 * Capture Scene: Green Plant 1030 * 1031 * @syscap SystemCapability.Multimedia.Image.Core 1032 * @crossplatform 1033 * @since 11 1034 */ 1035 SCENE_GREEN_PLANT_CONF = 'HwMnoteSceneGreenPlantConf', 1036 1037 /** 1038 * Capture Scene: Beach 1039 * 1040 * @syscap SystemCapability.Multimedia.Image.Core 1041 * @crossplatform 1042 * @since 11 1043 */ 1044 SCENE_BEACH_CONF = 'HwMnoteSceneBeachConf', 1045 1046 /** 1047 * Capture Scene: Snow 1048 * 1049 * @syscap SystemCapability.Multimedia.Image.Core 1050 * @crossplatform 1051 * @since 11 1052 */ 1053 SCENE_SNOW_CONF = 'HwMnoteSceneSnowConf', 1054 1055 /** 1056 * Capture Scene: Sunset 1057 * 1058 * @syscap SystemCapability.Multimedia.Image.Core 1059 * @crossplatform 1060 * @since 11 1061 */ 1062 SCENE_SUNSET_CONF = 'HwMnoteSceneSunsetConf', 1063 1064 /** 1065 * Capture Scene: Flowers 1066 * 1067 * @syscap SystemCapability.Multimedia.Image.Core 1068 * @crossplatform 1069 * @since 11 1070 */ 1071 SCENE_FLOWERS_CONF = 'HwMnoteSceneFlowersConf', 1072 1073 /** 1074 * Capture Scene: Night 1075 * 1076 * @syscap SystemCapability.Multimedia.Image.Core 1077 * @crossplatform 1078 * @since 11 1079 */ 1080 SCENE_NIGHT_CONF = 'HwMnoteSceneNightConf', 1081 1082 /** 1083 * Capture Scene: Text 1084 * 1085 * @syscap SystemCapability.Multimedia.Image.Core 1086 * @crossplatform 1087 * @since 11 1088 */ 1089 SCENE_TEXT_CONF = 'HwMnoteSceneTextConf', 1090 1091 /** 1092 * Face Count 1093 * 1094 * @syscap SystemCapability.Multimedia.Image.Core 1095 * @crossplatform 1096 * @since 11 1097 */ 1098 FACE_COUNT = 'HwMnoteFaceCount', 1099 1100 /** 1101 * Focus Mode 1102 * 1103 * @syscap SystemCapability.Multimedia.Image.Core 1104 * @crossplatform 1105 * @since 11 1106 */ 1107 FOCUS_MODE = 'HwMnoteFocusMode', 1108 1109 /** 1110 * The scheme used for image compression. 1111 * 1112 * @syscap SystemCapability.Multimedia.Image.Core 1113 * @crossplatform 1114 * @since 12 1115 */ 1116 COMPRESSION = 'Compression', 1117 1118 /** 1119 * Pixel composition, such as RGB or YCbCr. 1120 * 1121 * @syscap SystemCapability.Multimedia.Image.Core 1122 * @crossplatform 1123 * @since 12 1124 */ 1125 PHOTOMETRIC_INTERPRETATION = 'PhotometricInterpretation', 1126 1127 /** 1128 * For each strip, the byte offset of that strip. 1129 * 1130 * @syscap SystemCapability.Multimedia.Image.Core 1131 * @crossplatform 1132 * @since 12 1133 */ 1134 STRIP_OFFSETS = 'StripOffsets', 1135 1136 /** 1137 * The number of components per pixel. 1138 * 1139 * @syscap SystemCapability.Multimedia.Image.Core 1140 * @crossplatform 1141 * @since 12 1142 */ 1143 SAMPLES_PER_PIXEL = 'SamplesPerPixel', 1144 1145 /** 1146 * The number of rows per strip of image data. 1147 * 1148 * @syscap SystemCapability.Multimedia.Image.Core 1149 * @crossplatform 1150 * @since 12 1151 */ 1152 ROWS_PER_STRIP = 'RowsPerStrip', 1153 1154 /** 1155 * The total number of bytes in each strip of image data. 1156 * 1157 * @syscap SystemCapability.Multimedia.Image.Core 1158 * @crossplatform 1159 * @since 12 1160 */ 1161 STRIP_BYTE_COUNTS = 'StripByteCounts', 1162 1163 /** 1164 * The image resolution in the width direction. 1165 * 1166 * @syscap SystemCapability.Multimedia.Image.Core 1167 * @crossplatform 1168 * @since 12 1169 */ 1170 X_RESOLUTION = 'XResolution', 1171 1172 /** 1173 * The image resolution in the height direction. 1174 * 1175 * @syscap SystemCapability.Multimedia.Image.Core 1176 * @crossplatform 1177 * @since 12 1178 */ 1179 Y_RESOLUTION = 'YResolution', 1180 1181 /** 1182 * Indicates whether pixel components are recorded in a chunky or planar format. 1183 * 1184 * @syscap SystemCapability.Multimedia.Image.Core 1185 * @crossplatform 1186 * @since 12 1187 */ 1188 PLANAR_CONFIGURATION = 'PlanarConfiguration', 1189 1190 /** 1191 * The unit used to measure XResolution and YResolution. 1192 * 1193 * @syscap SystemCapability.Multimedia.Image.Core 1194 * @crossplatform 1195 * @since 12 1196 */ 1197 RESOLUTION_UNIT = 'ResolutionUnit', 1198 1199 /** 1200 * The transfer function for the image, typically used for color correction. 1201 * 1202 * @syscap SystemCapability.Multimedia.Image.Core 1203 * @crossplatform 1204 * @since 12 1205 */ 1206 TRANSFER_FUNCTION = 'TransferFunction', 1207 1208 /** 1209 * The name and version of the software used to generate the image. 1210 * 1211 * @syscap SystemCapability.Multimedia.Image.Core 1212 * @crossplatform 1213 * @since 12 1214 */ 1215 SOFTWARE = 'Software', 1216 1217 /** 1218 * The name of the person who created the image. 1219 * 1220 * @syscap SystemCapability.Multimedia.Image.Core 1221 * @crossplatform 1222 * @since 12 1223 */ 1224 ARTIST = 'Artist', 1225 1226 /** 1227 * The chromaticity of the white point of the image. 1228 * 1229 * @syscap SystemCapability.Multimedia.Image.Core 1230 * @crossplatform 1231 * @since 12 1232 */ 1233 WHITE_POINT = 'WhitePoint', 1234 1235 /** 1236 * The chromaticity of the primary colors of the image. 1237 * 1238 * @syscap SystemCapability.Multimedia.Image.Core 1239 * @crossplatform 1240 * @since 12 1241 */ 1242 PRIMARY_CHROMATICITIES = 'PrimaryChromaticities', 1243 1244 /** 1245 * The matrix coefficients for transformation from RGB to YCbCr image data. 1246 * 1247 * @syscap SystemCapability.Multimedia.Image.Core 1248 * @crossplatform 1249 * @since 12 1250 */ 1251 YCBCR_COEFFICIENTS = 'YCbCrCoefficients', 1252 1253 /** 1254 * The sampling ratio of chrominance components to the luminance component. 1255 * 1256 * @syscap SystemCapability.Multimedia.Image.Core 1257 * @crossplatform 1258 * @since 12 1259 */ 1260 YCBCR_SUB_SAMPLING = 'YCbCrSubSampling', 1261 1262 /** 1263 * The position of chrominance components in relation to the luminance component. 1264 * 1265 * @syscap SystemCapability.Multimedia.Image.Core 1266 * @crossplatform 1267 * @since 12 1268 */ 1269 YCBCR_POSITIONING = 'YCbCrPositioning', 1270 1271 /** 1272 * The reference black point value and reference white point value. 1273 * 1274 * @syscap SystemCapability.Multimedia.Image.Core 1275 * @crossplatform 1276 * @since 12 1277 */ 1278 REFERENCE_BLACK_WHITE = 'ReferenceBlackWhite', 1279 1280 /** 1281 * Copyright information for the image. 1282 * 1283 * @syscap SystemCapability.Multimedia.Image.Core 1284 * @crossplatform 1285 * @since 12 1286 */ 1287 COPYRIGHT = 'Copyright', 1288 1289 /** 1290 * The offset to the start byte (SOI) of JPEG compressed thumbnail data. 1291 * 1292 * @syscap SystemCapability.Multimedia.Image.Core 1293 * @crossplatform 1294 * @since 12 1295 */ 1296 JPEG_INTERCHANGE_FORMAT = 'JPEGInterchangeFormat', 1297 1298 /** 1299 * The number of bytes of JPEG compressed thumbnail data. 1300 * 1301 * @syscap SystemCapability.Multimedia.Image.Core 1302 * @crossplatform 1303 * @since 12 1304 */ 1305 JPEG_INTERCHANGE_FORMAT_LENGTH = 'JPEGInterchangeFormatLength', 1306 1307 /** 1308 * The class of the program used by the camera to set exposure when the picture is taken. 1309 * 1310 * @syscap SystemCapability.Multimedia.Image.Core 1311 * @crossplatform 1312 * @since 12 1313 */ 1314 EXPOSURE_PROGRAM = 'ExposureProgram', 1315 1316 /** 1317 * Indicates the spectral sensitivity of each channel of the camera used. 1318 * 1319 * @syscap SystemCapability.Multimedia.Image.Core 1320 * @crossplatform 1321 * @since 12 1322 */ 1323 SPECTRAL_SENSITIVITY = 'SpectralSensitivity', 1324 1325 /** 1326 * Indicates the Opto-Electric Conversion Function (OECF) specified in ISO 14524. 1327 * 1328 * @syscap SystemCapability.Multimedia.Image.Core 1329 * @crossplatform 1330 * @since 12 1331 */ 1332 OECF = 'OECF', 1333 1334 /** 1335 * The version of the Exif standard supported. 1336 * 1337 * @syscap SystemCapability.Multimedia.Image.Core 1338 * @crossplatform 1339 * @since 12 1340 */ 1341 EXIF_VERSION = 'ExifVersion', 1342 1343 /** 1344 * The date and time when the image was stored as digital data. 1345 * 1346 * @syscap SystemCapability.Multimedia.Image.Core 1347 * @crossplatform 1348 * @since 12 1349 */ 1350 DATE_TIME_DIGITIZED = 'DateTimeDigitized', 1351 1352 /** 1353 * Information specific to compressed data. 1354 * 1355 * @syscap SystemCapability.Multimedia.Image.Core 1356 * @crossplatform 1357 * @since 12 1358 */ 1359 COMPONENTS_CONFIGURATION = 'ComponentsConfiguration', 1360 1361 /** 1362 * The shutter speed, expressed as an APEX (Additive System of Photographic Exposure) value. 1363 * 1364 * @syscap SystemCapability.Multimedia.Image.Core 1365 * @crossplatform 1366 * @since 12 1367 */ 1368 SHUTTER_SPEED = 'ShutterSpeedValue', 1369 1370 /** 1371 * The brightness value of the image, in APEX units. 1372 * 1373 * @syscap SystemCapability.Multimedia.Image.Core 1374 * @crossplatform 1375 * @since 12 1376 */ 1377 BRIGHTNESS_VALUE = 'BrightnessValue', 1378 1379 /** 1380 * The smallest F number of lens. 1381 * 1382 * @syscap SystemCapability.Multimedia.Image.Core 1383 * @crossplatform 1384 * @since 12 1385 */ 1386 MAX_APERTURE_VALUE = 'MaxApertureValue', 1387 1388 /** 1389 * The distance to the subject, measured in meters. 1390 * 1391 * @syscap SystemCapability.Multimedia.Image.Core 1392 * @crossplatform 1393 * @since 12 1394 */ 1395 SUBJECT_DISTANCE = 'SubjectDistance', 1396 1397 /** 1398 * This tag indicate the location and area of the main subject in the overall scene. 1399 * 1400 * @syscap SystemCapability.Multimedia.Image.Core 1401 * @crossplatform 1402 * @since 12 1403 */ 1404 SUBJECT_AREA = 'SubjectArea', 1405 1406 /** 1407 * A tag for manufacturers of Exif/DCF writers to record any desired information. 1408 * 1409 * @syscap SystemCapability.Multimedia.Image.Core 1410 * @crossplatform 1411 * @since 12 1412 */ 1413 MAKER_NOTE = 'MakerNote', 1414 1415 /** 1416 * A tag for record fractions of seconds for the DateTime tag. 1417 * 1418 * @syscap SystemCapability.Multimedia.Image.Core 1419 * @crossplatform 1420 * @since 12 1421 */ 1422 SUBSEC_TIME = 'SubsecTime', 1423 1424 /** 1425 * A tag used to record fractions of seconds for the DateTimeOriginal tag. 1426 * 1427 * @syscap SystemCapability.Multimedia.Image.Core 1428 * @crossplatform 1429 * @since 12 1430 */ 1431 SUBSEC_TIME_ORIGINAL = 'SubsecTimeOriginal', 1432 1433 /** 1434 * A tag used to record fractions of seconds for the DateTimeDigitized tag. 1435 * 1436 * @syscap SystemCapability.Multimedia.Image.Core 1437 * @crossplatform 1438 * @since 12 1439 */ 1440 SUBSEC_TIME_DIGITIZED = 'SubsecTimeDigitized', 1441 1442 /** 1443 * This tag denotes the Flashpix format version supported by an FPXR file, enhancing device compatibility. 1444 * 1445 * @syscap SystemCapability.Multimedia.Image.Core 1446 * @crossplatform 1447 * @since 12 1448 */ 1449 FLASHPIX_VERSION = 'FlashpixVersion', 1450 1451 /** 1452 * The color space information tag, often recorded as the color space specifier. 1453 * 1454 * @syscap SystemCapability.Multimedia.Image.Core 1455 * @crossplatform 1456 * @since 12 1457 */ 1458 COLOR_SPACE = 'ColorSpace', 1459 1460 /** 1461 * The name of an audio file related to the image data. 1462 * 1463 * @syscap SystemCapability.Multimedia.Image.Core 1464 * @crossplatform 1465 * @since 12 1466 */ 1467 RELATED_SOUND_FILE = 'RelatedSoundFile', 1468 1469 /** 1470 * Strobe energy at image capture, in BCPS. 1471 * 1472 * @syscap SystemCapability.Multimedia.Image.Core 1473 * @crossplatform 1474 * @since 12 1475 */ 1476 FLASH_ENERGY = 'FlashEnergy', 1477 1478 /** 1479 * Camera or input device spatial frequency table. 1480 * 1481 * @syscap SystemCapability.Multimedia.Image.Core 1482 * @crossplatform 1483 * @since 12 1484 */ 1485 SPATIAL_FREQUENCY_RESPONSE = 'SpatialFrequencyResponse', 1486 1487 /** 1488 * Pixels per FocalPlaneResolutionUnit in the image width. 1489 * 1490 * @syscap SystemCapability.Multimedia.Image.Core 1491 * @crossplatform 1492 * @since 12 1493 */ 1494 FOCAL_PLANE_X_RESOLUTION = 'FocalPlaneXResolution', 1495 1496 /** 1497 * Pixels per FocalPlaneResolutionUnit in the image height. 1498 * 1499 * @syscap SystemCapability.Multimedia.Image.Core 1500 * @crossplatform 1501 * @since 12 1502 */ 1503 FOCAL_PLANE_Y_RESOLUTION = 'FocalPlaneYResolution', 1504 1505 /** 1506 * Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution. 1507 * 1508 * @syscap SystemCapability.Multimedia.Image.Core 1509 * @crossplatform 1510 * @since 12 1511 */ 1512 FOCAL_PLANE_RESOLUTION_UNIT = 'FocalPlaneResolutionUnit', 1513 1514 /** 1515 * Location of the main subject, relative to the left edge. 1516 * 1517 * @syscap SystemCapability.Multimedia.Image.Core 1518 * @crossplatform 1519 * @since 12 1520 */ 1521 SUBJECT_LOCATION = 'SubjectLocation', 1522 1523 /** 1524 * Selected exposure index at capture. 1525 * 1526 * @syscap SystemCapability.Multimedia.Image.Core 1527 * @crossplatform 1528 * @since 12 1529 */ 1530 EXPOSURE_INDEX = 'ExposureIndex', 1531 1532 /** 1533 * Image sensor type on the camera. 1534 * 1535 * @syscap SystemCapability.Multimedia.Image.Core 1536 * @crossplatform 1537 * @since 12 1538 */ 1539 SENSING_METHOD = 'SensingMethod', 1540 1541 /** 1542 * Indicates the image source. 1543 * 1544 * @syscap SystemCapability.Multimedia.Image.Core 1545 * @crossplatform 1546 * @since 12 1547 */ 1548 FILE_SOURCE = 'FileSource', 1549 1550 /** 1551 * Color filter array (CFA) geometric pattern of the image sensor. 1552 * 1553 * @syscap SystemCapability.Multimedia.Image.Core 1554 * @crossplatform 1555 * @since 12 1556 */ 1557 CFA_PATTERN = 'CFAPattern', 1558 1559 /** 1560 * Indicates special processing on image data. 1561 * 1562 * @syscap SystemCapability.Multimedia.Image.Core 1563 * @crossplatform 1564 * @since 12 1565 */ 1566 CUSTOM_RENDERED = 'CustomRendered', 1567 1568 /** 1569 * Exposure mode set when the image was shot. 1570 * 1571 * @syscap SystemCapability.Multimedia.Image.Core 1572 * @crossplatform 1573 * @since 12 1574 */ 1575 EXPOSURE_MODE = 'ExposureMode', 1576 1577 /** 1578 * Digital zoom ratio at the time of capture. 1579 * 1580 * @syscap SystemCapability.Multimedia.Image.Core 1581 * @crossplatform 1582 * @since 12 1583 */ 1584 DIGITAL_ZOOM_RATIO = 'DigitalZoomRatio', 1585 1586 /** 1587 * Type of scene captured. 1588 * 1589 * @syscap SystemCapability.Multimedia.Image.Core 1590 * @crossplatform 1591 * @since 12 1592 */ 1593 SCENE_CAPTURE_TYPE = 'SceneCaptureType', 1594 1595 /** 1596 * Degree of overall image gain adjustment. 1597 * 1598 * @syscap SystemCapability.Multimedia.Image.Core 1599 * @crossplatform 1600 * @since 12 1601 */ 1602 GAIN_CONTROL = 'GainControl', 1603 1604 /** 1605 * Direction of contrast processing applied by the camera. 1606 * 1607 * @syscap SystemCapability.Multimedia.Image.Core 1608 * @crossplatform 1609 * @since 12 1610 */ 1611 CONTRAST = 'Contrast', 1612 1613 /** 1614 * Direction of saturation processing applied by the camera. 1615 * 1616 * @syscap SystemCapability.Multimedia.Image.Core 1617 * @crossplatform 1618 * @since 12 1619 */ 1620 SATURATION = 'Saturation', 1621 1622 /** 1623 * The direction of sharpness processing applied by the camera. 1624 * 1625 * @syscap SystemCapability.Multimedia.Image.Core 1626 * @crossplatform 1627 * @since 12 1628 */ 1629 SHARPNESS = 'Sharpness', 1630 1631 /** 1632 * Information on picture-taking conditions for a specific camera model. 1633 * 1634 * @syscap SystemCapability.Multimedia.Image.Core 1635 * @crossplatform 1636 * @since 12 1637 */ 1638 DEVICE_SETTING_DESCRIPTION = 'DeviceSettingDescription', 1639 1640 /** 1641 * Indicates the distance range to the subject. 1642 * 1643 * @syscap SystemCapability.Multimedia.Image.Core 1644 * @crossplatform 1645 * @since 12 1646 */ 1647 SUBJECT_DISTANCE_RANGE = 'SubjectDistanceRange', 1648 1649 /** 1650 * An identifier uniquely assigned to each image. 1651 * 1652 * @syscap SystemCapability.Multimedia.Image.Core 1653 * @crossplatform 1654 * @since 12 1655 */ 1656 IMAGE_UNIQUE_ID = 'ImageUniqueID', 1657 1658 /** 1659 * The version of the GPSInfoIFD. 1660 * 1661 * @syscap SystemCapability.Multimedia.Image.Core 1662 * @crossplatform 1663 * @since 12 1664 */ 1665 GPS_VERSION_ID = 'GPSVersionID', 1666 1667 /** 1668 * Reference altitude used for GPS altitude. 1669 * 1670 * @syscap SystemCapability.Multimedia.Image.Core 1671 * @crossplatform 1672 * @since 12 1673 */ 1674 GPS_ALTITUDE_REF = 'GPSAltitudeRef', 1675 1676 /** 1677 * The altitude based on the reference in GPSAltitudeRef. 1678 * 1679 * @syscap SystemCapability.Multimedia.Image.Core 1680 * @crossplatform 1681 * @since 12 1682 */ 1683 GPS_ALTITUDE = 'GPSAltitude', 1684 1685 /** 1686 * The GPS satellites used for measurements. 1687 * 1688 * @syscap SystemCapability.Multimedia.Image.Core 1689 * @crossplatform 1690 * @since 12 1691 */ 1692 GPS_SATELLITES = 'GPSSatellites', 1693 1694 /** 1695 * The status of the GPS receiver when the image is recorded. 1696 * 1697 * @syscap SystemCapability.Multimedia.Image.Core 1698 * @crossplatform 1699 * @since 12 1700 */ 1701 GPS_STATUS = 'GPSStatus', 1702 1703 /** 1704 * The GPS measurement mode. 1705 * 1706 * @syscap SystemCapability.Multimedia.Image.Core 1707 * @crossplatform 1708 * @since 12 1709 */ 1710 GPS_MEASURE_MODE = 'GPSMeasureMode', 1711 1712 /** 1713 * The GPS DOP (data degree of precision). 1714 * 1715 * @syscap SystemCapability.Multimedia.Image.Core 1716 * @crossplatform 1717 * @since 12 1718 */ 1719 GPS_DOP = 'GPSDOP', 1720 1721 /** 1722 * The unit used to express the GPS receiver speed of movement. 1723 * 1724 * @syscap SystemCapability.Multimedia.Image.Core 1725 * @crossplatform 1726 * @since 12 1727 */ 1728 GPS_SPEED_REF = 'GPSSpeedRef', 1729 1730 /** 1731 * The speed of GPS receiver movement. 1732 * 1733 * @syscap SystemCapability.Multimedia.Image.Core 1734 * @crossplatform 1735 * @since 12 1736 */ 1737 GPS_SPEED = 'GPSSpeed', 1738 1739 /** 1740 * The reference for giving the direction of GPS receiver movement. 1741 * 1742 * @syscap SystemCapability.Multimedia.Image.Core 1743 * @crossplatform 1744 * @since 12 1745 */ 1746 GPS_TRACK_REF = 'GPSTrackRef', 1747 1748 /** 1749 * The direction of GPS receiver movement. 1750 * 1751 * @syscap SystemCapability.Multimedia.Image.Core 1752 * @crossplatform 1753 * @since 12 1754 */ 1755 GPS_TRACK = 'GPSTrack', 1756 1757 /** 1758 * The reference for the image's direction. 1759 * 1760 * @syscap SystemCapability.Multimedia.Image.Core 1761 * @crossplatform 1762 * @since 12 1763 */ 1764 GPS_IMG_DIRECTION_REF = 'GPSImgDirectionRef', 1765 1766 /** 1767 * The direction of the image when captured. 1768 * 1769 * @syscap SystemCapability.Multimedia.Image.Core 1770 * @crossplatform 1771 * @since 12 1772 */ 1773 GPS_IMG_DIRECTION = 'GPSImgDirection', 1774 1775 /** 1776 * Geodetic survey data used by the GPS receiver. 1777 * 1778 * @syscap SystemCapability.Multimedia.Image.Core 1779 * @crossplatform 1780 * @since 12 1781 */ 1782 GPS_MAP_DATUM = 'GPSMapDatum', 1783 1784 /** 1785 * Indicates the latitude reference of the destination point. 1786 * 1787 * @syscap SystemCapability.Multimedia.Image.Core 1788 * @crossplatform 1789 * @since 12 1790 */ 1791 GPS_DEST_LATITUDE_REF = 'GPSDestLatitudeRef', 1792 1793 /** 1794 * The latitude of the destination point. 1795 * 1796 * @syscap SystemCapability.Multimedia.Image.Core 1797 * @crossplatform 1798 * @since 12 1799 */ 1800 GPS_DEST_LATITUDE = 'GPSDestLatitude', 1801 1802 /** 1803 * Indicates the longitude reference of the destination point. 1804 * 1805 * @syscap SystemCapability.Multimedia.Image.Core 1806 * @crossplatform 1807 * @since 12 1808 */ 1809 GPS_DEST_LONGITUDE_REF = 'GPSDestLongitudeRef', 1810 1811 /** 1812 * The longitude of the destination point. 1813 * 1814 * @syscap SystemCapability.Multimedia.Image.Core 1815 * @crossplatform 1816 * @since 12 1817 */ 1818 GPS_DEST_LONGITUDE = 'GPSDestLongitude', 1819 1820 /** 1821 * The reference for the bearing to the destination point. 1822 * 1823 * @syscap SystemCapability.Multimedia.Image.Core 1824 * @crossplatform 1825 * @since 12 1826 */ 1827 GPS_DEST_BEARING_REF = 'GPSDestBearingRef', 1828 1829 /** 1830 * The bearing to the destination point. 1831 * 1832 * @syscap SystemCapability.Multimedia.Image.Core 1833 * @crossplatform 1834 * @since 12 1835 */ 1836 GPS_DEST_BEARING = 'GPSDestBearing', 1837 1838 /** 1839 * The measurement unit for the distance to the target point. 1840 * 1841 * @syscap SystemCapability.Multimedia.Image.Core 1842 * @crossplatform 1843 * @since 12 1844 */ 1845 GPS_DEST_DISTANCE_REF = 'GPSDestDistanceRef', 1846 1847 /** 1848 * The distance to the destination point. 1849 * 1850 * @syscap SystemCapability.Multimedia.Image.Core 1851 * @crossplatform 1852 * @since 12 1853 */ 1854 GPS_DEST_DISTANCE = 'GPSDestDistance', 1855 1856 /** 1857 * A character string recording the name of the method used for location finding. 1858 * 1859 * @syscap SystemCapability.Multimedia.Image.Core 1860 * @crossplatform 1861 * @since 12 1862 */ 1863 GPS_PROCESSING_METHOD = 'GPSProcessingMethod', 1864 1865 /** 1866 * A character string recording the name of the GPS area. 1867 * 1868 * @syscap SystemCapability.Multimedia.Image.Core 1869 * @crossplatform 1870 * @since 12 1871 */ 1872 GPS_AREA_INFORMATION = 'GPSAreaInformation', 1873 1874 /** 1875 * This field denotes if differential correction was applied to GPS data, crucial for precise location accuracy. 1876 * 1877 * @syscap SystemCapability.Multimedia.Image.Core 1878 * @crossplatform 1879 * @since 12 1880 */ 1881 GPS_DIFFERENTIAL = 'GPSDifferential', 1882 1883 /** 1884 * The serial number of the camera body. 1885 * 1886 * @syscap SystemCapability.Multimedia.Image.Core 1887 * @crossplatform 1888 * @since 12 1889 */ 1890 BODY_SERIAL_NUMBER = 'BodySerialNumber', 1891 1892 /** 1893 * The name of the camera owner. 1894 * 1895 * @syscap SystemCapability.Multimedia.Image.Core 1896 * @crossplatform 1897 * @since 12 1898 */ 1899 CAMERA_OWNER_NAME = 'CameraOwnerName', 1900 1901 /** 1902 * Indicates whether the image is a composite image. 1903 * 1904 * @syscap SystemCapability.Multimedia.Image.Core 1905 * @crossplatform 1906 * @since 12 1907 */ 1908 COMPOSITE_IMAGE = 'CompositeImage', 1909 1910 /** 1911 * The compression mode used for a compressed image, in unit bits per pixel. 1912 * 1913 * @syscap SystemCapability.Multimedia.Image.Core 1914 * @crossplatform 1915 * @since 12 1916 */ 1917 COMPRESSED_BITS_PER_PIXEL = 'CompressedBitsPerPixel', 1918 1919 /** 1920 * The DNGVersion tag encodes the four-tier version number for DNG specification compliance. 1921 * 1922 * @syscap SystemCapability.Multimedia.Image.Core 1923 * @crossplatform 1924 * @since 12 1925 */ 1926 DNG_VERSION = 'DNGVersion', 1927 1928 /** 1929 * DefaultCropSize specifies the final image size in raw coordinates, accounting for extra edge pixels. 1930 * 1931 * @syscap SystemCapability.Multimedia.Image.Core 1932 * @crossplatform 1933 * @since 12 1934 */ 1935 DEFAULT_CROP_SIZE = 'DefaultCropSize', 1936 1937 /** 1938 * Indicates the value of coefficient gamma. 1939 * 1940 * @syscap SystemCapability.Multimedia.Image.Core 1941 * @crossplatform 1942 * @since 12 1943 */ 1944 GAMMA = 'Gamma', 1945 1946 /** 1947 * The tag indicate the ISO speed latitude yyy value of the camera or input device that is defined in ISO 12232. 1948 * 1949 * @syscap SystemCapability.Multimedia.Image.Core 1950 * @crossplatform 1951 * @since 12 1952 */ 1953 ISO_SPEED_LATITUDE_YYY = 'ISOSpeedLatitudeyyy', 1954 1955 /** 1956 * The tag indicate the ISO speed latitude zzz value of the camera or input device that is defined in ISO 12232. 1957 * 1958 * @syscap SystemCapability.Multimedia.Image.Core 1959 * @crossplatform 1960 * @since 12 1961 */ 1962 ISO_SPEED_LATITUDE_ZZZ = 'ISOSpeedLatitudezzz', 1963 1964 /** 1965 * The manufacturer of the lens. 1966 * 1967 * @syscap SystemCapability.Multimedia.Image.Core 1968 * @crossplatform 1969 * @since 12 1970 */ 1971 LENS_MAKE = 'LensMake', 1972 1973 /** 1974 * The model name of the lens. 1975 * 1976 * @syscap SystemCapability.Multimedia.Image.Core 1977 * @crossplatform 1978 * @since 12 1979 */ 1980 LENS_MODEL = 'LensModel', 1981 1982 /** 1983 * The serial number of the lens. 1984 * 1985 * @syscap SystemCapability.Multimedia.Image.Core 1986 * @crossplatform 1987 * @since 12 1988 */ 1989 LENS_SERIAL_NUMBER = 'LensSerialNumber', 1990 1991 /** 1992 * Specifications of the lens used. 1993 * 1994 * @syscap SystemCapability.Multimedia.Image.Core 1995 * @crossplatform 1996 * @since 12 1997 */ 1998 LENS_SPECIFICATION = 'LensSpecification', 1999 2000 /** 2001 * This tag provides a broad description of the data type in this subfile. 2002 * 2003 * @syscap SystemCapability.Multimedia.Image.Core 2004 * @crossplatform 2005 * @since 12 2006 */ 2007 NEW_SUBFILE_TYPE = 'NewSubfileType', 2008 2009 /** 2010 * This tag records the UTC offset for the DateTime tag, ensuring accurate timestamps regardless of location. 2011 * 2012 * @syscap SystemCapability.Multimedia.Image.Core 2013 * @crossplatform 2014 * @since 12 2015 */ 2016 OFFSET_TIME = 'OffsetTime', 2017 2018 /** 2019 * This tag records the UTC offset when the image was digitized, aiding in accurate timestamp adjustment. 2020 * 2021 * @syscap SystemCapability.Multimedia.Image.Core 2022 * @crossplatform 2023 * @since 12 2024 */ 2025 OFFSET_TIME_DIGITIZED = 'OffsetTimeDigitized', 2026 2027 /** 2028 * This tag records the UTC offset when the original image was created, crucial for time-sensitive applications. 2029 * 2030 * @syscap SystemCapability.Multimedia.Image.Core 2031 * @crossplatform 2032 * @since 12 2033 */ 2034 OFFSET_TIME_ORIGINAL = 'OffsetTimeOriginal', 2035 2036 /** 2037 * Exposure times of source images for a composite image. 2038 * 2039 * @syscap SystemCapability.Multimedia.Image.Core 2040 * @crossplatform 2041 * @since 12 2042 */ 2043 SOURCE_EXPOSURE_TIMES_OF_COMPOSITE_IMAGE = 'SourceExposureTimesOfCompositeImage', 2044 2045 /** 2046 * The number of source images used for a composite image. 2047 * 2048 * @syscap SystemCapability.Multimedia.Image.Core 2049 * @crossplatform 2050 * @since 12 2051 */ 2052 SOURCE_IMAGE_NUMBER_OF_COMPOSITE_IMAGE = 'SourceImageNumberOfCompositeImage', 2053 2054 /** 2055 * This deprecated tag indicates the data type in this subfile. Use NewSubfileType instead. 2056 * 2057 * @syscap SystemCapability.Multimedia.Image.Core 2058 * @crossplatform 2059 * @since 12 2060 */ 2061 SUBFILE_TYPE = 'SubfileType', 2062 2063 /** 2064 * This tag indicates horizontal positioning errors in meters. 2065 * 2066 * @syscap SystemCapability.Multimedia.Image.Core 2067 * @crossplatform 2068 * @since 12 2069 */ 2070 GPS_H_POSITIONING_ERROR = 'GPSHPositioningError', 2071 2072 /** 2073 * This tag indicates the sensitivity of the camera or input device when the image was shot. 2074 * 2075 * @syscap SystemCapability.Multimedia.Image.Core 2076 * @crossplatform 2077 * @since 12 2078 */ 2079 PHOTOGRAPHIC_SENSITIVITY = 'PhotographicSensitivity', 2080 2081 /** 2082 * Burst Number 2083 * 2084 * @syscap SystemCapability.Multimedia.Image.Core 2085 * @crossplatform 2086 * @since 12 2087 */ 2088 BURST_NUMBER = 'HwMnoteBurstNumber', 2089 2090 /** 2091 * Face Conf 2092 * 2093 * @syscap SystemCapability.Multimedia.Image.Core 2094 * @crossplatform 2095 * @since 12 2096 */ 2097 FACE_CONF = 'HwMnoteFaceConf', 2098 2099 /** 2100 * Face Leye Center 2101 * 2102 * @syscap SystemCapability.Multimedia.Image.Core 2103 * @crossplatform 2104 * @since 12 2105 */ 2106 FACE_LEYE_CENTER = 'HwMnoteFaceLeyeCenter', 2107 2108 /** 2109 * Face Mouth Center 2110 * 2111 * @syscap SystemCapability.Multimedia.Image.Core 2112 * @crossplatform 2113 * @since 12 2114 */ 2115 FACE_MOUTH_CENTER = 'HwMnoteFaceMouthCenter', 2116 2117 /** 2118 * Face Pointer 2119 * 2120 * @syscap SystemCapability.Multimedia.Image.Core 2121 * @crossplatform 2122 * @since 12 2123 */ 2124 FACE_POINTER = 'HwMnoteFacePointer', 2125 2126 /** 2127 * Face Rect 2128 * 2129 * @syscap SystemCapability.Multimedia.Image.Core 2130 * @crossplatform 2131 * @since 12 2132 */ 2133 FACE_RECT = 'HwMnoteFaceRect', 2134 2135 /** 2136 * Face Reye Center 2137 * 2138 * @syscap SystemCapability.Multimedia.Image.Core 2139 * @crossplatform 2140 * @since 12 2141 */ 2142 FACE_REYE_CENTER = 'HwMnoteFaceReyeCenter', 2143 2144 /** 2145 * Face Smile Score 2146 * 2147 * @syscap SystemCapability.Multimedia.Image.Core 2148 * @crossplatform 2149 * @since 12 2150 */ 2151 FACE_SMILE_SCORE = 'HwMnoteFaceSmileScore', 2152 2153 /** 2154 * Face Version 2155 * 2156 * @syscap SystemCapability.Multimedia.Image.Core 2157 * @crossplatform 2158 * @since 12 2159 */ 2160 FACE_VERSION = 'HwMnoteFaceVersion', 2161 2162 /** 2163 * Front Camera 2164 * 2165 * @syscap SystemCapability.Multimedia.Image.Core 2166 * @crossplatform 2167 * @since 12 2168 */ 2169 FRONT_CAMERA = 'HwMnoteFrontCamera', 2170 2171 /** 2172 * Scene Pointer 2173 * 2174 * @syscap SystemCapability.Multimedia.Image.Core 2175 * @crossplatform 2176 * @since 12 2177 */ 2178 SCENE_POINTER = 'HwMnoteScenePointer', 2179 2180 /** 2181 * Scene Version 2182 * 2183 * @syscap SystemCapability.Multimedia.Image.Core 2184 * @crossplatform 2185 * @since 12 2186 */ 2187 SCENE_VERSION = 'HwMnoteSceneVersion', 2188 2189 /** 2190 * Is Xmage Supported 2191 * 2192 * @syscap SystemCapability.Multimedia.Image.Core 2193 * @crossplatform 2194 * @since 12 2195 */ 2196 IS_XMAGE_SUPPORTED = 'HwMnoteIsXmageSupported', 2197 2198 /** 2199 * Xmage Mode 2200 * 2201 * @syscap SystemCapability.Multimedia.Image.Core 2202 * @crossplatform 2203 * @since 12 2204 */ 2205 XMAGE_MODE = 'HwMnoteXmageMode', 2206 2207 /** 2208 * Xmage X1 Coordinate 2209 * 2210 * @syscap SystemCapability.Multimedia.Image.Core 2211 * @crossplatform 2212 * @since 12 2213 */ 2214 XMAGE_LEFT = 'HwMnoteXmageLeft', 2215 2216 /** 2217 * Xmage Y1 Coordinate 2218 * 2219 * @syscap SystemCapability.Multimedia.Image.Core 2220 * @crossplatform 2221 * @since 12 2222 */ 2223 XMAGE_TOP = 'HwMnoteXmageTop', 2224 2225 /** 2226 * Xmage X2 Coordinate 2227 * 2228 * @syscap SystemCapability.Multimedia.Image.Core 2229 * @crossplatform 2230 * @since 12 2231 */ 2232 XMAGE_RIGHT = 'HwMnoteXmageRight', 2233 2234 /** 2235 * Xmage Y2 Coordinate 2236 * 2237 * @syscap SystemCapability.Multimedia.Image.Core 2238 * @crossplatform 2239 * @since 12 2240 */ 2241 XMAGE_BOTTOM = 'HwMnoteXmageBottom', 2242 2243 /** 2244 * Cloud Enhancement Mode 2245 * 2246 * @syscap SystemCapability.Multimedia.Image.Core 2247 * @crossplatform 2248 * @since 12 2249 */ 2250 CLOUD_ENHANCEMENT_MODE = 'HwMnoteCloudEnhancementMode', 2251 2252 /** 2253 * Wind Snapshot Mode 2254 * 2255 * @syscap SystemCapability.Multimedia.Image.Core 2256 * @crossplatform 2257 * @since 12 2258 */ 2259 WIND_SNAPSHOT_MODE = 'HwMnoteWindSnapshotMode', 2260 2261 /** 2262 * GIF LOOP COUNT 2263 * If infinite loop returns 0, other values represent the number of loops 2264 * 2265 * @syscap SystemCapability.Multimedia.Image.Core 2266 * @crossplatform 2267 * @since 12 2268 */ 2269 GIF_LOOP_COUNT = 'GIFLoopCount' 2270 } 2271 2272 /** 2273 * Enum for image formats. 2274 * 2275 * @enum { number } 2276 * @syscap SystemCapability.Multimedia.Image.Core 2277 * @since 9 2278 */ 2279 enum ImageFormat { 2280 /** 2281 * YCBCR422 semi-planar format. 2282 * 2283 * @syscap SystemCapability.Multimedia.Image.Core 2284 * @since 9 2285 */ 2286 YCBCR_422_SP = 1000, 2287 2288 /** 2289 * JPEG encoding format. 2290 * 2291 * @syscap SystemCapability.Multimedia.Image.Core 2292 * @since 9 2293 */ 2294 JPEG = 2000 2295 } 2296 2297 /** 2298 * Enumerates alpha types. 2299 * 2300 * @enum { number } 2301 * @syscap SystemCapability.Multimedia.Image.Core 2302 * @since 9 2303 */ 2304 /** 2305 * Enumerates alpha types. 2306 * 2307 * @enum { number } 2308 * @syscap SystemCapability.Multimedia.Image.Core 2309 * @crossplatform 2310 * @since 10 2311 */ 2312 /** 2313 * Enumerates alpha types. 2314 * 2315 * @enum { number } 2316 * @syscap SystemCapability.Multimedia.Image.Core 2317 * @crossplatform 2318 * @atomicservice 2319 * @since 11 2320 */ 2321 /** 2322 * Enumerates alpha types. 2323 * 2324 * @enum { number } 2325 * @syscap SystemCapability.Multimedia.Image.Core 2326 * @crossplatform 2327 * @form 2328 * @atomicservice 2329 * @since 12 2330 */ 2331 enum AlphaType { 2332 /** 2333 * Indicates an unknown alpha type. 2334 * 2335 * @syscap SystemCapability.Multimedia.Image.Core 2336 * @since 9 2337 */ 2338 /** 2339 * Indicates an unknown alpha type. 2340 * 2341 * @syscap SystemCapability.Multimedia.Image.Core 2342 * @crossplatform 2343 * @since 10 2344 */ 2345 /** 2346 * Indicates an unknown alpha type. 2347 * 2348 * @syscap SystemCapability.Multimedia.Image.Core 2349 * @crossplatform 2350 * @atomicservice 2351 * @since 11 2352 */ 2353 /** 2354 * Indicates an unknown alpha type. 2355 * 2356 * @syscap SystemCapability.Multimedia.Image.Core 2357 * @crossplatform 2358 * @form 2359 * @atomicservice 2360 * @since 12 2361 */ 2362 UNKNOWN = 0, 2363 2364 /** 2365 * Indicates that the image has no alpha channel, or all pixels in the image are fully opaque. 2366 * 2367 * @syscap SystemCapability.Multimedia.Image.Core 2368 * @since 9 2369 */ 2370 /** 2371 * Indicates that the image has no alpha channel, or all pixels in the image are fully opaque. 2372 * 2373 * @syscap SystemCapability.Multimedia.Image.Core 2374 * @crossplatform 2375 * @since 10 2376 */ 2377 /** 2378 * Indicates that the image has no alpha channel, or all pixels in the image are fully opaque. 2379 * 2380 * @syscap SystemCapability.Multimedia.Image.Core 2381 * @crossplatform 2382 * @atomicservice 2383 * @since 11 2384 */ 2385 /** 2386 * Indicates that the image has no alpha channel, or all pixels in the image are fully opaque. 2387 * 2388 * @syscap SystemCapability.Multimedia.Image.Core 2389 * @crossplatform 2390 * @form 2391 * @atomicservice 2392 * @since 12 2393 */ 2394 OPAQUE = 1, 2395 2396 /** 2397 * Indicates that RGB components of each pixel in the image are premultiplied by alpha. 2398 * 2399 * @syscap SystemCapability.Multimedia.Image.Core 2400 * @since 9 2401 */ 2402 /** 2403 * Indicates that RGB components of each pixel in the image are premultiplied by alpha. 2404 * 2405 * @syscap SystemCapability.Multimedia.Image.Core 2406 * @crossplatform 2407 * @since 10 2408 */ 2409 /** 2410 * Indicates that RGB components of each pixel in the image are premultiplied by alpha. 2411 * 2412 * @syscap SystemCapability.Multimedia.Image.Core 2413 * @crossplatform 2414 * @atomicservice 2415 * @since 11 2416 */ 2417 /** 2418 * Indicates that RGB components of each pixel in the image are premultiplied by alpha. 2419 * 2420 * @syscap SystemCapability.Multimedia.Image.Core 2421 * @crossplatform 2422 * @form 2423 * @atomicservice 2424 * @since 12 2425 */ 2426 PREMUL = 2, 2427 2428 /** 2429 * Indicates that RGB components of each pixel in the image are independent of alpha and are not premultiplied by alpha. 2430 * 2431 * @syscap SystemCapability.Multimedia.Image.Core 2432 * @since 9 2433 */ 2434 /** 2435 * Indicates that RGB components of each pixel in the image are independent of alpha and are not premultiplied by alpha. 2436 * 2437 * @syscap SystemCapability.Multimedia.Image.Core 2438 * @crossplatform 2439 * @since 10 2440 */ 2441 /** 2442 * Indicates that RGB components of each pixel in the image are independent of alpha and are not premultiplied by alpha. 2443 * 2444 * @syscap SystemCapability.Multimedia.Image.Core 2445 * @crossplatform 2446 * @atomicservice 2447 * @since 11 2448 */ 2449 /** 2450 * Indicates that RGB components of each pixel in the image are independent of alpha and are not premultiplied by alpha. 2451 * 2452 * @syscap SystemCapability.Multimedia.Image.Core 2453 * @crossplatform 2454 * @form 2455 * @atomicservice 2456 * @since 12 2457 */ 2458 UNPREMUL = 3 2459 } 2460 2461 /** 2462 * Enumerates decoding dynamic range. 2463 * 2464 * @enum { number } 2465 * @syscap SystemCapability.Multimedia.Image.Core 2466 * @since 12 2467 */ 2468 enum DecodingDynamicRange { 2469 /** 2470 * Decoding according to the content of the image. 2471 * 2472 * @syscap SystemCapability.Multimedia.Image.Core 2473 * @since 12 2474 */ 2475 AUTO = 0, 2476 2477 /** 2478 * Decoding to standard dynamic range. 2479 * 2480 * @syscap SystemCapability.Multimedia.Image.Core 2481 * @since 12 2482 */ 2483 SDR = 1, 2484 2485 /** 2486 * Decoding to high dynamic range. 2487 * 2488 * @syscap SystemCapability.Multimedia.Image.Core 2489 * @since 12 2490 */ 2491 HDR = 2 2492 } 2493 2494 /** 2495 * Enumerates packing dynamic range. 2496 * 2497 * @enum { number } 2498 * @syscap SystemCapability.Multimedia.Image.Core 2499 * @since 12 2500 */ 2501 enum PackingDynamicRange { 2502 /** 2503 * Packing according to the content of the image. 2504 * 2505 * @syscap SystemCapability.Multimedia.Image.Core 2506 * @since 12 2507 */ 2508 AUTO = 0, 2509 2510 /** 2511 * Packing to standard dynamic range. 2512 * 2513 * @syscap SystemCapability.Multimedia.Image.Core 2514 * @since 12 2515 */ 2516 SDR = 1, 2517 } 2518 2519 /** 2520 * Enumerates the anti-aliasing level. 2521 * 2522 * @enum { number } 2523 * @syscap SystemCapability.Multimedia.Image.Core 2524 * @since 12 2525 */ 2526 enum AntiAliasingLevel { 2527 /** 2528 * Nearest-neighbor interpolation algorithm. 2529 * 2530 * @syscap SystemCapability.Multimedia.Image.Core 2531 * @since 12 2532 */ 2533 NONE = 0, 2534 2535 /** 2536 * Bilinear interpolation algorithm. 2537 * 2538 * @syscap SystemCapability.Multimedia.Image.Core 2539 * @since 12 2540 */ 2541 LOW = 1, 2542 2543 /** 2544 * Bilinear interpolation algorithm with mipmap linear filtering. 2545 * 2546 * @syscap SystemCapability.Multimedia.Image.Core 2547 * @since 12 2548 */ 2549 MEDIUM = 2, 2550 2551 /** 2552 * Cubic interpolation algorithm. 2553 * 2554 * @syscap SystemCapability.Multimedia.Image.Core 2555 * @since 12 2556 */ 2557 HIGH = 3, 2558 } 2559 2560 /** 2561 * Enum for image scale mode. 2562 * 2563 * @enum { number } 2564 * @syscap SystemCapability.Multimedia.Image.Core 2565 * @since 9 2566 */ 2567 /** 2568 * Enum for image scale mode. 2569 * 2570 * @enum { number } 2571 * @syscap SystemCapability.Multimedia.Image.Core 2572 * @crossplatform 2573 * @since 10 2574 */ 2575 /** 2576 * Enum for image scale mode. 2577 * 2578 * @enum { number } 2579 * @syscap SystemCapability.Multimedia.Image.Core 2580 * @crossplatform 2581 * @atomicservice 2582 * @since 11 2583 */ 2584 /** 2585 * Enum for image scale mode. 2586 * 2587 * @enum { number } 2588 * @syscap SystemCapability.Multimedia.Image.Core 2589 * @crossplatform 2590 * @form 2591 * @atomicservice 2592 * @since 12 2593 */ 2594 enum ScaleMode { 2595 /** 2596 * Indicates the effect that fits the image into the target size. 2597 * 2598 * @syscap SystemCapability.Multimedia.Image.Core 2599 * @since 9 2600 */ 2601 /** 2602 * Indicates the effect that fits the image into the target size. 2603 * 2604 * @syscap SystemCapability.Multimedia.Image.Core 2605 * @crossplatform 2606 * @since 10 2607 */ 2608 /** 2609 * Indicates the effect that fits the image into the target size. 2610 * 2611 * @syscap SystemCapability.Multimedia.Image.Core 2612 * @crossplatform 2613 * @atomicservice 2614 * @since 11 2615 */ 2616 /** 2617 * Indicates the effect that fits the image into the target size. 2618 * 2619 * @syscap SystemCapability.Multimedia.Image.Core 2620 * @crossplatform 2621 * @form 2622 * @atomicservice 2623 * @since 12 2624 */ 2625 FIT_TARGET_SIZE = 0, 2626 2627 /** 2628 * Indicates the effect that scales an image to fill the target image area and center-crops the part outside the area. 2629 * 2630 * @syscap SystemCapability.Multimedia.Image.Core 2631 * @since 9 2632 */ 2633 /** 2634 * Indicates the effect that scales an image to fill the target image area and center-crops the part outside the area. 2635 * 2636 * @syscap SystemCapability.Multimedia.Image.Core 2637 * @crossplatform 2638 * @since 10 2639 */ 2640 /** 2641 * Indicates the effect that scales an image to fill the target image area and center-crops the part outside the area. 2642 * 2643 * @syscap SystemCapability.Multimedia.Image.Core 2644 * @crossplatform 2645 * @atomicservice 2646 * @since 11 2647 */ 2648 /** 2649 * Indicates the effect that scales an image to fill the target image area and center-crops the part outside the area. 2650 * 2651 * @syscap SystemCapability.Multimedia.Image.Core 2652 * @crossplatform 2653 * @form 2654 * @atomicservice 2655 * @since 12 2656 */ 2657 CENTER_CROP = 1 2658 } 2659 2660 /** 2661 * The component type of image. 2662 * 2663 * @enum { number } 2664 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 2665 * @since 9 2666 */ 2667 enum ComponentType { 2668 /** 2669 * Luma info. 2670 * 2671 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 2672 * @since 9 2673 */ 2674 YUV_Y = 1, 2675 2676 /** 2677 * Chrominance info. 2678 * 2679 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 2680 * @since 9 2681 */ 2682 YUV_U = 2, 2683 2684 /** 2685 * Chroma info. 2686 * 2687 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 2688 * @since 9 2689 */ 2690 YUV_V = 3, 2691 2692 /** 2693 * Jpeg type. 2694 * 2695 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 2696 * @since 9 2697 */ 2698 JPEG = 4 2699 } 2700 2701 /** 2702 * Enumerates the HDR metadata types that need to be stored in Pixelmap. 2703 * 2704 * @enum { number } 2705 * @syscap SystemCapability.Multimedia.Image.Core 2706 * @since 12 2707 */ 2708 enum HdrMetadataKey { 2709 /** 2710 * Indicate the types of metadata that image needs to use. 2711 * 2712 * @syscap SystemCapability.Multimedia.Image.Core 2713 * @since 12 2714 */ 2715 HDR_METADATA_TYPE = 0, 2716 2717 /** 2718 * Static metadata key. 2719 * 2720 * @syscap SystemCapability.Multimedia.Image.Core 2721 * @since 12 2722 */ 2723 HDR_STATIC_METADATA = 1, 2724 2725 /** 2726 * Dynamic metadata key. 2727 * 2728 * @syscap SystemCapability.Multimedia.Image.Core 2729 * @since 12 2730 */ 2731 HDR_DYNAMIC_METADATA = 2, 2732 2733 /** 2734 * Gainmap metadata key. 2735 * 2736 * @syscap SystemCapability.Multimedia.Image.Core 2737 * @since 12 2738 */ 2739 HDR_GAINMAP_METADATA = 3, 2740 } 2741 2742 /** 2743 * Value for HDR_METADATA_TYPE. 2744 * 2745 * @enum { number } 2746 * @syscap SystemCapability.Multimedia.Image.Core 2747 * @since 12 2748 */ 2749 enum HdrMetadataType { 2750 /** 2751 * No metadata. 2752 * 2753 * @syscap SystemCapability.Multimedia.Image.Core 2754 * @since 12 2755 */ 2756 NONE = 0, 2757 2758 /** 2759 * Indicates that metadata will be used for the base image. 2760 * 2761 * @syscap SystemCapability.Multimedia.Image.Core 2762 * @since 12 2763 */ 2764 BASE = 1, 2765 2766 /** 2767 * Indicates that metadata will be used for the gainmap image. 2768 * 2769 * @syscap SystemCapability.Multimedia.Image.Core 2770 * @since 12 2771 */ 2772 GAINMAP = 2, 2773 2774 /** 2775 * Indicates that metadata will be used for the alternate image. 2776 * 2777 * @syscap SystemCapability.Multimedia.Image.Core 2778 * @since 12 2779 */ 2780 ALTERNATE = 3, 2781 } 2782 2783 /** 2784 * Describes region information. 2785 * 2786 * @typedef Region 2787 * @syscap SystemCapability.Multimedia.Image.Core 2788 * @since 8 2789 */ 2790 /** 2791 * Describes region information. 2792 * 2793 * @typedef Region 2794 * @syscap SystemCapability.Multimedia.Image.Core 2795 * @crossplatform 2796 * @since 10 2797 */ 2798 /** 2799 * Describes region information. 2800 * 2801 * @typedef Region 2802 * @syscap SystemCapability.Multimedia.Image.Core 2803 * @crossplatform 2804 * @atomicservice 2805 * @since 11 2806 */ 2807 /** 2808 * Describes region information. 2809 * 2810 * @typedef Region 2811 * @syscap SystemCapability.Multimedia.Image.Core 2812 * @crossplatform 2813 * @form 2814 * @atomicservice 2815 * @since 12 2816 */ 2817 interface Region { 2818 /** 2819 * Image size. 2820 * 2821 * @type { Size } 2822 * @syscap SystemCapability.Multimedia.Image.Core 2823 * @since 7 2824 */ 2825 /** 2826 * Image size. 2827 * 2828 * @type { Size } 2829 * @syscap SystemCapability.Multimedia.Image.Core 2830 * @crossplatform 2831 * @since 10 2832 */ 2833 /** 2834 * Image size. 2835 * 2836 * @type { Size } 2837 * @syscap SystemCapability.Multimedia.Image.Core 2838 * @crossplatform 2839 * @atomicservice 2840 * @since 11 2841 */ 2842 /** 2843 * Image size. 2844 * 2845 * @type { Size } 2846 * @syscap SystemCapability.Multimedia.Image.Core 2847 * @crossplatform 2848 * @form 2849 * @atomicservice 2850 * @since 12 2851 */ 2852 size: Size; 2853 2854 /** 2855 * x-coordinate at the upper left corner of the image. 2856 * 2857 * @type { number } 2858 * @syscap SystemCapability.Multimedia.Image.Core 2859 * @since 7 2860 */ 2861 /** 2862 * x-coordinate at the upper left corner of the image. 2863 * 2864 * @type { number } 2865 * @syscap SystemCapability.Multimedia.Image.Core 2866 * @crossplatform 2867 * @since 10 2868 */ 2869 /** 2870 * x-coordinate at the upper left corner of the image. 2871 * 2872 * @type { number } 2873 * @syscap SystemCapability.Multimedia.Image.Core 2874 * @crossplatform 2875 * @atomicservice 2876 * @since 11 2877 */ 2878 /** 2879 * x-coordinate at the upper left corner of the image. 2880 * 2881 * @type { number } 2882 * @syscap SystemCapability.Multimedia.Image.Core 2883 * @crossplatform 2884 * @form 2885 * @atomicservice 2886 * @since 12 2887 */ 2888 x: number; 2889 2890 /** 2891 * y-coordinate at the upper left corner of the image. 2892 * 2893 * @type { number } 2894 * @syscap SystemCapability.Multimedia.Image.Core 2895 * @since 7 2896 */ 2897 /** 2898 * y-coordinate at the upper left corner of the image. 2899 * 2900 * @type { number } 2901 * @syscap SystemCapability.Multimedia.Image.Core 2902 * @crossplatform 2903 * @since 10 2904 */ 2905 /** 2906 * y-coordinate at the upper left corner of the image. 2907 * 2908 * @type { number } 2909 * @syscap SystemCapability.Multimedia.Image.Core 2910 * @crossplatform 2911 * @atomicservice 2912 * @since 11 2913 */ 2914 /** 2915 * y-coordinate at the upper left corner of the image. 2916 * 2917 * @type { number } 2918 * @syscap SystemCapability.Multimedia.Image.Core 2919 * @crossplatform 2920 * @form 2921 * @atomicservice 2922 * @since 12 2923 */ 2924 y: number; 2925 } 2926 2927 /** 2928 * Describes area information in an image. 2929 * 2930 * @typedef PositionArea 2931 * @syscap SystemCapability.Multimedia.Image.Core 2932 * @since 7 2933 */ 2934 /** 2935 * Describes area information in an image. 2936 * 2937 * @typedef PositionArea 2938 * @syscap SystemCapability.Multimedia.Image.Core 2939 * @crossplatform 2940 * @since 10 2941 */ 2942 /** 2943 * Describes area information in an image. 2944 * 2945 * @typedef PositionArea 2946 * @syscap SystemCapability.Multimedia.Image.Core 2947 * @crossplatform 2948 * @atomicservice 2949 * @since 11 2950 */ 2951 /** 2952 * Describes area information in an image. 2953 * 2954 * @typedef PositionArea 2955 * @syscap SystemCapability.Multimedia.Image.Core 2956 * @crossplatform 2957 * @form 2958 * @atomicservice 2959 * @since 12 2960 */ 2961 interface PositionArea { 2962 /** 2963 * Image data that will be read or written. 2964 * 2965 * @type { ArrayBuffer } 2966 * @syscap SystemCapability.Multimedia.Image.Core 2967 * @since 7 2968 */ 2969 /** 2970 * Image data that will be read or written. 2971 * 2972 * @type { ArrayBuffer } 2973 * @syscap SystemCapability.Multimedia.Image.Core 2974 * @crossplatform 2975 * @since 10 2976 */ 2977 /** 2978 * Image data that will be read or written. 2979 * 2980 * @type { ArrayBuffer } 2981 * @syscap SystemCapability.Multimedia.Image.Core 2982 * @crossplatform 2983 * @atomicservice 2984 * @since 11 2985 */ 2986 /** 2987 * Image data that will be read or written. 2988 * 2989 * @type { ArrayBuffer } 2990 * @syscap SystemCapability.Multimedia.Image.Core 2991 * @crossplatform 2992 * @form 2993 * @atomicservice 2994 * @since 12 2995 */ 2996 pixels: ArrayBuffer; 2997 2998 /** 2999 * Offset for data reading. 3000 * 3001 * @type { number } 3002 * @syscap SystemCapability.Multimedia.Image.Core 3003 * @since 7 3004 */ 3005 /** 3006 * Offset for data reading. 3007 * 3008 * @type { number } 3009 * @syscap SystemCapability.Multimedia.Image.Core 3010 * @crossplatform 3011 * @since 10 3012 */ 3013 /** 3014 * Offset for data reading. 3015 * 3016 * @type { number } 3017 * @syscap SystemCapability.Multimedia.Image.Core 3018 * @crossplatform 3019 * @atomicservice 3020 * @since 11 3021 */ 3022 /** 3023 * Offset for data reading. 3024 * 3025 * @type { number } 3026 * @syscap SystemCapability.Multimedia.Image.Core 3027 * @crossplatform 3028 * @form 3029 * @atomicservice 3030 * @since 12 3031 */ 3032 offset: number; 3033 3034 /** 3035 * Number of bytes to read. 3036 * 3037 * @type { number } 3038 * @syscap SystemCapability.Multimedia.Image.Core 3039 * @since 7 3040 */ 3041 /** 3042 * Number of bytes to read. 3043 * 3044 * @type { number } 3045 * @syscap SystemCapability.Multimedia.Image.Core 3046 * @crossplatform 3047 * @since 10 3048 */ 3049 /** 3050 * Number of bytes to read. 3051 * 3052 * @type { number } 3053 * @syscap SystemCapability.Multimedia.Image.Core 3054 * @crossplatform 3055 * @atomicservice 3056 * @since 11 3057 */ 3058 /** 3059 * Number of bytes to read. 3060 * 3061 * @type { number } 3062 * @syscap SystemCapability.Multimedia.Image.Core 3063 * @crossplatform 3064 * @form 3065 * @atomicservice 3066 * @since 12 3067 */ 3068 stride: number; 3069 3070 /** 3071 * Region to read. 3072 * 3073 * @type { Region } 3074 * @syscap SystemCapability.Multimedia.Image.Core 3075 * @since 7 3076 */ 3077 /** 3078 * Region to read. 3079 * 3080 * @type { Region } 3081 * @syscap SystemCapability.Multimedia.Image.Core 3082 * @crossplatform 3083 * @since 10 3084 */ 3085 /** 3086 * Region to read. 3087 * 3088 * @type { Region } 3089 * @syscap SystemCapability.Multimedia.Image.Core 3090 * @crossplatform 3091 * @atomicservice 3092 * @since 11 3093 */ 3094 /** 3095 * Region to read. 3096 * 3097 * @type { Region } 3098 * @syscap SystemCapability.Multimedia.Image.Core 3099 * @crossplatform 3100 * @form 3101 * @atomicservice 3102 * @since 12 3103 */ 3104 region: Region; 3105 } 3106 3107 /** 3108 * Describes image information. 3109 * 3110 * @typedef ImageInfo 3111 * @syscap SystemCapability.Multimedia.Image.Core 3112 * @since 6 3113 */ 3114 /** 3115 * Describes image information. 3116 * 3117 * @typedef ImageInfo 3118 * @syscap SystemCapability.Multimedia.Image.Core 3119 * @crossplatform 3120 * @since 10 3121 */ 3122 /** 3123 * Describes image information. 3124 * 3125 * @typedef ImageInfo 3126 * @syscap SystemCapability.Multimedia.Image.Core 3127 * @crossplatform 3128 * @atomicservice 3129 * @since 11 3130 */ 3131 /** 3132 * Describes image information. 3133 * 3134 * @typedef ImageInfo 3135 * @syscap SystemCapability.Multimedia.Image.Core 3136 * @crossplatform 3137 * @form 3138 * @atomicservice 3139 * @since 12 3140 */ 3141 interface ImageInfo { 3142 /** 3143 * Indicates image dimensions specified by a {@link Size} interface. 3144 * 3145 * @type { Size } 3146 * @syscap SystemCapability.Multimedia.Image.Core 3147 * @since 6 3148 */ 3149 /** 3150 * Indicates image dimensions specified by a {@link Size} interface. 3151 * 3152 * @type { Size } 3153 * @syscap SystemCapability.Multimedia.Image.Core 3154 * @crossplatform 3155 * @since 10 3156 */ 3157 /** 3158 * Indicates image dimensions specified by a {@link Size} interface. 3159 * 3160 * @type { Size } 3161 * @syscap SystemCapability.Multimedia.Image.Core 3162 * @crossplatform 3163 * @atomicservice 3164 * @since 11 3165 */ 3166 /** 3167 * Indicates image dimensions specified by a {@link Size} interface. 3168 * 3169 * @type { Size } 3170 * @syscap SystemCapability.Multimedia.Image.Core 3171 * @crossplatform 3172 * @form 3173 * @atomicservice 3174 * @since 12 3175 */ 3176 size: Size; 3177 3178 /** 3179 * Indicates image default density. 3180 * 3181 * @type { number } 3182 * @syscap SystemCapability.Multimedia.Image.Core 3183 * @since 9 3184 */ 3185 /** 3186 * Indicates image default density. 3187 * 3188 * @type { number } 3189 * @syscap SystemCapability.Multimedia.Image.Core 3190 * @crossplatform 3191 * @since 10 3192 */ 3193 /** 3194 * Indicates image default density. 3195 * 3196 * @type { number } 3197 * @syscap SystemCapability.Multimedia.Image.Core 3198 * @crossplatform 3199 * @atomicservice 3200 * @since 11 3201 */ 3202 /** 3203 * Indicates image default density. 3204 * 3205 * @type { number } 3206 * @syscap SystemCapability.Multimedia.Image.Core 3207 * @crossplatform 3208 * @form 3209 * @atomicservice 3210 * @since 12 3211 */ 3212 density: number; 3213 3214 /** 3215 * The number of byte per row. 3216 * 3217 * @type { number } 3218 * @syscap SystemCapability.Multimedia.Image.Core 3219 * @atomicservice 3220 * @since 11 3221 */ 3222 /** 3223 * The number of byte per row. 3224 * 3225 * @type { number } 3226 * @syscap SystemCapability.Multimedia.Image.Core 3227 * @form 3228 * @atomicservice 3229 * @since 12 3230 */ 3231 stride: number; 3232 3233 /** 3234 * Indicates image format. 3235 * 3236 * @type { PixelMapFormat } 3237 * @syscap SystemCapability.Multimedia.Image.Core 3238 * @crossplatform 3239 * @form 3240 * @atomicservice 3241 * @since 12 3242 */ 3243 pixelFormat: PixelMapFormat; 3244 3245 /** 3246 * Indicates image alpha type. 3247 * 3248 * @type { AlphaType } 3249 * @syscap SystemCapability.Multimedia.Image.Core 3250 * @crossplatform 3251 * @form 3252 * @atomicservice 3253 * @since 12 3254 */ 3255 alphaType: AlphaType; 3256 3257 /** 3258 * Indicates image mime type. 3259 * 3260 * @type { string } 3261 * @syscap SystemCapability.Multimedia.Image.Core 3262 * @crossplatform 3263 * @since 12 3264 */ 3265 mimeType: string; 3266 3267 /** 3268 * Indicates whether the image high dynamic range 3269 * 3270 * @type { boolean } 3271 * @syscap SystemCapability.Multimedia.Image.Core 3272 * @since 12 3273 */ 3274 isHdr: boolean; 3275 } 3276 3277 /** 3278 * Describes the option for image packing. 3279 * 3280 * @typedef PackingOption 3281 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3282 * @since 6 3283 */ 3284 /** 3285 * Describes the option for image packing. 3286 * 3287 * @typedef PackingOption 3288 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3289 * @crossplatform 3290 * @since 10 3291 */ 3292 /** 3293 * Describes the option for image packing. 3294 * 3295 * @typedef PackingOption 3296 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3297 * @crossplatform 3298 * @atomicservice 3299 * @since 11 3300 */ 3301 interface PackingOption { 3302 /** 3303 * Multipurpose Internet Mail Extensions (MIME) format of the target image, for example, image/jpeg. 3304 * 3305 * @type { string } 3306 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3307 * @since 6 3308 */ 3309 /** 3310 * Multipurpose Internet Mail Extensions (MIME) format of the target image, for example, image/jpeg. 3311 * 3312 * @type { string } 3313 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3314 * @crossplatform 3315 * @since 10 3316 */ 3317 /** 3318 * Multipurpose Internet Mail Extensions (MIME) format of the target image, for example, image/jpeg. 3319 * 3320 * @type { string } 3321 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3322 * @crossplatform 3323 * @atomicservice 3324 * @since 11 3325 */ 3326 format: string; 3327 3328 /** 3329 * Quality of the target image. The value is an integer ranging from 0 to 100. A larger value indicates better. 3330 * 3331 * @type { number } 3332 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3333 * @since 6 3334 */ 3335 /** 3336 * Quality of the target image. The value is an integer ranging from 0 to 100. A larger value indicates better. 3337 * 3338 * @type { number } 3339 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3340 * @crossplatform 3341 * @since 10 3342 */ 3343 /** 3344 * Quality of the target image. The value is an integer ranging from 0 to 100. A larger value indicates better. 3345 * 3346 * @type { number } 3347 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3348 * @crossplatform 3349 * @atomicservice 3350 * @since 11 3351 */ 3352 quality: number; 3353 3354 /** 3355 * BufferSize of the target image. 3356 * If this bufferSize is less than or equal to 0, it will be converted to 10MB. 3357 * 3358 * @type { ?number } 3359 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3360 * @since 9 3361 */ 3362 /** 3363 * BufferSize of the target image. 3364 * If this bufferSize is less than or equal to 0, it will be converted to 10MB. 3365 * 3366 * @type { ?number } 3367 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3368 * @crossplatform 3369 * @since 10 3370 */ 3371 /** 3372 * BufferSize of the target image. 3373 * If this bufferSize is less than or equal to 0, it will be converted to 10MB. 3374 * 3375 * @type { ?number } 3376 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3377 * @crossplatform 3378 * @atomicservice 3379 * @since 11 3380 */ 3381 bufferSize?: number; 3382 3383 /** 3384 * The desired dynamic range of the target image. 3385 * 3386 * @type { ?PackingDynamicRange } 3387 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3388 * @since 12 3389 */ 3390 desiredDynamicRange?: PackingDynamicRange; 3391 3392 /** 3393 * Whether the image properties can be saved, like Exif. 3394 * 3395 * @type { ?boolean } 3396 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3397 * @since 12 3398 */ 3399 needsPackProperties?: boolean; 3400 } 3401 3402 /** 3403 * Describes the options for image sequence packing. 3404 * 3405 * @typedef PackingOptionsForSequence 3406 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3407 * @since 13 3408 */ 3409 interface PackingOptionsForSequence { 3410 /** 3411 * Specify the number of frames. 3412 * 3413 * @type { number } 3414 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3415 * @since 13 3416 */ 3417 frameCount: number; 3418 3419 /** 3420 * Specify the delay time for each frame of the dynamic image. 3421 * If the length is less than frameCount, the missing parts will be filling with the last value 3422 * 3423 * @type { Array<number> } 3424 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3425 * @since 13 3426 */ 3427 delayTimeList: Array<number>; 3428 3429 /** 3430 * Specify the disposal types of each frame in the image sequence packing. 3431 * 3432 * @type { ?Array<number> } 3433 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3434 * @since 13 3435 */ 3436 disposalTypes?: Array<number>; 3437 3438 /** 3439 * Specify the number of times the loop should, the range is [0, 65535] 3440 * If this loop is equal to 0, it will be infinite loop. 3441 * 3442 * @type { ?number } 3443 * @syscap SystemCapability.Multimedia.Image.ImagePacker 3444 * @since 13 3445 */ 3446 loopCount?: number; 3447 } 3448 3449 /** 3450 * Describes image properties. 3451 * 3452 * @typedef GetImagePropertyOptions 3453 * @syscap SystemCapability.Multimedia.Image.ImageSource 3454 * @since 7 3455 * @deprecated since 11 3456 * @useinstead image.ImagePropertyOptions 3457 */ 3458 /** 3459 * Describes image properties. 3460 * 3461 * @typedef GetImagePropertyOptions 3462 * @syscap SystemCapability.Multimedia.Image.ImageSource 3463 * @crossplatform 3464 * @since 10 3465 * @deprecated since 11 3466 * @useinstead image.ImagePropertyOptions 3467 */ 3468 interface GetImagePropertyOptions { 3469 /** 3470 * Index of an image. 3471 * 3472 * @type { ?number } 3473 * @syscap SystemCapability.Multimedia.Image.ImageSource 3474 * @since 7 3475 * @deprecated since 11 3476 * @useinstead image.ImagePropertyOptions#index 3477 */ 3478 /** 3479 * Index of an image. 3480 * 3481 * @type { ?number } 3482 * @syscap SystemCapability.Multimedia.Image.ImageSource 3483 * @crossplatform 3484 * @since 10 3485 * @deprecated since 11 3486 * @useinstead image.ImagePropertyOptions#index 3487 */ 3488 index?: number; 3489 3490 /** 3491 * Default property value. 3492 * 3493 * @type { ?string } 3494 * @syscap SystemCapability.Multimedia.Image.ImageSource 3495 * @since 7 3496 * @deprecated since 11 3497 * @useinstead image.ImagePropertyOptions#defaultValue 3498 */ 3499 /** 3500 * Default property value. 3501 * 3502 * @type { ?string } 3503 * @syscap SystemCapability.Multimedia.Image.ImageSource 3504 * @crossplatform 3505 * @since 10 3506 * @deprecated since 11 3507 * @useinstead image.ImagePropertyOptions#defaultValue 3508 */ 3509 defaultValue?: string; 3510 } 3511 3512 /** 3513 * Describes image properties. 3514 * 3515 * @typedef ImagePropertyOptions 3516 * @syscap SystemCapability.Multimedia.Image.ImageSource 3517 * @crossplatform 3518 * @since 11 3519 */ 3520 interface ImagePropertyOptions { 3521 /** 3522 * Index of an image. 3523 * 3524 * @type { ?number } 3525 * @syscap SystemCapability.Multimedia.Image.ImageSource 3526 * @crossplatform 3527 * @since 11 3528 */ 3529 index?: number; 3530 3531 /** 3532 * Default property value. 3533 * 3534 * @type { ?string } 3535 * @syscap SystemCapability.Multimedia.Image.ImageSource 3536 * @crossplatform 3537 * @since 11 3538 */ 3539 defaultValue?: string; 3540 } 3541 3542 /** 3543 * Describes image decoding parameters. 3544 * 3545 * @typedef DecodingOptions 3546 * @syscap SystemCapability.Multimedia.Image.ImageSource 3547 * @since 7 3548 */ 3549 /** 3550 * Describes image decoding parameters. 3551 * 3552 * @typedef DecodingOptions 3553 * @syscap SystemCapability.Multimedia.Image.ImageSource 3554 * @crossplatform 3555 * @since 10 3556 */ 3557 /** 3558 * Describes image decoding parameters. 3559 * 3560 * @typedef DecodingOptions 3561 * @syscap SystemCapability.Multimedia.Image.ImageSource 3562 * @crossplatform 3563 * @atomicservice 3564 * @since 11 3565 */ 3566 /** 3567 * Describes image decoding parameters. 3568 * 3569 * @typedef DecodingOptions 3570 * @syscap SystemCapability.Multimedia.Image.ImageSource 3571 * @crossplatform 3572 * @form 3573 * @atomicservice 3574 * @since 12 3575 */ 3576 interface DecodingOptions { 3577 /** 3578 * Number of image frames. 3579 * 3580 * @type { ?number } 3581 * @syscap SystemCapability.Multimedia.Image.ImageSource 3582 * @since 7 3583 */ 3584 /** 3585 * Number of image frames. 3586 * 3587 * @type { ?number } 3588 * @syscap SystemCapability.Multimedia.Image.ImageSource 3589 * @crossplatform 3590 * @since 10 3591 */ 3592 /** 3593 * Number of image frames. 3594 * 3595 * @type { ?number } 3596 * @syscap SystemCapability.Multimedia.Image.ImageSource 3597 * @crossplatform 3598 * @atomicservice 3599 * @since 11 3600 */ 3601 /** 3602 * Number of image frames. 3603 * 3604 * @type { ?number } 3605 * @syscap SystemCapability.Multimedia.Image.ImageSource 3606 * @crossplatform 3607 * @form 3608 * @atomicservice 3609 * @since 12 3610 */ 3611 index?: number; 3612 3613 /** 3614 * Sampling ratio of the image pixel map. 3615 * 3616 * @type { ?number } 3617 * @syscap SystemCapability.Multimedia.Image.ImageSource 3618 * @since 7 3619 */ 3620 /** 3621 * Sampling ratio of the image pixel map. 3622 * 3623 * @type { ?number } 3624 * @syscap SystemCapability.Multimedia.Image.ImageSource 3625 * @crossplatform 3626 * @since 10 3627 */ 3628 /** 3629 * Sampling ratio of the image pixel map. 3630 * 3631 * @type { ?number } 3632 * @syscap SystemCapability.Multimedia.Image.ImageSource 3633 * @crossplatform 3634 * @atomicservice 3635 * @since 11 3636 */ 3637 /** 3638 * Sampling ratio of the image pixel map. 3639 * 3640 * @type { ?number } 3641 * @syscap SystemCapability.Multimedia.Image.ImageSource 3642 * @crossplatform 3643 * @form 3644 * @atomicservice 3645 * @since 12 3646 */ 3647 sampleSize?: number; 3648 3649 /** 3650 * Rotation angle of the image pixel map. The value ranges from 0 to 360. 3651 * 3652 * @type { ?number } 3653 * @syscap SystemCapability.Multimedia.Image.ImageSource 3654 * @since 7 3655 */ 3656 /** 3657 * Rotation angle of the image pixel map. The value ranges from 0 to 360. 3658 * 3659 * @type { ?number } 3660 * @syscap SystemCapability.Multimedia.Image.ImageSource 3661 * @crossplatform 3662 * @since 10 3663 */ 3664 /** 3665 * Rotation angle of the image pixel map. The value ranges from 0 to 360. 3666 * 3667 * @type { ?number } 3668 * @syscap SystemCapability.Multimedia.Image.ImageSource 3669 * @crossplatform 3670 * @atomicservice 3671 * @since 11 3672 */ 3673 /** 3674 * Rotation angle of the image pixel map. The value ranges from 0 to 360. 3675 * 3676 * @type { ?number } 3677 * @syscap SystemCapability.Multimedia.Image.ImageSource 3678 * @crossplatform 3679 * @form 3680 * @atomicservice 3681 * @since 12 3682 */ 3683 rotate?: number; 3684 3685 /** 3686 * Whether the image pixel map is editable. 3687 * 3688 * @type { ?boolean } 3689 * @syscap SystemCapability.Multimedia.Image.ImageSource 3690 * @since 7 3691 */ 3692 /** 3693 * Whether the image pixel map is editable. 3694 * 3695 * @type { ?boolean } 3696 * @syscap SystemCapability.Multimedia.Image.ImageSource 3697 * @crossplatform 3698 * @since 10 3699 */ 3700 /** 3701 * Whether the image pixel map is editable. 3702 * 3703 * @type { ?boolean } 3704 * @syscap SystemCapability.Multimedia.Image.ImageSource 3705 * @crossplatform 3706 * @atomicservice 3707 * @since 11 3708 */ 3709 /** 3710 * Whether the image pixel map is editable. 3711 * 3712 * @type { ?boolean } 3713 * @syscap SystemCapability.Multimedia.Image.ImageSource 3714 * @crossplatform 3715 * @form 3716 * @atomicservice 3717 * @since 12 3718 */ 3719 editable?: boolean; 3720 3721 /** 3722 * Width and height of the image pixel map. The value (0, 0) indicates that the pixels are decoded 3723 * based on the original image size. 3724 * 3725 * @type { ?Size } 3726 * @syscap SystemCapability.Multimedia.Image.ImageSource 3727 * @since 7 3728 */ 3729 /** 3730 * Width and height of the image pixel map. The value (0, 0) indicates that the pixels are decoded 3731 * based on the original image size. 3732 * 3733 * @type { ?Size } 3734 * @syscap SystemCapability.Multimedia.Image.ImageSource 3735 * @crossplatform 3736 * @since 10 3737 */ 3738 /** 3739 * Width and height of the image pixel map. The value (0, 0) indicates that the pixels are decoded 3740 * based on the original image size. 3741 * 3742 * @type { ?Size } 3743 * @syscap SystemCapability.Multimedia.Image.ImageSource 3744 * @crossplatform 3745 * @atomicservice 3746 * @since 11 3747 */ 3748 /** 3749 * Width and height of the image pixel map. The value (0, 0) indicates that the pixels are decoded 3750 * based on the original image size. 3751 * 3752 * @type { ?Size } 3753 * @syscap SystemCapability.Multimedia.Image.ImageSource 3754 * @crossplatform 3755 * @form 3756 * @atomicservice 3757 * @since 12 3758 */ 3759 desiredSize?: Size; 3760 3761 /** 3762 * Cropping region of the image pixel map. 3763 * 3764 * @type { ?Region } 3765 * @syscap SystemCapability.Multimedia.Image.ImageSource 3766 * @since 7 3767 */ 3768 /** 3769 * Cropping region of the image pixel map. 3770 * 3771 * @type { ?Region } 3772 * @syscap SystemCapability.Multimedia.Image.ImageSource 3773 * @crossplatform 3774 * @since 10 3775 */ 3776 /** 3777 * Cropping region of the image pixel map. 3778 * 3779 * @type { ?Region } 3780 * @syscap SystemCapability.Multimedia.Image.ImageSource 3781 * @crossplatform 3782 * @atomicservice 3783 * @since 11 3784 */ 3785 /** 3786 * Cropping region of the image pixel map. 3787 * 3788 * @type { ?Region } 3789 * @syscap SystemCapability.Multimedia.Image.ImageSource 3790 * @crossplatform 3791 * @form 3792 * @atomicservice 3793 * @since 12 3794 */ 3795 desiredRegion?: Region; 3796 3797 /** 3798 * Data format of the image pixel map. 3799 * 3800 * @type { ?PixelMapFormat } 3801 * @syscap SystemCapability.Multimedia.Image.ImageSource 3802 * @since 7 3803 */ 3804 /** 3805 * Data format of the image pixel map. 3806 * 3807 * @type { ?PixelMapFormat } 3808 * @syscap SystemCapability.Multimedia.Image.ImageSource 3809 * @crossplatform 3810 * @since 10 3811 */ 3812 /** 3813 * Data format of the image pixel map. 3814 * 3815 * @type { ?PixelMapFormat } 3816 * @syscap SystemCapability.Multimedia.Image.ImageSource 3817 * @crossplatform 3818 * @atomicservice 3819 * @since 11 3820 */ 3821 /** 3822 * Data format of the image pixel map. 3823 * 3824 * @type { ?PixelMapFormat } 3825 * @syscap SystemCapability.Multimedia.Image.ImageSource 3826 * @crossplatform 3827 * @form 3828 * @atomicservice 3829 * @since 12 3830 */ 3831 desiredPixelFormat?: PixelMapFormat; 3832 3833 /** 3834 * The density for image pixel map. 3835 * 3836 * @type { ?number } 3837 * @syscap SystemCapability.Multimedia.Image.ImageSource 3838 * @since 9 3839 */ 3840 /** 3841 * The density for image pixel map. 3842 * 3843 * @type { ?number } 3844 * @syscap SystemCapability.Multimedia.Image.ImageSource 3845 * @crossplatform 3846 * @since 10 3847 */ 3848 /** 3849 * The density for image pixel map. 3850 * 3851 * @type { ?number } 3852 * @syscap SystemCapability.Multimedia.Image.ImageSource 3853 * @crossplatform 3854 * @atomicservice 3855 * @since 11 3856 */ 3857 /** 3858 * The density for image pixel map. 3859 * 3860 * @type { ?number } 3861 * @syscap SystemCapability.Multimedia.Image.ImageSource 3862 * @crossplatform 3863 * @form 3864 * @atomicservice 3865 * @since 12 3866 */ 3867 fitDensity?: number; 3868 3869 /** 3870 * Color space of the image pixel map. 3871 * 3872 * @type { ?colorSpaceManager.ColorSpaceManager } 3873 * @syscap SystemCapability.Multimedia.Image.ImageSource 3874 * @crossplatform 3875 * @since 11 3876 */ 3877 desiredColorSpace?: colorSpaceManager.ColorSpaceManager; 3878 3879 /** 3880 * The desired dynamic range of the image pixelmap. 3881 * 3882 * @type { ?DecodingDynamicRange } 3883 * @syscap SystemCapability.Multimedia.Image.ImageSource 3884 * @since 12 3885 */ 3886 desiredDynamicRange?: DecodingDynamicRange; 3887 3888 /** 3889 * Resolution Quality of the image. 3890 * 3891 * @type { ?ResolutionQuality } 3892 * @syscap SystemCapability.Multimedia.Image.ImageSource 3893 * @systemapi 3894 * @since 12 3895 */ 3896 resolutionQuality?: ResolutionQuality; 3897 } 3898 3899 /** 3900 * Describes image color components. 3901 * 3902 * @typedef Component 3903 * @syscap SystemCapability.Multimedia.Image.Core 3904 * @since 9 3905 */ 3906 interface Component { 3907 /** 3908 * Component type. 3909 * 3910 * @type { ComponentType } 3911 * @syscap SystemCapability.Multimedia.Image.Core 3912 * @since 9 3913 */ 3914 readonly componentType: ComponentType; 3915 3916 /** 3917 * Row stride. 3918 * 3919 * @type { number } 3920 * @syscap SystemCapability.Multimedia.Image.Core 3921 * @since 9 3922 */ 3923 readonly rowStride: number; 3924 3925 /** 3926 * Pixel stride. 3927 * 3928 * @type { number } 3929 * @syscap SystemCapability.Multimedia.Image.Core 3930 * @since 9 3931 */ 3932 readonly pixelStride: number; 3933 3934 /** 3935 * Component buffer. 3936 * 3937 * @type { ArrayBuffer } 3938 * @syscap SystemCapability.Multimedia.Image.Core 3939 * @since 9 3940 */ 3941 readonly byteBuffer: ArrayBuffer; 3942 } 3943 3944 /** 3945 * Initialization options for pixelmap. 3946 * 3947 * @typedef InitializationOptions 3948 * @syscap SystemCapability.Multimedia.Image.Core 3949 * @since 8 3950 */ 3951 /** 3952 * Initialization options for pixelmap. 3953 * 3954 * @typedef InitializationOptions 3955 * @syscap SystemCapability.Multimedia.Image.Core 3956 * @crossplatform 3957 * @since 10 3958 */ 3959 /** 3960 * Initialization options for pixelmap. 3961 * 3962 * @typedef InitializationOptions 3963 * @syscap SystemCapability.Multimedia.Image.Core 3964 * @crossplatform 3965 * @atomicservice 3966 * @since 11 3967 */ 3968 /** 3969 * Initialization options for pixelmap. 3970 * 3971 * @typedef InitializationOptions 3972 * @syscap SystemCapability.Multimedia.Image.Core 3973 * @crossplatform 3974 * @form 3975 * @atomicservice 3976 * @since 12 3977 */ 3978 interface InitializationOptions { 3979 /** 3980 * PixelMap size. 3981 * 3982 * @type { Size } 3983 * @syscap SystemCapability.Multimedia.Image.Core 3984 * @since 8 3985 */ 3986 /** 3987 * PixelMap size. 3988 * 3989 * @type { Size } 3990 * @syscap SystemCapability.Multimedia.Image.Core 3991 * @crossplatform 3992 * @since 10 3993 */ 3994 /** 3995 * PixelMap size. 3996 * 3997 * @type { Size } 3998 * @syscap SystemCapability.Multimedia.Image.Core 3999 * @crossplatform 4000 * @atomicservice 4001 * @since 11 4002 */ 4003 /** 4004 * PixelMap size. 4005 * 4006 * @type { Size } 4007 * @syscap SystemCapability.Multimedia.Image.Core 4008 * @crossplatform 4009 * @form 4010 * @atomicservice 4011 * @since 12 4012 */ 4013 size: Size; 4014 4015 /** 4016 * PixelMap source format. 4017 * 4018 * @type { ?PixelMapFormat } 4019 * @syscap SystemCapability.Multimedia.Image.Core 4020 * @since 12 4021 */ 4022 srcPixelFormat?: PixelMapFormat; 4023 4024 /** 4025 * PixelMap expected format. 4026 * 4027 * @type { ?PixelMapFormat } 4028 * @syscap SystemCapability.Multimedia.Image.Core 4029 * @since 8 4030 */ 4031 /** 4032 * PixelMap expected format. 4033 * 4034 * @type { ?PixelMapFormat } 4035 * @syscap SystemCapability.Multimedia.Image.Core 4036 * @crossplatform 4037 * @since 10 4038 */ 4039 /** 4040 * PixelMap expected format. 4041 * 4042 * @type { ?PixelMapFormat } 4043 * @syscap SystemCapability.Multimedia.Image.Core 4044 * @crossplatform 4045 * @atomicservice 4046 * @since 11 4047 */ 4048 /** 4049 * PixelMap expected format. 4050 * 4051 * @type { ?PixelMapFormat } 4052 * @syscap SystemCapability.Multimedia.Image.Core 4053 * @crossplatform 4054 * @form 4055 * @atomicservice 4056 * @since 12 4057 */ 4058 pixelFormat?: PixelMapFormat; 4059 4060 /** 4061 * Editable or not. 4062 * 4063 * @type { ?boolean } 4064 * @syscap SystemCapability.Multimedia.Image.Core 4065 * @since 8 4066 */ 4067 /** 4068 * Editable or not. 4069 * 4070 * @type { ?boolean } 4071 * @syscap SystemCapability.Multimedia.Image.Core 4072 * @crossplatform 4073 * @since 10 4074 */ 4075 /** 4076 * Editable or not. 4077 * 4078 * @type { ?boolean } 4079 * @syscap SystemCapability.Multimedia.Image.Core 4080 * @crossplatform 4081 * @atomicservice 4082 * @since 11 4083 */ 4084 /** 4085 * Editable or not. 4086 * 4087 * @type { ?boolean } 4088 * @syscap SystemCapability.Multimedia.Image.Core 4089 * @crossplatform 4090 * @form 4091 * @atomicservice 4092 * @since 12 4093 */ 4094 editable?: boolean; 4095 4096 /** 4097 * PixelMap expected alpha type. 4098 * 4099 * @type { ?AlphaType } 4100 * @syscap SystemCapability.Multimedia.Image.Core 4101 * @since 9 4102 */ 4103 /** 4104 * PixelMap expected alpha type. 4105 * 4106 * @type { ?AlphaType } 4107 * @syscap SystemCapability.Multimedia.Image.Core 4108 * @crossplatform 4109 * @since 10 4110 */ 4111 /** 4112 * PixelMap expected alpha type. 4113 * 4114 * @type { ?AlphaType } 4115 * @syscap SystemCapability.Multimedia.Image.Core 4116 * @crossplatform 4117 * @atomicservice 4118 * @since 11 4119 */ 4120 /** 4121 * PixelMap expected alpha type. 4122 * 4123 * @type { ?AlphaType } 4124 * @syscap SystemCapability.Multimedia.Image.Core 4125 * @crossplatform 4126 * @form 4127 * @atomicservice 4128 * @since 12 4129 */ 4130 alphaType?: AlphaType; 4131 4132 /** 4133 * PixelMap expected scaling effect. 4134 * 4135 * @type { ?ScaleMode } 4136 * @syscap SystemCapability.Multimedia.Image.Core 4137 * @since 9 4138 */ 4139 /** 4140 * PixelMap expected scaling effect. 4141 * 4142 * @type { ?ScaleMode } 4143 * @syscap SystemCapability.Multimedia.Image.Core 4144 * @crossplatform 4145 * @since 10 4146 */ 4147 /** 4148 * PixelMap expected scaling effect. 4149 * 4150 * @type { ?ScaleMode } 4151 * @syscap SystemCapability.Multimedia.Image.Core 4152 * @crossplatform 4153 * @atomicservice 4154 * @since 11 4155 */ 4156 /** 4157 * PixelMap expected scaling effect. 4158 * 4159 * @type { ?ScaleMode } 4160 * @syscap SystemCapability.Multimedia.Image.Core 4161 * @crossplatform 4162 * @form 4163 * @atomicservice 4164 * @since 12 4165 */ 4166 scaleMode?: ScaleMode; 4167 } 4168 4169 /** 4170 * Initialization options for ImageSource. 4171 * 4172 * @typedef SourceOptions 4173 * @syscap SystemCapability.Multimedia.Image.Core 4174 * @since 9 4175 */ 4176 /** 4177 * Initialization options for ImageSource. 4178 * 4179 * @typedef SourceOptions 4180 * @syscap SystemCapability.Multimedia.Image.Core 4181 * @crossplatform 4182 * @since 10 4183 */ 4184 /** 4185 * Initialization options for ImageSource. 4186 * 4187 * @typedef SourceOptions 4188 * @syscap SystemCapability.Multimedia.Image.Core 4189 * @crossplatform 4190 * @atomicservice 4191 * @since 11 4192 */ 4193 /** 4194 * Initialization options for ImageSource. 4195 * 4196 * @typedef SourceOptions 4197 * @syscap SystemCapability.Multimedia.Image.Core 4198 * @crossplatform 4199 * @form 4200 * @atomicservice 4201 * @since 12 4202 */ 4203 interface SourceOptions { 4204 /** 4205 * The density for ImageSource. 4206 * 4207 * @type { number } 4208 * @syscap SystemCapability.Multimedia.Image.Core 4209 * @since 9 4210 */ 4211 /** 4212 * The density for ImageSource. 4213 * 4214 * @type { number } 4215 * @syscap SystemCapability.Multimedia.Image.Core 4216 * @crossplatform 4217 * @since 10 4218 */ 4219 /** 4220 * The density for ImageSource. 4221 * 4222 * @type { number } 4223 * @syscap SystemCapability.Multimedia.Image.Core 4224 * @crossplatform 4225 * @atomicservice 4226 * @since 11 4227 */ 4228 /** 4229 * The density for ImageSource. 4230 * 4231 * @type { number } 4232 * @syscap SystemCapability.Multimedia.Image.Core 4233 * @crossplatform 4234 * @form 4235 * @atomicservice 4236 * @since 12 4237 */ 4238 sourceDensity: number; 4239 4240 /** 4241 * PixelMap expected format. 4242 * 4243 * @type { ?PixelMapFormat } 4244 * @syscap SystemCapability.Multimedia.Image.Core 4245 * @since 9 4246 */ 4247 /** 4248 * PixelMap expected format. 4249 * 4250 * @type { ?PixelMapFormat } 4251 * @syscap SystemCapability.Multimedia.Image.Core 4252 * @crossplatform 4253 * @since 10 4254 */ 4255 /** 4256 * PixelMap expected format. 4257 * 4258 * @type { ?PixelMapFormat } 4259 * @syscap SystemCapability.Multimedia.Image.Core 4260 * @crossplatform 4261 * @atomicservice 4262 * @since 11 4263 */ 4264 /** 4265 * PixelMap expected format. 4266 * 4267 * @type { ?PixelMapFormat } 4268 * @syscap SystemCapability.Multimedia.Image.Core 4269 * @crossplatform 4270 * @form 4271 * @atomicservice 4272 * @since 12 4273 */ 4274 sourcePixelFormat?: PixelMapFormat; 4275 4276 /** 4277 * PixelMap size. 4278 * 4279 * @type { ?Size } 4280 * @syscap SystemCapability.Multimedia.Image.Core 4281 * @since 9 4282 */ 4283 /** 4284 * PixelMap size. 4285 * 4286 * @type { ?Size } 4287 * @syscap SystemCapability.Multimedia.Image.Core 4288 * @crossplatform 4289 * @since 10 4290 */ 4291 /** 4292 * PixelMap size. 4293 * 4294 * @type { ?Size } 4295 * @syscap SystemCapability.Multimedia.Image.Core 4296 * @crossplatform 4297 * @atomicservice 4298 * @since 11 4299 */ 4300 /** 4301 * PixelMap size. 4302 * 4303 * @type { ?Size } 4304 * @syscap SystemCapability.Multimedia.Image.Core 4305 * @crossplatform 4306 * @form 4307 * @atomicservice 4308 * @since 12 4309 */ 4310 sourceSize?: Size; 4311 } 4312 4313 /** 4314 * Value for HDR_STATIC_METADATA. 4315 * 4316 * @typedef HdrStaticMetadata 4317 * @syscap SystemCapability.Multimedia.Image.Core 4318 * @since 12 4319 */ 4320 interface HdrStaticMetadata { 4321 /** 4322 * The X-coordinate of the primary colors. The length of the array is three. Store in the order of r, g, b. 4323 * 4324 * @type { Array<number> } 4325 * @syscap SystemCapability.Multimedia.Image.Core 4326 * @since 12 4327 */ 4328 displayPrimariesX: Array<number>; 4329 4330 /** 4331 * The Y-coordinate of the primary colors. The length of the array is three. Store in the order of r, g, b. 4332 * 4333 * @type { Array<number> } 4334 * @syscap SystemCapability.Multimedia.Image.Core 4335 * @since 12 4336 */ 4337 displayPrimariesY: Array<number>; 4338 4339 /** 4340 * The X-coordinate of the white point value. 4341 * 4342 * @type { number } 4343 * @syscap SystemCapability.Multimedia.Image.Core 4344 * @since 12 4345 */ 4346 whitePointX: number; 4347 4348 /** 4349 * The Y-coordinate of the white point value. 4350 * 4351 * @type { number } 4352 * @syscap SystemCapability.Multimedia.Image.Core 4353 * @since 12 4354 */ 4355 whitePointY: number; 4356 4357 /** 4358 * Max luminance. 4359 * 4360 * @type { number } 4361 * @syscap SystemCapability.Multimedia.Image.Core 4362 * @since 12 4363 */ 4364 maxLuminance: number; 4365 4366 /** 4367 * Min luminance. 4368 * 4369 * @type { number } 4370 * @syscap SystemCapability.Multimedia.Image.Core 4371 * @since 12 4372 */ 4373 minLuminance: number; 4374 4375 /** 4376 * Maximum brightness of displayed content. 4377 * 4378 * @type { number } 4379 * @syscap SystemCapability.Multimedia.Image.Core 4380 * @since 12 4381 */ 4382 maxContentLightLevel: number; 4383 4384 /** 4385 * Maximum average brightness of displayed content. 4386 * 4387 * @type { number } 4388 * @syscap SystemCapability.Multimedia.Image.Core 4389 * @since 12 4390 */ 4391 maxFrameAverageLightLevel: number; 4392 } 4393 4394 /** 4395 * The per-component metadata. 4396 * 4397 * @typedef GainmapChannel 4398 * @syscap SystemCapability.Multimedia.Image.Core 4399 * @since 12 4400 */ 4401 interface GainmapChannel { 4402 /** 4403 * The per-component max gain map values. 4404 * 4405 * @type { number } 4406 * @syscap SystemCapability.Multimedia.Image.Core 4407 * @since 12 4408 */ 4409 gainmapMax: number; 4410 4411 /** 4412 * The per-component min gain map values. 4413 * 4414 * @type { number } 4415 * @syscap SystemCapability.Multimedia.Image.Core 4416 * @since 12 4417 */ 4418 gainmapMin: number; 4419 4420 /** 4421 * The per-component gamma values. 4422 * 4423 * @type { number } 4424 * @syscap SystemCapability.Multimedia.Image.Core 4425 * @since 12 4426 */ 4427 gamma: number; 4428 4429 /** 4430 * The per-component baseline offset. 4431 * 4432 * @type { number } 4433 * @syscap SystemCapability.Multimedia.Image.Core 4434 * @since 12 4435 */ 4436 baseOffset: number; 4437 4438 /** 4439 * The per-component alternate offset. 4440 * 4441 * @type { number } 4442 * @syscap SystemCapability.Multimedia.Image.Core 4443 * @since 12 4444 */ 4445 alternateOffset: number; 4446 } 4447 4448 /** 4449 * Values for HDR_GAINMAP_METADATA. 4450 * 4451 * @typedef HdrGainmapMetadata 4452 * @syscap SystemCapability.Multimedia.Image.Core 4453 * @since 12 4454 */ 4455 interface HdrGainmapMetadata { 4456 /** 4457 * The version used by the writer. 4458 * 4459 * @type { number } 4460 * @syscap SystemCapability.Multimedia.Image.Core 4461 * @since 12 4462 */ 4463 writerVersion: number; 4464 4465 /** 4466 * The minimum version a parser needs to understand. 4467 * 4468 * @type { number } 4469 * @syscap SystemCapability.Multimedia.Image.Core 4470 * @since 12 4471 */ 4472 miniVersion: number; 4473 4474 /** 4475 * The number of gain map channels, with a value of 1 or 3. 4476 * 4477 * @type { number } 4478 * @syscap SystemCapability.Multimedia.Image.Core 4479 * @since 12 4480 */ 4481 gainmapChannelCount: number; 4482 4483 /** 4484 * Indicate whether to use the color space of the base image. 4485 * 4486 * @type { boolean } 4487 * @syscap SystemCapability.Multimedia.Image.Core 4488 * @since 12 4489 */ 4490 useBaseColorFlag: boolean; 4491 4492 /** 4493 * The baseline hdr headroom. 4494 * 4495 * @type { number } 4496 * @syscap SystemCapability.Multimedia.Image.Core 4497 * @since 12 4498 */ 4499 baseHeadroom: number; 4500 4501 /** 4502 * The alternate hdr headroom. 4503 * 4504 * @type { number } 4505 * @syscap SystemCapability.Multimedia.Image.Core 4506 * @since 12 4507 */ 4508 alternateHeadroom: number; 4509 4510 /** 4511 * The per-channel metadata. 4512 * 4513 * @type { Array<GainmapChannel> } 4514 * @syscap SystemCapability.Multimedia.Image.Core 4515 * @since 12 4516 */ 4517 channels: Array<GainmapChannel>; 4518 } 4519 4520 /** 4521 * Defines the hdr metadata value. 4522 * 4523 * @typedef {HdrMetadataType | HdrStaticMetadata | ArrayBuffer | HdrGainmapMetadata} HdrMetadataValue 4524 * @syscap SystemCapability.Multimedia.Image.Core 4525 * @since 12 4526 */ 4527 type HdrMetadataValue = HdrMetadataType | HdrStaticMetadata | ArrayBuffer | HdrGainmapMetadata; 4528 4529 /** 4530 * Create pixelmap by data buffer. 4531 * 4532 * @param { ArrayBuffer } colors The image color buffer. 4533 * @param { InitializationOptions } options Initialization options for pixelmap. 4534 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 4535 * @syscap SystemCapability.Multimedia.Image.Core 4536 * @since 8 4537 */ 4538 /** 4539 * Create pixelmap by data buffer. 4540 * 4541 * @param { ArrayBuffer } colors The image color buffer. 4542 * @param { InitializationOptions } options Initialization options for pixelmap. 4543 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 4544 * @syscap SystemCapability.Multimedia.Image.Core 4545 * @crossplatform 4546 * @since 10 4547 */ 4548 function createPixelMap(colors: ArrayBuffer, options: InitializationOptions, callback: AsyncCallback<PixelMap>): void; 4549 4550 /** 4551 * Create pixelmap by data buffer. 4552 * 4553 * @param { ArrayBuffer } colors The image color buffer. 4554 * @param { InitializationOptions } options Initialization options for pixelmap. 4555 * @returns { Promise<PixelMap> } A Promise instance used to return the PixelMap object. 4556 * @syscap SystemCapability.Multimedia.Image.Core 4557 * @since 8 4558 */ 4559 /** 4560 * Create pixelmap by data buffer. 4561 * 4562 * @param { ArrayBuffer } colors The image color buffer. 4563 * @param { InitializationOptions } options Initialization options for pixelmap. 4564 * @returns { Promise<PixelMap> } A Promise instance used to return the PixelMap object. 4565 * @syscap SystemCapability.Multimedia.Image.Core 4566 * @crossplatform 4567 * @since 10 4568 */ 4569 function createPixelMap(colors: ArrayBuffer, options: InitializationOptions): Promise<PixelMap>; 4570 4571 /** 4572 * Create pixelmap by data buffer. 4573 * 4574 * @param { ArrayBuffer } colors The image color buffer. 4575 * @param { InitializationOptions } options Initialization options for pixelmap. 4576 * @returns { PixelMap } Returns the instance if the operation is successful;Otherwise, return undefined. 4577 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4578 * 2.Incorrect parameter types. 3.Parameter verification failed. 4579 * @syscap SystemCapability.Multimedia.Image.Core 4580 * @crossplatform 4581 * @since 12 4582 */ 4583 function createPixelMapSync(colors: ArrayBuffer, options: InitializationOptions): PixelMap; 4584 4585 /** 4586 * Create an empty pixelmap. 4587 * 4588 * @param { InitializationOptions } options Initialization options for pixelmap. 4589 * @returns { PixelMap } Returns the instance if the operation is successful;Otherwise, return undefined. 4590 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4591 * 2.Incorrect parameter types. 3.Parameter verification failed. 4592 * @syscap SystemCapability.Multimedia.Image.Core 4593 * @crossplatform 4594 * @since 12 4595 */ 4596function createPixelMapSync(options: InitializationOptions): PixelMap; 4597 4598 /** 4599 * Transforms pixelmap from unpremultiplied alpha format to premultiplied alpha format. 4600 * 4601 * @param { PixelMap } src The source pixelmap. 4602 * @param { PixelMap } dst The destination pixelmap. 4603 * @param { AsyncCallback<void> } callback Callback used to return the operation result. 4604 * If the operation fails, an error message is returned. 4605 * @throws { BusinessError } 62980103 - The image data is not supported. 4606 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4607 * 2.Incorrect parameter types. 3.Parameter verification failed. 4608 * @throws { BusinessError } 62980246 - Failed to read the pixelMap. 4609 * @throws { BusinessError } 62980248 - Pixelmap not allow modify. 4610 * @syscap SystemCapability.Multimedia.Image.Core 4611 * @crossplatform 4612 * @since 12 4613 */ 4614function createPremultipliedPixelMap(src: PixelMap, dst: PixelMap, callback: AsyncCallback<void>): void; 4615 4616 /** 4617 * Transforms pixelmap from premultiplied alpha format to unpremultiplied alpha format. 4618 * 4619 * @param { PixelMap } src The source pixelMap. 4620 * @param { PixelMap } dst The destination pixelmap. 4621 * @returns { Promise<void> } A Promise instance used to return the operation result. 4622 * If the operation fails, an error message is returned. 4623 * @throws { BusinessError } 62980103 - The image data is not supported. 4624 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4625 * 2.Incorrect parameter types. 3.Parameter verification failed. 4626 * @throws { BusinessError } 62980246 - Failed to read the pixelMap. 4627 * @throws { BusinessError } 62980248 - Pixelmap not allow modify. 4628 * @syscap SystemCapability.Multimedia.Image.Core 4629 * @crossplatform 4630 * @since 12 4631 */ 4632function createPremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise<void>; 4633 4634 /** 4635 * Transforms pixelmap from premultiplied alpha format to unpremultiplied alpha format. 4636 * 4637 * @param { PixelMap } src The source pixelmap. 4638 * @param { PixelMap } dst The destination pixelmap. 4639 * @param { AsyncCallback<void> } callback Callback used to return the operation result. 4640 * If the operation fails, an error message is returned. 4641 * @throws { BusinessError } 62980103 - The image data is not supported. 4642 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4643 * 2.Incorrect parameter types. 3.Parameter verification failed. 4644 * @throws { BusinessError } 62980246 - Failed to read the pixelMap. 4645 * @throws { BusinessError } 62980248 - Pixelmap not allow modify. 4646 * @syscap SystemCapability.Multimedia.Image.Core 4647 * @crossplatform 4648 * @since 12 4649 */ 4650function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap, callback: AsyncCallback<void>): void; 4651 4652 /** 4653 * Transforms pixelmap from premultiplied alpha format to unpremultiplied alpha format. 4654 * 4655 * @param { PixelMap } src The source pixelmap. 4656 * @param { PixelMap } dst The destination pixelmap. 4657 * @returns { Promise<void> } A Promise instance used to return the operation result. 4658 * If the operation fails, an error message is returned. 4659 * @throws { BusinessError } 62980103 - The image data is not supported. 4660 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4661 * 2.Incorrect parameter types. 3.Parameter verification failed. 4662 * @throws { BusinessError } 62980246 - Failed to read the pixelMap. 4663 * @throws { BusinessError } 62980248 - Pixelmap not allow modify. 4664 * @syscap SystemCapability.Multimedia.Image.Core 4665 * @crossplatform 4666 * @since 12 4667 */ 4668function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise<void>; 4669 4670 /** 4671 * Creates a PixelMap object based on MessageSequence parameter. 4672 * 4673 * @param { rpc.MessageSequence } sequence - rpc.MessageSequence parameter. 4674 * @returns { PixelMap } Returns the instance if the operation is successful;Otherwise, an exception will be thrown. 4675 * @throws { BusinessError } 62980096 - Operation failed. 4676 * @throws { BusinessError } 62980097 - IPC error. 4677 * @throws { BusinessError } 62980115 - Invalid input parameter. 4678 * @throws { BusinessError } 62980105 - Failed to get the data. 4679 * @throws { BusinessError } 62980177 - Abnormal API environment. 4680 * @throws { BusinessError } 62980178 - Failed to create the PixelMap. 4681 * @throws { BusinessError } 62980179 - Abnormal buffer size. 4682 * @throws { BusinessError } 62980180 - FD mapping failed. 4683 * @throws { BusinessError } 62980246 - Failed to read the PixelMap. 4684 * @syscap SystemCapability.Multimedia.Image.Core 4685 * @since 11 4686 */ 4687 function createPixelMapFromParcel(sequence: rpc.MessageSequence): PixelMap; 4688 4689 /** 4690 * Creates a PixelMap object from surface id. 4691 * 4692 * @param { string } surfaceId - surface id. 4693 * @param { Region } region - The region to surface. 4694 * @returns { Promise<PixelMap> } Returns the instance if the operation is successful;Otherwise, an exception will be thrown. 4695 * @throws { BusinessError } 62980115 - If the image parameter invalid. 4696 * @throws { BusinessError } 62980105 - Failed to get the data. 4697 * @throws { BusinessError } 62980178 - Failed to create the PixelMap. 4698 * @syscap SystemCapability.Multimedia.Image.Core 4699 * @since 11 4700 */ 4701 function createPixelMapFromSurface(surfaceId: string, region: Region): Promise<PixelMap>; 4702 4703 /** 4704 * Creates a PixelMap object from surface id. 4705 * 4706 * @param { string } surfaceId - surface id. 4707 * @param { Region } region - The region to surface. 4708 * @returns { PixelMap } Returns the instance if the operation is successful;Otherwise, an exception will be thrown. 4709 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4710 * 2.Incorrect parameter types. 3.Parameter verification failed. 4711 * @throws { BusinessError } 62980105 - Failed to get the data. 4712 * @throws { BusinessError } 62980178 - Failed to create the PixelMap. 4713 * @syscap SystemCapability.Multimedia.Image.Core 4714 * @since 12 4715 */ 4716 function createPixelMapFromSurfaceSync(surfaceId: string, region: Region): PixelMap; 4717 4718 /** 4719 * Creates an ImageSource instance based on the URI. 4720 * 4721 * @param { string } uri Image source URI. 4722 * @returns { ImageSource } returns the ImageSource instance if the operation is successful; returns null otherwise. 4723 * @syscap SystemCapability.Multimedia.Image.ImageSource 4724 * @since 6 4725 */ 4726 /** 4727 * Creates an ImageSource instance based on the URI. 4728 * 4729 * @param { string } uri Image source URI. 4730 * @returns { ImageSource } returns the ImageSource instance if the operation is successful; returns null otherwise. 4731 * @syscap SystemCapability.Multimedia.Image.ImageSource 4732 * @crossplatform 4733 * @since 10 4734 */ 4735 /** 4736 * Creates an ImageSource instance based on the URI. 4737 * 4738 * @param { string } uri Image source URI. 4739 * @returns { ImageSource } returns the ImageSource instance if the operation is successful; returns null otherwise. 4740 * @syscap SystemCapability.Multimedia.Image.ImageSource 4741 * @crossplatform 4742 * @atomicservice 4743 * @since 11 4744 */ 4745 function createImageSource(uri: string): ImageSource; 4746 4747 /** 4748 * Creates an ImageSource instance based on the URI. 4749 * 4750 * @param { string } uri Image source URI. 4751 * @param { SourceOptions } options The config of Image source. 4752 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4753 * @syscap SystemCapability.Multimedia.Image.ImageSource 4754 * @since 9 4755 */ 4756 /** 4757 * Creates an ImageSource instance based on the URI. 4758 * 4759 * @param { string } uri Image source URI. 4760 * @param { SourceOptions } options The config of Image source. 4761 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4762 * @syscap SystemCapability.Multimedia.Image.ImageSource 4763 * @crossplatform 4764 * @since 10 4765 */ 4766 /** 4767 * Creates an ImageSource instance based on the URI. 4768 * 4769 * @param { string } uri Image source URI. 4770 * @param { SourceOptions } options The config of Image source. 4771 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4772 * @syscap SystemCapability.Multimedia.Image.ImageSource 4773 * @crossplatform 4774 * @atomicservice 4775 * @since 11 4776 */ 4777 /** 4778 * Creates an ImageSource instance based on the URI. 4779 * 4780 * @param { string } uri Image source URI. 4781 * @param { SourceOptions } options The config of Image source. 4782 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4783 * @syscap SystemCapability.Multimedia.Image.ImageSource 4784 * @crossplatform 4785 * @form 4786 * @atomicservice 4787 * @since 12 4788 */ 4789 function createImageSource(uri: string, options: SourceOptions): ImageSource; 4790 4791 /** 4792 * Creates an ImageSource instance based on the file descriptor. 4793 * 4794 * @param { number } fd ID of a file descriptor. 4795 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4796 * @syscap SystemCapability.Multimedia.Image.ImageSource 4797 * @since 7 4798 */ 4799 /** 4800 * Creates an ImageSource instance based on the file descriptor. 4801 * 4802 * @param { number } fd ID of a file descriptor. 4803 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4804 * @syscap SystemCapability.Multimedia.Image.ImageSource 4805 * @crossplatform 4806 * @since 10 4807 */ 4808 /** 4809 * Creates an ImageSource instance based on the file descriptor. 4810 * 4811 * @param { number } fd ID of a file descriptor. 4812 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4813 * @syscap SystemCapability.Multimedia.Image.ImageSource 4814 * @crossplatform 4815 * @atomicservice 4816 * @since 11 4817 */ 4818 function createImageSource(fd: number): ImageSource; 4819 4820 /** 4821 * Creates an ImageSource instance based on the file descriptor. 4822 * 4823 * @param { number } fd ID of a file descriptor. 4824 * @param { SourceOptions } options The config of Image source. 4825 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4826 * @syscap SystemCapability.Multimedia.Image.ImageSource 4827 * @since 9 4828 */ 4829 /** 4830 * Creates an ImageSource instance based on the file descriptor. 4831 * 4832 * @param { number } fd ID of a file descriptor. 4833 * @param { SourceOptions } options The config of Image source. 4834 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4835 * @syscap SystemCapability.Multimedia.Image.ImageSource 4836 * @crossplatform 4837 * @since 10 4838 */ 4839 /** 4840 * Creates an ImageSource instance based on the file descriptor. 4841 * 4842 * @param { number } fd ID of a file descriptor. 4843 * @param { SourceOptions } options The config of Image source. 4844 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4845 * @syscap SystemCapability.Multimedia.Image.ImageSource 4846 * @crossplatform 4847 * @atomicservice 4848 * @since 11 4849 */ 4850 /** 4851 * Creates an ImageSource instance based on the file descriptor. 4852 * 4853 * @param { number } fd ID of a file descriptor. 4854 * @param { SourceOptions } options The config of Image source. 4855 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4856 * @syscap SystemCapability.Multimedia.Image.ImageSource 4857 * @crossplatform 4858 * @form 4859 * @atomicservice 4860 * @since 12 4861 */ 4862 function createImageSource(fd: number, options: SourceOptions): ImageSource; 4863 4864 /** 4865 * Creates an ImageSource instance based on the buffer. 4866 * 4867 * @param { ArrayBuffer } buf The buffer of the image. 4868 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4869 * @syscap SystemCapability.Multimedia.Image.ImageSource 4870 * @since 9 4871 */ 4872 /** 4873 * Creates an ImageSource instance based on the buffer. 4874 * 4875 * @param { ArrayBuffer } buf The buffer of the image. 4876 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4877 * @syscap SystemCapability.Multimedia.Image.ImageSource 4878 * @crossplatform 4879 * @since 10 4880 */ 4881 /** 4882 * Creates an ImageSource instance based on the buffer. 4883 * 4884 * @param { ArrayBuffer } buf The buffer of the image. 4885 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4886 * @syscap SystemCapability.Multimedia.Image.ImageSource 4887 * @crossplatform 4888 * @atomicservice 4889 * @since 11 4890 */ 4891 /** 4892 * Creates an ImageSource instance based on the buffer. 4893 * 4894 * @param { ArrayBuffer } buf The buffer of the image. 4895 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4896 * @syscap SystemCapability.Multimedia.Image.ImageSource 4897 * @crossplatform 4898 * @form 4899 * @atomicservice 4900 * @since 12 4901 */ 4902 function createImageSource(buf: ArrayBuffer): ImageSource; 4903 4904 /** 4905 * Creates an ImageSource instance based on the buffer. 4906 * 4907 * @param { ArrayBuffer } buf The buffer of the image. 4908 * @param { SourceOptions } options The config of Image source. 4909 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4910 * @syscap SystemCapability.Multimedia.Image.ImageSource 4911 * @since 9 4912 */ 4913 /** 4914 * Creates an ImageSource instance based on the buffer. 4915 * 4916 * @param { ArrayBuffer } buf The buffer of the image. 4917 * @param { SourceOptions } options The config of Image source. 4918 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4919 * @syscap SystemCapability.Multimedia.Image.ImageSource 4920 * @crossplatform 4921 * @since 10 4922 */ 4923 /** 4924 * Creates an ImageSource instance based on the buffer. 4925 * 4926 * @param { ArrayBuffer } buf The buffer of the image. 4927 * @param { SourceOptions } options The config of Image source. 4928 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4929 * @syscap SystemCapability.Multimedia.Image.ImageSource 4930 * @crossplatform 4931 * @atomicservice 4932 * @since 11 4933 */ 4934 /** 4935 * Creates an ImageSource instance based on the buffer. 4936 * 4937 * @param { ArrayBuffer } buf The buffer of the image. 4938 * @param { SourceOptions } options The config of Image source. 4939 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4940 * @syscap SystemCapability.Multimedia.Image.ImageSource 4941 * @crossplatform 4942 * @form 4943 * @atomicservice 4944 * @since 12 4945 */ 4946 function createImageSource(buf: ArrayBuffer, options: SourceOptions): ImageSource; 4947 4948 /** 4949 * Creates an ImageSource instance based on the raw file descriptor. 4950 * 4951 * @param { resourceManager.RawFileDescriptor } rawfile The raw file descriptor of the image. 4952 * @param { SourceOptions } options The config of Image source. 4953 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4954 * @syscap SystemCapability.Multimedia.Image.ImageSource 4955 * @crossplatform 4956 * @atomicservice 4957 * @since 11 4958 */ 4959 function createImageSource(rawfile: resourceManager.RawFileDescriptor, options?: SourceOptions): ImageSource; 4960 4961 /** 4962 * Creates an ImageSource instance based on the buffer in incremental. 4963 * 4964 * @param { ArrayBuffer } buf The buffer of the image. 4965 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4966 * @syscap SystemCapability.Multimedia.Image.ImageSource 4967 * @since 9 4968 */ 4969 /** 4970 * Creates an ImageSource instance based on the buffer in incremental. 4971 * 4972 * @param { ArrayBuffer } buf The buffer of the image. 4973 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4974 * @syscap SystemCapability.Multimedia.Image.ImageSource 4975 * @crossplatform 4976 * @since 10 4977 */ 4978 function CreateIncrementalSource(buf: ArrayBuffer): ImageSource; 4979 4980 /** 4981 * Creates an ImageSource instance based on the buffer in incremental. 4982 * 4983 * @param { ArrayBuffer } buf The buffer of the image. 4984 * @param { SourceOptions } options The config of source. 4985 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4986 * @syscap SystemCapability.Multimedia.Image.ImageSource 4987 * @since 9 4988 */ 4989 /** 4990 * Creates an ImageSource instance based on the buffer in incremental. 4991 * 4992 * @param { ArrayBuffer } buf The buffer of the image. 4993 * @param { SourceOptions } options The config of source. 4994 * @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise. 4995 * @syscap SystemCapability.Multimedia.Image.ImageSource 4996 * @crossplatform 4997 * @since 10 4998 */ 4999 function CreateIncrementalSource(buf: ArrayBuffer, options?: SourceOptions): ImageSource; 5000 5001 /** 5002 * Creates an ImagePacker instance. 5003 * 5004 * @returns { ImagePacker } Returns the ImagePacker instance if the operation is successful; returns null otherwise. 5005 * @syscap SystemCapability.Multimedia.Image.ImagePacker 5006 * @since 6 5007 */ 5008 /** 5009 * Creates an ImagePacker instance. 5010 * 5011 * @returns { ImagePacker } Returns the ImagePacker instance if the operation is successful; returns null otherwise. 5012 * @syscap SystemCapability.Multimedia.Image.ImagePacker 5013 * @crossplatform 5014 * @since 10 5015 */ 5016 /** 5017 * Creates an ImagePacker instance. 5018 * 5019 * @returns { ImagePacker } Returns the ImagePacker instance if the operation is successful; returns null otherwise. 5020 * @syscap SystemCapability.Multimedia.Image.ImagePacker 5021 * @crossplatform 5022 * @atomicservice 5023 * @since 11 5024 */ 5025 function createImagePacker(): ImagePacker; 5026 5027 /** 5028 * Creates an ImageReceiver instance. 5029 * 5030 * @param { number } width The default width in pixels of the Images that this receiver will produce. 5031 * @param { number } height The default height in pixels of the Images that this receiver will produce. 5032 * @param { number } format The format of the Image that this receiver will produce. This must be one of the 5033 * {@link ImageFormat} constants. 5034 * @param { number } capacity The maximum number of images the user will want to access simultaneously. 5035 * @returns { ImageReceiver } Returns the ImageReceiver instance if the operation is successful; returns null otherwise. 5036 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 5037 * @since 9 5038 * @deprecated since 11 5039 * @useinstead image#createImageReceiver 5040 */ 5041 function createImageReceiver(width: number, height: number, format: number, capacity: number): ImageReceiver; 5042 5043 /** 5044 * Creates an ImageReceiver instance. 5045 * 5046 * @param { Size } size - The default {@link Size} in pixels of the Images that this receiver will produce. 5047 * @param { ImageFormat } format - The format of the Image that this receiver will produce. This must be one of the 5048 * {@link ImageFormat} constants. 5049 * @param { number } capacity - The maximum number of images the user will want to access simultaneously. 5050 * @returns { ImageReceiver } Returns the ImageReceiver instance if the operation is successful; returns null otherwise. 5051 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 5052 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 5053 * @since 11 5054 */ 5055 function createImageReceiver(size: Size, format: ImageFormat, capacity: number): ImageReceiver; 5056 5057 /** 5058 * Creates an ImageCreator instance. 5059 * 5060 * @param { number } width The default width in pixels of the Images that this creator will produce. 5061 * @param { number } height The default height in pixels of the Images that this creator will produce. 5062 * @param { number } format The format of the Image that this creator will produce. This must be one of the 5063 * {@link ImageFormat} constants. 5064 * @param { number } capacity The maximum number of images the user will want to access simultaneously. 5065 * @returns { ImageCreator } Returns the ImageCreator instance if the operation is successful; returns null otherwise. 5066 * @syscap SystemCapability.Multimedia.Image.ImageCreator 5067 * @since 9 5068 * @deprecated since 11 5069 * @useinstead image#createImageCreator 5070 */ 5071 function createImageCreator(width: number, height: number, format: number, capacity: number): ImageCreator; 5072 5073 /** 5074 * Creates an ImageCreator instance. 5075 * 5076 * @param { Size } size - The default {@link Size} in pixels of the Images that this creator will produce. 5077 * @param { ImageFormat } format - The format of the Image that this creator will produce. This must be one of the 5078 * {@link ImageFormat} constants. 5079 * @param { number } capacity - The maximum number of images the user will want to access simultaneously. 5080 * @returns { ImageCreator } Returns the ImageCreator instance if the operation is successful; returns null otherwise. 5081 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 5082 * @syscap SystemCapability.Multimedia.Image.ImageCreator 5083 * @since 11 5084 */ 5085 function createImageCreator(size: Size, format: ImageFormat, capacity: number): ImageCreator; 5086 /** 5087 * PixelMap instance. 5088 * 5089 * @typedef PixelMap 5090 * @syscap SystemCapability.Multimedia.Image.Core 5091 * @since 7 5092 */ 5093 /** 5094 * PixelMap instance. 5095 * 5096 * @typedef PixelMap 5097 * @syscap SystemCapability.Multimedia.Image.Core 5098 * @crossplatform 5099 * @since 10 5100 */ 5101 /** 5102 * PixelMap instance. 5103 * 5104 * @typedef PixelMap 5105 * @syscap SystemCapability.Multimedia.Image.Core 5106 * @crossplatform 5107 * @atomicservice 5108 * @since 11 5109 */ 5110 /** 5111 * PixelMap instance. 5112 * 5113 * @typedef PixelMap 5114 * @syscap SystemCapability.Multimedia.Image.Core 5115 * @crossplatform 5116 * @form 5117 * @atomicservice 5118 * @since 12 5119 */ 5120 interface PixelMap { 5121 /** 5122 * Whether the image pixel map can be edited. 5123 * 5124 * @type { boolean } 5125 * @syscap SystemCapability.Multimedia.Image.Core 5126 * @since 7 5127 */ 5128 /** 5129 * Whether the image pixel map can be edited. 5130 * 5131 * @type { boolean } 5132 * @syscap SystemCapability.Multimedia.Image.Core 5133 * @crossplatform 5134 * @since 10 5135 */ 5136 /** 5137 * Whether the image pixel map can be edited. 5138 * 5139 * @type { boolean } 5140 * @syscap SystemCapability.Multimedia.Image.Core 5141 * @crossplatform 5142 * @atomicservice 5143 * @since 11 5144 */ 5145 /** 5146 * Whether the image pixel map can be edited. 5147 * 5148 * @type { boolean } 5149 * @syscap SystemCapability.Multimedia.Image.Core 5150 * @crossplatform 5151 * @form 5152 * @atomicservice 5153 * @since 12 5154 */ 5155 readonly isEditable: boolean; 5156 5157 /** 5158 * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses 5159 * a promise to return the result. 5160 * 5161 * @param { ArrayBuffer } dst A buffer to which the image pixel map data will be written. 5162 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5163 * @syscap SystemCapability.Multimedia.Image.Core 5164 * @since 7 5165 */ 5166 /** 5167 * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses 5168 * a promise to return the result. 5169 * 5170 * @param { ArrayBuffer } dst A buffer to which the image pixel map data will be written. 5171 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5172 * @syscap SystemCapability.Multimedia.Image.Core 5173 * @crossplatform 5174 * @since 10 5175 */ 5176 /** 5177 * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses 5178 * a promise to return the result. 5179 * 5180 * @param { ArrayBuffer } dst A buffer to which the image pixel map data will be written. 5181 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5182 * @syscap SystemCapability.Multimedia.Image.Core 5183 * @crossplatform 5184 * @atomicservice 5185 * @since 11 5186 */ 5187 /** 5188 * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses 5189 * a promise to return the result. 5190 * 5191 * @param { ArrayBuffer } dst A buffer to which the image pixel map data will be written. 5192 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5193 * @syscap SystemCapability.Multimedia.Image.Core 5194 * @crossplatform 5195 * @form 5196 * @atomicservice 5197 * @since 12 5198 */ 5199 readPixelsToBuffer(dst: ArrayBuffer): Promise<void>; 5200 5201 /** 5202 * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses 5203 * a callback to return the result. 5204 * 5205 * @param { ArrayBuffer } dst A buffer to which the image pixel map data will be written. 5206 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5207 * @syscap SystemCapability.Multimedia.Image.Core 5208 * @since 7 5209 */ 5210 /** 5211 * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses 5212 * a callback to return the result. 5213 * 5214 * @param { ArrayBuffer } dst A buffer to which the image pixel map data will be written. 5215 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5216 * @syscap SystemCapability.Multimedia.Image.Core 5217 * @crossplatform 5218 * @since 10 5219 */ 5220 /** 5221 * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses 5222 * a callback to return the result. 5223 * 5224 * @param { ArrayBuffer } dst A buffer to which the image pixel map data will be written. 5225 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5226 * @syscap SystemCapability.Multimedia.Image.Core 5227 * @crossplatform 5228 * @atomicservice 5229 * @since 11 5230 */ 5231 /** 5232 * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses 5233 * a callback to return the result. 5234 * 5235 * @param { ArrayBuffer } dst A buffer to which the image pixel map data will be written. 5236 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5237 * @syscap SystemCapability.Multimedia.Image.Core 5238 * @crossplatform 5239 * @form 5240 * @atomicservice 5241 * @since 12 5242 */ 5243 readPixelsToBuffer(dst: ArrayBuffer, callback: AsyncCallback<void>): void; 5244 5245 /** 5246 * Reads image pixel map data and writes the data to an ArrayBuffer. 5247 * 5248 * @param { ArrayBuffer } dst A buffer to which the image pixel map data will be written. 5249 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 5250 * 2.Incorrect parameter types. 3.Parameter verification failed. 5251 * @throws { BusinessError } 501 - Resource Unavailable. 5252 * @syscap SystemCapability.Multimedia.Image.Core 5253 * @crossplatform 5254 * @form 5255 * @atomicservice 5256 * @since 12 5257 */ 5258 readPixelsToBufferSync(dst: ArrayBuffer): void; 5259 5260 /** 5261 * Reads image pixel map data in an area. This method uses a promise to return the data read. 5262 * 5263 * @param { PositionArea } area Area from which the image pixel map data will be read. 5264 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5265 * @syscap SystemCapability.Multimedia.Image.Core 5266 * @since 7 5267 */ 5268 /** 5269 * Reads image pixel map data in an area. This method uses a promise to return the data read. 5270 * 5271 * @param { PositionArea } area Area from which the image pixel map data will be read. 5272 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5273 * @syscap SystemCapability.Multimedia.Image.Core 5274 * @crossplatform 5275 * @since 10 5276 */ 5277 /** 5278 * Reads image pixel map data in an area. This method uses a promise to return the data read. 5279 * 5280 * @param { PositionArea } area Area from which the image pixel map data will be read. 5281 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5282 * @syscap SystemCapability.Multimedia.Image.Core 5283 * @crossplatform 5284 * @atomicservice 5285 * @since 11 5286 */ 5287 /** 5288 * Reads image pixel map data in an area. This method uses a promise to return the data read. 5289 * 5290 * @param { PositionArea } area Area from which the image pixel map data will be read. 5291 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5292 * @syscap SystemCapability.Multimedia.Image.Core 5293 * @crossplatform 5294 * @form 5295 * @atomicservice 5296 * @since 12 5297 */ 5298 readPixels(area: PositionArea): Promise<void>; 5299 5300 /** 5301 * Reads image pixel map data in an area. This method uses a callback to return the data read. 5302 * 5303 * @param { PositionArea } area Area from which the image pixel map data will be read. 5304 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5305 * @syscap SystemCapability.Multimedia.Image.Core 5306 * @since 7 5307 */ 5308 /** 5309 * Reads image pixel map data in an area. This method uses a callback to return the data read. 5310 * 5311 * @param { PositionArea } area Area from which the image pixel map data will be read. 5312 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5313 * @syscap SystemCapability.Multimedia.Image.Core 5314 * @crossplatform 5315 * @since 10 5316 */ 5317 /** 5318 * Reads image pixel map data in an area. This method uses a callback to return the data read. 5319 * 5320 * @param { PositionArea } area Area from which the image pixel map data will be read. 5321 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5322 * @syscap SystemCapability.Multimedia.Image.Core 5323 * @crossplatform 5324 * @atomicservice 5325 * @since 11 5326 */ 5327 /** 5328 * Reads image pixel map data in an area. This method uses a callback to return the data read. 5329 * 5330 * @param { PositionArea } area Area from which the image pixel map data will be read. 5331 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5332 * @syscap SystemCapability.Multimedia.Image.Core 5333 * @crossplatform 5334 * @form 5335 * @atomicservice 5336 * @since 12 5337 */ 5338 readPixels(area: PositionArea, callback: AsyncCallback<void>): void; 5339 5340 /** 5341 * Reads image pixel map data in an area. 5342 * 5343 * @param { PositionArea } area Area from which the image pixel map data will be read. 5344 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 5345 * 2.Incorrect parameter types. 3.Parameter verification failed. 5346 * @throws { BusinessError } 501 - Resource Unavailable. 5347 * @syscap SystemCapability.Multimedia.Image.Core 5348 * @crossplatform 5349 * @atomicservice 5350 * @since 12 5351 */ 5352 readPixelsSync(area: PositionArea): void; 5353 5354 /** 5355 * Writes image pixel map data to the specified area. This method uses a promise to return 5356 * the operation result. 5357 * 5358 * @param { PositionArea } area Area to which the image pixel map data will be written. 5359 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5360 * @syscap SystemCapability.Multimedia.Image.Core 5361 * @since 7 5362 */ 5363 /** 5364 * Writes image pixel map data to the specified area. This method uses a promise to return 5365 * the operation result. 5366 * 5367 * @param { PositionArea } area Area to which the image pixel map data will be written. 5368 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5369 * @syscap SystemCapability.Multimedia.Image.Core 5370 * @crossplatform 5371 * @since 10 5372 */ 5373 /** 5374 * Writes image pixel map data to the specified area. This method uses a promise to return 5375 * the operation result. 5376 * 5377 * @param { PositionArea } area Area to which the image pixel map data will be written. 5378 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5379 * @syscap SystemCapability.Multimedia.Image.Core 5380 * @crossplatform 5381 * @atomicservice 5382 * @since 11 5383 */ 5384 /** 5385 * Writes image pixel map data to the specified area. This method uses a promise to return 5386 * the operation result. 5387 * 5388 * @param { PositionArea } area Area to which the image pixel map data will be written. 5389 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5390 * @syscap SystemCapability.Multimedia.Image.Core 5391 * @crossplatform 5392 * @form 5393 * @atomicservice 5394 * @since 12 5395 */ 5396 writePixels(area: PositionArea): Promise<void>; 5397 5398 /** 5399 * Writes image pixel map data to the specified area. This method uses a callback to return 5400 * the operation result. 5401 * 5402 * @param { PositionArea } area Area to which the image pixel map data will be written. 5403 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5404 * @syscap SystemCapability.Multimedia.Image.Core 5405 * @since 7 5406 */ 5407 /** 5408 * Writes image pixel map data to the specified area. This method uses a callback to return 5409 * the operation result. 5410 * 5411 * @param { PositionArea } area Area to which the image pixel map data will be written. 5412 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5413 * @syscap SystemCapability.Multimedia.Image.Core 5414 * @crossplatform 5415 * @since 10 5416 */ 5417 /** 5418 * Writes image pixel map data to the specified area. This method uses a callback to return 5419 * the operation result. 5420 * 5421 * @param { PositionArea } area Area to which the image pixel map data will be written. 5422 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5423 * @syscap SystemCapability.Multimedia.Image.Core 5424 * @crossplatform 5425 * @atomicservice 5426 * @since 11 5427 */ 5428 /** 5429 * Writes image pixel map data to the specified area. This method uses a callback to return 5430 * the operation result. 5431 * 5432 * @param { PositionArea } area Area to which the image pixel map data will be written. 5433 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5434 * @syscap SystemCapability.Multimedia.Image.Core 5435 * @crossplatform 5436 * @form 5437 * @atomicservice 5438 * @since 12 5439 */ 5440 writePixels(area: PositionArea, callback: AsyncCallback<void>): void; 5441 5442 /** 5443 * Writes image pixel map data to the specified area. 5444 * 5445 * @param { PositionArea } area Area to which the image pixel map data will be written. 5446 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 5447 * 2.Incorrect parameter types. 3.Parameter verification failed. 5448 * @throws { BusinessError } 501 - Resource Unavailable. 5449 * @syscap SystemCapability.Multimedia.Image.Core 5450 * @crossplatform 5451 * @form 5452 * @atomicservice 5453 * @since 12 5454 */ 5455 writePixelsSync(area: PositionArea): void; 5456 /** 5457 * Reads image data in an ArrayBuffer and writes the data to a PixelMap object. This method 5458 * uses a promise to return the result. 5459 * 5460 * @param { ArrayBuffer } src A buffer from which the image data will be read. 5461 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5462 * @syscap SystemCapability.Multimedia.Image.Core 5463 * @since 7 5464 */ 5465 /** 5466 * Reads image data in an ArrayBuffer and writes the data to a PixelMap object. This method 5467 * uses a promise to return the result. 5468 * 5469 * @param { ArrayBuffer } src A buffer from which the image data will be read. 5470 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5471 * @syscap SystemCapability.Multimedia.Image.Core 5472 * @crossplatform 5473 * @since 10 5474 */ 5475 /** 5476 * Reads image data in an ArrayBuffer and writes the data to a PixelMap object. This method 5477 * uses a promise to return the result. 5478 * 5479 * @param { ArrayBuffer } src A buffer from which the image data will be read. 5480 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5481 * @syscap SystemCapability.Multimedia.Image.Core 5482 * @crossplatform 5483 * @atomicservice 5484 * @since 11 5485 */ 5486 /** 5487 * Reads image data in an ArrayBuffer and writes the data to a PixelMap object. This method 5488 * uses a promise to return the result. 5489 * 5490 * @param { ArrayBuffer } src A buffer from which the image data will be read. 5491 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5492 * @syscap SystemCapability.Multimedia.Image.Core 5493 * @crossplatform 5494 * @form 5495 * @atomicservice 5496 * @since 12 5497 */ 5498 writeBufferToPixels(src: ArrayBuffer): Promise<void>; 5499 5500 /** 5501 * Reads image data in an ArrayBuffer and writes the data to a PixelMap object. This method 5502 * uses a callback to return the result. 5503 * 5504 * @param { ArrayBuffer } src A buffer from which the image data will be read. 5505 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5506 * @syscap SystemCapability.Multimedia.Image.Core 5507 * @since 7 5508 */ 5509 /** 5510 * Reads image data in an ArrayBuffer and writes the data to a PixelMap object. This method 5511 * uses a callback to return the result. 5512 * 5513 * @param { ArrayBuffer } src A buffer from which the image data will be read. 5514 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5515 * @syscap SystemCapability.Multimedia.Image.Core 5516 * @crossplatform 5517 * @since 10 5518 */ 5519 /** 5520 * Reads image data in an ArrayBuffer and writes the data to a PixelMap object. This method 5521 * uses a callback to return the result. 5522 * 5523 * @param { ArrayBuffer } src A buffer from which the image data will be read. 5524 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5525 * @syscap SystemCapability.Multimedia.Image.Core 5526 * @crossplatform 5527 * @atomicservice 5528 * @since 11 5529 */ 5530 /** 5531 * Reads image data in an ArrayBuffer and writes the data to a PixelMap object. This method 5532 * uses a callback to return the result. 5533 * 5534 * @param { ArrayBuffer } src A buffer from which the image data will be read. 5535 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5536 * @syscap SystemCapability.Multimedia.Image.Core 5537 * @crossplatform 5538 * @form 5539 * @atomicservice 5540 * @since 12 5541 */ 5542 writeBufferToPixels(src: ArrayBuffer, callback: AsyncCallback<void>): void; 5543 5544 /** 5545 * Reads image data in an ArrayBuffer and writes the data to a PixelMap object. 5546 * 5547 * @param { ArrayBuffer } src A buffer from which the image data will be read. 5548 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 5549 * 2.Incorrect parameter types. 3.Parameter verification failed. 5550 * @throws { BusinessError } 501 - Resource Unavailable. 5551 * @syscap SystemCapability.Multimedia.Image.Core 5552 * @crossplatform 5553 * @atomicservice 5554 * @since 12 5555 */ 5556 writeBufferToPixelsSync(src: ArrayBuffer): void; 5557 5558 /** 5559 * Convert pixelmap to standard dynamic range. 5560 * 5561 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5562 * @throws { BusinessError } 62980137 - Invalid image operation. 5563 * @syscap SystemCapability.Multimedia.Image.Core 5564 * @since 12 5565 */ 5566 toSdr(): Promise<void>; 5567 5568 /** 5569 * Obtains pixel map information about this image. This method uses a promise to return the information. 5570 * 5571 * @returns { Promise<ImageInfo> } A Promise instance used to return the image pixel map information. If the operation fails, an error message is returned. 5572 * @syscap SystemCapability.Multimedia.Image.Core 5573 * @since 7 5574 */ 5575 /** 5576 * Obtains pixel map information about this image. This method uses a promise to return the information. 5577 * 5578 * @returns { Promise<ImageInfo> } A Promise instance used to return the image pixel map information. If the operation fails, an error message is returned. 5579 * @syscap SystemCapability.Multimedia.Image.Core 5580 * @crossplatform 5581 * @since 10 5582 */ 5583 /** 5584 * Obtains pixel map information about this image. This method uses a promise to return the information. 5585 * 5586 * @returns { Promise<ImageInfo> } A Promise instance used to return the image pixel map information. If the operation fails, an error message is returned. 5587 * @syscap SystemCapability.Multimedia.Image.Core 5588 * @crossplatform 5589 * @atomicservice 5590 * @since 11 5591 */ 5592 /** 5593 * Obtains pixel map information about this image. This method uses a promise to return the information. 5594 * 5595 * @returns { Promise<ImageInfo> } A Promise instance used to return the image pixel map information. If the operation fails, an error message is returned. 5596 * @syscap SystemCapability.Multimedia.Image.Core 5597 * @crossplatform 5598 * @form 5599 * @atomicservice 5600 * @since 12 5601 */ 5602 getImageInfo(): Promise<ImageInfo>; 5603 5604 /** 5605 * Obtains pixel map information about this image. This method uses a callback to return the information. 5606 * 5607 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image pixel map information. 5608 * If the operation fails, an error message is returned. 5609 * @syscap SystemCapability.Multimedia.Image.Core 5610 * @since 7 5611 */ 5612 /** 5613 * Obtains pixel map information about this image. This method uses a callback to return the information. 5614 * 5615 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image pixel map information. 5616 * If the operation fails, an error message is returned. 5617 * @syscap SystemCapability.Multimedia.Image.Core 5618 * @crossplatform 5619 * @since 10 5620 */ 5621 /** 5622 * Obtains pixel map information about this image. This method uses a callback to return the information. 5623 * 5624 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image pixel map information. 5625 * If the operation fails, an error message is returned. 5626 * @syscap SystemCapability.Multimedia.Image.Core 5627 * @crossplatform 5628 * @atomicservice 5629 * @since 11 5630 */ 5631 /** 5632 * Obtains pixel map information about this image. This method uses a callback to return the information. 5633 * 5634 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image pixel map information. 5635 * If the operation fails, an error message is returned. 5636 * @syscap SystemCapability.Multimedia.Image.Core 5637 * @crossplatform 5638 * @form 5639 * @atomicservice 5640 * @since 12 5641 */ 5642 getImageInfo(callback: AsyncCallback<ImageInfo>): void; 5643 5644 /** 5645 * Get image information from image source. 5646 * 5647 * @returns { ImageInfo } the image information. 5648 * @throws { BusinessError } 501 - Resource Unavailable. 5649 * @syscap SystemCapability.Multimedia.Image.ImageSource 5650 * @crossplatform 5651 * @form 5652 * @atomicservice 5653 * @since 12 5654 */ 5655 getImageInfoSync(): ImageInfo; 5656 5657 /** 5658 * Obtains the number of bytes in each line of the image pixel map. 5659 * 5660 * @returns { number } Number of bytes in each line. 5661 * @syscap SystemCapability.Multimedia.Image.Core 5662 * @since 7 5663 */ 5664 /** 5665 * Obtains the number of bytes in each line of the image pixel map. 5666 * 5667 * @returns { number } Number of bytes in each line. 5668 * @syscap SystemCapability.Multimedia.Image.Core 5669 * @crossplatform 5670 * @since 10 5671 */ 5672 /** 5673 * Obtains the number of bytes in each line of the image pixel map. 5674 * 5675 * @returns { number } Number of bytes in each line. 5676 * @syscap SystemCapability.Multimedia.Image.Core 5677 * @crossplatform 5678 * @atomicservice 5679 * @since 11 5680 */ 5681 /** 5682 * Obtains the number of bytes in each line of the image pixel map. 5683 * 5684 * @returns { number } Number of bytes in each line. 5685 * @syscap SystemCapability.Multimedia.Image.Core 5686 * @crossplatform 5687 * @form 5688 * @atomicservice 5689 * @since 12 5690 */ 5691 getBytesNumberPerRow(): number; 5692 5693 /** 5694 * Obtains the total number of bytes of the image pixel map. 5695 * 5696 * @returns { number } Total number of bytes. 5697 * @syscap SystemCapability.Multimedia.Image.Core 5698 * @since 7 5699 */ 5700 /** 5701 * Obtains the total number of bytes of the image pixel map. 5702 * 5703 * @returns { number } Total number of bytes. 5704 * @syscap SystemCapability.Multimedia.Image.Core 5705 * @crossplatform 5706 * @since 10 5707 */ 5708 /** 5709 * Obtains the total number of bytes of the image pixel map. 5710 * 5711 * @returns { number } Total number of bytes. 5712 * @syscap SystemCapability.Multimedia.Image.Core 5713 * @crossplatform 5714 * @atomicservice 5715 * @since 11 5716 */ 5717 /** 5718 * Obtains the total number of bytes of the image pixel map. 5719 * 5720 * @returns { number } Total number of bytes. 5721 * @syscap SystemCapability.Multimedia.Image.Core 5722 * @crossplatform 5723 * @form 5724 * @atomicservice 5725 * @since 12 5726 */ 5727 getPixelBytesNumber(): number; 5728 5729 /** 5730 * Obtains the density of the image pixel map. 5731 * 5732 * @returns { number } The number of density. 5733 * @syscap SystemCapability.Multimedia.Image.Core 5734 * @since 9 5735 */ 5736 /** 5737 * Obtains the density of the image pixel map. 5738 * 5739 * @returns { number } The number of density. 5740 * @syscap SystemCapability.Multimedia.Image.Core 5741 * @crossplatform 5742 * @since 10 5743 */ 5744 /** 5745 * Obtains the density of the image pixel map. 5746 * 5747 * @returns { number } The number of density. 5748 * @syscap SystemCapability.Multimedia.Image.Core 5749 * @crossplatform 5750 * @atomicservice 5751 * @since 11 5752 */ 5753 /** 5754 * Obtains the density of the image pixel map. 5755 * 5756 * @returns { number } The number of density. 5757 * @syscap SystemCapability.Multimedia.Image.Core 5758 * @crossplatform 5759 * @form 5760 * @atomicservice 5761 * @since 12 5762 */ 5763 getDensity(): number; 5764 5765 /** 5766 * Set the transparent rate of pixel map. This method uses a callback to return the operation result. 5767 * 5768 * @param { number } rate The value of transparent rate. 5769 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5770 * @syscap SystemCapability.Multimedia.Image.Core 5771 * @since 9 5772 */ 5773 /** 5774 * Set the transparent rate of pixel map. This method uses a callback to return the operation result. 5775 * 5776 * @param { number } rate The value of transparent rate. 5777 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5778 * @syscap SystemCapability.Multimedia.Image.Core 5779 * @crossplatform 5780 * @since 10 5781 */ 5782 /** 5783 * Set the transparent rate of pixel map. This method uses a callback to return the operation result. 5784 * 5785 * @param { number } rate The value of transparent rate. 5786 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5787 * @syscap SystemCapability.Multimedia.Image.Core 5788 * @crossplatform 5789 * @atomicservice 5790 * @since 11 5791 */ 5792 /** 5793 * Set the transparent rate of pixel map. This method uses a callback to return the operation result. 5794 * 5795 * @param { number } rate The value of transparent rate. 5796 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5797 * @syscap SystemCapability.Multimedia.Image.Core 5798 * @crossplatform 5799 * @form 5800 * @atomicservice 5801 * @since 12 5802 */ 5803 opacity(rate: number, callback: AsyncCallback<void>): void; 5804 5805 /** 5806 * Set the transparent rate of pixel map. This method uses a promise to return the result. 5807 * 5808 * @param { number } rate The value of transparent rate. 5809 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5810 * @syscap SystemCapability.Multimedia.Image.Core 5811 * @since 9 5812 */ 5813 /** 5814 * Set the transparent rate of pixel map. This method uses a promise to return the result. 5815 * 5816 * @param { number } rate The value of transparent rate. 5817 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5818 * @syscap SystemCapability.Multimedia.Image.Core 5819 * @crossplatform 5820 * @since 10 5821 */ 5822 /** 5823 * Set the transparent rate of pixel map. This method uses a promise to return the result. 5824 * 5825 * @param { number } rate The value of transparent rate. 5826 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5827 * @syscap SystemCapability.Multimedia.Image.Core 5828 * @crossplatform 5829 * @atomicservice 5830 * @since 11 5831 */ 5832 /** 5833 * Set the transparent rate of pixel map. This method uses a promise to return the result. 5834 * 5835 * @param { number } rate The value of transparent rate. 5836 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5837 * @syscap SystemCapability.Multimedia.Image.Core 5838 * @crossplatform 5839 * @form 5840 * @atomicservice 5841 * @since 12 5842 */ 5843 opacity(rate: number): Promise<void>; 5844 5845 /** 5846 * Set the transparent rate of pixel map. 5847 * 5848 * @param { number } rate The value of transparent rate. 5849 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 5850 * 2.Incorrect parameter types. 3.Parameter verification failed. 5851 * @throws { BusinessError } 501 - Resource Unavailable. 5852 * @syscap SystemCapability.Multimedia.Image.Core 5853 * @crossplatform 5854 * @atomicservice 5855 * @since 12 5856 */ 5857 opacitySync(rate: number): void; 5858 /** 5859 * Obtains new pixel map with alpha information. This method uses a promise to return the information. 5860 * 5861 * @returns { Promise<PixelMap> } A Promise instance used to return the new image pixel map. If the operation fails, an error message is returned. 5862 * @syscap SystemCapability.Multimedia.Image.Core 5863 * @since 9 5864 */ 5865 /** 5866 * Obtains new pixel map with alpha information. This method uses a promise to return the information. 5867 * 5868 * @returns { Promise<PixelMap> } A Promise instance used to return the new image pixel map. If the operation fails, an error message is returned. 5869 * @syscap SystemCapability.Multimedia.Image.Core 5870 * @crossplatform 5871 * @since 10 5872 */ 5873 /** 5874 * Obtains new pixel map with alpha information. This method uses a promise to return the information. 5875 * 5876 * @returns { Promise<PixelMap> } A Promise instance used to return the new image pixel map. If the operation fails, an error message is returned. 5877 * @syscap SystemCapability.Multimedia.Image.Core 5878 * @crossplatform 5879 * @atomicservice 5880 * @since 11 5881 */ 5882 /** 5883 * Obtains new pixel map with alpha information. This method uses a promise to return the information. 5884 * 5885 * @returns { Promise<PixelMap> } A Promise instance used to return the new image pixel map. If the operation fails, an error message is returned. 5886 * @syscap SystemCapability.Multimedia.Image.Core 5887 * @crossplatform 5888 * @form 5889 * @atomicservice 5890 * @since 12 5891 */ 5892 createAlphaPixelmap(): Promise<PixelMap>; 5893 5894 /** 5895 * Obtains new pixel map with alpha information. This method uses a callback to return the information. 5896 * 5897 * @param { AsyncCallback<PixelMap> } callback Callback used to return the new image pixel map. If the operation fails, an error message is returned. 5898 * @syscap SystemCapability.Multimedia.Image.Core 5899 * @since 9 5900 */ 5901 /** 5902 * Obtains new pixel map with alpha information. This method uses a callback to return the information. 5903 * 5904 * @param { AsyncCallback<PixelMap> } callback Callback used to return the new image pixel map. If the operation fails, an error message is returned. 5905 * @syscap SystemCapability.Multimedia.Image.Core 5906 * @crossplatform 5907 * @since 10 5908 */ 5909 /** 5910 * Obtains new pixel map with alpha information. This method uses a callback to return the information. 5911 * 5912 * @param { AsyncCallback<PixelMap> } callback Callback used to return the new image pixel map. If the operation fails, an error message is returned. 5913 * @syscap SystemCapability.Multimedia.Image.Core 5914 * @crossplatform 5915 * @atomicservice 5916 * @since 11 5917 */ 5918 /** 5919 * Obtains new pixel map with alpha information. This method uses a callback to return the information. 5920 * 5921 * @param { AsyncCallback<PixelMap> } callback Callback used to return the new image pixel map. If the operation fails, an error message is returned. 5922 * @syscap SystemCapability.Multimedia.Image.Core 5923 * @crossplatform 5924 * @form 5925 * @atomicservice 5926 * @since 12 5927 */ 5928 createAlphaPixelmap(callback: AsyncCallback<PixelMap>): void; 5929 5930 /** 5931 * Obtains new pixel map with alpha information. 5932 * 5933 * @returns { PixelMap } return the new image pixel map. If the operation fails, an error message is returned. 5934 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Parameter verification failed. 5935 * @throws { BusinessError } 501 - Resource Unavailable. 5936 * @syscap SystemCapability.Multimedia.Image.Core 5937 * @crossplatform 5938 * @atomicservice 5939 * @since 12 5940 */ 5941 createAlphaPixelmapSync(): PixelMap; 5942 /** 5943 * Image zoom in width and height. This method uses a callback to return the operation result. 5944 * 5945 * @param { number } x The zoom value of width. 5946 * @param { number } y The zoom value of height. 5947 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5948 * @syscap SystemCapability.Multimedia.Image.Core 5949 * @since 9 5950 */ 5951 /** 5952 * Image zoom in width and height. This method uses a callback to return the operation result. 5953 * 5954 * @param { number } x The zoom value of width. 5955 * @param { number } y The zoom value of height. 5956 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5957 * @syscap SystemCapability.Multimedia.Image.Core 5958 * @crossplatform 5959 * @since 10 5960 */ 5961 /** 5962 * Image zoom in width and height. This method uses a callback to return the operation result. 5963 * 5964 * @param { number } x The zoom value of width. 5965 * @param { number } y The zoom value of height. 5966 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5967 * @syscap SystemCapability.Multimedia.Image.Core 5968 * @crossplatform 5969 * @atomicservice 5970 * @since 11 5971 */ 5972 /** 5973 * Image zoom in width and height. This method uses a callback to return the operation result. 5974 * 5975 * @param { number } x The zoom value of width. 5976 * @param { number } y The zoom value of height. 5977 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 5978 * @syscap SystemCapability.Multimedia.Image.Core 5979 * @crossplatform 5980 * @form 5981 * @atomicservice 5982 * @since 12 5983 */ 5984 scale(x: number, y: number, callback: AsyncCallback<void>): void; 5985 5986 /** 5987 * Image zoom in width and height. This method uses a promise to return the result. 5988 * 5989 * @param { number } x The zoom value of width. 5990 * @param { number } y The zoom value of height. 5991 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 5992 * @syscap SystemCapability.Multimedia.Image.Core 5993 * @since 9 5994 */ 5995 /** 5996 * Image zoom in width and height. This method uses a promise to return the result. 5997 * 5998 * @param { number } x The zoom value of width. 5999 * @param { number } y The zoom value of height. 6000 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6001 * @syscap SystemCapability.Multimedia.Image.Core 6002 * @crossplatform 6003 * @since 10 6004 */ 6005 /** 6006 * Image zoom in width and height. This method uses a promise to return the result. 6007 * 6008 * @param { number } x The zoom value of width. 6009 * @param { number } y The zoom value of height. 6010 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6011 * @syscap SystemCapability.Multimedia.Image.Core 6012 * @crossplatform 6013 * @atomicservice 6014 * @since 11 6015 */ 6016 /** 6017 * Image zoom in width and height. This method uses a promise to return the result. 6018 * 6019 * @param { number } x The zoom value of width. 6020 * @param { number } y The zoom value of height. 6021 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6022 * @syscap SystemCapability.Multimedia.Image.Core 6023 * @crossplatform 6024 * @form 6025 * @atomicservice 6026 * @since 12 6027 */ 6028 scale(x: number, y: number): Promise<void>; 6029 6030 /** 6031 * Image zoom in width and height. 6032 * 6033 * @param { number } x The zoom value of width. 6034 * @param { number } y The zoom value of height. 6035 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6036 * 2.Incorrect parameter types. 3.Parameter verification failed. 6037 * @throws { BusinessError } 501 - Resource Unavailable. 6038 * @syscap SystemCapability.Multimedia.Image.Core 6039 * @crossplatform 6040 * @atomicservice 6041 * @since 12 6042 */ 6043 scaleSync(x: number, y: number): void; 6044 6045 /** 6046 * Image zoom in width and height width with anti-aliasing. This method uses a promise to return the result. 6047 * 6048 * @param { number } x The zoom value of width. 6049 * @param { number } y The zoom value of height. 6050 * @param { AntiAliasingLevel } level The anti-aliasing algorithm to be used. 6051 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6052 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6053 * 2.Incorrect parameter types. 3.Parameter verification failed. 6054 * @throws { BusinessError } 501 - Resource Unavailable. 6055 * @syscap SystemCapability.Multimedia.Image.Core 6056 * @crossplatform 6057 * @form 6058 * @atomicservice 6059 * @since 12 6060 */ 6061 scale(x: number, y: number, level: AntiAliasingLevel): Promise<void>; 6062 6063 /** 6064 * Image zoom in width and height with anti-aliasing. 6065 * 6066 * @param { number } x The zoom value of width. 6067 * @param { number } y The zoom value of height. 6068 * @param { AntiAliasingLevel } level The anti-aliasing algorithm to be used. 6069 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6070 * 2.Incorrect parameter types. 3.Parameter verification failed. 6071 * @throws { BusinessError } 501 - Resource Unavailable. 6072 * @syscap SystemCapability.Multimedia.Image.Core 6073 * @crossplatform 6074 * @atomicservice 6075 * @since 12 6076 */ 6077 scaleSync(x: number, y: number, level: AntiAliasingLevel): void; 6078 6079 /** 6080 * Image position transformation. This method uses a callback to return the operation result. 6081 * 6082 * @param { number } x The position value of width. 6083 * @param { number } y The position value of height. 6084 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6085 * @syscap SystemCapability.Multimedia.Image.Core 6086 * @since 9 6087 */ 6088 /** 6089 * Image position transformation. This method uses a callback to return the operation result. 6090 * 6091 * @param { number } x The position value of width. 6092 * @param { number } y The position value of height. 6093 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6094 * @syscap SystemCapability.Multimedia.Image.Core 6095 * @crossplatform 6096 * @since 10 6097 */ 6098 /** 6099 * Image position transformation. This method uses a callback to return the operation result. 6100 * 6101 * @param { number } x The position value of width. 6102 * @param { number } y The position value of height. 6103 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6104 * @syscap SystemCapability.Multimedia.Image.Core 6105 * @crossplatform 6106 * @atomicservice 6107 * @since 11 6108 */ 6109 /** 6110 * Image position transformation. This method uses a callback to return the operation result. 6111 * 6112 * @param { number } x The position value of width. 6113 * @param { number } y The position value of height. 6114 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6115 * @syscap SystemCapability.Multimedia.Image.Core 6116 * @crossplatform 6117 * @form 6118 * @atomicservice 6119 * @since 12 6120 */ 6121 translate(x: number, y: number, callback: AsyncCallback<void>): void; 6122 6123 /** 6124 * Image position transformation. This method uses a promise to return the result. 6125 * 6126 * @param { number } x The position value of width. 6127 * @param { number } y The position value of height. 6128 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6129 * @syscap SystemCapability.Multimedia.Image.Core 6130 * @since 9 6131 */ 6132 /** 6133 * Image position transformation. This method uses a promise to return the result. 6134 * 6135 * @param { number } x The position value of width. 6136 * @param { number } y The position value of height. 6137 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6138 * @syscap SystemCapability.Multimedia.Image.Core 6139 * @crossplatform 6140 * @since 10 6141 */ 6142 /** 6143 * Image position transformation. This method uses a promise to return the result. 6144 * 6145 * @param { number } x The position value of width. 6146 * @param { number } y The position value of height. 6147 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6148 * @syscap SystemCapability.Multimedia.Image.Core 6149 * @crossplatform 6150 * @atomicservice 6151 * @since 11 6152 */ 6153 /** 6154 * Image position transformation. This method uses a promise to return the result. 6155 * 6156 * @param { number } x The position value of width. 6157 * @param { number } y The position value of height. 6158 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6159 * @syscap SystemCapability.Multimedia.Image.Core 6160 * @crossplatform 6161 * @form 6162 * @atomicservice 6163 * @since 12 6164 */ 6165 translate(x: number, y: number): Promise<void>; 6166 6167 /** 6168 * Image position transformation. 6169 * 6170 * @param { number } x The position value of width. 6171 * @param { number } y The position value of height. 6172 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6173 * 2.Incorrect parameter types. 3.Parameter verification failed. 6174 * @throws { BusinessError } 501 - Resource Unavailable. 6175 * @syscap SystemCapability.Multimedia.Image.Core 6176 * @crossplatform 6177 * @atomicservice 6178 * @since 12 6179 */ 6180 translateSync(x: number, y: number): void; 6181 6182 /** 6183 * Image rotation. This method uses a callback to return the operation result. 6184 * 6185 * @param { number } angle The rotation angle. 6186 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6187 * @syscap SystemCapability.Multimedia.Image.Core 6188 * @since 9 6189 */ 6190 /** 6191 * Image rotation. This method uses a callback to return the operation result. 6192 * 6193 * @param { number } angle The rotation angle. 6194 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6195 * @syscap SystemCapability.Multimedia.Image.Core 6196 * @crossplatform 6197 * @since 10 6198 */ 6199 /** 6200 * Image rotation. This method uses a callback to return the operation result. 6201 * 6202 * @param { number } angle The rotation angle. 6203 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6204 * @syscap SystemCapability.Multimedia.Image.Core 6205 * @crossplatform 6206 * @atomicservice 6207 * @since 11 6208 */ 6209 /** 6210 * Image rotation. This method uses a callback to return the operation result. 6211 * 6212 * @param { number } angle The rotation angle. 6213 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6214 * @syscap SystemCapability.Multimedia.Image.Core 6215 * @crossplatform 6216 * @form 6217 * @atomicservice 6218 * @since 12 6219 */ 6220 rotate(angle: number, callback: AsyncCallback<void>): void; 6221 6222 /** 6223 * Image rotation. This method uses a promise to return the result. 6224 * 6225 * @param { number } angle The rotation angle. 6226 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6227 * @syscap SystemCapability.Multimedia.Image.Core 6228 * @since 9 6229 */ 6230 /** 6231 * Image rotation. This method uses a promise to return the result. 6232 * 6233 * @param { number } angle The rotation angle. 6234 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6235 * @syscap SystemCapability.Multimedia.Image.Core 6236 * @crossplatform 6237 * @since 10 6238 */ 6239 /** 6240 * Image rotation. This method uses a promise to return the result. 6241 * 6242 * @param { number } angle The rotation angle. 6243 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6244 * @syscap SystemCapability.Multimedia.Image.Core 6245 * @crossplatform 6246 * @atomicservice 6247 * @since 11 6248 */ 6249 /** 6250 * Image rotation. This method uses a promise to return the result. 6251 * 6252 * @param { number } angle The rotation angle. 6253 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6254 * @syscap SystemCapability.Multimedia.Image.Core 6255 * @crossplatform 6256 * @form 6257 * @atomicservice 6258 * @since 12 6259 */ 6260 rotate(angle: number): Promise<void>; 6261 6262 /** 6263 * Image rotation. 6264 * 6265 * @param { number } angle The rotation angle. 6266 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6267 * 2.Incorrect parameter types. 3.Parameter verification failed. 6268 * @throws { BusinessError } 501 - Resource Unavailable. 6269 * @syscap SystemCapability.Multimedia.Image.Core 6270 * @crossplatform 6271 * @atomicservice 6272 * @since 12 6273 */ 6274 rotateSync(angle: number): void; 6275 6276 /** 6277 * Image flipping. This method uses a callback to return the operation result. 6278 * 6279 * @param { boolean } horizontal Is flip in horizontal. 6280 * @param { boolean } vertical Is flip in vertical. 6281 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6282 * @syscap SystemCapability.Multimedia.Image.Core 6283 * @since 9 6284 */ 6285 /** 6286 * Image flipping. This method uses a callback to return the operation result. 6287 * 6288 * @param { boolean } horizontal Is flip in horizontal. 6289 * @param { boolean } vertical Is flip in vertical. 6290 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6291 * @syscap SystemCapability.Multimedia.Image.Core 6292 * @crossplatform 6293 * @since 10 6294 */ 6295 /** 6296 * Image flipping. This method uses a callback to return the operation result. 6297 * 6298 * @param { boolean } horizontal Is flip in horizontal. 6299 * @param { boolean } vertical Is flip in vertical. 6300 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6301 * @syscap SystemCapability.Multimedia.Image.Core 6302 * @crossplatform 6303 * @atomicservice 6304 * @since 11 6305 */ 6306 /** 6307 * Image flipping. This method uses a callback to return the operation result. 6308 * 6309 * @param { boolean } horizontal Is flip in horizontal. 6310 * @param { boolean } vertical Is flip in vertical. 6311 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6312 * @syscap SystemCapability.Multimedia.Image.Core 6313 * @crossplatform 6314 * @form 6315 * @atomicservice 6316 * @since 12 6317 */ 6318 flip(horizontal: boolean, vertical: boolean, callback: AsyncCallback<void>): void; 6319 6320 /** 6321 * Image flipping. This method uses a promise to return the result. 6322 * 6323 * @param { boolean } horizontal Is flip in horizontal. 6324 * @param { boolean } vertical Is flip in vertical. 6325 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6326 * @syscap SystemCapability.Multimedia.Image.Core 6327 * @since 9 6328 */ 6329 /** 6330 * Image flipping. This method uses a promise to return the result. 6331 * 6332 * @param { boolean } horizontal Is flip in horizontal. 6333 * @param { boolean } vertical Is flip in vertical. 6334 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6335 * @syscap SystemCapability.Multimedia.Image.Core 6336 * @crossplatform 6337 * @since 10 6338 */ 6339 /** 6340 * Image flipping. This method uses a promise to return the result. 6341 * 6342 * @param { boolean } horizontal Is flip in horizontal. 6343 * @param { boolean } vertical Is flip in vertical. 6344 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6345 * @syscap SystemCapability.Multimedia.Image.Core 6346 * @crossplatform 6347 * @atomicservice 6348 * @since 11 6349 */ 6350 /** 6351 * Image flipping. This method uses a promise to return the result. 6352 * 6353 * @param { boolean } horizontal Is flip in horizontal. 6354 * @param { boolean } vertical Is flip in vertical. 6355 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6356 * @syscap SystemCapability.Multimedia.Image.Core 6357 * @crossplatform 6358 * @form 6359 * @atomicservice 6360 * @since 12 6361 */ 6362 flip(horizontal: boolean, vertical: boolean): Promise<void>; 6363 6364 /** 6365 * Image flipping. 6366 * 6367 * @param { boolean } horizontal Is flip in horizontal. 6368 * @param { boolean } vertical Is flip in vertical. 6369 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6370 * 2.Incorrect parameter types. 3.Parameter verification failed. 6371 * @throws { BusinessError } 501 - Resource Unavailable. 6372 * @syscap SystemCapability.Multimedia.Image.Core 6373 * @crossplatform 6374 * @atomicservice 6375 * @since 12 6376 */ 6377 flipSync(horizontal: boolean, vertical: boolean): void; 6378 6379 /** 6380 * Crop the image. This method uses a callback to return the operation result. 6381 * 6382 * @param { Region } region The region to crop. 6383 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6384 * @syscap SystemCapability.Multimedia.Image.Core 6385 * @since 9 6386 */ 6387 /** 6388 * Crop the image. This method uses a callback to return the operation result. 6389 * 6390 * @param { Region } region The region to crop. 6391 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6392 * @syscap SystemCapability.Multimedia.Image.Core 6393 * @crossplatform 6394 * @since 10 6395 */ 6396 /** 6397 * Crop the image. This method uses a callback to return the operation result. 6398 * 6399 * @param { Region } region The region to crop. 6400 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6401 * @syscap SystemCapability.Multimedia.Image.Core 6402 * @crossplatform 6403 * @atomicservice 6404 * @since 11 6405 */ 6406 /** 6407 * Crop the image. This method uses a callback to return the operation result. 6408 * 6409 * @param { Region } region The region to crop. 6410 * @param { AsyncCallback<void> } callback Callback used to return the operation result. If the operation fails, an error message is returned. 6411 * @syscap SystemCapability.Multimedia.Image.Core 6412 * @crossplatform 6413 * @form 6414 * @atomicservice 6415 * @since 12 6416 */ 6417 crop(region: Region, callback: AsyncCallback<void>): void; 6418 6419 /** 6420 * Crop the image. This method uses a promise to return the result. 6421 * 6422 * @param { Region } region The region to crop. 6423 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6424 * @syscap SystemCapability.Multimedia.Image.Core 6425 * @since 9 6426 */ 6427 /** 6428 * Crop the image. This method uses a promise to return the result. 6429 * 6430 * @param { Region } region The region to crop. 6431 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6432 * @syscap SystemCapability.Multimedia.Image.Core 6433 * @crossplatform 6434 * @since 10 6435 */ 6436 /** 6437 * Crop the image. This method uses a promise to return the result. 6438 * 6439 * @param { Region } region The region to crop. 6440 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6441 * @syscap SystemCapability.Multimedia.Image.Core 6442 * @crossplatform 6443 * @atomicservice 6444 * @since 11 6445 */ 6446 /** 6447 * Crop the image. This method uses a promise to return the result. 6448 * 6449 * @param { Region } region The region to crop. 6450 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6451 * @syscap SystemCapability.Multimedia.Image.Core 6452 * @crossplatform 6453 * @form 6454 * @atomicservice 6455 * @since 12 6456 */ 6457 crop(region: Region): Promise<void>; 6458 6459 /** 6460 * Crop the image. 6461 * 6462 * @param { Region } region The region to crop. 6463 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6464 * 2.Incorrect parameter types. 3.Parameter verification failed. 6465 * @throws { BusinessError } 501 - Resource Unavailable. 6466 * @syscap SystemCapability.Multimedia.Image.Core 6467 * @crossplatform 6468 * @atomicservice 6469 * @since 12 6470 */ 6471 cropSync(region: Region): void; 6472 6473 /** 6474 * Get color space of pixel map. 6475 * 6476 * @returns { colorSpaceManager.ColorSpaceManager } If the operation fails, an error message is returned. 6477 * @throws { BusinessError } 62980101 - The image data is abnormal. 6478 * @throws { BusinessError } 62980103 - The image data is not supported. 6479 * @throws { BusinessError } 62980115 - Invalid image parameter. 6480 * @syscap SystemCapability.Multimedia.Image.Core 6481 * @since 10 6482 */ 6483 /** 6484 * Get color space of pixel map. 6485 * 6486 * @returns { colorSpaceManager.ColorSpaceManager } If the operation fails, an error message is returned. 6487 * @throws { BusinessError } 62980101 - If the image data abnormal. 6488 * @throws { BusinessError } 62980103 - If the image data unsupport. 6489 * @throws { BusinessError } 62980115 - If the image parameter invalid. 6490 * @syscap SystemCapability.Multimedia.Image.Core 6491 * @crossplatform 6492 * @since 11 6493 */ 6494 getColorSpace(): colorSpaceManager.ColorSpaceManager; 6495 6496 /** 6497 * Marshalling pixelmap and write into MessageSequence. 6498 * 6499 * @param { rpc.MessageSequence } sequence rpc.MessageSequence parameter. 6500 * @throws { BusinessError } 62980115 - Invalid image parameter. 6501 * @throws { BusinessError } 62980097 - IPC error. 6502 * @syscap SystemCapability.Multimedia.Image.Core 6503 * @since 10 6504 */ 6505 marshalling(sequence: rpc.MessageSequence): void; 6506 6507 /** 6508 * Creates a PixelMap object based on MessageSequence parameter. 6509 * 6510 * @param { rpc.MessageSequence } sequence rpc.MessageSequence parameter. 6511 * @returns { Promise<PixelMap> } A Promise instance used to return the PixelMap object. 6512 * @throws { BusinessError } 62980115 - Invalid image parameter. 6513 * @throws { BusinessError } 62980097 - IPC error. 6514 * @throws { BusinessError } 62980096 - The operation failed. 6515 * @syscap SystemCapability.Multimedia.Image.Core 6516 * @since 10 6517 */ 6518 unmarshalling(sequence: rpc.MessageSequence): Promise<PixelMap>; 6519 6520 /** 6521 * Set color space of pixel map. 6522 * 6523 * This method is only used to set the colorspace property of pixelmap, while all pixel data remains the same after calling this method. 6524 * If you want to change colorspace for all pixels, use method {@Link #applyColorSpace(colorSpaceManager.ColorSpaceManager)} or 6525 * {@Link #applyColorSpace(colorSpaceManager.ColorSpaceManager, AsyncCallback<void>)}. 6526 * 6527 * @param { colorSpaceManager.ColorSpaceManager } colorSpace The color space for pixel map. 6528 * @throws { BusinessError } 62980111 - The image source data is incomplete. 6529 * @throws { BusinessError } 62980115 - Invalid image parameter. 6530 * @syscap SystemCapability.Multimedia.Image.Core 6531 * @since 10 6532 */ 6533 /** 6534 * Set color space of pixel map. 6535 * 6536 * This method is only used to set the colorspace property of pixelmap, while all pixel data remains the same after calling this method. 6537 * If you want to change colorspace for all pixels, use method {@Link #applyColorSpace(colorSpaceManager.ColorSpaceManager)} or 6538 * {@Link #applyColorSpace(colorSpaceManager.ColorSpaceManager, AsyncCallback<void>)}. 6539 * 6540 * @param { colorSpaceManager.ColorSpaceManager } colorSpace The color space for pixel map. 6541 * @throws { BusinessError } 62980111 - If the operation invalid. 6542 * @throws { BusinessError } 62980115 - If the image parameter invalid. 6543 * @syscap SystemCapability.Multimedia.Image.Core 6544 * @crossplatform 6545 * @since 11 6546 */ 6547 /** 6548 * Set color space of pixel map. 6549 * 6550 * This method is only used to set the colorspace property of pixelmap, while all pixel data remains the same after calling this method. 6551 * If you want to change colorspace for all pixels, use method {@Link #applyColorSpace(colorSpaceManager.ColorSpaceManager)} or 6552 * {@Link #applyColorSpace(colorSpaceManager.ColorSpaceManager, AsyncCallback<void>)}. 6553 * 6554 * @param { colorSpaceManager.ColorSpaceManager } colorSpace The color space for pixel map. 6555 * @throws { BusinessError } 62980111 - The image source data is incomplete. 6556 * @throws { BusinessError } 62980115 - If the image parameter invalid. 6557 * @syscap SystemCapability.Multimedia.Image.Core 6558 * @crossplatform 6559 * @since 12 6560 */ 6561 setColorSpace(colorSpace: colorSpaceManager.ColorSpaceManager): void; 6562 6563 /** 6564 * Is it stride Alignment 6565 * 6566 * @type { boolean } 6567 * @readonly 6568 * @syscap SystemCapability.Multimedia.Image.Core 6569 * @since 11 6570 */ 6571 readonly isStrideAlignment: boolean; 6572 6573 /** 6574 * Apply color space of pixel map, the pixels will be changed by input color space. This method uses a callback to return the operation result. 6575 * 6576 * This method is used to change color space of pixelmap. Pixel data will be changed by calling this method. 6577 * If you want to set the colorspace property of pixelmap only, use method {@Link #setColorSpace(colorSpaceManager.ColorSpaceManager)}. 6578 * 6579 * @param { colorSpaceManager.ColorSpaceManager } targetColorSpace - The color space for pixel map. 6580 * @param { AsyncCallback<void> } callback - Callback used to return the operation result. If the operation fails, an error message is returned. 6581 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6582 * 2.Incorrect parameter types. 3.Parameter verification failed. 6583 * @throws { BusinessError } 62980104 - Failed to initialize the internal object. 6584 * @throws { BusinessError } 62980108 - Failed to convert the color space. 6585 * @throws { BusinessError } 62980115 - Invalid image parameter. 6586 * @syscap SystemCapability.Multimedia.Image.Core 6587 * @crossplatform 6588 * @since 11 6589 */ 6590 applyColorSpace(targetColorSpace: colorSpaceManager.ColorSpaceManager, callback: AsyncCallback<void>): void; 6591 6592 /** 6593 * Apply color space of pixel map, the pixels will be changed by input color space. This method uses a promise to return the result. 6594 * 6595 * This method is used to change color space of pixelmap. Pixel data will be changed by calling this method. 6596 * If you want to set the colorspace property of pixelmap only, use method {@Link #setColorSpace(colorSpaceManager.ColorSpaceManager)}. 6597 * 6598 * @param { colorSpaceManager.ColorSpaceManager } targetColorSpace - The color space for pixel map. 6599 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6600 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6601 * 2.Incorrect parameter types. 3.Parameter verification failed. 6602 * @throws { BusinessError } 62980104 - Failed to initialize the internal object. 6603 * @throws { BusinessError } 62980108 - Failed to convert the color space. 6604 * @throws { BusinessError } 62980115 - Invalid image parameter. 6605 * @syscap SystemCapability.Multimedia.Image.Core 6606 * @crossplatform 6607 * @since 11 6608 */ 6609 applyColorSpace(targetColorSpace: colorSpaceManager.ColorSpaceManager): Promise<void>; 6610 6611 /** 6612 * The method is used for the transformation of the image formats. Pixel data will be changed by calling this method. 6613 * 6614 * @param { PixelMapFormat } targetPixelFormat - The pixel format for pixelmap conversion. 6615 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an error message is returned. 6616 * @throws { BusinessError } 62980115 - Invalid input parameter. 6617 * @throws { BusinessError } 62980111 - The image source data is incomplete. 6618 * @throws { BusinessError } 62980274 - The conversion failed. 6619 * @throws { BusinessError } 62980276 - The type to be converted is an unsupported target pixel format. 6620 * @throws { BusinessError } 62980178 - Failed to create the pixelmap. 6621 * @syscap SystemCapability.Multimedia.Image.Core 6622 * @since 12 6623 */ 6624 convertPixelFormat(targetPixelFormat: PixelMapFormat): Promise<void>; 6625 6626 /** 6627 * Releases this PixelMap object. This method uses a callback to return the result. 6628 * 6629 * @param { AsyncCallback<void> } callback Callback invoked for instance release. If the operation fails, an error message is returned. 6630 * @syscap SystemCapability.Multimedia.Image.Core 6631 * @since 7 6632 */ 6633 /** 6634 * Releases this PixelMap object. This method uses a callback to return the result. 6635 * 6636 * @param { AsyncCallback<void> } callback Callback invoked for instance release. If the operation fails, an error message is returned. 6637 * @syscap SystemCapability.Multimedia.Image.Core 6638 * @crossplatform 6639 * @since 10 6640 */ 6641 /** 6642 * Releases this PixelMap object. This method uses a callback to return the result. 6643 * 6644 * @param { AsyncCallback<void> } callback Callback invoked for instance release. If the operation fails, an error message is returned. 6645 * @syscap SystemCapability.Multimedia.Image.Core 6646 * @crossplatform 6647 * @atomicservice 6648 * @since 11 6649 */ 6650 /** 6651 * Releases this PixelMap object. This method uses a callback to return the result. 6652 * 6653 * @param { AsyncCallback<void> } callback Callback invoked for instance release. If the operation fails, an error message is returned. 6654 * @syscap SystemCapability.Multimedia.Image.Core 6655 * @crossplatform 6656 * @form 6657 * @atomicservice 6658 * @since 12 6659 */ 6660 release(callback: AsyncCallback<void>): void; 6661 6662 /** 6663 * Releases this PixelMap object. This method uses a promise to return the result. 6664 * 6665 * @returns { Promise<void> } A Promise instance used to return the instance release result. If the operation fails, an error message is returned. 6666 * @syscap SystemCapability.Multimedia.Image.Core 6667 * @since 7 6668 */ 6669 /** 6670 * Releases this PixelMap object. This method uses a promise to return the result. 6671 * 6672 * @returns { Promise<void> } A Promise instance used to return the instance release result. If the operation fails, an error message is returned. 6673 * @syscap SystemCapability.Multimedia.Image.Core 6674 * @crossplatform 6675 * @since 10 6676 */ 6677 /** 6678 * Releases this PixelMap object. This method uses a promise to return the result. 6679 * 6680 * @returns { Promise<void> } A Promise instance used to return the instance release result. If the operation fails, an error message is returned. 6681 * @syscap SystemCapability.Multimedia.Image.Core 6682 * @crossplatform 6683 * @atomicservice 6684 * @since 11 6685 */ 6686 /** 6687 * Releases this PixelMap object. This method uses a promise to return the result. 6688 * 6689 * @returns { Promise<void> } A Promise instance used to return the instance release result. If the operation fails, an error message is returned. 6690 * @syscap SystemCapability.Multimedia.Image.Core 6691 * @crossplatform 6692 * @form 6693 * @atomicservice 6694 * @since 12 6695 */ 6696 release(): Promise<void>; 6697 6698 /** 6699 * Enables the PixelMap object to be transferred across threads and detaches the reference from the current 6700 * thread upon transfer. 6701 * 6702 * @param { boolean } detached A boolean value indicating whether to enable or disable the transfer and 6703 * detachment feature. 6704 * @throws { BusinessError } 501 - Resource Unavailable. 6705 * @syscap SystemCapability.Multimedia.Image.Core 6706 * @since 12 6707 */ 6708 setTransferDetached(detached: boolean): void; 6709 6710 /** 6711 * Get metadata. 6712 * 6713 * @param { HdrMetadataKey } key Type of metadata. 6714 * @returns { HdrMetadataValue } Returns the value of metadata. 6715 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6716 * 2.Incorrect parameter types. 3.Parameter verification failed. 6717 * @throws { BusinessError } 501 - Resource unavailable. 6718 * @throws { BusinessError } 62980173 - The DMA memory does not exist. 6719 * @throws { BusinessError } 62980302 - Memory copy failed. 6720 * @syscap SystemCapability.Multimedia.Image.Core 6721 * @since 12 6722 */ 6723 getMetadata(key: HdrMetadataKey): HdrMetadataValue; 6724 6725 /** 6726 * Set pixelmap memory name. 6727 * 6728 * @param { string } name The name of the memory that needs to be set 6729 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.The length of the input parameter is too long. 6730 * 2.Parameter verification failed. 6731 * @throws { BusinessError } 501 - Resource unavailable. 6732 * @throws { BusinessError } 62980286 - Memory format not supported. 6733 * @syscap SystemCapability.Multimedia.Image.Core 6734 * @since 13 6735 */ 6736 setMemoryNameSync(name: string): void; 6737 6738 /** 6739 * Set metadata. 6740 * 6741 * @param { HdrMetadataKey } key Type of metadata. 6742 * @param { HdrMetadataValue } value Value of metadata. 6743 * @returns { Promise<void> } A Promise instance used to return the instance release result. If the operation fails, 6744 * an error message is returned. 6745 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6746 * 2.Incorrect parameter types. 3.Parameter verification failed. 6747 * @throws { BusinessError } 501 - Resource unavailable. 6748 * @throws { BusinessError } 62980173 - The DMA memory does not exist. 6749 * @throws { BusinessError } 62980302 - Memory copy failed. 6750 * @syscap SystemCapability.Multimedia.Image.Core 6751 * @since 12 6752 */ 6753 setMetadata(key: HdrMetadataKey, value: HdrMetadataValue): Promise<void>; 6754 } 6755 6756 /** 6757 * Picture instance. 6758 * 6759 * @typedef Picture 6760 * @syscap SystemCapability.Multimedia.Image.Core 6761 * @since 13 6762 */ 6763 interface Picture { 6764 /** 6765 * Obtains the pixel map of the main image. 6766 * 6767 * @returns { PixelMap } Returns the pixel map. 6768 * @syscap SystemCapability.Multimedia.Image.Core 6769 * @since 13 6770 */ 6771 getMainPixelmap(): PixelMap; 6772 6773 /** 6774 * Obtains the hdr pixel map. This method uses a promise to return the PixelMap object. 6775 * 6776 * @returns { Promise<PixelMap> } A Promise instance used to return the PixelMap object. 6777 * @throws { BusinessError } 7600901 - Unknown error. 6778 * @throws { BusinessError } 7600201 - Unsupported operation. 6779 * @syscap SystemCapability.Multimedia.Image.Core 6780 * @since 13 6781 */ 6782 getHdrComposedPixelmap(): Promise<PixelMap>; 6783 6784 /** 6785 * Obtains the gain map pixel map. 6786 * @returns { PixelMap | null } Returns the pixel map if the operation is successful; returns null otherwise. 6787 * @syscap SystemCapability.Multimedia.Image.Core 6788 * @since 13 6789 */ 6790 getGainmapPixelmap(): PixelMap | null; 6791 6792 /** 6793 * Set auxiliary picture. 6794 * 6795 * @param { AuxiliaryPictureType } type The type of auxiliary picture. 6796 * @param { AuxiliaryPicture } auxiliaryPicture AuxiliaryPicture object. 6797 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6798 * 2.Incorrect parameter types. 3.Parameter verification failed. 6799 * @syscap SystemCapability.Multimedia.Image.Core 6800 * @since 13 6801 */ 6802 setAuxiliaryPicture(type: AuxiliaryPictureType, auxiliaryPicture: AuxiliaryPicture): void; 6803 6804 /** 6805 * Obtains the auxiliary picture based on type. 6806 * 6807 * @param { AuxiliaryPictureType } type The type of auxiliary picture. 6808 * @returns { AuxiliaryPicture | null } Returns the auxiliary picture object. 6809 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6810 * 2.Incorrect parameter types. 3.Parameter verification failed. 6811 * @syscap SystemCapability.Multimedia.Image.Core 6812 * @since 13 6813 */ 6814 getAuxiliaryPicture(type: AuxiliaryPictureType): AuxiliaryPicture | null; 6815 6816 /** 6817 * Set the metadata of main picture. 6818 * 6819 * @param { MetadataType } metadataType The type of metadata. 6820 * @param { Metadata } metadata The metadata of main picture. 6821 * @returns { Promise<void> } A Promise instance used to return the operation result. 6822 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6823 * 2.Incorrect parameter types. 3.Parameter verification failed. 6824 * @throws { BusinessError } 7600202 - Unsupported metadata. Possible causes: Unsupported metadata type. 6825 * @syscap SystemCapability.Multimedia.Image.Core 6826 * @since 13 6827 */ 6828 setMetadata(metadataType: MetadataType, metadata: Metadata): Promise<void> 6829 6830 /** 6831 * Obtains the metadata of main picture. 6832 * 6833 * @param { MetadataType } metadataType The type of metadata. 6834 * @returns { Promise<Metadata> } Return the metadata of main picture. 6835 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6836 * 2.Incorrect parameter types. 3.Parameter verification failed. 6837 * @throws { BusinessError } 7600202 - Unsupported metadata. Possible causes: Unsupported metadata type. 6838 * @syscap SystemCapability.Multimedia.Image.Core 6839 * @since 13 6840 */ 6841 getMetadata(metadataType: MetadataType): Promise<Metadata> 6842 6843 /** 6844 * Marshalling picture and write into MessageSequence. 6845 * 6846 * @param { rpc.MessageSequence } sequence rpc.MessageSequence parameter. 6847 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6848 * 2.Incorrect parameter types; 3.Parameter verification failed. 6849 * @throws { BusinessError } 62980097 - IPC error. 6850 * @syscap SystemCapability.Multimedia.Image.Core 6851 * @since 13 6852 */ 6853 marshalling(sequence: rpc.MessageSequence): void 6854 6855 /** 6856 * Releases this Picture object. 6857 * @syscap SystemCapability.Multimedia.Image.Core 6858 * @since 13 6859 */ 6860 release(): void 6861 } 6862 6863 /** 6864 * Create a Picture object by the pixel map of the main image. 6865 * 6866 * @param { PixelMap } mainPixelmap The pixel map of the main image. 6867 * @returns { Picture } Returns the Picture object. 6868 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified. 6869 * 2.Incorrect parameter types; 3.Parameter verification failed. 6870 * @syscap SystemCapability.Multimedia.Image.Core 6871 * @since 13 6872 */ 6873 function createPicture(mainPixelmap : PixelMap): Picture; 6874 6875 /** 6876 * Creates a Picture object based on MessageSequence parameter. 6877 * 6878 * @param { rpc.MessageSequence } sequence - rpc.MessageSequence parameter. 6879 * @returns { Picture } Returns the Picture object. 6880 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified. 6881 * 2.Incorrect parameter types; 3.Parameter verification failed. 6882 * @throws { BusinessError } 62980097 - IPC error. 6883 * @syscap SystemCapability.Multimedia.Image.Core 6884 * @since 13 6885 */ 6886 function createPictureFromParcel(sequence: rpc.MessageSequence): Picture; 6887 6888 /** 6889 * Create a AuxiliaryPicture object by data buffer. 6890 * 6891 * @param { ArrayBuffer } buffer The image data buffer. 6892 * @param { Size } size The size of auxiliary picture. 6893 * @param { AuxiliaryPictureType } type The type of auxiliary picture. 6894 * @returns { AuxiliaryPicture } The AuxiliaryPicture object. 6895 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified. 6896 * 2.Incorrect parameter types; 3.Parameter verification failed. 6897 * @syscap SystemCapability.Multimedia.Image.Core 6898 * @since 13 6899 */ 6900 function createAuxiliaryPicture(buffer: ArrayBuffer, size: Size, type: AuxiliaryPictureType): AuxiliaryPicture; 6901 6902 /** 6903 * AuxiliaryPicture instance. 6904 * 6905 * @typedef AuxiliaryPicture 6906 * @syscap SystemCapability.Multimedia.Image.Core 6907 * @since 13 6908 */ 6909 interface AuxiliaryPicture { 6910 /** 6911 * Reads auxiliary picture data in an ArrayBuffer and writes the data to a AuxiliaryPicture object. This method 6912 * uses a promise to return the result. 6913 * 6914 * @param { ArrayBuffer } data A buffer from which the auxiliary picture data will be read. 6915 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an 6916 * error message is returned. 6917 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified. 6918 * 2.Incorrect parameter types. 3.Parameter verification failed. 6919 * @throws { BusinessError } 7600301 - Memory alloc failed. 6920 * @throws { BusinessError } 7600302 - Memory copy failed. 6921 * @syscap SystemCapability.Multimedia.Image.Core 6922 * @since 13 6923 */ 6924 writePixelsFromBuffer(data: ArrayBuffer): Promise<void>; 6925 6926 /** 6927 * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses 6928 * a promise to return the result. 6929 * 6930 * @returns { Promise<ArrayBuffer> } A Promise instance used to return the pixel map data. 6931 * @throws { BusinessError } 7600301 - Memory alloc failed. 6932 * @throws { BusinessError } 7600302 - Memory copy failed. 6933 * @syscap SystemCapability.Multimedia.Image.Core 6934 * @since 13 6935 */ 6936 readPixelsToBuffer(): Promise<ArrayBuffer>; 6937 6938 /** 6939 * Obtains the type of auxiliary picture. 6940 * 6941 * @returns { AuxiliaryPictureType } Returns the type of auxiliary picture. 6942 * @syscap SystemCapability.Multimedia.Image.Core 6943 * @since 13 6944 */ 6945 getType(): AuxiliaryPictureType; 6946 6947 /** 6948 * Set the metadata of auxiliary picture. 6949 * 6950 * @param { MetadataType } metadataType The type of metadata. 6951 * @param { Metadata } metadata The metadata of auxiliary picture. 6952 * @returns { Promise<void> } A Promise instance used to return the operation result. 6953 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6954 * 2.Incorrect parameter types. 3.Parameter verification failed. 6955 * @throws { BusinessError } 7600202 - Unsupported metadata. Possible causes: 1. Unsupported metadata type. 2. The 6956 * metadata type does not match the auxiliary picture type. 6957 * @syscap SystemCapability.Multimedia.Image.Core 6958 * @since 13 6959 */ 6960 setMetadata(metadataType: MetadataType, metadata: Metadata): Promise<void> 6961 6962 /** 6963 * Obtains the metadata of auxiliary picture. 6964 * 6965 * @param { MetadataType } metadataType The type of metadata. 6966 * @returns { Promise<Metadata> } Return the metadata of auxiliary picture. 6967 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 6968 * 2.Incorrect parameter types. 3.Parameter verification failed. 6969 * @throws { BusinessError } 7600202 - Unsupported metadata. Possible causes: 1. Unsupported metadata type. 2. The 6970 * metadata type does not match the auxiliary picture type. 6971 * @syscap SystemCapability.Multimedia.Image.Core 6972 * @since 13 6973 */ 6974 getMetadata(metadataType: MetadataType): Promise<Metadata> 6975 6976 /** 6977 * Obtains the information about this auxiliary picture. 6978 * 6979 * @returns { AuxiliaryPictureInfo } Returns the auxiliary picture information. If the operation fails, an error 6980 * message is returned. 6981 * @syscap SystemCapability.Multimedia.Image.Core 6982 * @since 13 6983 */ 6984 getAuxiliaryPictureInfo(): AuxiliaryPictureInfo; 6985 6986 /** 6987 * Set the information about this auxiliary picture. 6988 * 6989 * @param { AuxiliaryPictureInfo } info the auxiliary picture information. 6990 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified. 6991 * 2.Incorrect parameter types. 3.Parameter verification failed. 6992 * @syscap SystemCapability.Multimedia.Image.Core 6993 * @since 13 6994 */ 6995 setAuxiliaryPictureInfo(info: AuxiliaryPictureInfo): void 6996 6997 /** 6998 * Releases this AuxiliaryPicture object. 6999 * @syscap SystemCapability.Multimedia.Image.Core 7000 * @since 13 7001 */ 7002 release():void 7003 } 7004 7005 /** 7006 * Enumerates auxiliary picture type. 7007 * 7008 * @enum { number } 7009 * @syscap SystemCapability.Multimedia.Image.Core 7010 * @since 13 7011 */ 7012 enum AuxiliaryPictureType { 7013 /** 7014 * Gain map. 7015 * 7016 * @syscap SystemCapability.Multimedia.Image.Core 7017 * @since 13 7018 */ 7019 GAINMAP = 1, 7020 7021 /** 7022 * Depth map. 7023 * 7024 * @syscap SystemCapability.Multimedia.Image.Core 7025 * @since 13 7026 */ 7027 DEPTH_MAP = 2, 7028 7029 /** 7030 * Unrefocus map. 7031 * 7032 * @syscap SystemCapability.Multimedia.Image.Core 7033 * @since 13 7034 */ 7035 UNREFOCUS_MAP = 3, 7036 7037 /** 7038 * Linear map. 7039 * 7040 * @syscap SystemCapability.Multimedia.Image.Core 7041 * @since 13 7042 */ 7043 LINEAR_MAP = 4, 7044 7045 /** 7046 * Fragment map. 7047 * 7048 * @syscap SystemCapability.Multimedia.Image.Core 7049 * @since 13 7050 */ 7051 FRAGMENT_MAP = 5, 7052 } 7053 7054 /** 7055 * Enumerates metadata type. 7056 * 7057 * @enum { number } 7058 * @syscap SystemCapability.Multimedia.Image.Core 7059 * @since 13 7060 */ 7061 enum MetadataType { 7062 /** 7063 * EXIF metadata. 7064 * 7065 * @syscap SystemCapability.Multimedia.Image.Core 7066 * @since 13 7067 */ 7068 EXIF_METADATA = 1, 7069 7070 /** 7071 * Fragment metadata. 7072 * 7073 * @syscap SystemCapability.Multimedia.Image.Core 7074 * @since 13 7075 */ 7076 FRAGMENT_METADATA = 2, 7077 } 7078 7079 /** 7080 * Metadata instance. 7081 * 7082 * @typedef Metadata 7083 * @syscap SystemCapability.Multimedia.Image.Core 7084 * @since 13 7085 */ 7086 interface Metadata { 7087 /** 7088 * Obtains the value of properties in an image. This method uses a promise to return the property values in array 7089 * of records. 7090 * 7091 * @param { Array<string> } key Name of the properties whose value is to be obtained. 7092 * @returns { Promise<Record<string, string | null>> } Array of Records instance used to return the property values. 7093 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 7094 * 2.Incorrect parameter types. 3.Parameter verification failed. 7095 * @throws { BusinessError } 7600202 - Unsupported metadata. Possible causes: 1. Unsupported metadata type. 2. The 7096 * metadata type does not match the auxiliary picture type. 7097 * @syscap SystemCapability.Multimedia.Image.Core 7098 * @since 13 7099 */ 7100 getProperties(key: Array<string>): Promise<Record<string, string | null>> 7101 7102 /** 7103 * Modify the value of properties in an image with the specified keys. 7104 * 7105 * @param { Record<string, string | null> } records Array of the property Records whose values are to 7106 * be modified. 7107 * @returns { Promise<void> } A Promise instance used to return the operation result. 7108 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 7109 * 2.Incorrect parameter types. 3.Parameter verification failed. 7110 * @throws { BusinessError } 7600202 - Unsupported metadata. Possible causes: 1. Unsupported metadata type. 2. The 7111 * metadata type does not match the auxiliary picture type. 7112 * @syscap SystemCapability.Multimedia.Image.Core 7113 * @since 13 7114 */ 7115 setProperties(records: Record<string, string | null>): Promise<void> 7116 7117 /** 7118 * Obtains the value of all properties in an image. This method uses a promise to return the property values 7119 * in array of records. 7120 * 7121 * @returns { Promise<Record<string, string | null>> } Array of Records instance used to return the property values. 7122 * @syscap SystemCapability.Multimedia.Image.Core 7123 * @since 13 7124 */ 7125 getAllProperties(): Promise<Record<string, string | null>> 7126 7127 /** 7128 * Obtains a clone of metadata. This method uses a promise to return the metadata. 7129 * 7130 * @returns { Promise<Metadata> } A Promise instance used to return the metadata. 7131 * @throws { BusinessError } 7600301 - Memory alloc failed. 7132 * @throws { BusinessError } 7600302 - Memory copy failed. 7133 * @syscap SystemCapability.Multimedia.Image.Core 7134 * @since 13 7135 */ 7136 clone(): Promise<Metadata> 7137 } 7138 7139 /** 7140 * Enumerates fragment map information types of an image. 7141 * 7142 * @enum { string } 7143 * @syscap SystemCapability.Multimedia.Image.Core 7144 * @since 13 7145 */ 7146 enum FragmentMapPropertyKey { 7147 /** 7148 * The x-coordinate of the top left corner of the mark cup map in the original image. 7149 * 7150 * @syscap SystemCapability.Multimedia.Image.Core 7151 * @since 13 7152 */ 7153 X_IN_ORIGINAL = 'XInOriginal', 7154 7155 /** 7156 * The y-coordinate of the top left corner of the mark cup map in the original image. 7157 * 7158 * @syscap SystemCapability.Multimedia.Image.Core 7159 * @since 13 7160 */ 7161 Y_IN_ORIGINAL = 'YInOriginal', 7162 7163 /** 7164 * Mark cut map width. 7165 * 7166 * @syscap SystemCapability.Multimedia.Image.Core 7167 * @since 13 7168 */ 7169 WIDTH = 'FragmentImageWidth', 7170 7171 /** 7172 * Mark cut map width. 7173 * 7174 * @syscap SystemCapability.Multimedia.Image.Core 7175 * @since 13 7176 */ 7177 HEIGHT = 'FragmentImageHeight' 7178 } 7179 7180 /** 7181 * Describes image decoding parameters. 7182 * 7183 * @typedef DecodingOptionsForPicture 7184 * @syscap SystemCapability.Multimedia.Image.ImageSource 7185 * @since 13 7186 */ 7187 interface DecodingOptionsForPicture { 7188 /** 7189 * Expected set of auxiliary picture types, default to decoding all auxiliary pictures. 7190 * 7191 * @type { Array<AuxiliaryPictureType> } 7192 * @syscap SystemCapability.Multimedia.Image.Core 7193 * @since 13 7194 */ 7195 desiredAuxiliaryPictures: Array<AuxiliaryPictureType>; 7196 } 7197 7198 /** 7199 * Describes auxiliary picture information. 7200 * 7201 * @typedef AuxiliaryPictureInfo 7202 * @syscap SystemCapability.Multimedia.Image.Core 7203 * @since 13 7204 */ 7205 interface AuxiliaryPictureInfo { 7206 /** 7207 * Indicates auxiliary picture type. 7208 * 7209 * @type { AuxiliaryPictureType } 7210 * @syscap SystemCapability.Multimedia.Image.Core 7211 * @since 13 7212 */ 7213 auxiliaryPictureType: AuxiliaryPictureType; 7214 7215 /** 7216 * Indicates image dimensions specified by a {@link Size} interface. 7217 * 7218 * @type { Size } 7219 * @syscap SystemCapability.Multimedia.Image.Core 7220 * @since 13 7221 */ 7222 size: Size; 7223 7224 /** 7225 * The number of byte per row. 7226 * 7227 * @type { number } 7228 * @syscap SystemCapability.Multimedia.Image.Core 7229 * @since 13 7230 */ 7231 rowStride: number; 7232 7233 /** 7234 * Indicates image format. 7235 * 7236 * @type { PixelMapFormat } 7237 * @syscap SystemCapability.Multimedia.Image.Core 7238 * @since 13 7239 */ 7240 pixelFormat: PixelMapFormat; 7241 7242 /** 7243 * Indicates color space for pixel map. 7244 * 7245 * @type { colorSpaceManager.ColorSpaceManager } 7246 * @syscap SystemCapability.Multimedia.Image.Core 7247 * @since 13 7248 */ 7249 colorSpace: colorSpaceManager.ColorSpaceManager; 7250 } 7251 7252 /** 7253 * ImageSource instance. 7254 * 7255 * @typedef ImageSource 7256 * @syscap SystemCapability.Multimedia.Image.ImageSource 7257 * @since 6 7258 */ 7259 /** 7260 * ImageSource instance. 7261 * 7262 * @typedef ImageSource 7263 * @syscap SystemCapability.Multimedia.Image.ImageSource 7264 * @crossplatform 7265 * @since 10 7266 */ 7267 /** 7268 * ImageSource instance. 7269 * 7270 * @typedef ImageSource 7271 * @syscap SystemCapability.Multimedia.Image.ImageSource 7272 * @crossplatform 7273 * @atomicservice 7274 * @since 11 7275 */ 7276 /** 7277 * ImageSource instance. 7278 * 7279 * @typedef ImageSource 7280 * @syscap SystemCapability.Multimedia.Image.ImageSource 7281 * @crossplatform 7282 * @form 7283 * @atomicservice 7284 * @since 12 7285 */ 7286 interface ImageSource { 7287 /** 7288 * Obtains information about an image with the specified sequence number and uses a callback 7289 * to return the result. 7290 * 7291 * @param { number } index Sequence number of an image. 7292 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image information. 7293 * @syscap SystemCapability.Multimedia.Image.ImageSource 7294 * @since 6 7295 */ 7296 /** 7297 * Obtains information about an image with the specified sequence number and uses a callback 7298 * to return the result. 7299 * 7300 * @param { number } index Sequence number of an image. 7301 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image information. 7302 * @syscap SystemCapability.Multimedia.Image.ImageSource 7303 * @crossplatform 7304 * @since 10 7305 */ 7306 /** 7307 * Obtains information about an image with the specified sequence number and uses a callback 7308 * to return the result. 7309 * 7310 * @param { number } index Sequence number of an image. 7311 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image information. 7312 * @syscap SystemCapability.Multimedia.Image.ImageSource 7313 * @crossplatform 7314 * @atomicservice 7315 * @since 11 7316 */ 7317 /** 7318 * Obtains information about an image with the specified sequence number and uses a callback 7319 * to return the result. 7320 * 7321 * @param { number } index Sequence number of an image. 7322 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image information. 7323 * @syscap SystemCapability.Multimedia.Image.ImageSource 7324 * @crossplatform 7325 * @form 7326 * @atomicservice 7327 * @since 12 7328 */ 7329 getImageInfo(index: number, callback: AsyncCallback<ImageInfo>): void; 7330 7331 /** 7332 * Obtains information about this image and uses a callback to return the result. 7333 * 7334 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image information. 7335 * @syscap SystemCapability.Multimedia.Image.ImageSource 7336 * @since 6 7337 */ 7338 /** 7339 * Obtains information about this image and uses a callback to return the result. 7340 * 7341 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image information. 7342 * @syscap SystemCapability.Multimedia.Image.ImageSource 7343 * @crossplatform 7344 * @since 10 7345 */ 7346 /** 7347 * Obtains information about this image and uses a callback to return the result. 7348 * 7349 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image information. 7350 * @syscap SystemCapability.Multimedia.Image.ImageSource 7351 * @crossplatform 7352 * @atomicservice 7353 * @since 11 7354 */ 7355 /** 7356 * Obtains information about this image and uses a callback to return the result. 7357 * 7358 * @param { AsyncCallback<ImageInfo> } callback Callback used to return the image information. 7359 * @syscap SystemCapability.Multimedia.Image.ImageSource 7360 * @crossplatform 7361 * @form 7362 * @atomicservice 7363 * @since 12 7364 */ 7365 getImageInfo(callback: AsyncCallback<ImageInfo>): void; 7366 7367 /** 7368 * Get image information from image source. 7369 * 7370 * @param { number } index Sequence number of an image. If this parameter is not specified, the default value 0 is used. 7371 * @returns { Promise<ImageInfo> } A Promise instance used to return the image information. 7372 * @syscap SystemCapability.Multimedia.Image.ImageSource 7373 * @since 6 7374 */ 7375 /** 7376 * Get image information from image source. 7377 * 7378 * @param { number } index Sequence number of an image. If this parameter is not specified, the default value 0 is used. 7379 * @returns { Promise<ImageInfo> } A Promise instance used to return the image information. 7380 * @syscap SystemCapability.Multimedia.Image.ImageSource 7381 * @crossplatform 7382 * @since 10 7383 */ 7384 /** 7385 * Get image information from image source. 7386 * 7387 * @param { number } index Sequence number of an image. If this parameter is not specified, the default value 0 is used. 7388 * @returns { Promise<ImageInfo> } A Promise instance used to return the image information. 7389 * @syscap SystemCapability.Multimedia.Image.ImageSource 7390 * @crossplatform 7391 * @atomicservice 7392 * @since 11 7393 */ 7394 /** 7395 * Get image information from image source. 7396 * 7397 * @param { number } index Sequence number of an image. If this parameter is not specified, the default value 0 is used. 7398 * @returns { Promise<ImageInfo> } A Promise instance used to return the image information. 7399 * @syscap SystemCapability.Multimedia.Image.ImageSource 7400 * @crossplatform 7401 * @form 7402 * @atomicservice 7403 * @since 12 7404 */ 7405 getImageInfo(index?: number): Promise<ImageInfo>; 7406 7407 /** 7408 * Get image information from image source synchronously. 7409 * 7410 * @param { number } index - Index of sequence images. If this parameter is not specified, default value is 0. 7411 * @returns { ImageInfo } The image information. 7412 * @syscap SystemCapability.Multimedia.Image.ImageSource 7413 * @crossplatform 7414 * @since 12 7415 */ 7416 getImageInfoSync(index?: number): ImageInfo; 7417 7418 /** 7419 * Creates a PixelMap object based on image decoding parameters. This method uses a promise to 7420 * return the object. 7421 * 7422 * @param { DecodingOptions } options Image decoding parameters. 7423 * @returns { Promise<PixelMap> } A Promise instance used to return the PixelMap object. 7424 * @syscap SystemCapability.Multimedia.Image.ImageSource 7425 * @since 7 7426 */ 7427 /** 7428 * Creates a PixelMap object based on image decoding parameters. This method uses a promise to 7429 * return the object. 7430 * 7431 * @param { DecodingOptions } options Image decoding parameters. 7432 * @returns { Promise<PixelMap> } A Promise instance used to return the PixelMap object. 7433 * @syscap SystemCapability.Multimedia.Image.ImageSource 7434 * @crossplatform 7435 * @since 10 7436 */ 7437 /** 7438 * Creates a PixelMap object based on image decoding parameters. This method uses a promise to 7439 * return the object. 7440 * 7441 * @param { DecodingOptions } options Image decoding parameters. 7442 * @returns { Promise<PixelMap> } A Promise instance used to return the PixelMap object. 7443 * @syscap SystemCapability.Multimedia.Image.ImageSource 7444 * @crossplatform 7445 * @atomicservice 7446 * @since 11 7447 */ 7448 /** 7449 * Creates a PixelMap object based on image decoding parameters. This method uses a promise to 7450 * return the object. 7451 * 7452 * @param { DecodingOptions } options Image decoding parameters. 7453 * @returns { Promise<PixelMap> } A Promise instance used to return the PixelMap object. 7454 * @syscap SystemCapability.Multimedia.Image.ImageSource 7455 * @crossplatform 7456 * @form 7457 * @atomicservice 7458 * @since 12 7459 */ 7460 createPixelMap(options?: DecodingOptions): Promise<PixelMap>; 7461 7462 /** 7463 * Creates a PixelMap object. This method uses a callback to return the object. 7464 * 7465 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 7466 * @syscap SystemCapability.Multimedia.Image.ImageSource 7467 * @since 7 7468 */ 7469 /** 7470 * Creates a PixelMap object. This method uses a callback to return the object. 7471 * 7472 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 7473 * @syscap SystemCapability.Multimedia.Image.ImageSource 7474 * @crossplatform 7475 * @since 10 7476 */ 7477 /** 7478 * Creates a PixelMap object. This method uses a callback to return the object. 7479 * 7480 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 7481 * @syscap SystemCapability.Multimedia.Image.ImageSource 7482 * @crossplatform 7483 * @atomicservice 7484 * @since 11 7485 */ 7486 /** 7487 * Creates a PixelMap object. This method uses a callback to return the object. 7488 * 7489 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 7490 * @syscap SystemCapability.Multimedia.Image.ImageSource 7491 * @crossplatform 7492 * @form 7493 * @atomicservice 7494 * @since 12 7495 */ 7496 createPixelMap(callback: AsyncCallback<PixelMap>): void; 7497 7498 /** 7499 * Creates a PixelMap object based on image decoding parameters. This method uses a callback to 7500 * return the object. 7501 * 7502 * @param { DecodingOptions } options Image decoding parameters. 7503 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 7504 * @syscap SystemCapability.Multimedia.Image.ImageSource 7505 * @since 7 7506 */ 7507 /** 7508 * Creates a PixelMap object based on image decoding parameters. This method uses a callback to 7509 * return the object. 7510 * 7511 * @param { DecodingOptions } options Image decoding parameters. 7512 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 7513 * @syscap SystemCapability.Multimedia.Image.ImageSource 7514 * @crossplatform 7515 * @since 10 7516 */ 7517 /** 7518 * Creates a PixelMap object based on image decoding parameters. This method uses a callback to 7519 * return the object. 7520 * 7521 * @param { DecodingOptions } options Image decoding parameters. 7522 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 7523 * @syscap SystemCapability.Multimedia.Image.ImageSource 7524 * @crossplatform 7525 * @atomicservice 7526 * @since 11 7527 */ 7528 /** 7529 * Creates a PixelMap object based on image decoding parameters. This method uses a callback to 7530 * return the object. 7531 * 7532 * @param { DecodingOptions } options Image decoding parameters. 7533 * @param { AsyncCallback<PixelMap> } callback Callback used to return the PixelMap object. 7534 * @syscap SystemCapability.Multimedia.Image.ImageSource 7535 * @crossplatform 7536 * @form 7537 * @atomicservice 7538 * @since 12 7539 */ 7540 createPixelMap(options: DecodingOptions, callback: AsyncCallback<PixelMap>): void; 7541 7542 /** 7543 * Create a PixelMap object based on image decoding parameters synchronously. 7544 * 7545 * @param { DecodingOptions } options - Image decoding parameters. 7546 * @returns { PixelMap } Return the PixelMap. If decoding fails, return undefined. 7547 * @syscap SystemCapability.Multimedia.Image.ImageSource 7548 * @crossplatform 7549 * @since 12 7550 */ 7551 createPixelMapSync(options?: DecodingOptions): PixelMap; 7552 7553 /** 7554 * Creates a PixelMap array based on image decoding parameters. This method uses a promise to 7555 * return the array. 7556 * 7557 * @param { DecodingOptions } options Image decoding parameters. 7558 * @returns { Promise<Array<PixelMap>> } A Promise instance used to return the PixelMap array. 7559 * @throws { BusinessError } 62980096 - The operation failed. 7560 * @throws { BusinessError } 62980099 - The shared memory data is abnormal. 7561 * @throws { BusinessError } 62980101 - The image data is abnormal. 7562 * @throws { BusinessError } 62980103 - The image data is not supported. 7563 * @throws { BusinessError } 62980106 - The image is too large. 7564 * @throws { BusinessError } 62980109 - Failed to crop the image. 7565 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7566 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7567 * @throws { BusinessError } 62980112 - The image format does not match. 7568 * @throws { BusinessError } 62980113 - Unknown image format. 7569 * @throws { BusinessError } 62980115 - Invalid image parameter. 7570 * @throws { BusinessError } 62980116 - Failed to decode the image. 7571 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7572 * @throws { BusinessError } 62980122 - The image decoding header is abnormal. 7573 * @throws { BusinessError } 62980137 - Invalid media operation. 7574 * @throws { BusinessError } 62980173 - The DMA memory does not exist. 7575 * @throws { BusinessError } 62980174 - The DMA memory data is abnormal. 7576 * @syscap SystemCapability.Multimedia.Image.ImageSource 7577 * @crossplatform 7578 * @since 10 7579 */ 7580 /** 7581 * Creates a PixelMap array based on image decoding parameters. This method uses a promise to 7582 * return the array. 7583 * 7584 * @param { DecodingOptions } options Image decoding parameters. 7585 * @returns { Promise<Array<PixelMap>> } A Promise instance used to return the PixelMap array. 7586 * @throws { BusinessError } 62980096 - The operation failed. 7587 * @throws { BusinessError } 62980099 - The shared memory data is abnormal. 7588 * @throws { BusinessError } 62980101 - The image data is abnormal. 7589 * @throws { BusinessError } 62980103 - The image data is not supported. 7590 * @throws { BusinessError } 62980106 - The image is too large. 7591 * @throws { BusinessError } 62980109 - Failed to crop the image. 7592 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7593 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7594 * @throws { BusinessError } 62980112 - The image format does not match. 7595 * @throws { BusinessError } 62980113 - Unknown image format. 7596 * @throws { BusinessError } 62980115 - Invalid image parameter. 7597 * @throws { BusinessError } 62980116 - Failed to decode the image. 7598 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7599 * @throws { BusinessError } 62980122 - Failed to decode the image header. 7600 * @throws { BusinessError } 62980137 - Invalid media operation. 7601 * @throws { BusinessError } 62980173 - The DMA memory does not exist. 7602 * @throws { BusinessError } 62980174 - The DMA memory data is abnormal. 7603 * @syscap SystemCapability.Multimedia.Image.ImageSource 7604 * @crossplatform 7605 * @since 12 7606 */ 7607 createPixelMapList(options?: DecodingOptions): Promise<Array<PixelMap>>; 7608 7609 /** 7610 * Creates a PixelMap array. This method uses a callback to return the array. 7611 * 7612 * @param { AsyncCallback<Array<PixelMap>> } callback Callback used to return the PixelMap array. 7613 * @throws { BusinessError } 62980096 - The operation failed. 7614 * @throws { BusinessError } 62980099 - The shared memory data is abnormal. 7615 * @throws { BusinessError } 62980101 - The image data is abnormal. 7616 * @throws { BusinessError } 62980103 - The image data is not supported. 7617 * @throws { BusinessError } 62980106 - The image is too large. 7618 * @throws { BusinessError } 62980109 - Failed to crop the image. 7619 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7620 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7621 * @throws { BusinessError } 62980112 - The image format does not match. 7622 * @throws { BusinessError } 62980113 - Unknown image format. 7623 * @throws { BusinessError } 62980115 - Invalid image parameter. 7624 * @throws { BusinessError } 62980116 - Failed to decode the image. 7625 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7626 * @throws { BusinessError } 62980122 - The image decoding header is abnormal. 7627 * @throws { BusinessError } 62980137 - Invalid media operation. 7628 * @throws { BusinessError } 62980173 - The DMA memory does not exist. 7629 * @throws { BusinessError } 62980174 - The DMA memory data is abnormal. 7630 * @syscap SystemCapability.Multimedia.Image.ImageSource 7631 * @crossplatform 7632 * @since 10 7633 */ 7634 /** 7635 * Creates a PixelMap array. This method uses a callback to return the array. 7636 * 7637 * @param { AsyncCallback<Array<PixelMap>> } callback Callback used to return the PixelMap array. 7638 * @throws { BusinessError } 62980096 - The operation failed. 7639 * @throws { BusinessError } 62980099 - The shared memory data is abnormal. 7640 * @throws { BusinessError } 62980101 - The image data is abnormal. 7641 * @throws { BusinessError } 62980103 - The image data is not supported. 7642 * @throws { BusinessError } 62980106 - The image is too large. 7643 * @throws { BusinessError } 62980109 - Failed to crop the image. 7644 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7645 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7646 * @throws { BusinessError } 62980112 - The image format does not match. 7647 * @throws { BusinessError } 62980113 - Unknown image format. 7648 * @throws { BusinessError } 62980115 - Invalid image parameter. 7649 * @throws { BusinessError } 62980116 - Failed to decode the image. 7650 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7651 * @throws { BusinessError } 62980122 - Failed to decode the image header. 7652 * @throws { BusinessError } 62980137 - Invalid media operation. 7653 * @throws { BusinessError } 62980173 - The DMA memory does not exist. 7654 * @throws { BusinessError } 62980174 - The DMA memory data is abnormal. 7655 * @syscap SystemCapability.Multimedia.Image.ImageSource 7656 * @crossplatform 7657 * @since 12 7658 */ 7659 createPixelMapList(callback: AsyncCallback<Array<PixelMap>>): void; 7660 7661 /** 7662 * Creates a PixelMap array based on image decoding parameters. This method uses a callback to 7663 * return the array. 7664 * 7665 * @param { DecodingOptions } options Image decoding parameters. 7666 * @param { AsyncCallback<Array<PixelMap>> } callback Callback used to return the PixelMap array. 7667 * @throws { BusinessError } 62980096 - The operation failed. 7668 * @throws { BusinessError } 62980099 - The shared memory data is abnormal. 7669 * @throws { BusinessError } 62980101 - The image data is abnormal. 7670 * @throws { BusinessError } 62980103 - The image data is not supported. 7671 * @throws { BusinessError } 62980106 - The image is too large. 7672 * @throws { BusinessError } 62980109 - Failed to crop the image. 7673 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7674 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7675 * @throws { BusinessError } 62980112 - The image format does not match. 7676 * @throws { BusinessError } 62980113 - Unknown image format. 7677 * @throws { BusinessError } 62980115 - Invalid image parameter. 7678 * @throws { BusinessError } 62980116 - Failed to decode the image. 7679 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7680 * @throws { BusinessError } 62980122 - The image decoding header is abnormal. 7681 * @throws { BusinessError } 62980137 - Invalid media operation. 7682 * @throws { BusinessError } 62980173 - The DMA memory does not exist. 7683 * @throws { BusinessError } 62980174 - The DMA memory data is abnormal. 7684 * @syscap SystemCapability.Multimedia.Image.ImageSource 7685 * @crossplatform 7686 * @since 10 7687 */ 7688 /** 7689 * Creates a PixelMap array based on image decoding parameters. This method uses a callback to 7690 * return the array. 7691 * 7692 * @param { DecodingOptions } options Image decoding parameters. 7693 * @param { AsyncCallback<Array<PixelMap>> } callback Callback used to return the PixelMap array. 7694 * @throws { BusinessError } 62980096 - The operation failed. 7695 * @throws { BusinessError } 62980099 - The shared memory data is abnormal. 7696 * @throws { BusinessError } 62980101 - The image data is abnormal. 7697 * @throws { BusinessError } 62980103 - The image data is not supported. 7698 * @throws { BusinessError } 62980106 - The image is too large. 7699 * @throws { BusinessError } 62980109 - Failed to crop the image. 7700 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7701 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7702 * @throws { BusinessError } 62980112 - The image format does not match. 7703 * @throws { BusinessError } 62980113 - Unknown image format. 7704 * @throws { BusinessError } 62980115 - Invalid image parameter. 7705 * @throws { BusinessError } 62980116 - Failed to decode the image. 7706 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7707 * @throws { BusinessError } 62980122 - Failed to decode the image header. 7708 * @throws { BusinessError } 62980137 - Invalid media operation. 7709 * @throws { BusinessError } 62980173 - The DMA memory does not exist. 7710 * @throws { BusinessError } 62980174 - The DMA memory data is abnormal. 7711 * @syscap SystemCapability.Multimedia.Image.ImageSource 7712 * @crossplatform 7713 * @since 12 7714 */ 7715 createPixelMapList(options: DecodingOptions, callback: AsyncCallback<Array<PixelMap>>): void; 7716 7717 /** 7718 * Obtains the array of delay time in an image. This method uses a promise to return the array. 7719 * 7720 * @returns { Promise<Array<number>> } A Promise instance used to return the array. 7721 * @throws { BusinessError } 62980096 - The operation failed. 7722 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7723 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7724 * @throws { BusinessError } 62980112 - The image format does not match. 7725 * @throws { BusinessError } 62980113 - Unknown image format. 7726 * @throws { BusinessError } 62980115 - Invalid image parameter. 7727 * @throws { BusinessError } 62980116 - Failed to decode the image. 7728 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7729 * @throws { BusinessError } 62980122 - The image decoding header is abnormal. 7730 * @throws { BusinessError } 62980137 - Invalid media operation. 7731 * @throws { BusinessError } 62980149 - Invalid media parameter. 7732 * @syscap SystemCapability.Multimedia.Image.ImageSource 7733 * @crossplatform 7734 * @since 10 7735 */ 7736 /** 7737 * Obtains the array of delay time in an image. This method uses a promise to return the array. 7738 * 7739 * @returns { Promise<Array<number>> } A Promise instance used to return the array. 7740 * @throws { BusinessError } 62980096 - The operation failed. 7741 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7742 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7743 * @throws { BusinessError } 62980112 - The image format does not match. 7744 * @throws { BusinessError } 62980113 - Unknown image format. 7745 * @throws { BusinessError } 62980115 - Invalid image parameter. 7746 * @throws { BusinessError } 62980116 - Failed to decode the image. 7747 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7748 * @throws { BusinessError } 62980122 - Failed to decode the image header. 7749 * @throws { BusinessError } 62980137 - Invalid media operation. 7750 * @throws { BusinessError } 62980149 - Invalid MIME type for the image source. 7751 * @syscap SystemCapability.Multimedia.Image.ImageSource 7752 * @crossplatform 7753 * @since 12 7754 */ 7755 getDelayTimeList(): Promise<Array<number>>; 7756 7757 /** 7758 * Obtains the array of delay time in an image. This method uses a callback to return the array. 7759 * 7760 * @param { AsyncCallback<Array<number>> } callback Callback used to return the array. 7761 * @throws { BusinessError } 62980096 - The operation failed. 7762 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7763 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7764 * @throws { BusinessError } 62980112 - The image format does not match. 7765 * @throws { BusinessError } 62980113 - Unknown image format. 7766 * @throws { BusinessError } 62980115 - Invalid image parameter. 7767 * @throws { BusinessError } 62980116 - Failed to decode the image. 7768 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7769 * @throws { BusinessError } 62980122 - The image decoding header is abnormal. 7770 * @throws { BusinessError } 62980137 - Invalid media operation. 7771 * @throws { BusinessError } 62980149 - Invalid media parameter. 7772 * @syscap SystemCapability.Multimedia.Image.ImageSource 7773 * @crossplatform 7774 * @since 10 7775 */ 7776 /** 7777 * Obtains the array of delay time in an image. This method uses a callback to return the array. 7778 * 7779 * @param { AsyncCallback<Array<number>> } callback Callback used to return the array. 7780 * @throws { BusinessError } 62980096 - The operation failed. 7781 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7782 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7783 * @throws { BusinessError } 62980112 - The image format does not match. 7784 * @throws { BusinessError } 62980113 - Unknown image format. 7785 * @throws { BusinessError } 62980115 - Invalid image parameter. 7786 * @throws { BusinessError } 62980116 - Failed to decode the image. 7787 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7788 * @throws { BusinessError } 62980122 - Failed to decode the image header. 7789 * @throws { BusinessError } 62980137 - Invalid media operation. 7790 * @throws { BusinessError } 62980149 - Invalid MIME type for the image source. 7791 * @syscap SystemCapability.Multimedia.Image.ImageSource 7792 * @crossplatform 7793 * @since 12 7794 */ 7795 getDelayTimeList(callback: AsyncCallback<Array<number>>): void; 7796 7797 /** 7798 * Obtains the array of disposal type in a gif image. This method uses a promise to return the array. 7799 * 7800 * @returns { Promise<Array<number>> } A Promise instance used to return the array. 7801 * @throws { BusinessError } 62980096 - The operation failed. 7802 * @throws { BusinessError } 62980101 - The image data is abnormal. 7803 * @throws { BusinessError } 62980137 - Invalid media operation. 7804 * @throws { BusinessError } 62980149 - Invalid MIME type for the image source. 7805 * @syscap SystemCapability.Multimedia.Image.ImageSource 7806 * @crossplatform 7807 * @since 12 7808 */ 7809 getDisposalTypeList(): Promise<Array<number>>; 7810 7811 /** 7812 * Obtains the count of frame in an image. This method uses a promise to return the number. 7813 * 7814 * @returns { Promise<number> } A Promise instance used to return the number. 7815 * @throws { BusinessError } 62980096 - The operation failed. 7816 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7817 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7818 * @throws { BusinessError } 62980112 - The image format does not match. 7819 * @throws { BusinessError } 62980113 - Unknown image format. 7820 * @throws { BusinessError } 62980115 - Invalid image parameter. 7821 * @throws { BusinessError } 62980116 - Failed to decode the image. 7822 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7823 * @throws { BusinessError } 62980122 - The image decoding header is abnormal. 7824 * @throws { BusinessError } 62980137 - Invalid media operation. 7825 * @syscap SystemCapability.Multimedia.Image.ImageSource 7826 * @crossplatform 7827 * @since 10 7828 */ 7829 /** 7830 * Obtains the count of frame in an image. This method uses a promise to return the number. 7831 * 7832 * @returns { Promise<number> } A Promise instance used to return the number. 7833 * @throws { BusinessError } 62980096 - The operation failed. 7834 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7835 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7836 * @throws { BusinessError } 62980112 - The image format does not match. 7837 * @throws { BusinessError } 62980113 - Unknown image format. 7838 * @throws { BusinessError } 62980115 - Invalid image parameter. 7839 * @throws { BusinessError } 62980116 - Failed to decode the image. 7840 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7841 * @throws { BusinessError } 62980122 - Failed to decode the image header. 7842 * @throws { BusinessError } 62980137 - Invalid media operation. 7843 * @syscap SystemCapability.Multimedia.Image.ImageSource 7844 * @crossplatform 7845 * @since 12 7846 */ 7847 getFrameCount(): Promise<number>; 7848 7849 /** 7850 * Obtains the count of frame in an image. This method uses a callback to return the number. 7851 * 7852 * @param { AsyncCallback<number> } callback Callback used to return the number. 7853 * @throws { BusinessError } 62980096 - The operation failed. 7854 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7855 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7856 * @throws { BusinessError } 62980112 - The image format does not match. 7857 * @throws { BusinessError } 62980113 - Unknown image format. 7858 * @throws { BusinessError } 62980115 - Invalid image parameter. 7859 * @throws { BusinessError } 62980116 - Failed to decode the image. 7860 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7861 * @throws { BusinessError } 62980122 - The image decoding header is abnormal. 7862 * @throws { BusinessError } 62980137 - Invalid media operation. 7863 * @syscap SystemCapability.Multimedia.Image.ImageSource 7864 * @crossplatform 7865 * @since 10 7866 */ 7867 /** 7868 * Obtains the count of frame in an image. This method uses a callback to return the number. 7869 * 7870 * @param { AsyncCallback<number> } callback Callback used to return the number. 7871 * @throws { BusinessError } 62980096 - The operation failed. 7872 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7873 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7874 * @throws { BusinessError } 62980112 - The image format does not match. 7875 * @throws { BusinessError } 62980113 - Unknown image format. 7876 * @throws { BusinessError } 62980115 - Invalid image parameter. 7877 * @throws { BusinessError } 62980116 - Failed to decode the image. 7878 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7879 * @throws { BusinessError } 62980122 - Failed to decode the image header. 7880 * @throws { BusinessError } 62980137 - Invalid media operation. 7881 * @syscap SystemCapability.Multimedia.Image.ImageSource 7882 * @crossplatform 7883 * @since 12 7884 */ 7885 getFrameCount(callback: AsyncCallback<number>): void; 7886 7887 /** 7888 * Obtains the value of a property in an image with the specified index. This method uses a 7889 * promise to return the property value in a string. 7890 * 7891 * @param { PropertyKey } key - Name of the property whose value is to be obtained. 7892 * @param { ImagePropertyOptions } options - Index of the image. 7893 * @returns { Promise<string> } A Promise instance used to return the property value. If the operation fails, the default value is returned. 7894 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types;3.Parameter verification failed; 7895 * @throws { BusinessError } 62980096 - The operation failed. 7896 * @throws { BusinessError } 62980103 - The image data is not supported. 7897 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7898 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7899 * @throws { BusinessError } 62980112 - The image format does not match. 7900 * @throws { BusinessError } 62980113 - Unknown image format. 7901 * @throws { BusinessError } 62980115 - Invalid image parameter. 7902 * @throws { BusinessError } 62980116 - Failed to decode the image. 7903 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7904 * @throws { BusinessError } 62980122 - The image decoding header is abnormal. 7905 * @throws { BusinessError } 62980123 - Images in EXIF format are not supported. 7906 * @throws { BusinessError } 62980135 - The EXIF value is invalid. 7907 * @syscap SystemCapability.Multimedia.Image.ImageSource 7908 * @crossplatform 7909 * @since 11 7910 */ 7911 /** 7912 * Obtains the value of a property in an image with the specified index. This method uses a 7913 * promise to return the property value in a string. 7914 * 7915 * @param { PropertyKey } key - Name of the property whose value is to be obtained. 7916 * @param { ImagePropertyOptions } options - Index of the image. 7917 * @returns { Promise<string> } A Promise instance used to return the property value. If the operation fails, the default value is returned. 7918 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types;3.Parameter verification failed; 7919 * @throws { BusinessError } 62980096 - The operation failed. 7920 * @throws { BusinessError } 62980103 - The image data is not supported. 7921 * @throws { BusinessError } 62980110 - The image source data is incorrect. 7922 * @throws { BusinessError } 62980111 - The image source data is incomplete. 7923 * @throws { BusinessError } 62980112 - The image format does not match. 7924 * @throws { BusinessError } 62980113 - Unknown image format. 7925 * @throws { BusinessError } 62980115 - Invalid image parameter. 7926 * @throws { BusinessError } 62980116 - Failed to decode the image. 7927 * @throws { BusinessError } 62980118 - Failed to create the image plugin. 7928 * @throws { BusinessError } 62980122 - Failed to decode the image header. 7929 * @throws { BusinessError } 62980123 - Images in EXIF format are not supported. 7930 * @throws { BusinessError } 62980135 - The EXIF value is invalid. 7931 * @syscap SystemCapability.Multimedia.Image.ImageSource 7932 * @crossplatform 7933 * @since 12 7934 */ 7935 getImageProperty(key: PropertyKey, options?: ImagePropertyOptions): Promise<string>; 7936 7937 /** 7938 * Obtains the value of a property in an image with the specified index. This method uses a 7939 * promise to return the property value in a string. 7940 * 7941 * @param { string } key Name of the property whose value is to be obtained. 7942 * @param { GetImagePropertyOptions } options Index of the image. 7943 * @returns { Promise<string> } A Promise instance used to return the property value. If the operation fails, the default value is returned. 7944 * @syscap SystemCapability.Multimedia.Image.ImageSource 7945 * @since 7 7946 * @deprecated since 11 7947 * @useinstead image.ImageSource#getImageProperty 7948 */ 7949 /** 7950 * Obtains the value of a property in an image with the specified index. This method uses a 7951 * promise to return the property value in a string. 7952 * 7953 * @param { string } key Name of the property whose value is to be obtained. 7954 * @param { GetImagePropertyOptions } options Index of the image. 7955 * @returns { Promise<string> } A Promise instance used to return the property value. If the operation fails, the default value is returned. 7956 * @syscap SystemCapability.Multimedia.Image.ImageSource 7957 * @crossplatform 7958 * @since 10 7959 * @deprecated since 11 7960 * @useinstead image.ImageSource#getImageProperty 7961 */ 7962 getImageProperty(key: string, options?: GetImagePropertyOptions): Promise<string>; 7963 7964 /** 7965 * Obtains the value of a property in this image. This method uses a callback to return the 7966 * property value in a string. 7967 * 7968 * @param { string } key Name of the property whose value is to be obtained. 7969 * @param { AsyncCallback<string> } callback Callback used to return the property value. If the operation fails, an error message is returned. 7970 * @syscap SystemCapability.Multimedia.Image.ImageSource 7971 * @since 7 7972 * @deprecated since 11 7973 * @useinstead image.ImageSource#getImageProperty 7974 */ 7975 /** 7976 * Obtains the value of a property in this image. This method uses a callback to return the 7977 * property value in a string. 7978 * 7979 * @param { string } key Name of the property whose value is to be obtained. 7980 * @param { AsyncCallback<string> } callback Callback used to return the property value. If the operation fails, an error message is returned. 7981 * @syscap SystemCapability.Multimedia.Image.ImageSource 7982 * @crossplatform 7983 * @since 10 7984 * @deprecated since 11 7985 * @useinstead image.ImageSource#getImageProperty 7986 */ 7987 getImageProperty(key: string, callback: AsyncCallback<string>): void; 7988 7989 /** 7990 * Obtains the value of a property in an image with the specified index. This method uses 7991 * a callback to return the property value in a string. 7992 * 7993 * @param { string } key Name of the property whose value is to be obtained. 7994 * @param { GetImagePropertyOptions } options Index of the image. 7995 * @param { AsyncCallback<string> } callback Callback used to return the property value. If the operation fails, the default value is returned. 7996 * @syscap SystemCapability.Multimedia.Image.ImageSource 7997 * @since 7 7998 * @deprecated since 11 7999 * @useinstead image.ImageSource#getImageProperty 8000 */ 8001 /** 8002 * Obtains the value of a property in an image with the specified index. This method uses 8003 * a callback to return the property value in a string. 8004 * 8005 * @param { string } key Name of the property whose value is to be obtained. 8006 * @param { GetImagePropertyOptions } options Index of the image. 8007 * @param { AsyncCallback<string> } callback Callback used to return the property value. If the operation fails, the default value is returned. 8008 * @syscap SystemCapability.Multimedia.Image.ImageSource 8009 * @crossplatform 8010 * @since 10 8011 * @deprecated since 11 8012 * @useinstead image.ImageSource#getImageProperty 8013 */ 8014 getImageProperty(key: string, options: GetImagePropertyOptions, callback: AsyncCallback<string>): void; 8015 8016 /** 8017 * Obtains the value of properties in an image. This method uses a promise to return the property values in array 8018 * of records. 8019 * 8020 * @param { Array<PropertyKey> } key - Name of the properties whose value is to be obtained. 8021 * @returns { Promise<Record<PropertyKey, string|null>> } Array of Records instance used to return the 8022 * property values. If the operation fails, the null is returned. 8023 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed; 8024 * @throws { BusinessError } 62980096 - The operation failed. 8025 * @throws { BusinessError } 62980110 - The image source data is incorrect. 8026 * @throws { BusinessError } 62980113 - Unknown image format. 8027 * @throws { BusinessError } 62980116 - Failed to decode the image. 8028 * @syscap SystemCapability.Multimedia.Image.ImageSource 8029 * @crossplatform 8030 * @since 12 8031 */ 8032 getImageProperties(key: Array<PropertyKey>): Promise<Record<PropertyKey, string|null>>; 8033 8034 /** 8035 * Modify the value of a property in an image with the specified key. This method uses a 8036 * promise to return the property value in a string. 8037 * 8038 * @param { PropertyKey } key - Name of the property whose value is to be modified. 8039 * @param { string } value - The value to be set to property. 8040 * @returns { Promise<void> } A Promise instance used to return the property value. 8041 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 8042 * @throws { BusinessError } 62980123 - Images in EXIF format are not supported. 8043 * @throws { BusinessError } 62980133 - The EXIF data is out of range. 8044 * @throws { BusinessError } 62980135 - The EXIF value is invalid. 8045 * @throws { BusinessError } 62980146 - The EXIF data failed to be written to the file. 8046 * @syscap SystemCapability.Multimedia.Image.ImageSource 8047 * @crossplatform 8048 * @since 11 8049 */ 8050 /** 8051 * Modify the value of a property in an image with the specified key. This method uses a 8052 * promise to return the property value in a string. 8053 * 8054 * @param { PropertyKey } key - Name of the property whose value is to be modified. 8055 * @param { string } value - The value to be set to property. 8056 * @returns { Promise<void> } A Promise instance used to return the property value. 8057 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 8058 * @throws { BusinessError } 62980123 - The image does not support EXIF decoding. 8059 * @throws { BusinessError } 62980133 - The EXIF data is out of range. 8060 * @throws { BusinessError } 62980135 - The EXIF value is invalid. 8061 * @throws { BusinessError } 62980146 - The EXIF data failed to be written to the file. 8062 * @syscap SystemCapability.Multimedia.Image.ImageSource 8063 * @crossplatform 8064 * @since 12 8065 */ 8066 modifyImageProperty(key: PropertyKey, value: string): Promise<void>; 8067 8068 /** 8069 * Modify the value of a property in an image with the specified key. This method uses a 8070 * promise to return the property value in a string. 8071 * 8072 * @param { string } key Name of the property whose value is to be modified. 8073 * @param { string } value The value to be set to property. 8074 * @returns { Promise<void> } A Promise instance used to return the property value. 8075 * @syscap SystemCapability.Multimedia.Image.ImageSource 8076 * @since 9 8077 * @deprecated since 11 8078 * @useinstead image.ImageSource#modifyImageProperty 8079 */ 8080 /** 8081 * Modify the value of a property in an image with the specified key. This method uses a 8082 * promise to return the property value in a string. 8083 * 8084 * @param { string } key Name of the property whose value is to be modified. 8085 * @param { string } value The value to be set to property. 8086 * @returns { Promise<void> } A Promise instance used to return the property value. 8087 * @syscap SystemCapability.Multimedia.Image.ImageSource 8088 * @crossplatform 8089 * @since 10 8090 * @deprecated since 11 8091 * @useinstead image.ImageSource#modifyImageProperty 8092 */ 8093 modifyImageProperty(key: string, value: string): Promise<void>; 8094 8095 /** 8096 * Modify the value of a property in an image with the specified key. This method uses a callback to return the 8097 * property value in a string. 8098 * 8099 * @param { string } key Name of the property whose value is to be obtained. 8100 * @param { string } value The value to be set to property. 8101 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8102 * @syscap SystemCapability.Multimedia.Image.ImageSource 8103 * @since 9 8104 * @deprecated since 11 8105 * @useinstead image.ImageSource#modifyImageProperty 8106 */ 8107 /** 8108 * Modify the value of a property in an image with the specified key. This method uses a callback to return the 8109 * property value in a string. 8110 * 8111 * @param { string } key Name of the property whose value is to be obtained. 8112 * @param { string } value The value to be set to property. 8113 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8114 * @syscap SystemCapability.Multimedia.Image.ImageSource 8115 * @crossplatform 8116 * @since 10 8117 * @deprecated since 11 8118 * @useinstead image.ImageSource#modifyImageProperty 8119 */ 8120 modifyImageProperty(key: string, value: string, callback: AsyncCallback<void>): void; 8121 8122 /** 8123 * Modify the value of properties in an image with the specified keys. 8124 * 8125 * @param { Record<PropertyKey, string|null> } records - Array of the property Records whose values are to 8126 * be modified. 8127 * @returns { Promise<void> } A Promise instance used to return the operation result. If the operation fails, an 8128 * error message is returned. 8129 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed; 8130 * @throws { BusinessError } 62980123 - The image does not support EXIF decoding. 8131 * @throws { BusinessError } 62980133 - The EXIF data is out of range. 8132 * @throws { BusinessError } 62980135 - The EXIF value is invalid. 8133 * @throws { BusinessError } 62980146 - The EXIF data failed to be written to the file. 8134 * @syscap SystemCapability.Multimedia.Image.ImageSource 8135 * @crossplatform 8136 * @since 12 8137 */ 8138 modifyImageProperties(records: Record<PropertyKey, string|null>): Promise<void>; 8139 8140 /** 8141 * Update the data in the incremental ImageSource. 8142 * 8143 * @param { ArrayBuffer } buf The data to be updated. 8144 * @param { boolean } isFinished If is it finished. 8145 * @param { number } value The offset of data. 8146 * @param { number } length The length fo buf. 8147 * @returns { Promise<void> } A Promise instance used to return the property value. 8148 * @syscap SystemCapability.Multimedia.Image.ImageSource 8149 * @since 9 8150 */ 8151 /** 8152 * Update the data in the incremental ImageSource. 8153 * 8154 * @param { ArrayBuffer } buf The data to be updated. 8155 * @param { boolean } isFinished If is it finished. 8156 * @param { number } value The offset of data. 8157 * @param { number } length The length fo buf. 8158 * @returns { Promise<void> } A Promise instance used to return the property value. 8159 * @syscap SystemCapability.Multimedia.Image.ImageSource 8160 * @crossplatform 8161 * @since 10 8162 */ 8163 /** 8164 * Update the data in the incremental ImageSource. 8165 * 8166 * @param { ArrayBuffer } buf The data to be updated. 8167 * @param { boolean } isFinished If is it finished. 8168 * @param { number } offset The offset of data. 8169 * @param { number } length The length fo buf. 8170 * @returns { Promise<void> } A Promise instance used to return the property value. 8171 * @syscap SystemCapability.Multimedia.Image.ImageSource 8172 * @crossplatform 8173 * @since 11 8174 */ 8175 updateData(buf: ArrayBuffer, isFinished: boolean, offset: number, length: number): Promise<void>; 8176 8177 /** 8178 * Update the data in the incremental ImageSource. 8179 * 8180 * @param { ArrayBuffer } buf The data to be updated. 8181 * @param { boolean } isFinished If is it finished. 8182 * @param { number } value The offset of data. 8183 * @param { number } length The length fo buf. 8184 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8185 * @syscap SystemCapability.Multimedia.Image.ImageSource 8186 * @since 9 8187 */ 8188 /** 8189 * Update the data in the incremental ImageSource. 8190 * 8191 * @param { ArrayBuffer } buf The data to be updated. 8192 * @param { boolean } isFinished If is it finished. 8193 * @param { number } value The offset of data. 8194 * @param { number } length The length fo buf. 8195 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8196 * @syscap SystemCapability.Multimedia.Image.ImageSource 8197 * @crossplatform 8198 * @since 10 8199 */ 8200 /** 8201 * Update the data in the incremental ImageSource. 8202 * 8203 * @param { ArrayBuffer } buf The data to be updated. 8204 * @param { boolean } isFinished If is it finished. 8205 * @param { number } offset The offset of data. 8206 * @param { number } length The length fo buf. 8207 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8208 * @syscap SystemCapability.Multimedia.Image.ImageSource 8209 * @crossplatform 8210 * @since 11 8211 */ 8212 updateData( 8213 buf: ArrayBuffer, 8214 isFinished: boolean, 8215 offset: number, 8216 length: number, 8217 callback: AsyncCallback<void> 8218 ): void; 8219 8220 /** 8221 * Releases an ImageSource instance and uses a callback to return the result. 8222 * 8223 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8224 * @syscap SystemCapability.Multimedia.Image.ImageSource 8225 * @since 6 8226 */ 8227 /** 8228 * Releases an ImageSource instance and uses a callback to return the result. 8229 * 8230 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8231 * @syscap SystemCapability.Multimedia.Image.ImageSource 8232 * @crossplatform 8233 * @since 10 8234 */ 8235 release(callback: AsyncCallback<void>): void; 8236 8237 /** 8238 * Releases an ImageSource instance and uses a promise to return the result. 8239 * 8240 * @returns { Promise<void> } A Promise instance used to return the operation result. 8241 * @syscap SystemCapability.Multimedia.Image.ImageSource 8242 * @since 6 8243 */ 8244 /** 8245 * Releases an ImageSource instance and uses a promise to return the result. 8246 * 8247 * @returns { Promise<void> } A Promise instance used to return the operation result. 8248 * @syscap SystemCapability.Multimedia.Image.ImageSource 8249 * @crossplatform 8250 * @since 10 8251 */ 8252 release(): Promise<void>; 8253 8254 /** 8255 * Creates a Picture object based on image decoding parameters. This method uses a promise to 8256 * return the object. 8257 * 8258 * @param { DecodingOptionsForPicture } options Image decoding parameters. 8259 * @returns { Promise<Picture> } A Promise instance used to return the Picture object. 8260 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified. 8261 * 2.Incorrect parameter types; 3.Parameter verification failed. 8262 * @throws { BusinessError } 7700301 - Decode failed. 8263 * @syscap SystemCapability.Multimedia.Image.ImageSource 8264 * @since 13 8265 */ 8266 createPicture(options?: DecodingOptionsForPicture): Promise<Picture> 8267 8268 /** 8269 * Supported image formats. 8270 * 8271 * @type { Array<string> } 8272 * @syscap SystemCapability.Multimedia.Image.ImageSource 8273 * @since 6 8274 */ 8275 /** 8276 * Supported image formats. 8277 * 8278 * @type { Array<string> } 8279 * @syscap SystemCapability.Multimedia.Image.ImageSource 8280 * @crossplatform 8281 * @since 10 8282 */ 8283 readonly supportedFormats: Array<string>; 8284 } 8285 8286 /** 8287 * ImagePacker instance. 8288 * 8289 * @typedef ImagePacker 8290 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8291 * @since 6 8292 */ 8293 /** 8294 * ImagePacker instance. 8295 * 8296 * @typedef ImagePacker 8297 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8298 * @crossplatform 8299 * @since 10 8300 */ 8301 /** 8302 * ImagePacker instance. 8303 * 8304 * @typedef ImagePacker 8305 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8306 * @crossplatform 8307 * @atomicservice 8308 * @since 11 8309 */ 8310 interface ImagePacker { 8311 /** 8312 * Compresses or packs an image and uses a callback to return the result. 8313 * 8314 * @param { ImageSource } source Image to be processed. 8315 * @param { PackingOption } option Option for image packing. 8316 * @param { AsyncCallback<ArrayBuffer> } callback Callback used to return the packed data. 8317 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8318 * @since 6 8319 */ 8320 /** 8321 * Compresses or packs an image and uses a callback to return the result. 8322 * 8323 * @param { ImageSource } source Image to be processed. 8324 * @param { PackingOption } option Option for image packing. 8325 * @param { AsyncCallback<ArrayBuffer> } callback Callback used to return the packed data. 8326 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8327 * @crossplatform 8328 * @since 10 8329 */ 8330 /** 8331 * Compresses or packs an image and uses a callback to return the result. 8332 * 8333 * @param { ImageSource } source Image to be processed. 8334 * @param { PackingOption } option Option for image packing. 8335 * @param { AsyncCallback<ArrayBuffer> } callback Callback used to return the packed data. 8336 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8337 * @crossplatform 8338 * @atomicservice 8339 * @since 11 8340 */ 8341 packing(source: ImageSource, option: PackingOption, callback: AsyncCallback<ArrayBuffer>): void; 8342 8343 /** 8344 * Compresses or packs an image and uses a promise to return the result. 8345 * 8346 * @param { ImageSource } source Image to be processed. 8347 * @param { PackingOption } option Option for image packing. 8348 * @returns { Promise<ArrayBuffer> } A Promise instance used to return the compressed or packed data. 8349 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8350 * @since 6 8351 */ 8352 /** 8353 * Compresses or packs an image and uses a promise to return the result. 8354 * 8355 * @param { ImageSource } source Image to be processed. 8356 * @param { PackingOption } option Option for image packing. 8357 * @returns { Promise<ArrayBuffer> } A Promise instance used to return the compressed or packed data. 8358 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8359 * @crossplatform 8360 * @since 10 8361 */ 8362 /** 8363 * Compresses or packs an image and uses a promise to return the result. 8364 * 8365 * @param { ImageSource } source Image to be processed. 8366 * @param { PackingOption } option Option for image packing. 8367 * @returns { Promise<ArrayBuffer> } A Promise instance used to return the compressed or packed data. 8368 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8369 * @crossplatform 8370 * @atomicservice 8371 * @since 11 8372 */ 8373 packing(source: ImageSource, option: PackingOption): Promise<ArrayBuffer>; 8374 8375 /** 8376 * Compresses or packs an image and uses a callback to return the result. 8377 * 8378 * @param { PixelMap } source PixelMap to be processed. 8379 * @param { PackingOption } option Option for image packing. 8380 * @param { AsyncCallback<ArrayBuffer> } callback Callback used to return the packed data. 8381 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8382 * @since 8 8383 */ 8384 /** 8385 * Compresses or packs an image and uses a callback to return the result. 8386 * 8387 * @param { PixelMap } source PixelMap to be processed. 8388 * @param { PackingOption } option Option for image packing. 8389 * @param { AsyncCallback<ArrayBuffer> } callback Callback used to return the packed data. 8390 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8391 * @crossplatform 8392 * @since 10 8393 */ 8394 /** 8395 * Compresses or packs an image and uses a callback to return the result. 8396 * 8397 * @param { PixelMap } source PixelMap to be processed. 8398 * @param { PackingOption } option Option for image packing. 8399 * @param { AsyncCallback<ArrayBuffer> } callback Callback used to return the packed data. 8400 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8401 * @crossplatform 8402 * @atomicservice 8403 * @since 11 8404 */ 8405 packing(source: PixelMap, option: PackingOption, callback: AsyncCallback<ArrayBuffer>): void; 8406 8407 /** 8408 * Compresses or packs an image and uses a promise to return the result. 8409 * 8410 * @param { PixelMap } source PixelMap to be processed. 8411 * @param { PackingOption } option Option for image packing. 8412 * @returns { Promise<ArrayBuffer> } A Promise instance used to return the compressed or packed data. 8413 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8414 * @since 8 8415 */ 8416 /** 8417 * Compresses or packs an image and uses a promise to return the result. 8418 * 8419 * @param { PixelMap } source PixelMap to be processed. 8420 * @param { PackingOption } option Option for image packing. 8421 * @returns { Promise<ArrayBuffer> } A Promise instance used to return the compressed or packed data. 8422 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8423 * @crossplatform 8424 * @since 10 8425 */ 8426 /** 8427 * Compresses or packs an image and uses a promise to return the result. 8428 * 8429 * @param { PixelMap } source PixelMap to be processed. 8430 * @param { PackingOption } option Option for image packing. 8431 * @returns { Promise<ArrayBuffer> } A Promise instance used to return the compressed or packed data. 8432 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8433 * @crossplatform 8434 * @atomicservice 8435 * @since 11 8436 */ 8437 packing(source: PixelMap, option: PackingOption): Promise<ArrayBuffer>; 8438 8439 /** 8440 * Compresses or packs some images into an arraybuffer and uses a promise to return the result. 8441 * 8442 * @param { Array<PixelMap> } pixelmapSequence PixelMaps to be processed. 8443 * @param { PackingOptionsForSequence } options Options for image packing. 8444 * @returns { Promise<ArrayBuffer> } A Promise instance used to return the operation result. 8445 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8446 * @since 13 8447 */ 8448 packing(pixelmapSequence: Array<PixelMap>, options: PackingOptionsForSequence): Promise<ArrayBuffer>; 8449 8450 /** 8451 * Compresses or packs an image into a file and uses a callback to return the result. 8452 * 8453 * @param { ImageSource } source Image to be processed. 8454 * @param { number } fd ID of a file descriptor. 8455 * @param { PackingOption } options Options for image packing. 8456 * @param { AsyncCallback<void> } callback Callback used to return the operation result. 8457 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8458 * @crossplatform 8459 * @since 11 8460 */ 8461 packToFile(source: ImageSource, fd: number, options: PackingOption, callback: AsyncCallback<void>): void; 8462 8463 /** 8464 * Compresses or packs an image into a file and uses a promise to return the result. 8465 * 8466 * @param { ImageSource } source Image to be processed. 8467 * @param { number } fd ID of a file descriptor. 8468 * @param { PackingOption } options Options for image packing. 8469 * @returns { Promise<void> } A Promise instance used to return the operation result. 8470 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8471 * @crossplatform 8472 * @since 11 8473 */ 8474 packToFile(source: ImageSource, fd: number, options: PackingOption): Promise<void>; 8475 8476 /** 8477 * Compresses or packs an image into a file and uses a callback to return the result. 8478 * 8479 * @param { PixelMap } source PixelMap to be processed. 8480 * @param { number } fd ID of a file descriptor. 8481 * @param { PackingOption } options Options for image packing. 8482 * @param { AsyncCallback<void> } callback Callback used to return the operation result. 8483 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8484 * @crossplatform 8485 * @since 11 8486 */ 8487 packToFile(source: PixelMap, fd: number, options: PackingOption, callback: AsyncCallback<void>): void; 8488 8489 /** 8490 * Compresses or packs an image into a file and uses a promise to return the result. 8491 * 8492 * @param { PixelMap } source PixelMap to be processed. 8493 * @param { number } fd ID of a file descriptor. 8494 * @param { PackingOption } options Options for image packing. 8495 * @returns { Promise<void> } A Promise instance used to return the operation result. 8496 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8497 * @crossplatform 8498 * @since 11 8499 */ 8500 packToFile(source: PixelMap, fd: number, options: PackingOption): Promise<void>; 8501 8502 /** 8503 * Compresses or packs some images into a file and uses a promise to return the result. 8504 * 8505 * @param { Array<PixelMap> } pixelmapSequence PixelMaps to be processed. 8506 * @param { number } fd ID of a file descriptor. 8507 * @param { PackingOptionsForSequence } options Options for image packing. 8508 * @returns { Promise<void> } A Promise instance used to return the operation result. 8509 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8510 * @since 13 8511 */ 8512 packToFile(pixelmapSequence: Array<PixelMap>, fd: number, options: PackingOptionsForSequence): Promise<void>; 8513 8514 /** 8515 * Releases an ImagePacker instance and uses a callback to return the result. 8516 * 8517 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8518 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8519 * @since 6 8520 */ 8521 /** 8522 * Releases an ImagePacker instance and uses a callback to return the result. 8523 * 8524 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8525 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8526 * @crossplatform 8527 * @since 10 8528 */ 8529 release(callback: AsyncCallback<void>): void; 8530 8531 /** 8532 * Releases an ImagePacker instance and uses a promise to return the result. 8533 * 8534 * @returns { Promise<void> } A Promise instance used to return the operation result. 8535 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8536 * @since 6 8537 */ 8538 /** 8539 * Releases an ImagePacker instance and uses a promise to return the result. 8540 * 8541 * @returns { Promise<void> } A Promise instance used to return the operation result. 8542 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8543 * @crossplatform 8544 * @since 10 8545 */ 8546 release(): Promise<void>; 8547 8548 /** 8549 * Compresses or packs an image and uses a promise to return the result. 8550 * 8551 * @param { Picture } picture Picture to be processed. 8552 * @param { PackingOption } options Option for image packing. 8553 * @returns { Promise<ArrayBuffer> } A Promise instance used to return the compressed or packed data. 8554 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified. 8555 * 2.Incorrect parameter types. 3.Parameter verification failed. 8556 * @throws { BusinessError } 7800301 - Encode failed. 8557 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8558 * @since 13 8559 */ 8560 packing(picture: Picture, options: PackingOption): Promise<ArrayBuffer>; 8561 8562 /** 8563 * Compresses or packs an image into a file and uses a promise to return the result. 8564 * 8565 * @param { Picture } picture Picture to be processed. 8566 * @param { number } fd ID of a file descriptor. 8567 * @param { PackingOption } options Options for image packing. 8568 * @returns { Promise<void> } A Promise instance used to return the operation result. 8569 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified. 8570 * 2.Incorrect parameter types. 3.Parameter verification failed. 8571 * @throws { BusinessError } 7800301 - Encode failed. 8572 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8573 * @since 13 8574 */ 8575 packToFile(picture: Picture, fd: number, options: PackingOption): Promise<void> 8576 8577 /** 8578 * Supported image formats. 8579 * 8580 * @type { Array<string> } 8581 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8582 * @since 6 8583 */ 8584 /** 8585 * Supported image formats. 8586 * 8587 * @type { Array<string> } 8588 * @syscap SystemCapability.Multimedia.Image.ImagePacker 8589 * @crossplatform 8590 * @since 10 8591 */ 8592 readonly supportedFormats: Array<string>; 8593 } 8594 8595 /** 8596 * Provides basic image operations, including obtaining image information, and reading and writing image data. 8597 * 8598 * @typedef Image 8599 * @syscap SystemCapability.Multimedia.Image.Core 8600 * @since 9 8601 */ 8602 interface Image { 8603 /** 8604 * Sets or gets the image area to crop, default is size. 8605 * 8606 * @type { Region } 8607 * @syscap SystemCapability.Multimedia.Image.Core 8608 * @since 9 8609 */ 8610 clipRect: Region; 8611 8612 /** 8613 * Image size. 8614 * 8615 * @type { Size } 8616 * @syscap SystemCapability.Multimedia.Image.Core 8617 * @since 9 8618 */ 8619 readonly size: Size; 8620 8621 /** 8622 * Image format. 8623 * 8624 * @type { number } 8625 * @syscap SystemCapability.Multimedia.Image.Core 8626 * @since 9 8627 */ 8628 readonly format: number; 8629 8630 /** 8631 * Image timestamp. 8632 * 8633 * @type { number } 8634 * @syscap SystemCapability.Multimedia.Image.Core 8635 * @since 12 8636 */ 8637 readonly timestamp: number; 8638 8639 /** 8640 * Get component buffer from image and uses a callback to return the result. 8641 * 8642 * @param { ComponentType } componentType The component type of image. 8643 * @param { AsyncCallback<Component> } callback Callback used to return the component buffer. 8644 * @syscap SystemCapability.Multimedia.Image.Core 8645 * @since 9 8646 */ 8647 getComponent(componentType: ComponentType, callback: AsyncCallback<Component>): void; 8648 8649 /** 8650 * Get component buffer from image and uses a promise to return the result. 8651 * 8652 * @param { ComponentType } componentType The component type of image. 8653 * @returns { Promise<Component> } A Promise instance used to return the component buffer. 8654 * @syscap SystemCapability.Multimedia.Image.Core 8655 * @since 9 8656 */ 8657 getComponent(componentType: ComponentType): Promise<Component>; 8658 8659 /** 8660 * Release current image to receive another and uses a callback to return the result. 8661 * 8662 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8663 * @syscap SystemCapability.Multimedia.Image.Core 8664 * @since 9 8665 */ 8666 release(callback: AsyncCallback<void>): void; 8667 8668 /** 8669 * Release current image to receive another and uses a promise to return the result. 8670 * 8671 * @returns { Promise<void> } A Promise instance used to return the operation result. 8672 * @syscap SystemCapability.Multimedia.Image.Core 8673 * @since 9 8674 */ 8675 release(): Promise<void>; 8676 } 8677 8678 /** 8679 * Image receiver object. 8680 * 8681 * @typedef ImageReceiver 8682 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8683 * @since 9 8684 */ 8685 interface ImageReceiver { 8686 /** 8687 * Image size. 8688 * 8689 * @type { Size } 8690 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8691 * @since 9 8692 */ 8693 readonly size: Size; 8694 8695 /** 8696 * Image capacity. 8697 * 8698 * @type { number } 8699 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8700 * @since 9 8701 */ 8702 readonly capacity: number; 8703 8704 /** 8705 * Image format. 8706 * 8707 * @type { ImageFormat } 8708 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8709 * @since 9 8710 */ 8711 readonly format: ImageFormat; 8712 8713 /** 8714 * Get an id which indicates a surface and can be used to set to Camera or other component can receive a surface 8715 * and uses a callback to return the result. 8716 * 8717 * @param { AsyncCallback<string> } callback Callback used to return the surface id. 8718 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8719 * @since 9 8720 */ 8721 getReceivingSurfaceId(callback: AsyncCallback<string>): void; 8722 8723 /** 8724 * Get an id which indicates a surface and can be used to set to Camera or other component can receive a surface 8725 * and uses a promise to return the result. 8726 * 8727 * @returns { Promise<string> } A Promise instance used to return the surface id. 8728 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8729 * @since 9 8730 */ 8731 getReceivingSurfaceId(): Promise<string>; 8732 8733 /** 8734 * Get lasted image from receiver and uses a callback to return the result. 8735 * 8736 * @param { AsyncCallback<Image> } callback Callback used to return the latest image. 8737 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8738 * @since 9 8739 */ 8740 readLatestImage(callback: AsyncCallback<Image>): void; 8741 8742 /** 8743 * Get lasted image from receiver and uses a promise to return the result. 8744 * 8745 * @returns { Promise<Image> } A Promise instance used to return the latest image. 8746 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8747 * @since 9 8748 */ 8749 readLatestImage(): Promise<Image>; 8750 8751 /** 8752 * Get next image from receiver and uses a callback to return the result. 8753 * 8754 * @param { AsyncCallback<Image> } callback Callback used to return the next image. 8755 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8756 * @since 9 8757 */ 8758 readNextImage(callback: AsyncCallback<Image>): void; 8759 8760 /** 8761 * Get next image from receiver and uses a promise to return the result. 8762 * 8763 * @returns { Promise<Image> } A Promise instance used to return the next image. 8764 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8765 * @since 9 8766 */ 8767 readNextImage(): Promise<Image>; 8768 8769 /** 8770 * Subscribe callback when receiving an image 8771 * 8772 * @param { 'imageArrival' } type Callback used to return the next image. 8773 * @param { AsyncCallback<void> } callback Callback used to return image. 8774 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8775 * @since 9 8776 */ 8777 on(type: 'imageArrival', callback: AsyncCallback<void>): void; 8778 8779 /** 8780 * Remove callback subscriptions when releasing buffer 8781 * 8782 * @param { 'imageArrival' } type - Event type. 8783 * @param { AsyncCallback<void> } callback Callback to be removed. 8784 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8785 * @since 13 8786 */ 8787 off(type: 'imageArrival', callback?: AsyncCallback<void>): void; 8788 8789 /** 8790 * Release image receiver instance and uses a callback to return the result. 8791 * 8792 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8793 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8794 * @since 9 8795 */ 8796 release(callback: AsyncCallback<void>): void; 8797 8798 /** 8799 * Release image receiver instance and uses a promise to return the result. 8800 * 8801 * @returns { Promise<void> } A Promise instance used to return the operation result. 8802 * @syscap SystemCapability.Multimedia.Image.ImageReceiver 8803 * @since 9 8804 */ 8805 release(): Promise<void>; 8806 } 8807 8808 /** 8809 * Image creator object. 8810 * 8811 * @typedef ImageCreator 8812 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8813 * @since 9 8814 */ 8815 interface ImageCreator { 8816 /** 8817 * Image capacity. 8818 * 8819 * @type { number } 8820 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8821 * @since 9 8822 */ 8823 readonly capacity: number; 8824 8825 /** 8826 * Image format. 8827 * 8828 * @type { ImageFormat } 8829 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8830 * @since 9 8831 */ 8832 readonly format: ImageFormat; 8833 8834 /** 8835 * Apply for new graphic buffer from free queue and use a callback to return the result. 8836 * 8837 * @param { AsyncCallback<Image> } callback Callback to return the operation result. 8838 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8839 * @since 9 8840 */ 8841 dequeueImage(callback: AsyncCallback<Image>): void; 8842 8843 /** 8844 * Apply for new graphic buffer from free queue and uses a promise to return the result. 8845 * 8846 * @returns { Promise<Image> } A Promise instance used to return the operation result. 8847 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8848 * @since 9 8849 */ 8850 dequeueImage(): Promise<Image>; 8851 8852 /** 8853 * Queue buffer to dirty queue and uses a callback to return the result. 8854 * 8855 * @param { Image } interface 8856 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8857 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8858 * @since 9 8859 */ 8860 queueImage(interface: Image, callback: AsyncCallback<void>): void; 8861 8862 /** 8863 * Queue buffer to dirty queue and uses a promise to return the result. 8864 * 8865 * @param { Image } interface 8866 * @returns { Promise<void> } A Promise instance used to return the operation result. 8867 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8868 * @since 9 8869 */ 8870 queueImage(interface: Image): Promise<void>; 8871 8872 /** 8873 * Subscribe callback when releasing buffer 8874 * 8875 * @param { 'imageRelease' } type Callback used to return the operation result. 8876 * @param { AsyncCallback<void> } callback Callback used to return the operation result. 8877 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8878 * @since 9 8879 */ 8880 on(type: 'imageRelease', callback: AsyncCallback<void>): void; 8881 8882 /** 8883 * Remove callback subscriptions when releasing buffer 8884 * 8885 * @param { 'imageRelease' } type - Event type. 8886 * @param { AsyncCallback<void> } callback Callback to be removed. 8887 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8888 * @since 13 8889 */ 8890 off(type: 'imageRelease', callback?: AsyncCallback<void>): void; 8891 8892 /** 8893 * Releases buffer in bufferqueue instance and uses a callback to return the result. 8894 * 8895 * @param { AsyncCallback<void> } callback Callback to return the operation result. 8896 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8897 * @since 9 8898 */ 8899 release(callback: AsyncCallback<void>): void; 8900 8901 /** 8902 * Releases buffer in bufferqueue instance and uses a promise to return the result. 8903 * 8904 * @returns { Promise<void> } A Promise instance used to return the operation result. 8905 * @syscap SystemCapability.Multimedia.Image.ImageCreator 8906 * @since 9 8907 */ 8908 release(): Promise<void>; 8909 } 8910} 8911 8912export default image; 8913