Commit Graph

11 Commits

Author SHA1 Message Date
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Jeff Epler f224ed1848 OnDiskBitmap: Correct handling of "0 color palette" images
Microsoft documentation says:

> If biCompression equals BI_RGB and the bitmap uses 8 bpp or less, the bitmap has a color table immediatelly following the BITMAPINFOHEADER structure. The color table consists of an array of RGBQUAD values. The size of the array is given by the biClrUsed member. If biClrUsed is zero, the array contains the maximum number of colors for the given bitdepth; that is, 2^biBitCount colors.

Formerly, we treated 0 colors as "no image palette" during construction,
but then during common_hal_displayio_ondiskbitmap_get_pixel indexed into
the palette anyway.  This could have unpredictable results.  On a pygamer,
it gave an image that was blue and black.  On magtag, it gave a crash.
2020-12-17 10:54:37 -06:00
Scott Shawcroft 72e7ffa324
More cleanup 2019-08-22 16:16:09 -07:00
Scott Shawcroft 70680d5b22
EPaper displays work mostly. 2019-08-22 14:08:33 -07:00
Scott Shawcroft c372567330
Fix off by one error in OnDiskBitmap
It resulted in the first row of pixels being pulled for out of bounds.

Fixes #1801
2019-04-17 15:17:11 -07:00
Bryan Siepert 76dc8e1ac8 fixed typo 2019-03-01 07:32:46 -08:00
Bryan Siepert 014595bff5 fixed whitespace, clarified variable name, and updated error messages 2019-03-01 07:17:50 -08:00
Bryan Siepert 398c7060f8 added monochrome, 8bpp indexed, and 32bpp ARGB BMPs 2019-02-28 23:08:12 -08:00
Bryan Siepert b81072e750 (fork rebuild) Initial support for 16bpp 555&565 and 8bpp grayscale bitmaps 2019-02-23 10:58:46 -08:00
Bryan Siepert ab2ad7ba45 adding height and width to OnDiskBitmap for #1460 2019-01-20 22:33:22 -08:00
Scott Shawcroft f21cf15c38
Add OnDiskBitmap which loads pixel data straight from disk.
Also, renamed Sprite's palette to pixel_shader so it can be
anything that produces colors based on values (including color values).
Added a ColorConverter that converts RGB888 (found in bitmaps) to
RGB565 for the display.

Fixes #1182
2018-09-12 15:25:59 -07:00