bitbank2 / PNGenc

An embedded-friendly PNG encoder
Apache License 2.0
39 stars 8 forks source link

RGB565 to PNG #5

Closed weilunisme798 closed 2 years ago

weilunisme798 commented 2 years ago

Hi, Sir I was trying to use your library to convert my RGB565 to PNG, but I do not know what is the parameter value for addRGB565Line(uint16_t *pPixels, void *pTempLine); what does pTempLine means? Maybe you can share an example for RGB565 to PNG. Thank you

bitbank2 commented 2 years ago

This library is designed to use as little memory as possible and to never call malloc. For this reason, you need to give it a buffer to receive the converted pixels. So... if you are going from RGB565->TrueColor (24-bpp), then you need 3*Width bytes in the temporary buffer you pass. If you're converting from RGB565 to grayscale, then you only need Width bytes.