summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2017-12-02 20:35:27 +0100
committerpacien2017-12-02 20:35:27 +0100
commit1a5cebf48d76b7be5ab87c6d9e3c856456372b55 (patch)
tree6403cccc877a40bf42f12f6633c04ee8c1b92dab
parent13e28ea7f8b3ed9a68174c7ad89e70659957046b (diff)
downloadmorpher-1a5cebf48d76b7be5ab87c6d9e3c856456372b55.tar.gz
Impl. morpher stub
Signed-off-by: pacien <pacien.trangirard@pacien.net>
-rw-r--r--include/morpher/morpher.h19
-rw-r--r--src/morpher/morpher.c23
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 */
16typedef void *Morphing; 17typedef 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 */
36void morpher_free(Morphing *morphing); 39void morpher_free(Morphing *morphing);
37 40
@@ -61,4 +64,16 @@ void morpher_add_constraint(Morphing *morphing, CartesianVector origin, Cartesia
61 */ 64 */
62CartesianMapping morpher_get_point_mapping(Morphing *morphing, CartesianVector point, TimeVector frame); 65CartesianMapping 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 */
77CartesianVector 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
3void morpher_init(Morphing *morphing, IntVector width, IntVector height) {
4 morphing->dim = (CartesianVector) {width, height};
5}
6
7void morpher_free(Morphing *morphing) {
8
9}
10
11void morpher_add_constraint(Morphing *morphing, CartesianVector origin, CartesianVector destination) {
12
13}
14
15CartesianMapping morpher_get_point_mapping(Morphing *morphing, CartesianVector point, TimeVector frame) {
16 // TODO
17 return (CartesianMapping) {point,
18 point};
19}
20
21CartesianVector morpher_get_dim(Morphing *morphing) {
22 return morphing->dim;
23}