summaryrefslogtreecommitdiff
path: root/include/painter/rasterizer.h
blob: 6859cb596bff371b4a0ffc659eb44281a9b7d294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef UPEM_MORPHING_RASTERIZER
#define UPEM_MORPHING_RASTERIZER

/**
 * File: rasterizer.h
 * > Everyday is a good day when you paint.
 * -- Bob Ross
 */

#include "painter/canvas.h"
#include "morpher/morphing.h"

/**
 * Struct: RasterizationContext
 */
typedef struct {
  Canvas *result, *source, *target;
  TimeVector frame;
} RasterizationContext;

/**
 * Struct: TriangleContext
 */
typedef struct {
  Triangle current, source, target;
} TriangleContext;

/**
 * Function: rasterize
 * Rasterises a morphing from a source and a target image at the given time frame.
 *
 * Parameters:
 *   *source - source image canvas
 *   *target - target image canvas
 *   *m      - reference morphing
 *   frame   - time frame
 *
 * Returns:
 *   The drawn canvas, dynamically allocated
 */
Canvas *rasterize(Canvas *source, Canvas *target, Morphing *m, TimeVector frame);

#endif