21 if (numChannels < 1 || numChannels > 4) {
24 fDataTypeSupport[
static_cast<size_t>(
type) + (numChannels - 1)*
kDataTypeCnt] =
true;
69 for (
int i = 0;
i < n; ++
i) {
75 for (
size_t i = 0; i < static_cast<size_t>(n); ++
i) {
84 ok &=
i == 0 || colorTypeDataType == fDataType;
85 ok &= numColorTypeChannels >= numRequiredChannels;
86 ok &= fPlaneInfos[
i].validRowBytes(fRowBytes[
i]);
87 fDataType = colorTypeDataType;
99 const size_t rowBytes[kMaxPlanes]) {
110 bool result = fYUVAInfo == that.fYUVAInfo &&
111 fPlaneInfos == that.fPlaneInfos &&
112 fRowBytes == that.fRowBytes;
128 SkPixmap pixmaps[kMaxPlanes])
const {
133 char*
addr =
static_cast<char*
>(memory);
135 for (
int i = 0;
i < n; ++
i) {
136 SkASSERT(fPlaneInfos[
i].validRowBytes(fRowBytes[
i]));
137 pixmaps[
i].reset(fPlaneInfos[
i],
addr, fRowBytes[
i]);
138 size_t planeSize = pixmaps[
i].rowBytes()*pixmaps[
i].height();
170 if (!yuvaPixmapInfo.
isValid()) {
178 if (!yuvaPixmapInfo.
isValid()) {
188 if (!
src.isValid()) {
192 int n =
result.numPlanes();
193 for (
int i = 0;
i < n; ++
i) {
202 s.info().minRowBytes(),
210 if (!yuvaPixmapInfo.
isValid()) {
219 const SkPixmap pixmaps[kMaxPlanes]) {
224 colorTypes[
i] = pixmaps[
i].colorType();
225 rowBytes[
i] = pixmaps[
i].rowBytes();
228 if (!yuvaPixmapInfo.
isValid()) {
236 , fYUVAInfo(yuvaPixmapInfo.yuvaInfo())
237 , fDataType(yuvaPixmapInfo.dataType()) {
247 : fYUVAInfo(yuvaInfo), fDataType(dataType) {
259 colorTypes[
i] = fPlanes[
i].colorType();
260 rowBytes[
i] = fPlanes[
i].rowBytes();
262 return {fYUVAInfo, colorTypes, rowBytes};
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
@ kR16G16B16A16_unorm_SkColorType
pixel with a little endian uint16_t for red, green, blue
@ kR8G8_unorm_SkColorType
pixel with a uint8_t for red and green
@ 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
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
@ 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
@ kA16_float_SkColorType
pixel with a half float for alpha
@ kRGBA_1010102_SkColorType
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
@ 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;
@ kR16G16_float_SkColorType
pixel with a half float for red and green
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static bool ok(int result)
static uint32_t SkColorTypeChannelFlags(SkColorType ct)
SK_API int SkColorTypeBytesPerPixel(SkColorType ct)
static void SkRectMemcpy(void *dst, size_t dstRB, const void *src, size_t srcRB, size_t trimRowBytes, int rowCount)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
static sk_sp< SkData > MakeUninitialized(size_t length)
size_t computeTotalBytes(const size_t rowBytes[kMaxPlanes], size_t planeSizes[kMaxPlanes]=nullptr) const
YUVALocations toYUVALocations(const uint32_t *channelFlags) const
PlaneConfig planeConfig() const
int planeDimensions(SkISize planeDimensions[kMaxPlanes]) const
std::array< YUVALocation, kYUVAChannelCount > YUVALocations
int numChannelsInPlane(int i) const
constexpr bool supported(PlaneConfig, DataType) const
void enableDataType(DataType, int numChannels)
size_t rowBytes(int i) const
const SkYUVAInfo & yuvaInfo() const
SkYUVAPixmapInfo()=default
bool initPixmapsFromSingleAllocation(void *memory, SkPixmap pixmaps[kMaxPlanes]) const
bool operator==(const SkYUVAPixmapInfo &) const
@ kUnorm10_Unorm2
10 bit unorm for Y, U, and V. 2 bit unorm for alpha (if present).
@ kUnorm8
8 bit unsigned normalized
@ kUnorm16
16 bit unsigned normalized
@ kFloat16
16 bit (half) floating point
size_t computeTotalBytes(size_t planeSizes[kMaxPlanes]=nullptr) const
DataType dataType() const
bool isSupported(const SupportedDataTypes &) const
static std::tuple< int, DataType > NumChannelsAndDataType(SkColorType)
static constexpr int kDataTypeCnt
static constexpr auto kMaxPlanes
static constexpr SkColorType DefaultColorTypeForDataType(DataType dataType, int numChannels)
static SkYUVAPixmaps FromData(const SkYUVAPixmapInfo &, sk_sp< SkData >)
DataType dataType() const
const SkYUVAInfo & yuvaInfo() const
SkYUVAPixmapInfo pixmapsInfo() const
static SkYUVAPixmaps Allocate(const SkYUVAPixmapInfo &yuvaPixmapInfo)
static SkYUVAPixmaps MakeCopy(const SkYUVAPixmaps &src)
static SkYUVAPixmaps FromExternalPixmaps(const SkYUVAInfo &, const SkPixmap[kMaxPlanes])
static SkYUVAPixmaps FromExternalMemory(const SkYUVAPixmapInfo &, void *memory)
static SkColorType RecommendedRGBAColorType(DataType)
SkYUVAInfo::YUVALocations toYUVALocations() const
static constexpr auto kMaxPlanes
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
SkYUVAPixmapInfo::DataType DataType
constexpr int32_t width() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static bool AreValidLocations(const SkYUVAInfo::YUVALocations &locations, int *numPlanes=nullptr)
std::shared_ptr< const fml::Mapping > data