8#ifndef SkImageInfo_DEFINED
9#define SkImageInfo_DEFINED
148 bool gammaCloseToSRGB()
const;
181 int bytesPerPixel()
const;
190 int shiftPerPixel()
const;
253 return SkImageInfo(dimensions, std::move(colorInfo));
358 return MakeUnknown(0, 0);
365 int width()
const {
return fDimensions.width(); }
371 int height()
const {
return fDimensions.height(); }
399 bool isEmpty()
const {
return fDimensions.isEmpty(); }
415 bool isOpaque()
const {
return fColorInfo.isOpaque(); }
445 return Make({newWidth, newHeight}, fColorInfo);
455 return Make(newSize, fColorInfo);
467 return Make(fDimensions, fColorInfo.makeAlphaType(newAlphaType));
476 return Make(fDimensions, fColorInfo.makeColorType(newColorType));
518 uint64_t minRowBytes = this->minRowBytes64();
519 if (!SkTFitsIn<int32_t>(minRowBytes)) {
522 return (
size_t)minRowBytes;
537 size_t computeOffset(
int x,
int y,
size_t rowBytes)
const;
546 return fDimensions == other.
fDimensions && fColorInfo == other.fColorInfo;
556 return !(*
this == other);
568 size_t computeByteSize(
size_t rowBytes)
const;
579 return this->computeByteSize(this->minRowBytes());
589 return SIZE_MAX == byteSize;
599 if (rowBytes < this->minRowBytes64()) {
602 int shift = this->shiftPerPixel();
603 size_t alignedRowBytes = rowBytes >> shift << shift;
604 return alignedRowBytes == rowBytes;
622 : fColorInfo(colorInfo), fDimensions(dimensions) {}
625 : fColorInfo(
std::move(colorInfo)), fDimensions(dimensions) {}
static bool SkAlphaTypeIsOpaque(SkAlphaType at)
@ kUnknown_SkAlphaType
uninitialized
@ kUnknown_SkColorType
uninitialized
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
SK_API int SkColorTypeBytesPerPixel(SkColorType ct)
@ kRec709_Full_SkYUVColorSpace
describes HDTV range
@ kYCgCo_10bit_Full_SkYUVColorSpace
@ kYCgCo_12bit_Full_SkYUVColorSpace
@ kYCgCo_12bit_Limited_SkYUVColorSpace
@ kYCgCo_10bit_Limited_SkYUVColorSpace
@ kGBR_Limited_SkYUVColorSpace
@ kBT2020_8bit_Limited_SkYUVColorSpace
@ kBT2020_SkYUVColorSpace
@ kFCC_Full_SkYUVColorSpace
describes FCC range
@ kLastEnum_SkYUVColorSpace
last valid value
@ kYCgCo_8bit_Limited_SkYUVColorSpace
@ kYDZDX_Full_SkYUVColorSpace
describes YDZDX range
@ kRec601_SkYUVColorSpace
@ kFCC_Limited_SkYUVColorSpace
@ kBT2020_12bit_Limited_SkYUVColorSpace
@ kYCgCo_8bit_Full_SkYUVColorSpace
describes YCgCo matrix
@ kBT2020_8bit_Full_SkYUVColorSpace
describes UHDTV range, non-constant-luminance
@ kRec601_Limited_SkYUVColorSpace
describes SDTV range
@ kRec709_Limited_SkYUVColorSpace
@ kSMPTE240_Full_SkYUVColorSpace
describes SMPTE240M range
@ kGBR_Full_SkYUVColorSpace
describes GBR range
@ kSMPTE240_Limited_SkYUVColorSpace
@ kBT2020_12bit_Full_SkYUVColorSpace
@ kBT2020_10bit_Full_SkYUVColorSpace
@ kRec709_SkYUVColorSpace
@ kIdentity_SkYUVColorSpace
maps Y->R, U->G, V->B
@ kBT2020_10bit_Limited_SkYUVColorSpace
@ kYDZDX_Limited_SkYUVColorSpace
@ kJPEG_Full_SkYUVColorSpace
describes full range
SK_API bool SkColorTypeIsAlwaysOpaque(SkColorType ct)
SK_API bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType, SkAlphaType *canonical=nullptr)
static int64_t sk_64_mul(int64_t a, int64_t b)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
SkAlphaType alphaType() const
SkColorInfo(const SkColorInfo &)
SkColorInfo & operator=(SkColorInfo &&)
SkColorInfo & operator=(const SkColorInfo &)
SkColorInfo(SkColorInfo &&)
SkColorType colorType() const
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
bool operator==(C p1, const scoped_nsprotocol< C > &p2)
bool operator!=(C p1, const scoped_nsprotocol< C > &p2)
static constexpr SkIRect MakeSize(const SkISize &size)
SkImageInfo makeWH(int newWidth, int newHeight) const
static bool ByteSizeOverflowed(size_t byteSize)
bool operator!=(const SkImageInfo &other) const
const SkColorInfo & colorInfo() const
SkImageInfo(SkISize dimensions, SkColorInfo &&colorInfo)
static SkImageInfo Make(SkISize dimensions, SkColorInfo &&colorInfo)
SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const
bool operator==(const SkImageInfo &other) const
size_t minRowBytes() const
static SkImageInfo Make(SkISize dimensions, const SkColorInfo &colorInfo)
SkImageInfo makeDimensions(SkISize newSize) const
int bytesPerPixel() const
SkISize dimensions() const
SkDEBUGCODE(void validate() const ;) private SkISize fDimensions
bool gammaCloseToSRGB() const
size_t computeMinByteSize() const
static SkImageInfo MakeUnknown()
SkImageInfo(SkISize dimensions, const SkColorInfo &colorInfo)
SkAlphaType alphaType() const
SkColorType colorType() const
uint64_t minRowBytes64() const
int shiftPerPixel() const
SkImageInfo makeColorType(SkColorType newColorType) const
bool validRowBytes(size_t rowBytes) const