Flutter Engine
The Flutter Engine
|
#include <SkImageInfo.h>
Public Attributes | |
SkDEBUGCODE(void validate() const ;) private SkISize | fDimensions = {0, 0} |
Describes pixel dimensions and encoding. SkBitmap, SkImage, PixMap, and SkSurface can be created from SkImageInfo. SkImageInfo can be retrieved from SkBitmap and SkPixmap, but not from SkImage and SkSurface. For example, SkImage and SkSurface implementations may defer pixel depth, so may not completely specify SkImageInfo.
SkImageInfo contains dimensions, the pixel integral width and height. It encodes how pixel bits describe alpha, transparency; color components red, blue, and green; and SkColorSpace, the range and linearity of colors.
Definition at line 208 of file SkImageInfo.h.
|
default |
Creates an empty SkImageInfo with kUnknown_SkColorType, kUnknown_SkAlphaType, a width and height of zero, and no SkColorSpace.
|
inline |
Definition at line 621 of file SkImageInfo.h.
|
inline |
Definition at line 624 of file SkImageInfo.h.
|
inline |
Definition at line 375 of file SkImageInfo.h.
|
inline |
|
inlinestatic |
Returns true if byteSize equals SIZE_MAX. computeByteSize() and computeMinByteSize() return SIZE_MAX if size_t can not hold buffer size.
byteSize | result of computeByteSize() or computeMinByteSize() |
Definition at line 588 of file SkImageInfo.h.
|
inline |
Returns number of bytes per pixel required by SkColorType. Returns zero if colorType( is kUnknown_SkColorType.
Definition at line 492 of file SkImageInfo.h.
|
inline |
Returns the dimensionless SkColorInfo that represents the same color type, alpha type, and color space as this SkImageInfo.
Definition at line 404 of file SkImageInfo.h.
SkColorSpace * SkImageInfo::colorSpace | ( | ) | const |
Returns SkColorSpace, the range of colors. The reference count of SkColorSpace is unchanged. The returned SkColorSpace is immutable.
Definition at line 119 of file SkImageInfo.cpp.
|
inline |
Definition at line 373 of file SkImageInfo.h.
size_t SkImageInfo::computeByteSize | ( | size_t | rowBytes | ) | const |
Returns storage required by pixel array, given SkImageInfo dimensions, SkColorType, and rowBytes. rowBytes is assumed to be at least as large as minRowBytes().
Returns zero if height is zero. Returns SIZE_MAX if answer exceeds the range of size_t.
rowBytes | size of pixel row or larger |
Definition at line 104 of file SkImageInfo.cpp.
|
inline |
Returns storage required by pixel array, given SkImageInfo dimensions, and SkColorType. Uses minRowBytes() to compute bytes for pixel row.
Returns zero if height is zero. Returns SIZE_MAX if answer exceeds the range of size_t.
Definition at line 578 of file SkImageInfo.h.
Returns byte offset of pixel from pixel base address.
Asserts in debug build if x or y is outside of bounds. Does not assert if rowBytes is smaller than minRowBytes(), even though result may be incorrect.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
rowBytes | size of pixel row or larger |
example: https://fiddle.skia.org/c/@ImageInfo_computeOffset
Definition at line 98 of file SkImageInfo.cpp.
|
inline |
|
inline |
Returns true if associated SkColorSpace is not nullptr, and SkColorSpace gamma is approximately the same as sRGB. This includes the
Definition at line 435 of file SkImageInfo.h.
|
inline |
|
inline |
Returns if SkImageInfo describes an empty area of pixels by checking if either width or height is zero or smaller.
Definition at line 399 of file SkImageInfo.h.
|
inline |
Returns true if SkAlphaType is set to hint that all pixels are opaque; their alpha value is implicitly or explicitly 1.0. If true, and all pixels are not opaque, Skia may draw incorrectly.
Does not check if SkColorType allows alpha, or if any pixel value has transparency.
Definition at line 415 of file SkImageInfo.h.
|
static |
Creates SkImageInfo from integral dimensions width and height, SkColorType ct, SkAlphaType at, and optionally SkColorSpace cs.
If SkColorSpace cs is nullptr and SkImageInfo is part of drawing source: SkColorSpace defaults to sRGB, mapping into SkSurface SkColorSpace.
Parameters are not validated to see if their values are legal, or that the combination is supported.
width | pixel column count; must be zero or greater |
height | pixel row count; must be zero or greater |
cs | range of colors; may be nullptr |
Definition at line 127 of file SkImageInfo.cpp.
|
static |
Definition at line 131 of file SkImageInfo.cpp.
|
inlinestatic |
Creates SkImageInfo from integral dimensions and SkColorInfo colorInfo,
Parameters are not validated to see if their values are legal, or that the combination is supported.
dimensions | pixel column and row count; must be zeros or greater |
SkColorInfo | the pixel encoding consisting of SkColorType, SkAlphaType, and SkColorSpace (which may be nullptr) |
Definition at line 249 of file SkImageInfo.h.
|
inlinestatic |
Definition at line 252 of file SkImageInfo.h.
|
static |
Definition at line 136 of file SkImageInfo.cpp.
|
static |
Definition at line 140 of file SkImageInfo.cpp.
|
static |
Creates SkImageInfo from integral dimensions width and height, kAlpha_8_SkColorType, kPremul_SkAlphaType, with SkColorSpace set to nullptr.
width | pixel column count; must be zero or greater |
height | pixel row count; must be zero or greater |
Definition at line 173 of file SkImageInfo.cpp.
|
static |
Creates SkImageInfo from integral dimensions, kAlpha_8_SkColorType, kPremul_SkAlphaType, with SkColorSpace set to nullptr.
dimensions | pixel row and column count; must be zero or greater |
Definition at line 177 of file SkImageInfo.cpp.
|
inline |
Creates SkImageInfo with same SkColorType, SkColorSpace, width, and height, with SkAlphaType set to newAlphaType.
Created SkImageInfo contains newAlphaType even if it is incompatible with SkColorType, in which case SkAlphaType in SkImageInfo is ignored.
Definition at line 466 of file SkImageInfo.h.
SkImageInfo SkImageInfo::makeColorSpace | ( | sk_sp< SkColorSpace > | cs | ) | const |
Creates SkImageInfo with same SkAlphaType, SkColorType, width, and height, with SkColorSpace set to cs.
cs | range of colors; may be nullptr |
Definition at line 123 of file SkImageInfo.cpp.
|
inline |
Creates SkImageInfo with same SkAlphaType, SkColorSpace, width, and height, with SkColorType set to newColorType.
Definition at line 475 of file SkImageInfo.h.
|
inline |
Creates SkImageInfo with the same SkColorType, SkColorSpace, and SkAlphaType, with dimensions set to newDimensions.
newSize | pixel column and row count; must be zero or greater |
Definition at line 454 of file SkImageInfo.h.
|
static |
Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType, SkAlphaType at, and optionally SkColorSpace cs. kN32_SkColorType will equal either kBGRA_8888_SkColorType or kRGBA_8888_SkColorType, whichever is optimal.
If SkColorSpace cs is nullptr and SkImageInfo is part of drawing source: SkColorSpace defaults to sRGB, mapping into SkSurface SkColorSpace.
Parameters are not validated to see if their values are legal, or that the combination is supported.
width | pixel column count; must be zero or greater |
height | pixel row count; must be zero or greater |
cs | range of colors; may be nullptr |
Definition at line 145 of file SkImageInfo.cpp.
|
static |
Definition at line 149 of file SkImageInfo.cpp.
|
static |
Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType, kPremul_SkAlphaType, with optional SkColorSpace.
If SkColorSpace cs is nullptr and SkImageInfo is part of drawing source: SkColorSpace defaults to sRGB, mapping into SkSurface SkColorSpace.
Parameters are not validated to see if their values are legal, or that the combination is supported.
width | pixel column count; must be zero or greater |
height | pixel row count; must be zero or greater |
cs | range of colors; may be nullptr |
Definition at line 157 of file SkImageInfo.cpp.
|
static |
Definition at line 161 of file SkImageInfo.cpp.
|
static |
Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType, kPremul_SkAlphaType, with SkColorSpace set to nullptr.
If SkImageInfo is part of drawing source: SkColorSpace defaults to sRGB, mapping into SkSurface SkColorSpace.
Parameters are not validated to see if their values are legal, or that the combination is supported.
dimensions | width and height, each must be zero or greater |
cs | range of colors; may be nullptr |
Definition at line 165 of file SkImageInfo.cpp.
|
static |
Definition at line 169 of file SkImageInfo.cpp.
|
static |
Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType, SkAlphaType at, with sRGB SkColorSpace.
Parameters are not validated to see if their values are legal, or that the combination is supported.
width | pixel column count; must be zero or greater |
height | pixel row count; must be zero or greater |
example: https://fiddle.skia.org/c/@ImageInfo_MakeS32
Definition at line 153 of file SkImageInfo.cpp.
|
inlinestatic |
Creates SkImageInfo from integral dimensions width and height set to zero, kUnknown_SkColorType, kUnknown_SkAlphaType, with SkColorSpace set to nullptr.
Returned SkImageInfo as part of source does not draw, and as part of destination can not be drawn to.
Definition at line 357 of file SkImageInfo.h.
|
static |
Creates SkImageInfo from integral dimensions width and height, kUnknown_SkColorType, kUnknown_SkAlphaType, with SkColorSpace set to nullptr.
Returned SkImageInfo as part of source does not draw, and as part of destination can not be drawn to.
width | pixel column count; must be zero or greater |
height | pixel row count; must be zero or greater |
Definition at line 181 of file SkImageInfo.cpp.
|
inline |
Creates SkImageInfo with the same SkColorType, SkColorSpace, and SkAlphaType, with dimensions set to width and height.
newWidth | pixel column count; must be zero or greater |
newHeight | pixel row count; must be zero or greater |
Definition at line 444 of file SkImageInfo.h.
|
inline |
Returns minimum bytes per row, computed from pixel width() and SkColorType, which specifies bytesPerPixel(). SkBitmap maximum value for row bytes must fit in 31 bits.
Definition at line 517 of file SkImageInfo.h.
|
inline |
Returns minimum bytes per row, computed from pixel width() and SkColorType, which specifies bytesPerPixel(). SkBitmap maximum value for row bytes must fit in 31 bits.
Definition at line 507 of file SkImageInfo.h.
|
inline |
Compares SkImageInfo with other, and returns true if width, height, SkColorType, SkAlphaType, and SkColorSpace are not equivalent.
other | SkImageInfo to compare |
Definition at line 555 of file SkImageInfo.h.
|
inline |
Compares SkImageInfo with other, and returns true if width, height, SkColorType, SkAlphaType, and SkColorSpace are equivalent.
other | SkImageInfo to compare |
Definition at line 545 of file SkImageInfo.h.
sk_sp< SkColorSpace > SkImageInfo::refColorSpace | ( | ) | const |
Returns smart pointer to SkColorSpace, the range of colors. The smart pointer tracks the number of objects sharing this SkColorSpace reference so the memory is released when the owners destruct.
The returned SkColorSpace is immutable.
Definition at line 121 of file SkImageInfo.cpp.
|
inline |
Creates an empty SkImageInfo with kUnknown_SkColorType, kUnknown_SkAlphaType, a width and height of zero, and no SkColorSpace.
Definition at line 610 of file SkImageInfo.h.
|
inline |
Returns bit shift converting row bytes to row pixels. Returns zero for kUnknown_SkColorType.
Definition at line 499 of file SkImageInfo.h.
|
inline |
Returns true if rowBytes is valid for this SkImageInfo.
rowBytes | size of pixel row including padding |
Definition at line 598 of file SkImageInfo.h.
|
inline |
SkDEBUGCODE (void validate() const;) private SkISize SkImageInfo::fDimensions = {0, 0} |
Asserts if internal values are illegal or inconsistent. Only available if SK_DEBUG is defined at compile time.
Definition at line 619 of file SkImageInfo.h.