This is the David Smart RA8875 Library with mods for working with FRDM-K64F
Diff: GraphicsDisplayJPEG.cpp
- Revision:
- 197:853d08e2fb53
- Parent:
- 167:8aa3fb2a5a31
diff -r 56820026701b -r 853d08e2fb53 GraphicsDisplayJPEG.cpp --- a/GraphicsDisplayJPEG.cpp Tue Feb 11 21:26:59 2020 +0000 +++ b/GraphicsDisplayJPEG.cpp Tue Feb 11 21:51:42 2020 +0000 @@ -10,9 +10,9 @@ // INFO("Stuff to show %d", var); // new-line is automatically appended // #if (defined(DEBUG) && !defined(TARGET_LPC11U24)) -#define INFO(x, ...) std::printf("[INF %s %4d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); -#define WARN(x, ...) std::printf("[WRN %s %4d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); -#define ERR(x, ...) std::printf("[ERR %s %4d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); +#define INFO(x, ...) std::printf("[INF %s %4d] " x "\r\n", DEBUG, __LINE__, ##__VA_ARGS__); +#define WARN(x, ...) std::printf("[WRN %s %4d] " x "\r\n", DEBUG, __LINE__, ##__VA_ARGS__); +#define ERR(x, ...) std::printf("[ERR %s %4d] " x "\r\n", DEBUG, __LINE__, ##__VA_ARGS__); static void HexDump(const char * title, const uint8_t * p, int count) { int i; @@ -526,7 +526,7 @@ INFO("mcu_load"); HexDump("JDEC", (uint8_t *)jd, sizeof(JDEC)); - + nby = jd->msx * jd->msy; /* Number of Y blocks (1, 2 or 4) */ nbc = 2; /* Number of C blocks (2) */ bp = jd->mcubuf; /* Pointer to the first block */ @@ -740,7 +740,7 @@ /* Output the RGB rectangular */ INFO("call outfunc"); if (outfunc) - return outfunc(jd, jd->workbuf, &rect) ? JDR_OK : JDR_INTR; + return outfunc(jd, jd->workbuf, &rect) ? JDR_OK : JDR_INTR; else return privOutFunc(jd, jd->workbuf, &rect) ? JDR_OK : JDR_INTR; } @@ -760,7 +760,7 @@ uint16_t i, dc; uint16_t d; uint8_t *dp; - + INFO("restart(%p,%d)", jd, rstn); /* Discard padding bits and get two bytes from the input stream */ @@ -830,7 +830,7 @@ int x1 = rect->right; int y0 = rect->top; int y1 = rect->bottom; - + INFO("privOutFunc: (%d,%d)-(%d,%d) : (%d,%d)", x0,y0, x1,y1, width(), height()); if (y0 >= height() || x0 >= width()) return 1; // off the right || bottom of screen @@ -844,8 +844,8 @@ #if JD_FORMAT == 0 uint8_t *s = (uint8_t *)bitmap; uint16_t rgb565, *d = (uint16_t *)s; - uint32_t pCount = pixelCount; - + uint32_t pCount = pixelCount; + do { rgb565 = (*s++ & 0xF8) << 8; /* RRRRR----------- */ rgb565 |= (*s++ & 0xFC) << 3; /* -----GGGGGG----- */ @@ -969,14 +969,14 @@ jd->width = LDB_WORD(seg+3); /* Image width in unit of pixel */ jd->height = LDB_WORD(seg+1); /* Image height in unit of pixel */ INFO("Image size(%d,%d)", jd->width, jd->height); - + if (seg[5] != 3) { ERR("JDR_FMT3"); return JDR_FMT3; /* Err: Supports only Y/Cb/Cr format */ } /* Check three image components */ - for (i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { b = seg[7 + 3 * i]; /* Get sampling factor */ if (!i) { /* Y component */ if (b != 0x11 && b != 0x22 && b != 0x21) {/* Check sampling factor */ @@ -1073,7 +1073,7 @@ ERR("JDR_FMT3"); return JDR_FMT3; /* Err: Supports only three color components format */ } - + /* Check if all tables corresponding to each components have been loaded */ for (i = 0; i < 3; i++) { b = seg[2 + 2 * i]; /* Get huffman table ID */