/** *SkYUVAInfocombinedwithper-planeSkColorTypesandrowbytes.FullyspecifiestheSkPixmaps *foraYUVAimagewithouttheactualpixelmemoryanddata.
*/ class SK_API SkYUVAPixmapInfo {
public: static constexpr auto kMaxPlanes = SkYUVAInfo::kMaxPlanes;
using PlaneConfig = SkYUVAInfo::PlaneConfig;
using Subsampling = SkYUVAInfo::Subsampling;
/** *DatatypeforY,U,V,andpossiblyAchannelsindependentofhowvaluesarepackedinto *planes.
**/ enumclass DataType {
kUnorm8, ///< 8 bit unsigned normalized
kUnorm16, ///< 16 bit unsigned normalized
kFloat16, ///< 16 bit (half) floating point
kUnorm10_Unorm2, ///< 10 bit unorm for Y, U, and V. 2 bit unorm for alpha (if present).
/** Image info for the ith plane, or default SkImageInfo if i >= numPlanes() */ const SkImageInfo& planeInfo(int i) const { return fPlaneInfos[static_cast<size_t>(i)]; }
constexpr bool SkYUVAPixmapInfo::SupportedDataTypes::supported(PlaneConfig config,
DataType type) const { int n = SkYUVAInfo::NumPlanes(config); for (int i = 0; i < n; ++i) { auto c = static_cast<size_t>(SkYUVAInfo::NumChannelsInPlane(config, i));
SkASSERT(c >= 1 && c <= 4); if (!fDataTypeSupport[static_cast<size_t>(type) +
(c - 1)*static_cast<size_t>(kDataTypeCnt)]) { returnfalse;
}
} return true;
}
constexpr SkColorType SkYUVAPixmapInfo::DefaultColorTypeForDataType(DataType dataType, int numChannels) { switch (numChannels) { case1: switch (dataType) { case DataType::kUnorm8: return kGray_8_SkColorType; case DataType::kUnorm16: return kA16_unorm_SkColorType; case DataType::kFloat16: return kA16_float_SkColorType; case DataType::kUnorm10_Unorm2: return kUnknown_SkColorType;
} break; case2: switch (dataType) { case DataType::kUnorm8: return kR8G8_unorm_SkColorType; case DataType::kUnorm16: return kR16G16_unorm_SkColorType; case DataType::kFloat16: return kR16G16_float_SkColorType; case DataType::kUnorm10_Unorm2: return kUnknown_SkColorType;
} break; case3: // None of these are tightly packed. The intended use case is for interleaved YUVA // planes where we're forcing opaqueness by ignoring the alpha values. // There are "x" rather than "A" variants for Unorm8 and Unorm10_Unorm2 but we don't // choose them because 1) there is no inherent advantage and 2) there is better support // in the GPU backend for the "A" versions. switch (dataType) { case DataType::kUnorm8: return kRGBA_8888_SkColorType; case DataType::kUnorm16: return kR16G16B16A16_unorm_SkColorType; case DataType::kFloat16: return kRGBA_F16_SkColorType; case DataType::kUnorm10_Unorm2: return kRGBA_1010102_SkColorType;
} break; case4: switch (dataType) { case DataType::kUnorm8: return kRGBA_8888_SkColorType; case DataType::kUnorm16: return kR16G16B16A16_unorm_SkColorType; case DataType::kFloat16: return kRGBA_F16_SkColorType; case DataType::kUnorm10_Unorm2: return kRGBA_1010102_SkColorType;
} break;
} return kUnknown_SkColorType;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.