From 9b83919815f6a6ce5d73da1c28483970d0ca5589 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Feb 2021 14:22:28 -0600 Subject: added dev/MinGfx/ --- dev/MinGfx/docs/html/classmingfx_1_1_color.html | 529 ++++++++++++++++++++++++ 1 file changed, 529 insertions(+) create mode 100644 dev/MinGfx/docs/html/classmingfx_1_1_color.html (limited to 'dev/MinGfx/docs/html/classmingfx_1_1_color.html') diff --git a/dev/MinGfx/docs/html/classmingfx_1_1_color.html b/dev/MinGfx/docs/html/classmingfx_1_1_color.html new file mode 100644 index 0000000..d863be4 --- /dev/null +++ b/dev/MinGfx/docs/html/classmingfx_1_1_color.html @@ -0,0 +1,529 @@ + + + + + + + +MinGfx Toolkit: mingfx::Color Class Reference + + + + + + + + + + + + +
+
+ + + + + + +
+
MinGfx Toolkit +  1.0 +
+
A minimal library for writing cross-platform (Windows, OSX, linux) graphics programs.
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
mingfx::Color Class Reference
+
+
+

Detailed Description

+

Represents a 4-component (R,G,B,A) color, stored internally in a float array to be compatable with OpenGL.

+

Example usage:

Color black(0, 0, 0);
+
Color white(1, 1, 1);
+
Color gray(0.5, 0.5, 0.5);
+
Color tranparent_red(1.0, 0.0, 0.0, 0.5);
+
Color orange(1.0, 0.65, 0.0);
+
+
float red_component_of_orange = orange[0];
+
float green_component_of_orange = orange[1];
+
float blue_component_of_orange = orange[2];
+
float alpha_component_of_orange = orange[3];
+
+
// Use value_ptr() to send the array of floats directly to OpenGL commands
+
glColor4fv(orange.value_ptr());
+
Color()
Defaults to black.
+
+

Definition at line 41 of file color.h.

+
+

#include <color.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Color ()
 Defaults to black. More...
 
 Color (float red, float green, float blue, float alpha=1.0)
 Constructs a color. Alpha defaults to 1.0 (completely opaque) More...
 
 Color (float *p)
 Constructs a point given a pointer to float array. More...
 
 Color (const std::vector< float > &vals)
 Constructs a point given a 3 or 4-element vector of floats. More...
 
 Color (const Color &p)
 Copy constructor. More...
 
virtual ~Color ()
 Color destructor. More...
 
bool operator== (const Color &p) const
 Check for equality. More...
 
bool operator!= (const Color &p) const
 Check for inequality. More...
 
Coloroperator= (const Color &p)
 Assignment operator. More...
 
float operator[] (const int i) const
 Accesses the ith component of the color, stored in RGBA order. More...
 
float & operator[] (const int i)
 Accesses the ith coordinate of the color, stored in RGBA order. More...
 
const float * value_ptr () const
 Returns a const pointer to the raw data array. More...
 
std::vector< float > ToVector () const
 
Color Lerp (const Color &b, float alpha) const
 Linear interpolation between this color and another. Alpha=0.0 returns this color, and alpha=1.0 returns the other color, other values blend between the two via a linear interpolation on each color channel. More...
 
+ + + + +

+Static Public Member Functions

static Color Lerp (const Color &a, const Color &b, float alpha)
 Linear interpolation between two colors. Alpha=0.0 returns 'a' and alpha=1.0 returns 'b', other values blend between the two via a linear interpolation on each color channel. More...
 
+

Constructor & Destructor Documentation

+ +

◆ Color() [1/5]

+ +
+
+ + + + + + + +
mingfx::Color::Color ()
+
+ +

Defaults to black.

+ +
+
+ +

◆ Color() [2/5]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
mingfx::Color::Color (float red,
float green,
float blue,
float alpha = 1.0 
)
+
+ +

Constructs a color. Alpha defaults to 1.0 (completely opaque)

+ +
+
+ +

◆ Color() [3/5]

+ +
+
+ + + + + + + + +
mingfx::Color::Color (float * p)
+
+ +

Constructs a point given a pointer to float array.

+ +
+
+ +

◆ Color() [4/5]

+ +
+
+ + + + + + + + +
mingfx::Color::Color (const std::vector< float > & vals)
+
+ +

Constructs a point given a 3 or 4-element vector of floats.

+ +
+
+ +

◆ Color() [5/5]

+ +
+
+ + + + + + + + +
mingfx::Color::Color (const Colorp)
+
+ +

Copy constructor.

+ +
+
+ +

◆ ~Color()

+ +
+
+ + + + + +
+ + + + + + + +
virtual mingfx::Color::~Color ()
+
+virtual
+
+ +

Color destructor.

+ +
+
+

Member Function Documentation

+ +

◆ Lerp() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static Color mingfx::Color::Lerp (const Colora,
const Colorb,
float alpha 
)
+
+static
+
+ +

Linear interpolation between two colors. Alpha=0.0 returns 'a' and alpha=1.0 returns 'b', other values blend between the two via a linear interpolation on each color channel.

+ +
+
+ +

◆ Lerp() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + +
Color mingfx::Color::Lerp (const Colorb,
float alpha 
) const
+
+ +

Linear interpolation between this color and another. Alpha=0.0 returns this color, and alpha=1.0 returns the other color, other values blend between the two via a linear interpolation on each color channel.

+ +
+
+ +

◆ operator!=()

+ +
+
+ + + + + + + + +
bool mingfx::Color::operator!= (const Colorp) const
+
+ +

Check for inequality.

+ +
+
+ +

◆ operator=()

+ +
+
+ + + + + + + + +
Color& mingfx::Color::operator= (const Colorp)
+
+ +

Assignment operator.

+ +
+
+ +

◆ operator==()

+ +
+
+ + + + + + + + +
bool mingfx::Color::operator== (const Colorp) const
+
+ +

Check for equality.

+ +
+
+ +

◆ operator[]() [1/2]

+ +
+
+ + + + + + + + +
float& mingfx::Color::operator[] (const int i)
+
+ +

Accesses the ith coordinate of the color, stored in RGBA order.

+ +
+
+ +

◆ operator[]() [2/2]

+ +
+
+ + + + + + + + +
float mingfx::Color::operator[] (const int i) const
+
+ +

Accesses the ith component of the color, stored in RGBA order.

+ +
+
+ +

◆ ToVector()

+ +
+
+ + + + + + + +
std::vector<float> mingfx::Color::ToVector () const
+
+ +
+
+ +

◆ value_ptr()

+ +
+
+ + + + + + + +
const float* mingfx::Color::value_ptr () const
+
+ +

Returns a const pointer to the raw data array.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + + -- cgit v1.2.3