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
584 stars 180 forks source link

Uc8151 Improvements DrawBitmap and DrawBuffer #680

Open conejoninja opened 1 month ago

deadprogram commented 1 month ago

@conejoninja please rebase against latest dev. Thanks!

conejoninja commented 1 month ago

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

deadprogram commented 1 month ago

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

That was perfect. :+1:

aykevl commented 1 month ago

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

conejoninja commented 1 month 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 1 month 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 1 month 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.