Skia
2D Graphics Library
|
SkYUVAInfo combined with per-plane SkColorTypes and row bytes. More...
#include <SkYUVAPixmaps.h>
Classes | |
class | SupportedDataTypes |
Public Types | |
enum class | DataType { kUnorm8 , kUnorm16 , kFloat16 , kUnorm10_Unorm2 , kLast = kUnorm10_Unorm2 } |
Data type for Y, U, V, and possibly A channels independent of how values are packed into planes. More... | |
using | PlaneConfig = SkYUVAInfo::PlaneConfig |
using | Subsampling = SkYUVAInfo::Subsampling |
Public Member Functions | |
SkYUVAPixmapInfo ()=default | |
Default SkYUVAPixmapInfo is invalid. More... | |
SkYUVAPixmapInfo (const SkYUVAInfo &, const SkColorType[kMaxPlanes], const size_t rowBytes[kMaxPlanes]) | |
Initializes the SkYUVAPixmapInfo from a SkYUVAInfo with per-plane color types and row bytes. More... | |
SkYUVAPixmapInfo (const SkYUVAInfo &, DataType, const size_t rowBytes[kMaxPlanes]) | |
Like above but uses DefaultColorTypeForDataType to determine each plane's SkColorType. More... | |
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 |
The number of SkPixmap planes, 0 if this SkYUVAPixmapInfo is invalid. More... | |
DataType | dataType () const |
The per-YUV[A] channel data type. More... | |
size_t | rowBytes (int i) const |
Row bytes for the ith plane. More... | |
const SkImageInfo & | planeInfo (int i) const |
Image info for the ith plane, or default SkImageInfo if i >= numPlanes() More... | |
size_t | computeTotalBytes (size_t planeSizes[kMaxPlanes]=nullptr) const |
Determine size to allocate for all planes. More... | |
bool | 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. More... | |
bool | isValid () const |
Returns true if this has been configured with a non-empty dimensioned SkYUVAInfo with compatible color types and row bytes. More... | |
bool | isSupported (const SupportedDataTypes &) const |
Is this valid and does it use color types allowed by the passed SupportedDataTypes? More... | |
Static Public Member Functions | |
static constexpr SkColorType | DefaultColorTypeForDataType (DataType dataType, int numChannels) |
Gets the default SkColorType to use with numChannels channels, each represented as DataType. More... | |
static std::tuple< int, DataType > | NumChannelsAndDataType (SkColorType) |
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. More... | |
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.
|
strong |
Data type for Y, U, V, and possibly A channels independent of how values are packed into planes.
|
default |
Default SkYUVAPixmapInfo is invalid.
SkYUVAPixmapInfo::SkYUVAPixmapInfo | ( | const SkYUVAInfo & | , |
const | SkColorType[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.
SkYUVAPixmapInfo::SkYUVAPixmapInfo | ( | const SkYUVAInfo & | , |
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.
|
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.
|
inline |
The per-YUV[A] channel data type.
|
staticconstexpr |
Gets the default SkColorType to use with numChannels channels, each represented as DataType.
Returns kUnknown_SkColorType if no such color type.
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.
bool SkYUVAPixmapInfo::isSupported | ( | const SupportedDataTypes & | ) | const |
Is this valid and does it use color types allowed by the passed SupportedDataTypes?
|
inline |
Returns true if this has been configured with a non-empty dimensioned SkYUVAInfo with compatible color types and row bytes.
|
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.
|
inline |
The number of SkPixmap planes, 0 if this SkYUVAPixmapInfo is invalid.
|
inline |
|
default |
bool SkYUVAPixmapInfo::operator== | ( | const SkYUVAPixmapInfo & | ) | const |
|
inline |
Image info for the ith plane, or default SkImageInfo if i >= numPlanes()
|
inline |
Row bytes for the ith plane.
Returns zero if i >= numPlanes() or this SkYUVAPixmapInfo is invalid.
|
inline |
|
inline |
|
staticconstexpr |
|
staticconstexpr |