Skia
2D Graphics Library
|
Describes pixel and encoding. More...
#include <SkImageInfo.h>
Public Member Functions | |
SkColorInfo () | |
Creates an SkColorInfo with kUnknown_SkColorType, kUnknown_SkAlphaType, and no SkColorSpace. More... | |
~SkColorInfo () | |
SkColorInfo (SkColorType ct, SkAlphaType at, sk_sp< SkColorSpace > cs) | |
Creates SkColorInfo from SkColorType ct, SkAlphaType at, and optionally SkColorSpace cs. More... | |
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 |
Does other represent the same color type, alpha type, and color space? More... | |
bool | operator!= (const SkColorInfo &other) const |
Does other represent a different color type, alpha type, or color space? More... | |
SkColorInfo | makeAlphaType (SkAlphaType newAlphaType) const |
Creates SkColorInfo with same SkColorType, SkColorSpace, with SkAlphaType set to newAlphaType. More... | |
SkColorInfo | makeColorType (SkColorType newColorType) const |
Creates new SkColorInfo with same SkAlphaType, SkColorSpace, with SkColorType set to newColorType. More... | |
SkColorInfo | makeColorSpace (sk_sp< SkColorSpace > cs) const |
Creates SkColorInfo with same SkAlphaType, SkColorType, with SkColorSpace set to cs. More... | |
int | bytesPerPixel () const |
Returns number of bytes per pixel required by SkColorType. More... | |
int | shiftPerPixel () const |
Returns bit shift converting row bytes to row pixels. More... | |
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.
SkColorInfo::SkColorInfo | ( | ) |
Creates an SkColorInfo with kUnknown_SkColorType, kUnknown_SkAlphaType, and no SkColorSpace.
SkColorInfo::~SkColorInfo | ( | ) |
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.
SkColorInfo::SkColorInfo | ( | const SkColorInfo & | ) |
SkColorInfo::SkColorInfo | ( | SkColorInfo && | ) |
|
inline |
int SkColorInfo::bytesPerPixel | ( | ) | const |
Returns number of bytes per pixel required by SkColorType.
Returns zero if colorType() is kUnknown_SkColorType.
SkColorSpace* SkColorInfo::colorSpace | ( | ) | const |
|
inline |
bool SkColorInfo::gammaCloseToSRGB | ( | ) | const |
|
inline |
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.
SkColorInfo SkColorInfo::makeColorSpace | ( | sk_sp< SkColorSpace > | cs | ) | const |
Creates SkColorInfo with same SkAlphaType, SkColorType, with SkColorSpace set to cs.
cs may be nullptr.
SkColorInfo SkColorInfo::makeColorType | ( | SkColorType | newColorType | ) | const |
Creates new SkColorInfo with same SkAlphaType, SkColorSpace, with SkColorType set to newColorType.
bool SkColorInfo::operator!= | ( | const SkColorInfo & | other | ) | const |
Does other represent a different color type, alpha type, or color space?
SkColorInfo& SkColorInfo::operator= | ( | const SkColorInfo & | ) |
SkColorInfo& SkColorInfo::operator= | ( | SkColorInfo && | ) |
bool SkColorInfo::operator== | ( | const SkColorInfo & | other | ) | const |
Does other represent the same color type, alpha type, and color space?
sk_sp<SkColorSpace> SkColorInfo::refColorSpace | ( | ) | const |
int SkColorInfo::shiftPerPixel | ( | ) | const |
Returns bit shift converting row bytes to row pixels.
Returns zero for kUnknown_SkColorType.