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
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
/* automatically generated by rust-bindgen */

pub const WEBP_ENCODER_ABI_VERSION: ::std::os::raw::c_int = 527;
pub const WEBP_MAX_DIMENSION: ::std::os::raw::c_int = 16383;
pub const WEBP_DECODER_ABI_VERSION: ::std::os::raw::c_int = 521;
pub const WEBP_MUX_ABI_VERSION: ::std::os::raw::c_int = 264;
extern "C" {
    pub fn WebPMalloc(size: usize) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn WebPFree(ptr: *mut ::std::os::raw::c_void);
}
extern "C" {
    pub fn WebPGetEncoderVersion() -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPEncodeRGB(
        rgb: *const u8,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        stride: ::std::os::raw::c_int,
        quality_factor: f32,
        output: *mut *mut u8,
    ) -> usize;
}
extern "C" {
    pub fn WebPEncodeBGR(
        bgr: *const u8,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        stride: ::std::os::raw::c_int,
        quality_factor: f32,
        output: *mut *mut u8,
    ) -> usize;
}
extern "C" {
    pub fn WebPEncodeRGBA(
        rgba: *const u8,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        stride: ::std::os::raw::c_int,
        quality_factor: f32,
        output: *mut *mut u8,
    ) -> usize;
}
extern "C" {
    pub fn WebPEncodeBGRA(
        bgra: *const u8,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        stride: ::std::os::raw::c_int,
        quality_factor: f32,
        output: *mut *mut u8,
    ) -> usize;
}
extern "C" {
    pub fn WebPEncodeLosslessRGB(
        rgb: *const u8,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        stride: ::std::os::raw::c_int,
        output: *mut *mut u8,
    ) -> usize;
}
extern "C" {
    pub fn WebPEncodeLosslessBGR(
        bgr: *const u8,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        stride: ::std::os::raw::c_int,
        output: *mut *mut u8,
    ) -> usize;
}
extern "C" {
    pub fn WebPEncodeLosslessRGBA(
        rgba: *const u8,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        stride: ::std::os::raw::c_int,
        output: *mut *mut u8,
    ) -> usize;
}
extern "C" {
    pub fn WebPEncodeLosslessBGRA(
        bgra: *const u8,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        stride: ::std::os::raw::c_int,
        output: *mut *mut u8,
    ) -> usize;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WebPImageHint {
    WEBP_HINT_DEFAULT = 0,
    WEBP_HINT_PICTURE = 1,
    WEBP_HINT_PHOTO = 2,
    WEBP_HINT_GRAPH = 3,
    WEBP_HINT_LAST = 4,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPConfig {
    pub lossless: ::std::os::raw::c_int,
    pub quality: f32,
    pub method: ::std::os::raw::c_int,
    pub image_hint: WebPImageHint,
    pub target_size: ::std::os::raw::c_int,
    pub target_PSNR: f32,
    pub segments: ::std::os::raw::c_int,
    pub sns_strength: ::std::os::raw::c_int,
    pub filter_strength: ::std::os::raw::c_int,
    pub filter_sharpness: ::std::os::raw::c_int,
    pub filter_type: ::std::os::raw::c_int,
    pub autofilter: ::std::os::raw::c_int,
    pub alpha_compression: ::std::os::raw::c_int,
    pub alpha_filtering: ::std::os::raw::c_int,
    pub alpha_quality: ::std::os::raw::c_int,
    pub pass: ::std::os::raw::c_int,
    pub show_compressed: ::std::os::raw::c_int,
    pub preprocessing: ::std::os::raw::c_int,
    pub partitions: ::std::os::raw::c_int,
    pub partition_limit: ::std::os::raw::c_int,
    pub emulate_jpeg_size: ::std::os::raw::c_int,
    pub thread_level: ::std::os::raw::c_int,
    pub low_memory: ::std::os::raw::c_int,
    pub near_lossless: ::std::os::raw::c_int,
    pub exact: ::std::os::raw::c_int,
    pub use_delta_palette: ::std::os::raw::c_int,
    pub use_sharp_yuv: ::std::os::raw::c_int,
    pub pad: [u32; 2usize],
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WebPPreset {
    WEBP_PRESET_DEFAULT = 0,
    WEBP_PRESET_PICTURE = 1,
    WEBP_PRESET_PHOTO = 2,
    WEBP_PRESET_DRAWING = 3,
    WEBP_PRESET_ICON = 4,
    WEBP_PRESET_TEXT = 5,
}
extern "C" {
    pub fn WebPConfigInitInternal(
        arg1: *mut WebPConfig,
        arg2: WebPPreset,
        arg3: f32,
        arg4: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPConfigLosslessPreset(
        config: *mut WebPConfig,
        level: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPValidateConfig(config: *const WebPConfig) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPAuxStats {
    pub coded_size: ::std::os::raw::c_int,
    pub PSNR: [f32; 5usize],
    pub block_count: [::std::os::raw::c_int; 3usize],
    pub header_bytes: [::std::os::raw::c_int; 2usize],
    pub residual_bytes: [[::std::os::raw::c_int; 4usize]; 3usize],
    pub segment_size: [::std::os::raw::c_int; 4usize],
    pub segment_quant: [::std::os::raw::c_int; 4usize],
    pub segment_level: [::std::os::raw::c_int; 4usize],
    pub alpha_data_size: ::std::os::raw::c_int,
    pub layer_data_size: ::std::os::raw::c_int,
    pub lossless_features: u32,
    pub histogram_bits: ::std::os::raw::c_int,
    pub transform_bits: ::std::os::raw::c_int,
    pub cache_bits: ::std::os::raw::c_int,
    pub palette_size: ::std::os::raw::c_int,
    pub lossless_size: ::std::os::raw::c_int,
    pub lossless_hdr_size: ::std::os::raw::c_int,
    pub lossless_data_size: ::std::os::raw::c_int,
    pub pad: [u32; 2usize],
}
pub type WebPWriterFunction = ::std::option::Option<
    unsafe extern "C" fn(
        data: *const u8,
        data_size: usize,
        picture: *const WebPPicture,
    ) -> ::std::os::raw::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPMemoryWriter {
    pub mem: *mut u8,
    pub size: usize,
    pub max_size: usize,
    pub pad: [u32; 1usize],
}
extern "C" {
    pub fn WebPMemoryWriterInit(writer: *mut WebPMemoryWriter);
}
extern "C" {
    pub fn WebPMemoryWriterClear(writer: *mut WebPMemoryWriter);
}
extern "C" {
    pub fn WebPMemoryWrite(
        data: *const u8,
        data_size: usize,
        picture: *const WebPPicture,
    ) -> ::std::os::raw::c_int;
}
pub type WebPProgressHook = ::std::option::Option<
    unsafe extern "C" fn(
        percent: ::std::os::raw::c_int,
        picture: *const WebPPicture,
    ) -> ::std::os::raw::c_int,
>;
impl WebPEncCSP {
    pub const WEBP_CSP_ALPHA_BIT: WebPEncCSP = WebPEncCSP::WEBP_YUV420A;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WebPEncCSP {
    WEBP_YUV420 = 0,
    WEBP_YUV420A = 4,
    WEBP_CSP_UV_MASK = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WebPEncodingError {
    VP8_ENC_OK = 0,
    VP8_ENC_ERROR_OUT_OF_MEMORY = 1,
    VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY = 2,
    VP8_ENC_ERROR_NULL_PARAMETER = 3,
    VP8_ENC_ERROR_INVALID_CONFIGURATION = 4,
    VP8_ENC_ERROR_BAD_DIMENSION = 5,
    VP8_ENC_ERROR_PARTITION0_OVERFLOW = 6,
    VP8_ENC_ERROR_PARTITION_OVERFLOW = 7,
    VP8_ENC_ERROR_BAD_WRITE = 8,
    VP8_ENC_ERROR_FILE_TOO_BIG = 9,
    VP8_ENC_ERROR_USER_ABORT = 10,
    VP8_ENC_ERROR_LAST = 11,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPPicture {
    ///
    pub use_argb: ::std::os::raw::c_int,
    pub colorspace: WebPEncCSP,
    pub width: ::std::os::raw::c_int,
    pub height: ::std::os::raw::c_int,
    pub y: *mut u8,
    pub u: *mut u8,
    pub v: *mut u8,
    pub y_stride: ::std::os::raw::c_int,
    pub uv_stride: ::std::os::raw::c_int,
    pub a: *mut u8,
    pub a_stride: ::std::os::raw::c_int,
    pub pad1: [u32; 2usize],
    pub argb: *mut u32,
    pub argb_stride: ::std::os::raw::c_int,
    pub pad2: [u32; 3usize],
    ///
    pub writer: WebPWriterFunction,
    pub custom_ptr: *mut ::std::os::raw::c_void,
    pub extra_info_type: ::std::os::raw::c_int,
    pub extra_info: *mut u8,
    ///
    pub stats: *mut WebPAuxStats,
    pub error_code: WebPEncodingError,
    pub progress_hook: WebPProgressHook,
    pub user_data: *mut ::std::os::raw::c_void,
    pub pad3: [u32; 3usize],
    pub pad4: *mut u8,
    pub pad5: *mut u8,
    pub pad6: [u32; 8usize],
    ///
    pub memory_: *mut ::std::os::raw::c_void,
    pub memory_argb_: *mut ::std::os::raw::c_void,
    pub pad7: [*mut ::std::os::raw::c_void; 2usize],
}
extern "C" {
    pub fn WebPPictureInitInternal(
        arg1: *mut WebPPicture,
        arg2: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureAlloc(picture: *mut WebPPicture) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureFree(picture: *mut WebPPicture);
}
extern "C" {
    pub fn WebPPictureCopy(src: *const WebPPicture, dst: *mut WebPPicture)
        -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPlaneDistortion(
        src: *const u8,
        src_stride: usize,
        ref_: *const u8,
        ref_stride: usize,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        x_step: usize,
        type_: ::std::os::raw::c_int,
        distortion: *mut f32,
        result: *mut f32,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureDistortion(
        src: *const WebPPicture,
        ref_: *const WebPPicture,
        metric_type: ::std::os::raw::c_int,
        result: *mut f32,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureCrop(
        picture: *mut WebPPicture,
        left: ::std::os::raw::c_int,
        top: ::std::os::raw::c_int,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureView(
        src: *const WebPPicture,
        left: ::std::os::raw::c_int,
        top: ::std::os::raw::c_int,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        dst: *mut WebPPicture,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureIsView(picture: *const WebPPicture) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureRescale(
        pic: *mut WebPPicture,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureImportRGB(
        picture: *mut WebPPicture,
        rgb: *const u8,
        rgb_stride: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureImportRGBA(
        picture: *mut WebPPicture,
        rgba: *const u8,
        rgba_stride: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureImportRGBX(
        picture: *mut WebPPicture,
        rgbx: *const u8,
        rgbx_stride: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureImportBGR(
        picture: *mut WebPPicture,
        bgr: *const u8,
        bgr_stride: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureImportBGRA(
        picture: *mut WebPPicture,
        bgra: *const u8,
        bgra_stride: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureImportBGRX(
        picture: *mut WebPPicture,
        bgrx: *const u8,
        bgrx_stride: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureARGBToYUVA(
        picture: *mut WebPPicture,
        arg1: WebPEncCSP,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureARGBToYUVADithered(
        picture: *mut WebPPicture,
        colorspace: WebPEncCSP,
        dithering: f32,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureSharpARGBToYUVA(picture: *mut WebPPicture) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureSmartARGBToYUVA(picture: *mut WebPPicture) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPPictureYUVAToARGB(picture: *mut WebPPicture) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPCleanupTransparentArea(picture: *mut WebPPicture);
}
extern "C" {
    pub fn WebPPictureHasTransparency(picture: *const WebPPicture) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPBlendAlpha(pic: *mut WebPPicture, background_rgb: u32);
}
extern "C" {
    pub fn WebPEncode(
        config: *const WebPConfig,
        picture: *mut WebPPicture,
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPIDecoder {
    _unused: [u8; 0],
}
extern "C" {
    pub fn WebPGetDecoderVersion() -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPGetInfo(
        data: *const u8,
        data_size: usize,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPDecodeRGBA(
        data: *const u8,
        data_size: usize,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeARGB(
        data: *const u8,
        data_size: usize,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeBGRA(
        data: *const u8,
        data_size: usize,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeRGB(
        data: *const u8,
        data_size: usize,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeBGR(
        data: *const u8,
        data_size: usize,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeYUV(
        data: *const u8,
        data_size: usize,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
        u: *mut *mut u8,
        v: *mut *mut u8,
        stride: *mut ::std::os::raw::c_int,
        uv_stride: *mut ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeRGBAInto(
        data: *const u8,
        data_size: usize,
        output_buffer: *mut u8,
        output_buffer_size: usize,
        output_stride: ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeARGBInto(
        data: *const u8,
        data_size: usize,
        output_buffer: *mut u8,
        output_buffer_size: usize,
        output_stride: ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeBGRAInto(
        data: *const u8,
        data_size: usize,
        output_buffer: *mut u8,
        output_buffer_size: usize,
        output_stride: ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeRGBInto(
        data: *const u8,
        data_size: usize,
        output_buffer: *mut u8,
        output_buffer_size: usize,
        output_stride: ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeBGRInto(
        data: *const u8,
        data_size: usize,
        output_buffer: *mut u8,
        output_buffer_size: usize,
        output_stride: ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPDecodeYUVInto(
        data: *const u8,
        data_size: usize,
        luma: *mut u8,
        luma_size: usize,
        luma_stride: ::std::os::raw::c_int,
        u: *mut u8,
        u_size: usize,
        u_stride: ::std::os::raw::c_int,
        v: *mut u8,
        v_size: usize,
        v_stride: ::std::os::raw::c_int,
    ) -> *mut u8;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WEBP_CSP_MODE {
    MODE_RGB = 0,
    MODE_RGBA = 1,
    MODE_BGR = 2,
    MODE_BGRA = 3,
    MODE_ARGB = 4,
    MODE_RGBA_4444 = 5,
    MODE_RGB_565 = 6,
    MODE_rgbA = 7,
    MODE_bgrA = 8,
    MODE_Argb = 9,
    MODE_rgbA_4444 = 10,
    MODE_YUV = 11,
    MODE_YUVA = 12,
    MODE_LAST = 13,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPRGBABuffer {
    pub rgba: *mut u8,
    pub stride: ::std::os::raw::c_int,
    pub size: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPYUVABuffer {
    pub y: *mut u8,
    pub u: *mut u8,
    pub v: *mut u8,
    pub a: *mut u8,
    pub y_stride: ::std::os::raw::c_int,
    pub u_stride: ::std::os::raw::c_int,
    pub v_stride: ::std::os::raw::c_int,
    pub a_stride: ::std::os::raw::c_int,
    pub y_size: usize,
    pub u_size: usize,
    pub v_size: usize,
    pub a_size: usize,
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
pub struct WebPDecBuffer {
    pub colorspace: WEBP_CSP_MODE,
    pub width: ::std::os::raw::c_int,
    pub height: ::std::os::raw::c_int,
    pub is_external_memory: ::std::os::raw::c_int,
    pub u: WebPDecBuffer__bindgen_ty_1,
    pub pad: [u32; 4usize],
    pub private_memory: *mut u8,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union WebPDecBuffer__bindgen_ty_1 {
    pub RGBA: WebPRGBABuffer,
    pub YUVA: WebPYUVABuffer,
    _bindgen_union_align: [u64; 10usize],
}
extern "C" {
    pub fn WebPInitDecBufferInternal(
        arg1: *mut WebPDecBuffer,
        arg2: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPFreeDecBuffer(buffer: *mut WebPDecBuffer);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum VP8StatusCode {
    VP8_STATUS_OK = 0,
    VP8_STATUS_OUT_OF_MEMORY = 1,
    VP8_STATUS_INVALID_PARAM = 2,
    VP8_STATUS_BITSTREAM_ERROR = 3,
    VP8_STATUS_UNSUPPORTED_FEATURE = 4,
    VP8_STATUS_SUSPENDED = 5,
    VP8_STATUS_USER_ABORT = 6,
    VP8_STATUS_NOT_ENOUGH_DATA = 7,
}
extern "C" {
    pub fn WebPINewDecoder(output_buffer: *mut WebPDecBuffer) -> *mut WebPIDecoder;
}
extern "C" {
    pub fn WebPINewRGB(
        csp: WEBP_CSP_MODE,
        output_buffer: *mut u8,
        output_buffer_size: usize,
        output_stride: ::std::os::raw::c_int,
    ) -> *mut WebPIDecoder;
}
extern "C" {
    pub fn WebPINewYUVA(
        luma: *mut u8,
        luma_size: usize,
        luma_stride: ::std::os::raw::c_int,
        u: *mut u8,
        u_size: usize,
        u_stride: ::std::os::raw::c_int,
        v: *mut u8,
        v_size: usize,
        v_stride: ::std::os::raw::c_int,
        a: *mut u8,
        a_size: usize,
        a_stride: ::std::os::raw::c_int,
    ) -> *mut WebPIDecoder;
}
extern "C" {
    pub fn WebPINewYUV(
        luma: *mut u8,
        luma_size: usize,
        luma_stride: ::std::os::raw::c_int,
        u: *mut u8,
        u_size: usize,
        u_stride: ::std::os::raw::c_int,
        v: *mut u8,
        v_size: usize,
        v_stride: ::std::os::raw::c_int,
    ) -> *mut WebPIDecoder;
}
extern "C" {
    pub fn WebPIDelete(idec: *mut WebPIDecoder);
}
extern "C" {
    pub fn WebPIAppend(idec: *mut WebPIDecoder, data: *const u8, data_size: usize)
        -> VP8StatusCode;
}
extern "C" {
    pub fn WebPIUpdate(idec: *mut WebPIDecoder, data: *const u8, data_size: usize)
        -> VP8StatusCode;
}
extern "C" {
    pub fn WebPIDecGetRGB(
        idec: *const WebPIDecoder,
        last_y: *mut ::std::os::raw::c_int,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
        stride: *mut ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPIDecGetYUVA(
        idec: *const WebPIDecoder,
        last_y: *mut ::std::os::raw::c_int,
        u: *mut *mut u8,
        v: *mut *mut u8,
        a: *mut *mut u8,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
        stride: *mut ::std::os::raw::c_int,
        uv_stride: *mut ::std::os::raw::c_int,
        a_stride: *mut ::std::os::raw::c_int,
    ) -> *mut u8;
}
extern "C" {
    pub fn WebPIDecodedArea(
        idec: *const WebPIDecoder,
        left: *mut ::std::os::raw::c_int,
        top: *mut ::std::os::raw::c_int,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
    ) -> *const WebPDecBuffer;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPBitstreamFeatures {
    pub width: ::std::os::raw::c_int,
    pub height: ::std::os::raw::c_int,
    pub has_alpha: ::std::os::raw::c_int,
    pub has_animation: ::std::os::raw::c_int,
    pub format: ::std::os::raw::c_int,
    pub pad: [u32; 5usize],
}
extern "C" {
    pub fn WebPGetFeaturesInternal(
        arg1: *const u8,
        arg2: usize,
        arg3: *mut WebPBitstreamFeatures,
        arg4: ::std::os::raw::c_int,
    ) -> VP8StatusCode;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPDecoderOptions {
    pub bypass_filtering: ::std::os::raw::c_int,
    pub no_fancy_upsampling: ::std::os::raw::c_int,
    pub use_cropping: ::std::os::raw::c_int,
    pub crop_left: ::std::os::raw::c_int,
    pub crop_top: ::std::os::raw::c_int,
    pub crop_width: ::std::os::raw::c_int,
    pub crop_height: ::std::os::raw::c_int,
    pub use_scaling: ::std::os::raw::c_int,
    pub scaled_width: ::std::os::raw::c_int,
    pub scaled_height: ::std::os::raw::c_int,
    pub use_threads: ::std::os::raw::c_int,
    pub dithering_strength: ::std::os::raw::c_int,
    pub flip: ::std::os::raw::c_int,
    pub alpha_dithering_strength: ::std::os::raw::c_int,
    pub pad: [u32; 5usize],
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
pub struct WebPDecoderConfig {
    pub input: WebPBitstreamFeatures,
    pub output: WebPDecBuffer,
    pub options: WebPDecoderOptions,
}
extern "C" {
    pub fn WebPInitDecoderConfigInternal(
        arg1: *mut WebPDecoderConfig,
        arg2: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPIDecode(
        data: *const u8,
        data_size: usize,
        config: *mut WebPDecoderConfig,
    ) -> *mut WebPIDecoder;
}
extern "C" {
    pub fn WebPDecode(
        data: *const u8,
        data_size: usize,
        config: *mut WebPDecoderConfig,
    ) -> VP8StatusCode;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WebPFeatureFlags {
    ANIMATION_FLAG = 2,
    XMP_FLAG = 4,
    EXIF_FLAG = 8,
    ALPHA_FLAG = 16,
    ICCP_FLAG = 32,
    ALL_VALID_FLAGS = 62,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WebPMuxAnimDispose {
    WEBP_MUX_DISPOSE_NONE = 0,
    WEBP_MUX_DISPOSE_BACKGROUND = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WebPMuxAnimBlend {
    WEBP_MUX_BLEND = 0,
    WEBP_MUX_NO_BLEND = 1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPData {
    pub bytes: *const u8,
    pub size: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPMux {
    _unused: [u8; 0],
}
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WebPMuxError {
    WEBP_MUX_OK = 1,
    WEBP_MUX_NOT_FOUND = 0,
    WEBP_MUX_INVALID_ARGUMENT = -1,
    WEBP_MUX_BAD_DATA = -2,
    WEBP_MUX_MEMORY_ERROR = -3,
    WEBP_MUX_NOT_ENOUGH_DATA = -4,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WebPChunkId {
    WEBP_CHUNK_VP8X = 0,
    WEBP_CHUNK_ICCP = 1,
    WEBP_CHUNK_ANIM = 2,
    WEBP_CHUNK_ANMF = 3,
    WEBP_CHUNK_DEPRECATED = 4,
    WEBP_CHUNK_ALPHA = 5,
    WEBP_CHUNK_IMAGE = 6,
    WEBP_CHUNK_EXIF = 7,
    WEBP_CHUNK_XMP = 8,
    WEBP_CHUNK_UNKNOWN = 9,
    WEBP_CHUNK_NIL = 10,
}
extern "C" {
    pub fn WebPGetMuxVersion() -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPNewInternal(arg1: ::std::os::raw::c_int) -> *mut WebPMux;
}
extern "C" {
    pub fn WebPMuxDelete(mux: *mut WebPMux);
}
extern "C" {
    pub fn WebPMuxCreateInternal(
        arg1: *const WebPData,
        arg2: ::std::os::raw::c_int,
        arg3: ::std::os::raw::c_int,
    ) -> *mut WebPMux;
}
extern "C" {
    pub fn WebPMuxSetChunk(
        mux: *mut WebPMux,
        fourcc: *const ::std::os::raw::c_char,
        chunk_data: *const WebPData,
        copy_data: ::std::os::raw::c_int,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxGetChunk(
        mux: *const WebPMux,
        fourcc: *const ::std::os::raw::c_char,
        chunk_data: *mut WebPData,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxDeleteChunk(
        mux: *mut WebPMux,
        fourcc: *const ::std::os::raw::c_char,
    ) -> WebPMuxError;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPMuxFrameInfo {
    pub bitstream: WebPData,
    pub x_offset: ::std::os::raw::c_int,
    pub y_offset: ::std::os::raw::c_int,
    pub duration: ::std::os::raw::c_int,
    pub id: WebPChunkId,
    pub dispose_method: WebPMuxAnimDispose,
    pub blend_method: WebPMuxAnimBlend,
    pub pad: [u32; 1usize],
}
extern "C" {
    pub fn WebPMuxSetImage(
        mux: *mut WebPMux,
        bitstream: *const WebPData,
        copy_data: ::std::os::raw::c_int,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxPushFrame(
        mux: *mut WebPMux,
        frame: *const WebPMuxFrameInfo,
        copy_data: ::std::os::raw::c_int,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxGetFrame(
        mux: *const WebPMux,
        nth: u32,
        frame: *mut WebPMuxFrameInfo,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxDeleteFrame(mux: *mut WebPMux, nth: u32) -> WebPMuxError;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPMuxAnimParams {
    pub bgcolor: u32,
    pub loop_count: ::std::os::raw::c_int,
}
extern "C" {
    pub fn WebPMuxSetAnimationParams(
        mux: *mut WebPMux,
        params: *const WebPMuxAnimParams,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxGetAnimationParams(
        mux: *const WebPMux,
        params: *mut WebPMuxAnimParams,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxSetCanvasSize(
        mux: *mut WebPMux,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxGetCanvasSize(
        mux: *const WebPMux,
        width: *mut ::std::os::raw::c_int,
        height: *mut ::std::os::raw::c_int,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxGetFeatures(mux: *const WebPMux, flags: *mut u32) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxNumChunks(
        mux: *const WebPMux,
        id: WebPChunkId,
        num_elements: *mut ::std::os::raw::c_int,
    ) -> WebPMuxError;
}
extern "C" {
    pub fn WebPMuxAssemble(mux: *mut WebPMux, assembled_data: *mut WebPData) -> WebPMuxError;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPAnimEncoder {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct WebPAnimEncoderOptions {
    pub anim_params: WebPMuxAnimParams,
    pub minimize_size: ::std::os::raw::c_int,
    pub kmin: ::std::os::raw::c_int,
    pub kmax: ::std::os::raw::c_int,
    pub allow_mixed: ::std::os::raw::c_int,
    pub verbose: ::std::os::raw::c_int,
    pub padding: [u32; 4usize],
}
extern "C" {
    pub fn WebPAnimEncoderOptionsInitInternal(
        arg1: *mut WebPAnimEncoderOptions,
        arg2: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPAnimEncoderNewInternal(
        arg1: ::std::os::raw::c_int,
        arg2: ::std::os::raw::c_int,
        arg3: *const WebPAnimEncoderOptions,
        arg4: ::std::os::raw::c_int,
    ) -> *mut WebPAnimEncoder;
}
extern "C" {
    pub fn WebPAnimEncoderAdd(
        enc: *mut WebPAnimEncoder,
        frame: *mut WebPPicture,
        timestamp_ms: ::std::os::raw::c_int,
        config: *const WebPConfig,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPAnimEncoderAssemble(
        enc: *mut WebPAnimEncoder,
        webp_data: *mut WebPData,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn WebPAnimEncoderGetError(enc: *mut WebPAnimEncoder) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn WebPAnimEncoderDelete(enc: *mut WebPAnimEncoder);
}