Bitmap/Bresenham's line algorithm: Difference between revisions
m
→{{header|11l}}: BVec3
(Added Easylang) |
Alextretyak (talk | contribs) m (→{{header|11l}}: BVec3) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 10:
{{trans|Python}}
<syntaxhighlight lang="11l">T Colour = BVec3
V black = Colour(0, 0, 0)
Line 109 ⟶ 100:
+-----------------+
</pre>
=={{header|360 Assembly}}==
{{trans|Rexx}}
Line 2,836 ⟶ 2,828:
This GUI implementation is for use with [http://miniscript.org/MiniMicro Mini Micro].
<syntaxhighlight lang="miniscript">
return -1
dy = abs(y2 - y1)▼
end function
er = -dy▼
sy = sign(y0, y1)
if dx > dy then
err = dx
else
end if
err = floor(err / 2)
while true
if
e2 =
if e2 > -dx then
end if
if e2 < dy then
end if
end while
end function
img= Image.create(320, 320)
drawLine img, 0, 0, 250, 300, color.red
gfx.clear
gfx.drawImage img, 0, 0
</syntaxhighlight>
Line 4,320 ⟶ 4,328:
{{libheader|DOME}}
Requires version 1.3.0 of DOME or later.
<syntaxhighlight lang="
import "dome" for Window
Line 4,377 ⟶ 4,385:
static draw(alpha) {}
}</syntaxhighlight>
=={{header|XPL0}}==
Bresenham line draw is built-in.
|