MCPcopy Create free account
hub / github.com/Image-Py/imagepy / scan

Function scan

imagepy/core/draw/polygonfill.py:14–22  ·  view source on GitHub ↗
(polys, idx, ys, st, y, cur, buf)

Source from the content-addressed store, hash-verified

12 return round((p1[0]+k*p2[0])/(1+k),4)
13
14def scan(polys, idx, ys, st, y, cur, buf):
15 while cur<len(idx) and ys[st[cur]]<=y:
16 c = idx[st[cur]]
17 poly = polys[c[0]]
18 for i in (c[0], (c[1]-1)%len(poly)), tuple(c):
19 if i in buf:buf.remove(i)
20 else: buf.append(i)
21 cur += 1
22 return cur
23
24def roots(polys, buf, y):
25 rs = []

Callers 1

fillFunction · 0.85

Calls 2

appendMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected