Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
GrColorFormatDesc Class Reference

#include <GrTypesPriv.h>

Public Member Functions

constexpr int r () const
 
constexpr int g () const
 
constexpr int b () const
 
constexpr int a () const
 
constexpr int operator[] (int c) const
 
constexpr int gray () const
 
constexpr GrColorTypeEncoding encoding () const
 

Static Public Member Functions

static constexpr GrColorFormatDesc MakeRGBA (int rgba, GrColorTypeEncoding e)
 
static constexpr GrColorFormatDesc MakeRGBA (int rgb, int a, GrColorTypeEncoding e)
 
static constexpr GrColorFormatDesc MakeRGB (int rgb, GrColorTypeEncoding e)
 
static constexpr GrColorFormatDesc MakeRGB (int r, int g, int b, GrColorTypeEncoding e)
 
static constexpr GrColorFormatDesc MakeAlpha (int a, GrColorTypeEncoding e)
 
static constexpr GrColorFormatDesc MakeR (int r, GrColorTypeEncoding e)
 
static constexpr GrColorFormatDesc MakeRG (int rg, GrColorTypeEncoding e)
 
static constexpr GrColorFormatDesc MakeGray (int grayBits, GrColorTypeEncoding e)
 
static constexpr GrColorFormatDesc MakeGrayAlpha (int grayAlpha, GrColorTypeEncoding e)
 
static constexpr GrColorFormatDesc MakeInvalid ()
 

Detailed Description

Describes a GrColorType by how many bits are used for each color component and how they are encoded. Currently all the non-zero channels share a single GrColorTypeEncoding. This could be expanded to store separate encodings and to indicate which bits belong to which components.

Definition at line 717 of file GrTypesPriv.h.

Member Function Documentation

◆ a()

constexpr int GrColorFormatDesc::a ( ) const
inlineconstexpr

Definition at line 760 of file GrTypesPriv.h.

760{ return fABits; }

◆ b()

constexpr int GrColorFormatDesc::b ( ) const
inlineconstexpr

Definition at line 759 of file GrTypesPriv.h.

759{ return fBBits; }

◆ encoding()

constexpr GrColorTypeEncoding GrColorFormatDesc::encoding ( ) const
inlineconstexpr

Definition at line 773 of file GrTypesPriv.h.

773{ return fEncoding; }

◆ g()

constexpr int GrColorFormatDesc::g ( ) const
inlineconstexpr

Definition at line 758 of file GrTypesPriv.h.

758{ return fGBits; }

◆ gray()

constexpr int GrColorFormatDesc::gray ( ) const
inlineconstexpr

Definition at line 771 of file GrTypesPriv.h.

771{ return fGrayBits; }

◆ MakeAlpha()

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeAlpha ( int  a,
GrColorTypeEncoding  e 
)
inlinestaticconstexpr

Definition at line 735 of file GrTypesPriv.h.

735 {
736 return {0, 0, 0, a, 0, e};
737 }
constexpr int a() const

◆ MakeGray()

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeGray ( int  grayBits,
GrColorTypeEncoding  e 
)
inlinestaticconstexpr

Definition at line 747 of file GrTypesPriv.h.

747 {
748 return {0, 0, 0, 0, grayBits, e};
749 }

◆ MakeGrayAlpha()

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeGrayAlpha ( int  grayAlpha,
GrColorTypeEncoding  e 
)
inlinestaticconstexpr

Definition at line 751 of file GrTypesPriv.h.

751 {
752 return {0, 0, 0, 0, grayAlpha, e};
753 }

◆ MakeInvalid()

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeInvalid ( )
inlinestaticconstexpr

Definition at line 755 of file GrTypesPriv.h.

755{ return {}; }

◆ MakeR()

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeR ( int  r,
GrColorTypeEncoding  e 
)
inlinestaticconstexpr

Definition at line 739 of file GrTypesPriv.h.

739 {
740 return {r, 0, 0, 0, 0, e};
741 }
constexpr int r() const

◆ MakeRG()

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeRG ( int  rg,
GrColorTypeEncoding  e 
)
inlinestaticconstexpr

Definition at line 743 of file GrTypesPriv.h.

743 {
744 return {rg, rg, 0, 0, 0, e};
745 }

◆ MakeRGB() [1/2]

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeRGB ( int  r,
int  g,
int  b,
GrColorTypeEncoding  e 
)
inlinestaticconstexpr

Definition at line 731 of file GrTypesPriv.h.

731 {
732 return {r, g, b, 0, 0, e};
733 }
constexpr int g() const
constexpr int b() const

◆ MakeRGB() [2/2]

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeRGB ( int  rgb,
GrColorTypeEncoding  e 
)
inlinestaticconstexpr

Definition at line 727 of file GrTypesPriv.h.

727 {
728 return {rgb, rgb, rgb, 0, 0, e};
729 }

◆ MakeRGBA() [1/2]

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeRGBA ( int  rgb,
int  a,
GrColorTypeEncoding  e 
)
inlinestaticconstexpr

Definition at line 723 of file GrTypesPriv.h.

723 {
724 return {rgb, rgb, rgb, a, 0, e};
725 }

◆ MakeRGBA() [2/2]

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeRGBA ( int  rgba,
GrColorTypeEncoding  e 
)
inlinestaticconstexpr

Definition at line 719 of file GrTypesPriv.h.

719 {
720 return {rgba, rgba, rgba, rgba, 0, e};
721 }
static const uint32_t rgba[kNumPixels]

◆ operator[]()

constexpr int GrColorFormatDesc::operator[] ( int  c) const
inlineconstexpr

Definition at line 761 of file GrTypesPriv.h.

761 {
762 switch (c) {
763 case 0: return this->r();
764 case 1: return this->g();
765 case 2: return this->b();
766 case 3: return this->a();
767 }
769 }
#define SkUNREACHABLE
Definition SkAssert.h:135

◆ r()

constexpr int GrColorFormatDesc::r ( ) const
inlineconstexpr

Definition at line 757 of file GrTypesPriv.h.

757{ return fRBits; }

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