summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/blender/blender.h26
-rw-r--r--include/painter/rasterizer.h41
2 files changed, 41 insertions, 26 deletions
diff --git a/include/blender/blender.h b/include/blender/blender.h
deleted file mode 100644
index 26ff802..0000000
--- a/include/blender/blender.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef UPEM_MORPHING_BLENDER
2#define UPEM_MORPHING_BLENDER
3
4/**
5 * File: blender.h
6 * Will it blend? That is the question.
7 */
8
9#include "common/time.h"
10#include "blender/canvas.h"
11#include "morpher/morphing.h"
12
13/**
14 * Function: blender_blend_canvas
15 * Blends two canvas by applying the given morphing at the requested time frame.
16 *
17 * Parameters:
18 * *canvas - pointer to the canvas to paint
19 * *source - source image
20 * *target - target image
21 * *morphing - morphing transform to apply
22 * frame - the interpolation distance from the origin canvas [0;1]
23 */
24void blender_blend_canvas(Canvas *canvas, Canvas *source, Canvas *target, Morphing *morphing, TimeVector frame);
25
26#endif
diff --git a/include/painter/rasterizer.h b/include/painter/rasterizer.h
new file mode 100644
index 0000000..204d616
--- /dev/null
+++ b/include/painter/rasterizer.h
@@ -0,0 +1,41 @@
1#ifndef UPEM_MORPHING_RASTERIZER
2#define UPEM_MORPHING_RASTERIZER
3
4/**
5 * File: rasterizer.h
6 */
7
8#include "painter/canvas.h"
9#include "morpher/morphing.h"
10
11/**
12 * Struct: RasterizationContext
13 */
14typedef struct {
15 Canvas *result, *source, *target;
16 TimeVector frame;
17} RasterizationContext;
18
19/**
20 * Struct: TriangleContext
21 */
22typedef struct {
23 Triangle current, source, target;
24} TriangleContext;
25
26/**
27 * Function: rasterize
28 * Rasterises a morphing from a source and a target image at the given time frame.
29 *
30 * Parameters:
31 * *source - source image canvas
32 * *target - target image canvas
33 * *m - reference morphing
34 * frame - time frame
35 *
36 * Returns:
37 * The drawn canvas, dynamically allocated
38 */
39Canvas *rasterize(Canvas *source, Canvas *target, Morphing *m, TimeVector frame);
40
41#endif