Inkplate 6COLOR TJpeg callback integration with display drawing

Customer:

I’m using the TJpeg library from the Inkplate-Arduino-library/src/libs/TJpeg directory, which can reduce image size by 2, 4, or 8. The library provides a callback function that gets called multiple times during JPEG decoding, where I need to draw blocks of the image to the Inkplate display.

The callback signature is:

bool output(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t *data, bool dither, bool invert)

I can see examples using Adafruit GFX with calls like tft.drawRGBBitmap(x, y, bitmap, w, h), but I’m having trouble finding the equivalent public method in the Inkplate library to draw using x, y coordinates with a uint16_t *data pointer, width, and height. Most matching methods like writePixel(int16_t x, int16_t y, uint16_t color) and drawRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h) appear to be private.

How should I draw to the Inkplate display from within the TJpeg callback function?

Originally submitted via email support on 23 March 2023. Migrated to the forum for community visibility.

Soldered Support:

You can see how this library is integrated and used in the Inkplate library by checking the relevant source files. Unfortunately, we don’t provide support for how the TJpeg library itself works. For detailed usage examples, refer to the TJpeg library’s original repository and our integration examples in the Inkplate library.