microwindows icon indicating copy to clipboard operation
microwindows copied to clipboard

Nano-X support webp

Open big-vl opened this issue 9 months ago • 1 comments

My dear friend @ghaerr, I am faced with the fact that there is no such format in support WebP, I am now busy figuring out how to write support, but I would very much like there to be such support, the project is alive and will live. If I start writing a library or if there is any progress, please let me know here.

big-vl avatar Mar 08 '25 08:03 big-vl

To write support for WebP, you'll create a new image decoder in a file engine/image_webp.c. This will use an entry point GdDecodeWEBP() which will be added to the engine/devimage.c file.

The decoder can use the GdImageBufferRead etc routines to read the input file or buffer (since both methods are supported by upper level), and then create a memory pixmap using GdCreatePixmap, specifying one of the internal image formats, such as MWIF_RGBA8888 (recommended). It may sound complicated, but look at engine/image_bmp.c for details, it is fairly straightforward, once you figure out which library code to use for the WebP format decoding. Essentially the image will likely be decoded into a memory buffer in RGBA format, then passed back to Microwindows in the way just discussed.

ghaerr avatar Mar 08 '25 15:03 ghaerr