Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
G3D::Color4 Class Reference


Do not subclass– this implementation makes assumptions about the memory layout. More...

Public Member Functions

 Color4 (const Any &any)
 
 Color4 (DoNotInitialize dni)
 
 Color4 ()
 
Initializes to all zero More...
 
 Color4 (const Color3 &c3, float a=1.0)
 
 Color4 (const class Color4unorm8 &c)
 
 Color4 (class BinaryInput &bi)
 
 Color4 (const class Vector4 &v)
 
 Color4 (float r, float g, float b, float a=1.0)
 
 Color4 (float value[4])
 
 Color4 (const Color4 &other)
 Initialize from another color. More...
 
Color3 bgr () const
 
void deserialize (class BinaryInput &bi)
 
bool fuzzyEq (const Color4 &other) const
 
bool fuzzyNe (const Color4 &other) const
 
size_t hashCode () const
 
bool isFinite () const
 
bool isOne () const
 
bool isZero () const
 
Color4 lerp (const Color4 &other, float a) const
 
Color4 max (const Color4 &other) const
 
Color4 min (const Color4 &other) const
 
bool operator!= (const Color4 &rkVector) const
 
Color4 operator* (float fScalar) const
 
Color4 operator* (const Color4 &k) const
 
Color4operator*= (const Color4 &c)
 
Color4operator*= (float fScalar)
 
Color4 operator+ (const Color4 &rkVector) const
 
Color4operator+= (const Color4 &rkVector)
 
Color4 operator- (const Color4 &rkVector) const
 
Color4 operator- () const
 
Color4operator-= (const Color4 &rkVector)
 
Color4 operator/ (float fScalar) const
 
Color4 operator/ (const Color4 &c) const
 
Color4operator/= (const Color4 &c)
 
Color4operator/= (float fScalar)
 
Color4operator= (const Color4 &rkVector)
 
bool operator== (const Color4 &rkVector) const
 
float & operator[] (int i) const
 
Color4 pow (float other) const
 Applies the exponent to all channels, including the Color4::a channel. More...
 
Color3 rgb () const
 
void serialize (class BinaryOutput &bo) const
 
float sum () const
 r + g + b + a More...
 
Any toAny () const
 Converts the Color4 to an Any. More...
 
String toString () const
 

Static Public Member Functions

static const Color4clear ()
 
static Color4 fromARGB (uint32)
 
Initialize from an HTML-style color (e.g. More...
 
static Color4 fromASRGB (uint32)
 
Initialize from an HTML-style color (e.g. More...
 
static const Color4inf ()
 
static const Color4nan ()
 
static const Color4one ()
 
static const Color4zero ()
 

Public Attributes

float a
 
float b
 
float g
 
float r
 Channel values. More...
 

Friends

Color4 operator* (double fScalar, const Color4 &rkVector)
 

Detailed Description


Do not subclass– this implementation makes assumptions about the memory layout.

Constructor & Destructor Documentation

◆ Color4() [1/10]

G3D::Color4::Color4 ( const Any any)
Parameters
anyMust be in one of the following forms:

The alpha channel may be specified as "glossyExponent(n)" or "mirror()" as well as using a number, following UniversalBSDF::packGlossyExponent and UniversalBSDF::packedSpecularMirror conventions.

◆ Color4() [2/10]

G3D::Color4::Color4 ( DoNotInitialize  dni)
inline

◆ Color4() [3/10]

G3D::Color4::Color4 ( )
inline


Initializes to all zero

Referenced by max(), min(), operator*(), operator+(), operator-(), operator/(), and pow().

◆ Color4() [4/10]

G3D::Color4::Color4 ( const Color3 c3,
float  a = 1.0 
)
inline

◆ Color4() [5/10]

G3D::Color4::Color4 ( const class Color4unorm8 c)

◆ Color4() [6/10]

G3D::Color4::Color4 ( class BinaryInput bi)

◆ Color4() [7/10]

G3D::Color4::Color4 ( const class Vector4 v)

◆ Color4() [8/10]

G3D::Color4::Color4 ( float  r,
float  g,
float  b,
float  a = 1.0 
)
inline

◆ Color4() [9/10]

G3D::Color4::Color4 ( float  value[4])
inline

◆ Color4() [10/10]

G3D::Color4::Color4 ( const Color4 other)
inline

Initialize from another color.

Member Function Documentation

◆ bgr()

Color3 G3D::Color4::bgr ( ) const
inline

◆ clear()

static const Color4& G3D::Color4::clear ( )
static

◆ deserialize()

void G3D::Color4::deserialize ( class BinaryInput bi)

◆ fromARGB()

static Color4 G3D::Color4::fromARGB ( uint32  )
static


Initialize from an HTML-style color (e.g.

0xFFFF0000 == RED)

◆ fromASRGB()

static Color4 G3D::Color4::fromASRGB ( uint32  )
static


Initialize from an HTML-style color (e.g.

0xFF0000 == RED) by converting from sRGB to RGB. The alpha channel is linear.

◆ fuzzyEq()

bool G3D::Color4::fuzzyEq ( const Color4 other) const
inline

◆ fuzzyNe()

bool G3D::Color4::fuzzyNe ( const Color4 other) const
inline

◆ hashCode()

size_t G3D::Color4::hashCode ( ) const

◆ inf()

static const Color4& G3D::Color4::inf ( )
static

◆ isFinite()

bool G3D::Color4::isFinite ( ) const
inline

◆ isOne()

bool G3D::Color4::isOne ( ) const
inline

◆ isZero()

bool G3D::Color4::isZero ( ) const
inline

◆ lerp()

Color4 G3D::Color4::lerp ( const Color4 other,
float  a 
) const
inline

Referenced by G3D::lerp().

◆ max()

Color4 G3D::Color4::max ( const Color4 other) const
inline

Referenced by G3D::max().

◆ min()

Color4 G3D::Color4::min ( const Color4 other) const
inline

Referenced by G3D::min().

◆ nan()

static const Color4& G3D::Color4::nan ( )
static

◆ one()

static const Color4& G3D::Color4::one ( )
static

◆ operator!=()

bool G3D::Color4::operator!= ( const Color4 rkVector) const
inline

◆ operator*() [1/2]

Color4 G3D::Color4::operator* ( float  fScalar) const
inline

◆ operator*() [2/2]

Color4 G3D::Color4::operator* ( const Color4 k) const
inline

◆ operator*=() [1/2]

Color4& G3D::Color4::operator*= ( const Color4 c)
inline

◆ operator*=() [2/2]

Color4 & G3D::Color4::operator*= ( float  fScalar)
inline

◆ operator+()

Color4 G3D::Color4::operator+ ( const Color4 rkVector) const
inline

◆ operator+=()

Color4 & G3D::Color4::operator+= ( const Color4 rkVector)
inline

◆ operator-() [1/2]

Color4 G3D::Color4::operator- ( const Color4 rkVector) const
inline

◆ operator-() [2/2]

Color4 G3D::Color4::operator- ( ) const
inline

◆ operator-=()

Color4 & G3D::Color4::operator-= ( const Color4 rkVector)
inline

◆ operator/() [1/2]

Color4 G3D::Color4::operator/ ( float  fScalar) const

◆ operator/() [2/2]

Color4 G3D::Color4::operator/ ( const Color4 c) const
inline

◆ operator/=() [1/2]

Color4& G3D::Color4::operator/= ( const Color4 c)
inline

◆ operator/=() [2/2]

Color4& G3D::Color4::operator/= ( float  fScalar)

◆ operator=()

Color4 & G3D::Color4::operator= ( const Color4 rkVector)
inline

◆ operator==()

bool G3D::Color4::operator== ( const Color4 rkVector) const
inline

◆ operator[]()

float & G3D::Color4::operator[] ( int  i) const
inline

◆ pow()

Color4 G3D::Color4::pow ( float  other) const
inline

Applies the exponent to all channels, including the Color4::a channel.

◆ rgb()

Color3 G3D::Color4::rgb ( ) const
inline

◆ serialize()

void G3D::Color4::serialize ( class BinaryOutput bo) const

◆ sum()

float G3D::Color4::sum ( ) const
inline

r + g + b + a

◆ toAny()

Any G3D::Color4::toAny ( ) const

Converts the Color4 to an Any.

◆ toString()

String G3D::Color4::toString ( ) const

◆ zero()

static const Color4& G3D::Color4::zero ( )
static

Friends And Related Function Documentation

◆ operator*

Color4 operator* ( double  fScalar,
const Color4 rkVector 
)
friend

Member Data Documentation

◆ a

float G3D::Color4::a

◆ b

float G3D::Color4::b

◆ g

float G3D::Color4::g

◆ r

float G3D::Color4::r

documentation generated on Wed Nov 24 2021 08:01:54 using doxygen 1.8.15