Flutter Engine
The Flutter Engine
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 718 of file GrTypesPriv.h.

Member Function Documentation

◆ a()

constexpr int GrColorFormatDesc::a ( ) const
inlineconstexpr

Definition at line 761 of file GrTypesPriv.h.

761{ return fABits; }

◆ b()

constexpr int GrColorFormatDesc::b ( ) const
inlineconstexpr

Definition at line 760 of file GrTypesPriv.h.

760{ return fBBits; }

◆ encoding()

constexpr GrColorTypeEncoding GrColorFormatDesc::encoding ( ) const
inlineconstexpr

Definition at line 774 of file GrTypesPriv.h.

774{ return fEncoding; }

◆ g()

constexpr int GrColorFormatDesc::g ( ) const
inlineconstexpr

Definition at line 759 of file GrTypesPriv.h.

759{ return fGBits; }

◆ gray()

constexpr int GrColorFormatDesc::gray ( ) const
inlineconstexpr

Definition at line 772 of file GrTypesPriv.h.

772{ return fGrayBits; }

◆ MakeAlpha()

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

Definition at line 736 of file GrTypesPriv.h.

736 {
737 return {0, 0, 0, a, 0, e};
738 }
constexpr int a() const
Definition: GrTypesPriv.h:761

◆ MakeGray()

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

Definition at line 748 of file GrTypesPriv.h.

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

◆ MakeGrayAlpha()

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

Definition at line 752 of file GrTypesPriv.h.

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

◆ MakeInvalid()

static constexpr GrColorFormatDesc GrColorFormatDesc::MakeInvalid ( )
inlinestaticconstexpr

Definition at line 756 of file GrTypesPriv.h.

756{ return {}; }

◆ MakeR()

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

Definition at line 740 of file GrTypesPriv.h.

740 {
741 return {r, 0, 0, 0, 0, e};
742 }
constexpr int r() const
Definition: GrTypesPriv.h:758

◆ MakeRG()

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

Definition at line 744 of file GrTypesPriv.h.

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

◆ MakeRGB() [1/2]

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

Definition at line 732 of file GrTypesPriv.h.

732 {
733 return {r, g, b, 0, 0, e};
734 }
constexpr int g() const
Definition: GrTypesPriv.h:759
constexpr int b() const
Definition: GrTypesPriv.h:760

◆ MakeRGB() [2/2]

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

Definition at line 728 of file GrTypesPriv.h.

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

◆ MakeRGBA() [1/2]

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

Definition at line 724 of file GrTypesPriv.h.

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

◆ MakeRGBA() [2/2]

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

Definition at line 720 of file GrTypesPriv.h.

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

◆ operator[]()

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

Definition at line 762 of file GrTypesPriv.h.

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

◆ r()

constexpr int GrColorFormatDesc::r ( ) const
inlineconstexpr

Definition at line 758 of file GrTypesPriv.h.

758{ return fRBits; }

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