Jump to content

Bitmap/Bresenham's line algorithm: Difference between revisions

Changed "pixel" to "color" and "Pixel" to "Color" to match "bitmap.nim" interface.
m (Added export mark fro "drawLine".)
(Changed "pixel" to "color" and "Pixel" to "Color" to match "bitmap.nim" interface.)
Line 2,624:
<lang nim>import bitmap
 
proc drawLine*(img: var Image; p, q: Point; pixelcolor: PixelColor) =
let
dx = abs(q.x - p.x)
Line 2,638:
 
while true:
img[p.x, p.y] = pixelcolor
if p == q:
break
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.