diff options
-rw-r--r-- | include/morpher/morpher.h | 19 | ||||
-rw-r--r-- | src/morpher/morpher.c | 23 |
2 files changed, 40 insertions, 2 deletions
diff --git a/include/morpher/morpher.h b/include/morpher/morpher.h index 5bb1ada..1a4bd66 100644 --- a/include/morpher/morpher.h +++ b/include/morpher/morpher.h | |||
@@ -7,13 +7,16 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "common/geom.h" | 9 | #include "common/geom.h" |
10 | #include "common/time.h" | ||
10 | 11 | ||
11 | /** | 12 | /** |
12 | * Type: Morphing | 13 | * Type: Morphing |
13 | * Represents an abstract coordinate transform from a source to a destination coordinate matrix, | 14 | * Represents an abstract coordinate transform from a source to a destination coordinate matrix, |
14 | * constrained by a given set of points. | 15 | * constrained by a given set of points. |
15 | */ | 16 | */ |
16 | typedef void *Morphing; | 17 | typedef struct { |
18 | CartesianVector dim; | ||
19 | } Morphing; | ||
17 | 20 | ||
18 | /** | 21 | /** |
19 | * Function: morpher_init | 22 | * Function: morpher_init |
@@ -31,7 +34,7 @@ void morpher_init(Morphing *morphing, IntVector width, IntVector height); | |||
31 | * Frees any resources allocated to a morphing. | 34 | * Frees any resources allocated to a morphing. |
32 | * | 35 | * |
33 | * Parameters: | 36 | * Parameters: |
34 | * *morphin* - pointer to the morphing to destroy | 37 | * *morphing - pointer to the morphing to destroy |
35 | */ | 38 | */ |
36 | void morpher_free(Morphing *morphing); | 39 | void morpher_free(Morphing *morphing); |
37 | 40 | ||
@@ -61,4 +64,16 @@ void morpher_add_constraint(Morphing *morphing, CartesianVector origin, Cartesia | |||
61 | */ | 64 | */ |
62 | CartesianMapping morpher_get_point_mapping(Morphing *morphing, CartesianVector point, TimeVector frame); | 65 | CartesianMapping morpher_get_point_mapping(Morphing *morphing, CartesianVector point, TimeVector frame); |
63 | 66 | ||
67 | /** | ||
68 | * Function: morpher_get_dim | ||
69 | * Returns the dimension of the morphing. | ||
70 | * | ||
71 | * Parameters: | ||
72 | * *morphing - the morphing | ||
73 | * | ||
74 | * Returns: | ||
75 | * the dimension as a vector | ||
76 | */ | ||
77 | CartesianVector morpher_get_dim(Morphing *morphing); | ||
78 | |||
64 | #endif | 79 | #endif |
diff --git a/src/morpher/morpher.c b/src/morpher/morpher.c new file mode 100644 index 0000000..8bb5427 --- /dev/null +++ b/src/morpher/morpher.c | |||
@@ -0,0 +1,23 @@ | |||
1 | #include "morpher/morpher.h" | ||
2 | |||
3 | void morpher_init(Morphing *morphing, IntVector width, IntVector height) { | ||
4 | morphing->dim = (CartesianVector) {width, height}; | ||
5 | } | ||
6 | |||
7 | void morpher_free(Morphing *morphing) { | ||
8 | |||
9 | } | ||
10 | |||
11 | void morpher_add_constraint(Morphing *morphing, CartesianVector origin, CartesianVector destination) { | ||
12 | |||
13 | } | ||
14 | |||
15 | CartesianMapping morpher_get_point_mapping(Morphing *morphing, CartesianVector point, TimeVector frame) { | ||
16 | // TODO | ||
17 | return (CartesianMapping) {point, | ||
18 | point}; | ||
19 | } | ||
20 | |||
21 | CartesianVector morpher_get_dim(Morphing *morphing) { | ||
22 | return morphing->dim; | ||
23 | } | ||