Skip to content
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
9 changes: 9 additions & 0 deletions src/bb_ep_gfx.inl
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,15 @@ void bbepSetPixelFast16Clr(void *pb, int x, int y, unsigned char ucColor)
uint8_t u8;
BBEPDISP *pBBEP = (BBEPDISP *)pb;

if (ucColor & BBEP_DITHERING_FLAG) {
// if dithering requested, unset the bit to get the correct color
ucColor &= ~BBEP_DITHERING_FLAG;
if (x % 2 == (y % 2 == 0) ? 0 : 1) {
// skip pixel
return;
}
}

iPitch = pBBEP->width >> 1;
i = (x >> 1) + (y * iPitch);
u8 = pBBEP->ucScreen[i];
Expand Down
2 changes: 2 additions & 0 deletions src/bb_epaper.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ enum {
#define BBEP_SPECTRA_ORANGE 0x06
#define BBEP_SPECTRA_CLEAN 0x07

#define BBEP_DITHERING_FLAG 0x80 //if set, draws a 2x2 dithering pattern (every second pixels skipped)

// 4 gray levels
#define BBEP_GRAY0 0
#define BBEP_GRAY1 1
Expand Down