tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
622 stars 196 forks source link

Uc8151 Improvements DrawBitmap and DrawBuffer #680

Closed conejoninja closed 3 weeks ago

deadprogram commented 6 months ago

@conejoninja please rebase against latest dev. Thanks!

conejoninja commented 6 months ago

Probably the first time I rebase locally, hope I didn't screw up.

deadprogram commented 6 months ago

Probably the first time I rebase locally, hope I didn't screw up.

That was perfect. :+1:

aykevl commented 6 months ago

DrawBuffer is a new interface, why didn't you use the conventional DrawBitmap interface? (Or even DrawRGBBitmap8)

conejoninja commented 6 months ago

DrawBitmap already exists and it calls d.SetPixel for each pixel, but I already had the buffer with the data in the correct format, should should avoid a bunch of operations if just copy it instead. It's convenient (in my case)

deadprogram commented 6 months ago

DrawBitmap already exists and it calls d.SetPixel for each pixel

Perhaps you would like to improve the implementation of DrawBitmap() instead? :smile_cat:

conejoninja commented 6 months ago

DrawBitmap already exists and it calls d.SetPixel for each pixel

Perhaps you would like to improve the implementation of DrawBitmap() instead? 😸

Not sure if possible or worthy. Each byte of the buffer represent a row of 1x8 pixels. Using arbitrary coordinates x,y (ie not a multiple of 8), size and different rotations could be quite complex.

deadprogram commented 4 weeks ago

Just coming back around to this, since the badger2040 repo is using it.

What should we do?

deadprogram commented 3 weeks ago

@conejoninja I think this PR will no longer be required after our efforts of earlier today.