fmt2rgb888 OR fmt2bmp OR frame2bmp
Posted: Thu Sep 24, 2020 8:07 pm
There appear to be three different functions for converting from a JPEG Frame Buffer to a buffer containing BITMAP data, but try as I might I cannot find any documentation on any of them. There's an example that I came across that uses frame2bmp, but even in the example there's no information on its limitations (e.g. it generally can't handle frame sizes above SVGA).
Ideally I'd appreciate it if someone could point me to actual, comprehensive descriptions of those three functions.
But barring that, could someone tell me what KIND of bitmap they each create? The fmt2tgb888 pretty clearly creates rgb888 pixels. But what do the other two do? In fact, there appears to be SEVERAL bmp formats:
PIXFORMAT_RGB565, // 2BPP/RGB565
PIXFORMAT_RGB888, // 3BPP/RGB888
PIXFORMAT_RGB444, // 3BP2P/RGB444
PIXFORMAT_RGB555, // 3BP2P/RGB555
Also, importantly, when you get the resultant bitmap data in its own buffer, is it ONLY the pixel data? Or does it also include the necessary bitmap format HEADER data so that the buffer could then be sent out to a file?
I've discovered that if you create a Frame Buffer containing PIXFORMAT_JPEG you can just send that out to a file and the file is indeed a valid JPEG file, which pretty clearly indicates that the Frame Buffer contains not just the pixel data but also the necessary HEADER info. Not so if you load any of the RGB formats directly into the FrameBuffer. All you get in that case is the pixel data, no header info. If you try to save that kind of Frame Buffer out to a file you end up with an invalid image file.
Ideally I'd appreciate it if someone could point me to actual, comprehensive descriptions of those three functions.
But barring that, could someone tell me what KIND of bitmap they each create? The fmt2tgb888 pretty clearly creates rgb888 pixels. But what do the other two do? In fact, there appears to be SEVERAL bmp formats:
PIXFORMAT_RGB565, // 2BPP/RGB565
PIXFORMAT_RGB888, // 3BPP/RGB888
PIXFORMAT_RGB444, // 3BP2P/RGB444
PIXFORMAT_RGB555, // 3BP2P/RGB555
Also, importantly, when you get the resultant bitmap data in its own buffer, is it ONLY the pixel data? Or does it also include the necessary bitmap format HEADER data so that the buffer could then be sent out to a file?
I've discovered that if you create a Frame Buffer containing PIXFORMAT_JPEG you can just send that out to a file and the file is indeed a valid JPEG file, which pretty clearly indicates that the Frame Buffer contains not just the pixel data but also the necessary HEADER info. Not so if you load any of the RGB formats directly into the FrameBuffer. All you get in that case is the pixel data, no header info. If you try to save that kind of Frame Buffer out to a file you end up with an invalid image file.