1#![allow(non_upper_case_globals)]
3#![allow(non_camel_case_types)]
4#![allow(non_snake_case)]
5
6pub const JBIG2_VERSION_MAJOR: u32 = 0;
7pub const JBIG2_VERSION_MINOR: u32 = 19;
8#[repr(u32)]
9#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
10pub enum Jbig2Severity {
11 JBIG2_SEVERITY_DEBUG = 0,
12 JBIG2_SEVERITY_INFO = 1,
13 JBIG2_SEVERITY_WARNING = 2,
14 JBIG2_SEVERITY_FATAL = 3,
15}
16#[repr(u32)]
17#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
18pub enum Jbig2Options {
19 JBIG2_OPTIONS_DEFAULT = 0,
20 JBIG2_OPTIONS_EMBEDDED = 1,
21}
22pub type Jbig2Allocator = _Jbig2Allocator;
23#[repr(C)]
24#[derive(Debug, Copy, Clone)]
25pub struct _Jbig2Ctx {
26 _unused: [u8; 0],
27}
28pub type Jbig2Ctx = _Jbig2Ctx;
29#[repr(C)]
30#[derive(Debug, Copy, Clone)]
31pub struct _Jbig2GlobalCtx {
32 _unused: [u8; 0],
33}
34pub type Jbig2GlobalCtx = _Jbig2GlobalCtx;
35pub type Jbig2Image = _Jbig2Image;
36#[repr(C)]
37#[derive(Debug, Copy, Clone)]
38pub struct _Jbig2Image {
39 pub width: u32,
40 pub height: u32,
41 pub stride: u32,
42 pub data: *mut u8,
43 pub refcount: ::std::os::raw::c_int,
44}
45pub type Jbig2ErrorCallback = ::std::option::Option<
46 unsafe extern "C" fn(
47 data: *mut ::std::os::raw::c_void,
48 msg: *const ::std::os::raw::c_char,
49 severity: Jbig2Severity,
50 seg_idx: u32,
51 ),
52>;
53#[repr(C)]
54#[derive(Debug, Copy, Clone)]
55pub struct _Jbig2Allocator {
56 pub alloc: ::std::option::Option<
57 unsafe extern "C" fn(
58 allocator: *mut Jbig2Allocator,
59 size: usize,
60 ) -> *mut ::std::os::raw::c_void,
61 >,
62 pub free: ::std::option::Option<
63 unsafe extern "C" fn(allocator: *mut Jbig2Allocator, p: *mut ::std::os::raw::c_void),
64 >,
65 pub realloc: ::std::option::Option<
66 unsafe extern "C" fn(
67 allocator: *mut Jbig2Allocator,
68 p: *mut ::std::os::raw::c_void,
69 size: usize,
70 ) -> *mut ::std::os::raw::c_void,
71 >,
72}
73extern "C" {
74 pub fn jbig2_ctx_new_imp(
75 allocator: *mut Jbig2Allocator,
76 options: Jbig2Options,
77 global_ctx: *mut Jbig2GlobalCtx,
78 error_callback: Jbig2ErrorCallback,
79 error_callback_data: *mut ::std::os::raw::c_void,
80 jbig2_version_major: ::std::os::raw::c_int,
81 jbig2_version_minor: ::std::os::raw::c_int,
82 ) -> *mut Jbig2Ctx;
83}
84extern "C" {
85 pub fn jbig2_ctx_free(ctx: *mut Jbig2Ctx) -> *mut Jbig2Allocator;
86}
87extern "C" {
88 pub fn jbig2_make_global_ctx(ctx: *mut Jbig2Ctx) -> *mut Jbig2GlobalCtx;
89}
90extern "C" {
91 pub fn jbig2_global_ctx_free(global_ctx: *mut Jbig2GlobalCtx) -> *mut Jbig2Allocator;
92}
93extern "C" {
94 pub fn jbig2_data_in(
95 ctx: *mut Jbig2Ctx,
96 data: *const ::std::os::raw::c_uchar,
97 size: usize,
98 ) -> ::std::os::raw::c_int;
99}
100extern "C" {
101 pub fn jbig2_page_out(ctx: *mut Jbig2Ctx) -> *mut Jbig2Image;
102}
103extern "C" {
104 pub fn jbig2_release_page(ctx: *mut Jbig2Ctx, image: *mut Jbig2Image);
105}
106extern "C" {
107 pub fn jbig2_complete_page(ctx: *mut Jbig2Ctx) -> ::std::os::raw::c_int;
108}