-
Notifications
You must be signed in to change notification settings - Fork 123
/
giflib.hpp
55 lines (46 loc) · 1.82 KB
/
giflib.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef LILLIPUT_GIFLIB_HPP
#define LILLIPUT_GIFLIB_HPP
#include "opencv.hpp"
#ifdef __cplusplus
extern "C" {
#endif
struct GifAnimationInfo {
int loop_count;
int frame_count;
int bg_red;
int bg_green;
int bg_blue;
int bg_alpha;
};
#define GIF_DISPOSE_NONE 0
#define GIF_DISPOSE_BACKGROUND 1
typedef struct giflib_decoder_struct* giflib_decoder;
typedef struct giflib_encoder_struct* giflib_encoder;
typedef enum {
giflib_decoder_have_next_frame,
giflib_decoder_eof,
giflib_decoder_error,
} giflib_decoder_frame_state;
giflib_decoder giflib_decoder_create(const opencv_mat buf);
int giflib_decoder_get_width(const giflib_decoder d);
int giflib_decoder_get_height(const giflib_decoder d);
int giflib_decoder_get_num_frames(const giflib_decoder d);
int giflib_decoder_get_frame_width(const giflib_decoder d);
int giflib_decoder_get_frame_height(const giflib_decoder d);
int giflib_decoder_get_prev_frame_delay(const giflib_decoder d);
void giflib_decoder_release(giflib_decoder d);
giflib_decoder_frame_state giflib_decoder_decode_frame_header(giflib_decoder d);
bool giflib_decoder_decode_frame(giflib_decoder d, opencv_mat mat);
giflib_decoder_frame_state giflib_decoder_skip_frame(giflib_decoder d);
giflib_encoder giflib_encoder_create(void* buf, size_t buf_len);
bool giflib_encoder_init(giflib_encoder e, const giflib_decoder d, int width, int height);
bool giflib_encoder_encode_frame(giflib_encoder e, const giflib_decoder d, const opencv_mat frame);
bool giflib_encoder_flush(giflib_encoder e, const giflib_decoder d);
void giflib_encoder_release(giflib_encoder e);
int giflib_encoder_get_output_length(giflib_encoder e);
struct GifAnimationInfo giflib_decoder_get_animation_info(const giflib_decoder d);
int giflib_decoder_get_prev_frame_disposal(const giflib_decoder d);
#ifdef __cplusplus
}
#endif
#endif