{ "info": { "author": "Petr Viktorin", "author_email": "encukou@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries" ], "description": "The bresenham module\n====================\n\nA simple implementation of Bresenham's line drawing algorithm.\n\nSee `the Wikipedia entry`_ for details on what that is.\n\n.. _the Wikipedia entry: https://en.wikipedia.org/wiki/Bresenham's_line_algorithm\n\nNote that this is a simple implementation.\nIt is written in Pure Python (without e.g. `numpy`), so it is relatively slow.\n\nI found some beauty in combining the classic algorithm (whose ingenuity lies in\nusing only integers \u2013 a constraint that isn't really as relevant now)\nwith a Python generator (a modern device that follows the spirit of\n\u201cexecutable pseudocode\u201d, abstracting away the output subroutine).\nI hope others can appreciate the code as well.\n\nFor serious use, look at these:\n\n* `skimage.draw.line`_, which solves the same problem *fast*.\n* A `Numpy-based recipe`_ that generalizes the solution to N\n dimensions.\n\n.. _`skimage.draw.line`: http://scikit-image.org/docs/dev/api/skimage.draw.html#skimage.draw.line\n.. _`Numpy-based recipe`: http://code.activestate.com/recipes/578112-bresenhams-line-algorithm-in-n-dimensions/\n\n\nInstallation\n============\n\nIn a Python virtual environment, do::\n\n python -m pip install bresenham\n\nTo install from a Git checkout (in editable mode)::\n\n python -m pip install -e.\n\nTo install without a virtual envitonment, add the ``--user`` option.\n\n\nUsage\n=====\n\nThe ``bresenham(x0, y0, x1, y1)`` function returns a generator of\nthe coordinates of the line from ``(x0, y0)`` to ``(x1, y1)``.\n\nFor example, the coordinates of a line from (-1, -4) to (3, 2), are::\n\n >>> from bresenham import bresenham\n\n >>> list(bresenham(-1, -4, 3, 2))\n [(-1, -4), (0, -3), (0, -2), (1, -1), (2, 0), (2, 1), (3, 2)]\n\n\nDevelopment\n===========\n\nYou're welcome to join this project!\n\nIf you spot an issue, please report it at the `Issues page`_ on Github.\n\nIf you'd like to start changing the code or documentation, check out the code\nlocally using::\n\n git clone https://github.com/encukou/bresenham\n\nIf you're new to this, please read the `this guide`_ about collaborating\non Github-hosted projects like this one.\n\nIf that doesn't make sense, please `e-mail the author `_\nfor clarification. I'd be happy to help you get started.\n\n.. _Issues page: https://github.com/encukou/bresenham/issues\n.. _this guide: https://guides.github.com/activities/contributing-to-open-source/\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/encukou/bresenham", "keywords": "bresenham,pixel art", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "bresenham", "package_url": "https://pypi.org/project/bresenham/", "platform": "", "project_url": "https://pypi.org/project/bresenham/", "project_urls": { "Homepage": "https://github.com/encukou/bresenham" }, "release_url": "https://pypi.org/project/bresenham/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "An implementation of Bresenham's line drawing algorithm", "version": "0.2.1" }, "last_serial": 4825517, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ff97a7ebdee4348a870e0b226265b396", "sha256": "2f63f4b3af628163acc89e6a1752fc51d5129004b464fabb5d9060d7b18d4d7c" }, "downloads": -1, "filename": "bresenham-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ff97a7ebdee4348a870e0b226265b396", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2741, "upload_time": "2016-11-23T22:06:30", "url": "https://files.pythonhosted.org/packages/3a/4a/51bcac256c7c7c36c07830f9e0aad820f2957212678728117e82374b3d7c/bresenham-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c8cd462a1d3fd2dc9b7b980ecab09260", "sha256": "223e1fbdb652ac7460d413d3661500fd0094a8852c745561d64242dccd8cd474" }, "downloads": -1, "filename": "bresenham-0.1.tar.gz", "has_sig": false, "md5_digest": "c8cd462a1d3fd2dc9b7b980ecab09260", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2226, "upload_time": "2016-11-23T22:06:33", "url": "https://files.pythonhosted.org/packages/1d/2f/3e5184417ca80da149530618e300b09bbcfa62c812398d007e1ea1a572de/bresenham-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "1354b30247deb35fafbec4a0582f34b4", "sha256": "b1b8e6fd249aeea67aee40bf1493cf7d5aa0cf5bf4e6580ceb3e3cb48d52be0e" }, "downloads": -1, "filename": "bresenham-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "1354b30247deb35fafbec4a0582f34b4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4091, "upload_time": "2018-02-11T17:36:35", "url": "https://files.pythonhosted.org/packages/49/29/e78370a55a5f25a21af7545ac34f944feb1f5fed2000d096d2345aa35bb8/bresenham-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e20448feb10d56990cb1b135d28ea554", "sha256": "ac1db3268fc1adb73db090a5bd57193b534cfc1584c375a87353e6ae7272ce4a" }, "downloads": -1, "filename": "bresenham-0.2.tar.gz", "has_sig": false, "md5_digest": "e20448feb10d56990cb1b135d28ea554", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3098, "upload_time": "2018-02-11T17:36:37", "url": "https://files.pythonhosted.org/packages/7f/2e/05fb17075327319f11ab8f8641de2ecded4f8640b7435b5ee9a8400b8e60/bresenham-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "fcd47129040882327ed805a238275cc4", "sha256": "c076b8bf730adb65cc5037d26639a5629dd63f6c1481d80b6856c99d47a1c6bf" }, "downloads": -1, "filename": "bresenham-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "fcd47129040882327ed805a238275cc4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3682, "upload_time": "2019-02-15T15:30:34", "url": "https://files.pythonhosted.org/packages/71/db/b614ac2ef531a4ea5402342db8630f4842388fb86e4640c81b0e23b16d64/bresenham-0.2.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fcd47129040882327ed805a238275cc4", "sha256": "c076b8bf730adb65cc5037d26639a5629dd63f6c1481d80b6856c99d47a1c6bf" }, "downloads": -1, "filename": "bresenham-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "fcd47129040882327ed805a238275cc4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3682, "upload_time": "2019-02-15T15:30:34", "url": "https://files.pythonhosted.org/packages/71/db/b614ac2ef531a4ea5402342db8630f4842388fb86e4640c81b0e23b16d64/bresenham-0.2.1-py3-none-any.whl" } ] }