Flutter Engine
The Flutter Engine
|
#include <SkImageInfo.h>
Public Member Functions | |
SkColorInfo () | |
~SkColorInfo () | |
SkColorInfo (SkColorType ct, SkAlphaType at, sk_sp< SkColorSpace > cs) | |
SkColorInfo (const SkColorInfo &) | |
SkColorInfo (SkColorInfo &&) | |
SkColorInfo & | operator= (const SkColorInfo &) |
SkColorInfo & | operator= (SkColorInfo &&) |
SkColorSpace * | colorSpace () const |
sk_sp< SkColorSpace > | refColorSpace () const |
SkColorType | colorType () const |
SkAlphaType | alphaType () const |
bool | isOpaque () const |
bool | gammaCloseToSRGB () const |
bool | operator== (const SkColorInfo &other) const |
bool | operator!= (const SkColorInfo &other) const |
SkColorInfo | makeAlphaType (SkAlphaType newAlphaType) const |
SkColorInfo | makeColorType (SkColorType newColorType) const |
SkColorInfo | makeColorSpace (sk_sp< SkColorSpace > cs) const |
int | bytesPerPixel () const |
int | shiftPerPixel () const |
Describes pixel and encoding. SkImageInfo can be created from SkColorInfo by providing dimensions.
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 111 of file SkImageInfo.h.
|
default |
Creates an SkColorInfo with kUnknown_SkColorType, kUnknown_SkAlphaType, and no SkColorSpace.
|
default |
SkColorInfo::SkColorInfo | ( | SkColorType | ct, |
SkAlphaType | at, | ||
sk_sp< SkColorSpace > | cs | ||
) |
Creates SkColorInfo from SkColorType ct, SkAlphaType at, and optionally SkColorSpace cs.
If SkColorSpace cs is nullptr and SkColorInfo 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.
Definition at line 57 of file SkImageInfo.cpp.
|
default |
|
default |
|
inline |
Definition at line 141 of file SkImageInfo.h.
int SkColorInfo::bytesPerPixel | ( | ) | const |
Returns number of bytes per pixel required by SkColorType. Returns zero if colorType() is kUnknown_SkColorType.
example: https://fiddle.skia.org/c/@ImageInfo_bytesPerPixel
Definition at line 88 of file SkImageInfo.cpp.
SkColorSpace * SkColorInfo::colorSpace | ( | ) | const |
Definition at line 66 of file SkImageInfo.cpp.
|
inline |
Definition at line 140 of file SkImageInfo.h.
bool SkColorInfo::gammaCloseToSRGB | ( | ) | const |
Definition at line 90 of file SkImageInfo.cpp.
|
inline |
Definition at line 143 of file SkImageInfo.h.
SkColorInfo SkColorInfo::makeAlphaType | ( | SkAlphaType | newAlphaType | ) | const |
Creates SkColorInfo with same SkColorType, SkColorSpace, with SkAlphaType set to newAlphaType.
Created SkColorInfo contains newAlphaType even if it is incompatible with SkColorType, in which case SkAlphaType in SkColorInfo is ignored.
Definition at line 76 of file SkImageInfo.cpp.
SkColorInfo SkColorInfo::makeColorSpace | ( | sk_sp< SkColorSpace > | cs | ) | const |
Creates SkColorInfo with same SkAlphaType, SkColorType, with SkColorSpace set to cs. cs may be nullptr.
Definition at line 84 of file SkImageInfo.cpp.
SkColorInfo SkColorInfo::makeColorType | ( | SkColorType | newColorType | ) | const |
Creates new SkColorInfo with same SkAlphaType, SkColorSpace, with SkColorType set to newColorType.
Definition at line 80 of file SkImageInfo.cpp.
bool SkColorInfo::operator!= | ( | const SkColorInfo & | other | ) | const |
Does other represent a different color type, alpha type, or color space?
Definition at line 74 of file SkImageInfo.cpp.
|
default |
|
default |
bool SkColorInfo::operator== | ( | const SkColorInfo & | other | ) | const |
Does other represent the same color type, alpha type, and color space?
Definition at line 69 of file SkImageInfo.cpp.
sk_sp< SkColorSpace > SkColorInfo::refColorSpace | ( | ) | const |
Definition at line 67 of file SkImageInfo.cpp.
int SkColorInfo::shiftPerPixel | ( | ) | const |
Returns bit shift converting row bytes to row pixels. Returns zero for kUnknown_SkColorType.
example: https://fiddle.skia.org/c/@ImageInfo_shiftPerPixel
Definition at line 94 of file SkImageInfo.cpp.