Skia
2D Graphics Library
SkYUVAPixmaps Class Reference

Helper to store SkPixmap planes as described by a SkYUVAPixmapInfo. More...

#include <SkYUVAPixmaps.h>

Public Types

using DataType = SkYUVAPixmapInfo::DataType
 

Public Member Functions

 SkYUVAPixmaps ()=default
 Default SkYUVAPixmaps is invalid. More...
 
 ~SkYUVAPixmaps ()=default
 
 SkYUVAPixmaps (SkYUVAPixmaps &&that)=default
 
SkYUVAPixmapsoperator= (SkYUVAPixmaps &&that)=default
 
 SkYUVAPixmaps (const SkYUVAPixmaps &)=default
 
SkYUVAPixmapsoperator= (const SkYUVAPixmaps &that)=default
 
bool isValid () const
 Does have initialized pixmaps compatible with its SkYUVAInfo. More...
 
const SkYUVAInfoyuvaInfo () const
 
DataType dataType () const
 
SkYUVAPixmapInfo pixmapsInfo () const
 
int numPlanes () const
 Number of pixmap planes or 0 if this SkYUVAPixmaps is invalid. More...
 
const std::array< SkPixmap, kMaxPlanes > & planes () const
 Access the SkPixmap planes. More...
 
const SkPixmapplane (int i) const
 Get the ith SkPixmap plane. More...
 
SkYUVAInfo::YUVALocations toYUVALocations () const
 Computes a YUVALocations representation of the planar layout. More...
 
bool ownsStorage () const
 Does this SkPixmaps own the backing store of the planes? More...
 

Static Public Member Functions

static SkColorType RecommendedRGBAColorType (DataType)
 
static SkYUVAPixmaps Allocate (const SkYUVAPixmapInfo &yuvaPixmapInfo)
 Allocate space for pixmaps' pixels in the SkYUVAPixmaps. More...
 
static SkYUVAPixmaps FromData (const SkYUVAPixmapInfo &, sk_sp< SkData >)
 Use storage in SkData as backing store for pixmaps' pixels. More...
 
static SkYUVAPixmaps MakeCopy (const SkYUVAPixmaps &src)
 Makes a deep copy of the src SkYUVAPixmaps. More...
 
static SkYUVAPixmaps FromExternalMemory (const SkYUVAPixmapInfo &, void *memory)
 Use passed in memory as backing store for pixmaps' pixels. More...
 
static SkYUVAPixmaps FromExternalPixmaps (const SkYUVAInfo &, const SkPixmap[kMaxPlanes])
 Wraps existing SkPixmaps. More...
 

Static Public Attributes

static constexpr auto kMaxPlanes = SkYUVAPixmapInfo::kMaxPlanes
 

Detailed Description

Helper to store SkPixmap planes as described by a SkYUVAPixmapInfo.

Can be responsible for allocating/freeing memory for pixmaps or use external memory.

Member Typedef Documentation

◆ DataType

Constructor & Destructor Documentation

◆ SkYUVAPixmaps() [1/3]

SkYUVAPixmaps::SkYUVAPixmaps ( )
default

Default SkYUVAPixmaps is invalid.

◆ ~SkYUVAPixmaps()

SkYUVAPixmaps::~SkYUVAPixmaps ( )
default

◆ SkYUVAPixmaps() [2/3]

SkYUVAPixmaps::SkYUVAPixmaps ( SkYUVAPixmaps &&  that)
default

◆ SkYUVAPixmaps() [3/3]

SkYUVAPixmaps::SkYUVAPixmaps ( const SkYUVAPixmaps )
default

Member Function Documentation

◆ Allocate()

static SkYUVAPixmaps SkYUVAPixmaps::Allocate ( const SkYUVAPixmapInfo yuvaPixmapInfo)
static

Allocate space for pixmaps' pixels in the SkYUVAPixmaps.

◆ dataType()

DataType SkYUVAPixmaps::dataType ( ) const
inline

◆ FromData()

static SkYUVAPixmaps SkYUVAPixmaps::FromData ( const SkYUVAPixmapInfo ,
sk_sp< SkData  
)
static

Use storage in SkData as backing store for pixmaps' pixels.

SkData is retained by the SkYUVAPixmaps.

◆ FromExternalMemory()

static SkYUVAPixmaps SkYUVAPixmaps::FromExternalMemory ( const SkYUVAPixmapInfo ,
void *  memory 
)
static

Use passed in memory as backing store for pixmaps' pixels.

Caller must ensure memory remains allocated while pixmaps are in use. There must be at least SkYUVAPixmapInfo::computeTotalBytes() allocated starting at memory.

◆ FromExternalPixmaps()

static SkYUVAPixmaps SkYUVAPixmaps::FromExternalPixmaps ( const SkYUVAInfo ,
const  SkPixmap[kMaxPlanes] 
)
static

Wraps existing SkPixmaps.

The SkYUVAPixmaps will have no ownership of the SkPixmaps' pixel memory so the caller must ensure it remains valid. Will return an invalid SkYUVAPixmaps if the SkYUVAInfo isn't compatible with the SkPixmap array (number of planes, plane dimensions, sufficient color channels in planes, ...).

◆ isValid()

bool SkYUVAPixmaps::isValid ( ) const
inline

Does have initialized pixmaps compatible with its SkYUVAInfo.

◆ MakeCopy()

static SkYUVAPixmaps SkYUVAPixmaps::MakeCopy ( const SkYUVAPixmaps src)
static

Makes a deep copy of the src SkYUVAPixmaps.

The returned SkYUVAPixmaps owns its planes' backing stores.

◆ numPlanes()

int SkYUVAPixmaps::numPlanes ( ) const
inline

Number of pixmap planes or 0 if this SkYUVAPixmaps is invalid.

◆ operator=() [1/2]

SkYUVAPixmaps& SkYUVAPixmaps::operator= ( const SkYUVAPixmaps that)
default

◆ operator=() [2/2]

SkYUVAPixmaps& SkYUVAPixmaps::operator= ( SkYUVAPixmaps &&  that)
default

◆ ownsStorage()

bool SkYUVAPixmaps::ownsStorage ( ) const
inline

Does this SkPixmaps own the backing store of the planes?

◆ pixmapsInfo()

SkYUVAPixmapInfo SkYUVAPixmaps::pixmapsInfo ( ) const

◆ plane()

const SkPixmap& SkYUVAPixmaps::plane ( int  i) const
inline

Get the ith SkPixmap plane.

SkPixmap will be default initialized if i >= numPlanes or this SkYUVAPixmaps is invalid.

◆ planes()

const std::array<SkPixmap, kMaxPlanes>& SkYUVAPixmaps::planes ( ) const
inline

Access the SkPixmap planes.

They are default initialized if this is not a valid SkYUVAPixmaps.

◆ RecommendedRGBAColorType()

static SkColorType SkYUVAPixmaps::RecommendedRGBAColorType ( DataType  )
static

◆ toYUVALocations()

SkYUVAInfo::YUVALocations SkYUVAPixmaps::toYUVALocations ( ) const

Computes a YUVALocations representation of the planar layout.

The result is guaranteed to be valid if this->isValid().

◆ yuvaInfo()

const SkYUVAInfo& SkYUVAPixmaps::yuvaInfo ( ) const
inline

Member Data Documentation

◆ kMaxPlanes

constexpr auto SkYUVAPixmaps::kMaxPlanes = SkYUVAPixmapInfo::kMaxPlanes
staticconstexpr

The documentation for this class was generated from the following file: