|
22 | 22 |
|
23 | 23 | extern ImageColor *_imagePtrJpeg; |
24 | 24 |
|
25 | | - |
26 | | -#if defined(ARDUINO_INKPLATECOLOR) |
27 | | - |
28 | | -static uint32_t pallete[] = {0x000000, 0xFFFFFF, 0x00FF00, 0x0000FF, 0xFF0000, 0xFFFF00, 0xFF8000}; |
29 | | -static unsigned int width = E_INK_WIDTH, height = E_INK_HEIGHT; |
30 | | - |
31 | | -#elif defined(ARDUINO_INKPLATE2) |
32 | | - |
33 | | -static uint32_t pallete[] = {0xFFFFFF, 0x000000, 0xFF0000}; |
34 | | -static unsigned int width = E_INK_HEIGHT, height = E_INK_WIDTH; |
35 | | - |
36 | | -#elif defined(ARDUINO_INKPLATE4) || defined(ARDUINO_INKPLATE7) |
37 | | - |
38 | | -static uint32_t pallete[] = {0xFFFFFF, 0x0000000, 0xFF0000}; |
39 | | -static unsigned int width = E_INK_WIDTH, height = E_INK_HEIGHT; |
40 | | - |
41 | | -#elif defined(ARDUINO_ESP32S3_DEV) |
42 | | -//static uint32_t pallete[] = { 0x424852, 0xA1A8A8, 0xB0AB44, 0x7D4749, 0x4B689A, 0x516A64}; |
43 | | -static uint32_t pallete[] = { 0x000000, 0xFFFFFF, 0xFFFF00, 0xFF0000, 0x0000FF, 0x00FF00}; |
44 | | -static unsigned int width = E_INK_WIDTH, height = E_INK_HEIGHT; |
45 | | - |
46 | | -#endif |
47 | | - |
48 | 25 | /** |
49 | 26 | * @brief findClosestPalette return closes pallete for given pixel |
50 | 27 | * |
@@ -117,12 +94,9 @@ uint8_t ImageColor::ditherGetPixelBmp(uint32_t px, int i, int j, int w, bool pal |
117 | 94 | int16_t g = GREEN8(px) + ditherBuffer[1][j % 8][i]; |
118 | 95 | int16_t b = BLUE8(px) + ditherBuffer[2][j % 8][i]; |
119 | 96 |
|
120 | | - if (i == w - 1) { |
121 | | - int row = j % 8; |
122 | | - memset(ditherBuffer[0][row], 0, w * sizeof(int16_t)); |
123 | | - memset(ditherBuffer[1][row], 0, w * sizeof(int16_t)); |
124 | | - memset(ditherBuffer[2][row], 0, w * sizeof(int16_t)); |
125 | | - } |
| 97 | + ditherBuffer[0][j % 8][i] = 0; |
| 98 | + ditherBuffer[1][j % 8][i] = 0; |
| 99 | + ditherBuffer[2][j % 8][i] = 0; |
126 | 100 |
|
127 | 101 | r = max((int16_t)0, min((int16_t)255, r)); |
128 | 102 | g = max((int16_t)0, min((int16_t)255, g)); |
|
0 commit comments