summaryrefslogtreecommitdiff
path: root/glcdgraphics/bitmap.c
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2011-09-19 00:15:19 +0200
committermrwastl <mrwastl@users.sourceforge.net>2011-09-19 00:15:19 +0200
commit36315d4f3ed507bcc613eb92155d561b78e81af6 (patch)
treef641c9cf2ac4bf35053ee57033c2294375c2ed59 /glcdgraphics/bitmap.c
parentface4c4bed68ae0d97d53cb0ebec6f1e02bbfbea (diff)
downloadgraphlcd-base-36315d4f3ed507bcc613eb92155d561b78e81af6.tar.gz
graphlcd-base-36315d4f3ed507bcc613eb92155d561b78e81af6.tar.bz2
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
Diffstat (limited to 'glcdgraphics/bitmap.c')
-rw-r--r--glcdgraphics/bitmap.c20
1 files changed, 20 insertions, 0 deletions
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};