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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
use std::ffi::{CString, c_void};
use std::os::raw::{c_char, c_int};
use libc::{size_t, c_float};
use crate::sys::webp::{
self as webp_sys,
WebPConfig,
WebPPicture,
};
pub fn empty_lossless_webp_picture() -> WebPPicture {
WebPPicture {
use_argb: 1,
colorspace: webp_sys::WEBP_YUV420,
width: 0,
height: 0,
y: std::ptr::null_mut(),
u: std::ptr::null_mut(),
v: std::ptr::null_mut(),
y_stride: 0,
uv_stride: 0,
a: std::ptr::null_mut(),
a_stride: 0,
pad1: [0, 0],
argb: std::ptr::null_mut(),
argb_stride: 0,
pad2: [
0,
0,
0,
],
writer: None,
custom_ptr: std::ptr::null_mut(),
extra_info_type: 0,
extra_info: std::ptr::null_mut(),
stats: std::ptr::null_mut(),
error_code: webp_sys::VP8_ENC_OK,
progress_hook: None,
user_data: std::ptr::null_mut(),
pad3: [0, 0, 0],
pad4: std::ptr::null_mut(),
pad5: std::ptr::null_mut(),
pad6: [0, 0, 0, 0, 0, 0, 0, 0],
memory_: std::ptr::null_mut(),
memory_argb_: std::ptr::null_mut(),
pad7: [std::ptr::null_mut(), std::ptr::null_mut()],
}
}
pub fn empty_lossy_webp_picture() -> WebPPicture {
let mut picture = empty_lossless_webp_picture();
picture.use_argb = 0;
picture
}