summaryrefslogtreecommitdiff
path: root/include/morpher/morphing.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/morpher/morphing.h')
-rw-r--r--include/morpher/morphing.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/include/morpher/morphing.h b/include/morpher/morphing.h
new file mode 100644
index 0000000..028cd87
--- /dev/null
+++ b/include/morpher/morphing.h
@@ -0,0 +1,58 @@
1#ifndef UPEM_MORPHING_MORPHING
2#define UPEM_MORPHING_MORPHING
3
4/**
5 * File: morphing.h
6 * Coordinate mapping for morphing transforms.
7 */
8
9#include "common/geom.h"
10#include "common/time.h"
11#include "morpher/trianglemap.h"
12
13/**
14 * Struct: Morphing
15 * Represents an abstract coordinate transform from a source to a destination coordinate matrix,
16 * constrained by a given set of points.
17 *
18 * Fields:
19 * dim - dimension in pixels
20 * *first - the first triangle in the linked list
21 * *center - the center triangle
22 */
23typedef struct {
24 CartesianVector dim;
25 TriangleMap *first, *center;
26} Morphing;
27
28/**
29 * Function: morphing_init
30 * Initialises a morphing.
31 *
32 * Parameters:
33 * width - coordinate matrix width in pixels
34 * height - coordinate matrix height in pixels
35 */
36Morphing *morphing_create(IntVector width, IntVector height);
37
38/**
39 * Function: morphing_free
40 * Frees any resources allocated to a morphing.
41 *
42 * Parameters:
43 * *m - pointer to the morphing to destroy
44 */
45void morphing_destroy(Morphing *m);
46
47/**
48 * Function: morphing_add_constraint
49 * Adds a constraint point to a morphing.
50 *
51 * Parameters:
52 * *m - pointer to the morphing to alter
53 * origin - constraint point coordinates on the origin matrix
54 * destination - constraint point coordinates on the target matrix
55 */
56void morphing_add_constraint(Morphing *m, CartesianVector origin, CartesianVector destination);
57
58#endif