Module gifski::c_api
[−]
[src]
How to use from C
Please note that it is impossible to use this API in a single-threaded program. You must have at least two threads -- one for adding the frames, and another for writing.
gifski *g = gifski_new(&settings);
// Call on decoder thread:
gifski_add_frame_rgba(g, i, width, height, buffer, 5);
gifski_end_adding_frames(g);
// Call on encoder thread:
gifski_write(g, "file.gif");
gifski_drop(g);
It's safe to call gifski_drop()
after gifski_write()
, because gifski_write()
blocks until gifski_end_adding_frames()
is called.
It's safe and efficient to call gifski_add_frame_*
in a loop as fast as you can get frames,
because it blocks and waits until previous frames are written.
Structs
GifskiHandle |
Opaque handle used in methods |
GifskiSettings |
Settings for creating a new encoder instance. See |
Enums
GifskiError |
Functions
gifski_add_frame_png_file |
File path must be valid UTF-8. This function is asynchronous. |
gifski_add_frame_rgba |
Pixels is an array width×height×4 bytes large. The array is copied, so you can free/reuse it immediately. |
gifski_drop |
Call to free all memory |
gifski_end_adding_frames |
You must call it at some point (after all frames are set), otherwise |
gifski_new |
Call to start the process |
gifski_set_progress_callback |
Get a callback for frame processed, and abort processing if desired. |
gifski_write |
Start writing to the |