1#Topic Image_Info 2#Alias Image_Info_Reference 3 4#Subtopic Overview 5 #Subtopic Subtopics 6 #Populate 7 ## 8## 9 10#Subtopic Constants 11#Populate 12## 13 14# ------------------------------------------------------------------------------ 15#Subtopic Alpha_Type 16#Line # incomplete ## 17#Alias Alpha_Type 18#Alias Alpha_Types 19#Enum SkAlphaType 20#Line # incomplete ## 21 22#Code 23 enum SkAlphaType { 24 kUnknown_SkAlphaType, 25 kOpaque_SkAlphaType, 26 kPremul_SkAlphaType, 27 kUnpremul_SkAlphaType, 28 kLastEnum_SkAlphaType = kUnpremul_SkAlphaType, 29 }; 30## 31 32Describes how to interpret the alpha component of a pixel. 33 34#Const kUnknown_SkAlphaType 0 35## 36#Const kOpaque_SkAlphaType 1 37All pixels are stored as opaque. 38## 39#Const kPremul_SkAlphaType 2 40All pixels have their alpha premultiplied in their color components. 41This is the natural format for the rendering target pixels. 42## 43#Const kUnpremul_SkAlphaType 3 44All pixels have their color components stored without any regard to the 45alpha. e.g. this is the default configuration for PNG images. 46kUnpremul_SkAlphaType is supported only for input images. Rendering cannot 47generate this on output. 48## 49 50#Example 51// incomplete 52## 53 54#SeeAlso incomplete 55 56#Enum SkAlphaType ## 57#Subtopic Alpha_Type ## 58 59# ------------------------------------------------------------------------------ 60#Subtopic Color_Type 61#Line # incomplete ## 62#Alias Native_Color_Type 63#Substitute native SkColorType 64#Alias Color_Type 65#Alias Color_Types 66#Enum SkColorType 67#Line # incomplete ## 68 69#Code 70 enum SkColorType { 71 kUnknown_SkColorType, 72 kAlpha_8_SkColorType, 73 kRGB_565_SkColorType, 74 kARGB_4444_SkColorType, 75 kRGBA_8888_SkColorType, 76 kBGRA_8888_SkColorType, 77 kGray_8_SkColorType, 78 kRGBA_F16_SkColorType, 79 kLastEnum_SkColorType = kRGBA_F16_SkColorType, 80 kN32_SkColorType = kBGRA_8888_SkColorType, 81 kN32_SkColorType = kRGBA_8888_SkColorType, 82 }; 83## 84 85Describes how to interpret the components of a pixel. 86kN32_SkColorType is an alias for whichever 32 bit Color_ARGB format is the "native" 87form for skia's blitters. Use this if you don't have a swizzle preference 88for 32 bit pixels. 89 90#Const kUnknown_SkColorType 0 91## 92#Const kAlpha_8_SkColorType 1 93## 94#Const kRGB_565_SkColorType 2 95## 96#Const kARGB_4444_SkColorType 3 97## 98#Const kRGBA_8888_SkColorType 4 99## 100#Const kRGB_888x_SkColorType 5 101## 102#Const kBGRA_8888_SkColorType 6 103## 104#Const kRGBA_1010102_SkColorType 7 105## 106#Const kRGB_101010x_SkColorType 8 107## 108#Const kGray_8_SkColorType 9 109## 110#Const kRGBA_F16_SkColorType 10 111## 112#ToDo can be 4 or 6; how to document? ## 113#Const kN32_SkColorType 4 114## 115 116#Example 117// incomplete 118## 119 120#SeeAlso incomplete 121 122#Enum SkColorType ## 123#Subtopic Color_Type ## 124 125# ------------------------------------------------------------------------------ 126#Enum SkYUVColorSpace 127#Line # incomplete ## 128 129#Code 130 enum SkYUVColorSpace { 131 kJPEG_SkYUVColorSpace, 132 kRec601_SkYUVColorSpace, 133 kRec709_SkYUVColorSpace, 134 kLastEnum_SkYUVColorSpace = kRec709_SkYUVColorSpace, 135 }; 136## 137 138Describes the color space a YUV pixel. 139 140#Const kJPEG_SkYUVColorSpace 0 141Standard JPEG color space. 142## 143#Const kRec601_SkYUVColorSpace 1 144SDTV standard Rec. 601 color space. Uses "studio swing" [16, 235] color 145range. See http://en.wikipedia.org/wiki/Rec._601 for details. 146## 147#Const kRec709_SkYUVColorSpace 2 148HDTV standard Rec. 709 color space. Uses "studio swing" [16, 235] color 149range. See http://en.wikipedia.org/wiki/Rec._709 for details. 150## 151 152#Example 153// incomplete 154## 155 156#SeeAlso incomplete 157 158#Enum SkYUVColorSpace ## 159 160# ------------------------------------------------------------------------------ 161#EnumClass SkDestinationSurfaceColorMode 162#Line # incomplete ## 163 164#Code 165 enum class SkDestinationSurfaceColorMode { 166 kLegacy, 167 kGammaAndColorSpaceAware, 168 }; 169## 170 171#Const kLegacy 0 172## 173#Const kGammaAndColorSpaceAware 1 174## 175 176#Example 177// incomplete 178## 179 180#SeeAlso incomplete 181 182#EnumClass SkDestinationSurfaceColorMode ## 183 184# ------------------------------------------------------------------------------ 185 186#Struct SkImageInfo 187 188Describe an image's dimensions and pixel type. 189Used for both src images and render-targets (surfaces). 190 191#Subtopic Operators 192#Populate 193## 194 195#Subtopic Member_Functions 196#Populate 197## 198 199#Subtopic Constructors 200#Populate 201## 202 203# ------------------------------------------------------------------------------ 204 205#Method SkImageInfo() 206 207#In Constructors 208#Line # creates with zero dimensions, kUnknown_SkColorType, kUnknown_SkAlphaType ## 209#Return incomplete ## 210 211#Example 212// incomplete 213## 214 215#SeeAlso incomplete 216 217#Method ## 218 219# ------------------------------------------------------------------------------ 220 221#Method static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at, 222 sk_sp<SkColorSpace> cs = nullptr) 223#In Constructors 224#Line # creates Image_Info from dimensions, Color_Type, Alpha_Type, Color_Space ## 225 226#Param width incomplete ## 227#Param height incomplete ## 228#Param ct incomplete ## 229#Param at incomplete ## 230#Param cs incomplete ## 231 232#Return incomplete ## 233 234#Example 235// incomplete 236## 237 238#SeeAlso incomplete 239 240#Method ## 241 242# ------------------------------------------------------------------------------ 243 244#Method static SkImageInfo MakeN32(int width, int height, SkAlphaType at, 245 sk_sp<SkColorSpace> cs = nullptr) 246#In Constructors 247#Line # creates Image_Info with Native_Color_Type ## 248 249Sets colortype to kN32_SkColorType. 250 251#Param width incomplete ## 252#Param height incomplete ## 253#Param at incomplete ## 254#Param cs incomplete ## 255 256#Return incomplete ## 257 258#Example 259// incomplete 260## 261 262#SeeAlso incomplete 263 264#Method ## 265 266# ------------------------------------------------------------------------------ 267 268#Method static SkImageInfo MakeS32(int width, int height, SkAlphaType at) 269 270#In Constructors 271#Line # creates Image_Info with Native_Color_Type, sRGB Color_Space ## 272Creates Image_Info marked as sRGB with kN32_SkColorType swizzle. 273 274#Param width incomplete ## 275#Param height incomplete ## 276#Param at incomplete ## 277 278#Return incomplete ## 279 280#Example 281// incomplete 282## 283 284#SeeAlso incomplete 285 286#Method ## 287 288# ------------------------------------------------------------------------------ 289 290#Method static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs = nullptr) 291 292#In Constructors 293#Line # creates Image_Info with Native_Color_Type, kPremul_SkAlphaType ## 294Sets colortype to kN32_SkColorType, and the alphatype to premul. 295 296#Param width incomplete ## 297#Param height incomplete ## 298#Param cs incomplete ## 299 300#Return incomplete ## 301 302#Example 303// incomplete 304## 305 306#SeeAlso incomplete 307 308#Method ## 309 310# ------------------------------------------------------------------------------ 311 312#Method static SkImageInfo MakeN32Premul(const SkISize& size) 313 314#In Constructors 315#Param size incomplete ## 316 317#Return incomplete ## 318 319#Example 320// incomplete 321## 322 323#SeeAlso incomplete 324 325#Method ## 326 327# ------------------------------------------------------------------------------ 328 329#Method static SkImageInfo MakeA8(int width, int height) 330 331#In Constructors 332#Line # creates Image_Info with kAlpha_8_SkColorType, kPremul_SkAlphaType ## 333#Param width incomplete ## 334#Param height incomplete ## 335 336#Return incomplete ## 337 338#Example 339// incomplete 340## 341 342#SeeAlso incomplete 343 344#Method ## 345 346# ------------------------------------------------------------------------------ 347 348#Method static SkImageInfo MakeUnknown(int width, int height) 349 350#In Constructors 351#Line # creates Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType ## 352#Param width incomplete ## 353#Param height incomplete ## 354 355#Return incomplete ## 356 357#Example 358// incomplete 359## 360 361#SeeAlso incomplete 362 363#Method ## 364 365# ------------------------------------------------------------------------------ 366 367#Method static SkImageInfo MakeUnknown() 368 369#In Constructors 370#Return incomplete ## 371 372#Example 373// incomplete 374## 375 376#SeeAlso incomplete 377 378#Method ## 379 380 381# ------------------------------------------------------------------------------ 382 383#Method int width() const 384 385#Line # incomplete ## 386#Return incomplete ## 387 388#Example 389// incomplete 390## 391 392#SeeAlso incomplete 393 394#Method ## 395 396# ------------------------------------------------------------------------------ 397 398#Method int height() const 399 400#Line # incomplete ## 401#Return incomplete ## 402 403#Example 404// incomplete 405## 406 407#SeeAlso incomplete 408 409#Method ## 410 411# ------------------------------------------------------------------------------ 412 413#Method SkColorType colorType() const 414 415#Line # incomplete ## 416#Return incomplete ## 417 418#Example 419// incomplete 420## 421 422#SeeAlso incomplete 423 424#Method ## 425 426# ------------------------------------------------------------------------------ 427 428#Method SkAlphaType alphaType() const 429 430#Line # incomplete ## 431#Return incomplete ## 432 433#Example 434// incomplete 435## 436 437#SeeAlso incomplete 438 439#Method ## 440 441# ------------------------------------------------------------------------------ 442 443#Method SkColorSpace* colorSpace() const 444 445#Line # incomplete ## 446#Return incomplete ## 447 448#Example 449// incomplete 450## 451 452#SeeAlso incomplete 453 454#Method ## 455 456# ------------------------------------------------------------------------------ 457 458#Method sk_sp<SkColorSpace> refColorSpace() const 459 460#Line # incomplete ## 461#Return incomplete ## 462 463#Example 464// incomplete 465## 466 467#SeeAlso incomplete 468 469#Method ## 470 471# ------------------------------------------------------------------------------ 472 473#Method bool isEmpty() const 474 475#Line # incomplete ## 476#Return incomplete ## 477 478#Example 479// incomplete 480## 481 482#SeeAlso incomplete 483 484#Method ## 485 486# ------------------------------------------------------------------------------ 487 488#Method bool isOpaque() const 489 490#Line # incomplete ## 491#Return incomplete ## 492 493#Example 494// incomplete 495## 496 497#SeeAlso incomplete 498 499#Method ## 500 501# ------------------------------------------------------------------------------ 502 503#Method SkISize dimensions() const 504 505#Line # incomplete ## 506#Return incomplete ## 507 508#Example 509// incomplete 510## 511 512#SeeAlso incomplete 513 514#Method ## 515 516# ------------------------------------------------------------------------------ 517 518#Method SkIRect bounds() const 519 520#Line # incomplete ## 521#Return incomplete ## 522 523#Example 524// incomplete 525## 526 527#SeeAlso incomplete 528 529#Method ## 530 531# ------------------------------------------------------------------------------ 532 533#Method bool gammaCloseToSRGB() const 534 535#Line # incomplete ## 536#Return incomplete ## 537 538#Example 539// incomplete 540## 541 542#SeeAlso incomplete 543 544#Method ## 545 546# ------------------------------------------------------------------------------ 547 548#Method SkImageInfo makeWH(int newWidth, int newHeight) const 549 550#Line # creates Image_Info with changed dimensions ## 551Creates Image_Info with the same colortype and alphatype as this info, 552but with the specified width and height. 553 554#Param newWidth incomplete ## 555#Param newHeight incomplete ## 556 557#Return incomplete ## 558 559#Example 560// incomplete 561## 562 563#SeeAlso incomplete 564 565#Method ## 566 567# ------------------------------------------------------------------------------ 568 569#Method SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const 570 571#Line # creates Image_Info with changed Alpha_Type ## 572#Param newAlphaType incomplete ## 573 574#Return incomplete ## 575 576#Example 577// incomplete 578## 579 580#SeeAlso incomplete 581 582#Method ## 583 584# ------------------------------------------------------------------------------ 585 586#Method SkImageInfo makeColorType(SkColorType newColorType) const 587 588#Line # creates Image_Info with changed Color_Type ## 589#Param newColorType incomplete ## 590 591#Return incomplete ## 592 593#Example 594// incomplete 595## 596 597#SeeAlso incomplete 598 599#Method ## 600 601# ------------------------------------------------------------------------------ 602 603#Method SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const 604 605#Line # creates Image_Info with changed Color_Space ## 606#Param cs incomplete ## 607 608#Return incomplete ## 609 610#Example 611// incomplete 612## 613 614#SeeAlso incomplete 615 616#Method ## 617 618# ------------------------------------------------------------------------------ 619 620#Method int bytesPerPixel() const 621 622#Line # incomplete ## 623#Return incomplete ## 624 625#Example 626// incomplete 627## 628 629#SeeAlso incomplete 630 631#Method ## 632 633# ------------------------------------------------------------------------------ 634 635#Method int shiftPerPixel() const 636 637#Line # incomplete ## 638#Return incomplete ## 639 640#Example 641// incomplete 642## 643 644#SeeAlso incomplete 645 646#Method ## 647 648# ------------------------------------------------------------------------------ 649 650#Method uint64_t minRowBytes64() const 651 652#Line # incomplete ## 653#Return incomplete ## 654 655#Example 656// incomplete 657## 658 659#SeeAlso incomplete 660 661#Method ## 662 663# ------------------------------------------------------------------------------ 664 665#Method size_t minRowBytes() const 666 667#Line # incomplete ## 668#Return incomplete ## 669 670#Example 671// incomplete 672## 673 674#SeeAlso incomplete 675 676#Method ## 677 678# ------------------------------------------------------------------------------ 679 680#Method size_t computeOffset(int x, int y, size_t rowBytes) const 681 682#Line # incomplete ## 683#Param x incomplete ## 684#Param y incomplete ## 685#Param rowBytes incomplete ## 686 687#Return incomplete ## 688 689#Example 690// incomplete 691## 692 693#SeeAlso incomplete 694 695#Method ## 696 697# ------------------------------------------------------------------------------ 698 699#Method bool operator==(const SkImageInfo& other)_const 700 701#Line # incomplete ## 702#Param other incomplete ## 703 704#Return incomplete ## 705 706#Example 707// incomplete 708## 709 710#SeeAlso incomplete 711 712#Method ## 713 714# ------------------------------------------------------------------------------ 715 716#Method bool operator!=(const SkImageInfo& other)_const 717 718#Line # incomplete ## 719#Param other incomplete ## 720 721#Return incomplete ## 722 723#Example 724// incomplete 725## 726 727#SeeAlso incomplete 728 729#Method ## 730 731# ------------------------------------------------------------------------------ 732 733#Method void unflatten(SkReadBuffer& buffer) 734 735#Line # incomplete ## 736#Param buffer incomplete ## 737 738#Example 739// incomplete 740## 741 742#SeeAlso incomplete 743 744#Method ## 745 746# ------------------------------------------------------------------------------ 747 748#Method void flatten(SkWriteBuffer& buffer) const 749 750#Line # incomplete ## 751#Param buffer incomplete ## 752 753#Example 754// incomplete 755## 756 757#SeeAlso incomplete 758 759#Method ## 760 761# ------------------------------------------------------------------------------ 762 763#Method size_t computeByteSize(size_t rowBytes) const 764 765#Line # incomplete ## 766Returns the size (in bytes) of the image buffer that this info needs, given the specified 767rowBytes. The rowBytes must be >= this->minRowBytes(). 768if (height == 0) { 769return 0; 770} else { 771return (height - 1) * rowBytes + width * bytes_per_pixel. 772 773If the calculation overflows this returns SK_MaxSizeT. 774 775#Param rowBytes incomplete ## 776 777#Return incomplete ## 778 779#Example 780// incomplete 781## 782 783#SeeAlso incomplete 784 785#Method ## 786 787# ------------------------------------------------------------------------------ 788 789#Method size_t computeMinByteSize() const 790 791#Line # incomplete ## 792Returns the minimum size (in bytes) of the image buffer that this info needs. 793If the calculation overflows, or if the height is 0, this returns 0. 794 795#Return incomplete ## 796 797#Example 798// incomplete 799## 800 801#SeeAlso incomplete 802 803#Method ## 804 805# ------------------------------------------------------------------------------ 806 807#Method static bool ByteSizeOverflowed(size_t byteSize) 808 809#Line # incomplete ## 810Returns true if the result of computeByteSize (or computeMinByteSize) overflowed 811 812#Param byteSize incomplete ## 813 814#Return incomplete ## 815 816#Example 817// incomplete 818## 819 820#SeeAlso incomplete 821 822#Method ## 823 824# ------------------------------------------------------------------------------ 825 826#Method bool validRowBytes(size_t rowBytes) const 827 828#Line # incomplete ## 829#Param rowBytes incomplete ## 830 831#Return incomplete ## 832 833#Example 834// incomplete 835## 836 837#SeeAlso incomplete 838 839#Method ## 840 841# ------------------------------------------------------------------------------ 842 843#Method void reset() 844 845#Line # incomplete ## 846#Example 847// incomplete 848## 849 850#SeeAlso incomplete 851 852#Method ## 853 854# ------------------------------------------------------------------------------ 855 856#Method void validate() const 857 858#Line # incomplete ## 859#Example 860// incomplete 861## 862 863#SeeAlso incomplete 864 865#Method ## 866 867#Struct SkImageInfo ## 868 869#Topic Image_Info ## 870