Flutter Engine
The Flutter Engine
|
#include <SkYUVAPixmaps.h>
Classes | |
class | SupportedDataTypes |
Public Types | |
enum class | DataType { kUnorm8 , kUnorm16 , kFloat16 , kUnorm10_Unorm2 , kLast = kUnorm10_Unorm2 } |
using | PlaneConfig = SkYUVAInfo::PlaneConfig |
using | Subsampling = SkYUVAInfo::Subsampling |
Public Member Functions | |
SkYUVAPixmapInfo ()=default | |
SkYUVAPixmapInfo (const SkYUVAInfo &, const SkColorType[kMaxPlanes], const size_t rowBytes[kMaxPlanes]) | |
SkYUVAPixmapInfo (const SkYUVAInfo &, DataType, const size_t rowBytes[kMaxPlanes]) | |
SkYUVAPixmapInfo (const SkYUVAPixmapInfo &)=default | |
SkYUVAPixmapInfo & | operator= (const SkYUVAPixmapInfo &)=default |
bool | operator== (const SkYUVAPixmapInfo &) const |
bool | operator!= (const SkYUVAPixmapInfo &that) const |
const SkYUVAInfo & | yuvaInfo () const |
SkYUVColorSpace | yuvColorSpace () const |
int | numPlanes () const |
DataType | dataType () const |
size_t | rowBytes (int i) const |
const SkImageInfo & | planeInfo (int i) const |
size_t | computeTotalBytes (size_t planeSizes[kMaxPlanes]=nullptr) const |
bool | initPixmapsFromSingleAllocation (void *memory, SkPixmap pixmaps[kMaxPlanes]) const |
bool | isValid () const |
bool | isSupported (const SupportedDataTypes &) const |
Static Public Member Functions | |
static constexpr SkColorType | DefaultColorTypeForDataType (DataType dataType, int numChannels) |
static std::tuple< int, DataType > | NumChannelsAndDataType (SkColorType) |
Static Public Attributes | |
static constexpr auto | kMaxPlanes = SkYUVAInfo::kMaxPlanes |
static constexpr int | kDataTypeCnt = static_cast<int>(DataType::kLast) + 1 |
SkYUVAInfo combined with per-plane SkColorTypes and row bytes. Fully specifies the SkPixmaps for a YUVA image without the actual pixel memory and data.
Definition at line 30 of file SkYUVAPixmaps.h.
Definition at line 34 of file SkYUVAPixmaps.h.
Definition at line 35 of file SkYUVAPixmaps.h.
|
strong |
Data type for Y, U, V, and possibly A channels independent of how values are packed into planes.
Definition at line 41 of file SkYUVAPixmaps.h.
|
default |
Default SkYUVAPixmapInfo is invalid.
SkYUVAPixmapInfo::SkYUVAPixmapInfo | ( | const SkYUVAInfo & | yuvaInfo, |
const SkColorType | colorTypes[kMaxPlanes], | ||
const size_t | rowBytes[kMaxPlanes] | ||
) |
Initializes the SkYUVAPixmapInfo from a SkYUVAInfo with per-plane color types and row bytes. This will be invalid if the colorTypes aren't compatible with the SkYUVAInfo or if a rowBytes entry is not valid for the plane dimensions and color type. Color type and row byte values beyond the number of planes in SkYUVAInfo are ignored. All SkColorTypes must have the same DataType or this will be invalid.
If rowBytes is nullptr then bpp*width is assumed for each plane.
Definition at line 56 of file SkYUVAPixmaps.cpp.
SkYUVAPixmapInfo::SkYUVAPixmapInfo | ( | const SkYUVAInfo & | yuvaInfo, |
DataType | dataType, | ||
const size_t | rowBytes[kMaxPlanes] | ||
) |
Like above but uses DefaultColorTypeForDataType to determine each plane's SkColorType. If rowBytes is nullptr then bpp*width is assumed for each plane.
Definition at line 97 of file SkYUVAPixmaps.cpp.
|
default |
size_t SkYUVAPixmapInfo::computeTotalBytes | ( | size_t | planeSizes[kMaxPlanes] = nullptr | ) | const |
Determine size to allocate for all planes. Optionally retrieves the per-plane sizes in planeSizes if not null. If total size overflows will return SIZE_MAX and set all planeSizes to SIZE_MAX. Returns 0 and fills planesSizes with 0 if this SkYUVAPixmapInfo is not valid.
Definition at line 117 of file SkYUVAPixmaps.cpp.
|
inline |
The per-YUV[A] channel data type.
Definition at line 126 of file SkYUVAPixmaps.h.
|
staticconstexpr |
Gets the default SkColorType to use with numChannels channels, each represented as DataType. Returns kUnknown_SkColorType if no such color type.
Definition at line 293 of file SkYUVAPixmaps.h.
bool SkYUVAPixmapInfo::initPixmapsFromSingleAllocation | ( | void * | memory, |
SkPixmap | pixmaps[kMaxPlanes] | ||
) | const |
Takes an allocation that is assumed to be at least computeTotalBytes() in size and configures the first numPlanes() entries in pixmaps array to point into that memory. The remaining entries of pixmaps are default initialized. Fails if this SkYUVAPixmapInfo not valid.
Definition at line 127 of file SkYUVAPixmaps.cpp.
bool SkYUVAPixmapInfo::isSupported | ( | const SupportedDataTypes & | supportedDataTypes | ) | const |
Is this valid and does it use color types allowed by the passed SupportedDataTypes?
Definition at line 148 of file SkYUVAPixmaps.cpp.
|
inline |
Returns true if this has been configured with a non-empty dimensioned SkYUVAInfo with compatible color types and row bytes.
Definition at line 155 of file SkYUVAPixmaps.h.
|
static |
If the SkColorType is supported for YUVA pixmaps this will return the number of YUVA channels that can be stored in a plane of this color type and what the DataType is of those channels. If the SkColorType is not supported as a YUVA plane the number of channels is reported as 0 and the DataType returned should be ignored.
Definition at line 29 of file SkYUVAPixmaps.cpp.
|
inline |
The number of SkPixmap planes, 0 if this SkYUVAPixmapInfo is invalid.
Definition at line 123 of file SkYUVAPixmaps.h.
|
inline |
Definition at line 116 of file SkYUVAPixmaps.h.
|
default |
bool SkYUVAPixmapInfo::operator== | ( | const SkYUVAPixmapInfo & | that | ) | const |
Definition at line 109 of file SkYUVAPixmaps.cpp.
|
inline |
Image info for the ith plane, or default SkImageInfo if i >= numPlanes()
Definition at line 135 of file SkYUVAPixmaps.h.
|
inline |
Row bytes for the ith plane. Returns zero if i >= numPlanes() or this SkYUVAPixmapInfo is invalid.
Definition at line 132 of file SkYUVAPixmaps.h.
|
inline |
Definition at line 118 of file SkYUVAPixmaps.h.
|
inline |
Definition at line 120 of file SkYUVAPixmaps.h.
|
staticconstexpr |
Definition at line 49 of file SkYUVAPixmaps.h.
|
staticconstexpr |
Definition at line 32 of file SkYUVAPixmaps.h.