Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SkYUVAInfo::YUVALocation Struct Reference

#include <SkYUVAInfoLocation.h>

Public Member Functions

bool operator== (const YUVALocation &that) const
 
bool operator!= (const YUVALocation &that) const
 

Static Public Member Functions

static bool AreValidLocations (const SkYUVAInfo::YUVALocations &locations, int *numPlanes=nullptr)
 

Public Attributes

int fPlane = -1
 
SkColorChannel fChannel = SkColorChannel::kA
 

Detailed Description

The location of Y, U, V, or A values within the planes described by SkYUVAInfo. Computed from a SkYUVAInfo and the set of channels present in a set of pixmaps/textures.

Definition at line 20 of file SkYUVAInfoLocation.h.

Member Function Documentation

◆ AreValidLocations()

static bool SkYUVAInfo::YUVALocation::AreValidLocations ( const SkYUVAInfo::YUVALocations locations,
int numPlanes = nullptr 
)
inlinestatic

Definition at line 31 of file SkYUVAInfoLocation.h.

32 {
33 int maxSlotUsed = -1;
34 bool used[SkYUVAInfo::kMaxPlanes] = {};
35 bool valid = true;
36 for (int i = 0; i < SkYUVAInfo::kYUVAChannelCount; ++i) {
37 if (locations[i].fPlane < 0) {
39 valid = false; // only the 'A' plane can be omitted
40 }
41 } else if (locations[i].fPlane >= SkYUVAInfo::kMaxPlanes) {
42 valid = false; // A maximum of four input textures is allowed
43 } else {
44 maxSlotUsed = std::max(locations[i].fPlane, maxSlotUsed);
45 used[i] = true;
46 }
47 }
48
49 // All the used slots should be packed starting at 0 with no gaps
50 for (int i = 0; i <= maxSlotUsed; ++i) {
51 if (!used[i]) {
52 valid = false;
53 }
54 }
55
56 if (numPlanes) {
57 *numPlanes = valid ? maxSlotUsed + 1 : 0;
58 }
59 return valid;
60 }
int numPlanes() const
Definition SkYUVAInfo.h:204
static constexpr int kMaxPlanes
Definition SkYUVAInfo.h:98
static constexpr int kYUVAChannelCount
Definition SkYUVAInfo.h:29

◆ operator!=()

bool SkYUVAInfo::YUVALocation::operator!= ( const YUVALocation that) const
inline

Definition at line 29 of file SkYUVAInfoLocation.h.

29{ return !(*this == that); }

◆ operator==()

bool SkYUVAInfo::YUVALocation::operator== ( const YUVALocation that) const
inline

Definition at line 26 of file SkYUVAInfoLocation.h.

26 {
27 return fPlane == that.fPlane && fChannel == that.fChannel;
28 }

Member Data Documentation

◆ fChannel

SkColorChannel SkYUVAInfo::YUVALocation::fChannel = SkColorChannel::kA

The channel in the plane that contains the Y, U, V, or A value.

Definition at line 24 of file SkYUVAInfoLocation.h.

◆ fPlane

int SkYUVAInfo::YUVALocation::fPlane = -1

The index of the plane where the Y, U, V, or A value is to be found.

Definition at line 22 of file SkYUVAInfoLocation.h.


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