naev
0.11.5
src
colour.h
1
/*
2
* See Licensing and Copyright notice in naev.h
3
*/
4
#pragma once
5
7
#include "glad.h"
13
typedef
struct
glColour_
{
14
GLfloat
r
;
15
GLfloat
g
;
16
GLfloat
b
;
17
GLfloat
a
;
18
} __attribute__((packed)) glColour;
19
20
/*
21
* default colours
22
*/
23
#include "colours.gen.h"
24
25
#define COL_ALPHA( col, alpha ) \
26
{ .r = (col).r, .g = (col).g, .b = (col).b, .a = alpha }
27
28
/*
29
* Colour space conversion routines.
30
*/
31
__attribute__((
const
)) double linearToGamma(
double
x );
32
__attribute__((const))
double
gammaToLinear(
double
x );
33
void
col_linearToGamma( glColour *
c
);
34
void
col_gammaToLinear( glColour *
c
);
35
void
col_hsv2rgb( glColour *
c
,
float
h,
float
s,
float
v );
36
void
col_rgb2hsv(
float
*h,
float
*s,
float
*v,
float
r,
float
g,
float
b );
37
void
col_blend( glColour *blend, const glColour *fg, const glColour *bg,
float
alpha );
c
static const double c[]
Definition
rng.c:264
glColour_
represents a colour via its RGBA values.
Definition
colour.h:13
glColour_::r
GLfloat r
Definition
colour.h:14
glColour_::g
GLfloat g
Definition
colour.h:15
glColour_::a
GLfloat a
Definition
colour.h:17
glColour_::b
GLfloat b
Definition
colour.h:16
Generated by
1.12.0