Git Product home page Git Product logo

adafruit_circuitpython_gfx's Introduction

Introduction

Documentation Status

Discord

Build Status

Code Style: Black

CircuitPython pixel graphics drawing library.

Important: This library will likely be deprecated soon. If you are looking to use a specific display, search the product name (i.e. ssd1322 or ili9341) at https://github.com/adafruit/, or find it in the circuitpython bundle.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Usage Example

See example in /examples/gfx_simpletest.py

Most displays now use displayio. You can find simpletests for specific displays in their respective repositories or in the examples section of the circuitpython bundle

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Documentation

For information on building library documentation, please check out this guide.

adafruit_circuitpython_gfx's People

Contributors

dhalbert avatar evaherrada avatar foamyguy avatar jposada202020 avatar kattni avatar kschinck avatar lucashadfield avatar makermelissa avatar peter-l5 avatar siddacious avatar sommersoft avatar tannewt avatar tekktrik avatar tg-techie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_circuitpython_gfx's Issues

Possible bug in fill_triangle() method

The fill_triangle method seems to be drawing triangles incorrectly around the middle vertex (in the vertical direction). This appears to be related to the method drawing a horizontal line with the same y co-ordinate twice at the level of the middle vertex. The behaviour happens because the final value of the loop variable y in the loop used to fill the top part of the triangle is repeated for the first line used to fill the bottom part of the triangle. The code from the two loops is below for reference.

The images below illustrate the issue around the middle vertex.

I have developed and tested a fix for this employed in the repository framebuf2 and will post it here as a pull request separately in the next day or two. While I realise that this library is due to be deprecated soon, I figure it may still be worthwhile to fix it.

        for y in range(y0, last + 1):
            a = x0 + sa // dy01
            b = x0 + sb // dy02
            sa += dx01
            sb += dx02
            if a > b:
                a, b = b, a
            self.hline(a, y, b - a + 1, *args, **kwargs)
        sa = dx12 * (y - y1)
        sb = dx02 * (y - y0)
        while y <= y2:
            a = x1 + sa // dy12
            b = x0 + sb // dy02
            sa += dx12
            sb += dx02
            if a > b:
                a, b = b, a
            self.hline(a, y, b - a + 1, *args, **kwargs)
            y += 1

fill_triangle_issue1
fill_triangle_issue2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.