X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/9a7b1594b331d775714d863a5b20930af4acf21b..b2d84a4b240edc1e4e15793180529eacce45cec8:/drivers/displays/tft/aafonts.h diff --git a/drivers/displays/tft/aafonts.h b/drivers/displays/tft/aafonts.h index f76d35a..e09f246 100644 --- a/drivers/displays/tft/aafonts.h +++ b/drivers/displays/tft/aafonts.h @@ -64,16 +64,14 @@ typedef struct aafontsFont_s const aafontsCharInfo_t *charTable; /* Pointer to the aafontsCharInfo_t array containing the char data */ } aafontsFont_t; -// Common color lookup tables for AA2 (4-color anti-aliased) fonts -const uint16_t COLORTABLE_AA2_WHITEONBLACK[4] = { 0x0000, 0x52AA, 0xAD55, 0xFFFF}; -const uint16_t COLORTABLE_AA2_BLACKONWHITE[4] = { 0xFFFF, 0xAD55, 0x52AA, 0x0000}; +extern const uint16_t COLORTABLE_AA2_WHITEONBLACK[4]; +extern const uint16_t COLORTABLE_AA2_BLACKONWHITE[4]; +extern const uint16_t COLORTABLE_AA4_WHITEONBLACK[16]; +extern const uint16_t COLORTABLE_AA4_BLACKONWHITE[16]; -// Common color lookup tables for AA4 (16-color anti-aliased) fonts -const uint16_t COLORTABLE_AA4_WHITEONBLACK[16] = { 0x0000, 0x1082, 0x2104, 0x3186, 0x4208, 0x528A, 0x630C, 0x738E, 0x8410, 0x9492, 0xA514, 0xB596, 0xC618, 0xD69A, 0xE71C, 0xFFFF}; -const uint16_t COLORTABLE_AA4_BLACKONWHITE[16] = { 0xFFFF, 0xE71C, 0xD69A, 0xC618, 0xB596, 0xA514, 0x9492, 0x8410, 0x738E, 0x630C, 0x528A, 0x4208, 0x3186, 0x2104, 0x1082, 0x0000}; - -uint16_t aafontsBlendColor ( uint16_t bgColor, uint16_t foreColor, uint8_t intensity ); -void aafontsDrawString( uint16_t x, uint16_t y, const uint16_t * colorTable, const aafontsFont_t *font, char *str ); -uint16_t aafontsGetStringWidth( const aafontsFont_t *font, char *str ); +void aafontsDrawString ( uint16_t x, uint16_t y, const uint16_t * colorTable, const aafontsFont_t *font, char *str ); +void aafontsCenterString ( uint16_t x, uint16_t y, const uint16_t * colorTable, const aafontsFont_t *font, char *str ); +uint16_t aafontsGetStringWidth ( const aafontsFont_t *font, char *str ); +void aafontsCalculateColorTable ( uint16_t bgColor, uint16_t foreColor, uint16_t *colorTable, size_t tableSize ); #endif