diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2011-06-27 22:23:46 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2011-06-27 22:23:46 +0200 |
commit | 861d73246c73ae3201a9be96483d04f3cc5ba741 (patch) | |
tree | 7161dc65d4dffde05322030236cab85259a49433 /glcdgraphics/extformats.c | |
parent | 27199225f8570472322971eb3059be64bd6cfe43 (diff) | |
download | graphlcd-base-861d73246c73ae3201a9be96483d04f3cc5ba741.tar.gz graphlcd-base-861d73246c73ae3201a9be96483d04f3cc5ba741.tar.bz2 |
deactivate monochrome setting of imagemagick files because of problems with background/foreground colour
Diffstat (limited to 'glcdgraphics/extformats.c')
-rw-r--r-- | glcdgraphics/extformats.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/glcdgraphics/extformats.c b/glcdgraphics/extformats.c index a797bbc..ee87a32 100644 --- a/glcdgraphics/extformats.c +++ b/glcdgraphics/extformats.c @@ -101,7 +101,7 @@ bool cExtFormatFile::Load(cImage & image, const string & fileName) //Dprintf("this image has %d colors\n", (*it).totalColors()); bool isMatte = (*it).matte(); - bool isMonochrome = ((*it).totalColors() <= 2) ? true : false; + //bool isMonochrome = ((*it).totalColors() <= 2) ? true : false; const PixelPacket *pix = (*it).getConstPixels(0, 0, (int)width, (int)height); for (int iy = 0; iy < (int)height; ++iy) { @@ -111,20 +111,20 @@ bool cExtFormatFile::Load(cImage & image, const string & fileName) } else { //bmpdata[iy*width+ix] = (uint32_t)( 0xFF000000 | (int(pix->red * 255 / MaxRGB) << 16) | (int(pix->green * 255 / MaxRGB) << 8) | int(pix->blue * 255 / MaxRGB)); bmpdata[iy*width+ix] = (uint32_t)( (int(255 - (pix->opacity * 255 / MaxRGB)) << 24) | (int(pix->red * 255 / MaxRGB) << 16) | (int(pix->green * 255 / MaxRGB) << 8) | int(pix->blue * 255 / MaxRGB)); - if ( isMonochrome ) { // if is monochrome: exchange black and white - uint32_t c = bmpdata[iy*width+ix]; - switch(c) { - case cColor::White: c = cColor::Black; break; - case cColor::Black: c = cColor::White; break; - } - bmpdata[iy*width+ix] = c; - } + //if ( isMonochrome ) { // if is monochrome: exchange black and white + // uint32_t c = bmpdata[iy*width+ix]; + // switch(c) { + // case cColor::White: c = cColor::Black; break; + // case cColor::Black: c = cColor::White; break; + // } + // bmpdata[iy*width+ix] = c; + //} } ++pix; } } cBitmap * b = new cBitmap(width, height, bmpdata); - b->SetMonochrome(isMonochrome); + //b->SetMonochrome(isMonochrome); image.AddBitmap(b); delete[] bmpdata; bmpdata = NULL; |