Working version of AGG for lines. Use two different templates for 3 and 4 byte pixels