From 36315d4f3ed507bcc613eb92155d561b78e81af6 Mon Sep 17 00:00:00 2001 From: mrwastl Date: Mon, 19 Sep 2011 00:15:19 +0200 Subject: deactivated static method cSkinString::Reparse + static cSkinString::mStrings (wasn't used anyways, but caused big problems when using more than one display thread); beauty fixes: initialisation of static cColor-colour constants now moved to .c-file, type fix --- glcdgraphics/bitmap.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'glcdgraphics/bitmap.c') diff --git a/glcdgraphics/bitmap.c b/glcdgraphics/bitmap.c index 0ab27b6..b96fe6d 100644 --- a/glcdgraphics/bitmap.c +++ b/glcdgraphics/bitmap.c @@ -27,6 +27,17 @@ namespace GLCD { +const uint32_t cColor::Black = GRAPHLCD_Black; +const uint32_t cColor::White = GRAPHLCD_White; +const uint32_t cColor::Red = 0xFFFF0000; +const uint32_t cColor::Green = 0xFF00FF00; +const uint32_t cColor::Blue = 0xFF0000FF; +const uint32_t cColor::Magenta = 0xFFFF00FF; +const uint32_t cColor::Cyan = 0xFF00FFFF; +const uint32_t cColor::Yellow = 0xFFFFFF00; +const uint32_t cColor::Transparent = GRAPHLCD_Transparent; +const uint32_t cColor::ERRCOL = GRAPHLCD_ERRCOL; + cColor cColor::ParseColor(std::string col) { if (col == "black") return cColor(cColor::Black); @@ -61,6 +72,15 @@ cColor cColor::Invert(void) return cColor( (uint32_t)(color ^ 0x00FFFFFF) ) ; } +uint32_t cColor::AlignAlpha (uint32_t col) { + switch (col) { + case Transparent: + case ERRCOL: + return col; + default: + return (col & 0xFF000000) ? col : (col | 0xFF000000); + } +} const unsigned char bitmask[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; const unsigned char bitmaskl[8] = {0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}; -- cgit v1.2.3