diff options
author | pacien | 2017-12-28 01:23:08 +0100 |
---|---|---|
committer | pacien | 2017-12-28 01:23:08 +0100 |
commit | 330fd85db8c89c178621d978929d911bbe93fec7 (patch) | |
tree | b47e049846b10641776af8ea3673ab61dd2d4d45 /include/painter | |
parent | 190449ee18bec69b2e385dccd9bd42ddc83dd418 (diff) | |
download | morpher-330fd85db8c89c178621d978929d911bbe93fec7.tar.gz |
Refactor canvas blender into rasterizer
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'include/painter')
-rw-r--r-- | include/painter/rasterizer.h | 41 |
1 files changed, 41 insertions, 0 deletions
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 | */ | ||
14 | typedef struct { | ||
15 | Canvas *result, *source, *target; | ||
16 | TimeVector frame; | ||
17 | } RasterizationContext; | ||
18 | |||
19 | /** | ||
20 | * Struct: TriangleContext | ||
21 | */ | ||
22 | typedef 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 | */ | ||
39 | Canvas *rasterize(Canvas *source, Canvas *target, Morphing *m, TimeVector frame); | ||
40 | |||
41 | #endif | ||