#include <stdint.h>
#include <stddef.h>
Go to the source code of this file.
|
int | msf_gif_begin (MsfGifState *handle, int width, int height) |
|
int | msf_gif_frame (MsfGifState *handle, uint8_t *pixelData, int centiSecondsPerFame, int maxBitDepth, int pitchInBytes) |
|
MsfGifResult | msf_gif_end (MsfGifState *handle) |
|
void | msf_gif_free (MsfGifResult result) |
|
int | msf_gif_begin_to_file (MsfGifState *handle, int width, int height, MsfGifFileWriteFunc func, void *filePointer) |
|
int | msf_gif_frame_to_file (MsfGifState *handle, uint8_t *pixelData, int centiSecondsPerFame, int maxBitDepth, int pitchInBytes) |
|
int | msf_gif_end_to_file (MsfGifState *handle) |
|
◆ MsfGifBuffer
◆ MsfGifFileWriteFunc
typedef size_t(* MsfGifFileWriteFunc) (const void *buffer, size_t size, size_t count, void *stream) |
◆ msf_gif_begin()
int msf_gif_begin |
( |
MsfGifState * |
handle, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
- Parameters
-
width | Image width in pixels. |
height | Image height in pixels. |
- Returns
- Non-zero on success, 0 on error.
◆ msf_gif_begin_to_file()
◆ msf_gif_end()
- Returns
- A block of memory containing the gif file data, or NULL on error. You are responsible for freeing this via
msf_gif_free()
.
◆ msf_gif_end_to_file()
◆ msf_gif_frame()
int msf_gif_frame |
( |
MsfGifState * |
handle, |
|
|
uint8_t * |
pixelData, |
|
|
int |
centiSecondsPerFame, |
|
|
int |
maxBitDepth, |
|
|
int |
pitchInBytes |
|
) |
| |
- Parameters
-
pixelData | Pointer to raw framebuffer data. Rows must be contiguous in memory, in RGBA8 format (or BGRA8 if you have set msf_gif_bgra_flag = true ). Note: This function does NOT free pixelData . You must free it yourself afterwards. |
centiSecondsPerFrame | How many hundredths of a second this frame should be displayed for. Note: This being specified in centiseconds is a limitation of the GIF format. |
maxBitDepth | Limits how many bits per pixel can be used when quantizing the gif. The actual bit depth chosen for a given frame will be less than or equal to the supplied maximum, depending on the variety of colors used in the frame. maxBitDepth will be clamped between 1 and 16. The recommended default is 16. Lowering this value can result in faster exports and smaller gifs, but the quality may suffer. Please experiment with this value to find what works best for your application. |
pitchInBytes | The number of bytes from the beginning of one row of pixels to the beginning of the next. If you want to flip the image, just pass in a negative pitch. |
- Returns
- Non-zero on success, 0 on error.
◆ msf_gif_frame_to_file()
int msf_gif_frame_to_file |
( |
MsfGifState * |
handle, |
|
|
uint8_t * |
pixelData, |
|
|
int |
centiSecondsPerFame, |
|
|
int |
maxBitDepth, |
|
|
int |
pitchInBytes |
|
) |
| |
◆ msf_gif_free()
◆ msf_gif_alpha_threshold
int msf_gif_alpha_threshold |
|
extern |
◆ msf_gif_bgra_flag