70 return fColorType == other.fColorType && fAlphaType == other.fAlphaType &&
105 if (0 == this->
height()) {
109 size_t bytes = safe.
add(safe.
mul(safe.
addInt(this->height(), -1), rowBytes),
110 safe.
mul(this->width(), this->bytesPerPixel()));
115 constexpr size_t kMaxSigned32BitSize =
SK_MaxS32;
116 return (safe.
ok() && (bytes <= kMaxSigned32BitSize)) ? bytes : SIZE_MAX;
186void SkImageInfo::validate()
const {
237 *canonical = alphaType;
@ kUnknown_SkAlphaType
uninitialized
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kR16G16B16A16_unorm_SkColorType
pixel with a little endian uint16_t for red, green, blue
@ kRGBA_10x6_SkColorType
pixel with 10 used bits (most significant) followed by 6 unused
@ kBGR_101010x_SkColorType
pixel with 10 bits each for blue, green, red; in 32-bit word
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
@ kR8G8_unorm_SkColorType
pixel with a uint8_t for red and green
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kA16_unorm_SkColorType
pixel with a little endian uint16_t for alpha
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kRGB_101010x_SkColorType
pixel with 10 bits each for red, green, blue; in 32-bit word
@ kSRGBA_8888_SkColorType
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
@ kBGRA_10101010_XR_SkColorType
pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kRGB_888x_SkColorType
pixel with 8 bits each for red, green, blue; in 32-bit word
@ kBGRA_1010102_SkColorType
10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
@ kA16_float_SkColorType
pixel with a half float for alpha
@ kRGBA_F32_SkColorType
pixel using C float for red, green, blue, alpha; in 128-bit word
@ kRGBA_1010102_SkColorType
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
@ kBGR_101010x_XR_SkColorType
pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
@ kR16G16_unorm_SkColorType
pixel with a little endian uint16_t for red and green
@ kRGBA_F16Norm_SkColorType
pixel with half floats in [0,1] for red, green, blue, alpha;
@ kUnknown_SkColorType
uninitialized
@ kR16G16_float_SkColorType
pixel with a half float for red and green
@ kAlpha_SkColorChannelFlag
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static uint32_t SkColorTypeChannelFlags(SkColorType ct)
static bool SkColorTypeIsValid(unsigned value)
static size_t SkColorTypeComputeOffset(SkColorType ct, int x, int y, size_t rowBytes)
static int SkColorTypeShiftPerPixel(SkColorType ct)
static bool SkAlphaTypeIsValid(unsigned value)
bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType, SkAlphaType *canonical)
bool SkColorTypeIsAlwaysOpaque(SkColorType ct)
int SkColorTypeBytesPerPixel(SkColorType ct)
static constexpr int32_t SK_MaxS32
int bytesPerPixel() const
SkColorInfo makeAlphaType(SkAlphaType newAlphaType) const
SkAlphaType alphaType() const
bool operator!=(const SkColorInfo &other) const
SkColorInfo makeColorSpace(sk_sp< SkColorSpace > cs) const
int shiftPerPixel() const
SkColorInfo makeColorType(SkColorType newColorType) const
bool gammaCloseToSRGB() const
sk_sp< SkColorSpace > refColorSpace() const
SkColorSpace * colorSpace() const
SkColorInfo & operator=(const SkColorInfo &)
bool operator==(const SkColorInfo &other) const
SkColorType colorType() const
bool gammaCloseToSRGB() const
static bool Equals(const SkColorSpace *, const SkColorSpace *)
static sk_sp< SkColorSpace > MakeSRGB()
size_t add(size_t x, size_t y)
size_t mul(size_t x, size_t y)
constexpr int32_t width() const
constexpr int32_t height() const
static SkImageInfo MakeN32Premul(int width, int height)
sk_sp< SkColorSpace > refColorSpace() const
static SkImageInfo MakeS32(int width, int height, SkAlphaType at)
size_t computeByteSize(size_t rowBytes) const
SkColorSpace * colorSpace() const
SkISize dimensions() const
SkDEBUGCODE(void validate() const ;) private SkISize fDimensions
SkImageInfo makeColorSpace(sk_sp< SkColorSpace > cs) const
static SkImageInfo MakeUnknown()
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
SkAlphaType alphaType() const
SkColorType colorType() const
size_t computeOffset(int x, int y, size_t rowBytes) const
static SkImageInfo MakeA8(int width, int height)