libspng icon indicating copy to clipboard operation
libspng copied to clipboard

Example for spng_set_png_stream()

Open JanGerber opened this issue 1 year ago • 1 comments

Is there an example how to use the spng_set_png_stream() function?

JanGerber avatar Jul 12 '23 08:07 JanGerber

One example is the spng_set_png_file() function which is essentially spng_set_png_stream(ctx, file_read_fn, file) where file_read_fn looks like this: https://github.com/randy408/libspng/blob/e5c1fc470fceaca08b8c30dc40768c28b82b9e12/spng/spng.c#L5024-L5036

For writing file_write_fn is used, it's right after file_read_fn in the same file.

There is documentation on the read and write callbacks: https://libspng.org/docs/context/#spng_read_fn, https://libspng.org/docs/context/#spng_write_fn

randy408 avatar Jul 12 '23 11:07 randy408