forked from aruiz/webp-pixbuf-loader
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathio-webp.h
50 lines (44 loc) · 1.28 KB
/
io-webp.h
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
/* GdkPixbuf library - WebP Image Loader
*
* SPDX-License-Identifier: LGPL-2.0-or-later
* Copyright (C) 2011 Alberto Ruiz
* Copyright (C) 2011 David Mazary
* Copyright (C) 2014 Přemysl Janouch
*
* Authors: Alberto Ruiz <[email protected]>
* David Mazary <[email protected]>
* Přemysl Janouch <[email protected]>
*/
#ifndef IO_WEBP_H
#define IO_WEBP_H
#include <webp/decode.h>
#include <webp/encode.h>
#include <string.h>
#define GDK_PIXBUF_ENABLE_BACKEND
#include <gdk-pixbuf/gdk-pixbuf.h>
#undef GDK_PIXBUF_ENABLE_BACKEND
/* Animation progressive loader state */
typedef struct {
int state; /* ACCUMstate */
guchar *filedata;
guchar *accum_data;
size_t used_len;
size_t cur_max_len;
size_t total_data_len;
} AnimIncrDecode;
/* Progressive loader context */
typedef struct {
GdkPixbufModuleSizeFunc size_func;
GdkPixbufModuleUpdatedFunc update_func;
GdkPixbufModulePreparedFunc prepare_func;
WebPDecoderConfig config;
gpointer user_data;
GdkPixbuf *pixbuf;
gboolean got_header;
WebPIDecoder *idec;
WebPBitstreamFeatures features; /* used by animation. */
AnimIncrDecode anim_incr; /* used by animation. */
gint last_y;
GError **error;
} WebPContext;
#endif /* IO_WEBP_H */