diff options
| author | Dan Halbert <halbert@halwitz.org> | 2019-02-24 13:21:54 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-24 13:21:54 -0500 |
| commit | e3606461c516e478af24e1eb5bee8a4ab97eafea (patch) | |
| tree | ff9f48cfece120c782bbe855517a6ba17574c65a | |
| parent | 9888b81bdcaac22563b9cee68ab7d4e317d8c7f4 (diff) | |
| parent | d26ae6f81eef6269eccf87fbddf48fcec23c9e3b (diff) | |
Merge pull request #1558 from siddacious/bmp_bitdepths
initial support for additional bitdepths in OnDiskBitmap
| -rw-r--r-- | locale/ID.po | 11 | ||||
| -rw-r--r-- | locale/circuitpython.pot | 11 | ||||
| -rw-r--r-- | locale/de_DE.po | 88 | ||||
| -rw-r--r-- | locale/en_US.po | 11 | ||||
| -rw-r--r-- | locale/es.po | 16 | ||||
| -rw-r--r-- | locale/fil.po | 16 | ||||
| -rw-r--r-- | locale/fr.po | 16 | ||||
| -rw-r--r-- | locale/it_IT.po | 16 | ||||
| -rw-r--r-- | locale/pt_BR.po | 16 | ||||
| -rw-r--r-- | ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk | 3 | ||||
| -rw-r--r-- | shared-module/displayio/OnDiskBitmap.c | 63 | ||||
| -rw-r--r-- | shared-module/displayio/OnDiskBitmap.h | 5 |
12 files changed, 207 insertions, 65 deletions
diff --git a/locale/ID.po b/locale/ID.po index 7e3a6c798..bfa219222 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-22 15:26-0800\n" +"POT-Creation-Date: 2019-02-23 10:51-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -756,6 +756,11 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Parity ganjil tidak didukung" +#, c-format +msgid "" +"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x" +msgstr "" + msgid "Only 8 or 16 bit mono with " msgstr "Hanya 8 atau 16 bit mono dengan " @@ -770,7 +775,9 @@ msgid "Only slices with step=1 (aka None) are supported" msgstr "" #, c-format -msgid "Only true color (24 bpp or higher) BMP supported %x" +msgid "" +"Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale " +"BMP supported %d" msgstr "" msgid "Only tx supported on UART1 (GPIO2)." diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 226a3a6fa..318adc768 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-22 15:26-0800\n" +"POT-Creation-Date: 2019-02-23 19:57-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -730,6 +730,11 @@ msgstr "" msgid "Odd parity is not supported" msgstr "" +#, c-format +msgid "" +"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x" +msgstr "" + msgid "Only 8 or 16 bit mono with " msgstr "" @@ -744,7 +749,9 @@ msgid "Only slices with step=1 (aka None) are supported" msgstr "" #, c-format -msgid "Only true color (24 bpp or higher) BMP supported %x" +msgid "" +"Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale " +"BMP supported %d" msgstr "" msgid "Only tx supported on UART1 (GPIO2)." diff --git a/locale/de_DE.po b/locale/de_DE.po index 45f2462e4..d9354f01f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-22 15:26-0800\n" +"POT-Creation-Date: 2019-02-23 19:57-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -394,7 +394,8 @@ msgid "Display rotation must be in 90 degree increments" msgstr "Die Rotation der Anzeige muss in 90-Grad-Schritten erfolgen" msgid "Don't know how to pass object to native function" -msgstr "Ich weiß nicht, wie man das Objekt an die native Funktion übergeben kann" +msgstr "" +"Ich weiß nicht, wie man das Objekt an die native Funktion übergeben kann" msgid "Drive mode not used when direction is input." msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." @@ -664,20 +665,25 @@ msgid "Maximum x value when mirrored is %d" msgstr "Maximaler x-Wert beim Spiegeln ist %d" msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "MicroPython-NLR-Sprung ist fehlgeschlagen. Wahrscheinlich Speicherbeschädigung.\n" +msgstr "" +"MicroPython-NLR-Sprung ist fehlgeschlagen. Wahrscheinlich " +"Speicherbeschädigung.\n" msgid "MicroPython fatal error.\n" msgstr "Schwerwiegender MicroPython-Fehler\n" msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "Die Startverzögerung des Mikrofons muss im Bereich von 0,0 bis 1,0 liegen" +msgstr "" +"Die Startverzögerung des Mikrofons muss im Bereich von 0,0 bis 1,0 liegen" msgid "Minimum PWM frequency is 1hz." msgstr "Minimale PWM Frequenz ist %dHz" #, c-format msgid "Multiple PWM frequencies not supported. PWM already set to %dhz." -msgstr "Mehrere PWM Frequenzen werden nicht unterstützt. PWM wurde bereits auf %dHz gesetzt." +msgstr "" +"Mehrere PWM Frequenzen werden nicht unterstützt. PWM wurde bereits auf %dHz " +"gesetzt." msgid "Must be a Group subclass." msgstr "" @@ -742,6 +748,11 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Eine ungerade Parität wird nicht unterstützt" +#, c-format +msgid "" +"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x" +msgstr "" + msgid "Only 8 or 16 bit mono with " msgstr "Nur 8 oder 16 bit mono mit " @@ -750,14 +761,17 @@ msgid "Only Windows format, uncompressed BMP supported %d" msgstr "Nur unkomprimiertes Windows-Format (BMP) unterstützt %d" msgid "Only bit maps of 8 bit color or less are supported" -msgstr "Es werden nur Bitmaps mit einer Farbtiefe von 8 Bit oder weniger unterstützt" +msgstr "" +"Es werden nur Bitmaps mit einer Farbtiefe von 8 Bit oder weniger unterstützt" msgid "Only slices with step=1 (aka None) are supported" msgstr "" #, c-format -msgid "Only true color (24 bpp or higher) BMP supported %x" -msgstr "Es werden nur true color (24 bpp oder höher) BMP unterstützt %x" +msgid "" +"Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale " +"BMP supported %d" +msgstr "" msgid "Only tx supported on UART1 (GPIO2)." msgstr "UART1 (GPIO2) unterstützt nur tx" @@ -767,13 +781,11 @@ msgstr "Oversample muss ein Vielfaches von 8 sein." msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" -"PWM duty_cycle muss zwischen 0 und 65535 (16 Bit Auflösung) liegen" +msgstr "PWM duty_cycle muss zwischen 0 und 65535 (16 Bit Auflösung) liegen" msgid "" "PWM frequency not writable when variable_frequency is False on construction." -msgstr "" -"Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." +msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." #, c-format msgid "PWM not supported on pin %d" @@ -801,7 +813,9 @@ msgid "Plus any modules on the filesystem\n" msgstr "und alle Module im Dateisystem \n" msgid "Press any key to enter the REPL. Use CTRL-D to reload." -msgstr "Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu laden" +msgstr "" +"Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu " +"laden" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." @@ -984,7 +998,9 @@ msgstr "Unbekannter Typ" #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." -msgstr "Nicht übereinstimmende Anzahl von Elementen auf der rechten Seite (erwartet %d, %d erhalten)." +msgstr "" +"Nicht übereinstimmende Anzahl von Elementen auf der rechten Seite (erwartet " +"%d, %d erhalten)." msgid "Unsupported baudrate" msgstr "Baudrate wird nicht unterstützt" @@ -1002,7 +1018,8 @@ msgid "Unsupported pull value." msgstr "Nicht unterstützter Pull-Wert" msgid "Use esptool to erase flash and re-upload Python instead" -msgstr "Benutze das esptool um den flash zu löschen und Python erneut hochzuladen" +msgstr "" +"Benutze das esptool um den flash zu löschen und Python erneut hochzuladen" msgid "Viper functions don't currently support more than 4 arguments" msgstr "Viper-Funktionen unterstützen derzeit nicht mehr als 4 Argumente" @@ -1011,7 +1028,8 @@ msgid "Voice index too high" msgstr "Voice index zu hoch" msgid "WARNING: Your code filename has two extensions\n" -msgstr "WARNUNG: Der Dateiname deines Programms hat zwei Dateityperweiterungen\n" +msgstr "" +"WARNUNG: Der Dateiname deines Programms hat zwei Dateityperweiterungen\n" #, c-format msgid "" @@ -1474,7 +1492,8 @@ msgstr "Funktion vermisst benötigtes Argumente ohne Keyword #%d" #, c-format msgid "function takes %d positional arguments but %d were given" -msgstr "Funktion nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben" +msgstr "" +"Funktion nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben" msgid "function takes exactly 9 arguments" msgstr "Funktion benötigt genau 9 Argumente" @@ -1592,10 +1611,14 @@ msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" msgid "join expects a list of str/bytes objects consistent with self object" -msgstr "join erwartet eine Liste von str/bytes-Objekten, die mit dem self-Objekt übereinstimmen" +msgstr "" +"join erwartet eine Liste von str/bytes-Objekten, die mit dem self-Objekt " +"übereinstimmen" msgid "keyword argument(s) not yet implemented - use normal args instead" -msgstr "Keyword-Argument(e) noch nicht implementiert - verwenden Sie stattdessen normale Argumente" +msgstr "" +"Keyword-Argument(e) noch nicht implementiert - verwenden Sie stattdessen " +"normale Argumente" msgid "keywords must be strings" msgstr "Schlüsselwörter müssen Zeichenfolgen sein" @@ -1622,7 +1645,9 @@ msgid "local '%q' used before type known" msgstr "Lokales '%q' verwendet bevor Typ bekannt" msgid "local variable referenced before assignment" -msgstr "Es wurde versucht auf eine Variable zuzugreifen, die es (noch) nicht gibt. Variablen immer zuerst Zuweisen!" +msgstr "" +"Es wurde versucht auf eine Variable zuzugreifen, die es (noch) nicht gibt. " +"Variablen immer zuerst Zuweisen!" msgid "long int not supported in this build" msgstr "long int wird in diesem Build nicht unterstützt" @@ -1642,7 +1667,8 @@ msgstr "Speicherzuordnung fehlgeschlagen, Zuweisung von %u Bytes" #, c-format msgid "memory allocation failed, allocating %u bytes for native code" -msgstr "Speicherallozierung fehlgeschlagen, alloziere %u Bytes für nativen Code" +msgstr "" +"Speicherallozierung fehlgeschlagen, alloziere %u Bytes für nativen Code" msgid "memory allocation failed, heap is locked" msgstr "Speicherzuweisung fehlgeschlagen, der Heap ist gesperrt" @@ -1782,7 +1808,9 @@ msgstr "ord erwartet ein Zeichen" #, c-format msgid "ord() expected a character, but string of length %d found" -msgstr "ord() erwartet ein Zeichen aber es wurde eine Zeichenfolge mit Länge %d gefunden" +msgstr "" +"ord() erwartet ein Zeichen aber es wurde eine Zeichenfolge mit Länge %d " +"gefunden" msgid "overflow converting long int to machine word" msgstr "" @@ -2029,7 +2057,9 @@ msgid "unicode name escapes" msgstr "" msgid "unindent does not match any outer indentation level" -msgstr "Einrückung entspricht keiner äußeren Einrückungsebene. Bitte Leerzeichen am Zeilenanfang kontrollieren!" +msgstr "" +"Einrückung entspricht keiner äußeren Einrückungsebene. Bitte Leerzeichen am " +"Zeilenanfang kontrollieren!" msgid "unknown config param" msgstr "" @@ -2112,15 +2142,3 @@ msgstr "y Wert außerhalb der Grenzen" msgid "zero step" msgstr "" - -#, c-format -msgid "" -"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%d G:%d B:%d" -msgstr "" - -#, c-format -msgid "" -"Only true color (24 bpp or higher), 16bpp 565 , and 8bpp grayscale BMP " -"supported %x" -msgstr "" - diff --git a/locale/en_US.po b/locale/en_US.po index c6bc8c5af..cb9d85a18 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-22 15:26-0800\n" +"POT-Creation-Date: 2019-02-23 10:51-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -730,6 +730,11 @@ msgstr "" msgid "Odd parity is not supported" msgstr "" +#, c-format +msgid "" +"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x" +msgstr "" + msgid "Only 8 or 16 bit mono with " msgstr "" @@ -744,7 +749,9 @@ msgid "Only slices with step=1 (aka None) are supported" msgstr "" #, c-format -msgid "Only true color (24 bpp or higher) BMP supported %x" +msgid "" +"Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale " +"BMP supported %d" msgstr "" msgid "Only tx supported on UART1 (GPIO2)." diff --git a/locale/es.po b/locale/es.po index 46b9435e5..06a1f10f9 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-22 15:26-0800\n" +"POT-Creation-Date: 2019-02-23 10:51-0800\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -770,6 +770,11 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Paridad impar no soportada" +#, c-format +msgid "" +"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x" +msgstr "" + msgid "Only 8 or 16 bit mono with " msgstr "Solo mono de 8 o 16 bit con " @@ -785,8 +790,10 @@ msgid "Only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" #, c-format -msgid "Only true color (24 bpp or higher) BMP supported %x" -msgstr "Solo color verdadero (24 bpp o superior) BMP admitido %x" +msgid "" +"Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale " +"BMP supported %d" +msgstr "" msgid "Only tx supported on UART1 (GPIO2)." msgstr "Solo tx soportada en UART1 (GPIO2)" @@ -2160,3 +2167,6 @@ msgstr "address fuera de límites" msgid "zero step" msgstr "paso cero" + +#~ msgid "Only true color (24 bpp or higher) BMP supported %x" +#~ msgstr "Solo color verdadero (24 bpp o superior) BMP admitido %x" diff --git a/locale/fil.po b/locale/fil.po index 3dc70c626..0e79f2031 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-22 15:26-0800\n" +"POT-Creation-Date: 2019-02-23 10:51-0800\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy <me@timothygarcia.ca>\n" "Language-Team: fil\n" @@ -768,6 +768,11 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Odd na parity ay hindi supportado" +#, c-format +msgid "" +"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x" +msgstr "" + msgid "Only 8 or 16 bit mono with " msgstr "Tanging 8 o 16 na bit mono na may " @@ -783,8 +788,10 @@ msgid "Only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" #, c-format -msgid "Only true color (24 bpp or higher) BMP supported %x" -msgstr "Dapat true color (24 bpp o mas mataas) BMP lamang ang supportado %x" +msgid "" +"Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale " +"BMP supported %d" +msgstr "" msgid "Only tx supported on UART1 (GPIO2)." msgstr "Tanging suportado ang TX sa UART1 (GPIO2)." @@ -2166,3 +2173,6 @@ msgstr "wala sa sakop ang address" msgid "zero step" msgstr "zero step" + +#~ msgid "Only true color (24 bpp or higher) BMP supported %x" +#~ msgstr "Dapat true color (24 bpp o mas mataas) BMP lamang ang supportado %x" diff --git a/locale/fr.po b/locale/fr.po index 98911d64d..cb81f74ca 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-22 15:26-0800\n" +"POT-Creation-Date: 2019-02-23 10:51-0800\n" "PO-Revision-Date: 2018-12-23 20:05+0100\n" "Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n" "Language-Team: fr\n" @@ -772,6 +772,11 @@ msgstr "" msgid "Odd parity is not supported" msgstr "parité impaire non supportée" +#, c-format +msgid "" +"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x" +msgstr "" + msgid "Only 8 or 16 bit mono with " msgstr "Uniquement 8 ou 16 bit mono avec " @@ -787,8 +792,10 @@ msgid "Only slices with step=1 (aka None) are supported" msgstr "seuls les slices avec 'step=1' (cad None) sont supportées" #, c-format -msgid "Only true color (24 bpp or higher) BMP supported %x" -msgstr "Seul les BMP 24bits ou plus sont supportés %x" +msgid "" +"Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale " +"BMP supported %d" +msgstr "" msgid "Only tx supported on UART1 (GPIO2)." msgstr "Seul le tx est supporté sur l'UART1 (GPIO2)." @@ -2190,3 +2197,6 @@ msgstr "adresse hors limites" msgid "zero step" msgstr "'step' nul" + +#~ msgid "Only true color (24 bpp or higher) BMP supported %x" +#~ msgstr "Seul les BMP 24bits ou plus sont supportés %x" diff --git a/locale/it_IT.po b/locale/it_IT.po index 55c6c065e..83664a146 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-22 15:26-0800\n" +"POT-Creation-Date: 2019-02-23 10:51-0800\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n" "Language-Team: \n" @@ -767,6 +767,11 @@ msgstr "" msgid "Odd parity is not supported" msgstr "operazione I2C non supportata" +#, c-format +msgid "" +"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x" +msgstr "" + msgid "Only 8 or 16 bit mono with " msgstr "" @@ -782,8 +787,10 @@ msgid "Only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" #, c-format -msgid "Only true color (24 bpp or higher) BMP supported %x" -msgstr "Solo BMP true color (24 bpp o superiore) sono supportati %x" +msgid "" +"Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale " +"BMP supported %d" +msgstr "" msgid "Only tx supported on UART1 (GPIO2)." msgstr "Solo tx supportato su UART1 (GPIO2)." @@ -2162,3 +2169,6 @@ msgstr "indirizzo fuori limite" msgid "zero step" msgstr "zero step" + +#~ msgid "Only true color (24 bpp or higher) BMP supported %x" +#~ msgstr "Solo BMP true color (24 bpp o superiore) sono supportati %x" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 6b08dcef0..70e7bde4a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-22 15:26-0800\n" +"POT-Creation-Date: 2019-02-23 10:51-0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -756,6 +756,11 @@ msgstr "" msgid "Odd parity is not supported" msgstr "I2C operação não suportada" +#, c-format +msgid "" +"Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x" +msgstr "" + msgid "Only 8 or 16 bit mono with " msgstr "" @@ -770,8 +775,10 @@ msgid "Only slices with step=1 (aka None) are supported" msgstr "" #, c-format -msgid "Only true color (24 bpp or higher) BMP supported %x" -msgstr "Apenas cores verdadeiras (24 bpp ou maior) BMP suportadas" +msgid "" +"Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale " +"BMP supported %d" +msgstr "" msgid "Only tx supported on UART1 (GPIO2)." msgstr "Apenas TX suportado no UART1 (GPIO2)." @@ -2110,3 +2117,6 @@ msgstr "" msgid "zero step" msgstr "passo zero" + +#~ msgid "Only true color (24 bpp or higher) BMP supported %x" +#~ msgstr "Apenas cores verdadeiras (24 bpp ou maior) BMP suportadas" diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index e41e2ebd9..222a217b3 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -16,3 +16,6 @@ CHIP_FAMILY = samd21 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel + +# To keep the build small +CIRCUITPY_I2CSLAVE = 0 diff --git a/shared-module/displayio/OnDiskBitmap.c b/shared-module/displayio/OnDiskBitmap.c index aa2ca3e10..bc3064632 100644 --- a/shared-module/displayio/OnDiskBitmap.c +++ b/shared-module/displayio/OnDiskBitmap.c @@ -38,13 +38,13 @@ static uint32_t read_word(uint16_t* bmp_header, uint16_t index) { void common_hal_displayio_ondiskbitmap_construct(displayio_ondiskbitmap_t *self, pyb_file_obj_t* file) { // Load the wave self->file = file; - uint16_t bmp_header[24]; + uint16_t bmp_header[69]; f_rewind(&self->file->fp); UINT bytes_read; - if (f_read(&self->file->fp, bmp_header, 48, &bytes_read) != FR_OK) { + if (f_read(&self->file->fp, bmp_header, 138, &bytes_read) != FR_OK) { mp_raise_OSError(MP_EIO); } - if (bytes_read != 48 || + if (bytes_read != 138 || memcmp(bmp_header, "BM", 2) != 0) { mp_raise_ValueError(translate("Invalid BMP file")); } @@ -53,15 +53,35 @@ void common_hal_displayio_ondiskbitmap_construct(displayio_ondiskbitmap_t *self, self->data_offset = read_word(bmp_header, 5); uint32_t header_size = read_word(bmp_header, 7); + uint16_t bits_per_pixel = bmp_header[14]; uint32_t compression = read_word(bmp_header, 15); - if (!(header_size == 12 || header_size == 40 || header_size == 108 || header_size == 124) || + uint32_t number_of_colors = read_word(bmp_header, 23); + self->bitfield_compressed = (compression == 3); + + self->grayscale = ((bits_per_pixel == 8) && (number_of_colors == 256)); + if (bits_per_pixel == 16){ + if (((header_size == 124) || (header_size == 56)) && (self->bitfield_compressed)) { + self->r_bitmask = read_word(bmp_header, 27); + self->g_bitmask = read_word(bmp_header, 29); + self->b_bitmask = read_word(bmp_header, 31); + + if (!((self->r_bitmask == 0xf800) && (self->g_bitmask == 0x07e0) && (self->b_bitmask == 0x001f))){ + mp_raise_ValueError_varg(translate("Only 16bpp RGB 565 supported for bitfield compressed BMPs; R:%x G:%x B:%x"), + self->r_bitmask, self->g_bitmask, self->b_bitmask); + } + } else if (header_size == 40){ // no bitmasks means 5:5:5 + self->r_bitmask = 0x7c00; + self->g_bitmask = 0x3e0; + self->b_bitmask = 0x1f; + } + + } else if (!(header_size == 12 || header_size == 40 || header_size == 108 || header_size == 124) || !(compression == 0)) { mp_raise_ValueError_varg(translate("Only Windows format, uncompressed BMP supported %d"), header_size); } - // TODO(tannewt): Support bitfield compressed colors since RGB565 can be produced by the GIMP. - uint16_t bits_per_pixel = bmp_header[14]; - if (bits_per_pixel < 24) { - mp_raise_ValueError_varg(translate("Only true color (24 bpp or higher) BMP supported %x"), bits_per_pixel); + + if (bits_per_pixel < 16 && !(self->grayscale)) { + mp_raise_ValueError_varg(translate("Only true color (24 bpp or higher), 16bpp 565 and 555, and 8bpp grayscale BMP supported %d"), bits_per_pixel); } self->bytes_per_pixel = bits_per_pixel / 8; self->width = read_word(bmp_header, 9); @@ -87,7 +107,32 @@ uint32_t common_hal_displayio_ondiskbitmap_get_pixel(displayio_ondiskbitmap_t *s uint32_t pixel = 0; uint32_t result = f_read(&self->file->fp, &pixel, self->bytes_per_pixel, &bytes_read); if (result == FR_OK) { - return pixel; + uint32_t tmp = 0; + uint8_t red; + uint8_t green; + uint8_t blue; + if (self->grayscale){ + red = pixel; + green = pixel; + blue = pixel; + tmp = (red << 16 | green << 8 | blue); + return tmp; + } else if (self->bytes_per_pixel == 2) { + if (self->bitfield_compressed){ + red =((pixel & self->r_bitmask) >>11); + green = ((pixel & self->g_bitmask) >>5); + blue = ((pixel & self->b_bitmask) >> 0); + } else { + red =((pixel & self->r_bitmask) >>10); + green = ((pixel & self->g_bitmask) >>4); + blue = ((pixel & self->b_bitmask) >> 0); + } + tmp = (red << 19 | green << 10 | blue << 3); + return tmp; + }else { + return pixel; + } + } return 0; } diff --git a/shared-module/displayio/OnDiskBitmap.h b/shared-module/displayio/OnDiskBitmap.h index 31d6c9550..2102863d6 100644 --- a/shared-module/displayio/OnDiskBitmap.h +++ b/shared-module/displayio/OnDiskBitmap.h @@ -40,6 +40,11 @@ typedef struct { uint16_t height; uint16_t data_offset; uint16_t stride; + uint32_t r_bitmask; + uint32_t g_bitmask; + uint32_t b_bitmask; + bool bitfield_compressed; + bool grayscale; pyb_file_obj_t* file; uint8_t bytes_per_pixel; } displayio_ondiskbitmap_t; |
