lvandeve / lodepng

PNG encoder and decoder in C and C++.
zlib License
2.03k stars 420 forks source link

Encoding from RGB 24 frame buffers handling stride / pitch #189

Open antonio-pasini opened 1 month ago

antonio-pasini commented 1 month ago

I'd love to use LodePNG to encode a 24 bpp 800x480 frame buffer, but my embedded board has a weird frame buffer scan line pitch: each line must have a length multiple of 128 bytes.

So each line of the frame buffer is 3800 + 32 bytes = 2432 bytes, not even a pixel* multiple.

Woule be really difficult to find enough ram to make a whole copy of that in another region to have contiguous pixels.

Is there a way to use LodePNG with unconventional pixel source formats ? Even if slower, of course.

Or just feeding a line at a time, converted in contiguous pixel form, that would do also.