Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of RA8875 by
Diff: GraphicsDisplay.cpp
- Revision:
- 79:544eb4964795
- Parent:
- 72:ecffe56af969
- Child:
- 93:6fbc516de05e
diff -r faf49c381591 -r 544eb4964795 GraphicsDisplay.cpp --- a/GraphicsDisplay.cpp Sun Dec 28 03:14:35 2014 +0000 +++ b/GraphicsDisplay.cpp Sun Dec 28 19:55:16 2014 +0000 @@ -228,9 +228,9 @@ return noerror; } -void GraphicsDisplay::WindowMax(void) +RetCode_t GraphicsDisplay::WindowMax(void) { - window(0,0, width(),height()); + return window(0,0, width(),height()); } RetCode_t GraphicsDisplay::_putp(color_t color) @@ -248,18 +248,17 @@ return noerror; } -void GraphicsDisplay::fill(int x, int y, int w, int h, color_t color) +RetCode_t GraphicsDisplay::fill(int x, int y, int w, int h, color_t color) { - fillrect(x,y, x+w, y+h, color); + return fillrect(x,y, x+w, y+h, color); } RetCode_t GraphicsDisplay::cls(uint16_t layers) { - fill(0, 0, width(), height(), _background); - return noerror; + return fill(0, 0, width(), height(), _background); } -void GraphicsDisplay::blit(int x, int y, int w, int h, const int * color) +RetCode_t GraphicsDisplay::blit(int x, int y, int w, int h, const int * color) { window(x, y, w, h); _StartGraphicsStream(); @@ -267,7 +266,7 @@ _putp(color[i]); } _EndGraphicsStream(); - WindowMax(); + return WindowMax(); } #ifdef LOCALFONT @@ -384,11 +383,11 @@ PixelHeight = BMP_Info.biHeight; PixelWidth = BMP_Info.biWidth; + INFO("(%d,%d) (%d,%d) (%d,%d)", x,y, PixelWidth,PixelHeight, width(), height()); if (PixelHeight > height() + y || PixelWidth > width() + x) { fclose(Image); return(image_too_big); } - INFO("(%d,%d) (%d,%d)", x,y, PixelWidth,PixelHeight); if (BMP_Info.biBitCount <= 8) { int paletteSize; // Read the color palette @@ -448,7 +447,7 @@ offset = fileOffset + j * (lineBufSize + padd); // start of line fseek(Image, offset, SEEK_SET); fread(lineBuffer, 1, lineBufSize, Image); // read a line - slow ! - INFO("offset: %6X", offset); + //INFO("offset: %6X", offset); for (i = 0; i < PixelWidth; i++) { // copy pixel data to TFT if (BPP_t == 4) { uint8_t dPix = lineBuffer[i/2]; @@ -456,18 +455,14 @@ dPix >>= 4; dPix &= 0x0F; pixelBuffer[i] = RGBQuadToRGB16(colorPalette, dPix); - //_putp(RGBQuadToRGB16(colorPalette, dPix)); } else if (BPP_t == 8) { pixelBuffer[i] = RGBQuadToRGB16(colorPalette, lineBuffer[i]); - //_putp(RGBQuadToRGB16(colorPalette, lineBuffer[i])); } else if (BPP_t == 16) { pixelBuffer[i] = lineBuffer[i]; - //_putp(lineBuffer[i]); } else if (BPP_t == 24) { color_t color; color = RGB(lineBuffer[i*3+2], lineBuffer[i*3+1], lineBuffer[i*3+0]); pixelBuffer[i] = color; - //putp(color); } } pixelStream(pixelBuffer, PixelWidth, x, y++); @@ -566,5 +561,3 @@ { return height() / 8; } - -