GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
M_COLOR(3) FreeBSD Library Functions Manual M_COLOR(3)

M_Color
Agar-Math color structure

#include <agar/math.h>

The M_Color structure describes a color in terms of RGB values and an alpha component. It is defined as:
#ifdef HAVE_SSE
typedef union m_color {
	__m128 m128;
	struct { float r, g, b, a; };
} M_Color;
#else
typedef struct m_color {
	M_Real r, g, b, a;
} M_Color;
#endif

Notice that SIMD extensions force single-precision floats, regardless of the precision for which Agar-Math was built.

M_Color
M_ColorRGB(M_Real r, M_Real g, M_Real b);


M_Color
M_ColorRGBA(M_Real r, M_Real g, M_Real b, M_Real a);


M_Color
M_ColorHSV(M_Real hue, M_Real saturation, M_Real value);


M_Color
M_ColorHSVA(M_Real hue, M_Real saturation, M_Real value, M_Real a);


M_Color
M_ColorBlack(void);


M_Color
M_ColorWhite(void);


M_Color
M_ColorGray(M_Real c);


M_Color
M_ReadColor(AG_DataSource *ds);


void
M_WriteColor(AG_DataSource *ds, const M_Color *C);


void
M_ColorTo4fv(const M_Color *C, float *fv);


void
M_ColorTo4dv(const M_Color *C, double *fv);

The M_ColorRGB() function returns an M_Color structure describing an opaque color composed of the given red, green and blue components. The components are real values ranging from 0.0 to 1.0. M_ColorRGBA() accepts an alpha component as well.

The M_ColorHSV() and M_ColorHSVA() functions return a color specified in terms of hue, saturation and value, all real numbers ranging from 0.0 to 1.0.

M_ColorBlack() returns an opaque black and M_ColorWhite() returns an opaque white. M_ColorGray() returns a shade of gray where c ranges from 0 to 1.0.

The M_ReadColor() and M_WriteColor() functions read or write a color structure from/to an AG_DataSource(3).

M_ColorTo4fv() and M_ColorTo4dv() convert a M_Color structure to an array of 4 float or double, respectively.

AG_DataSource(3), AG_Intro(3)

The M_Color structure first appeared in Agar 1.3.4.
July 13, 2009 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.