diff options
author | pacien | 2017-11-28 19:01:51 +0100 |
---|---|---|
committer | pacien | 2017-11-28 19:01:51 +0100 |
commit | 987835afe8fc5d46cb3a6359ec80c9f035e72801 (patch) | |
tree | e93ddebbfc15900f9307df446e420c086f8a2ebd /include/common | |
parent | ac60669cd3a93312f0ff186055e61a5e3fb5fcdd (diff) | |
download | morpher-987835afe8fc5d46cb3a6359ec80c9f035e72801.tar.gz |
Add module spec headers
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'include/common')
-rw-r--r-- | include/common/geom.h | 32 | ||||
-rw-r--r-- | include/common/matrix.h | 34 | ||||
-rw-r--r-- | include/common/time.h | 23 |
3 files changed, 89 insertions, 0 deletions
diff --git a/include/common/geom.h b/include/common/geom.h new file mode 100644 index 0000000..15a1d57 --- /dev/null +++ b/include/common/geom.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef UPEM_MORPHING_GEOM | ||
2 | #define UPEM_MORPHING_GEOM | ||
3 | |||
4 | /** | ||
5 | * File: geom.h | ||
6 | */ | ||
7 | |||
8 | #include <inttypes.h> | ||
9 | |||
10 | /** | ||
11 | * Type: IntVector | ||
12 | * An abstract 1-D vector. | ||
13 | */ | ||
14 | typedef int32_t IntVector; | ||
15 | |||
16 | /** | ||
17 | * Type: CartesianVector | ||
18 | * An abstract 2-D vector in cartesian coordinates. | ||
19 | */ | ||
20 | typedef struct { | ||
21 | IntVector x, y; | ||
22 | } CartesianVector; | ||
23 | |||
24 | /** | ||
25 | * Type: CartesianMapping | ||
26 | * A tuple of cartesian vectors representing a mapping. | ||
27 | */ | ||
28 | typedef struct { | ||
29 | CartesianVector origin, target; | ||
30 | } CartesianMapping; | ||
31 | |||
32 | #endif | ||
diff --git a/include/common/matrix.h b/include/common/matrix.h new file mode 100644 index 0000000..6c35cc0 --- /dev/null +++ b/include/common/matrix.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef UPEM_MORPHING_MATRIX | ||
2 | #define UPEM_MORPHING_MATRIX | ||
3 | |||
4 | /** | ||
5 | * File: matrix.h | ||
6 | * | ||
7 | * See also: | ||
8 | * The film | ||
9 | */ | ||
10 | |||
11 | #include "geom.h" | ||
12 | |||
13 | /** | ||
14 | * Type: IntSquareMatrix | ||
15 | * Represents a square integer matrix. | ||
16 | */ | ||
17 | typedef struct { | ||
18 | IntVector *elements; | ||
19 | IntVector dim; | ||
20 | } IntSquareMatrix; | ||
21 | |||
22 | /** | ||
23 | * Function: matrix_int_det | ||
24 | * Computes and returns the determinant of a square integer matrix. | ||
25 | * | ||
26 | * Parameters: | ||
27 | * *matrix - pointer to input matrix | ||
28 | * | ||
29 | * Returns: | ||
30 | * The integer determinant | ||
31 | */ | ||
32 | IntVector matrix_int_det(IntSquareMatrix *matrix); | ||
33 | |||
34 | #endif | ||
diff --git a/include/common/time.h b/include/common/time.h new file mode 100644 index 0000000..060b7be --- /dev/null +++ b/include/common/time.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef UPEM_MORPHING_TIME | ||
2 | #define UPEM_MORPHING_TIME | ||
3 | |||
4 | /** | ||
5 | * File: time.h | ||
6 | */ | ||
7 | |||
8 | /** | ||
9 | * Type: TimeVector | ||
10 | * An abstract time vector. | ||
11 | */ | ||
12 | typedef float TimeVector; | ||
13 | |||
14 | /** | ||
15 | * Constants: Time vectors | ||
16 | * | ||
17 | * TIME_ORIGIN - the origin of times | ||
18 | * TIME_UNIT - a unit time vector | ||
19 | */ | ||
20 | const TimeVector TIME_ORIGIN = 0; | ||
21 | const TimeVector TIME_UNIT = 1; | ||
22 | |||
23 | #endif | ||