Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing default arguments and fix 1-bit BMP draw image from b… #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/include/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ class Image : virtual public NetworkClient, virtual public Adafruit_GFX

void drawBitmap3Bit(int16_t _x, int16_t _y, const unsigned char *_p, int16_t _w, int16_t _h);

bool drawBitmapFromBuffer(uint8_t *buf, int x, int y, bool dither, bool invert);
bool drawBitmapFromBuffer(const uint8_t *buf, int x, int y, bool dither = 0, bool invert = 0);

bool drawBitmapFromSd(const char *fileName, int x, int y, bool dither = 0, bool invert = 0);
bool drawBitmapFromSd(SdFile *p, int x, int y, bool dither = 0, bool invert = 0);

bool drawBitmapFromWeb(const char *url, int x, int y, bool dither = 0, bool invert = 0);
bool drawBitmapFromWeb(WiFiClient *s, int x, int y, int32_t len, bool dither = 0, bool invert = 0);

bool drawJpegFromBuffer(uint8_t *buf, int32_t len, int x, int y, bool dither, bool invert);
bool drawJpegFromBuffer(uint8_t *buf, int32_t len, int x, int y, bool dither = 0, bool invert = 0);

bool drawJpegFromSd(const char *fileName, int x, int y, bool dither = 0, bool invert = 0);
bool drawJpegFromSd(SdFile *p, int x, int y, bool dither = 0, bool invert = 0);
Expand Down
5 changes: 4 additions & 1 deletion src/include/ImageBMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ void Image::displayBmpLine(int16_t x, int16_t y, bitmapHeader *bmpHeader, bool d
writePixel(x + j, y,
(!invert ^ (palette[0] > palette[1])) ^ !!(pixelBuffer[j >> 3] & (1 << (7 - (j & 7)))));
#else
writePixel(x + j, y, (invert ^ (palette[0] > palette[1])) ^ !!(pixelBuffer[j >> 3] & (1 << (7 - (j & 7)))));
if (getDisplayMode() == INKPLATE_1BIT)
writePixel(x + j, y, (invert ^ (palette[0] > palette[1])) ^ !!(pixelBuffer[j >> 3] & (1 << (7 - (j & 7)))) ? 0 : 1);
else
writePixel(x + j, y, (invert ^ (palette[0] > palette[1])) ^ !!(pixelBuffer[j >> 3] & (1 << (7 - (j & 7)))) ? 0 : 7);
#endif
break;
}
Expand Down