avr/animation/animation.h

27 lines
775 B
C
Raw Normal View History

#ifndef __ANIMATION_H__
#define __ANIMATION_H__
// line_t provides a simplified implementation of Bresenham's line drawing
// technique. At this time, it assumes a transition of x = 0 -> 60, and a dy
// between -59 and 59. I am not sure I understand Bresenham's algorithm yet,
// but I'll need to revisit all of this if I want to expand the boundaries.
2022-07-18 03:01:27 +00:00
typedef struct {
int y;
int de;
int error;
int inc;
int dt;
int dy;
} time_line_t;
// Construct a new line object. x1 must be greater than x0, and dy must be less than dx.
2022-07-18 03:01:27 +00:00
time_line_t time_line_new(int, int, int, int);
// Calculate the next y value of the line.
2022-07-18 03:01:27 +00:00
int time_line_next(time_line_t *);
// Diagnostic printout of the current state of line_t.
// void line_print(line_t *line);
#endif