From 1a5cebf48d76b7be5ab87c6d9e3c856456372b55 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 2 Dec 2017 20:35:27 +0100 Subject: Impl. morpher stub Signed-off-by: pacien --- include/morpher/morpher.h | 19 +++++++++++++++++-- src/morpher/morpher.c | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/morpher/morpher.c 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 @@ */ #include "common/geom.h" +#include "common/time.h" /** * Type: Morphing * Represents an abstract coordinate transform from a source to a destination coordinate matrix, * constrained by a given set of points. */ -typedef void *Morphing; +typedef struct { + CartesianVector dim; +} Morphing; /** * Function: morpher_init @@ -31,7 +34,7 @@ void morpher_init(Morphing *morphing, IntVector width, IntVector height); * Frees any resources allocated to a morphing. * * Parameters: - * *morphin* - pointer to the morphing to destroy + * *morphing - pointer to the morphing to destroy */ void morpher_free(Morphing *morphing); @@ -61,4 +64,16 @@ void morpher_add_constraint(Morphing *morphing, CartesianVector origin, Cartesia */ CartesianMapping morpher_get_point_mapping(Morphing *morphing, CartesianVector point, TimeVector frame); +/** + * Function: morpher_get_dim + * Returns the dimension of the morphing. + * + * Parameters: + * *morphing - the morphing + * + * Returns: + * the dimension as a vector + */ +CartesianVector morpher_get_dim(Morphing *morphing); + #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 @@ +#include "morpher/morpher.h" + +void morpher_init(Morphing *morphing, IntVector width, IntVector height) { + morphing->dim = (CartesianVector) {width, height}; +} + +void morpher_free(Morphing *morphing) { + +} + +void morpher_add_constraint(Morphing *morphing, CartesianVector origin, CartesianVector destination) { + +} + +CartesianMapping morpher_get_point_mapping(Morphing *morphing, CartesianVector point, TimeVector frame) { + // TODO + return (CartesianMapping) {point, + point}; +} + +CartesianVector morpher_get_dim(Morphing *morphing) { + return morphing->dim; +} -- cgit v1.2.3