diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/blender/blender.h | 2 | ||||
-rw-r--r-- | include/morpher/morphing.h | 58 |
2 files changed, 59 insertions, 1 deletions
diff --git a/include/blender/blender.h b/include/blender/blender.h index 8e89208..26ff802 100644 --- a/include/blender/blender.h +++ b/include/blender/blender.h | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | #include "common/time.h" | 9 | #include "common/time.h" |
10 | #include "blender/canvas.h" | 10 | #include "blender/canvas.h" |
11 | #include "morpher/morpher.h" | 11 | #include "morpher/morphing.h" |
12 | 12 | ||
13 | /** | 13 | /** |
14 | * Function: blender_blend_canvas | 14 | * Function: blender_blend_canvas |
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 | */ | ||
23 | typedef 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 | */ | ||
36 | Morphing *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 | */ | ||
45 | void 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 | */ | ||
56 | void morphing_add_constraint(Morphing *m, CartesianVector origin, CartesianVector destination); | ||
57 | |||
58 | #endif | ||