GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
Color Class Reference

#include <VectorTools.hh>

Public Member Functions

 Color ()
 Color (Vector v)
 Color (float r_, float g_, float b_, float a_)
 Color (double r_, double g_, double b_, double a_)
 Color (int r, int g, int b)
 Color (int r, int g, int b, int alpha)
 Color (unsigned int color)
 Color (Color &&x)
 Color (const Color &x)
Color & operator= (Color &&x)
Color & operator= (const Color &x)
void check ()
void operator*= (float k)
Color clamp () const
unsigned int Pixel ()
float rf () const
float gf () const
float bf () const
float af () const

Static Public Member Functions

static unsigned int Average (std::vector< unsigned int > vec)
static unsigned short PixelConvert (unsigned int pixel)
static unsigned int PixelCombine (unsigned int pixel1, unsigned int pixel2)
static Color Transparent ()
static Color Black ()
static Color White ()
static Color CubeCenter ()
static unsigned int ColorCube (float x, float y, float z, float sizex, float sizey, float sizez)
static unsigned int RangeChange (unsigned int color, unsigned int source_upper, unsigned int source_lower, unsigned int range_upper, unsigned int range_lower)
static unsigned int CubicInterpolate (unsigned int pixel1, unsigned int pixel2, float val)
static unsigned int max_color (unsigned int pixel1, unsigned int pixel2)
static unsigned int min_color (unsigned int pixel1, unsigned int pixel2)
static unsigned int Interpolate (unsigned int pixel1, unsigned int pixel2, float val)
static Color Interpolate (const Color &aVec, const Color &aVec2, float aVal)
static Color Lighter (const Color &aVec, float aVal)
static Color Darker (const Color &aVec, float aVal)
static Color AverageArray (Color *array, int size)

Public Attributes

int r
int g
int b
int alpha

Friends

std::ostream & operator<< (std::ostream &o, const Color &c)
Color operator+ (const Color &c1, const Color &c2)
Color operator* (Color c, float val)
Color operator* (float val, Color c)
bool operator== (const Color &c1, const Color &c2)

Constructor & Destructor Documentation

◆ Color() [1/9]

Color::Color ( )
inline
Here is the caller graph for this function:

◆ Color() [2/9]

Color::Color ( Vector v)

◆ Color() [3/9]

Color::Color ( float r_,
float g_,
float b_,
float a_ )
inline

◆ Color() [4/9]

Color::Color ( double r_,
double g_,
double b_,
double a_ )
inline

◆ Color() [5/9]

Color::Color ( int r,
int g,
int b )

◆ Color() [6/9]

Color::Color ( int r,
int g,
int b,
int alpha )

◆ Color() [7/9]

Color::Color ( unsigned int color)

◆ Color() [8/9]

Color::Color ( Color && x)
inline

◆ Color() [9/9]

Color::Color ( const Color & x)
inline

Member Function Documentation

◆ af()

float Color::af ( ) const
inline
Here is the caller graph for this function:

◆ Average()

unsigned int Color::Average ( std::vector< unsigned int > vec)
static

◆ AverageArray()

Color Color::AverageArray ( Color * array,
int size )
inlinestatic
Here is the caller graph for this function:

◆ bf()

float Color::bf ( ) const
inline
Here is the caller graph for this function:

◆ Black()

Color Color::Black ( )
inlinestatic
Here is the caller graph for this function:

◆ check()

void Color::check ( )
Here is the caller graph for this function:

◆ clamp()

Color Color::clamp ( ) const
inline
Here is the caller graph for this function:

◆ ColorCube()

unsigned int Color::ColorCube ( float x,
float y,
float z,
float sizex,
float sizey,
float sizez )
inlinestatic
Here is the caller graph for this function:

◆ CubeCenter()

Color Color::CubeCenter ( )
inlinestatic

◆ CubicInterpolate()

unsigned int Color::CubicInterpolate ( unsigned int pixel1,
unsigned int pixel2,
float val )
inlinestatic
Here is the caller graph for this function:

◆ Darker()

Color Color::Darker ( const Color & aVec,
float aVal )
inlinestatic
Here is the caller graph for this function:

◆ gf()

float Color::gf ( ) const
inline
Here is the caller graph for this function:

◆ Interpolate() [1/2]

Color Color::Interpolate ( const Color & aVec,
const Color & aVec2,
float aVal )
inlinestatic

◆ Interpolate() [2/2]

unsigned int Color::Interpolate ( unsigned int pixel1,
unsigned int pixel2,
float val )
inlinestatic
Here is the caller graph for this function:

◆ Lighter()

Color Color::Lighter ( const Color & aVec,
float aVal )
inlinestatic
Here is the caller graph for this function:

◆ max_color()

unsigned int Color::max_color ( unsigned int pixel1,
unsigned int pixel2 )
inlinestatic
Here is the caller graph for this function:

◆ min_color()

unsigned int Color::min_color ( unsigned int pixel1,
unsigned int pixel2 )
inlinestatic
Here is the caller graph for this function:

◆ operator*=()

void Color::operator*= ( float k)
inline

◆ operator=() [1/2]

Color & Color::operator= ( Color && x)
inline

◆ operator=() [2/2]

Color & Color::operator= ( const Color & x)
inline

◆ Pixel()

unsigned int Color::Pixel ( )
inline

◆ PixelCombine()

unsigned int Color::PixelCombine ( unsigned int pixel1,
unsigned int pixel2 )
inlinestatic
Here is the caller graph for this function:

◆ PixelConvert()

unsigned short Color::PixelConvert ( unsigned int pixel)
inlinestatic

◆ RangeChange()

unsigned int Color::RangeChange ( unsigned int color,
unsigned int source_upper,
unsigned int source_lower,
unsigned int range_upper,
unsigned int range_lower )
inlinestatic
Here is the caller graph for this function:

◆ rf()

float Color::rf ( ) const
inline
Here is the caller graph for this function:

◆ Transparent()

Color Color::Transparent ( )
inlinestatic
Here is the caller graph for this function:

◆ White()

Color Color::White ( )
inlinestatic
Here is the caller graph for this function:

◆ operator* [1/2]

Color operator* ( Color c,
float val )
friend

◆ operator* [2/2]

Color operator* ( float val,
Color c )
friend

◆ operator+

Color operator+ ( const Color & c1,
const Color & c2 )
friend

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const Color & c )
friend

◆ operator==

bool operator== ( const Color & c1,
const Color & c2 )
friend

Member Data Documentation

◆ alpha

int Color::alpha

◆ b

int Color::b

◆ g

int Color::g

◆ r

int Color::r

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