summaryrefslogtreecommitdiff
path: root/include/painter/color.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/painter/color.h')
-rw-r--r--include/painter/color.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/include/painter/color.h b/include/painter/color.h
new file mode 100644
index 0000000..2aeee3e
--- /dev/null
+++ b/include/painter/color.h
@@ -0,0 +1,61 @@
1#ifndef UPEM_MORPHING_COLOR
2#define UPEM_MORPHING_COLOR
3
4/**
5 * File: color.h
6 *
7 * See also:
8 * A rainbow
9 */
10
11#include <MLV/MLV_color.h>
12#include <stdbool.h>
13#include "common/time.h"
14
15/**
16 * Type: ColorComponent
17 * Represents a single colour component of 32-bits RGBa tuple.
18 */
19typedef uint8_t ColorComponent;
20
21/**
22 * Type: ColorPixel
23 * Represents a single RGBa coloured pixel.
24 * Compatible with the libMLV representation.
25 */
26typedef union {
27 struct {
28 ColorComponent a, b, g, r;
29 } rgba;
30
31 MLV_Color mlv;
32} Color;
33
34/**
35 * Function: color_equals
36 * Compares the supplied colors.
37 *
38 * Parameters:
39 * c1 - the first color
40 * c2 - the second color
41 *
42 * Returns:
43 * T(c1 is the same color as c2)
44 */
45bool color_equals(Color c1, Color c2);
46
47/**
48 * Function: color_blend
49 * Blends two colors.
50 *
51 * Parameters:
52 * origin - the first color
53 * target - the second color
54 * distance - the distance from the first color
55 *
56 * Returns:
57 * The blended color
58 */
59Color color_blend(Color origin, Color target, TimeVector distance);
60
61#endif