Wise&mystical  1.0
Project about Europe
Loading...
Searching...
No Matches
msf_gif.h File Reference
#include <stdint.h>
#include <stddef.h>
+ Include dependency graph for msf_gif.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MsfGifResult
 HEADER ///. More...
 
struct  MsfCookedFrame
 
struct  MsfGifBuffer
 
struct  MsfGifState
 

Typedefs

typedef struct MsfGifBuffer MsfGifBuffer
 
typedef size_t(* MsfGifFileWriteFunc) (const void *buffer, size_t size, size_t count, void *stream)
 

Functions

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)
 

Variables

int msf_gif_alpha_threshold
 
int msf_gif_bgra_flag
 

Typedef Documentation

◆ MsfGifBuffer

typedef struct MsfGifBuffer MsfGifBuffer

◆ MsfGifFileWriteFunc

typedef size_t(* MsfGifFileWriteFunc) (const void *buffer, size_t size, size_t count, void *stream)

Definition at line 94 of file msf_gif.h.

Function Documentation

◆ msf_gif_begin()

int msf_gif_begin ( MsfGifState handle,
int  width,
int  height 
)
Parameters
widthImage width in pixels.
heightImage height in pixels.
Returns
Non-zero on success, 0 on error.

◆ msf_gif_begin_to_file()

int msf_gif_begin_to_file ( MsfGifState handle,
int  width,
int  height,
MsfGifFileWriteFunc  func,
void *  filePointer 
)

◆ msf_gif_end()

MsfGifResult msf_gif_end ( MsfGifState handle)
Returns
A block of memory containing the gif file data, or NULL on error. You are responsible for freeing this via msf_gif_free().
+ Here is the caller graph for this function:

◆ msf_gif_end_to_file()

int msf_gif_end_to_file ( MsfGifState handle)

◆ msf_gif_frame()

int msf_gif_frame ( MsfGifState handle,
uint8_t pixelData,
int  centiSecondsPerFame,
int  maxBitDepth,
int  pitchInBytes 
)
Parameters
pixelDataPointer 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.
centiSecondsPerFrameHow many hundredths of a second this frame should be displayed for. Note: This being specified in centiseconds is a limitation of the GIF format.
maxBitDepthLimits 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.
pitchInBytesThe 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.
+ Here is the caller graph for this function:

◆ 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()

void msf_gif_free ( MsfGifResult  result)
Parameters
resultThe MsfGifResult struct, verbatim as it was returned from msf_gif_end().
+ Here is the caller graph for this function:

Variable Documentation

◆ msf_gif_alpha_threshold

int msf_gif_alpha_threshold
extern

◆ msf_gif_bgra_flag

int msf_gif_bgra_flag
extern