Skip to content

Instantly share code, notes, and snippets.

@stevengj
Created July 15, 2021 12:26
Show Gist options
  • Save stevengj/a2faa46f71bef91b85fa839712f5fcb9 to your computer and use it in GitHub Desktop.
Save stevengj/a2faa46f71bef91b85fa839712f5fcb9 to your computer and use it in GitHub Desktop.
# Automatically generated using Clang.jl
const JPEG_LIB_VERSION = 62
const LIBJPEG_TURBO_VERSION = ".1."
const LIBJPEG_TURBO_VERSION_NUMBER = 2001000
const C_ARITH_CODING_SUPPORTED = 1
const D_ARITH_CODING_SUPPORTED = 1
const MEM_SRCDST_SUPPORTED = 1
const WITH_SIMD = 1
const BITS_IN_JSAMPLE = 8
const HAVE_LOCALE_H = 1
const HAVE_STDDEF_H = 1
const HAVE_STDLIB_H = 1
const NEED_SYS_TYPES_H = 1
const HAVE_UNSIGNED_CHAR = 1
const HAVE_UNSIGNED_SHORT = 1
const MAX_COMPONENTS = 10
# Skipping MacroDefinition: GETJOCTET ( value ) ( value )
const JPEG_MAX_DIMENSION = Int32(65500)
# Skipping MacroDefinition: METHODDEF ( type ) static type
# Skipping MacroDefinition: LOCAL ( type ) static type
# Skipping MacroDefinition: GLOBAL ( type ) type
# Skipping MacroDefinition: EXTERN ( type ) extern type
# Skipping MacroDefinition: JMETHOD ( type , methodname , arglist ) type ( * methodname ) arglist
const FALSE = 0
const TRUE = 1
const JCOEF = Int16
const JOCTET = Cuchar
const UINT8 = Cuchar
const UINT16 = UInt32
const INT16 = Int16
const INT32 = Clong
const JDIMENSION = UInt32
const boolean = Cint
const DCTSIZE = 8
const DCTSIZE2 = 64
const NUM_QUANT_TBLS = 4
const NUM_HUFF_TBLS = 4
const NUM_ARITH_TBLS = 16
const MAX_COMPS_IN_SCAN = 4
const MAX_SAMP_FACTOR = 4
const C_MAX_BLOCKS_IN_MCU = 10
const D_MAX_BLOCKS_IN_MCU = 10
const JCS_EXTENSIONS = 1
const JCS_ALPHA_EXTENSIONS = 1
@cenum J_DCT_METHOD::UInt32 begin
JDCT_ISLOW = 0
JDCT_IFAST = 1
JDCT_FLOAT = 2
end
const JDCT_DEFAULT = JDCT_ISLOW
const JDCT_FASTEST = JDCT_IFAST
# Skipping MacroDefinition: jpeg_common_fields struct jpeg_error_mgr * err ; /* Error handler module */ struct jpeg_memory_mgr * mem ; /* Memory manager module */ struct jpeg_progress_mgr * progress ; /* Progress monitor, or NULL if none */ void * client_data ; /* Available for use by application */ boolean is_decompressor ; /* So common code can tell which is which */ int global_state
const JMSG_LENGTH_MAX = 200
const JMSG_STR_PARM_MAX = 80
const JPOOL_PERMANENT = 0
const JPOOL_IMAGE = 1
const JPOOL_NUMPOOLS = 2
# Skipping MacroDefinition: JPP ( arglist ) arglist
# Skipping MacroDefinition: jpeg_create_compress ( cinfo ) jpeg_CreateCompress ( ( cinfo ) , JPEG_LIB_VERSION , ( size_t ) sizeof ( struct jpeg_compress_struct ) )
# Skipping MacroDefinition: jpeg_create_decompress ( cinfo ) jpeg_CreateDecompress ( ( cinfo ) , JPEG_LIB_VERSION , ( size_t ) sizeof ( struct jpeg_decompress_struct ) )
const JPEG_SUSPENDED = 0
const JPEG_HEADER_OK = 1
const JPEG_HEADER_TABLES_ONLY = 2
const JPEG_REACHED_SOS = 1
const JPEG_REACHED_EOI = 2
const JPEG_ROW_COMPLETED = 3
const JPEG_SCAN_COMPLETED = 4
const JPEG_RST0 = 0xd0
const JPEG_EOI = 0xd9
const JPEG_APP0 = 0xe0
const JPEG_COM = 0xfe
const JSAMPROW = Ptr{JSAMPLE}
const JSAMPARRAY = Ptr{JSAMPROW}
const JSAMPIMAGE = Ptr{JSAMPARRAY}
const JBLOCK = NTuple{64, JCOEF}
const JBLOCKROW = Ptr{JBLOCK}
const JBLOCKARRAY = Ptr{JBLOCKROW}
const JBLOCKIMAGE = Ptr{JBLOCKARRAY}
const JCOEFPTR = Ptr{JCOEF}
struct JQUANT_TBL
quantval::NTuple{64, UINT16}
sent_table::boolean
end
struct JHUFF_TBL
bits::NTuple{17, UINT8}
huffval::NTuple{256, UINT8}
sent_table::boolean
end
struct jpeg_component_info
component_id::Cint
component_index::Cint
h_samp_factor::Cint
v_samp_factor::Cint
quant_tbl_no::Cint
dc_tbl_no::Cint
ac_tbl_no::Cint
width_in_blocks::JDIMENSION
height_in_blocks::JDIMENSION
DCT_scaled_size::Cint
downsampled_width::JDIMENSION
downsampled_height::JDIMENSION
component_needed::boolean
MCU_width::Cint
MCU_height::Cint
MCU_blocks::Cint
MCU_sample_width::Cint
last_col_width::Cint
last_row_height::Cint
quant_table::Ptr{JQUANT_TBL}
dct_table::Ptr{Cvoid}
end
struct jpeg_scan_info
comps_in_scan::Cint
component_index::NTuple{4, Cint}
Ss::Cint
Se::Cint
Ah::Cint
Al::Cint
end
const jpeg_saved_marker_ptr = Ptr{jpeg_marker_struct}
struct jpeg_marker_struct
next::jpeg_saved_marker_ptr
marker::UINT8
original_length::UInt32
data_length::UInt32
data::Ptr{JOCTET}
end
@cenum J_COLOR_SPACE::UInt32 begin
JCS_UNKNOWN = 0
JCS_GRAYSCALE = 1
JCS_RGB = 2
JCS_YCbCr = 3
JCS_CMYK = 4
JCS_YCCK = 5
JCS_EXT_RGB = 6
JCS_EXT_RGBX = 7
JCS_EXT_BGR = 8
JCS_EXT_BGRX = 9
JCS_EXT_XBGR = 10
JCS_EXT_XRGB = 11
JCS_EXT_RGBA = 12
JCS_EXT_BGRA = 13
JCS_EXT_ABGR = 14
JCS_EXT_ARGB = 15
JCS_RGB565 = 16
end
@cenum J_DITHER_MODE::UInt32 begin
JDITHER_NONE = 0
JDITHER_ORDERED = 1
JDITHER_FS = 2
end
struct ANONYMOUS1_msg_parm
s::NTuple{80, UInt8}
end
struct jpeg_error_mgr
error_exit::Ptr{Cvoid}
emit_message::Ptr{Cvoid}
output_message::Ptr{Cvoid}
format_message::Ptr{Cvoid}
reset_error_mgr::Ptr{Cvoid}
msg_code::Cint
msg_parm::ANONYMOUS1_msg_parm
trace_level::Cint
num_warnings::Clong
jpeg_message_table::Ptr{Cstring}
last_jpeg_message::Cint
addon_message_table::Ptr{Cstring}
first_addon_message::Cint
last_addon_message::Cint
end
struct jpeg_memory_mgr
alloc_small::Ptr{Cvoid}
alloc_large::Ptr{Cvoid}
alloc_sarray::Ptr{Cvoid}
alloc_barray::Ptr{Cvoid}
request_virt_sarray::Ptr{Cvoid}
request_virt_barray::Ptr{Cvoid}
realize_virt_arrays::Ptr{Cvoid}
access_virt_sarray::Ptr{Cvoid}
access_virt_barray::Ptr{Cvoid}
free_pool::Ptr{Cvoid}
self_destruct::Ptr{Cvoid}
max_memory_to_use::Clong
max_alloc_chunk::Clong
end
struct jpeg_progress_mgr
progress_monitor::Ptr{Cvoid}
pass_counter::Clong
pass_limit::Clong
completed_passes::Cint
total_passes::Cint
end
struct jpeg_common_struct
err::Ptr{jpeg_error_mgr}
mem::Ptr{jpeg_memory_mgr}
progress::Ptr{jpeg_progress_mgr}
client_data::Ptr{Cvoid}
is_decompressor::boolean
global_state::Cint
end
const j_common_ptr = Ptr{jpeg_common_struct}
struct jpeg_destination_mgr
next_output_byte::Ptr{JOCTET}
free_in_buffer::Cint
init_destination::Ptr{Cvoid}
empty_output_buffer::Ptr{Cvoid}
term_destination::Ptr{Cvoid}
end
struct jpeg_compress_struct
err::Ptr{jpeg_error_mgr}
mem::Ptr{jpeg_memory_mgr}
progress::Ptr{jpeg_progress_mgr}
client_data::Ptr{Cvoid}
is_decompressor::boolean
global_state::Cint
dest::Ptr{jpeg_destination_mgr}
image_width::JDIMENSION
image_height::JDIMENSION
input_components::Cint
in_color_space::J_COLOR_SPACE
input_gamma::Cdouble
data_precision::Cint
num_components::Cint
jpeg_color_space::J_COLOR_SPACE
comp_info::Ptr{jpeg_component_info}
quant_tbl_ptrs::NTuple{4, Ptr{JQUANT_TBL}}
dc_huff_tbl_ptrs::NTuple{4, Ptr{JHUFF_TBL}}
ac_huff_tbl_ptrs::NTuple{4, Ptr{JHUFF_TBL}}
arith_dc_L::NTuple{16, UINT8}
arith_dc_U::NTuple{16, UINT8}
arith_ac_K::NTuple{16, UINT8}
num_scans::Cint
scan_info::Ptr{jpeg_scan_info}
raw_data_in::boolean
arith_code::boolean
optimize_coding::boolean
CCIR601_sampling::boolean
smoothing_factor::Cint
dct_method::J_DCT_METHOD
restart_interval::UInt32
restart_in_rows::Cint
write_JFIF_header::boolean
JFIF_major_version::UINT8
JFIF_minor_version::UINT8
density_unit::UINT8
X_density::UINT16
Y_density::UINT16
write_Adobe_marker::boolean
next_scanline::JDIMENSION
progressive_mode::boolean
max_h_samp_factor::Cint
max_v_samp_factor::Cint
total_iMCU_rows::JDIMENSION
comps_in_scan::Cint
cur_comp_info::NTuple{4, Ptr{jpeg_component_info}}
MCUs_per_row::JDIMENSION
MCU_rows_in_scan::JDIMENSION
blocks_in_MCU::Cint
MCU_membership::NTuple{10, Cint}
Ss::Cint
Se::Cint
Ah::Cint
Al::Cint
master::Ptr{jpeg_comp_master}
main::Ptr{jpeg_c_main_controller}
prep::Ptr{jpeg_c_prep_controller}
coef::Ptr{jpeg_c_coef_controller}
marker::Ptr{jpeg_marker_writer}
cconvert::Ptr{jpeg_color_converter}
downsample::Ptr{jpeg_downsampler}
fdct::Ptr{jpeg_forward_dct}
entropy::Ptr{jpeg_entropy_encoder}
script_space::Ptr{jpeg_scan_info}
script_space_size::Cint
end
const j_compress_ptr = Ptr{jpeg_compress_struct}
struct jpeg_source_mgr
next_input_byte::Ptr{JOCTET}
bytes_in_buffer::Cint
init_source::Ptr{Cvoid}
fill_input_buffer::Ptr{Cvoid}
skip_input_data::Ptr{Cvoid}
resync_to_restart::Ptr{Cvoid}
term_source::Ptr{Cvoid}
end
struct jpeg_decompress_struct
err::Ptr{jpeg_error_mgr}
mem::Ptr{jpeg_memory_mgr}
progress::Ptr{jpeg_progress_mgr}
client_data::Ptr{Cvoid}
is_decompressor::boolean
global_state::Cint
src::Ptr{jpeg_source_mgr}
image_width::JDIMENSION
image_height::JDIMENSION
num_components::Cint
jpeg_color_space::J_COLOR_SPACE
out_color_space::J_COLOR_SPACE
scale_num::UInt32
scale_denom::UInt32
output_gamma::Cdouble
buffered_image::boolean
raw_data_out::boolean
dct_method::J_DCT_METHOD
do_fancy_upsampling::boolean
do_block_smoothing::boolean
quantize_colors::boolean
dither_mode::J_DITHER_MODE
two_pass_quantize::boolean
desired_number_of_colors::Cint
enable_1pass_quant::boolean
enable_external_quant::boolean
enable_2pass_quant::boolean
output_width::JDIMENSION
output_height::JDIMENSION
out_color_components::Cint
output_components::Cint
rec_outbuf_height::Cint
actual_number_of_colors::Cint
colormap::JSAMPARRAY
output_scanline::JDIMENSION
input_scan_number::Cint
input_iMCU_row::JDIMENSION
output_scan_number::Cint
output_iMCU_row::JDIMENSION
coef_bits::Ptr{NTuple{64, Cint}}
quant_tbl_ptrs::NTuple{4, Ptr{JQUANT_TBL}}
dc_huff_tbl_ptrs::NTuple{4, Ptr{JHUFF_TBL}}
ac_huff_tbl_ptrs::NTuple{4, Ptr{JHUFF_TBL}}
data_precision::Cint
comp_info::Ptr{jpeg_component_info}
progressive_mode::boolean
arith_code::boolean
arith_dc_L::NTuple{16, UINT8}
arith_dc_U::NTuple{16, UINT8}
arith_ac_K::NTuple{16, UINT8}
restart_interval::UInt32
saw_JFIF_marker::boolean
JFIF_major_version::UINT8
JFIF_minor_version::UINT8
density_unit::UINT8
X_density::UINT16
Y_density::UINT16
saw_Adobe_marker::boolean
Adobe_transform::UINT8
CCIR601_sampling::boolean
marker_list::jpeg_saved_marker_ptr
max_h_samp_factor::Cint
max_v_samp_factor::Cint
min_DCT_scaled_size::Cint
total_iMCU_rows::JDIMENSION
sample_range_limit::Ptr{JSAMPLE}
comps_in_scan::Cint
cur_comp_info::NTuple{4, Ptr{jpeg_component_info}}
MCUs_per_row::JDIMENSION
MCU_rows_in_scan::JDIMENSION
blocks_in_MCU::Cint
MCU_membership::NTuple{10, Cint}
Ss::Cint
Se::Cint
Ah::Cint
Al::Cint
unread_marker::Cint
master::Ptr{jpeg_decomp_master}
main::Ptr{jpeg_d_main_controller}
coef::Ptr{jpeg_d_coef_controller}
post::Ptr{jpeg_d_post_controller}
inputctl::Ptr{jpeg_input_controller}
marker::Ptr{jpeg_marker_reader}
entropy::Ptr{jpeg_entropy_decoder}
idct::Ptr{jpeg_inverse_dct}
upsample::Ptr{jpeg_upsampler}
cconvert::Ptr{jpeg_color_deconverter}
cquantize::Ptr{jpeg_color_quantizer}
end
const j_decompress_ptr = Ptr{jpeg_decompress_struct}
const jvirt_sarray_control = Cvoid
const jvirt_sarray_ptr = Ptr{jvirt_sarray_control}
const jvirt_barray_control = Cvoid
const jvirt_barray_ptr = Ptr{jvirt_barray_control}
const jpeg_marker_parser_method = Ptr{Cvoid}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment