summaryrefslogtreecommitdiff
path: root/include/blender/canvas.h
diff options
context:
space:
mode:
authorpacien2017-11-28 19:01:51 +0100
committerpacien2017-11-28 19:01:51 +0100
commit987835afe8fc5d46cb3a6359ec80c9f035e72801 (patch)
treee93ddebbfc15900f9307df446e420c086f8a2ebd /include/blender/canvas.h
parentac60669cd3a93312f0ff186055e61a5e3fb5fcdd (diff)
downloadmorpher-987835afe8fc5d46cb3a6359ec80c9f035e72801.tar.gz
Add module spec headers
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'include/blender/canvas.h')
-rw-r--r--include/blender/canvas.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/include/blender/canvas.h b/include/blender/canvas.h
new file mode 100644
index 0000000..12f7ce1
--- /dev/null
+++ b/include/blender/canvas.h
@@ -0,0 +1,79 @@
1#ifndef UPEM_MORPHING_CANVAS
2#define UPEM_MORPHING_CANVAS
3
4/**
5 * File: canvas.h
6 *
7 * See also:
8 * Freedom, according to Bob Ross
9 */
10
11#include <MLV_image.h>
12#include "common/geom.h"
13#include "color.h"
14
15/**
16 * Type: Canvas
17 * Represents a fixed size RGBa pixel matrix.
18 */
19typedef struct {
20 MLV_Image mlv;
21} Canvas;
22
23/**
24 * Function: canvas_init
25 * Initialises a canvas of the given size
26 *
27 * Parameters:
28 * *canvas - the canvas to initialise
29 * width - the width in pixels
30 * height - the height in pixels
31 */
32void canvas_init(Canvas *canvas, IntVector width, IntVector height);
33
34/**
35 * Function: canvas_free
36 * Frees all memory allocated to a canvas.
37 *
38 * Parameters:
39 * *canvas - the canvas to destroy
40 */
41void canvas_free(Canvas *canvas);
42
43/**
44 * Function: canvas_set_pixel
45 * Sets the pixel colour at the given coordinates.
46 *
47 * Parameters:
48 * *canvas - the canvas to alter
49 * position - the cartesian coordinates of the pixel to set
50 * color - the new colour to set
51 */
52void canvas_set_pixel(Canvas *canvas, CartesianVector position, Color color);
53
54/**
55 * Function: canvas_get_pixel
56 * Returns the colour of the pixel at the given position.
57 *
58 * Parameters:
59 * *canvas - the base canvas
60 * position - the position in cartesian coordinates
61 *
62 * Returns:
63 * The colour of the requested pixel
64 */
65Color canvas_get_pixel(Canvas *canvas, CartesianVector position);
66
67/**
68 * Function: canvas_get_size
69 * Returns the size (in pixels) of the given canvas.
70 *
71 * Parameters:
72 * *canvas - the canvas
73 *
74 * Returns:
75 * The size of the canvas
76 */
77CartesianVector canvas_get_size(Canvas *canvas);
78
79#endif