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

Getting the RGB888 value of pixel with JD_FORMAT = 0 #79

Open
raulzanardo opened this issue Jul 16, 2024 · 1 comment
Open

Getting the RGB888 value of pixel with JD_FORMAT = 0 #79

raulzanardo opened this issue Jul 16, 2024 · 1 comment

Comments

@raulzanardo
Copy link

How do I get the value of each 8 bit color when the library is configured with JD_FORMAT=0?

The function that draws the image, in the mai case called 'tft_outpu' ony has a pointer of 16bits.
(int16_t _x, int16_t _y, uint16_t w, uint16_t h, uint16_t *bitmap).

@raulzanardo
Copy link
Author

raulzanardo commented Jul 16, 2024

I figure it out:

change JD_FORMAT to 0 in tjpgdcnf.h

in TJpg_Decoder.h change :
"typedef bool (*SketchCallback)(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t *data);" to
"typedef bool (*SketchCallback)(int16_t x, int16_t y, uint16_t w, uint16_t h, uint8_t *data);"

in TJpg_Decoder.cpp, line 155, change:
return thisPtr->tft_output(x, y, w, h, (uint16_t*)bitmap); to
return thisPtr->tft_output(x, y, w, h, (uint8_t*)bitmap);

it could be a ifdef for those two parts of the code based on the JD_FORMAT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant