
15 Oct
2006
15 Oct
'06
1:39 a.m.
The next question is, can we make draw_line more generic, and how much more generic (i.e. what kinds of images are possible)
I don't know about AGG but I think a generic draw line approach can be implemented as an image iterator. For each step the iterator would move to the next line's pixel. A line segment is defined by start and end point. The iterator would need to calculate the slope and can then decide what the next pixel is. The underlying algorithm, like Bresenham, might be a policy of the line iterator class. I'm suggesting an iterator since one might to some extra work at each line's pixel. Think about antialiased lines. Christian