il y a 6 ans
Hi :),
is there a short and fast function to convert the RGB565 to RGB888 and back again?
NEW il y a 6 ans
There is https://gamebuino.com/academy/reference/gb-createcolor for going from rgb888 to rgb565.
I see rgb565Torgb888
in Misc.cpp to go the other way, but I'm guessing it was written assuming it would only be used internally in the library.
NEW il y a 6 ans
I'd like to add that rgb888 -> rgb565 has dataloss, as we are downsampling a 24-bit cilor to a 16-bit one
NEW il y a 6 ans
Thats no problem.
I have an ESP32 with a OV7670 Camera.
The Camera only outputs RGR565, but for me its easier to work with RGB888 Values.
NEW il y a 6 ans
Well, you can always use the method aoniell pointed out by pre-declaring it.
EDIT:
something like this should do (untested):
#include <utils/Misc.h> // and then Gamebuino_Meta::RGB888 rgb = Gamebuino_Meta::rgb565Torgb888(0x1234); rgb.r; // red rgb.g; // green rgb.b; // blue