GithubHelp home page GithubHelp logo

Comments (3)

BoringCat avatar BoringCat commented on September 21, 2024

加上 display() 和 getbuffer() 的性能优化方案

  • 屏幕:5.83inch e-Paper HAT
    def display(self, image):
        imwidth, imheight = image.size
        image_monocolor = image.convert('1')
        logging.debug('imwidth = %d  imheight =  %d ',imwidth, imheight)
        if(imwidth == self.width and imheight == self.height):
            pixels = image_monocolor.getdata()
        elif(imwidth == self.height and imheight == self.width):
            pixels = image_monocolor.rotate(90, expand=True).getdata()
        else:
            pixels = image_monocolor.resize((self.width,self.height)).getdata()
        buf = [ (pixels[i]>>6<<4) + (pixels[i+1]>>6) for i in range(0, len(pixels), 2)]
        self.send_command(0x10)
        self.send_datas(buf)
        self.send_command(0x12)
        epdconfig.delay_ms(100)
        self.ReadBusy()

from e-paper.

hnwangkg-ezio avatar hnwangkg-ezio commented on September 21, 2024

这个是很好的点子,等疫情过去,我到公司测试一遍

from e-paper.

CodeGueas avatar CodeGueas commented on September 21, 2024

ReadBusy 耗时是由硬件决定的吗?

from e-paper.

Related Issues (20)

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.