[SciPy-User] Bresenham algorithm?
Sturla Molden
sturla at molden.no
Tue Sep 22 02:55:17 EDT 2009
Sturla Molden skrev:
> @cython.boundscheck(False)
> @cython.wraparound(False)
> def bresenham(int x, int y, int x2, int y2):
>
> cdef np.ndarray[np.int32_t, ndim=2, mode="c"] coords
>
> cdef int steep = 0
> cdef int dx = abs(x2 - x)
> cdef int dy = abs(y2 - y)
> cdef int sx, sy, d, i
>
> coords = np.zeros(dx, dtype=np.int32)
>
Oops...
coords = np.zeros((int(dx),2), dtype=np.int32)
S.M
More information about the SciPy-User
mailing list