8#ifndef SkYUVAInfo_DEFINED
9#define SkYUVAInfo_DEFINED
29 static constexpr int kYUVAChannelCount =
static_cast<int>(YUVAChannels::kLast + 1);
98 static constexpr int kMaxPlanes = 4;
101 static std::tuple<int, int> SubsamplingFactors(
Subsampling);
118 static int PlaneDimensions(
SkISize imageDimensions,
122 SkISize planeDimensions[kMaxPlanes]);
131 static constexpr int NumChannelsInPlane(
PlaneConfig,
int i);
155 Siting sitingX = Siting::kCentered,
156 Siting sitingY = Siting::kCentered);
164 return PlaneSubsamplingFactors(fPlaneConfig, fSubsampling, planeIdx);
172 int width()
const {
return fDimensions.width(); }
173 int height()
const {
return fDimensions.height(); }
185 bool hasAlpha()
const {
return HasAlpha(fPlaneConfig); }
193 return PlaneDimensions(fDimensions, fPlaneConfig, fSubsampling, fOrigin, planeDimensions);
201 size_t computeTotalBytes(
const size_t rowBytes[kMaxPlanes],
202 size_t planeSizes[kMaxPlanes] =
nullptr)
const;
204 int numPlanes()
const {
return NumPlanes(fPlaneConfig); }
214 YUVALocations toYUVALocations(
const uint32_t* channelFlags)
const;
249 Siting fSitingX = Siting::kCentered;
250 Siting fSitingY = Siting::kCentered;
279 return i >= 0 &&
i < 3 ? 1 : 0;
289 return i == 0 ? 3 : 0;
292 return i >= 0 &&
i < 4 ? 1 : 0;
303 return i == 0 ? 4 : 0;
@ kTopLeft_SkEncodedOrigin
static SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int w, int h)
@ kIdentity_SkYUVColorSpace
maps Y->R, U->G, V->B
SkYUVAInfo(const SkYUVAInfo &)=default
SkMatrix originMatrix() const
SkYUVColorSpace yuvColorSpace() const
@ kY_U_V_A
Plane 0: Y, Plane 1: U, Plane 2: V, Plane 3: A.
@ kY_U_V
Plane 0: Y, Plane 1: U, Plane 2: V.
@ kY_V_U_A
Plane 0: Y, Plane 1: V, Plane 2: U, Plane 3: A.
@ kY_VU
Plane 0: Y, Plane 1: VU.
@ kY_UV
Plane 0: Y, Plane 1: UV.
@ kY_VU_A
Plane 0: Y, Plane 1: VU, Plane 2: A.
@ kY_V_U
Plane 0: Y, Plane 1: V, Plane 2: U.
@ kY_UV_A
Plane 0: Y, Plane 1: UV, Plane 2: A.
static constexpr int NumChannelsInPlane(PlaneConfig, int i)
std::tuple< int, int > planeSubsamplingFactors(int planeIdx) const
static constexpr int NumPlanes(PlaneConfig)
PlaneConfig planeConfig() const
int planeDimensions(SkISize planeDimensions[kMaxPlanes]) const
std::array< YUVALocation, kYUVAChannelCount > YUVALocations
SkEncodedOrigin origin() const
SkYUVAInfo & operator=(const SkYUVAInfo &that)=default
Subsampling subsampling() const
bool operator!=(const SkYUVAInfo &that) const
SkISize dimensions() const
int numChannelsInPlane(int i) const
bool operator==(C p1, const scoped_nsprotocol< C > &p2)