Task

Using the data storage type defined on the Bitmap page for raster graphics images,

draw a line given two points with Bresenham's line algorithm.




ppm:=PPM(200,200,0xFF|FF|FF);
ppm.line(50,100,  100,190, 0);
ppm.line(100,190, 150,100, 0);
ppm.line(150,100, 100,10,  0);
ppm.line(100,10,  50,100,  0);
 
ppm.writeJPGFile("line.jpg");