-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathreference_bindings.rs
746 lines (729 loc) · 29.3 KB
/
reference_bindings.rs
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
/* automatically generated by rust-bindgen */
pub const LIBSIXEL_VERSION: &'static [u8; 6usize] = b"1.7.3\x00";
pub const LIBSIXEL_ABI_VERSION: &'static [u8; 6usize] = b"1:6:0\x00";
pub const SIXEL_OUTPUT_PACKET_SIZE: ::std::os::raw::c_uint = 16384;
pub const SIXEL_PALETTE_MIN: ::std::os::raw::c_uint = 2;
pub const SIXEL_PALETTE_MAX: ::std::os::raw::c_uint = 256;
pub const SIXEL_USE_DEPRECATED_SYMBOLS: ::std::os::raw::c_uint = 1;
pub const SIXEL_OK: ::std::os::raw::c_uint = 0;
pub const SIXEL_FALSE: ::std::os::raw::c_uint = 4096;
pub const SIXEL_RUNTIME_ERROR: ::std::os::raw::c_uint = 4352;
pub const SIXEL_LOGIC_ERROR: ::std::os::raw::c_uint = 4608;
pub const SIXEL_FEATURE_ERROR: ::std::os::raw::c_uint = 4864;
pub const SIXEL_LIBC_ERROR: ::std::os::raw::c_uint = 5120;
pub const SIXEL_CURL_ERROR: ::std::os::raw::c_uint = 5376;
pub const SIXEL_JPEG_ERROR: ::std::os::raw::c_uint = 5632;
pub const SIXEL_PNG_ERROR: ::std::os::raw::c_uint = 5888;
pub const SIXEL_GDK_ERROR: ::std::os::raw::c_uint = 6144;
pub const SIXEL_GD_ERROR: ::std::os::raw::c_uint = 6400;
pub const SIXEL_STBI_ERROR: ::std::os::raw::c_uint = 6656;
pub const SIXEL_STBIW_ERROR: ::std::os::raw::c_uint = 6912;
pub const SIXEL_INTERRUPTED: ::std::os::raw::c_uint = 1;
pub const SIXEL_BAD_ALLOCATION: ::std::os::raw::c_uint = 4353;
pub const SIXEL_BAD_ARGUMENT: ::std::os::raw::c_uint = 4354;
pub const SIXEL_BAD_INPUT: ::std::os::raw::c_uint = 4355;
pub const SIXEL_NOT_IMPLEMENTED: ::std::os::raw::c_uint = 4865;
pub const SIXEL_LARGE_AUTO: ::std::os::raw::c_uint = 0;
pub const SIXEL_LARGE_NORM: ::std::os::raw::c_uint = 1;
pub const SIXEL_LARGE_LUM: ::std::os::raw::c_uint = 2;
pub const SIXEL_REP_AUTO: ::std::os::raw::c_uint = 0;
pub const SIXEL_REP_CENTER_BOX: ::std::os::raw::c_uint = 1;
pub const SIXEL_REP_AVERAGE_COLORS: ::std::os::raw::c_uint = 2;
pub const SIXEL_REP_AVERAGE_PIXELS: ::std::os::raw::c_uint = 3;
pub const SIXEL_DIFFUSE_AUTO: ::std::os::raw::c_uint = 0;
pub const SIXEL_DIFFUSE_NONE: ::std::os::raw::c_uint = 1;
pub const SIXEL_DIFFUSE_ATKINSON: ::std::os::raw::c_uint = 2;
pub const SIXEL_DIFFUSE_FS: ::std::os::raw::c_uint = 3;
pub const SIXEL_DIFFUSE_JAJUNI: ::std::os::raw::c_uint = 4;
pub const SIXEL_DIFFUSE_STUCKI: ::std::os::raw::c_uint = 5;
pub const SIXEL_DIFFUSE_BURKES: ::std::os::raw::c_uint = 6;
pub const SIXEL_QUALITY_AUTO: ::std::os::raw::c_uint = 0;
pub const SIXEL_QUALITY_HIGH: ::std::os::raw::c_uint = 1;
pub const SIXEL_QUALITY_LOW: ::std::os::raw::c_uint = 2;
pub const SIXEL_QUALITY_FULL: ::std::os::raw::c_uint = 3;
pub const SIXEL_QUALITY_HIGHCOLOR: ::std::os::raw::c_uint = 4;
pub const SIXEL_BUILTIN_MONO_DARK: ::std::os::raw::c_uint = 0;
pub const SIXEL_BUILTIN_MONO_LIGHT: ::std::os::raw::c_uint = 1;
pub const SIXEL_BUILTIN_XTERM16: ::std::os::raw::c_uint = 2;
pub const SIXEL_BUILTIN_XTERM256: ::std::os::raw::c_uint = 3;
pub const SIXEL_BUILTIN_VT340_MONO: ::std::os::raw::c_uint = 4;
pub const SIXEL_BUILTIN_VT340_COLOR: ::std::os::raw::c_uint = 5;
pub const SIXEL_BUILTIN_G1: ::std::os::raw::c_uint = 6;
pub const SIXEL_BUILTIN_G2: ::std::os::raw::c_uint = 7;
pub const SIXEL_BUILTIN_G4: ::std::os::raw::c_uint = 8;
pub const SIXEL_BUILTIN_G8: ::std::os::raw::c_uint = 9;
pub const SIXEL_FORMATTYPE_COLOR: ::std::os::raw::c_uint = 0;
pub const SIXEL_FORMATTYPE_GRAYSCALE: ::std::os::raw::c_uint = 64;
pub const SIXEL_FORMATTYPE_PALETTE: ::std::os::raw::c_uint = 128;
pub const SIXEL_PIXELFORMAT_RGB555: ::std::os::raw::c_uint = 1;
pub const SIXEL_PIXELFORMAT_RGB565: ::std::os::raw::c_uint = 2;
pub const SIXEL_PIXELFORMAT_RGB888: ::std::os::raw::c_uint = 3;
pub const SIXEL_PIXELFORMAT_BGR555: ::std::os::raw::c_uint = 4;
pub const SIXEL_PIXELFORMAT_BGR565: ::std::os::raw::c_uint = 5;
pub const SIXEL_PIXELFORMAT_BGR888: ::std::os::raw::c_uint = 6;
pub const SIXEL_PIXELFORMAT_ARGB8888: ::std::os::raw::c_uint = 16;
pub const SIXEL_PIXELFORMAT_RGBA8888: ::std::os::raw::c_uint = 17;
pub const SIXEL_PIXELFORMAT_ABGR8888: ::std::os::raw::c_uint = 18;
pub const SIXEL_PIXELFORMAT_BGRA8888: ::std::os::raw::c_uint = 19;
pub const SIXEL_PIXELFORMAT_G1: ::std::os::raw::c_uint = 64;
pub const SIXEL_PIXELFORMAT_G2: ::std::os::raw::c_uint = 65;
pub const SIXEL_PIXELFORMAT_G4: ::std::os::raw::c_uint = 66;
pub const SIXEL_PIXELFORMAT_G8: ::std::os::raw::c_uint = 67;
pub const SIXEL_PIXELFORMAT_AG88: ::std::os::raw::c_uint = 83;
pub const SIXEL_PIXELFORMAT_GA88: ::std::os::raw::c_uint = 99;
pub const SIXEL_PIXELFORMAT_PAL1: ::std::os::raw::c_uint = 128;
pub const SIXEL_PIXELFORMAT_PAL2: ::std::os::raw::c_uint = 129;
pub const SIXEL_PIXELFORMAT_PAL4: ::std::os::raw::c_uint = 130;
pub const SIXEL_PIXELFORMAT_PAL8: ::std::os::raw::c_uint = 131;
pub const SIXEL_PALETTETYPE_AUTO: ::std::os::raw::c_uint = 0;
pub const SIXEL_PALETTETYPE_HLS: ::std::os::raw::c_uint = 1;
pub const SIXEL_PALETTETYPE_RGB: ::std::os::raw::c_uint = 2;
pub const SIXEL_ENCODEPOLICY_AUTO: ::std::os::raw::c_uint = 0;
pub const SIXEL_ENCODEPOLICY_FAST: ::std::os::raw::c_uint = 1;
pub const SIXEL_ENCODEPOLICY_SIZE: ::std::os::raw::c_uint = 2;
pub const SIXEL_RES_NEAREST: ::std::os::raw::c_uint = 0;
pub const SIXEL_RES_GAUSSIAN: ::std::os::raw::c_uint = 1;
pub const SIXEL_RES_HANNING: ::std::os::raw::c_uint = 2;
pub const SIXEL_RES_HAMMING: ::std::os::raw::c_uint = 3;
pub const SIXEL_RES_BILINEAR: ::std::os::raw::c_uint = 4;
pub const SIXEL_RES_WELSH: ::std::os::raw::c_uint = 5;
pub const SIXEL_RES_BICUBIC: ::std::os::raw::c_uint = 6;
pub const SIXEL_RES_LANCZOS2: ::std::os::raw::c_uint = 7;
pub const SIXEL_RES_LANCZOS3: ::std::os::raw::c_uint = 8;
pub const SIXEL_RES_LANCZOS4: ::std::os::raw::c_uint = 9;
pub const SIXEL_FORMAT_GIF: ::std::os::raw::c_uint = 0;
pub const SIXEL_FORMAT_PNG: ::std::os::raw::c_uint = 1;
pub const SIXEL_FORMAT_BMP: ::std::os::raw::c_uint = 2;
pub const SIXEL_FORMAT_JPG: ::std::os::raw::c_uint = 3;
pub const SIXEL_FORMAT_TGA: ::std::os::raw::c_uint = 4;
pub const SIXEL_FORMAT_WBMP: ::std::os::raw::c_uint = 5;
pub const SIXEL_FORMAT_TIFF: ::std::os::raw::c_uint = 6;
pub const SIXEL_FORMAT_SIXEL: ::std::os::raw::c_uint = 7;
pub const SIXEL_FORMAT_PNM: ::std::os::raw::c_uint = 8;
pub const SIXEL_FORMAT_GD2: ::std::os::raw::c_uint = 9;
pub const SIXEL_FORMAT_PSD: ::std::os::raw::c_uint = 10;
pub const SIXEL_FORMAT_HDR: ::std::os::raw::c_uint = 11;
pub const SIXEL_LOOP_AUTO: ::std::os::raw::c_uint = 0;
pub const SIXEL_LOOP_FORCE: ::std::os::raw::c_uint = 1;
pub const SIXEL_LOOP_DISABLE: ::std::os::raw::c_uint = 2;
pub const SIXEL_OPTFLAG_INPUT: u8 = b'i';
pub const SIXEL_OPTFLAG_OUTPUT: u8 = b'o';
pub const SIXEL_OPTFLAG_OUTFILE: u8 = b'o';
pub const SIXEL_OPTFLAG_7BIT_MODE: u8 = b'7';
pub const SIXEL_OPTFLAG_8BIT_MODE: u8 = b'8';
pub const SIXEL_OPTFLAG_HAS_GRI_ARG_LIMIT: u8 = b'R';
pub const SIXEL_OPTFLAG_COLORS: u8 = b'p';
pub const SIXEL_OPTFLAG_MAPFILE: u8 = b'm';
pub const SIXEL_OPTFLAG_MONOCHROME: u8 = b'e';
pub const SIXEL_OPTFLAG_INSECURE: u8 = b'k';
pub const SIXEL_OPTFLAG_INVERT: u8 = b'i';
pub const SIXEL_OPTFLAG_HIGH_COLOR: u8 = b'I';
pub const SIXEL_OPTFLAG_USE_MACRO: u8 = b'u';
pub const SIXEL_OPTFLAG_MACRO_NUMBER: u8 = b'n';
pub const SIXEL_OPTFLAG_COMPLEXION_SCORE: u8 = b'C';
pub const SIXEL_OPTFLAG_IGNORE_DELAY: u8 = b'g';
pub const SIXEL_OPTFLAG_STATIC: u8 = b'S';
pub const SIXEL_OPTFLAG_DIFFUSION: u8 = b'd';
pub const SIXEL_OPTFLAG_FIND_LARGEST: u8 = b'f';
pub const SIXEL_OPTFLAG_SELECT_COLOR: u8 = b's';
pub const SIXEL_OPTFLAG_CROP: u8 = b'c';
pub const SIXEL_OPTFLAG_WIDTH: u8 = b'w';
pub const SIXEL_OPTFLAG_HEIGHT: u8 = b'h';
pub const SIXEL_OPTFLAG_RESAMPLING: u8 = b'r';
pub const SIXEL_OPTFLAG_QUALITY: u8 = b'q';
pub const SIXEL_OPTFLAG_LOOPMODE: u8 = b'l';
pub const SIXEL_OPTFLAG_PALETTE_TYPE: u8 = b't';
pub const SIXEL_OPTFLAG_BUILTIN_PALETTE: u8 = b'b';
pub const SIXEL_OPTFLAG_ENCODE_POLICY: u8 = b'E';
pub const SIXEL_OPTFLAG_BGCOLOR: u8 = b'B';
pub const SIXEL_OPTFLAG_PENETRATE: u8 = b'P';
pub const SIXEL_OPTFLAG_PIPE_MODE: u8 = b'D';
pub const SIXEL_OPTFLAG_VERBOSE: u8 = b'v';
pub const SIXEL_OPTFLAG_VERSION: u8 = b'V';
pub const SIXEL_OPTFLAG_HELP: u8 = b'H';
pub type wchar_t = ::std::os::raw::c_int;
pub type SIXELSTATUS = ::std::os::raw::c_int;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum characterSize { CSIZE_7BIT = 0, CSIZE_8BIT = 1, }
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum methodForLargest { LARGE_AUTO = 0, LARGE_NORM = 1, LARGE_LUM = 2, }
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum methodForRep {
REP_AUTO = 0,
REP_CENTER_BOX = 1,
REP_AVERAGE_COLORS = 2,
REP_AVERAGE_PIXELS = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum methodForDiffuse {
DIFFUSE_AUTO = 0,
DIFFUSE_NONE = 1,
DIFFUSE_ATKINSON = 2,
DIFFUSE_FS = 3,
DIFFUSE_JAJUNI = 4,
DIFFUSE_STUCKI = 5,
DIFFUSE_BURKES = 6,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum qualityMode {
QUALITY_AUTO = 0,
QUALITY_HIGH = 1,
QUALITY_LOW = 2,
QUALITY_FULL = 3,
QUALITY_HIGHCOLOR = 4,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum builtinDither {
BUILTIN_MONO_DARK = 0,
BUILTIN_MONO_LIGHT = 1,
BUILTIN_XTERM16 = 2,
BUILTIN_XTERM256 = 3,
BUILTIN_VT340_MONO = 4,
BUILTIN_VT340_COLOR = 5,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum formatType {
FORMATTYPE_COLOR = 0,
FORMATTYPE_GRAYSCALE = 64,
FORMATTYPE_PALETTE = 128,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pixelFormat {
PIXELFORMAT_RGB555 = 1,
PIXELFORMAT_RGB565 = 2,
PIXELFORMAT_RGB888 = 3,
PIXELFORMAT_BGR555 = 4,
PIXELFORMAT_BGR565 = 5,
PIXELFORMAT_BGR888 = 6,
PIXELFORMAT_ARGB8888 = 16,
PIXELFORMAT_RGBA8888 = 17,
PIXELFORMAT_G1 = 64,
PIXELFORMAT_G2 = 65,
PIXELFORMAT_G4 = 66,
PIXELFORMAT_G8 = 67,
PIXELFORMAT_AG88 = 83,
PIXELFORMAT_GA88 = 99,
PIXELFORMAT_PAL1 = 128,
PIXELFORMAT_PAL2 = 129,
PIXELFORMAT_PAL4 = 130,
PIXELFORMAT_PAL8 = 131,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum paletteType {
PALETTETYPE_AUTO = 0,
PALETTETYPE_HLS = 1,
PALETTETYPE_RGB = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum encodePolicy {
ENCODEPOLICY_AUTO = 0,
ENCODEPOLICY_FAST = 1,
ENCODEPOLICY_SIZE = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum methodForResampling {
RES_NEAREST = 0,
RES_GAUSSIAN = 1,
RES_HANNING = 2,
RES_HAMMING = 3,
RES_BILINEAR = 4,
RES_WELSH = 5,
RES_BICUBIC = 6,
RES_LANCZOS2 = 7,
RES_LANCZOS3 = 8,
RES_LANCZOS4 = 9,
}
pub type sixel_malloc_t =
::std::option::Option<unsafe extern "C" fn(arg1: usize)
-> *mut ::std::os::raw::c_void>;
pub type sixel_calloc_t =
::std::option::Option<unsafe extern "C" fn(arg1: usize, arg2: usize)
-> *mut ::std::os::raw::c_void>;
pub type sixel_realloc_t =
::std::option::Option<unsafe extern "C" fn(arg1:
*mut ::std::os::raw::c_void,
arg2: usize)
-> *mut ::std::os::raw::c_void>;
pub type sixel_free_t =
::std::option::Option<unsafe extern "C" fn(arg1:
*mut ::std::os::raw::c_void)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sixel_allocator([u8; 0]);
pub type sixel_allocator_t = sixel_allocator;
extern "C" {
pub fn sixel_allocator_new(ppallocator: *mut *mut sixel_allocator_t,
fn_malloc: sixel_malloc_t,
fn_calloc: sixel_calloc_t,
fn_realloc: sixel_realloc_t,
fn_free: sixel_free_t) -> SIXELSTATUS;
}
extern "C" {
pub fn sixel_allocator_ref(allocator: *mut sixel_allocator_t);
}
extern "C" {
pub fn sixel_allocator_unref(allocator: *mut sixel_allocator_t);
}
extern "C" {
pub fn sixel_allocator_malloc(allocator: *mut sixel_allocator_t, n: usize)
-> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn sixel_allocator_calloc(allocator: *mut sixel_allocator_t,
nelm: usize, elsize: usize)
-> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn sixel_allocator_realloc(allocator: *mut sixel_allocator_t,
p: *mut ::std::os::raw::c_void, n: usize)
-> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn sixel_allocator_free(allocator: *mut sixel_allocator_t,
p: *mut ::std::os::raw::c_void);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sixel_output([u8; 0]);
pub type sixel_output_t = sixel_output;
pub type sixel_write_function =
::std::option::Option<unsafe extern "C" fn(data:
*mut ::std::os::raw::c_char,
size: ::std::os::raw::c_int,
priv_:
*mut ::std::os::raw::c_void)
-> ::std::os::raw::c_int>;
extern "C" {
pub fn sixel_output_new(output: *mut *mut sixel_output_t,
fn_write: sixel_write_function,
priv_: *mut ::std::os::raw::c_void,
allocator: *mut sixel_allocator_t) -> SIXELSTATUS;
}
extern "C" {
pub fn sixel_output_create(fn_write: sixel_write_function,
priv_: *mut ::std::os::raw::c_void)
-> *mut sixel_output_t;
}
extern "C" {
pub fn sixel_output_destroy(output: *mut sixel_output_t);
}
extern "C" {
pub fn sixel_output_ref(output: *mut sixel_output_t);
}
extern "C" {
pub fn sixel_output_unref(output: *mut sixel_output_t);
}
extern "C" {
pub fn sixel_output_get_8bit_availability(output: *mut sixel_output_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_output_set_8bit_availability(output: *mut sixel_output_t,
availability:
::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_output_set_gri_arg_limit(output: *mut sixel_output_t,
value: ::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_output_set_penetrate_multiplexer(output: *mut sixel_output_t,
penetrate:
::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_output_set_skip_dcs_envelope(output: *mut sixel_output_t,
skip: ::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_output_set_palette_type(output: *mut sixel_output_t,
palettetype: ::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_output_set_encode_policy(output: *mut sixel_output_t,
encode_policy:
::std::os::raw::c_int);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sixel_dither([u8; 0]);
pub type sixel_dither_t = sixel_dither;
extern "C" {
pub fn sixel_dither_new(ppdither: *mut *mut sixel_dither_t,
ncolors: ::std::os::raw::c_int,
allocator: *mut sixel_allocator_t) -> SIXELSTATUS;
}
extern "C" {
pub fn sixel_dither_create(ncolors: ::std::os::raw::c_int)
-> *mut sixel_dither_t;
}
extern "C" {
pub fn sixel_dither_get(builtin_dither: ::std::os::raw::c_int)
-> *mut sixel_dither_t;
}
extern "C" {
pub fn sixel_dither_destroy(dither: *mut sixel_dither_t);
}
extern "C" {
pub fn sixel_dither_ref(dither: *mut sixel_dither_t);
}
extern "C" {
pub fn sixel_dither_unref(dither: *mut sixel_dither_t);
}
extern "C" {
pub fn sixel_dither_initialize(dither: *mut sixel_dither_t,
data: *mut ::std::os::raw::c_uchar,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
pixelformat: ::std::os::raw::c_int,
method_for_largest: ::std::os::raw::c_int,
method_for_rep: ::std::os::raw::c_int,
quality_mode: ::std::os::raw::c_int)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_dither_set_diffusion_type(dither: *mut sixel_dither_t,
method_for_diffuse:
::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_dither_get_num_of_palette_colors(dither: *mut sixel_dither_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_dither_get_num_of_histogram_colors(dither:
*mut sixel_dither_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_dither_get_num_of_histgram_colors(dither:
*mut sixel_dither_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_dither_get_palette(dither: *mut sixel_dither_t)
-> *mut ::std::os::raw::c_uchar;
}
extern "C" {
pub fn sixel_dither_set_palette(dither: *mut sixel_dither_t,
palette: *mut ::std::os::raw::c_uchar);
}
extern "C" {
pub fn sixel_dither_set_complexion_score(dither: *mut sixel_dither_t,
score: ::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_dither_set_body_only(dither: *mut sixel_dither_t,
bodyonly: ::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_dither_set_optimize_palette(dither: *mut sixel_dither_t,
do_opt: ::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_dither_set_pixelformat(dither: *mut sixel_dither_t,
pixelformat: ::std::os::raw::c_int);
}
extern "C" {
pub fn sixel_dither_set_transparent(dither: *mut sixel_dither_t,
transparent: ::std::os::raw::c_int);
}
pub type sixel_allocator_function =
::std::option::Option<unsafe extern "C" fn(size: usize)
-> *mut ::std::os::raw::c_void>;
extern "C" {
pub fn sixel_encode(pixels: *mut ::std::os::raw::c_uchar,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
depth: ::std::os::raw::c_int,
dither: *mut sixel_dither_t,
context: *mut sixel_output_t) -> SIXELSTATUS;
}
extern "C" {
pub fn sixel_decode_raw(p: *mut ::std::os::raw::c_uchar,
len: ::std::os::raw::c_int,
pixels: *mut *mut ::std::os::raw::c_uchar,
pwidth: *mut ::std::os::raw::c_int,
pheight: *mut ::std::os::raw::c_int,
palette: *mut *mut ::std::os::raw::c_uchar,
ncolors: *mut ::std::os::raw::c_int,
allocator: *mut sixel_allocator_t) -> SIXELSTATUS;
}
extern "C" {
pub fn sixel_decode(sixels: *mut ::std::os::raw::c_uchar,
size: ::std::os::raw::c_int,
pixels: *mut *mut ::std::os::raw::c_uchar,
pwidth: *mut ::std::os::raw::c_int,
pheight: *mut ::std::os::raw::c_int,
palette: *mut *mut ::std::os::raw::c_uchar,
ncolors: *mut ::std::os::raw::c_int,
fn_malloc: sixel_allocator_function) -> SIXELSTATUS;
}
extern "C" {
pub fn sixel_helper_set_additional_message(message:
*const ::std::os::raw::c_char);
}
extern "C" {
pub fn sixel_helper_get_additional_message()
-> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn sixel_helper_format_error(status: SIXELSTATUS)
-> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn sixel_helper_compute_depth(pixelformat: ::std::os::raw::c_int)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_helper_normalize_pixelformat(dst:
*mut ::std::os::raw::c_uchar,
dst_pixelformat:
*mut ::std::os::raw::c_int,
src:
*const ::std::os::raw::c_uchar,
src_pixelformat:
::std::os::raw::c_int,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_helper_scale_image(dst: *mut ::std::os::raw::c_uchar,
src: *const ::std::os::raw::c_uchar,
srcw: ::std::os::raw::c_int,
srch: ::std::os::raw::c_int,
pixelformat: ::std::os::raw::c_int,
dstw: ::std::os::raw::c_int,
dsth: ::std::os::raw::c_int,
method_for_resampling:
::std::os::raw::c_int,
allocator: *mut sixel_allocator_t)
-> SIXELSTATUS;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum imageFormat {
FORMAT_GIF = 0,
FORMAT_PNG = 1,
FORMAT_BMP = 2,
FORMAT_JPG = 3,
FORMAT_TGA = 4,
FORMAT_WBMP = 5,
FORMAT_TIFF = 6,
FORMAT_SIXEL = 7,
FORMAT_PNM = 8,
FORMAT_GD2 = 9,
FORMAT_PSD = 10,
FORMAT_HDR = 11,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum loopControl { LOOP_AUTO = 0, LOOP_FORCE = 1, LOOP_DISABLE = 2, }
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sixel_frame([u8; 0]);
pub type sixel_frame_t = sixel_frame;
extern "C" {
pub fn sixel_frame_new(ppframe: *mut *mut sixel_frame_t,
allocator: *mut sixel_allocator_t) -> SIXELSTATUS;
}
extern "C" {
pub fn sixel_frame_create() -> *mut sixel_frame_t;
}
extern "C" {
pub fn sixel_frame_ref(frame: *mut sixel_frame_t);
}
extern "C" {
pub fn sixel_frame_unref(frame: *mut sixel_frame_t);
}
extern "C" {
pub fn sixel_frame_init(frame: *mut sixel_frame_t,
pixels: *mut ::std::os::raw::c_uchar,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
pixelformat: ::std::os::raw::c_int,
palette: *mut ::std::os::raw::c_uchar,
ncolors: ::std::os::raw::c_int) -> SIXELSTATUS;
}
extern "C" {
pub fn sixel_frame_get_pixels(frame: *mut sixel_frame_t)
-> *mut ::std::os::raw::c_uchar;
}
extern "C" {
pub fn sixel_frame_get_palette(frame: *mut sixel_frame_t)
-> *mut ::std::os::raw::c_uchar;
}
extern "C" {
pub fn sixel_frame_get_width(frame: *mut sixel_frame_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_get_height(frame: *mut sixel_frame_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_get_ncolors(frame: *mut sixel_frame_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_get_pixelformat(frame: *mut sixel_frame_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_get_transparent(frame: *mut sixel_frame_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_get_multiframe(frame: *mut sixel_frame_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_get_delay(frame: *mut sixel_frame_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_get_frame_no(frame: *mut sixel_frame_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_get_loop_no(frame: *mut sixel_frame_t)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_strip_alpha(frame: *mut sixel_frame_t,
bgcolor: *mut ::std::os::raw::c_uchar)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn sixel_frame_resize(frame: *mut sixel_frame_t,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
method_for_resampling: ::std::os::raw::c_int)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_frame_clip(frame: *mut sixel_frame_t,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int) -> SIXELSTATUS;
}
pub type sixel_load_image_function =
::std::option::Option<unsafe extern "C" fn(frame: *mut sixel_frame_t,
context:
*mut ::std::os::raw::c_void)
-> SIXELSTATUS>;
extern "C" {
pub fn sixel_helper_load_image_file(filename:
*const ::std::os::raw::c_char,
fstatic: ::std::os::raw::c_int,
fuse_palette: ::std::os::raw::c_int,
reqcolors: ::std::os::raw::c_int,
bgcolor: *mut ::std::os::raw::c_uchar,
loop_control: ::std::os::raw::c_int,
fn_load: sixel_load_image_function,
finsecure: ::std::os::raw::c_int,
cancel_flag:
*const ::std::os::raw::c_int,
context: *mut ::std::os::raw::c_void,
allocator: *mut sixel_allocator_t)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_helper_write_image_file(data: *mut ::std::os::raw::c_uchar,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
palette:
*mut ::std::os::raw::c_uchar,
pixelformat: ::std::os::raw::c_int,
filename:
*const ::std::os::raw::c_char,
imageformat: ::std::os::raw::c_int,
allocator: *mut sixel_allocator_t)
-> SIXELSTATUS;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sixel_encoder([u8; 0]);
pub type sixel_encoder_t = sixel_encoder;
extern "C" {
pub fn sixel_encoder_new(ppencoder: *mut *mut sixel_encoder_t,
allocator: *mut sixel_allocator_t)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_encoder_create() -> *mut sixel_encoder_t;
}
extern "C" {
pub fn sixel_encoder_ref(encoder: *mut sixel_encoder_t);
}
extern "C" {
pub fn sixel_encoder_unref(encoder: *mut sixel_encoder_t);
}
extern "C" {
pub fn sixel_encoder_set_cancel_flag(encoder: *mut sixel_encoder_t,
cancel_flag:
*mut ::std::os::raw::c_int)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_encoder_setopt(encoder: *mut sixel_encoder_t,
arg: ::std::os::raw::c_int,
optarg: *const ::std::os::raw::c_char)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_encoder_encode(encoder: *mut sixel_encoder_t,
filename: *const ::std::os::raw::c_char)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_encoder_encode_bytes(encoder: *mut sixel_encoder_t,
// length = width * height * depth
bytes: *mut ::std::os::raw::c_uchar,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
pixelformat: ::std::os::raw::c_int,
palette: *mut ::std::os::raw::c_uchar,
ncolors: ::std::os::raw::c_int)
-> SIXELSTATUS;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sixel_decoder([u8; 0]);
pub type sixel_decoder_t = sixel_decoder;
extern "C" {
pub fn sixel_decoder_new(ppdecoder: *mut *mut sixel_decoder_t,
allocator: *mut sixel_allocator_t)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_decoder_create() -> *mut sixel_decoder_t;
}
extern "C" {
pub fn sixel_decoder_ref(decoder: *mut sixel_decoder_t);
}
extern "C" {
pub fn sixel_decoder_unref(decoder: *mut sixel_decoder_t);
}
extern "C" {
pub fn sixel_decoder_setopt(decoder: *mut sixel_decoder_t,
arg: ::std::os::raw::c_int,
optarg: *const ::std::os::raw::c_char)
-> SIXELSTATUS;
}
extern "C" {
pub fn sixel_decoder_decode(decoder: *mut sixel_decoder_t) -> SIXELSTATUS;
}